require('./sourcemap-register.js');module.exports = /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 54479: /***/ ((module) => { "use strict"; module.exports = JSON.parse("{\"nested\":{\"google\":{\"nested\":{\"protobuf\":{\"options\":{\"go_package\":\"google.golang.org/protobuf/types/descriptorpb\",\"java_package\":\"com.google.protobuf\",\"java_outer_classname\":\"DescriptorProtos\",\"csharp_namespace\":\"Google.Protobuf.Reflection\",\"objc_class_prefix\":\"GPB\",\"cc_enable_arenas\":true,\"optimize_for\":\"SPEED\"},\"nested\":{\"Duration\":{\"fields\":{\"seconds\":{\"type\":\"int64\",\"id\":1},\"nanos\":{\"type\":\"int32\",\"id\":2}}},\"FileDescriptorSet\":{\"fields\":{\"file\":{\"rule\":\"repeated\",\"type\":\"FileDescriptorProto\",\"id\":1}}},\"FileDescriptorProto\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"package\":{\"type\":\"string\",\"id\":2},\"dependency\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":3},\"publicDependency\":{\"rule\":\"repeated\",\"type\":\"int32\",\"id\":10,\"options\":{\"packed\":false}},\"weakDependency\":{\"rule\":\"repeated\",\"type\":\"int32\",\"id\":11,\"options\":{\"packed\":false}},\"messageType\":{\"rule\":\"repeated\",\"type\":\"DescriptorProto\",\"id\":4},\"enumType\":{\"rule\":\"repeated\",\"type\":\"EnumDescriptorProto\",\"id\":5},\"service\":{\"rule\":\"repeated\",\"type\":\"ServiceDescriptorProto\",\"id\":6},\"extension\":{\"rule\":\"repeated\",\"type\":\"FieldDescriptorProto\",\"id\":7},\"options\":{\"type\":\"FileOptions\",\"id\":8},\"sourceCodeInfo\":{\"type\":\"SourceCodeInfo\",\"id\":9},\"syntax\":{\"type\":\"string\",\"id\":12}}},\"DescriptorProto\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"field\":{\"rule\":\"repeated\",\"type\":\"FieldDescriptorProto\",\"id\":2},\"extension\":{\"rule\":\"repeated\",\"type\":\"FieldDescriptorProto\",\"id\":6},\"nestedType\":{\"rule\":\"repeated\",\"type\":\"DescriptorProto\",\"id\":3},\"enumType\":{\"rule\":\"repeated\",\"type\":\"EnumDescriptorProto\",\"id\":4},\"extensionRange\":{\"rule\":\"repeated\",\"type\":\"ExtensionRange\",\"id\":5},\"oneofDecl\":{\"rule\":\"repeated\",\"type\":\"OneofDescriptorProto\",\"id\":8},\"options\":{\"type\":\"MessageOptions\",\"id\":7},\"reservedRange\":{\"rule\":\"repeated\",\"type\":\"ReservedRange\",\"id\":9},\"reservedName\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":10}},\"nested\":{\"ExtensionRange\":{\"fields\":{\"start\":{\"type\":\"int32\",\"id\":1},\"end\":{\"type\":\"int32\",\"id\":2},\"options\":{\"type\":\"ExtensionRangeOptions\",\"id\":3}}},\"ReservedRange\":{\"fields\":{\"start\":{\"type\":\"int32\",\"id\":1},\"end\":{\"type\":\"int32\",\"id\":2}}}}},\"ExtensionRangeOptions\":{\"fields\":{\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]]},\"FieldDescriptorProto\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"number\":{\"type\":\"int32\",\"id\":3},\"label\":{\"type\":\"Label\",\"id\":4},\"type\":{\"type\":\"Type\",\"id\":5},\"typeName\":{\"type\":\"string\",\"id\":6},\"extendee\":{\"type\":\"string\",\"id\":2},\"defaultValue\":{\"type\":\"string\",\"id\":7},\"oneofIndex\":{\"type\":\"int32\",\"id\":9},\"jsonName\":{\"type\":\"string\",\"id\":10},\"options\":{\"type\":\"FieldOptions\",\"id\":8},\"proto3Optional\":{\"type\":\"bool\",\"id\":17}},\"nested\":{\"Type\":{\"values\":{\"TYPE_DOUBLE\":1,\"TYPE_FLOAT\":2,\"TYPE_INT64\":3,\"TYPE_UINT64\":4,\"TYPE_INT32\":5,\"TYPE_FIXED64\":6,\"TYPE_FIXED32\":7,\"TYPE_BOOL\":8,\"TYPE_STRING\":9,\"TYPE_GROUP\":10,\"TYPE_MESSAGE\":11,\"TYPE_BYTES\":12,\"TYPE_UINT32\":13,\"TYPE_ENUM\":14,\"TYPE_SFIXED32\":15,\"TYPE_SFIXED64\":16,\"TYPE_SINT32\":17,\"TYPE_SINT64\":18}},\"Label\":{\"values\":{\"LABEL_OPTIONAL\":1,\"LABEL_REQUIRED\":2,\"LABEL_REPEATED\":3}}}},\"OneofDescriptorProto\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"options\":{\"type\":\"OneofOptions\",\"id\":2}}},\"EnumDescriptorProto\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"value\":{\"rule\":\"repeated\",\"type\":\"EnumValueDescriptorProto\",\"id\":2},\"options\":{\"type\":\"EnumOptions\",\"id\":3},\"reservedRange\":{\"rule\":\"repeated\",\"type\":\"EnumReservedRange\",\"id\":4},\"reservedName\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":5}},\"nested\":{\"EnumReservedRange\":{\"fields\":{\"start\":{\"type\":\"int32\",\"id\":1},\"end\":{\"type\":\"int32\",\"id\":2}}}}},\"EnumValueDescriptorProto\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"number\":{\"type\":\"int32\",\"id\":2},\"options\":{\"type\":\"EnumValueOptions\",\"id\":3}}},\"ServiceDescriptorProto\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"method\":{\"rule\":\"repeated\",\"type\":\"MethodDescriptorProto\",\"id\":2},\"options\":{\"type\":\"ServiceOptions\",\"id\":3}}},\"MethodDescriptorProto\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"inputType\":{\"type\":\"string\",\"id\":2},\"outputType\":{\"type\":\"string\",\"id\":3},\"options\":{\"type\":\"MethodOptions\",\"id\":4},\"clientStreaming\":{\"type\":\"bool\",\"id\":5,\"options\":{\"default\":false}},\"serverStreaming\":{\"type\":\"bool\",\"id\":6,\"options\":{\"default\":false}}}},\"FileOptions\":{\"fields\":{\"javaPackage\":{\"type\":\"string\",\"id\":1},\"javaOuterClassname\":{\"type\":\"string\",\"id\":8},\"javaMultipleFiles\":{\"type\":\"bool\",\"id\":10,\"options\":{\"default\":false}},\"javaGenerateEqualsAndHash\":{\"type\":\"bool\",\"id\":20,\"options\":{\"deprecated\":true}},\"javaStringCheckUtf8\":{\"type\":\"bool\",\"id\":27,\"options\":{\"default\":false}},\"optimizeFor\":{\"type\":\"OptimizeMode\",\"id\":9,\"options\":{\"default\":\"SPEED\"}},\"goPackage\":{\"type\":\"string\",\"id\":11},\"ccGenericServices\":{\"type\":\"bool\",\"id\":16,\"options\":{\"default\":false}},\"javaGenericServices\":{\"type\":\"bool\",\"id\":17,\"options\":{\"default\":false}},\"pyGenericServices\":{\"type\":\"bool\",\"id\":18,\"options\":{\"default\":false}},\"phpGenericServices\":{\"type\":\"bool\",\"id\":42,\"options\":{\"default\":false}},\"deprecated\":{\"type\":\"bool\",\"id\":23,\"options\":{\"default\":false}},\"ccEnableArenas\":{\"type\":\"bool\",\"id\":31,\"options\":{\"default\":true}},\"objcClassPrefix\":{\"type\":\"string\",\"id\":36},\"csharpNamespace\":{\"type\":\"string\",\"id\":37},\"swiftPrefix\":{\"type\":\"string\",\"id\":39},\"phpClassPrefix\":{\"type\":\"string\",\"id\":40},\"phpNamespace\":{\"type\":\"string\",\"id\":41},\"phpMetadataNamespace\":{\"type\":\"string\",\"id\":44},\"rubyPackage\":{\"type\":\"string\",\"id\":45},\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]],\"reserved\":[[38,38]],\"nested\":{\"OptimizeMode\":{\"values\":{\"SPEED\":1,\"CODE_SIZE\":2,\"LITE_RUNTIME\":3}}}},\"MessageOptions\":{\"fields\":{\"messageSetWireFormat\":{\"type\":\"bool\",\"id\":1,\"options\":{\"default\":false}},\"noStandardDescriptorAccessor\":{\"type\":\"bool\",\"id\":2,\"options\":{\"default\":false}},\"deprecated\":{\"type\":\"bool\",\"id\":3,\"options\":{\"default\":false}},\"mapEntry\":{\"type\":\"bool\",\"id\":7},\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]],\"reserved\":[[4,4],[5,5],[6,6],[8,8],[9,9]]},\"FieldOptions\":{\"fields\":{\"ctype\":{\"type\":\"CType\",\"id\":1,\"options\":{\"default\":\"STRING\"}},\"packed\":{\"type\":\"bool\",\"id\":2},\"jstype\":{\"type\":\"JSType\",\"id\":6,\"options\":{\"default\":\"JS_NORMAL\"}},\"lazy\":{\"type\":\"bool\",\"id\":5,\"options\":{\"default\":false}},\"deprecated\":{\"type\":\"bool\",\"id\":3,\"options\":{\"default\":false}},\"weak\":{\"type\":\"bool\",\"id\":10,\"options\":{\"default\":false}},\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]],\"reserved\":[[4,4]],\"nested\":{\"CType\":{\"values\":{\"STRING\":0,\"CORD\":1,\"STRING_PIECE\":2}},\"JSType\":{\"values\":{\"JS_NORMAL\":0,\"JS_STRING\":1,\"JS_NUMBER\":2}}}},\"OneofOptions\":{\"fields\":{\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]]},\"EnumOptions\":{\"fields\":{\"allowAlias\":{\"type\":\"bool\",\"id\":2},\"deprecated\":{\"type\":\"bool\",\"id\":3,\"options\":{\"default\":false}},\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]],\"reserved\":[[5,5]]},\"EnumValueOptions\":{\"fields\":{\"deprecated\":{\"type\":\"bool\",\"id\":1,\"options\":{\"default\":false}},\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]]},\"ServiceOptions\":{\"fields\":{\"deprecated\":{\"type\":\"bool\",\"id\":33,\"options\":{\"default\":false}},\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]]},\"MethodOptions\":{\"fields\":{\"deprecated\":{\"type\":\"bool\",\"id\":33,\"options\":{\"default\":false}},\"idempotencyLevel\":{\"type\":\"IdempotencyLevel\",\"id\":34,\"options\":{\"default\":\"IDEMPOTENCY_UNKNOWN\"}},\"uninterpretedOption\":{\"rule\":\"repeated\",\"type\":\"UninterpretedOption\",\"id\":999}},\"extensions\":[[1000,536870911]],\"nested\":{\"IdempotencyLevel\":{\"values\":{\"IDEMPOTENCY_UNKNOWN\":0,\"NO_SIDE_EFFECTS\":1,\"IDEMPOTENT\":2}}}},\"UninterpretedOption\":{\"fields\":{\"name\":{\"rule\":\"repeated\",\"type\":\"NamePart\",\"id\":2},\"identifierValue\":{\"type\":\"string\",\"id\":3},\"positiveIntValue\":{\"type\":\"uint64\",\"id\":4},\"negativeIntValue\":{\"type\":\"int64\",\"id\":5},\"doubleValue\":{\"type\":\"double\",\"id\":6},\"stringValue\":{\"type\":\"bytes\",\"id\":7},\"aggregateValue\":{\"type\":\"string\",\"id\":8}},\"nested\":{\"NamePart\":{\"fields\":{\"namePart\":{\"rule\":\"required\",\"type\":\"string\",\"id\":1},\"isExtension\":{\"rule\":\"required\",\"type\":\"bool\",\"id\":2}}}}},\"SourceCodeInfo\":{\"fields\":{\"location\":{\"rule\":\"repeated\",\"type\":\"Location\",\"id\":1}},\"nested\":{\"Location\":{\"fields\":{\"path\":{\"rule\":\"repeated\",\"type\":\"int32\",\"id\":1},\"span\":{\"rule\":\"repeated\",\"type\":\"int32\",\"id\":2},\"leadingComments\":{\"type\":\"string\",\"id\":3},\"trailingComments\":{\"type\":\"string\",\"id\":4},\"leadingDetachedComments\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":6}}}}},\"GeneratedCodeInfo\":{\"fields\":{\"annotation\":{\"rule\":\"repeated\",\"type\":\"Annotation\",\"id\":1}},\"nested\":{\"Annotation\":{\"fields\":{\"path\":{\"rule\":\"repeated\",\"type\":\"int32\",\"id\":1},\"sourceFile\":{\"type\":\"string\",\"id\":2},\"begin\":{\"type\":\"int32\",\"id\":3},\"end\":{\"type\":\"int32\",\"id\":4}}}}},\"Struct\":{\"fields\":{\"fields\":{\"keyType\":\"string\",\"type\":\"Value\",\"id\":1}}},\"Value\":{\"oneofs\":{\"kind\":{\"oneof\":[\"nullValue\",\"numberValue\",\"stringValue\",\"boolValue\",\"structValue\",\"listValue\"]}},\"fields\":{\"nullValue\":{\"type\":\"NullValue\",\"id\":1},\"numberValue\":{\"type\":\"double\",\"id\":2},\"stringValue\":{\"type\":\"string\",\"id\":3},\"boolValue\":{\"type\":\"bool\",\"id\":4},\"structValue\":{\"type\":\"Struct\",\"id\":5},\"listValue\":{\"type\":\"ListValue\",\"id\":6}}},\"NullValue\":{\"values\":{\"NULL_VALUE\":0}},\"ListValue\":{\"fields\":{\"values\":{\"rule\":\"repeated\",\"type\":\"Value\",\"id\":1}}},\"Any\":{\"fields\":{\"type_url\":{\"type\":\"string\",\"id\":1},\"value\":{\"type\":\"bytes\",\"id\":2}}},\"Timestamp\":{\"fields\":{\"seconds\":{\"type\":\"int64\",\"id\":1},\"nanos\":{\"type\":\"int32\",\"id\":2}}},\"Empty\":{\"fields\":{}},\"FieldMask\":{\"fields\":{\"paths\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":1}}}}},\"logging\":{\"nested\":{\"type\":{\"options\":{\"csharp_namespace\":\"Google.Cloud.Logging.Type\",\"go_package\":\"google.golang.org/genproto/googleapis/logging/type;ltype\",\"java_multiple_files\":true,\"java_outer_classname\":\"LogSeverityProto\",\"java_package\":\"com.google.logging.type\",\"php_namespace\":\"Google\\\\Cloud\\\\Logging\\\\Type\"},\"nested\":{\"HttpRequest\":{\"fields\":{\"requestMethod\":{\"type\":\"string\",\"id\":1},\"requestUrl\":{\"type\":\"string\",\"id\":2},\"requestSize\":{\"type\":\"int64\",\"id\":3},\"status\":{\"type\":\"int32\",\"id\":4},\"responseSize\":{\"type\":\"int64\",\"id\":5},\"userAgent\":{\"type\":\"string\",\"id\":6},\"remoteIp\":{\"type\":\"string\",\"id\":7},\"serverIp\":{\"type\":\"string\",\"id\":13},\"referer\":{\"type\":\"string\",\"id\":8},\"latency\":{\"type\":\"google.protobuf.Duration\",\"id\":14},\"cacheLookup\":{\"type\":\"bool\",\"id\":11},\"cacheHit\":{\"type\":\"bool\",\"id\":9},\"cacheValidatedWithOriginServer\":{\"type\":\"bool\",\"id\":10},\"cacheFillBytes\":{\"type\":\"int64\",\"id\":12},\"protocol\":{\"type\":\"string\",\"id\":15}}},\"LogSeverity\":{\"values\":{\"DEFAULT\":0,\"DEBUG\":100,\"INFO\":200,\"NOTICE\":300,\"WARNING\":400,\"ERROR\":500,\"CRITICAL\":600,\"ALERT\":700,\"EMERGENCY\":800}}}},\"v2\":{\"options\":{\"cc_enable_arenas\":true,\"csharp_namespace\":\"Google.Cloud.Logging.V2\",\"go_package\":\"google.golang.org/genproto/googleapis/logging/v2;logging\",\"java_multiple_files\":true,\"java_outer_classname\":\"LoggingMetricsProto\",\"java_package\":\"com.google.logging.v2\",\"php_namespace\":\"Google\\\\Cloud\\\\Logging\\\\V2\",\"ruby_package\":\"Google::Cloud::Logging::V2\",\"(google.api.resource_definition).type\":\"logging.googleapis.com/BillingAccountLocation\",\"(google.api.resource_definition).pattern\":\"billingAccounts/{billing_account}/locations/{location}\"},\"nested\":{\"LogEntry\":{\"options\":{\"(google.api.resource).type\":\"logging.googleapis.com/Log\",\"(google.api.resource).pattern\":\"billingAccounts/{billing_account}/logs/{log}\",\"(google.api.resource).name_field\":\"log_name\"},\"oneofs\":{\"payload\":{\"oneof\":[\"protoPayload\",\"textPayload\",\"jsonPayload\"]}},\"fields\":{\"logName\":{\"type\":\"string\",\"id\":12,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"resource\":{\"type\":\"google.api.MonitoredResource\",\"id\":8,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"protoPayload\":{\"type\":\"google.protobuf.Any\",\"id\":2},\"textPayload\":{\"type\":\"string\",\"id\":3},\"jsonPayload\":{\"type\":\"google.protobuf.Struct\",\"id\":6},\"timestamp\":{\"type\":\"google.protobuf.Timestamp\",\"id\":9,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"receiveTimestamp\":{\"type\":\"google.protobuf.Timestamp\",\"id\":24,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"severity\":{\"type\":\"google.logging.type.LogSeverity\",\"id\":10,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"insertId\":{\"type\":\"string\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"httpRequest\":{\"type\":\"google.logging.type.HttpRequest\",\"id\":7,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"labels\":{\"keyType\":\"string\",\"type\":\"string\",\"id\":11,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"operation\":{\"type\":\"LogEntryOperation\",\"id\":15,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"trace\":{\"type\":\"string\",\"id\":22,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"spanId\":{\"type\":\"string\",\"id\":27,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"traceSampled\":{\"type\":\"bool\",\"id\":30,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"sourceLocation\":{\"type\":\"LogEntrySourceLocation\",\"id\":23,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"LogEntryOperation\":{\"fields\":{\"id\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"producer\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"first\":{\"type\":\"bool\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"last\":{\"type\":\"bool\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"LogEntrySourceLocation\":{\"fields\":{\"file\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"line\":{\"type\":\"int64\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"function\":{\"type\":\"string\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"LoggingServiceV2\":{\"options\":{\"(google.api.default_host)\":\"logging.googleapis.com\",\"(google.api.oauth_scopes)\":\"https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read,https://www.googleapis.com/auth/logging.write\"},\"methods\":{\"DeleteLog\":{\"requestType\":\"DeleteLogRequest\",\"responseType\":\"google.protobuf.Empty\",\"options\":{\"(google.api.http).delete\":\"/v2/{log_name=projects/*/logs/*}\",\"(google.api.http).additional_bindings.delete\":\"/v2/{log_name=billingAccounts/*/logs/*}\",\"(google.api.method_signature)\":\"log_name\"},\"parsedOptions\":[{\"(google.api.http)\":{\"delete\":\"/v2/{log_name=projects/*/logs/*}\",\"additional_bindings\":[{\"delete\":\"/v2/{log_name=*/*/logs/*}\"},{\"delete\":\"/v2/{log_name=organizations/*/logs/*}\"},{\"delete\":\"/v2/{log_name=folders/*/logs/*}\"},{\"delete\":\"/v2/{log_name=billingAccounts/*/logs/*}\"}]}},{\"(google.api.method_signature)\":\"log_name\"}]},\"WriteLogEntries\":{\"requestType\":\"WriteLogEntriesRequest\",\"responseType\":\"WriteLogEntriesResponse\",\"options\":{\"(google.api.http).post\":\"/v2/entries:write\",\"(google.api.http).body\":\"*\",\"(google.api.method_signature)\":\"log_name,resource,labels,entries\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/entries:write\",\"body\":\"*\"}},{\"(google.api.method_signature)\":\"log_name,resource,labels,entries\"}]},\"ListLogEntries\":{\"requestType\":\"ListLogEntriesRequest\",\"responseType\":\"ListLogEntriesResponse\",\"options\":{\"(google.api.http).post\":\"/v2/entries:list\",\"(google.api.http).body\":\"*\",\"(google.api.method_signature)\":\"resource_names,filter,order_by\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/entries:list\",\"body\":\"*\"}},{\"(google.api.method_signature)\":\"resource_names,filter,order_by\"}]},\"ListMonitoredResourceDescriptors\":{\"requestType\":\"ListMonitoredResourceDescriptorsRequest\",\"responseType\":\"ListMonitoredResourceDescriptorsResponse\",\"options\":{\"(google.api.http).get\":\"/v2/monitoredResourceDescriptors\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/monitoredResourceDescriptors\"}}]},\"ListLogs\":{\"requestType\":\"ListLogsRequest\",\"responseType\":\"ListLogsResponse\",\"options\":{\"(google.api.http).get\":\"/v2/{parent=*/*}/logs\",\"(google.api.http).additional_bindings.get\":\"/v2/{parent=billingAccounts/*}/logs\",\"(google.api.method_signature)\":\"parent\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{parent=*/*}/logs\",\"additional_bindings\":[{\"get\":\"/v2/{parent=projects/*}/logs\"},{\"get\":\"/v2/{parent=organizations/*}/logs\"},{\"get\":\"/v2/{parent=folders/*}/logs\"},{\"get\":\"/v2/{parent=billingAccounts/*}/logs\"}]}},{\"(google.api.method_signature)\":\"parent\"}]},\"TailLogEntries\":{\"requestType\":\"TailLogEntriesRequest\",\"requestStream\":true,\"responseType\":\"TailLogEntriesResponse\",\"responseStream\":true,\"options\":{\"(google.api.http).post\":\"/v2/entries:tail\",\"(google.api.http).body\":\"*\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/entries:tail\",\"body\":\"*\"}}]}}},\"DeleteLogRequest\":{\"fields\":{\"logName\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/Log\"}}}},\"WriteLogEntriesRequest\":{\"fields\":{\"logName\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/Log\"}},\"resource\":{\"type\":\"google.api.MonitoredResource\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"labels\":{\"keyType\":\"string\",\"type\":\"string\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"entries\":{\"rule\":\"repeated\",\"type\":\"LogEntry\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"partialSuccess\":{\"type\":\"bool\",\"id\":5,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"dryRun\":{\"type\":\"bool\",\"id\":6,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"WriteLogEntriesResponse\":{\"fields\":{}},\"WriteLogEntriesPartialErrors\":{\"fields\":{\"logEntryErrors\":{\"keyType\":\"int32\",\"type\":\"google.rpc.Status\",\"id\":1}}},\"ListLogEntriesRequest\":{\"fields\":{\"resourceNames\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":8,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/Log\"}},\"filter\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"orderBy\":{\"type\":\"string\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageSize\":{\"type\":\"int32\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageToken\":{\"type\":\"string\",\"id\":5,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"ListLogEntriesResponse\":{\"fields\":{\"entries\":{\"rule\":\"repeated\",\"type\":\"LogEntry\",\"id\":1},\"nextPageToken\":{\"type\":\"string\",\"id\":2}}},\"ListMonitoredResourceDescriptorsRequest\":{\"fields\":{\"pageSize\":{\"type\":\"int32\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageToken\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"ListMonitoredResourceDescriptorsResponse\":{\"fields\":{\"resourceDescriptors\":{\"rule\":\"repeated\",\"type\":\"google.api.MonitoredResourceDescriptor\",\"id\":1},\"nextPageToken\":{\"type\":\"string\",\"id\":2}}},\"ListLogsRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/Log\"}},\"pageSize\":{\"type\":\"int32\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageToken\":{\"type\":\"string\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"resourceNames\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":8,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"ListLogsResponse\":{\"fields\":{\"logNames\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":3},\"nextPageToken\":{\"type\":\"string\",\"id\":2}}},\"TailLogEntriesRequest\":{\"fields\":{\"resourceNames\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"filter\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"bufferWindow\":{\"type\":\"google.protobuf.Duration\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"TailLogEntriesResponse\":{\"fields\":{\"entries\":{\"rule\":\"repeated\",\"type\":\"LogEntry\",\"id\":1},\"suppressionInfo\":{\"rule\":\"repeated\",\"type\":\"SuppressionInfo\",\"id\":2}},\"nested\":{\"SuppressionInfo\":{\"fields\":{\"reason\":{\"type\":\"Reason\",\"id\":1},\"suppressedCount\":{\"type\":\"int32\",\"id\":2}},\"nested\":{\"Reason\":{\"values\":{\"REASON_UNSPECIFIED\":0,\"RATE_LIMIT\":1,\"NOT_CONSUMED\":2}}}}}},\"ConfigServiceV2\":{\"options\":{\"(google.api.default_host)\":\"logging.googleapis.com\",\"(google.api.oauth_scopes)\":\"https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read\"},\"methods\":{\"ListBuckets\":{\"requestType\":\"ListBucketsRequest\",\"responseType\":\"ListBucketsResponse\",\"options\":{\"(google.api.http).get\":\"/v2/{parent=*/*/locations/*}/buckets\",\"(google.api.http).additional_bindings.get\":\"/v2/{parent=billingAccounts/*/locations/*}/buckets\",\"(google.api.method_signature)\":\"parent\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{parent=*/*/locations/*}/buckets\",\"additional_bindings\":[{\"get\":\"/v2/{parent=projects/*/locations/*}/buckets\"},{\"get\":\"/v2/{parent=organizations/*/locations/*}/buckets\"},{\"get\":\"/v2/{parent=folders/*/locations/*}/buckets\"},{\"get\":\"/v2/{parent=billingAccounts/*/locations/*}/buckets\"}]}},{\"(google.api.method_signature)\":\"parent\"}]},\"GetBucket\":{\"requestType\":\"GetBucketRequest\",\"responseType\":\"LogBucket\",\"options\":{\"(google.api.http).get\":\"/v2/{name=*/*/locations/*/buckets/*}\",\"(google.api.http).additional_bindings.get\":\"/v2/{name=billingAccounts/*/buckets/*}\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{name=*/*/locations/*/buckets/*}\",\"additional_bindings\":[{\"get\":\"/v2/{name=projects/*/locations/*/buckets/*}\"},{\"get\":\"/v2/{name=organizations/*/locations/*/buckets/*}\"},{\"get\":\"/v2/{name=folders/*/locations/*/buckets/*}\"},{\"get\":\"/v2/{name=billingAccounts/*/buckets/*}\"}]}}]},\"CreateBucket\":{\"requestType\":\"CreateBucketRequest\",\"responseType\":\"LogBucket\",\"options\":{\"(google.api.http).post\":\"/v2/{parent=*/*/locations/*}/buckets\",\"(google.api.http).body\":\"bucket\",\"(google.api.http).additional_bindings.post\":\"/v2/{parent=billingAccounts/*/locations/*}/buckets\",\"(google.api.http).additional_bindings.body\":\"bucket\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/{parent=*/*/locations/*}/buckets\",\"body\":\"bucket\",\"additional_bindings\":[{\"post\":\"/v2/{parent=projects/*/locations/*}/buckets\",\"body\":\"bucket\"},{\"post\":\"/v2/{parent=organizations/*/locations/*}/buckets\",\"body\":\"bucket\"},{\"post\":\"/v2/{parent=folders/*/locations/*}/buckets\",\"body\":\"bucket\"},{\"post\":\"/v2/{parent=billingAccounts/*/locations/*}/buckets\",\"body\":\"bucket\"}]}}]},\"UpdateBucket\":{\"requestType\":\"UpdateBucketRequest\",\"responseType\":\"LogBucket\",\"options\":{\"(google.api.http).patch\":\"/v2/{name=*/*/locations/*/buckets/*}\",\"(google.api.http).body\":\"bucket\",\"(google.api.http).additional_bindings.patch\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*}\",\"(google.api.http).additional_bindings.body\":\"bucket\"},\"parsedOptions\":[{\"(google.api.http)\":{\"patch\":\"/v2/{name=*/*/locations/*/buckets/*}\",\"body\":\"bucket\",\"additional_bindings\":[{\"patch\":\"/v2/{name=projects/*/locations/*/buckets/*}\",\"body\":\"bucket\"},{\"patch\":\"/v2/{name=organizations/*/locations/*/buckets/*}\",\"body\":\"bucket\"},{\"patch\":\"/v2/{name=folders/*/locations/*/buckets/*}\",\"body\":\"bucket\"},{\"patch\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*}\",\"body\":\"bucket\"}]}}]},\"DeleteBucket\":{\"requestType\":\"DeleteBucketRequest\",\"responseType\":\"google.protobuf.Empty\",\"options\":{\"(google.api.http).delete\":\"/v2/{name=*/*/locations/*/buckets/*}\",\"(google.api.http).additional_bindings.delete\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*}\"},\"parsedOptions\":[{\"(google.api.http)\":{\"delete\":\"/v2/{name=*/*/locations/*/buckets/*}\",\"additional_bindings\":[{\"delete\":\"/v2/{name=projects/*/locations/*/buckets/*}\"},{\"delete\":\"/v2/{name=organizations/*/locations/*/buckets/*}\"},{\"delete\":\"/v2/{name=folders/*/locations/*/buckets/*}\"},{\"delete\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*}\"}]}}]},\"UndeleteBucket\":{\"requestType\":\"UndeleteBucketRequest\",\"responseType\":\"google.protobuf.Empty\",\"options\":{\"(google.api.http).post\":\"/v2/{name=*/*/locations/*/buckets/*}:undelete\",\"(google.api.http).body\":\"*\",\"(google.api.http).additional_bindings.post\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete\",\"(google.api.http).additional_bindings.body\":\"*\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/{name=*/*/locations/*/buckets/*}:undelete\",\"body\":\"*\",\"additional_bindings\":[{\"post\":\"/v2/{name=projects/*/locations/*/buckets/*}:undelete\",\"body\":\"*\"},{\"post\":\"/v2/{name=organizations/*/locations/*/buckets/*}:undelete\",\"body\":\"*\"},{\"post\":\"/v2/{name=folders/*/locations/*/buckets/*}:undelete\",\"body\":\"*\"},{\"post\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete\",\"body\":\"*\"}]}}]},\"ListViews\":{\"requestType\":\"ListViewsRequest\",\"responseType\":\"ListViewsResponse\",\"options\":{\"(google.api.http).get\":\"/v2/{parent=*/*/locations/*/buckets/*}/views\",\"(google.api.http).additional_bindings.get\":\"/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views\",\"(google.api.method_signature)\":\"parent\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{parent=*/*/locations/*/buckets/*}/views\",\"additional_bindings\":[{\"get\":\"/v2/{parent=projects/*/locations/*/buckets/*}/views\"},{\"get\":\"/v2/{parent=organizations/*/locations/*/buckets/*}/views\"},{\"get\":\"/v2/{parent=folders/*/locations/*/buckets/*}/views\"},{\"get\":\"/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views\"}]}},{\"(google.api.method_signature)\":\"parent\"}]},\"GetView\":{\"requestType\":\"GetViewRequest\",\"responseType\":\"LogView\",\"options\":{\"(google.api.http).get\":\"/v2/{name=*/*/locations/*/buckets/*/views/*}\",\"(google.api.http).additional_bindings.get\":\"/v2/{name=billingAccounts/*/buckets/*/views/*}\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{name=*/*/locations/*/buckets/*/views/*}\",\"additional_bindings\":[{\"get\":\"/v2/{name=projects/*/locations/*/buckets/*/views/*}\"},{\"get\":\"/v2/{name=organizations/*/locations/*/buckets/*/views/*}\"},{\"get\":\"/v2/{name=folders/*/locations/*/buckets/*/views/*}\"},{\"get\":\"/v2/{name=billingAccounts/*/buckets/*/views/*}\"}]}}]},\"CreateView\":{\"requestType\":\"CreateViewRequest\",\"responseType\":\"LogView\",\"options\":{\"(google.api.http).post\":\"/v2/{parent=*/*/locations/*/buckets/*}/views\",\"(google.api.http).body\":\"view\",\"(google.api.http).additional_bindings.post\":\"/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views\",\"(google.api.http).additional_bindings.body\":\"view\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/{parent=*/*/locations/*/buckets/*}/views\",\"body\":\"view\",\"additional_bindings\":[{\"post\":\"/v2/{parent=projects/*/locations/*/buckets/*}/views\",\"body\":\"view\"},{\"post\":\"/v2/{parent=organizations/*/locations/*/buckets/*}/views\",\"body\":\"view\"},{\"post\":\"/v2/{parent=folders/*/locations/*/buckets/*}/views\",\"body\":\"view\"},{\"post\":\"/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views\",\"body\":\"view\"}]}}]},\"UpdateView\":{\"requestType\":\"UpdateViewRequest\",\"responseType\":\"LogView\",\"options\":{\"(google.api.http).patch\":\"/v2/{name=*/*/locations/*/buckets/*/views/*}\",\"(google.api.http).body\":\"view\",\"(google.api.http).additional_bindings.patch\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}\",\"(google.api.http).additional_bindings.body\":\"view\"},\"parsedOptions\":[{\"(google.api.http)\":{\"patch\":\"/v2/{name=*/*/locations/*/buckets/*/views/*}\",\"body\":\"view\",\"additional_bindings\":[{\"patch\":\"/v2/{name=projects/*/locations/*/buckets/*/views/*}\",\"body\":\"view\"},{\"patch\":\"/v2/{name=organizations/*/locations/*/buckets/*/views/*}\",\"body\":\"view\"},{\"patch\":\"/v2/{name=folders/*/locations/*/buckets/*/views/*}\",\"body\":\"view\"},{\"patch\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}\",\"body\":\"view\"}]}}]},\"DeleteView\":{\"requestType\":\"DeleteViewRequest\",\"responseType\":\"google.protobuf.Empty\",\"options\":{\"(google.api.http).delete\":\"/v2/{name=*/*/locations/*/buckets/*/views/*}\",\"(google.api.http).additional_bindings.delete\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}\"},\"parsedOptions\":[{\"(google.api.http)\":{\"delete\":\"/v2/{name=*/*/locations/*/buckets/*/views/*}\",\"additional_bindings\":[{\"delete\":\"/v2/{name=projects/*/locations/*/buckets/*/views/*}\"},{\"delete\":\"/v2/{name=organizations/*/locations/*/buckets/*/views/*}\"},{\"delete\":\"/v2/{name=folders/*/locations/*/buckets/*/views/*}\"},{\"delete\":\"/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}\"}]}}]},\"ListSinks\":{\"requestType\":\"ListSinksRequest\",\"responseType\":\"ListSinksResponse\",\"options\":{\"(google.api.http).get\":\"/v2/{parent=*/*}/sinks\",\"(google.api.http).additional_bindings.get\":\"/v2/{parent=billingAccounts/*}/sinks\",\"(google.api.method_signature)\":\"parent\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{parent=*/*}/sinks\",\"additional_bindings\":[{\"get\":\"/v2/{parent=projects/*}/sinks\"},{\"get\":\"/v2/{parent=organizations/*}/sinks\"},{\"get\":\"/v2/{parent=folders/*}/sinks\"},{\"get\":\"/v2/{parent=billingAccounts/*}/sinks\"}]}},{\"(google.api.method_signature)\":\"parent\"}]},\"GetSink\":{\"requestType\":\"GetSinkRequest\",\"responseType\":\"LogSink\",\"options\":{\"(google.api.http).get\":\"/v2/{sink_name=*/*/sinks/*}\",\"(google.api.http).additional_bindings.get\":\"/v2/{sink_name=billingAccounts/*/sinks/*}\",\"(google.api.method_signature)\":\"sink_name\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{sink_name=*/*/sinks/*}\",\"additional_bindings\":[{\"get\":\"/v2/{sink_name=projects/*/sinks/*}\"},{\"get\":\"/v2/{sink_name=organizations/*/sinks/*}\"},{\"get\":\"/v2/{sink_name=folders/*/sinks/*}\"},{\"get\":\"/v2/{sink_name=billingAccounts/*/sinks/*}\"}]}},{\"(google.api.method_signature)\":\"sink_name\"}]},\"CreateSink\":{\"requestType\":\"CreateSinkRequest\",\"responseType\":\"LogSink\",\"options\":{\"(google.api.http).post\":\"/v2/{parent=*/*}/sinks\",\"(google.api.http).body\":\"sink\",\"(google.api.http).additional_bindings.post\":\"/v2/{parent=billingAccounts/*}/sinks\",\"(google.api.http).additional_bindings.body\":\"sink\",\"(google.api.method_signature)\":\"parent,sink\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/{parent=*/*}/sinks\",\"body\":\"sink\",\"additional_bindings\":[{\"post\":\"/v2/{parent=projects/*}/sinks\",\"body\":\"sink\"},{\"post\":\"/v2/{parent=organizations/*}/sinks\",\"body\":\"sink\"},{\"post\":\"/v2/{parent=folders/*}/sinks\",\"body\":\"sink\"},{\"post\":\"/v2/{parent=billingAccounts/*}/sinks\",\"body\":\"sink\"}]}},{\"(google.api.method_signature)\":\"parent,sink\"}]},\"UpdateSink\":{\"requestType\":\"UpdateSinkRequest\",\"responseType\":\"LogSink\",\"options\":{\"(google.api.http).put\":\"/v2/{sink_name=*/*/sinks/*}\",\"(google.api.http).body\":\"sink\",\"(google.api.http).additional_bindings.put\":\"/v2/{sink_name=billingAccounts/*/sinks/*}\",\"(google.api.http).additional_bindings.body\":\"sink\",\"(google.api.http).additional_bindings.patch\":\"/v2/{sink_name=billingAccounts/*/sinks/*}\",\"(google.api.method_signature)\":\"sink_name,sink\"},\"parsedOptions\":[{\"(google.api.http)\":{\"put\":\"/v2/{sink_name=*/*/sinks/*}\",\"body\":\"sink\",\"additional_bindings\":[{\"put\":\"/v2/{sink_name=projects/*/sinks/*}\",\"body\":\"sink\"},{\"put\":\"/v2/{sink_name=organizations/*/sinks/*}\",\"body\":\"sink\"},{\"put\":\"/v2/{sink_name=folders/*/sinks/*}\",\"body\":\"sink\"},{\"put\":\"/v2/{sink_name=billingAccounts/*/sinks/*}\",\"body\":\"sink\"},{\"patch\":\"/v2/{sink_name=projects/*/sinks/*}\",\"body\":\"sink\"},{\"patch\":\"/v2/{sink_name=organizations/*/sinks/*}\",\"body\":\"sink\"},{\"patch\":\"/v2/{sink_name=folders/*/sinks/*}\",\"body\":\"sink\"},{\"patch\":\"/v2/{sink_name=billingAccounts/*/sinks/*}\",\"body\":\"sink\"}]}},{\"(google.api.method_signature)\":\"sink_name,sink,update_mask\"},{\"(google.api.method_signature)\":\"sink_name,sink\"}]},\"DeleteSink\":{\"requestType\":\"DeleteSinkRequest\",\"responseType\":\"google.protobuf.Empty\",\"options\":{\"(google.api.http).delete\":\"/v2/{sink_name=*/*/sinks/*}\",\"(google.api.http).additional_bindings.delete\":\"/v2/{sink_name=billingAccounts/*/sinks/*}\",\"(google.api.method_signature)\":\"sink_name\"},\"parsedOptions\":[{\"(google.api.http)\":{\"delete\":\"/v2/{sink_name=*/*/sinks/*}\",\"additional_bindings\":[{\"delete\":\"/v2/{sink_name=projects/*/sinks/*}\"},{\"delete\":\"/v2/{sink_name=organizations/*/sinks/*}\"},{\"delete\":\"/v2/{sink_name=folders/*/sinks/*}\"},{\"delete\":\"/v2/{sink_name=billingAccounts/*/sinks/*}\"}]}},{\"(google.api.method_signature)\":\"sink_name\"}]},\"ListExclusions\":{\"requestType\":\"ListExclusionsRequest\",\"responseType\":\"ListExclusionsResponse\",\"options\":{\"(google.api.http).get\":\"/v2/{parent=*/*}/exclusions\",\"(google.api.http).additional_bindings.get\":\"/v2/{parent=billingAccounts/*}/exclusions\",\"(google.api.method_signature)\":\"parent\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{parent=*/*}/exclusions\",\"additional_bindings\":[{\"get\":\"/v2/{parent=projects/*}/exclusions\"},{\"get\":\"/v2/{parent=organizations/*}/exclusions\"},{\"get\":\"/v2/{parent=folders/*}/exclusions\"},{\"get\":\"/v2/{parent=billingAccounts/*}/exclusions\"}]}},{\"(google.api.method_signature)\":\"parent\"}]},\"GetExclusion\":{\"requestType\":\"GetExclusionRequest\",\"responseType\":\"LogExclusion\",\"options\":{\"(google.api.http).get\":\"/v2/{name=*/*/exclusions/*}\",\"(google.api.http).additional_bindings.get\":\"/v2/{name=billingAccounts/*/exclusions/*}\",\"(google.api.method_signature)\":\"name\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{name=*/*/exclusions/*}\",\"additional_bindings\":[{\"get\":\"/v2/{name=projects/*/exclusions/*}\"},{\"get\":\"/v2/{name=organizations/*/exclusions/*}\"},{\"get\":\"/v2/{name=folders/*/exclusions/*}\"},{\"get\":\"/v2/{name=billingAccounts/*/exclusions/*}\"}]}},{\"(google.api.method_signature)\":\"name\"}]},\"CreateExclusion\":{\"requestType\":\"CreateExclusionRequest\",\"responseType\":\"LogExclusion\",\"options\":{\"(google.api.http).post\":\"/v2/{parent=*/*}/exclusions\",\"(google.api.http).body\":\"exclusion\",\"(google.api.http).additional_bindings.post\":\"/v2/{parent=billingAccounts/*}/exclusions\",\"(google.api.http).additional_bindings.body\":\"exclusion\",\"(google.api.method_signature)\":\"parent,exclusion\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/{parent=*/*}/exclusions\",\"body\":\"exclusion\",\"additional_bindings\":[{\"post\":\"/v2/{parent=projects/*}/exclusions\",\"body\":\"exclusion\"},{\"post\":\"/v2/{parent=organizations/*}/exclusions\",\"body\":\"exclusion\"},{\"post\":\"/v2/{parent=folders/*}/exclusions\",\"body\":\"exclusion\"},{\"post\":\"/v2/{parent=billingAccounts/*}/exclusions\",\"body\":\"exclusion\"}]}},{\"(google.api.method_signature)\":\"parent,exclusion\"}]},\"UpdateExclusion\":{\"requestType\":\"UpdateExclusionRequest\",\"responseType\":\"LogExclusion\",\"options\":{\"(google.api.http).patch\":\"/v2/{name=*/*/exclusions/*}\",\"(google.api.http).body\":\"exclusion\",\"(google.api.http).additional_bindings.patch\":\"/v2/{name=billingAccounts/*/exclusions/*}\",\"(google.api.http).additional_bindings.body\":\"exclusion\",\"(google.api.method_signature)\":\"name,exclusion,update_mask\"},\"parsedOptions\":[{\"(google.api.http)\":{\"patch\":\"/v2/{name=*/*/exclusions/*}\",\"body\":\"exclusion\",\"additional_bindings\":[{\"patch\":\"/v2/{name=projects/*/exclusions/*}\",\"body\":\"exclusion\"},{\"patch\":\"/v2/{name=organizations/*/exclusions/*}\",\"body\":\"exclusion\"},{\"patch\":\"/v2/{name=folders/*/exclusions/*}\",\"body\":\"exclusion\"},{\"patch\":\"/v2/{name=billingAccounts/*/exclusions/*}\",\"body\":\"exclusion\"}]}},{\"(google.api.method_signature)\":\"name,exclusion,update_mask\"}]},\"DeleteExclusion\":{\"requestType\":\"DeleteExclusionRequest\",\"responseType\":\"google.protobuf.Empty\",\"options\":{\"(google.api.http).delete\":\"/v2/{name=*/*/exclusions/*}\",\"(google.api.http).additional_bindings.delete\":\"/v2/{name=billingAccounts/*/exclusions/*}\",\"(google.api.method_signature)\":\"name\"},\"parsedOptions\":[{\"(google.api.http)\":{\"delete\":\"/v2/{name=*/*/exclusions/*}\",\"additional_bindings\":[{\"delete\":\"/v2/{name=projects/*/exclusions/*}\"},{\"delete\":\"/v2/{name=organizations/*/exclusions/*}\"},{\"delete\":\"/v2/{name=folders/*/exclusions/*}\"},{\"delete\":\"/v2/{name=billingAccounts/*/exclusions/*}\"}]}},{\"(google.api.method_signature)\":\"name\"}]},\"GetCmekSettings\":{\"requestType\":\"GetCmekSettingsRequest\",\"responseType\":\"CmekSettings\",\"options\":{\"(google.api.http).get\":\"/v2/{name=*/*}/cmekSettings\",\"(google.api.http).additional_bindings.get\":\"/v2/{name=organizations/*}/cmekSettings\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{name=*/*}/cmekSettings\",\"additional_bindings\":{\"get\":\"/v2/{name=organizations/*}/cmekSettings\"}}}]},\"UpdateCmekSettings\":{\"requestType\":\"UpdateCmekSettingsRequest\",\"responseType\":\"CmekSettings\",\"options\":{\"(google.api.http).patch\":\"/v2/{name=*/*}/cmekSettings\",\"(google.api.http).body\":\"cmek_settings\",\"(google.api.http).additional_bindings.patch\":\"/v2/{name=organizations/*}/cmekSettings\",\"(google.api.http).additional_bindings.body\":\"cmek_settings\"},\"parsedOptions\":[{\"(google.api.http)\":{\"patch\":\"/v2/{name=*/*}/cmekSettings\",\"body\":\"cmek_settings\",\"additional_bindings\":{\"patch\":\"/v2/{name=organizations/*}/cmekSettings\",\"body\":\"cmek_settings\"}}}]}}},\"LogBucket\":{\"options\":{\"(google.api.resource).type\":\"logging.googleapis.com/LogBucket\",\"(google.api.resource).pattern\":\"billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}\"},\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"description\":{\"type\":\"string\",\"id\":3},\"createTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"updateTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":5,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"retentionDays\":{\"type\":\"int32\",\"id\":11},\"locked\":{\"type\":\"bool\",\"id\":9},\"lifecycleState\":{\"type\":\"LifecycleState\",\"id\":12,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}}}},\"LifecycleState\":{\"values\":{\"LIFECYCLE_STATE_UNSPECIFIED\":0,\"ACTIVE\":1,\"DELETE_REQUESTED\":2}},\"LogView\":{\"options\":{\"(google.api.resource).type\":\"logging.googleapis.com/LogView\",\"(google.api.resource).pattern\":\"billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}\"},\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"description\":{\"type\":\"string\",\"id\":3},\"createTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"updateTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":5,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"filter\":{\"type\":\"string\",\"id\":7}}},\"LogSink\":{\"options\":{\"(google.api.resource).type\":\"logging.googleapis.com/LogSink\",\"(google.api.resource).pattern\":\"billingAccounts/{billing_account}/sinks/{sink}\"},\"oneofs\":{\"options\":{\"oneof\":[\"bigqueryOptions\"]}},\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"destination\":{\"type\":\"string\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"*\"}},\"filter\":{\"type\":\"string\",\"id\":5,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"description\":{\"type\":\"string\",\"id\":18,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"disabled\":{\"type\":\"bool\",\"id\":19,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"exclusions\":{\"rule\":\"repeated\",\"type\":\"LogExclusion\",\"id\":16,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"outputVersionFormat\":{\"type\":\"VersionFormat\",\"id\":6,\"options\":{\"deprecated\":true}},\"writerIdentity\":{\"type\":\"string\",\"id\":8,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"includeChildren\":{\"type\":\"bool\",\"id\":9,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"bigqueryOptions\":{\"type\":\"BigQueryOptions\",\"id\":12,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"createTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":13,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"updateTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":14,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}}},\"nested\":{\"VersionFormat\":{\"values\":{\"VERSION_FORMAT_UNSPECIFIED\":0,\"V2\":1,\"V1\":2}}}},\"BigQueryOptions\":{\"fields\":{\"usePartitionedTables\":{\"type\":\"bool\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"usesTimestampColumnPartitioning\":{\"type\":\"bool\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}}}},\"ListBucketsRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/LogBucket\"}},\"pageToken\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageSize\":{\"type\":\"int32\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"ListBucketsResponse\":{\"fields\":{\"buckets\":{\"rule\":\"repeated\",\"type\":\"LogBucket\",\"id\":1},\"nextPageToken\":{\"type\":\"string\",\"id\":2}}},\"CreateBucketRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/LogBucket\"}},\"bucketId\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"bucket\":{\"type\":\"LogBucket\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}}}},\"UpdateBucketRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogBucket\"}},\"bucket\":{\"type\":\"LogBucket\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"updateMask\":{\"type\":\"google.protobuf.FieldMask\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}}}},\"GetBucketRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogBucket\"}}}},\"DeleteBucketRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogBucket\"}}}},\"UndeleteBucketRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogBucket\"}}}},\"ListViewsRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"pageToken\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageSize\":{\"type\":\"int32\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"ListViewsResponse\":{\"fields\":{\"views\":{\"rule\":\"repeated\",\"type\":\"LogView\",\"id\":1},\"nextPageToken\":{\"type\":\"string\",\"id\":2}}},\"CreateViewRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"viewId\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"view\":{\"type\":\"LogView\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}}}},\"UpdateViewRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"view\":{\"type\":\"LogView\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"updateMask\":{\"type\":\"google.protobuf.FieldMask\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"GetViewRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogView\"}}}},\"DeleteViewRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogView\"}}}},\"ListSinksRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/LogSink\"}},\"pageToken\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageSize\":{\"type\":\"int32\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"ListSinksResponse\":{\"fields\":{\"sinks\":{\"rule\":\"repeated\",\"type\":\"LogSink\",\"id\":1},\"nextPageToken\":{\"type\":\"string\",\"id\":2}}},\"GetSinkRequest\":{\"fields\":{\"sinkName\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogSink\"}}}},\"CreateSinkRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/LogSink\"}},\"sink\":{\"type\":\"LogSink\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"uniqueWriterIdentity\":{\"type\":\"bool\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"UpdateSinkRequest\":{\"fields\":{\"sinkName\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogSink\"}},\"sink\":{\"type\":\"LogSink\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"uniqueWriterIdentity\":{\"type\":\"bool\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"updateMask\":{\"type\":\"google.protobuf.FieldMask\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"DeleteSinkRequest\":{\"fields\":{\"sinkName\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogSink\"}}}},\"LogExclusion\":{\"options\":{\"(google.api.resource).type\":\"logging.googleapis.com/LogExclusion\",\"(google.api.resource).pattern\":\"billingAccounts/{billing_account}/exclusions/{exclusion}\"},\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"description\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"filter\":{\"type\":\"string\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"disabled\":{\"type\":\"bool\",\"id\":4,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"createTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":5,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"updateTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":6,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}}}},\"ListExclusionsRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/LogExclusion\"}},\"pageToken\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageSize\":{\"type\":\"int32\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"ListExclusionsResponse\":{\"fields\":{\"exclusions\":{\"rule\":\"repeated\",\"type\":\"LogExclusion\",\"id\":1},\"nextPageToken\":{\"type\":\"string\",\"id\":2}}},\"GetExclusionRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogExclusion\"}}}},\"CreateExclusionRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/LogExclusion\"}},\"exclusion\":{\"type\":\"LogExclusion\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}}}},\"UpdateExclusionRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogExclusion\"}},\"exclusion\":{\"type\":\"LogExclusion\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"updateMask\":{\"type\":\"google.protobuf.FieldMask\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}}}},\"DeleteExclusionRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogExclusion\"}}}},\"GetCmekSettingsRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/CmekSettings\"}}}},\"UpdateCmekSettingsRequest\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"cmekSettings\":{\"type\":\"CmekSettings\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"updateMask\":{\"type\":\"google.protobuf.FieldMask\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"CmekSettings\":{\"options\":{\"(google.api.resource).type\":\"logging.googleapis.com/CmekSettings\",\"(google.api.resource).pattern\":\"billingAccounts/{billing_account}/cmekSettings\"},\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"kmsKeyName\":{\"type\":\"string\",\"id\":2},\"serviceAccountId\":{\"type\":\"string\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}}}},\"MetricsServiceV2\":{\"options\":{\"(google.api.default_host)\":\"logging.googleapis.com\",\"(google.api.oauth_scopes)\":\"https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read,https://www.googleapis.com/auth/logging.write\"},\"methods\":{\"ListLogMetrics\":{\"requestType\":\"ListLogMetricsRequest\",\"responseType\":\"ListLogMetricsResponse\",\"options\":{\"(google.api.http).get\":\"/v2/{parent=projects/*}/metrics\",\"(google.api.method_signature)\":\"parent\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{parent=projects/*}/metrics\"}},{\"(google.api.method_signature)\":\"parent\"}]},\"GetLogMetric\":{\"requestType\":\"GetLogMetricRequest\",\"responseType\":\"LogMetric\",\"options\":{\"(google.api.http).get\":\"/v2/{metric_name=projects/*/metrics/*}\",\"(google.api.method_signature)\":\"metric_name\"},\"parsedOptions\":[{\"(google.api.http)\":{\"get\":\"/v2/{metric_name=projects/*/metrics/*}\"}},{\"(google.api.method_signature)\":\"metric_name\"}]},\"CreateLogMetric\":{\"requestType\":\"CreateLogMetricRequest\",\"responseType\":\"LogMetric\",\"options\":{\"(google.api.http).post\":\"/v2/{parent=projects/*}/metrics\",\"(google.api.http).body\":\"metric\",\"(google.api.method_signature)\":\"parent,metric\"},\"parsedOptions\":[{\"(google.api.http)\":{\"post\":\"/v2/{parent=projects/*}/metrics\",\"body\":\"metric\"}},{\"(google.api.method_signature)\":\"parent,metric\"}]},\"UpdateLogMetric\":{\"requestType\":\"UpdateLogMetricRequest\",\"responseType\":\"LogMetric\",\"options\":{\"(google.api.http).put\":\"/v2/{metric_name=projects/*/metrics/*}\",\"(google.api.http).body\":\"metric\",\"(google.api.method_signature)\":\"metric_name,metric\"},\"parsedOptions\":[{\"(google.api.http)\":{\"put\":\"/v2/{metric_name=projects/*/metrics/*}\",\"body\":\"metric\"}},{\"(google.api.method_signature)\":\"metric_name,metric\"}]},\"DeleteLogMetric\":{\"requestType\":\"DeleteLogMetricRequest\",\"responseType\":\"google.protobuf.Empty\",\"options\":{\"(google.api.http).delete\":\"/v2/{metric_name=projects/*/metrics/*}\",\"(google.api.method_signature)\":\"metric_name\"},\"parsedOptions\":[{\"(google.api.http)\":{\"delete\":\"/v2/{metric_name=projects/*/metrics/*}\"}},{\"(google.api.method_signature)\":\"metric_name\"}]}}},\"LogMetric\":{\"options\":{\"(google.api.resource).type\":\"logging.googleapis.com/LogMetric\",\"(google.api.resource).pattern\":\"projects/{project}/metrics/{metric}\"},\"fields\":{\"name\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"description\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"filter\":{\"type\":\"string\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}},\"metricDescriptor\":{\"type\":\"google.api.MetricDescriptor\",\"id\":5,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"valueExtractor\":{\"type\":\"string\",\"id\":6,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"labelExtractors\":{\"keyType\":\"string\",\"type\":\"string\",\"id\":7,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"bucketOptions\":{\"type\":\"google.api.Distribution.BucketOptions\",\"id\":8,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"createTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":9,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"updateTime\":{\"type\":\"google.protobuf.Timestamp\",\"id\":10,\"options\":{\"(google.api.field_behavior)\":\"OUTPUT_ONLY\"}},\"version\":{\"type\":\"ApiVersion\",\"id\":4,\"options\":{\"deprecated\":true}}},\"nested\":{\"ApiVersion\":{\"values\":{\"V2\":0,\"V1\":1}}}},\"ListLogMetricsRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"cloudresourcemanager.googleapis.com/Project\"}},\"pageToken\":{\"type\":\"string\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}},\"pageSize\":{\"type\":\"int32\",\"id\":3,\"options\":{\"(google.api.field_behavior)\":\"OPTIONAL\"}}}},\"ListLogMetricsResponse\":{\"fields\":{\"metrics\":{\"rule\":\"repeated\",\"type\":\"LogMetric\",\"id\":1},\"nextPageToken\":{\"type\":\"string\",\"id\":2}}},\"GetLogMetricRequest\":{\"fields\":{\"metricName\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogMetric\"}}}},\"CreateLogMetricRequest\":{\"fields\":{\"parent\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).child_type\":\"logging.googleapis.com/LogMetric\"}},\"metric\":{\"type\":\"LogMetric\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}}}},\"UpdateLogMetricRequest\":{\"fields\":{\"metricName\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogMetric\"}},\"metric\":{\"type\":\"LogMetric\",\"id\":2,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\"}}}},\"DeleteLogMetricRequest\":{\"fields\":{\"metricName\":{\"type\":\"string\",\"id\":1,\"options\":{\"(google.api.field_behavior)\":\"REQUIRED\",\"(google.api.resource_reference).type\":\"logging.googleapis.com/LogMetric\"}}}}}}}},\"api\":{\"options\":{\"go_package\":\"google.golang.org/genproto/googleapis/api/metric;metric\",\"java_multiple_files\":true,\"java_outer_classname\":\"MetricProto\",\"java_package\":\"com.google.api\",\"objc_class_prefix\":\"GAPI\",\"cc_enable_arenas\":true},\"nested\":{\"http\":{\"type\":\"HttpRule\",\"id\":72295728,\"extend\":\"google.protobuf.MethodOptions\"},\"Http\":{\"fields\":{\"rules\":{\"rule\":\"repeated\",\"type\":\"HttpRule\",\"id\":1},\"fullyDecodeReservedExpansion\":{\"type\":\"bool\",\"id\":2}}},\"HttpRule\":{\"oneofs\":{\"pattern\":{\"oneof\":[\"get\",\"put\",\"post\",\"delete\",\"patch\",\"custom\"]}},\"fields\":{\"selector\":{\"type\":\"string\",\"id\":1},\"get\":{\"type\":\"string\",\"id\":2},\"put\":{\"type\":\"string\",\"id\":3},\"post\":{\"type\":\"string\",\"id\":4},\"delete\":{\"type\":\"string\",\"id\":5},\"patch\":{\"type\":\"string\",\"id\":6},\"custom\":{\"type\":\"CustomHttpPattern\",\"id\":8},\"body\":{\"type\":\"string\",\"id\":7},\"responseBody\":{\"type\":\"string\",\"id\":12},\"additionalBindings\":{\"rule\":\"repeated\",\"type\":\"HttpRule\",\"id\":11}}},\"CustomHttpPattern\":{\"fields\":{\"kind\":{\"type\":\"string\",\"id\":1},\"path\":{\"type\":\"string\",\"id\":2}}},\"fieldBehavior\":{\"rule\":\"repeated\",\"type\":\"google.api.FieldBehavior\",\"id\":1052,\"extend\":\"google.protobuf.FieldOptions\"},\"FieldBehavior\":{\"values\":{\"FIELD_BEHAVIOR_UNSPECIFIED\":0,\"OPTIONAL\":1,\"REQUIRED\":2,\"OUTPUT_ONLY\":3,\"INPUT_ONLY\":4,\"IMMUTABLE\":5,\"UNORDERED_LIST\":6,\"NON_EMPTY_DEFAULT\":7}},\"MonitoredResourceDescriptor\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":5},\"type\":{\"type\":\"string\",\"id\":1},\"displayName\":{\"type\":\"string\",\"id\":2},\"description\":{\"type\":\"string\",\"id\":3},\"labels\":{\"rule\":\"repeated\",\"type\":\"LabelDescriptor\",\"id\":4},\"launchStage\":{\"type\":\"LaunchStage\",\"id\":7}}},\"MonitoredResource\":{\"fields\":{\"type\":{\"type\":\"string\",\"id\":1},\"labels\":{\"keyType\":\"string\",\"type\":\"string\",\"id\":2}}},\"MonitoredResourceMetadata\":{\"fields\":{\"systemLabels\":{\"type\":\"google.protobuf.Struct\",\"id\":1},\"userLabels\":{\"keyType\":\"string\",\"type\":\"string\",\"id\":2}}},\"LabelDescriptor\":{\"fields\":{\"key\":{\"type\":\"string\",\"id\":1},\"valueType\":{\"type\":\"ValueType\",\"id\":2},\"description\":{\"type\":\"string\",\"id\":3}},\"nested\":{\"ValueType\":{\"values\":{\"STRING\":0,\"BOOL\":1,\"INT64\":2}}}},\"LaunchStage\":{\"values\":{\"LAUNCH_STAGE_UNSPECIFIED\":0,\"UNIMPLEMENTED\":6,\"PRELAUNCH\":7,\"EARLY_ACCESS\":1,\"ALPHA\":2,\"BETA\":3,\"GA\":4,\"DEPRECATED\":5}},\"resourceReference\":{\"type\":\"google.api.ResourceReference\",\"id\":1055,\"extend\":\"google.protobuf.FieldOptions\"},\"resourceDefinition\":{\"rule\":\"repeated\",\"type\":\"google.api.ResourceDescriptor\",\"id\":1053,\"extend\":\"google.protobuf.FileOptions\"},\"resource\":{\"type\":\"google.api.ResourceDescriptor\",\"id\":1053,\"extend\":\"google.protobuf.MessageOptions\"},\"ResourceDescriptor\":{\"fields\":{\"type\":{\"type\":\"string\",\"id\":1},\"pattern\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":2},\"nameField\":{\"type\":\"string\",\"id\":3},\"history\":{\"type\":\"History\",\"id\":4},\"plural\":{\"type\":\"string\",\"id\":5},\"singular\":{\"type\":\"string\",\"id\":6},\"style\":{\"rule\":\"repeated\",\"type\":\"Style\",\"id\":10}},\"nested\":{\"History\":{\"values\":{\"HISTORY_UNSPECIFIED\":0,\"ORIGINALLY_SINGLE_PATTERN\":1,\"FUTURE_MULTI_PATTERN\":2}},\"Style\":{\"values\":{\"STYLE_UNSPECIFIED\":0,\"DECLARATIVE_FRIENDLY\":1}}}},\"ResourceReference\":{\"fields\":{\"type\":{\"type\":\"string\",\"id\":1},\"childType\":{\"type\":\"string\",\"id\":2}}},\"methodSignature\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":1051,\"extend\":\"google.protobuf.MethodOptions\"},\"defaultHost\":{\"type\":\"string\",\"id\":1049,\"extend\":\"google.protobuf.ServiceOptions\"},\"oauthScopes\":{\"type\":\"string\",\"id\":1050,\"extend\":\"google.protobuf.ServiceOptions\"},\"Distribution\":{\"fields\":{\"count\":{\"type\":\"int64\",\"id\":1},\"mean\":{\"type\":\"double\",\"id\":2},\"sumOfSquaredDeviation\":{\"type\":\"double\",\"id\":3},\"range\":{\"type\":\"Range\",\"id\":4},\"bucketOptions\":{\"type\":\"BucketOptions\",\"id\":6},\"bucketCounts\":{\"rule\":\"repeated\",\"type\":\"int64\",\"id\":7},\"exemplars\":{\"rule\":\"repeated\",\"type\":\"Exemplar\",\"id\":10}},\"nested\":{\"Range\":{\"fields\":{\"min\":{\"type\":\"double\",\"id\":1},\"max\":{\"type\":\"double\",\"id\":2}}},\"BucketOptions\":{\"oneofs\":{\"options\":{\"oneof\":[\"linearBuckets\",\"exponentialBuckets\",\"explicitBuckets\"]}},\"fields\":{\"linearBuckets\":{\"type\":\"Linear\",\"id\":1},\"exponentialBuckets\":{\"type\":\"Exponential\",\"id\":2},\"explicitBuckets\":{\"type\":\"Explicit\",\"id\":3}},\"nested\":{\"Linear\":{\"fields\":{\"numFiniteBuckets\":{\"type\":\"int32\",\"id\":1},\"width\":{\"type\":\"double\",\"id\":2},\"offset\":{\"type\":\"double\",\"id\":3}}},\"Exponential\":{\"fields\":{\"numFiniteBuckets\":{\"type\":\"int32\",\"id\":1},\"growthFactor\":{\"type\":\"double\",\"id\":2},\"scale\":{\"type\":\"double\",\"id\":3}}},\"Explicit\":{\"fields\":{\"bounds\":{\"rule\":\"repeated\",\"type\":\"double\",\"id\":1}}}}},\"Exemplar\":{\"fields\":{\"value\":{\"type\":\"double\",\"id\":1},\"timestamp\":{\"type\":\"google.protobuf.Timestamp\",\"id\":2},\"attachments\":{\"rule\":\"repeated\",\"type\":\"google.protobuf.Any\",\"id\":3}}}}},\"MetricDescriptor\":{\"fields\":{\"name\":{\"type\":\"string\",\"id\":1},\"type\":{\"type\":\"string\",\"id\":8},\"labels\":{\"rule\":\"repeated\",\"type\":\"LabelDescriptor\",\"id\":2},\"metricKind\":{\"type\":\"MetricKind\",\"id\":3},\"valueType\":{\"type\":\"ValueType\",\"id\":4},\"unit\":{\"type\":\"string\",\"id\":5},\"description\":{\"type\":\"string\",\"id\":6},\"displayName\":{\"type\":\"string\",\"id\":7},\"metadata\":{\"type\":\"MetricDescriptorMetadata\",\"id\":10},\"launchStage\":{\"type\":\"LaunchStage\",\"id\":12},\"monitoredResourceTypes\":{\"rule\":\"repeated\",\"type\":\"string\",\"id\":13}},\"nested\":{\"MetricDescriptorMetadata\":{\"fields\":{\"launchStage\":{\"type\":\"LaunchStage\",\"id\":1,\"options\":{\"deprecated\":true}},\"samplePeriod\":{\"type\":\"google.protobuf.Duration\",\"id\":2},\"ingestDelay\":{\"type\":\"google.protobuf.Duration\",\"id\":3}}},\"MetricKind\":{\"values\":{\"METRIC_KIND_UNSPECIFIED\":0,\"GAUGE\":1,\"DELTA\":2,\"CUMULATIVE\":3}},\"ValueType\":{\"values\":{\"VALUE_TYPE_UNSPECIFIED\":0,\"BOOL\":1,\"INT64\":2,\"DOUBLE\":3,\"STRING\":4,\"DISTRIBUTION\":5,\"MONEY\":6}}}},\"Metric\":{\"fields\":{\"type\":{\"type\":\"string\",\"id\":3},\"labels\":{\"keyType\":\"string\",\"type\":\"string\",\"id\":2}}}}},\"rpc\":{\"options\":{\"cc_enable_arenas\":true,\"go_package\":\"google.golang.org/genproto/googleapis/rpc/status;status\",\"java_multiple_files\":true,\"java_outer_classname\":\"StatusProto\",\"java_package\":\"com.google.rpc\",\"objc_class_prefix\":\"RPC\"},\"nested\":{\"Status\":{\"fields\":{\"code\":{\"type\":\"int32\",\"id\":1},\"message\":{\"type\":\"string\",\"id\":2},\"details\":{\"rule\":\"repeated\",\"type\":\"google.protobuf.Any\",\"id\":3}}}}}}}}}"); /***/ }), /***/ 75821: /***/ ((module) => { "use strict"; module.exports = JSON.parse("{\"interfaces\":{\"google.logging.v2.ConfigServiceV2\":{\"retry_codes\":{\"non_idempotent\":[],\"idempotent\":[\"DEADLINE_EXCEEDED\",\"UNAVAILABLE\"],\"deadline_exceeded_internal_unavailable\":[\"DEADLINE_EXCEEDED\",\"INTERNAL\",\"UNAVAILABLE\"]},\"retry_params\":{\"default\":{\"initial_retry_delay_millis\":100,\"retry_delay_multiplier\":1.3,\"max_retry_delay_millis\":60000,\"initial_rpc_timeout_millis\":60000,\"rpc_timeout_multiplier\":1,\"max_rpc_timeout_millis\":60000,\"total_timeout_millis\":600000}},\"methods\":{\"ListBuckets\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"GetBucket\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"CreateBucket\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"UpdateBucket\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"DeleteBucket\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"UndeleteBucket\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"ListViews\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"GetView\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"CreateView\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"UpdateView\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"DeleteView\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"ListSinks\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"GetSink\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"CreateSink\":{\"timeout_millis\":120000,\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"UpdateSink\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"DeleteSink\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"ListExclusions\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"GetExclusion\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"CreateExclusion\":{\"timeout_millis\":120000,\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"UpdateExclusion\":{\"timeout_millis\":120000,\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"DeleteExclusion\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"GetCmekSettings\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"UpdateCmekSettings\":{\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"}}}}}"); /***/ }), /***/ 22125: /***/ ((module) => { "use strict"; module.exports = JSON.parse("{\"interfaces\":{\"google.logging.v2.LoggingServiceV2\":{\"retry_codes\":{\"non_idempotent\":[],\"idempotent\":[\"DEADLINE_EXCEEDED\",\"UNAVAILABLE\"],\"deadline_exceeded_internal_unavailable\":[\"DEADLINE_EXCEEDED\",\"INTERNAL\",\"UNAVAILABLE\"]},\"retry_params\":{\"default\":{\"initial_retry_delay_millis\":100,\"retry_delay_multiplier\":1.3,\"max_retry_delay_millis\":60000,\"initial_rpc_timeout_millis\":60000,\"rpc_timeout_multiplier\":1,\"max_rpc_timeout_millis\":60000,\"total_timeout_millis\":600000}},\"methods\":{\"DeleteLog\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"WriteLogEntries\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\",\"bundling\":{\"element_count_threshold\":1000,\"request_byte_threshold\":1048576,\"delay_threshold_millis\":50,\"element_count_limit\":1000000}},\"ListLogEntries\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"ListMonitoredResourceDescriptors\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"ListLogs\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"TailLogEntries\":{\"timeout_millis\":3600000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"}}}}}"); /***/ }), /***/ 95739: /***/ ((module) => { "use strict"; module.exports = JSON.parse("{\"interfaces\":{\"google.logging.v2.MetricsServiceV2\":{\"retry_codes\":{\"non_idempotent\":[],\"idempotent\":[\"DEADLINE_EXCEEDED\",\"UNAVAILABLE\"],\"deadline_exceeded_internal_unavailable\":[\"DEADLINE_EXCEEDED\",\"INTERNAL\",\"UNAVAILABLE\"]},\"retry_params\":{\"default\":{\"initial_retry_delay_millis\":100,\"retry_delay_multiplier\":1.3,\"max_retry_delay_millis\":60000,\"initial_rpc_timeout_millis\":60000,\"rpc_timeout_multiplier\":1,\"max_rpc_timeout_millis\":60000,\"total_timeout_millis\":600000}},\"methods\":{\"ListLogMetrics\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"GetLogMetric\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"CreateLogMetric\":{\"timeout_millis\":60000,\"retry_codes_name\":\"non_idempotent\",\"retry_params_name\":\"default\"},\"UpdateLogMetric\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"},\"DeleteLogMetric\":{\"timeout_millis\":60000,\"retry_codes_name\":\"deadline_exceeded_internal_unavailable\",\"retry_params_name\":\"default\"}}}}}"); /***/ }), /***/ 87989: /***/ ((module) => { "use strict"; module.exports = {"i8":"9.6.6"}; /***/ }), /***/ 68160: /***/ ((module) => { "use strict"; module.exports = {"i8":"1.4.6"}; /***/ }), /***/ 87932: /***/ ((module) => { "use strict"; module.exports = JSON.parse("{\"name\":\"openid-client\",\"version\":\"4.7.3\",\"description\":\"OpenID Connect Relying Party (RP, Client) implementation for Node.js runtime, supports passportjs\",\"keywords\":[\"auth\",\"authentication\",\"basic\",\"certified\",\"client\",\"connect\",\"dynamic\",\"electron\",\"hybrid\",\"identity\",\"implicit\",\"oauth\",\"oauth2\",\"oidc\",\"openid\",\"passport\",\"relying party\",\"strategy\"],\"homepage\":\"https://github.com/panva/node-openid-client\",\"repository\":\"panva/node-openid-client\",\"funding\":{\"url\":\"https://github.com/sponsors/panva\"},\"license\":\"MIT\",\"author\":\"Filip Skokan \",\"exports\":{\"import\":\"./lib/index.mjs\",\"require\":\"./lib/index.js\"},\"main\":\"lib/index.js\",\"types\":\"types/index.d.ts\",\"files\":[\"lib\",\"types/index.d.ts\"],\"scripts\":{\"coverage\":\"nyc mocha test/**/*.test.js\",\"lint\":\"eslint lib test\",\"lint-fix\":\"eslint lib test --fix\",\"lint-ts\":\"npx typescript@~3.6.0 --build types\",\"test\":\"mocha test/**/*.test.js\"},\"nyc\":{\"reporter\":[\"lcov\",\"text-summary\"]},\"dependencies\":{\"aggregate-error\":\"^3.1.0\",\"got\":\"^11.8.0\",\"jose\":\"^2.0.5\",\"lru-cache\":\"^6.0.0\",\"make-error\":\"^1.3.6\",\"object-hash\":\"^2.0.1\",\"oidc-token-hash\":\"^5.0.1\"},\"devDependencies\":{\"@types/passport\":\"^1.0.4\",\"base64url\":\"^3.0.1\",\"chai\":\"^4.2.0\",\"eslint\":\"^7.12.1\",\"eslint-config-airbnb-base\":\"^14.2.0\",\"eslint-plugin-import\":\"^2.22.1\",\"mocha\":\"^8.2.0\",\"nock\":\"^13.0.2\",\"nyc\":\"^15.1.0\",\"readable-mock-req\":\"^0.2.2\",\"sinon\":\"^9.2.0\",\"timekeeper\":\"^2.2.0\"},\"engines\":{\"node\":\"^10.19.0 || >=12.0.0 < 13 || >=13.7.0 < 14 || >= 14.2.0\"},\"standard-version\":{\"scripts\":{\"postchangelog\":\"sed -i '' -e 's/### \\\\[/## [/g' CHANGELOG.md\"},\"types\":[{\"type\":\"feat\",\"section\":\"Features\"},{\"type\":\"fix\",\"section\":\"Bug Fixes\"},{\"type\":\"chore\",\"hidden\":true},{\"type\":\"docs\",\"hidden\":true},{\"type\":\"style\",\"hidden\":true},{\"type\":\"refactor\",\"section\":\"Refactor\",\"hidden\":true},{\"type\":\"perf\",\"section\":\"Performance\",\"hidden\":false},{\"type\":\"test\",\"hidden\":true}]}}"); /***/ }), /***/ 94822: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const model_1 = __webpack_require__(41359); const cli_1 = __webpack_require__(55651); function runMain() { return __awaiter(this, void 0, void 0, function* () { try { model_1.Action.checkCompatibility(); model_1.Cache.verify(); const { dockerfile, workspace, actionFolder } = model_1.Action; const buildParameters = yield model_1.BuildParameters.create(); const baseImage = new model_1.ImageTag(buildParameters); if (buildParameters.cloudRunnerCluster && buildParameters.cloudRunnerCluster !== '' && buildParameters.cloudRunnerCluster !== 'local') { yield model_1.CloudRunner.run(buildParameters, baseImage.toString()); } else { core.info('Building locally'); const builtImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage }); yield model_1.Docker.run(builtImage, Object.assign({ workspace }, buildParameters)); } // Set output yield model_1.Output.setBuildVersion(buildParameters.buildVersion); } catch (error) { core.setFailed(error.message); } }); } const options = cli_1.CLI.SetupCli(); if (cli_1.CLI.isCliMode(options)) { cli_1.CLI.RunCli(options); } else { runMain(); } /***/ }), /***/ 89088: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const path_1 = __importDefault(__webpack_require__(85622)); class Action { static get supportedPlatforms() { return ['linux']; } static get isRunningLocally() { return process.env.RUNNER_WORKSPACE === undefined; } static get isRunningFromSource() { return path_1.default.basename(__dirname) === 'model'; } static get canonicalName() { return 'unity-builder'; } static get rootFolder() { if (Action.isRunningFromSource) { return path_1.default.dirname(path_1.default.dirname(path_1.default.dirname(__filename))); } return path_1.default.dirname(path_1.default.dirname(__filename)); } static get actionFolder() { return `${Action.rootFolder}/dist`; } static get dockerfile() { return `${Action.actionFolder}/Dockerfile`; } static get workspace() { return process.env.GITHUB_WORKSPACE; } static checkCompatibility() { const currentPlatform = process.platform; if (!Action.supportedPlatforms.includes(currentPlatform)) { throw new Error(`Currently ${currentPlatform}-platform is not supported`); } } } exports.default = Action; /***/ }), /***/ 43059: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const semver = __importStar(__webpack_require__(11383)); class AndroidVersioning { static determineVersionCode(version, inputVersionCode) { if (!inputVersionCode) { return AndroidVersioning.versionToVersionCode(version); } return inputVersionCode; } static versionToVersionCode(version) { if (version === 'none') { core.info(`Versioning strategy is set to ${version}, so android version code should not be applied.`); return 0; } const parsedVersion = semver.parse(version); if (!parsedVersion) { core.warning(`Could not parse "${version}" to semver, defaulting android version code to 1`); return 1; } // The greatest value Google Plays allows is 2100000000. // Allow for 3 patch digits, 3 minor digits and 3 major digits. const versionCode = parsedVersion.major * 1000000 + parsedVersion.minor * 1000 + parsedVersion.patch; if (versionCode >= 2050000000) { throw new Error(`Generated versionCode ${versionCode} is dangerously close to the maximum allowed number 2100000000. Consider a different versioning scheme to be able to continue updating your application.`); } core.info(`Using android versionCode ${versionCode}`); return versionCode; } static determineSdkManagerParameters(targetSdkVersion) { const parsedVersion = Number.parseInt(targetSdkVersion.slice(-2), 10); return Number.isNaN(parsedVersion) ? '' : `platforms;android-${parsedVersion}`; } } exports.default = AndroidVersioning; /***/ }), /***/ 80787: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const nanoid_1 = __webpack_require__(39140); const android_versioning_1 = __importDefault(__webpack_require__(43059)); const cloud_runner_constants_1 = __importDefault(__webpack_require__(91311)); const cloud_runner_namespace_1 = __importDefault(__webpack_require__(63287)); const input_1 = __importDefault(__webpack_require__(91933)); const platform_1 = __importDefault(__webpack_require__(9707)); const unity_versioning_1 = __importDefault(__webpack_require__(17146)); const versioning_1 = __importDefault(__webpack_require__(88729)); class BuildParameters { static create() { return __awaiter(this, void 0, void 0, function* () { const buildFile = this.parseBuildFile(input_1.default.buildName, input_1.default.targetPlatform, input_1.default.androidAppBundle); const unityVersion = unity_versioning_1.default.determineUnityVersion(input_1.default.projectPath, input_1.default.unityVersion); const buildVersion = yield versioning_1.default.determineVersion(input_1.default.versioningStrategy, input_1.default.specifiedVersion); const androidVersionCode = android_versioning_1.default.determineVersionCode(buildVersion, input_1.default.androidVersionCode); const androidSdkManagerParameters = android_versioning_1.default.determineSdkManagerParameters(input_1.default.androidTargetSdkVersion); return { version: unityVersion, customImage: input_1.default.customImage, runnerTempPath: process.env.RUNNER_TEMP, platform: input_1.default.targetPlatform, projectPath: input_1.default.projectPath, buildName: input_1.default.buildName, buildPath: `${input_1.default.buildsPath}/${input_1.default.targetPlatform}`, buildFile, buildMethod: input_1.default.buildMethod, buildVersion, androidVersionCode, androidKeystoreName: input_1.default.androidKeystoreName, androidKeystoreBase64: input_1.default.androidKeystoreBase64, androidKeystorePass: input_1.default.androidKeystorePass, androidKeyaliasName: input_1.default.androidKeyaliasName, androidKeyaliasPass: input_1.default.androidKeyaliasPass, androidTargetSdkVersion: input_1.default.androidTargetSdkVersion, androidSdkManagerParameters, customParameters: input_1.default.customParameters, sshAgent: input_1.default.sshAgent, gitPrivateToken: yield input_1.default.gitPrivateToken(), chownFilesTo: input_1.default.chownFilesTo, cloudRunnerCluster: input_1.default.cloudRunnerCluster, awsBaseStackName: input_1.default.awsBaseStackName, kubeConfig: input_1.default.kubeConfig, githubToken: yield input_1.default.githubToken(), cloudRunnerMemory: input_1.default.cloudRunnerMemory, cloudRunnerCpu: input_1.default.cloudRunnerCpu, kubeVolumeSize: input_1.default.kubeVolumeSize, kubeVolume: input_1.default.kubeVolume, postBuildSteps: input_1.default.postBuildSteps, preBuildSteps: input_1.default.preBuildSteps, customJob: input_1.default.customJob, runNumber: input_1.default.runNumber, branch: yield input_1.default.branch(), githubRepo: yield input_1.default.githubRepo(), remoteBuildCluster: input_1.default.cloudRunnerCluster, awsStackName: input_1.default.awsBaseStackName, gitSha: input_1.default.gitSha, logId: nanoid_1.customAlphabet(cloud_runner_constants_1.default.alphabet, 9)(), buildGuid: cloud_runner_namespace_1.default.generateBuildName(input_1.default.runNumber, input_1.default.targetPlatform), }; }); } static parseBuildFile(filename, platform, androidAppBundle) { if (platform_1.default.isWindows(platform)) { return `${filename}.exe`; } if (platform_1.default.isAndroid(platform)) { return androidAppBundle ? `${filename}.aab` : `${filename}.apk`; } return filename; } } exports.default = BuildParameters; /***/ }), /***/ 97134: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const fs_1 = __importDefault(__webpack_require__(35747)); const action_1 = __importDefault(__webpack_require__(89088)); const project_1 = __importDefault(__webpack_require__(88666)); class Cache { static verify() { if (!fs_1.default.existsSync(project_1.default.libraryFolder)) { this.notifyAboutCachingPossibility(); } } static notifyAboutCachingPossibility() { if (action_1.default.isRunningLocally) { return; } core.warning(` Library folder does not exist. Consider setting up caching to speed up your workflow, if this is not your first build. `); } } exports.default = Cache; /***/ }), /***/ 8731: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GetAllCliModes = exports.GetCliFunctions = exports.CliFunction = void 0; const targets = new Array(); function CliFunction(key, description) { return function (target, propertyKey, descriptor) { targets.push({ target, propertyKey, descriptor, key, description, }); }; } exports.CliFunction = CliFunction; function GetCliFunctions(key) { return targets.find((x) => x.key === key); } exports.GetCliFunctions = GetCliFunctions; function GetAllCliModes() { return targets.map((x) => { return { key: x.key, description: x.description, }; }); } exports.GetAllCliModes = GetAllCliModes; /***/ }), /***/ 55651: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __decorate = (this && this.__decorate) || function (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; }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CLI = void 0; const commander_ts_1 = __webpack_require__(40451); const __1 = __webpack_require__(41359); const core = __importStar(__webpack_require__(42186)); const action_yaml_1 = __webpack_require__(11091); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const cli_decorator_1 = __webpack_require__(8731); const remote_client_logger_1 = __webpack_require__(28082); const cloud_runner_state_1 = __webpack_require__(70912); const setup_cloud_runner_repository_1 = __webpack_require__(39656); class CLI { static RunCli(options) { return __awaiter(this, void 0, void 0, function* () { __1.Input.githubInputEnabled = false; const results = cli_decorator_1.GetCliFunctions(options.mode); if (results === undefined || results.length === 0) { throw new Error('no CLI mode found'); } cloud_runner_logger_1.default.log(`Entrypoint: ${results.key}`); options.versioning = 'None'; __1.Input.cliOptions = options; return yield results.target[results.propertyKey](); }); } static isCliMode(options) { return options.mode !== undefined && options.mode !== ''; } static SetupCli() { const program = new commander_ts_1.Command(); program.version('0.0.1'); const properties = Object.getOwnPropertyNames(__1.Input); core.info(`\n`); core.info(`INPUT:`); const actionYamlReader = new action_yaml_1.ActionYamlReader(); for (const element of properties) { program.option(`--${element} <${element}>`, actionYamlReader.GetActionYamlValue(element)); if (__1.Input[element] !== undefined && __1.Input[element] !== '' && typeof __1.Input[element] !== `function`) { core.info(`${element} ${__1.Input[element]}`); } } core.info(`\n`); program.option('-m, --mode ', cli_decorator_1.GetAllCliModes() .map((x) => `${x.key} (${x.description})`) .join(` | `)); program.parse(process.argv); return program.opts(); } static CLIBuild() { return __awaiter(this, void 0, void 0, function* () { const buildParameter = yield __1.BuildParameters.create(); const baseImage = new __1.ImageTag(buildParameter); return yield __1.CloudRunner.run(buildParameter, baseImage.toString()); }); } static runRemoteClientJob() { return __awaiter(this, void 0, void 0, function* () { const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}'); remote_client_logger_1.RemoteClientLogger.log(`Build Params: ${JSON.stringify(buildParameter, undefined, 4)} `); cloud_runner_state_1.CloudRunnerState.setup(buildParameter); yield setup_cloud_runner_repository_1.SetupCloudRunnerRepository.run(); }); } } __decorate([ cli_decorator_1.CliFunction(`cli`, `runs a cloud runner build`) ], CLI, "CLIBuild", null); __decorate([ cli_decorator_1.CliFunction(`remote-cli`, `sets up a repository, usually before a game-ci build`) ], CLI, "runRemoteClientJob", null); exports.CLI = CLI; /***/ }), /***/ 38759: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Caching = void 0; const console_1 = __webpack_require__(57082); const fs_1 = __importDefault(__webpack_require__(35747)); const path_1 = __importDefault(__webpack_require__(85622)); const __1 = __webpack_require__(41359); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const cloud_runner_state_1 = __webpack_require__(70912); const cloud_runner_system_1 = __webpack_require__(66879); const lfs_hashing_1 = __webpack_require__(31938); const remote_client_logger_1 = __webpack_require__(28082); class Caching { static PushToCache(cacheFolder, sourceFolder, cacheKey) { return __awaiter(this, void 0, void 0, function* () { const startPath = process.cwd(); try { if (!fs_1.default.existsSync(cacheFolder)) { yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`); } if (__1.Input.cloudRunnerTests) { yield Caching.printFullCacheHierarchySize(); } process.chdir(`${sourceFolder}`); if (__1.Input.cloudRunnerTests) { cloud_runner_logger_1.default.log(`Hashed cache folder ${yield lfs_hashing_1.LFSHashing.hashAllFiles(sourceFolder)} ${sourceFolder} ${path_1.default.basename(sourceFolder)}`); } if (__1.Input.cloudRunnerTests) { yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls`); } console_1.assert(fs_1.default.existsSync(`./../${path_1.default.basename(sourceFolder)}`)); yield cloud_runner_system_1.CloudRunnerSystem.Run(`zip${__1.Input.cloudRunnerTests ? '' : ' -q'} -r ${cacheKey}.zip ./../${path_1.default.basename(sourceFolder)}`); console_1.assert(fs_1.default.existsSync(`${cacheKey}.zip`)); console_1.assert(fs_1.default.existsSync(`${cacheFolder}`)); console_1.assert(fs_1.default.existsSync(`./../${path_1.default.basename(sourceFolder)}`)); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${cacheKey}.zip ${cacheFolder}`); remote_client_logger_1.RemoteClientLogger.log(`moved ${cacheKey}.zip to ${cacheFolder}`); console_1.assert(fs_1.default.existsSync(`${path_1.default.join(cacheFolder, cacheKey)}.zip`)); if (__1.Input.cloudRunnerTests) { yield Caching.printFullCacheHierarchySize(); } } catch (error) { process.chdir(`${startPath}`); throw error; } process.chdir(`${startPath}`); }); } static PullFromCache(cacheFolder, destinationFolder, cacheKey = ``) { return __awaiter(this, void 0, void 0, function* () { const startPath = process.cwd(); remote_client_logger_1.RemoteClientLogger.log(`Caching for ${path_1.default.basename(destinationFolder)}`); try { if (!fs_1.default.existsSync(cacheFolder)) { yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`); } if (!fs_1.default.existsSync(destinationFolder)) { yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${destinationFolder}`); } const latestInBranch = yield (yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -t "${cacheFolder}" | grep .zip$ | head -1`)) .replace(/\n/g, ``) .replace('.zip', ''); process.chdir(cacheFolder); const cacheSelection = cacheKey !== `` && fs_1.default.existsSync(`${cacheKey}.zip`) ? cacheKey : latestInBranch; yield cloud_runner_logger_1.default.log(`cache key ${cacheKey} selection ${cacheSelection}`); if (fs_1.default.existsSync(`${cacheSelection}.zip`)) { if (__1.Input.cloudRunnerTests) { yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${destinationFolder}`); } remote_client_logger_1.RemoteClientLogger.log(`cache item exists`); console_1.assert(`${fs_1.default.existsSync(destinationFolder)}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`unzip -q ${cacheSelection}.zip -d ${path_1.default.basename(destinationFolder)}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${path_1.default.basename(destinationFolder)}/* ${destinationFolder}`); console_1.assert(fs_1.default.existsSync(`${path_1.default.join(destinationFolder, `${cacheSelection}.zip`)}`)); } else { remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`); if (cacheSelection !== ``) { if (__1.Input.cloudRunnerTests) { yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree ${cacheFolder}`); } remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey}.zip doesn't exist ${destinationFolder}`); throw new Error(`Failed to get cache item, but cache hit was found: ${cacheSelection}`); } } } catch (error) { process.chdir(`${startPath}`); throw error; } process.chdir(`${startPath}`); }); } static handleCachePurging() { if (process.env.purgeRemoteCaching !== undefined) { remote_client_logger_1.RemoteClientLogger.log(`purging ${cloud_runner_state_1.CloudRunnerState.purgeRemoteCaching}`); fs_1.default.rmdirSync(cloud_runner_state_1.CloudRunnerState.cacheFolder, { recursive: true }); } } static printFullCacheHierarchySize() { return __awaiter(this, void 0, void 0, function* () { yield cloud_runner_system_1.CloudRunnerSystem.Run(`echo ' ' echo "LFS cache for $branch" du -sch "${cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull}/" echo '**' echo "Library cache for $branch" du -sch "${cloud_runner_state_1.CloudRunnerState.libraryCacheFolderFull}/" echo '**' echo "Branch: $branch" du -sch "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}/" echo '**' echo 'Full cache' du -sch "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}/../" echo ' '`); }); } } exports.Caching = Caching; /***/ }), /***/ 66879: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CloudRunnerSystem = void 0; const child_process_1 = __webpack_require__(63129); const remote_client_logger_1 = __webpack_require__(28082); class CloudRunnerSystem { static Run(command) { return __awaiter(this, void 0, void 0, function* () { for (const element of command.split(`\n`)) { remote_client_logger_1.RemoteClientLogger.log(element); } return yield new Promise((promise) => { let output = ''; const child = child_process_1.exec(command, (error, stdout, stderr) => { if (error) { remote_client_logger_1.RemoteClientLogger.logCliError(`${error.message}`); throw error; } if (stderr) { remote_client_logger_1.RemoteClientLogger.logCliDiagnostic(`${stderr.toString()}`); return; } const outputChunk = `${stdout}`; output += outputChunk; }); child.on('close', function (code) { remote_client_logger_1.RemoteClientLogger.log(`[Exit code ${code}]`); if (code !== 0) { throw new Error(output); } const outputLines = output.split(`\n`); for (const element of outputLines) { remote_client_logger_1.RemoteClientLogger.log(element); } promise(output); }); }); }); } } exports.CloudRunnerSystem = CloudRunnerSystem; /***/ }), /***/ 31938: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LFSHashing = void 0; const path_1 = __importDefault(__webpack_require__(85622)); const cloud_runner_state_1 = __webpack_require__(70912); const cloud_runner_system_1 = __webpack_require__(66879); const fs_1 = __importDefault(__webpack_require__(35747)); const console_1 = __webpack_require__(57082); const __1 = __webpack_require__(41359); const remote_client_logger_1 = __webpack_require__(28082); class LFSHashing { static createLFSHashFiles() { return __awaiter(this, void 0, void 0, function* () { try { yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`md5sum .lfs-assets-guid > .lfs-assets-guid-sum`); console_1.assert(fs_1.default.existsSync(`.lfs-assets-guid-sum`)); console_1.assert(fs_1.default.existsSync(`.lfs-assets-guid`)); const lfsHashes = { lfsGuid: fs_1.default .readFileSync(`${path_1.default.join(cloud_runner_state_1.CloudRunnerState.repoPathFull, `.lfs-assets-guid`)}`, 'utf8') .replace(/\n/g, ``), lfsGuidSum: fs_1.default .readFileSync(`${path_1.default.join(cloud_runner_state_1.CloudRunnerState.repoPathFull, `.lfs-assets-guid-sum`)}`, 'utf8') .replace(/\n/g, ``), }; if (__1.Input.cloudRunnerTests) { remote_client_logger_1.RemoteClientLogger.log(lfsHashes.lfsGuid); remote_client_logger_1.RemoteClientLogger.log(lfsHashes.lfsGuidSum); } return lfsHashes; } catch (error) { throw error; } }); } static hashAllFiles(folder) { return __awaiter(this, void 0, void 0, function* () { process.chdir(`${folder}`); return yield (yield cloud_runner_system_1.CloudRunnerSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`)) .replace(/\n/g, '') .split(` `)[0]; }); } } exports.LFSHashing = LFSHashing; /***/ }), /***/ 28082: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RemoteClientLogger = void 0; const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); class RemoteClientLogger { static log(message) { cloud_runner_logger_1.default.log(`[Client] ${message}`); } static logCliError(message) { cloud_runner_logger_1.default.log(`[Client][Error] ${message}`); } static logCliDiagnostic(message) { cloud_runner_logger_1.default.log(`[Client][Diagnostic] ${message}`); } static logWarning(message) { cloud_runner_logger_1.default.logWarning(message); } } exports.RemoteClientLogger = RemoteClientLogger; /***/ }), /***/ 39656: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SetupCloudRunnerRepository = void 0; const fs_1 = __importDefault(__webpack_require__(35747)); const cloud_runner_state_1 = __webpack_require__(70912); const caching_1 = __webpack_require__(38759); const lfs_hashing_1 = __webpack_require__(31938); const cloud_runner_system_1 = __webpack_require__(66879); const __1 = __webpack_require__(41359); const remote_client_logger_1 = __webpack_require__(28082); const path_1 = __importDefault(__webpack_require__(85622)); const console_1 = __webpack_require__(57082); class SetupCloudRunnerRepository { static run() { return __awaiter(this, void 0, void 0, function* () { try { yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cloud_runner_state_1.CloudRunnerState.buildPathFull}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cloud_runner_state_1.CloudRunnerState.repoPathFull}`); yield SetupCloudRunnerRepository.cloneRepoWithoutLFSFiles(); const lfsHashes = yield lfs_hashing_1.LFSHashing.createLFSHashFiles(); if (fs_1.default.existsSync(cloud_runner_state_1.CloudRunnerState.libraryFolderFull)) { remote_client_logger_1.RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`); } yield caching_1.Caching.PullFromCache(cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull, cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull, `${lfsHashes.lfsGuid}`); yield SetupCloudRunnerRepository.pullLatestLFS(); yield caching_1.Caching.PushToCache(cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull, cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull, `${lfsHashes.lfsGuid}`); yield caching_1.Caching.PullFromCache(cloud_runner_state_1.CloudRunnerState.libraryCacheFolderFull, cloud_runner_state_1.CloudRunnerState.libraryFolderFull); caching_1.Caching.handleCachePurging(); } catch (error) { throw error; } }); } static cloneRepoWithoutLFSFiles() { return __awaiter(this, void 0, void 0, function* () { try { process.chdir(`${cloud_runner_state_1.CloudRunnerState.repoPathFull}`); remote_client_logger_1.RemoteClientLogger.log(`Initializing source repository for cloning with caching of LFS files`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global advice.detachedHead false`); remote_client_logger_1.RemoteClientLogger.log(`Cloning the repository being built:`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs install --skip-smudge`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ./../${path_1.default.basename(cloud_runner_state_1.CloudRunnerState.repoPathFull)}`); console_1.assert(fs_1.default.existsSync(`.git`)); if (__1.Input.cloudRunnerTests) { yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -lh`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`tree`); } remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`); remote_client_logger_1.RemoteClientLogger.log(`Checked out ${process.env.GITHUB_SHA}`); } catch (error) { throw error; } }); } static pullLatestLFS() { return __awaiter(this, void 0, void 0, function* () { yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -lh ${cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull}/..`); process.chdir(cloud_runner_state_1.CloudRunnerState.repoPathFull); yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs pull`); remote_client_logger_1.RemoteClientLogger.log(`pulled latest LFS files`); console_1.assert(fs_1.default.existsSync(cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull)); yield cloud_runner_system_1.CloudRunnerSystem.Run(`ls -lh ${cloud_runner_state_1.CloudRunnerState.lfsDirectoryFull}/..`); }); } } exports.SetupCloudRunnerRepository = SetupCloudRunnerRepository; /***/ }), /***/ 28730: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AWSBaseStack = void 0; const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const core = __importStar(__webpack_require__(42186)); const fs = __importStar(__webpack_require__(35747)); const path_1 = __importDefault(__webpack_require__(85622)); const crypto = __webpack_require__(76417); class AWSBaseStack { constructor(baseStackName) { this.baseStackName = baseStackName; } setupBaseStack(CF) { var _a, _b, _c, _d, _e; return __awaiter(this, void 0, void 0, function* () { const baseStackName = this.baseStackName; const baseStack = fs.readFileSync(path_1.default.join(__dirname, 'cloud-formations', 'base-setup.yml'), 'utf8'); // Cloud Formation Input const describeStackInput = { StackName: baseStackName, }; const parametersWithoutHash = [ { ParameterKey: 'EnvironmentName', ParameterValue: baseStackName }, ]; const parametersHash = crypto .createHash('md5') .update(baseStack + JSON.stringify(parametersWithoutHash)) .digest('hex'); const parameters = [ ...parametersWithoutHash, ...[{ ParameterKey: 'Version', ParameterValue: parametersHash }], ]; const updateInput = { StackName: baseStackName, TemplateBody: baseStack, Parameters: parameters, Capabilities: ['CAPABILITY_IAM'], }; const createStackInput = { StackName: baseStackName, TemplateBody: baseStack, Parameters: parameters, Capabilities: ['CAPABILITY_IAM'], }; const stacks = yield CF.listStacks({ StackStatusFilter: ['UPDATE_COMPLETE', 'CREATE_COMPLETE', 'ROLLBACK_COMPLETE'], }).promise(); const stackNames = ((_a = stacks.StackSummaries) === null || _a === void 0 ? void 0 : _a.map((x) => x.StackName)) || []; const stackExists = stackNames.includes(baseStackName) || false; const describeStack = () => __awaiter(this, void 0, void 0, function* () { return yield CF.describeStacks(describeStackInput).promise(); }); try { if (!stackExists) { cloud_runner_logger_1.default.log(`${baseStackName} stack does not exist (${JSON.stringify(stackNames)})`); yield CF.createStack(createStackInput).promise(); cloud_runner_logger_1.default.log(`created stack (version: ${parametersHash})`); } const CFState = yield describeStack(); let stack = (_b = CFState.Stacks) === null || _b === void 0 ? void 0 : _b[0]; if (!stack) { throw new Error(`Base stack doesn't exist, even after creation, stackExists check: ${stackExists}`); } const stackVersion = (_d = (_c = stack.Parameters) === null || _c === void 0 ? void 0 : _c.find((x) => x.ParameterKey === 'Version')) === null || _d === void 0 ? void 0 : _d.ParameterValue; if (stack.StackStatus === 'CREATE_IN_PROGRESS') { yield CF.waitFor('stackCreateComplete', describeStackInput).promise(); } if (stackExists) { cloud_runner_logger_1.default.log(`Base stack exists (version: ${stackVersion}, local version: ${parametersHash})`); if (parametersHash !== stackVersion) { cloud_runner_logger_1.default.log(`Attempting update of base stack`); try { yield CF.updateStack(updateInput).promise(); } catch (error) { cloud_runner_logger_1.default.log(error.message); cloud_runner_logger_1.default.log(`Update Failed (Stack name: ${baseStackName})`); cloud_runner_logger_1.default.log(`Continuing...`); } } else { cloud_runner_logger_1.default.log(`No update required`); } stack = (_e = (yield describeStack()).Stacks) === null || _e === void 0 ? void 0 : _e[0]; if (!stack) { throw new Error(`Base stack doesn't exist, even after updating and creation, stackExists check: ${stackExists}`); } if (stack.StackStatus === 'UPDATE_IN_PROGRESS') { yield CF.waitFor('stackUpdateComplete', describeStackInput).promise(); } } cloud_runner_logger_1.default.log('base stack is now ready'); } catch (error) { core.error(JSON.stringify(yield describeStack(), undefined, 4)); throw error; } }); } } exports.AWSBaseStack = AWSBaseStack; /***/ }), /***/ 83683: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AWSError = void 0; const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const core = __importStar(__webpack_require__(42186)); const __1 = __webpack_require__(41359); class AWSError { static handleStackCreationFailure(error, CF, taskDefStackName) { return __awaiter(this, void 0, void 0, function* () { cloud_runner_logger_1.default.log('aws error: '); core.error(JSON.stringify(error, undefined, 4)); if (__1.Input.cloudRunnerTests) { cloud_runner_logger_1.default.log('Getting events and resources for task stack'); const events = (yield CF.describeStackEvents({ StackName: taskDefStackName }).promise()).StackEvents; cloud_runner_logger_1.default.log(JSON.stringify(events, undefined, 4)); } }); } } exports.AWSError = AWSError; /***/ }), /***/ 85819: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AWSJobStack = void 0; const aws_templates_1 = __webpack_require__(6436); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const fs = __importStar(__webpack_require__(35747)); const aws_error_1 = __webpack_require__(83683); class AWSJobStack { constructor(baseStackName) { this.baseStackName = baseStackName; } setupCloudFormations(CF, buildGuid, image, entrypoint, commands, mountdir, workingdir, secrets) { return __awaiter(this, void 0, void 0, function* () { const taskDefStackName = `${this.baseStackName}-${buildGuid}`; let taskDefCloudFormation = aws_templates_1.AWSTemplates.readTaskCloudFormationTemplate(); const cleanupTaskDefStackName = `${taskDefStackName}-cleanup`; const cleanupCloudFormation = fs.readFileSync(`${__dirname}/cloud-formations/cloudformation-stack-ttl.yml`, 'utf8'); for (const secret of secrets) { secret.ParameterKey = `${buildGuid.replace(/[^\dA-Za-z]/g, '')}${secret.ParameterKey.replace(/[^\dA-Za-z]/g, '')}`; if (typeof secret.ParameterValue == 'number') { secret.ParameterValue = `${secret.ParameterValue}`; } if (!secret.ParameterValue || secret.ParameterValue === '') { secrets = secrets.filter((x) => x !== secret); continue; } taskDefCloudFormation = aws_templates_1.AWSTemplates.insertAtTemplate(taskDefCloudFormation, 'p1 - input', aws_templates_1.AWSTemplates.getParameterTemplate(secret.ParameterKey)); taskDefCloudFormation = aws_templates_1.AWSTemplates.insertAtTemplate(taskDefCloudFormation, 'p2 - secret', aws_templates_1.AWSTemplates.getSecretTemplate(`${secret.ParameterKey}`)); taskDefCloudFormation = aws_templates_1.AWSTemplates.insertAtTemplate(taskDefCloudFormation, 'p3 - container def', aws_templates_1.AWSTemplates.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey)); } const secretsMappedToCloudFormationParameters = secrets.map((x) => { return { ParameterKey: x.ParameterKey.replace(/[^\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue }; }); const parameters = [ { ParameterKey: 'EnvironmentName', ParameterValue: this.baseStackName, }, { ParameterKey: 'ImageUrl', ParameterValue: image, }, { ParameterKey: 'ServiceName', ParameterValue: taskDefStackName, }, { ParameterKey: 'Command', ParameterValue: 'echo "this template should be overwritten when running a task"', }, { ParameterKey: 'EntryPoint', ParameterValue: entrypoint.join(','), }, { ParameterKey: 'WorkingDirectory', ParameterValue: workingdir, }, { ParameterKey: 'EFSMountDirectory', ParameterValue: mountdir, }, ...secretsMappedToCloudFormationParameters, ]; let previousStackExists = true; while (previousStackExists) { previousStackExists = false; const stacks = yield CF.listStacks().promise(); if (!stacks.StackSummaries) { throw new Error('Faild to get stacks'); } for (let index = 0; index < stacks.StackSummaries.length; index++) { const element = stacks.StackSummaries[index]; if (element.StackName === taskDefStackName && element.StackStatus !== 'DELETE_COMPLETE') { previousStackExists = true; cloud_runner_logger_1.default.log(`Previous stack still exists: ${JSON.stringify(element)}`); } } } try { yield CF.createStack({ StackName: taskDefStackName, TemplateBody: taskDefCloudFormation, Capabilities: ['CAPABILITY_IAM'], Parameters: parameters, }).promise(); cloud_runner_logger_1.default.log('Creating cloud runner job'); yield CF.createStack({ StackName: cleanupTaskDefStackName, TemplateBody: cleanupCloudFormation, Capabilities: ['CAPABILITY_IAM'], Parameters: [ { ParameterKey: 'StackName', ParameterValue: taskDefStackName, }, { ParameterKey: 'DeleteStackName', ParameterValue: cleanupTaskDefStackName, }, { ParameterKey: 'TTL', ParameterValue: '100', }, { ParameterKey: 'EnvironmentName', ParameterValue: this.baseStackName, }, ], }).promise(); yield CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise(); } catch (error) { yield aws_error_1.AWSError.handleStackCreationFailure(error, CF, taskDefStackName); throw error; } const taskDefResources = (yield CF.describeStackResources({ StackName: taskDefStackName, }).promise()).StackResources; const baseResources = (yield CF.describeStackResources({ StackName: this.baseStackName }).promise()).StackResources; return { taskDefStackName, taskDefCloudFormation, taskDefStackNameTTL: cleanupTaskDefStackName, ttlCloudFormation: cleanupCloudFormation, taskDefResources, baseResources, }; }); } } exports.AWSJobStack = AWSJobStack; /***/ }), /***/ 74668: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const AWS = __importStar(__webpack_require__(71786)); const core = __importStar(__webpack_require__(42186)); const zlib = __importStar(__webpack_require__(78761)); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const __1 = __webpack_require__(41359); const cloud_runner_state_1 = __webpack_require__(70912); const cloud_runner_statics_1 = __webpack_require__(90828); const cloud_runner_build_command_process_1 = __webpack_require__(71899); class AWSTaskRunner { static runTask(taskDef, ECS, CF, environment, buildGuid, commands) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q; return __awaiter(this, void 0, void 0, function* () { const cluster = ((_b = (_a = taskDef.baseResources) === null || _a === void 0 ? void 0 : _a.find((x) => x.LogicalResourceId === 'ECSCluster')) === null || _b === void 0 ? void 0 : _b.PhysicalResourceId) || ''; const taskDefinition = ((_d = (_c = taskDef.taskDefResources) === null || _c === void 0 ? void 0 : _c.find((x) => x.LogicalResourceId === 'TaskDefinition')) === null || _d === void 0 ? void 0 : _d.PhysicalResourceId) || ''; const SubnetOne = ((_f = (_e = taskDef.baseResources) === null || _e === void 0 ? void 0 : _e.find((x) => x.LogicalResourceId === 'PublicSubnetOne')) === null || _f === void 0 ? void 0 : _f.PhysicalResourceId) || ''; const SubnetTwo = ((_h = (_g = taskDef.baseResources) === null || _g === void 0 ? void 0 : _g.find((x) => x.LogicalResourceId === 'PublicSubnetTwo')) === null || _h === void 0 ? void 0 : _h.PhysicalResourceId) || ''; const ContainerSecurityGroup = ((_k = (_j = taskDef.baseResources) === null || _j === void 0 ? void 0 : _j.find((x) => x.LogicalResourceId === 'ContainerSecurityGroup')) === null || _k === void 0 ? void 0 : _k.PhysicalResourceId) || ''; const streamName = ((_m = (_l = taskDef.taskDefResources) === null || _l === void 0 ? void 0 : _l.find((x) => x.LogicalResourceId === 'KinesisStream')) === null || _m === void 0 ? void 0 : _m.PhysicalResourceId) || ''; const task = yield ECS.runTask({ cluster, taskDefinition, platformVersion: '1.4.0', overrides: { containerOverrides: [ { name: taskDef.taskDefStackName, environment, command: ['-c', cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.ProcessCommands(commands, cloud_runner_state_1.CloudRunnerState.buildParams)], }, ], }, launchType: 'FARGATE', networkConfiguration: { awsvpcConfiguration: { subnets: [SubnetOne, SubnetTwo], assignPublicIp: 'ENABLED', securityGroups: [ContainerSecurityGroup], }, }, }).promise(); cloud_runner_logger_1.default.log('Cloud runner job is starting'); const taskArn = ((_o = task.tasks) === null || _o === void 0 ? void 0 : _o[0].taskArn) || ''; try { yield ECS.waitFor('tasksRunning', { tasks: [taskArn], cluster }).promise(); } catch (error_) { const error = error_; yield new Promise((resolve) => setTimeout(resolve, 3000)); cloud_runner_logger_1.default.log(`Cloud runner job has ended ${(_p = (yield AWSTaskRunner.describeTasks(ECS, cluster, taskArn)).containers) === null || _p === void 0 ? void 0 : _p[0].lastStatus}`); core.setFailed(error); core.error(error); } cloud_runner_logger_1.default.log(`Cloud runner job is running`); const output = yield this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName); const exitCode = (_q = (yield AWSTaskRunner.describeTasks(ECS, cluster, taskArn)).containers) === null || _q === void 0 ? void 0 : _q[0].exitCode; cloud_runner_logger_1.default.log(`Cloud runner job exit code ${exitCode}`); if (exitCode !== 0 && exitCode !== undefined) { core.error(`job failed with exit code ${exitCode} ${JSON.stringify(yield ECS.describeTasks({ tasks: [taskArn], cluster }).promise(), undefined, 4)}`); throw new Error(`job failed with exit code ${exitCode}`); } else { cloud_runner_logger_1.default.log(`Cloud runner job has finished successfully`); return output; } }); } static describeTasks(ECS, clusterName, taskArn) { var _a, _b; return __awaiter(this, void 0, void 0, function* () { const tasks = yield ECS.describeTasks({ cluster: clusterName, tasks: [taskArn], }).promise(); if ((_a = tasks.tasks) === null || _a === void 0 ? void 0 : _a[0]) { return (_b = tasks.tasks) === null || _b === void 0 ? void 0 : _b[0]; } else { throw new Error('No task found'); } }); } static streamLogsUntilTaskStops(ECS, CF, taskDef, clusterName, taskArn, kinesisStreamName) { var _a; return __awaiter(this, void 0, void 0, function* () { const kinesis = new AWS.Kinesis(); const stream = yield AWSTaskRunner.getLogStream(kinesis, kinesisStreamName); let iterator = yield AWSTaskRunner.getLogIterator(kinesis, stream); cloud_runner_logger_1.default.log(`Cloud runner job status is ${(_a = (yield AWSTaskRunner.describeTasks(ECS, clusterName, taskArn))) === null || _a === void 0 ? void 0 : _a.lastStatus}`); const logBaseUrl = `https://${__1.Input.region}.console.aws.amazon.com/cloudwatch/home?region=${CF.config.region}#logsV2:log-groups/log-group/${taskDef.taskDefStackName}`; cloud_runner_logger_1.default.log(`You can also see the logs at AWS Cloud Watch: ${logBaseUrl}`); let shouldReadLogs = true; let timestamp = 0; let output = ''; while (shouldReadLogs) { yield new Promise((resolve) => setTimeout(resolve, 1500)); const taskData = yield AWSTaskRunner.describeTasks(ECS, clusterName, taskArn); ({ timestamp, shouldReadLogs } = AWSTaskRunner.checkStreamingShouldContinue(taskData, timestamp, shouldReadLogs)); ({ iterator, shouldReadLogs, output } = yield AWSTaskRunner.handleLogStreamIteration(kinesis, iterator, shouldReadLogs, taskDef, output)); } return output; }); } static handleLogStreamIteration(kinesis, iterator, shouldReadLogs, taskDef, output) { return __awaiter(this, void 0, void 0, function* () { const records = yield kinesis .getRecords({ ShardIterator: iterator, }) .promise(); iterator = records.NextShardIterator || ''; ({ shouldReadLogs, output } = AWSTaskRunner.logRecords(records, iterator, taskDef, shouldReadLogs, output)); return { iterator, shouldReadLogs, output }; }); } static checkStreamingShouldContinue(taskData, timestamp, shouldReadLogs) { if ((taskData === null || taskData === void 0 ? void 0 : taskData.lastStatus) !== 'RUNNING') { if (timestamp === 0) { cloud_runner_logger_1.default.log('## Cloud runner job stopped, streaming end of logs'); timestamp = Date.now(); } if (timestamp !== 0 && Date.now() - timestamp > 30000) { cloud_runner_logger_1.default.log('## Cloud runner status is not RUNNING for 30 seconds, last query for logs'); shouldReadLogs = false; } cloud_runner_logger_1.default.log(`## Status of job: ${taskData.lastStatus}`); } return { timestamp, shouldReadLogs }; } static logRecords(records, iterator, taskDef, shouldReadLogs, output) { if (records.Records.length > 0 && iterator) { for (let index = 0; index < records.Records.length; index++) { const json = JSON.parse(zlib.gunzipSync(Buffer.from(records.Records[index].Data, 'base64')).toString('utf8')); if (json.messageType === 'DATA_MESSAGE') { for (let logEventsIndex = 0; logEventsIndex < json.logEvents.length; logEventsIndex++) { let message = json.logEvents[logEventsIndex].message; if (json.logEvents[logEventsIndex].message.includes(`---${cloud_runner_state_1.CloudRunnerState.buildParams.logId}`)) { cloud_runner_logger_1.default.log('End of log transmission received'); shouldReadLogs = false; } else if (message.includes('Rebuilding Library because the asset database could not be found!')) { core.warning('LIBRARY NOT FOUND!'); } message = `[${cloud_runner_statics_1.CloudRunnerStatics.logPrefix}] ${message}`; if (__1.Input.cloudRunnerTests) { output += message; } cloud_runner_logger_1.default.log(message); } } } } return { shouldReadLogs, output }; } static getLogStream(kinesis, kinesisStreamName) { return __awaiter(this, void 0, void 0, function* () { return yield kinesis .describeStream({ StreamName: kinesisStreamName, }) .promise(); }); } static getLogIterator(kinesis, stream) { return __awaiter(this, void 0, void 0, function* () { return ((yield kinesis .getShardIterator({ ShardIteratorType: 'TRIM_HORIZON', StreamName: stream.StreamDescription.StreamName, ShardId: stream.StreamDescription.Shards[0].ShardId, }) .promise()).ShardIterator || ''); }); } } exports.default = AWSTaskRunner; /***/ }), /***/ 6436: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AWSTemplates = void 0; const fs = __importStar(__webpack_require__(35747)); class AWSTemplates { static getParameterTemplate(p1) { return ` ${p1}: Type: String Default: '' `; } static getSecretTemplate(p1) { return ` ${p1}Secret: Type: AWS::SecretsManager::Secret Properties: Name: '${p1}' SecretString: !Ref ${p1} `; } static getSecretDefinitionTemplate(p1, p2) { return ` - Name: '${p1}' ValueFrom: !Ref ${p2}Secret `; } static insertAtTemplate(template, insertionKey, insertion) { const index = template.search(insertionKey) + insertionKey.length + '\n'.length; template = [template.slice(0, index), insertion, template.slice(index)].join(''); return template; } static readTaskCloudFormationTemplate() { return fs.readFileSync(`${__dirname}/cloud-formations/task-def-formation.yml`, 'utf8'); } } exports.AWSTemplates = AWSTemplates; /***/ }), /***/ 37569: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const SDK = __importStar(__webpack_require__(71786)); const aws_task_runner_1 = __importDefault(__webpack_require__(74668)); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const aws_job_stack_1 = __webpack_require__(85819); const aws_base_stack_1 = __webpack_require__(28730); const __1 = __webpack_require__(41359); class AWSBuildEnvironment { constructor(buildParameters) { this.baseStackName = buildParameters.awsBaseStackName; } cleanupSharedResources( // eslint-disable-next-line no-unused-vars buildGuid, // eslint-disable-next-line no-unused-vars buildParameters, // eslint-disable-next-line no-unused-vars branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { }); } setupSharedResources( // eslint-disable-next-line no-unused-vars buildGuid, // eslint-disable-next-line no-unused-vars buildParameters, // eslint-disable-next-line no-unused-vars branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { }); } runTask(buildGuid, image, commands, mountdir, workingdir, environment, secrets) { return __awaiter(this, void 0, void 0, function* () { process.env.AWS_REGION = __1.Input.region; const ECS = new SDK.ECS(); const CF = new SDK.CloudFormation(); cloud_runner_logger_1.default.log(`AWS Region: ${CF.config.region}`); const entrypoint = ['/bin/sh']; const startTimeMs = Date.now(); yield new aws_base_stack_1.AWSBaseStack(this.baseStackName).setupBaseStack(CF); const taskDef = yield new aws_job_stack_1.AWSJobStack(this.baseStackName).setupCloudFormations(CF, buildGuid, image, entrypoint, commands, mountdir, workingdir, secrets); let postRunTaskTimeMs; let output = ''; try { const postSetupStacksTimeMs = Date.now(); cloud_runner_logger_1.default.log(`Setup job time: ${Math.floor((postSetupStacksTimeMs - startTimeMs) / 1000)}s`); output = yield aws_task_runner_1.default.runTask(taskDef, ECS, CF, environment, buildGuid, commands); postRunTaskTimeMs = Date.now(); cloud_runner_logger_1.default.log(`Run job time: ${Math.floor((postRunTaskTimeMs - postSetupStacksTimeMs) / 1000)}s`); } finally { yield this.cleanupResources(CF, taskDef); const postCleanupTimeMs = Date.now(); if (postRunTaskTimeMs !== undefined) cloud_runner_logger_1.default.log(`Cleanup job time: ${Math.floor((postCleanupTimeMs - postRunTaskTimeMs) / 1000)}s`); } return output; }); } cleanupResources(CF, taskDef) { return __awaiter(this, void 0, void 0, function* () { cloud_runner_logger_1.default.log('Cleanup starting'); yield CF.deleteStack({ StackName: taskDef.taskDefStackName, }).promise(); yield CF.deleteStack({ StackName: taskDef.taskDefStackNameTTL, }).promise(); yield CF.waitFor('stackDeleteComplete', { StackName: taskDef.taskDefStackName, }).promise(); yield CF.waitFor('stackDeleteComplete', { StackName: taskDef.taskDefStackNameTTL, }).promise(); cloud_runner_logger_1.default.log(`Deleted Stacks: ${taskDef.taskDefStackName}, ${taskDef.taskDefStackNameTTL}`); cloud_runner_logger_1.default.log('Cleanup complete'); }); } } exports.default = AWSBuildEnvironment; /***/ }), /***/ 90828: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CloudRunnerStatics = void 0; class CloudRunnerStatics { } exports.CloudRunnerStatics = CloudRunnerStatics; CloudRunnerStatics.logPrefix = `Cloud-Runner-System`; /***/ }), /***/ 79144: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const aws_1 = __importDefault(__webpack_require__(37569)); const cloud_runner_state_1 = __webpack_require__(70912); const k8s_1 = __importDefault(__webpack_require__(25107)); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const cloud_runner_step_state_1 = __webpack_require__(64854); const workflow_composition_root_1 = __webpack_require__(54204); const cloud_runner_error_1 = __webpack_require__(2600); const task_parameter_serializer_1 = __webpack_require__(35346); const core = __importStar(__webpack_require__(42186)); class CloudRunner { static setup(buildParameters) { cloud_runner_logger_1.default.setup(); cloud_runner_state_1.CloudRunnerState.setup(buildParameters); CloudRunner.setupBuildPlatform(); const parameters = task_parameter_serializer_1.TaskParameterSerializer.readBuildEnvironmentVariables(); for (const element of parameters) { core.setOutput(element.name, element.value); } } static setupBuildPlatform() { switch (cloud_runner_state_1.CloudRunnerState.buildParams.cloudRunnerCluster) { case 'k8s': cloud_runner_logger_1.default.log('Cloud Runner platform selected Kubernetes'); cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform = new k8s_1.default(cloud_runner_state_1.CloudRunnerState.buildParams); break; default: case 'aws': cloud_runner_logger_1.default.log('Cloud Runner platform selected AWS'); cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform = new aws_1.default(cloud_runner_state_1.CloudRunnerState.buildParams); break; } } static run(buildParameters, baseImage) { return __awaiter(this, void 0, void 0, function* () { core.startGroup('Setup remote runner'); CloudRunner.setup(buildParameters); try { yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.setupSharedResources(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, cloud_runner_state_1.CloudRunnerState.buildParams, cloud_runner_state_1.CloudRunnerState.branchName, cloud_runner_state_1.CloudRunnerState.defaultSecrets); core.endGroup(); const output = yield new workflow_composition_root_1.WorkflowCompositionRoot().run(new cloud_runner_step_state_1.CloudRunnerStepState(baseImage, task_parameter_serializer_1.TaskParameterSerializer.readBuildEnvironmentVariables(), cloud_runner_state_1.CloudRunnerState.defaultSecrets)); core.startGroup('Cleanup'); yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.cleanupSharedResources(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, cloud_runner_state_1.CloudRunnerState.buildParams, cloud_runner_state_1.CloudRunnerState.branchName, cloud_runner_state_1.CloudRunnerState.defaultSecrets); core.endGroup(); return output; } catch (error) { yield cloud_runner_error_1.CloudRunnerError.handleException(error); throw error; } }); } } exports.default = CloudRunner; /***/ }), /***/ 2600: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CloudRunnerError = void 0; const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const cloud_runner_state_1 = __webpack_require__(70912); const core = __importStar(__webpack_require__(42186)); class CloudRunnerError { static handleException(error) { return __awaiter(this, void 0, void 0, function* () { cloud_runner_logger_1.default.error(JSON.stringify(error, undefined, 4)); core.setFailed('Cloud Runner failed'); yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.cleanupSharedResources(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, cloud_runner_state_1.CloudRunnerState.buildParams, cloud_runner_state_1.CloudRunnerState.branchName, cloud_runner_state_1.CloudRunnerState.defaultSecrets); }); } } exports.CloudRunnerError = CloudRunnerError; /***/ }), /***/ 25107: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const k8s = __importStar(__webpack_require__(89679)); const core = __importStar(__webpack_require__(42186)); const kubernetes_storage_1 = __importDefault(__webpack_require__(43951)); const kubernetes_task_runner_1 = __importDefault(__webpack_require__(7181)); const kubernetes_secret_1 = __importDefault(__webpack_require__(71586)); const async_wait_until_1 = __importDefault(__webpack_require__(41299)); const kubernetes_job_spec_factory_1 = __importDefault(__webpack_require__(1739)); const kubernetes_service_account_1 = __importDefault(__webpack_require__(42915)); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); class Kubernetes { constructor(buildParameters) { this.buildGuid = ''; this.pvcName = ''; this.secretName = ''; this.jobName = ''; this.podName = ''; this.containerName = ''; this.cleanupCronJobName = ''; this.serviceAccountName = ''; this.kubeConfig = new k8s.KubeConfig(); this.kubeConfig.loadFromDefault(); this.kubeClient = this.kubeConfig.makeApiClient(k8s.CoreV1Api); this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api); cloud_runner_logger_1.default.log('Loaded default Kubernetes configuration for this environment'); this.namespace = 'default'; this.buildParameters = buildParameters; } setupSharedResources(buildGuid, buildParameters, // eslint-disable-next-line no-unused-vars branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { try { this.pvcName = `unity-builder-pvc-${buildGuid}`; this.cleanupCronJobName = `unity-builder-cronjob-${buildGuid}`; this.serviceAccountName = `service-account-${buildGuid}`; yield kubernetes_storage_1.default.createPersistentVolumeClaim(buildParameters, this.pvcName, this.kubeClient, this.namespace); yield kubernetes_service_account_1.default.createServiceAccount(this.serviceAccountName, this.namespace, this.kubeClient); } catch (error) { throw error; } }); } runTask(buildGuid, image, commands, mountdir, workingdir, environment, secrets) { return __awaiter(this, void 0, void 0, function* () { try { // setup this.buildGuid = buildGuid; this.secretName = `build-credentials-${buildGuid}`; this.jobName = `unity-builder-job-${buildGuid}`; this.containerName = `main`; yield kubernetes_secret_1.default.createSecret(secrets, this.secretName, this.namespace, this.kubeClient); const jobSpec = kubernetes_job_spec_factory_1.default.getJobSpec(commands, image, mountdir, workingdir, environment, secrets, this.buildGuid, this.buildParameters, this.secretName, this.pvcName, this.jobName, k8s); //run cloud_runner_logger_1.default.log('Creating build job'); yield this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec); yield new Promise((promise) => setTimeout(promise, 5000)); cloud_runner_logger_1.default.log('Job created'); this.setPodNameAndContainerName(yield Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace)); cloud_runner_logger_1.default.log('Watching pod until running'); let output = ''; // eslint-disable-next-line no-constant-condition while (true) { try { yield kubernetes_task_runner_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace); cloud_runner_logger_1.default.log('Pod running, streaming logs'); output = yield kubernetes_task_runner_1.default.runTask(this.kubeConfig, this.kubeClient, this.jobName, this.podName, 'main', this.namespace, cloud_runner_logger_1.default.log); break; } catch (error) { if (error.message.includes(`HTTP`)) { continue; } else { throw error; } } } yield this.cleanupTaskResources(); return output; } catch (error) { cloud_runner_logger_1.default.log('Running job failed'); core.error(JSON.stringify(error, undefined, 4)); yield this.cleanupTaskResources(); throw error; } }); } setPodNameAndContainerName(pod) { var _a, _b, _c; this.podName = ((_a = pod.metadata) === null || _a === void 0 ? void 0 : _a.name) || ''; this.containerName = ((_c = (_b = pod.status) === null || _b === void 0 ? void 0 : _b.containerStatuses) === null || _c === void 0 ? void 0 : _c[0].name) || ''; } cleanupTaskResources() { return __awaiter(this, void 0, void 0, function* () { cloud_runner_logger_1.default.log('cleaning up'); try { yield this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace); yield this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace); } catch (error) { cloud_runner_logger_1.default.log('Failed to cleanup, error:'); core.error(JSON.stringify(error, undefined, 4)); cloud_runner_logger_1.default.log('Abandoning cleanup, build error:'); throw error; } try { yield async_wait_until_1.default(() => __awaiter(this, void 0, void 0, function* () { return (yield this.kubeClientBatch.readNamespacedJob(this.jobName, this.namespace)).body === null; }), { timeout: 500000, intervalBetweenAttempts: 15000, }); } catch (_a) { cloud_runner_logger_1.default.log('failed to read the state of the job while cleaning up?'); } }); } cleanupSharedResources( // eslint-disable-next-line no-unused-vars buildGuid, // eslint-disable-next-line no-unused-vars buildParameters, // eslint-disable-next-line no-unused-vars branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { return __awaiter(this, void 0, void 0, function* () { yield this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace); }); } static findPodFromJob(kubeClient, jobName, namespace) { return __awaiter(this, void 0, void 0, function* () { const namespacedPods = yield kubeClient.listNamespacedPod(namespace); const pod = namespacedPods.body.items.find((x) => { var _a, _b; return ((_b = (_a = x.metadata) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b['job-name']) === jobName; }); if (pod === undefined) { throw new Error("pod with job-name label doesn't exist"); } return pod; }); } } exports.default = Kubernetes; /***/ }), /***/ 1739: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const client_node_1 = __webpack_require__(89679); const cloud_runner_build_command_process_1 = __webpack_require__(71899); const cloud_runner_state_1 = __webpack_require__(70912); class KubernetesJobSpecFactory { static getJobSpec(command, image, mountdir, workingDirectory, environment, secrets, buildGuid, buildParameters, secretName, pvcName, jobName, k8s) { environment.push(...[ { name: 'GITHUB_SHA', value: buildGuid, }, { name: 'GITHUB_WORKSPACE', value: '/data/repo', }, { name: 'PROJECT_PATH', value: buildParameters.projectPath, }, { name: 'BUILD_PATH', value: buildParameters.buildPath, }, { name: 'BUILD_FILE', value: buildParameters.buildFile, }, { name: 'BUILD_NAME', value: buildParameters.buildName, }, { name: 'BUILD_METHOD', value: buildParameters.buildMethod, }, { name: 'CUSTOM_PARAMETERS', value: buildParameters.customParameters, }, { name: 'CHOWN_FILES_TO', value: buildParameters.chownFilesTo, }, { name: 'BUILD_TARGET', value: buildParameters.platform, }, { name: 'ANDROID_VERSION_CODE', value: buildParameters.androidVersionCode.toString(), }, { name: 'ANDROID_KEYSTORE_NAME', value: buildParameters.androidKeystoreName, }, { name: 'ANDROID_KEYALIAS_NAME', value: buildParameters.androidKeyaliasName, }, ]); const job = new k8s.V1Job(); job.apiVersion = 'batch/v1'; job.kind = 'Job'; job.metadata = { name: jobName, labels: { app: 'unity-builder', buildGuid, }, }; job.spec = { backoffLimit: 0, template: { spec: { volumes: [ { name: 'build-mount', persistentVolumeClaim: { claimName: pvcName, }, }, ], containers: [ { name: 'main', image, command: ['/bin/sh'], args: ['-c', cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.ProcessCommands(command, cloud_runner_state_1.CloudRunnerState.buildParams)], workingDir: `/${workingDirectory}`, resources: { requests: { memory: buildParameters.cloudRunnerMemory, cpu: buildParameters.cloudRunnerCpu, }, }, env: [ ...environment, ...secrets.map((x) => { const secret = new client_node_1.V1EnvVarSource(); secret.secretKeyRef = new client_node_1.V1SecretKeySelector(); secret.secretKeyRef.key = x.ParameterKey; secret.secretKeyRef.name = secretName; const environmentVariable = new client_node_1.V1EnvVar(); environmentVariable.name = x.EnvironmentVariable; environmentVariable.valueFrom = secret; return environmentVariable; }), ], volumeMounts: [ { name: 'build-mount', mountPath: `/${mountdir}`, }, ], lifecycle: { preStop: { exec: { command: [ 'bin/bash', '-c', `cd /data/builder/action/steps; chmod +x /return_license.sh; /return_license.sh;`, ], }, }, }, }, { name: 'controller-cleanup', image: 'alpine', command: ['/bin/sh'], args: ['-c', 'echo "test"'], }, ], restartPolicy: 'Never', }, }, }; return job; } } exports.default = KubernetesJobSpecFactory; /***/ }), /***/ 71586: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const k8s = __importStar(__webpack_require__(89679)); const base64 = __webpack_require__(85848); class KubernetesSecret { static createSecret(secrets, secretName, namespace, kubeClient) { return __awaiter(this, void 0, void 0, function* () { const secret = new k8s.V1Secret(); secret.apiVersion = 'v1'; secret.kind = 'Secret'; secret.type = 'Opaque'; secret.metadata = { name: secretName, }; secret.data = {}; for (const buildSecret of secrets) { secret.data[buildSecret.ParameterKey] = base64.encode(buildSecret.ParameterValue); } try { yield kubeClient.createNamespacedSecret(namespace, secret); } catch (error) { throw error; } }); } } exports.default = KubernetesSecret; /***/ }), /***/ 42915: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const k8s = __importStar(__webpack_require__(89679)); class KubernetesServiceAccount { static createServiceAccount(serviceAccountName, namespace, kubeClient) { return __awaiter(this, void 0, void 0, function* () { const serviceAccount = new k8s.V1ServiceAccount(); serviceAccount.apiVersion = 'v1'; serviceAccount.kind = 'ServiceAccount'; serviceAccount.metadata = { name: serviceAccountName, }; serviceAccount.automountServiceAccountToken = false; try { yield kubeClient.createNamespacedServiceAccount(namespace, serviceAccount); } catch (error) { throw error; } }); } } exports.default = KubernetesServiceAccount; /***/ }), /***/ 43951: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const async_wait_until_1 = __importDefault(__webpack_require__(41299)); const core = __importStar(__webpack_require__(42186)); const k8s = __importStar(__webpack_require__(89679)); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); class KubernetesStorage { static createPersistentVolumeClaim(buildParameters, pvcName, kubeClient, namespace) { return __awaiter(this, void 0, void 0, function* () { if (buildParameters.kubeVolume) { cloud_runner_logger_1.default.log(buildParameters.kubeVolume); pvcName = buildParameters.kubeVolume; return; } const pvcList = (yield kubeClient.listNamespacedPersistentVolumeClaim(namespace)).body.items.map((x) => { var _a; return (_a = x.metadata) === null || _a === void 0 ? void 0 : _a.name; }); cloud_runner_logger_1.default.log(`Current PVCs in namespace ${namespace}`); cloud_runner_logger_1.default.log(JSON.stringify(pvcList, undefined, 4)); if (pvcList.includes(pvcName)) { cloud_runner_logger_1.default.log(`pvc ${pvcName} already exists`); core.setOutput('volume', pvcName); return; } cloud_runner_logger_1.default.log(`Creating PVC ${pvcName} (does not exist)`); const result = yield KubernetesStorage.createPVC(pvcName, buildParameters, kubeClient, namespace); yield KubernetesStorage.handleResult(result, kubeClient, namespace, pvcName); }); } static getPVCPhase(kubeClient, name, namespace) { var _a; return __awaiter(this, void 0, void 0, function* () { try { return (_a = (yield kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body.status) === null || _a === void 0 ? void 0 : _a.phase; } catch (error) { core.error('Failed to get PVC phase'); core.error(JSON.stringify(error, undefined, 4)); throw error; } }); } static watchUntilPVCNotPending(kubeClient, name, namespace) { return __awaiter(this, void 0, void 0, function* () { try { cloud_runner_logger_1.default.log(`watch Until PVC Not Pending ${name} ${namespace}`); cloud_runner_logger_1.default.log(`${yield this.getPVCPhase(kubeClient, name, namespace)}`); yield async_wait_until_1.default(() => __awaiter(this, void 0, void 0, function* () { return (yield this.getPVCPhase(kubeClient, name, namespace)) !== 'Pending'; }), { timeout: 500000, intervalBetweenAttempts: 15000, }); } catch (error) { core.error('Failed to watch PVC'); core.error(JSON.stringify(error, undefined, 4)); core.error(`PVC Body: ${JSON.stringify((yield kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body, undefined, 4)}`); throw error; } }); } static createPVC(pvcName, buildParameters, kubeClient, namespace) { return __awaiter(this, void 0, void 0, function* () { const pvc = new k8s.V1PersistentVolumeClaim(); pvc.apiVersion = 'v1'; pvc.kind = 'PersistentVolumeClaim'; pvc.metadata = { name: pvcName, }; pvc.spec = { accessModes: ['ReadWriteOnce'], storageClassName: process.env.K8s_STORAGE_CLASS || 'standard', resources: { requests: { storage: buildParameters.kubeVolumeSize, }, }, }; const result = yield kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc); return result; }); } static handleResult(result, kubeClient, namespace, pvcName) { var _a; return __awaiter(this, void 0, void 0, function* () { const name = ((_a = result.body.metadata) === null || _a === void 0 ? void 0 : _a.name) || ''; cloud_runner_logger_1.default.log(`PVC ${name} created`); yield this.watchUntilPVCNotPending(kubeClient, name, namespace); cloud_runner_logger_1.default.log(`PVC ${name} is ready and not pending`); core.setOutput('volume', pvcName); }); } } exports.default = KubernetesStorage; /***/ }), /***/ 7181: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const client_node_1 = __webpack_require__(89679); const stream_1 = __webpack_require__(92413); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const core = __importStar(__webpack_require__(42186)); const cloud_runner_statics_1 = __webpack_require__(90828); const async_wait_until_1 = __importDefault(__webpack_require__(41299)); const __1 = __webpack_require__(41359); class KubernetesTaskRunner { static runTask(kubeConfig, kubeClient, jobName, podName, containerName, namespace, logCallback) { return __awaiter(this, void 0, void 0, function* () { cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace}`); const stream = new stream_1.Writable(); let output = ''; let didStreamAnyLogs = false; stream._write = (chunk, encoding, next) => { didStreamAnyLogs = true; let message = chunk.toString().trimRight(`\n`); message = `[${cloud_runner_statics_1.CloudRunnerStatics.logPrefix}] ${message}`; if (__1.Input.cloudRunnerTests) { output += message; } logCallback(message); next(); }; const logOptions = { follow: true, pretty: false, previous: false, }; try { const resultError = yield new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { return new client_node_1.Log(kubeConfig).log(namespace, podName, containerName, stream, resolve, logOptions); })); if (resultError) { throw resultError; } if (!didStreamAnyLogs) { core.error('Failed to stream any logs, listing namespace events, check for an error with the container'); core.error(JSON.stringify({ events: (yield kubeClient.listNamespacedEvent(namespace)).body.items .filter((x) => { return x.involvedObject.name === podName || x.involvedObject.name === jobName; }) .map((x) => { return { type: x.involvedObject.kind, name: x.involvedObject.name, message: x.message, }; }), }, undefined, 4)); throw new Error(`No logs streamed from k8s`); } } catch (error) { throw error; } cloud_runner_logger_1.default.log('end of log stream'); return output; }); } static watchUntilPodRunning(kubeClient, podName, namespace) { return __awaiter(this, void 0, void 0, function* () { let success = false; cloud_runner_logger_1.default.log(`Watching ${podName} ${namespace}`); yield async_wait_until_1.default(() => __awaiter(this, void 0, void 0, function* () { var _a, _b, _c, _d, _e, _f; const status = yield kubeClient.readNamespacedPodStatus(podName, namespace); const phase = (_a = status === null || status === void 0 ? void 0 : status.body.status) === null || _a === void 0 ? void 0 : _a.phase; success = phase === 'Running'; cloud_runner_logger_1.default.log(`${(_b = status.body.status) === null || _b === void 0 ? void 0 : _b.phase} ${((_d = (_c = status.body.status) === null || _c === void 0 ? void 0 : _c.conditions) === null || _d === void 0 ? void 0 : _d[0].reason) || ''} ${((_f = (_e = status.body.status) === null || _e === void 0 ? void 0 : _e.conditions) === null || _f === void 0 ? void 0 : _f[0].message) || ''}`); if (success || phase !== 'Pending') return true; return false; }), { timeout: 2000000, intervalBetweenAttempts: 15000, }); return success; }); } } exports.default = KubernetesTaskRunner; /***/ }), /***/ 71899: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Hook = exports.CloudRunnerBuildCommandProcessor = void 0; const __1 = __webpack_require__(41359); const yaml_1 = __importDefault(__webpack_require__(13552)); class CloudRunnerBuildCommandProcessor { static ProcessCommands(commands, buildParameters) { const hooks = CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`all`)); return `echo "---" echo "start cloud runner init" ${__1.Input.cloudRunnerTests ? '' : '#'} printenv echo "start cloud runner job" ${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '} ${commands} ${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '} echo "end of cloud runner job ---${buildParameters.logId}" `; } static getHooks() { const experimentHooks = process.env.EXPERIMENTAL_HOOKS; let output = new Array(); if (experimentHooks && experimentHooks !== '') { try { output = yaml_1.default.parse(experimentHooks); } catch (error) { throw error; } } return output.filter((x) => x.step !== undefined && x.hook !== undefined && x.hook.length > 0); } } exports.CloudRunnerBuildCommandProcessor = CloudRunnerBuildCommandProcessor; class Hook { constructor() { this.secrets = new Array(); } } exports.Hook = Hook; /***/ }), /***/ 91311: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class CloudRunnerConstants { } CloudRunnerConstants.alphabet = '0123456789abcdefghijklmnopqrstuvwxyz'; exports.default = CloudRunnerConstants; /***/ }), /***/ 22855: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); class CloudRunnerLogger { static setup() { this.timestamp = this.createTimestamp(); this.globalTimestamp = this.timestamp; } static log(message) { core.info(message); if (process.env.GCP_LOGGING) { CloudRunnerLogger.writeGCPLog(`${message}\n`); } } static logWarning(message) { core.warning(message); if (process.env.GCP_LOGGING) { CloudRunnerLogger.writeGCPLog(`${message}\n`); } } static logLine(message) { core.info(`${message}\n`); if (process.env.GCP_LOGGING) { CloudRunnerLogger.writeGCPLog(`${message}\n`); } } static error(message) { core.error(message); if (process.env.GCP_LOGGING) { CloudRunnerLogger.writeGCPLog(`${message}\n`); } } static logWithTime(message) { const newTimestamp = this.createTimestamp(); core.info(`${message} (Since previous: ${this.calculateTimeDiff(newTimestamp, this.timestamp)}, Total time: ${this.calculateTimeDiff(newTimestamp, this.globalTimestamp)})`); this.timestamp = newTimestamp; } static calculateTimeDiff(x, y) { return Math.floor((x - y) / 1000); } static createTimestamp() { return Date.now(); } static writeGCPLog(text) { return __awaiter(this, void 0, void 0, function* () { if (!CloudRunnerLogger.logger) { this.SetupGoogleLogs(); } const metadata = { resource: { type: 'global' }, severity: 'INFO', }; const entry = CloudRunnerLogger.logger.entry(metadata, text); yield CloudRunnerLogger.logger.write(entry); }); } static SetupGoogleLogs() { const logging = new Logging({ projectId: process.env.GCP_PROJECT }); CloudRunnerLogger.logger = logging.log('game-ci'); } } CloudRunnerLogger.logsFile = process.env.GCP_LOG_FILE || ''; let Logging; if (process.env.GCP_LOGGING) { Logging = __webpack_require__(9341); } exports.default = CloudRunnerLogger; /***/ }), /***/ 63287: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const nanoid_1 = __webpack_require__(39140); const cloud_runner_constants_1 = __importDefault(__webpack_require__(91311)); class CloudRunnerNamespace { static generateBuildName(runNumber, platform) { const nanoid = nanoid_1.customAlphabet(cloud_runner_constants_1.default.alphabet, 4); return `${runNumber}-${platform.toLowerCase().replace('standalone', '')}-${nanoid()}`; } } exports.default = CloudRunnerNamespace; /***/ }), /***/ 35346: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TaskParameterSerializer = void 0; const __1 = __webpack_require__(41359); const image_environment_factory_1 = __importDefault(__webpack_require__(25145)); const cloud_runner_state_1 = __webpack_require__(70912); const cloud_runner_build_command_process_1 = __webpack_require__(71899); class TaskParameterSerializer { static readBuildEnvironmentVariables() { TaskParameterSerializer.setupDefaultSecrets(); return [ { name: 'ContainerMemory', value: cloud_runner_state_1.CloudRunnerState.buildParams.cloudRunnerMemory, }, { name: 'ContainerCpu', value: cloud_runner_state_1.CloudRunnerState.buildParams.cloudRunnerCpu, }, { name: 'BUILD_TARGET', value: cloud_runner_state_1.CloudRunnerState.buildParams.platform, }, ...TaskParameterSerializer.serializeBuildParamsAndInput, ]; } static get serializeBuildParamsAndInput() { let array = new Array(); array = TaskParameterSerializer.readBuildParameters(array); array = TaskParameterSerializer.readInput(array); const configurableHooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks(); const secrets = configurableHooks.map((x) => x.secrets).filter((x) => x !== undefined && x.length > 0); if (secrets.length > 0) { // eslint-disable-next-line unicorn/no-array-reduce array.push(secrets.reduce((x, y) => [...x, ...y])); } array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '' && x.name !== 'prototype' && x.name !== 'length'); array = array.map((x) => { x.name = __1.Input.ToEnvVarFormat(x.name); x.value = `${x.value}`; return x; }); return array; } static readBuildParameters(array) { const keys = Object.keys(cloud_runner_state_1.CloudRunnerState.buildParams); for (const element of keys) { array.push({ name: element, value: cloud_runner_state_1.CloudRunnerState.buildParams[element], }); } array.push({ name: 'buildParameters', value: JSON.stringify(cloud_runner_state_1.CloudRunnerState.buildParams) }); return array; } static readInput(array) { const input = Object.getOwnPropertyNames(__1.Input); for (const element of input) { if (typeof __1.Input[element] !== 'function' && array.filter((x) => x.name === element).length === 0) { array.push({ name: element, value: `${__1.Input[element]}`, }); } } return array; } static setupDefaultSecrets() { if (cloud_runner_state_1.CloudRunnerState.defaultSecrets === undefined) cloud_runner_state_1.CloudRunnerState.defaultSecrets = image_environment_factory_1.default.getEnvironmentVariables(cloud_runner_state_1.CloudRunnerState.buildParams).map((x) => { return { ParameterKey: x.name, EnvironmentVariable: x.name, ParameterValue: x.value, }; }); } } exports.TaskParameterSerializer = TaskParameterSerializer; /***/ }), /***/ 70912: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CloudRunnerState = void 0; const path_1 = __importDefault(__webpack_require__(85622)); class CloudRunnerState { // only the following paths that do not start a path.join with another "Full" suffixed property need to start with an absolute / static get buildPathFull() { return path_1.default.join(`/`, CloudRunnerState.buildVolumeFolder, CloudRunnerState.buildParams.buildGuid); } static get cacheFolderFull() { return path_1.default.join('/', CloudRunnerState.buildVolumeFolder, CloudRunnerState.cacheFolder, CloudRunnerState.branchName); } static setup(buildParameters) { CloudRunnerState.buildParams = buildParameters; } static get branchName() { return CloudRunnerState.buildParams.branch; } static get builderPathFull() { return path_1.default.join(CloudRunnerState.buildPathFull, `builder`); } static get repoPathFull() { return path_1.default.join(CloudRunnerState.buildPathFull, CloudRunnerState.repositoryFolder); } static get projectPathFull() { return path_1.default.join(CloudRunnerState.repoPathFull, CloudRunnerState.buildParams.projectPath); } static get libraryFolderFull() { return path_1.default.join(CloudRunnerState.projectPathFull, `Library`); } static get lfsDirectoryFull() { return path_1.default.join(CloudRunnerState.repoPathFull, `.git`, `lfs`); } static get purgeRemoteCaching() { return process.env.PURGE_REMOTE_BUILDER_CACHE !== undefined; } static get lfsCacheFolderFull() { return path_1.default.join(CloudRunnerState.cacheFolderFull, `lfs`); } static get libraryCacheFolderFull() { return path_1.default.join(CloudRunnerState.cacheFolderFull, `lib`); } static get unityBuilderRepoUrl() { return `https://${CloudRunnerState.buildParams.githubToken}@github.com/game-ci/unity-builder.git`; } static get targetBuildRepoUrl() { return `https://${CloudRunnerState.buildParams.githubToken}@github.com/${CloudRunnerState.buildParams.githubRepo}.git`; } static get buildVolumeFolder() { return 'data'; } static get cacheFolder() { return 'cache'; } } exports.CloudRunnerState = CloudRunnerState; CloudRunnerState.repositoryFolder = 'repo'; /***/ }), /***/ 64854: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CloudRunnerStepState = void 0; class CloudRunnerStepState { constructor(image, environmentVariables, secrets) { this.image = image; this.environment = environmentVariables; this.secrets = secrets; } } exports.CloudRunnerStepState = CloudRunnerStepState; /***/ }), /***/ 91491: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BuildStep = void 0; const path_1 = __importDefault(__webpack_require__(85622)); const __1 = __webpack_require__(41359); const cloud_runner_build_command_process_1 = __webpack_require__(71899); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const cloud_runner_state_1 = __webpack_require__(70912); class BuildStep { run(cloudRunnerStepState) { return __awaiter(this, void 0, void 0, function* () { return yield BuildStep.BuildStep(cloudRunnerStepState.image, cloudRunnerStepState.environment, cloudRunnerStepState.secrets); }); } static BuildStep(image, environmentVariables, secrets) { return __awaiter(this, void 0, void 0, function* () { cloud_runner_logger_1.default.logLine(` `); cloud_runner_logger_1.default.logLine('Starting part 2/2 (build unity project)'); const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`)); return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, ` ${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '} export GITHUB_WORKSPACE="${cloud_runner_state_1.CloudRunnerState.repoPathFull}" cp -r "${path_1.default .join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'default-build-script') .replace(/\\/g, `/`)}" "/UnityBuilderAction" cp -r "${path_1.default .join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'entrypoint.sh') .replace(/\\/g, `/`)}" "/entrypoint.sh" cp -r "${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'steps').replace(/\\/g, `/`)}" "/steps" chmod -R +x "/entrypoint.sh" chmod -R +x "/steps" /entrypoint.sh apt-get update apt-get install -y -q zip tree cd "${cloud_runner_state_1.CloudRunnerState.libraryFolderFull.replace(/\\/g, `/`)}/.." zip -r "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "Library" mv "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/lib" cd "${cloud_runner_state_1.CloudRunnerState.repoPathFull.replace(/\\/g, `/`)}" ${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh zip -r "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "build" ${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh ${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}" mv "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}" ${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}" ${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '} `, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.projectPathFull}`, environmentVariables, secrets); }); } } exports.BuildStep = BuildStep; /***/ }), /***/ 58923: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SetupStep = void 0; const path_1 = __importDefault(__webpack_require__(85622)); const __1 = __webpack_require__(41359); const cloud_runner_build_command_process_1 = __webpack_require__(71899); const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const cloud_runner_state_1 = __webpack_require__(70912); class SetupStep { run(cloudRunnerStepState) { return __awaiter(this, void 0, void 0, function* () { try { return yield SetupStep.downloadRepository(cloudRunnerStepState.image, cloudRunnerStepState.environment, cloudRunnerStepState.secrets); } catch (error) { throw error; } }); } static downloadRepository(image, environmentVariables, secrets) { return __awaiter(this, void 0, void 0, function* () { try { cloud_runner_logger_1.default.log(` `); cloud_runner_logger_1.default.logLine('Starting step 1/2 (setup game files from repository)'); const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`)); return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, ` ${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '} apk update -q apk add unzip zip git-lfs jq tree nodejs -q ${__1.Input.cloudRunnerTests ? '' : '#'} apk add tree -q export GIT_DISCOVERY_ACROSS_FILESYSTEM=1 mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)} git clone -q -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}" ${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)} chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli ${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '} `, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets); } catch (error) { cloud_runner_logger_1.default.logLine(`Failed download repository step 1/2`); throw error; } }); } } exports.SetupStep = SetupStep; /***/ }), /***/ 94655: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BuildAutomationWorkflow = void 0; const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const task_parameter_serializer_1 = __webpack_require__(35346); const cloud_runner_state_1 = __webpack_require__(70912); const cloud_runner_step_state_1 = __webpack_require__(64854); const build_step_1 = __webpack_require__(91491); const setup_step_1 = __webpack_require__(58923); const custom_workflow_1 = __webpack_require__(3786); const core = __importStar(__webpack_require__(42186)); class BuildAutomationWorkflow { run(cloudRunnerStepState) { return __awaiter(this, void 0, void 0, function* () { try { return yield BuildAutomationWorkflow.standardBuildAutomation(cloudRunnerStepState.image); } catch (error) { throw error; } }); } static standardBuildAutomation(baseImage) { return __awaiter(this, void 0, void 0, function* () { try { cloud_runner_logger_1.default.log(`Cloud Runner is running standard build automation`); core.startGroup('pre build steps'); let output = ''; if (cloud_runner_state_1.CloudRunnerState.buildParams.preBuildSteps !== '') { output += yield custom_workflow_1.CustomWorkflow.runCustomJob(cloud_runner_state_1.CloudRunnerState.buildParams.preBuildSteps); } core.endGroup(); cloud_runner_logger_1.default.logWithTime('Configurable pre build step(s) time'); core.startGroup('setup'); output += yield new setup_step_1.SetupStep().run(new cloud_runner_step_state_1.CloudRunnerStepState('alpine/git', task_parameter_serializer_1.TaskParameterSerializer.readBuildEnvironmentVariables(), cloud_runner_state_1.CloudRunnerState.defaultSecrets)); core.endGroup(); cloud_runner_logger_1.default.logWithTime('Download repository step time'); core.startGroup('build'); output += yield new build_step_1.BuildStep().run(new cloud_runner_step_state_1.CloudRunnerStepState(baseImage, task_parameter_serializer_1.TaskParameterSerializer.readBuildEnvironmentVariables(), cloud_runner_state_1.CloudRunnerState.defaultSecrets)); core.endGroup(); cloud_runner_logger_1.default.logWithTime('Build time'); core.startGroup('post build steps'); if (cloud_runner_state_1.CloudRunnerState.buildParams.postBuildSteps !== '') { output += yield custom_workflow_1.CustomWorkflow.runCustomJob(cloud_runner_state_1.CloudRunnerState.buildParams.postBuildSteps); } core.endGroup(); cloud_runner_logger_1.default.logWithTime('Configurable post build step(s) time'); cloud_runner_logger_1.default.log(`Cloud Runner finished running standard build automation`); return output; } catch (error) { throw error; } }); } } exports.BuildAutomationWorkflow = BuildAutomationWorkflow; /***/ }), /***/ 3786: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CustomWorkflow = void 0; const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); const cloud_runner_state_1 = __webpack_require__(70912); const yaml_1 = __importDefault(__webpack_require__(13552)); const __1 = __webpack_require__(41359); const task_parameter_serializer_1 = __webpack_require__(35346); class CustomWorkflow { static runCustomJob(buildSteps) { return __awaiter(this, void 0, void 0, function* () { try { cloud_runner_logger_1.default.log(`Cloud Runner is running in custom job mode`); if (__1.Input.cloudRunnerTests) { cloud_runner_logger_1.default.log(`Parsing build steps: ${buildSteps}`); } try { buildSteps = yaml_1.default.parse(buildSteps); let output = ''; for (const step of buildSteps) { const stepSecrets = step.secrets.map((x) => { const secret = { ParameterKey: x.name, EnvironmentVariable: __1.Input.ToEnvVarFormat(x.name), ParameterValue: x.value, }; return secret; }); output += yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, step['image'], step['commands'], `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, task_parameter_serializer_1.TaskParameterSerializer.readBuildEnvironmentVariables(), [...cloud_runner_state_1.CloudRunnerState.defaultSecrets, ...stepSecrets]); } return output; } catch (error) { cloud_runner_logger_1.default.log(`failed to parse a custom job "${buildSteps}"`); throw error; } } catch (error) { throw error; } }); } } exports.CustomWorkflow = CustomWorkflow; /***/ }), /***/ 54204: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.WorkflowCompositionRoot = void 0; const cloud_runner_state_1 = __webpack_require__(70912); const cloud_runner_step_state_1 = __webpack_require__(64854); const custom_workflow_1 = __webpack_require__(3786); const build_automation_workflow_1 = __webpack_require__(94655); const task_parameter_serializer_1 = __webpack_require__(35346); const setup_step_1 = __webpack_require__(58923); class WorkflowCompositionRoot { run(cloudRunnerStepState) { return __awaiter(this, void 0, void 0, function* () { try { return yield WorkflowCompositionRoot.runJob(cloudRunnerStepState.image.toString()); } catch (error) { throw error; } }); } static runJob(baseImage) { return __awaiter(this, void 0, void 0, function* () { try { if (cloud_runner_state_1.CloudRunnerState.buildParams.customJob === `setup`) { return yield new setup_step_1.SetupStep().run(new cloud_runner_step_state_1.CloudRunnerStepState(baseImage, task_parameter_serializer_1.TaskParameterSerializer.readBuildEnvironmentVariables(), cloud_runner_state_1.CloudRunnerState.defaultSecrets)); } else if (cloud_runner_state_1.CloudRunnerState.buildParams.customJob !== '') { return yield custom_workflow_1.CustomWorkflow.runCustomJob(cloud_runner_state_1.CloudRunnerState.buildParams.customJob); } return yield new build_automation_workflow_1.BuildAutomationWorkflow().run(new cloud_runner_step_state_1.CloudRunnerStepState(baseImage, task_parameter_serializer_1.TaskParameterSerializer.readBuildEnvironmentVariables(), cloud_runner_state_1.CloudRunnerState.defaultSecrets)); } catch (error) { throw error; } }); } } exports.WorkflowCompositionRoot = WorkflowCompositionRoot; /***/ }), /***/ 16934: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const exec_1 = __webpack_require__(71514); const image_tag_1 = __importDefault(__webpack_require__(57648)); const image_environment_factory_1 = __importDefault(__webpack_require__(25145)); class Docker { static build(buildParameters, silent = false) { return __awaiter(this, void 0, void 0, function* () { const { path, dockerfile, baseImage } = buildParameters; const { version, platform } = baseImage; const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform }); const command = `docker build ${path} \ --file ${dockerfile} \ --build-arg IMAGE=${baseImage} \ --tag ${tag}`; yield exec_1.exec(command, undefined, { silent }); return tag; }); } static run(image, parameters, silent = false) { return __awaiter(this, void 0, void 0, function* () { const { workspace, runnerTempPath, sshAgent } = parameters; const command = `docker run \ --workdir /github/workspace \ --rm \ ${image_environment_factory_1.default.getEnvVarString(parameters)} \ --volume "/var/run/docker.sock":"/var/run/docker.sock" \ --volume "${runnerTempPath}/_github_home":"/root" \ --volume "${runnerTempPath}/_github_workflow":"/github/workflow" \ --volume "${workspace}":"/github/workspace" \ ${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \ ${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \ ${image}`; yield exec_1.exec(command, undefined, { silent }); }); } } exports.default = Docker; /***/ }), /***/ 26574: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class NotImplementedException extends Error { constructor(message = '') { super(message); this.name = 'NotImplementedException'; } } exports.default = NotImplementedException; /***/ }), /***/ 97266: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class ValidationError extends Error { constructor(message = '') { super(message); this.name = 'ValidationError'; } } exports.default = ValidationError; /***/ }), /***/ 25145: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const test_license_reader_1 = __webpack_require__(13963); class Parameter { } class ImageEnvironmentFactory { static getEnvVarString(parameters) { const environmentVariables = ImageEnvironmentFactory.getEnvironmentVariables(parameters); let string = ''; for (const p of environmentVariables) { if (p.value === '' || p.value === undefined) { continue; } if (p.value.toString().includes(`\n`)) { string += `--env ${p.name} `; continue; } string += `--env ${p.name}="${p.value}" `; } return string; } static getEnvironmentVariables(parameters) { const { version, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, customParameters, sshAgent, chownFilesTo, } = parameters; const environmentVariables = [ { name: 'UNITY_LICENSE', value: process.env.UNITY_LICENSE || test_license_reader_1.ReadLicense() }, { name: 'UNITY_LICENSE_FILE', value: process.env.UNITY_LICENSE_FILE }, { name: 'UNITY_EMAIL', value: process.env.UNITY_EMAIL }, { name: 'UNITY_PASSWORD', value: process.env.UNITY_PASSWORD }, { name: 'UNITY_SERIAL', value: process.env.UNITY_SERIAL }, { name: 'UNITY_VERSION', value: version }, { name: 'USYM_UPLOAD_AUTH_TOKEN', value: process.env.USYM_UPLOAD_AUTH_TOKEN }, { name: 'PROJECT_PATH', value: projectPath }, { name: 'BUILD_TARGET', value: platform }, { name: 'BUILD_NAME', value: buildName }, { name: 'BUILD_PATH', value: buildPath }, { name: 'BUILD_FILE', value: buildFile }, { name: 'BUILD_METHOD', value: buildMethod }, { name: 'VERSION', value: buildVersion }, { name: 'ANDROID_VERSION_CODE', value: androidVersionCode }, { name: 'ANDROID_KEYSTORE_NAME', value: androidKeystoreName }, { name: 'ANDROID_KEYSTORE_BASE64', value: androidKeystoreBase64 }, { name: 'ANDROID_KEYSTORE_PASS', value: androidKeystorePass }, { name: 'ANDROID_KEYALIAS_NAME', value: androidKeyaliasName }, { name: 'ANDROID_KEYALIAS_PASS', value: androidKeyaliasPass }, { name: 'CUSTOM_PARAMETERS', value: customParameters }, { name: 'CHOWN_FILES_TO', value: chownFilesTo }, { name: 'GITHUB_REF', value: process.env.GITHUB_REF }, { name: 'GITHUB_SHA', value: process.env.GITHUB_SHA }, { name: 'GITHUB_REPOSITORY', value: process.env.GITHUB_REPOSITORY }, { name: 'GITHUB_ACTOR', value: process.env.GITHUB_ACTOR }, { name: 'GITHUB_WORKFLOW', value: process.env.GITHUB_WORKFLOW }, { name: 'GITHUB_HEAD_REF', value: process.env.GITHUB_HEAD_REF }, { name: 'GITHUB_BASE_REF', value: process.env.GITHUB_BASE_REF }, { name: 'GITHUB_EVENT_NAME', value: process.env.GITHUB_EVENT_NAME }, { name: 'GITHUB_WORKSPACE', value: '/github/workspace' }, { name: 'GITHUB_ACTION', value: process.env.GITHUB_ACTION }, { name: 'GITHUB_EVENT_PATH', value: process.env.GITHUB_EVENT_PATH }, { name: 'RUNNER_OS', value: process.env.RUNNER_OS }, { name: 'RUNNER_TOOL_CACHE', value: process.env.RUNNER_TOOL_CACHE }, { name: 'RUNNER_TEMP', value: process.env.RUNNER_TEMP }, { name: 'RUNNER_WORKSPACE', value: process.env.RUNNER_WORKSPACE }, ]; if (sshAgent) environmentVariables.push({ name: 'SSH_AUTH_SOCK', value: '/ssh-agent' }); return environmentVariables; } } exports.default = ImageEnvironmentFactory; /***/ }), /***/ 57648: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const platform_1 = __importDefault(__webpack_require__(9707)); class ImageTag { constructor(imageProperties) { const { repository = 'unityci', name = 'editor', version = '2019.2.11f1', platform, customImage } = imageProperties; if (!ImageTag.versionPattern.test(version)) { throw new Error(`Invalid version "${version}".`); } const builderPlatform = ImageTag.getTargetPlatformToImageSuffixMap(platform, version); this.repository = repository; this.name = name; this.version = version; this.platform = platform; this.builderPlatform = builderPlatform; this.customImage = customImage; } static get versionPattern() { return /^20\d{2}\.\d\.\w{3,4}|3$/; } static get imageSuffixes() { return { generic: '', webgl: 'webgl', mac: 'mac-mono', windows: 'windows-mono', linux: 'base', linuxIl2cpp: 'linux-il2cpp', android: 'android', ios: 'ios', facebook: 'facebook', }; } static getTargetPlatformToImageSuffixMap(platform, version) { const { generic, webgl, mac, windows, linux, linuxIl2cpp, android, ios, facebook } = ImageTag.imageSuffixes; const [major, minor] = version.split('.').map((digit) => Number(digit)); // @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html switch (platform) { case platform_1.default.types.StandaloneOSX: return mac; case platform_1.default.types.StandaloneWindows: return windows; case platform_1.default.types.StandaloneWindows64: return windows; case platform_1.default.types.StandaloneLinux64: { // Unity versions before 2019.3 do not support il2cpp if (major >= 2020 || (major === 2019 && minor >= 3)) { return linuxIl2cpp; } return linux; } case platform_1.default.types.iOS: return ios; case platform_1.default.types.Android: return android; case platform_1.default.types.WebGL: return webgl; case platform_1.default.types.WSAPlayer: return windows; case platform_1.default.types.PS4: return windows; case platform_1.default.types.XboxOne: return windows; case platform_1.default.types.tvOS: return windows; case platform_1.default.types.Switch: return windows; // Unsupported case platform_1.default.types.Lumin: return windows; case platform_1.default.types.BJM: return windows; case platform_1.default.types.Stadia: return windows; case platform_1.default.types.Facebook: return facebook; case platform_1.default.types.NoTarget: return generic; // Test specific case platform_1.default.types.Test: return generic; default: throw new Error(` Platform must be one of the ones described in the documentation. "${platform}" is currently not supported.`); } } get tag() { return `${this.version}-${this.builderPlatform}`.replace(/-+$/, ''); } get image() { return `${this.repository}/${this.name}`.replace(/^\/+/, ''); } toString() { const { image, tag, customImage } = this; if (customImage && customImage !== '') { return customImage; } return `${image}:${tag}-0`; // '0' here represents the docker repo version } } exports.default = ImageTag; /***/ }), /***/ 41359: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CloudRunner = exports.Versioning = exports.Unity = exports.Project = exports.Platform = exports.Output = exports.ImageTag = exports.Input = exports.Docker = exports.Cache = exports.BuildParameters = exports.Action = void 0; const action_1 = __importDefault(__webpack_require__(89088)); exports.Action = action_1.default; const build_parameters_1 = __importDefault(__webpack_require__(80787)); exports.BuildParameters = build_parameters_1.default; const cache_1 = __importDefault(__webpack_require__(97134)); exports.Cache = cache_1.default; const docker_1 = __importDefault(__webpack_require__(16934)); exports.Docker = docker_1.default; const input_1 = __importDefault(__webpack_require__(91933)); exports.Input = input_1.default; const image_tag_1 = __importDefault(__webpack_require__(57648)); exports.ImageTag = image_tag_1.default; const output_1 = __importDefault(__webpack_require__(85487)); exports.Output = output_1.default; const platform_1 = __importDefault(__webpack_require__(9707)); exports.Platform = platform_1.default; const project_1 = __importDefault(__webpack_require__(88666)); exports.Project = project_1.default; const unity_1 = __importDefault(__webpack_require__(70498)); exports.Unity = unity_1.default; const versioning_1 = __importDefault(__webpack_require__(88729)); exports.Versioning = versioning_1.default; const cloud_runner_1 = __importDefault(__webpack_require__(79144)); exports.CloudRunner = cloud_runner_1.default; /***/ }), /***/ 11091: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ActionYamlReader = void 0; const fs_1 = __importDefault(__webpack_require__(35747)); const path_1 = __importDefault(__webpack_require__(85622)); const yaml_1 = __importDefault(__webpack_require__(13552)); class ActionYamlReader { constructor() { let filename = `action.yml`; if (!fs_1.default.existsSync(filename)) { filename = path_1.default.join(__dirname, `..`, filename); } this.actionYamlParsed = yaml_1.default.parse(fs_1.default.readFileSync(filename).toString()); } GetActionYamlValue(key) { var _a; return ((_a = this.actionYamlParsed.inputs[key]) === null || _a === void 0 ? void 0 : _a.description) || 'No description found in action.yml'; } } exports.ActionYamlReader = ActionYamlReader; /***/ }), /***/ 24271: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GitRepoReader = void 0; const console_1 = __webpack_require__(57082); const system_1 = __importDefault(__webpack_require__(62177)); const fs_1 = __importDefault(__webpack_require__(35747)); class GitRepoReader { static GetSha() { return ''; } static GetRemote() { return __awaiter(this, void 0, void 0, function* () { return (yield system_1.default.run(`git remote -v`, [], {}, false)) .split(' ')[1] .split('https://github.com/')[1] .split('.git')[0]; }); } static GetBranch() { return __awaiter(this, void 0, void 0, function* () { console_1.assert(fs_1.default.existsSync(`.git`)); return (yield system_1.default.run(`git branch`, [], {}, false)).split('*')[1].split(`\n`)[0].replace(/ /g, ``); }); } } exports.GitRepoReader = GitRepoReader; /***/ }), /***/ 44990: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GithubCliReader = void 0; const system_1 = __importDefault(__webpack_require__(62177)); class GithubCliReader { static GetGitHubAuthToken() { return __awaiter(this, void 0, void 0, function* () { try { return (yield system_1.default.run(`gh auth status -t`, [], {}, false)) .split(`Token: `)[1] .replace(/ /g, '') .replace(/\n/g, ''); } catch (_a) { return ''; } }); } } exports.GithubCliReader = GithubCliReader; /***/ }), /***/ 13963: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ReadLicense = void 0; const path_1 = __importDefault(__webpack_require__(85622)); const fs_1 = __importDefault(__webpack_require__(35747)); const yaml_1 = __importDefault(__webpack_require__(13552)); function ReadLicense() { const pipelineFile = path_1.default.join(__dirname, `.github`, `workflows`, `cloud-runner-k8s-pipeline.yml`); return fs_1.default.existsSync(pipelineFile) ? yaml_1.default.parse(fs_1.default.readFileSync(pipelineFile, 'utf8')).env.UNITY_LICENSE : ''; } exports.ReadLicense = ReadLicense; /***/ }), /***/ 91933: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs_1 = __importDefault(__webpack_require__(35747)); const path_1 = __importDefault(__webpack_require__(85622)); const git_repo_1 = __webpack_require__(24271); const github_cli_1 = __webpack_require__(44990); const platform_1 = __importDefault(__webpack_require__(9707)); const core = __webpack_require__(42186); /** * Input variables specified in workflows using "with" prop. * * Note that input is always passed as a string, even booleans. */ class Input { // also enabled debug logging for cloud runner static get cloudRunnerTests() { return Input.getInput(`cloudRunnerTests`) || Input.getInput(`CloudRunnerTests`) || false; } static getInput(query) { const coreInput = core.getInput(query); if (Input.githubInputEnabled && coreInput && coreInput !== '') { return coreInput; } return Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined ? Input.cliOptions[query] : process.env[query] !== undefined ? process.env[query] : process.env[Input.ToEnvVarFormat(query)] ? process.env[Input.ToEnvVarFormat(query)] : ''; } static get region() { return Input.getInput('region') || 'eu-west-2'; } static githubRepo() { return __awaiter(this, void 0, void 0, function* () { return (Input.getInput('GITHUB_REPOSITORY') || Input.getInput('GITHUB_REPO') || (yield git_repo_1.GitRepoReader.GetRemote()) || 'game-ci/unity-builder'); }); } static branch() { return __awaiter(this, void 0, void 0, function* () { if (yield git_repo_1.GitRepoReader.GetBranch()) { return yield git_repo_1.GitRepoReader.GetBranch(); } else if (Input.getInput(`GITHUB_REF`)) { return Input.getInput(`GITHUB_REF`).replace('refs/', '').replace(`head/`, ''); } else if (Input.getInput('branch')) { return Input.getInput('branch'); } else { return 'main'; } }); } static get gitSha() { if (Input.getInput(`GITHUB_SHA`)) { return Input.getInput(`GITHUB_SHA`); } else if (Input.getInput(`GitSHA`)) { return Input.getInput(`GitSHA`); } else if (git_repo_1.GitRepoReader.GetSha()) { return git_repo_1.GitRepoReader.GetSha(); } } static get runNumber() { return Input.getInput('GITHUB_RUN_NUMBER') || '0'; } static get unityVersion() { return Input.getInput('unityVersion') || 'auto'; } static get customImage() { return Input.getInput('customImage'); } static get targetPlatform() { return Input.getInput('targetPlatform') || platform_1.default.default; } static get projectPath() { const input = Input.getInput('projectPath'); const rawProjectPath = input ? input : fs_1.default.existsSync(path_1.default.join('test-project', 'ProjectSettings', 'ProjectVersion.txt')) && !fs_1.default.existsSync(path_1.default.join('ProjectSettings', 'ProjectVersion.txt')) ? 'test-project' : '.'; return rawProjectPath.replace(/\/$/, ''); } static get buildName() { return Input.getInput('buildName') || this.targetPlatform; } static get buildsPath() { return Input.getInput('buildsPath') || 'build'; } static get buildMethod() { return Input.getInput('buildMethod') || ''; // processed in docker file } static get versioningStrategy() { return Input.getInput('versioning') || 'Semantic'; } static get specifiedVersion() { return Input.getInput('version') || ''; } static get androidVersionCode() { return Input.getInput('androidVersionCode'); } static get androidAppBundle() { const input = Input.getInput('androidAppBundle') || false; return input === 'true'; } static get androidKeystoreName() { return Input.getInput('androidKeystoreName') || ''; } static get androidKeystoreBase64() { return Input.getInput('androidKeystoreBase64') || ''; } static get androidKeystorePass() { return Input.getInput('androidKeystorePass') || ''; } static get androidKeyaliasName() { return Input.getInput('androidKeyaliasName') || ''; } static get androidKeyaliasPass() { return Input.getInput('androidKeyaliasPass') || ''; } static get androidTargetSdkVersion() { return core.getInput('androidTargetSdkVersion') || ''; } static get allowDirtyBuild() { const input = Input.getInput('allowDirtyBuild') || false; return input === 'true'; } static get customParameters() { return Input.getInput('customParameters') || ''; } static get sshAgent() { return Input.getInput('sshAgent') || ''; } static githubToken() { return __awaiter(this, void 0, void 0, function* () { return Input.getInput('githubToken') || (yield github_cli_1.GithubCliReader.GetGitHubAuthToken()) || ''; }); } static gitPrivateToken() { return __awaiter(this, void 0, void 0, function* () { return core.getInput('gitPrivateToken') || (yield github_cli_1.GithubCliReader.GetGitHubAuthToken()) || ''; }); } static get chownFilesTo() { return Input.getInput('chownFilesTo') || ''; } static get postBuildSteps() { return Input.getInput('postBuildSteps') || ''; } static get preBuildSteps() { return Input.getInput('preBuildSteps') || ''; } static get customJob() { return Input.getInput('customJob') || ''; } static get cloudRunnerCluster() { return Input.getInput('cloudRunnerCluster') || ''; } static get awsBaseStackName() { return Input.getInput('awsBaseStackName') || 'game-ci'; } static get kubeConfig() { return Input.getInput('kubeConfig') || ''; } static get cloudRunnerMemory() { return Input.getInput('cloudRunnerMemory') || '750M'; } static get cloudRunnerCpu() { return Input.getInput('cloudRunnerCpu') || '1.0'; } static get kubeVolumeSize() { return Input.getInput('kubeVolumeSize') || '5Gi'; } static get kubeVolume() { return Input.getInput('kubeVolume') || ''; } static ToEnvVarFormat(input) { return input .replace(/([A-Z])/g, ' $1') .trim() .toUpperCase() .replace(/ /g, '_'); } } Input.githubInputEnabled = true; exports.default = Input; /***/ }), /***/ 85487: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __webpack_require__(42186); class Output { static setBuildVersion(buildVersion) { return __awaiter(this, void 0, void 0, function* () { yield core.setOutput('buildVersion', buildVersion); }); } } exports.default = Output; /***/ }), /***/ 9707: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class Platform { static get default() { return Platform.types.StandaloneWindows64; } static get types() { return { StandaloneOSX: 'StandaloneOSX', StandaloneWindows: 'StandaloneWindows', StandaloneWindows64: 'StandaloneWindows64', StandaloneLinux64: 'StandaloneLinux64', iOS: 'iOS', Android: 'Android', WebGL: 'WebGL', WSAPlayer: 'WSAPlayer', PS4: 'PS4', XboxOne: 'XboxOne', tvOS: 'tvOS', Switch: 'Switch', // Unsupported Lumin: 'Lumin', BJM: 'BJM', Stadia: 'Stadia', Facebook: 'Facebook', NoTarget: 'NoTarget', // Test specific Test: 'Test', }; } static isWindows(platform) { switch (platform) { case Platform.types.StandaloneWindows: case Platform.types.StandaloneWindows64: return true; default: return false; } } static isAndroid(platform) { switch (platform) { case Platform.types.Android: return true; default: return false; } } } exports.default = Platform; /***/ }), /***/ 88666: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const input_1 = __importDefault(__webpack_require__(91933)); const unity_1 = __importDefault(__webpack_require__(70498)); const action_1 = __importDefault(__webpack_require__(89088)); class Project { static get relativePath() { const { projectPath } = input_1.default; return `${projectPath}`; } static get absolutePath() { const { workspace } = action_1.default; return `${workspace}/${this.relativePath}`; } static get libraryFolder() { return `${this.relativePath}/${unity_1.default.libraryFolder}`; } } exports.default = Project; /***/ }), /***/ 62177: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const exec_1 = __webpack_require__(71514); class System { static run(command, arguments_ = [], options = {}, shouldLog = true) { return __awaiter(this, void 0, void 0, function* () { let result = ''; let error = ''; let debug = ''; const listeners = { stdout: (dataBuffer) => { result += dataBuffer.toString(); }, stderr: (dataBuffer) => { error += dataBuffer.toString(); }, debug: (dataString) => { debug += dataString.toString(); }, }; const showOutput = () => { if (debug !== '' && shouldLog) { core.debug(debug); } if (result !== '' && shouldLog) { core.info(result); } if (error !== '' && shouldLog) { core.warning(error); } }; const throwContextualError = (message) => { let commandAsString = command; if (Array.isArray(arguments_)) { commandAsString += ` ${arguments_.join(' ')}`; } else if (typeof arguments_ === 'string') { commandAsString += ` ${arguments_}`; } throw new Error(`Failed to run "${commandAsString}".\n ${message}`); }; try { const exitCode = yield exec_1.exec(command, arguments_, Object.assign({ silent: true, listeners }, options)); showOutput(); if (exitCode !== 0) { throwContextualError(`Command returned non-zero exit code.\nError: ${error}`); } } catch (inCommandError) { showOutput(); throwContextualError(`In-command error caught: ${inCommandError}`); } return result; }); } } exports.default = System; /***/ }), /***/ 17146: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __importStar(__webpack_require__(35747)); const path_1 = __importDefault(__webpack_require__(85622)); class UnityVersioning { static get versionPattern() { return /20\d{2}\.\d\.\w{3,4}|3/; } static determineUnityVersion(projectPath, unityVersion) { if (unityVersion === 'auto') { return UnityVersioning.read(projectPath); } return unityVersion; } static read(projectPath) { const filePath = path_1.default.join(projectPath, 'ProjectSettings', 'ProjectVersion.txt'); if (!fs.existsSync(filePath)) { throw new Error(`Project settings file not found at "${filePath}". Have you correctly set the projectPath?`); } return UnityVersioning.parse(fs.readFileSync(filePath, 'utf8')); } static parse(projectVersionTxt) { const matches = projectVersionTxt.match(UnityVersioning.versionPattern); if (!matches || matches.length === 0) { throw new Error(`Failed to parse version from "${projectVersionTxt}".`); } return matches[0]; } } exports.default = UnityVersioning; /***/ }), /***/ 70498: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class Unity { static get libraryFolder() { return 'Library'; } } exports.default = Unity; /***/ }), /***/ 88729: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__webpack_require__(42186)); const not_implemented_exception_1 = __importDefault(__webpack_require__(26574)); const validation_error_1 = __importDefault(__webpack_require__(97266)); const input_1 = __importDefault(__webpack_require__(91933)); const system_1 = __importDefault(__webpack_require__(62177)); class Versioning { static get projectPath() { return input_1.default.projectPath; } static get isDirtyAllowed() { return input_1.default.allowDirtyBuild; } static get strategies() { return { None: 'None', Semantic: 'Semantic', Tag: 'Tag', Custom: 'Custom' }; } /** * Get the branch name of the (related) branch */ static get branch() { // Todo - use optional chaining (https://github.com/zeit/ncc/issues/534) return this.headRef || (this.ref && this.ref.slice(11)); } /** * For pull requests we can reliably use GITHUB_HEAD_REF */ static get headRef() { return process.env.GITHUB_HEAD_REF; } /** * For branches GITHUB_REF will have format `refs/heads/feature-branch-1` */ static get ref() { return process.env.GITHUB_REF; } /** * The commit SHA that triggered the workflow run. */ static get sha() { return process.env.GITHUB_SHA; } /** * Maximum number of lines to print when logging the git diff */ static get maxDiffLines() { return 60; } /** * Log up to maxDiffLines of the git diff. */ static logDiff() { return __awaiter(this, void 0, void 0, function* () { const diffCommand = `git --no-pager diff | head -n ${this.maxDiffLines.toString()}`; yield system_1.default.run('sh', undefined, { input: Buffer.from(diffCommand), silent: true, }); }); } /** * Regex to parse version description into separate fields */ static get descriptionRegex1() { return /^v?([\d.]+)-(\d+)-g(\w+)-?(\w+)*/g; } static get descriptionRegex2() { return /^v?([\d.]+-\w+)-(\d+)-g(\w+)-?(\w+)*/g; } static get descriptionRegex3() { return /^v?([\d.]+-\w+\.\d+)-(\d+)-g(\w+)-?(\w+)*/g; } static determineVersion(strategy, inputVersion) { return __awaiter(this, void 0, void 0, function* () { // Validate input if (!Object.hasOwnProperty.call(this.strategies, strategy)) { throw new validation_error_1.default(`Versioning strategy should be one of ${Object.values(this.strategies).join(', ')}.`); } let version; switch (strategy) { case this.strategies.None: version = 'none'; break; case this.strategies.Custom: version = inputVersion; break; case this.strategies.Semantic: version = yield this.generateSemanticVersion(); break; case this.strategies.Tag: version = yield this.generateTagVersion(); break; default: throw new not_implemented_exception_1.default(`Strategy ${strategy} is not implemented.`); } return version; }); } /** * Automatically generates a version based on SemVer out of the box. * * The version works as follows: `..` for example `0.1.2`. * * The latest tag dictates `.` * The number of commits since that tag dictates``. * * @See: https://semver.org/ */ static generateSemanticVersion() { return __awaiter(this, void 0, void 0, function* () { if (yield this.isShallow()) { yield this.fetch(); } yield this.logDiff(); if ((yield this.isDirty()) && !this.isDirtyAllowed) { throw new Error('Branch is dirty. Refusing to base semantic version on uncommitted changes'); } if (!(yield this.hasAnyVersionTags())) { const version = `0.0.${yield this.getTotalNumberOfCommits()}`; core.info(`Generated version ${version} (no version tags found).`); return version; } const versionDescriptor = yield this.parseSemanticVersion(); if (versionDescriptor) { const { tag, commits, hash } = versionDescriptor; // Ensure 3 digits (commits should always be patch level) const [major, minor, patch] = `${tag}.${commits}`.split('.'); const threeDigitVersion = /^\d+$/.test(patch) ? `${major}.${minor}.${patch}` : `${major}.0.${minor}`; core.info(`Found semantic version ${threeDigitVersion} for ${this.branch}@${hash}`); return `${threeDigitVersion}`; } const version = `0.0.${yield this.getTotalNumberOfCommits()}`; core.info(`Generated version ${version} (semantic version couldn't be determined).`); return version; }); } /** * Generate the proper version for unity based on an existing tag. */ static generateTagVersion() { return __awaiter(this, void 0, void 0, function* () { let tag = yield this.getTag(); if (tag.charAt(0) === 'v') { tag = tag.slice(1); } return tag; }); } /** * Parses the versionDescription into their named parts. */ static parseSemanticVersion() { return __awaiter(this, void 0, void 0, function* () { const description = yield this.getVersionDescription(); try { const [match, tag, commits, hash] = this.descriptionRegex1.exec(description); return { match, tag, commits, hash, }; } catch (_a) { try { const [match, tag, commits, hash] = this.descriptionRegex2.exec(description); return { match, tag, commits, hash, }; } catch (_b) { try { const [match, tag, commits, hash] = this.descriptionRegex3.exec(description); return { match, tag, commits, hash, }; } catch (_c) { core.warning(`Failed to parse git describe output or version can not be determined through: "${description}".`); return false; } } } }); } /** * Returns whether the repository is shallow. */ static isShallow() { return __awaiter(this, void 0, void 0, function* () { const output = yield this.git(['rev-parse', '--is-shallow-repository']); return output !== 'false\n'; }); } /** * Retrieves refs from the configured remote. * * Fetch unshallow for incomplete repository, but fall back to normal fetch. * * Note: `--all` should not be used, and would break fetching for push event. */ static fetch() { return __awaiter(this, void 0, void 0, function* () { try { yield this.git(['fetch', '--unshallow']); } catch (error) { core.warning(`Fetch --unshallow caught: ${error}`); yield this.git(['fetch']); } }); } /** * Retrieves information about the branch. * * Format: `v0.12-24-gd2198ab` * * In this format v0.12 is the latest tag, 24 are the number of commits since, and gd2198ab * identifies the current commit. */ static getVersionDescription() { return __awaiter(this, void 0, void 0, function* () { return this.git(['describe', '--long', '--tags', '--always', this.sha]); }); } /** * Returns whether there are uncommitted changes that are not ignored. */ static isDirty() { return __awaiter(this, void 0, void 0, function* () { const output = yield this.git(['status', '--porcelain']); const isDirty = output !== ''; if (isDirty) { core.warning('Changes were made to the following files and folders:\n'); core.warning(output); } return isDirty; }); } /** * Get the tag if there is one pointing at HEAD */ static getTag() { return __awaiter(this, void 0, void 0, function* () { return (yield this.git(['tag', '--points-at', 'HEAD'])).trim(); }); } /** * Whether or not the repository has any version tags yet. */ static hasAnyVersionTags() { return __awaiter(this, void 0, void 0, function* () { const numberOfCommitsAsString = yield system_1.default.run('sh', undefined, { input: Buffer.from('git tag --list --merged HEAD | grep v[0-9]* | wc -l'), silent: false, }); const numberOfCommits = Number.parseInt(numberOfCommitsAsString, 10); return numberOfCommits !== 0; }); } /** * Get the total number of commits on head. * * Note: HEAD should not be used, as it may be detached, resulting in an additional count. */ static getTotalNumberOfCommits() { return __awaiter(this, void 0, void 0, function* () { const numberOfCommitsAsString = yield this.git(['rev-list', '--count', this.sha]); return Number.parseInt(numberOfCommitsAsString, 10); }); } /** * Run git in the specified project path */ static git(arguments_, options = {}) { return __awaiter(this, void 0, void 0, function* () { return system_1.default.run('git', arguments_, Object.assign({ cwd: this.projectPath }, options)); }); } } exports.default = Versioning; /***/ }), /***/ 87351: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const os = __importStar(__webpack_require__(12087)); const utils_1 = __webpack_require__(5278); /** * Commands * * Command Format: * ::name key=value,key=value::message * * Examples: * ::warning::This is the message * ::set-env name=MY_VAR::some value */ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); process.stdout.write(cmd.toString() + os.EOL); } exports.issueCommand = issueCommand; function issue(name, message = '') { issueCommand(name, {}, message); } exports.issue = issue; const CMD_STRING = '::'; class Command { constructor(command, properties, message) { if (!command) { command = 'missing.command'; } this.command = command; this.properties = properties; this.message = message; } toString() { let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += ' '; let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { if (first) { first = false; } else { cmdStr += ','; } cmdStr += `${key}=${escapeProperty(val)}`; } } } } cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } } function escapeData(s) { return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { return utils_1.toCommandValue(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') .replace(/:/g, '%3A') .replace(/,/g, '%2C'); } //# sourceMappingURL=command.js.map /***/ }), /***/ 42186: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const command_1 = __webpack_require__(87351); const file_command_1 = __webpack_require__(717); const utils_1 = __webpack_require__(5278); const os = __importStar(__webpack_require__(12087)); const path = __importStar(__webpack_require__(85622)); /** * The code to exit an action */ var ExitCode; (function (ExitCode) { /** * A code indicating that the action was successful */ ExitCode[ExitCode["Success"] = 0] = "Success"; /** * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; })(ExitCode = exports.ExitCode || (exports.ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- /** * Sets env variable for this action and future actions in the job * @param name the name of the variable to set * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { const convertedVal = utils_1.toCommandValue(val); process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { const delimiter = '_GitHubActionsFileCommandDelimeter_'; const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; file_command_1.issueCommand('ENV', commandValue); } else { command_1.issueCommand('set-env', { name }, convertedVal); } } exports.exportVariable = exportVariable; /** * Registers a secret which will get masked from logs * @param secret value of the secret */ function setSecret(secret) { command_1.issueCommand('add-mask', {}, secret); } exports.setSecret = setSecret; /** * Prepends inputPath to the PATH (for this action and future actions) * @param inputPath */ function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { file_command_1.issueCommand('PATH', inputPath); } else { command_1.issueCommand('add-path', {}, inputPath); } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } exports.addPath = addPath; /** * Gets the value of an input. The value is also trimmed. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string */ function getInput(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } return val.trim(); } exports.getInput = getInput; /** * Sets the value of an output. * * @param name name of the output to set * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { process.stdout.write(os.EOL); command_1.issueCommand('set-output', { name }, value); } exports.setOutput = setOutput; /** * Enables or disables the echoing of commands into stdout for the rest of the step. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. * */ function setCommandEcho(enabled) { command_1.issue('echo', enabled ? 'on' : 'off'); } exports.setCommandEcho = setCommandEcho; //----------------------------------------------------------------------- // Results //----------------------------------------------------------------------- /** * Sets the action status to failed. * When the action exits it will be with an exit code of 1 * @param message add error issue message */ function setFailed(message) { process.exitCode = ExitCode.Failure; error(message); } exports.setFailed = setFailed; //----------------------------------------------------------------------- // Logging Commands //----------------------------------------------------------------------- /** * Gets whether Actions Step Debug is on or not */ function isDebug() { return process.env['RUNNER_DEBUG'] === '1'; } exports.isDebug = isDebug; /** * Writes debug message to user log * @param message debug message */ function debug(message) { command_1.issueCommand('debug', {}, message); } exports.debug = debug; /** * Adds an error issue * @param message error issue message. Errors will be converted to string via toString() */ function error(message) { command_1.issue('error', message instanceof Error ? message.toString() : message); } exports.error = error; /** * Adds an warning issue * @param message warning issue message. Errors will be converted to string via toString() */ function warning(message) { command_1.issue('warning', message instanceof Error ? message.toString() : message); } exports.warning = warning; /** * Writes info to log with console.log. * @param message info message */ function info(message) { process.stdout.write(message + os.EOL); } exports.info = info; /** * Begin an output group. * * Output until the next `groupEnd` will be foldable in this group * * @param name The name of the output group */ function startGroup(name) { command_1.issue('group', name); } exports.startGroup = startGroup; /** * End an output group. */ function endGroup() { command_1.issue('endgroup'); } exports.endGroup = endGroup; /** * Wrap an asynchronous function call in a group. * * Returns the same type as the function itself. * * @param name The name of the group * @param fn The function to wrap in the group */ function group(name, fn) { return __awaiter(this, void 0, void 0, function* () { startGroup(name); let result; try { result = yield fn(); } finally { endGroup(); } return result; }); } exports.group = group; //----------------------------------------------------------------------- // Wrapper action state //----------------------------------------------------------------------- /** * Saves state for current action, the state can only be retrieved by this action's post job execution. * * @param name name of the state to store * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { command_1.issueCommand('save-state', { name }, value); } exports.saveState = saveState; /** * Gets the value of an state set by this action's main execution. * * @param name name of the state to get * @returns string */ function getState(name) { return process.env[`STATE_${name}`] || ''; } exports.getState = getState; //# sourceMappingURL=core.js.map /***/ }), /***/ 717: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; // For internal use, subject to change. var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__webpack_require__(35747)); const os = __importStar(__webpack_require__(12087)); const utils_1 = __webpack_require__(5278); function issueCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { encoding: 'utf8' }); } exports.issueCommand = issueCommand; //# sourceMappingURL=file-command.js.map /***/ }), /***/ 5278: /***/ ((__unused_webpack_module, exports) => { "use strict"; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty(exports, "__esModule", ({ value: true })); /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string */ function toCommandValue(input) { if (input === null || input === undefined) { return ''; } else if (typeof input === 'string' || input instanceof String) { return input; } return JSON.stringify(input); } exports.toCommandValue = toCommandValue; //# sourceMappingURL=utils.js.map /***/ }), /***/ 71514: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const tr = __importStar(__webpack_require__(88159)); /** * Exec a command. * Output will be streamed to the live console. * Returns promise with return code * * @param commandLine command to execute (can include additional args). Must be correctly escaped. * @param args optional arguments for tool. Escaping is handled by the lib. * @param options optional exec options. See ExecOptions * @returns Promise exit code */ function exec(commandLine, args, options) { return __awaiter(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } // Path to tool to execute should be first arg const toolPath = commandArgs[0]; args = commandArgs.slice(1).concat(args || []); const runner = new tr.ToolRunner(toolPath, args, options); return runner.exec(); }); } exports.exec = exec; //# sourceMappingURL=exec.js.map /***/ }), /***/ 88159: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const os = __importStar(__webpack_require__(12087)); const events = __importStar(__webpack_require__(28614)); const child = __importStar(__webpack_require__(63129)); const path = __importStar(__webpack_require__(85622)); const io = __importStar(__webpack_require__(47351)); const ioUtil = __importStar(__webpack_require__(81962)); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. */ class ToolRunner extends events.EventEmitter { constructor(toolPath, args, options) { super(); if (!toolPath) { throw new Error("Parameter 'toolPath' cannot be null or empty."); } this.toolPath = toolPath; this.args = args || []; this.options = options || {}; } _debug(message) { if (this.options.listeners && this.options.listeners.debug) { this.options.listeners.debug(message); } } _getCommandString(options, noPrefix) { const toolPath = this._getSpawnFileName(); const args = this._getSpawnArgs(options); let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool if (IS_WINDOWS) { // Windows + cmd file if (this._isCmdFile()) { cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } // Windows + verbatim else if (options.windowsVerbatimArguments) { cmd += `"${toolPath}"`; for (const a of args) { cmd += ` ${a}`; } } // Windows (regular) else { cmd += this._windowsQuoteCmdArg(toolPath); for (const a of args) { cmd += ` ${this._windowsQuoteCmdArg(a)}`; } } } else { // OSX/Linux - this can likely be improved with some form of quoting. // creating processes on Unix is fundamentally different than Windows. // on Unix, execvp() takes an arg array. cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } return cmd; } _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); let n = s.indexOf(os.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); // the rest of the string ... s = s.substring(n + os.EOL.length); n = s.indexOf(os.EOL); } strBuffer = s; } catch (err) { // streaming lines to console is best effort. Don't fail a build. this._debug(`error processing line. Failed with error ${err}`); } } _getSpawnFileName() { if (IS_WINDOWS) { if (this._isCmdFile()) { return process.env['COMSPEC'] || 'cmd.exe'; } } return this.toolPath; } _getSpawnArgs(options) { if (IS_WINDOWS) { if (this._isCmdFile()) { let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; for (const a of this.args) { argline += ' '; argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); } argline += '"'; return [argline]; } } return this.args; } _endsWith(str, end) { return str.endsWith(end); } _isCmdFile() { const upperToolPath = this.toolPath.toUpperCase(); return (this._endsWith(upperToolPath, '.CMD') || this._endsWith(upperToolPath, '.BAT')); } _windowsQuoteCmdArg(arg) { // for .exe, apply the normal quoting rules that libuv applies if (!this._isCmdFile()) { return this._uvQuoteCmdArg(arg); } // otherwise apply quoting rules specific to the cmd.exe command line parser. // the libuv rules are generic and are not designed specifically for cmd.exe // command line parser. // // for a detailed description of the cmd.exe command line parser, refer to // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 // need quotes for empty arg if (!arg) { return '""'; } // determine whether the arg needs to be quoted const cmdSpecialChars = [ ' ', '\t', '&', '(', ')', '[', ']', '{', '}', '^', '=', ';', '!', "'", '+', ',', '`', '~', '|', '<', '>', '"' ]; let needsQuotes = false; for (const char of arg) { if (cmdSpecialChars.some(x => x === char)) { needsQuotes = true; break; } } // short-circuit if quotes not needed if (!needsQuotes) { return arg; } // the following quoting rules are very similar to the rules that by libuv applies. // // 1) wrap the string in quotes // // 2) double-up quotes - i.e. " => "" // // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately // doesn't work well with a cmd.exe command line. // // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. // for example, the command line: // foo.exe "myarg:""my val""" // is parsed by a .NET console app into an arg array: // [ "myarg:\"my val\"" ] // which is the same end result when applying libuv quoting rules. although the actual // command line from libuv quoting rules would look like: // foo.exe "myarg:\"my val\"" // // 3) double-up slashes that precede a quote, // e.g. hello \world => "hello \world" // hello\"world => "hello\\""world" // hello\\"world => "hello\\\\""world" // hello world\ => "hello world\\" // // technically this is not required for a cmd.exe command line, or the batch argument parser. // the reasons for including this as a .cmd quoting rule are: // // a) this is optimized for the scenario where the argument is passed from the .cmd file to an // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. // // b) it's what we've been doing previously (by deferring to node default behavior) and we // haven't heard any complaints about that aspect. // // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be // escaped when used on the command line directly - even though within a .cmd file % can be escaped // by using %%. // // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. // // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args // to an external program. // // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. // % can be escaped within a .cmd file. let reverse = '"'; let quoteHit = true; for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; if (quoteHit && arg[i - 1] === '\\') { reverse += '\\'; // double the slash } else if (arg[i - 1] === '"') { quoteHit = true; reverse += '"'; // double the quote } else { quoteHit = false; } } reverse += '"'; return reverse .split('') .reverse() .join(''); } _uvQuoteCmdArg(arg) { // Tool runner wraps child_process.spawn() and needs to apply the same quoting as // Node in certain cases where the undocumented spawn option windowsVerbatimArguments // is used. // // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), // pasting copyright notice from Node within this function: // // Copyright Joyent, Inc. and other Node contributors. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. if (!arg) { // Need double quotation for empty argument return '""'; } if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { // No quotation needed return arg; } if (!arg.includes('"') && !arg.includes('\\')) { // No embedded double quotes or backslashes, so I can just wrap // quote marks around the whole thing. return `"${arg}"`; } // Expected input/output: // input : hello"world // output: "hello\"world" // input : hello""world // output: "hello\"\"world" // input : hello\world // output: hello\world // input : hello\\world // output: hello\\world // input : hello\"world // output: "hello\\\"world" // input : hello\\"world // output: "hello\\\\\"world" // input : hello world\ // output: "hello world\\" - note the comment in libuv actually reads "hello world\" // but it appears the comment is wrong, it should be "hello world\\" let reverse = '"'; let quoteHit = true; for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; if (quoteHit && arg[i - 1] === '\\') { reverse += '\\'; } else if (arg[i - 1] === '"') { quoteHit = true; reverse += '\\'; } else { quoteHit = false; } } reverse += '"'; return reverse .split('') .reverse() .join(''); } _cloneExecOptions(options) { options = options || {}; const result = { cwd: options.cwd || process.cwd(), env: options.env || process.env, silent: options.silent || false, windowsVerbatimArguments: options.windowsVerbatimArguments || false, failOnStdErr: options.failOnStdErr || false, ignoreReturnCode: options.ignoreReturnCode || false, delay: options.delay || 10000 }; result.outStream = options.outStream || process.stdout; result.errStream = options.errStream || process.stderr; return result; } _getSpawnOptions(options, toolPath) { options = options || {}; const result = {}; result.cwd = options.cwd; result.env = options.env; result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); if (options.windowsVerbatimArguments) { result.argv0 = `"${toolPath}"`; } return result; } /** * Exec a tool. * Output will be streamed to the live console. * Returns promise with return code * * @param tool path to tool to exec * @param options optional exec options. See ExecOptions * @returns number */ exec() { return __awaiter(this, void 0, void 0, function* () { // root the tool path if it is unrooted and contains relative pathing if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes('/') || (IS_WINDOWS && this.toolPath.includes('\\')))) { // prefer options.cwd if it is specified, however options.cwd may also need to be rooted this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } // if the tool is only a file name, then resolve it from the PATH // otherwise verify it exists (add extension on Windows if necessary) this.toolPath = yield io.which(this.toolPath, true); return new Promise((resolve, reject) => { this._debug(`exec tool: ${this.toolPath}`); this._debug('arguments:'); for (const arg of this.args) { this._debug(` ${arg}`); } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on('debug', (message) => { this._debug(message); }); const fileName = this._getSpawnFileName(); const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); const stdbuffer = ''; if (cp.stdout) { cp.stdout.on('data', (data) => { if (this.options.listeners && this.options.listeners.stdout) { this.options.listeners.stdout(data); } if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(data); } this._processLineBuffer(data, stdbuffer, (line) => { if (this.options.listeners && this.options.listeners.stdline) { this.options.listeners.stdline(line); } }); }); } const errbuffer = ''; if (cp.stderr) { cp.stderr.on('data', (data) => { state.processStderr = true; if (this.options.listeners && this.options.listeners.stderr) { this.options.listeners.stderr(data); } if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; s.write(data); } this._processLineBuffer(data, errbuffer, (line) => { if (this.options.listeners && this.options.listeners.errline) { this.options.listeners.errline(line); } }); }); } cp.on('error', (err) => { state.processError = err.message; state.processExited = true; state.processClosed = true; state.CheckComplete(); }); cp.on('exit', (code) => { state.processExitCode = code; state.processExited = true; this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); state.CheckComplete(); }); cp.on('close', (code) => { state.processExitCode = code; state.processExited = true; state.processClosed = true; this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); state.on('done', (error, exitCode) => { if (stdbuffer.length > 0) { this.emit('stdline', stdbuffer); } if (errbuffer.length > 0) { this.emit('errline', errbuffer); } cp.removeAllListeners(); if (error) { reject(error); } else { resolve(exitCode); } }); if (this.options.input) { if (!cp.stdin) { throw new Error('child process missing stdin'); } cp.stdin.end(this.options.input); } }); }); } } exports.ToolRunner = ToolRunner; /** * Convert an arg string to an array of args. Handles escaping * * @param argString string of arguments * @returns string[] array of arguments */ function argStringToArray(argString) { const args = []; let inQuotes = false; let escaped = false; let arg = ''; function append(c) { // we only escape double quotes. if (escaped && c !== '"') { arg += '\\'; } arg += c; escaped = false; } for (let i = 0; i < argString.length; i++) { const c = argString.charAt(i); if (c === '"') { if (!escaped) { inQuotes = !inQuotes; } else { append(c); } continue; } if (c === '\\' && escaped) { append(c); continue; } if (c === '\\' && inQuotes) { escaped = true; continue; } if (c === ' ' && !inQuotes) { if (arg.length > 0) { args.push(arg); arg = ''; } continue; } append(c); } if (arg.length > 0) { args.push(arg.trim()); } return args; } exports.argStringToArray = argStringToArray; class ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); this.processClosed = false; // tracks whether the process has exited and stdio is closed this.processError = ''; this.processExitCode = 0; this.processExited = false; // tracks whether the process has exited this.processStderr = false; // tracks whether stderr was written to this.delay = 10000; // 10 seconds this.done = false; this.timeout = null; if (!toolPath) { throw new Error('toolPath must not be empty'); } this.options = options; this.toolPath = toolPath; if (options.delay) { this.delay = options.delay; } } CheckComplete() { if (this.done) { return; } if (this.processClosed) { this._setResult(); } else if (this.processExited) { this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit('debug', message); } _setResult() { // determine whether there is an error let error; if (this.processExited) { if (this.processError) { error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } // clear the timeout if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; } this.done = true; this.emit('done', error, this.processExitCode); } static HandleTimeout(state) { if (state.done) { return; } if (!state.processClosed && state.processExited) { const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; state._debug(message); } state._setResult(); } } //# sourceMappingURL=toolrunner.js.map /***/ }), /***/ 81962: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); const assert_1 = __webpack_require__(42357); const fs = __importStar(__webpack_require__(35747)); const path = __importStar(__webpack_require__(85622)); _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; exports.IS_WINDOWS = process.platform === 'win32'; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { yield exports.stat(fsPath); } catch (err) { if (err.code === 'ENOENT') { return false; } throw err; } return true; }); } exports.exists = exists; function isDirectory(fsPath, useStat = false) { return __awaiter(this, void 0, void 0, function* () { const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); return stats.isDirectory(); }); } exports.isDirectory = isDirectory; /** * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). */ function isRooted(p) { p = normalizeSeparators(p); if (!p) { throw new Error('isRooted() parameter "p" cannot be empty'); } if (exports.IS_WINDOWS) { return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello ); // e.g. C: or C:\hello } return p.startsWith('/'); } exports.isRooted = isRooted; /** * Recursively create a directory at `fsPath`. * * This implementation is optimistic, meaning it attempts to create the full * path first, and backs up the path stack from there. * * @param fsPath The path to create * @param maxDepth The maximum recursion depth * @param depth The current recursion depth */ function mkdirP(fsPath, maxDepth = 1000, depth = 1) { return __awaiter(this, void 0, void 0, function* () { assert_1.ok(fsPath, 'a path argument must be provided'); fsPath = path.resolve(fsPath); if (depth >= maxDepth) return exports.mkdir(fsPath); try { yield exports.mkdir(fsPath); return; } catch (err) { switch (err.code) { case 'ENOENT': { yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); yield exports.mkdir(fsPath); return; } default: { let stats; try { stats = yield exports.stat(fsPath); } catch (err2) { throw err; } if (!stats.isDirectory()) throw err; } } } }); } exports.mkdirP = mkdirP; /** * Best effort attempt to determine whether a file exists and is executable. * @param filePath file path to check * @param extensions additional file extensions to try * @return if file exists and is executable, returns the file path. otherwise empty string. */ function tryGetExecutablePath(filePath, extensions) { return __awaiter(this, void 0, void 0, function* () { let stats = undefined; try { // test file exists stats = yield exports.stat(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // on Windows, test for valid extension const upperExt = path.extname(filePath).toUpperCase(); if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { return filePath; } } else { if (isUnixExecutable(stats)) { return filePath; } } } // try each extension const originalFilePath = filePath; for (const extension of extensions) { filePath = originalFilePath + extension; stats = undefined; try { stats = yield exports.stat(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // preserve the case of the actual file (since an extension was appended) try { const directory = path.dirname(filePath); const upperName = path.basename(filePath).toUpperCase(); for (const actualName of yield exports.readdir(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path.join(directory, actualName); break; } } } catch (err) { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } return filePath; } else { if (isUnixExecutable(stats)) { return filePath; } } } } return ''; }); } exports.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ''; if (exports.IS_WINDOWS) { // convert slashes on Windows p = p.replace(/\//g, '\\'); // remove redundant slashes return p.replace(/\\\\+/g, '\\'); } // remove redundant slashes return p.replace(/\/\/+/g, '/'); } // on Mac/Linux, test the execute bit // R W X R W X R W X // 256 128 64 32 16 8 4 2 1 function isUnixExecutable(stats) { return ((stats.mode & 1) > 0 || ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || ((stats.mode & 64) > 0 && stats.uid === process.getuid())); } //# sourceMappingURL=io-util.js.map /***/ }), /***/ 47351: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const childProcess = __importStar(__webpack_require__(63129)); const path = __importStar(__webpack_require__(85622)); const util_1 = __webpack_require__(31669); const ioUtil = __importStar(__webpack_require__(81962)); const exec = util_1.promisify(childProcess.exec); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js * * @param source source path * @param dest destination path * @param options optional. See CopyOptions. */ function cp(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { const { force, recursive } = readCopyOptions(options); const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; // Dest is an existing file, but not forcing if (destStat && destStat.isFile() && !force) { return; } // If dest is an existing directory, should copy inside. const newDest = destStat && destStat.isDirectory() ? path.join(dest, path.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } const sourceStat = yield ioUtil.stat(source); if (sourceStat.isDirectory()) { if (!recursive) { throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); } else { yield cpDirRecursive(source, newDest, 0, force); } } else { if (path.relative(source, newDest) === '') { // a file cannot be copied to itself throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); } }); } exports.cp = cp; /** * Moves a path. * * @param source source path * @param dest destination path * @param options optional. See MoveOptions. */ function mv(source, dest, options = {}) { return __awaiter(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { // If dest is directory copy src into dest dest = path.join(dest, path.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { if (options.force == null || options.force) { yield rmRF(dest); } else { throw new Error('Destination already exists'); } } } yield mkdirP(path.dirname(dest)); yield ioUtil.rename(source, dest); }); } exports.mv = mv; /** * Remove a path recursively with force * * @param inputPath path to remove */ function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. try { if (yield ioUtil.isDirectory(inputPath, true)) { yield exec(`rd /s /q "${inputPath}"`); } else { yield exec(`del /f /a "${inputPath}"`); } } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; } // Shelling out fails to remove a symlink folder with missing source, this unlink catches that try { yield ioUtil.unlink(inputPath); } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; } } else { let isDir = false; try { isDir = yield ioUtil.isDirectory(inputPath); } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved // other errors are valid if (err.code !== 'ENOENT') throw err; return; } if (isDir) { yield exec(`rm -rf "${inputPath}"`); } else { yield ioUtil.unlink(inputPath); } } }); } exports.rmRF = rmRF; /** * Make a directory. Creates the full path with folders in between * Will throw if it fails * * @param fsPath path to create * @returns Promise */ function mkdirP(fsPath) { return __awaiter(this, void 0, void 0, function* () { yield ioUtil.mkdirP(fsPath); }); } exports.mkdirP = mkdirP; /** * Returns path of a tool had the tool actually been invoked. Resolves via paths. * If you check and the tool does not exist, it will throw. * * @param tool name of the tool * @param check whether to check if tool exists * @returns Promise path to tool */ function which(tool, check) { return __awaiter(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // recursive when check=true if (check) { const result = yield which(tool, false); if (!result) { if (ioUtil.IS_WINDOWS) { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); } else { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); } } return result; } const matches = yield findInPath(tool); if (matches && matches.length > 0) { return matches[0]; } return ''; }); } exports.which = which; /** * Returns a list of all occurrences of the given tool on the system path. * * @returns Promise the paths of the tool */ function findInPath(tool) { return __awaiter(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // build the list of extensions to try const extensions = []; if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { for (const extension of process.env['PATHEXT'].split(path.delimiter)) { if (extension) { extensions.push(extension); } } } // if it's rooted, return it if exists. otherwise return empty. if (ioUtil.isRooted(tool)) { const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); if (filePath) { return [filePath]; } return []; } // if any path separators, return empty if (tool.includes(path.sep)) { return []; } // build the list of directories // // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, // it feels like we should not do this. Checking the current directory seems like more of a use // case of a shell, and the which() function exposed by the toolkit should strive for consistency // across platforms. const directories = []; if (process.env.PATH) { for (const p of process.env.PATH.split(path.delimiter)) { if (p) { directories.push(p); } } } // find all matches const matches = []; for (const directory of directories) { const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } } return matches; }); } exports.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); return { force, recursive }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { return __awaiter(this, void 0, void 0, function* () { // Ensure there is not a run away recursive copy if (currentDepth >= 255) return; currentDepth++; yield mkdirP(destDir); const files = yield ioUtil.readdir(sourceDir); for (const fileName of files) { const srcFile = `${sourceDir}/${fileName}`; const destFile = `${destDir}/${fileName}`; const srcFileStat = yield ioUtil.lstat(srcFile); if (srcFileStat.isDirectory()) { // Recurse yield cpDirRecursive(srcFile, destFile, currentDepth, force); } else { yield copyFile(srcFile, destFile, force); } } // Change the mode for the newly created directory yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); }); } // Buffered file copy function copyFile(srcFile, destFile, force) { return __awaiter(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { // unlink/re-link it try { yield ioUtil.lstat(destFile); yield ioUtil.unlink(destFile); } catch (e) { // Try to override file permission if (e.code === 'EPERM') { yield ioUtil.chmod(destFile, '0666'); yield ioUtil.unlink(destFile); } // other errors = it doesn't exist, no work to do } // Copy over symlink const symlinkFull = yield ioUtil.readlink(srcFile); yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); } else if (!(yield ioUtil.exists(destFile)) || force) { yield ioUtil.copyFile(srcFile, destFile); } }); } //# sourceMappingURL=io.js.map /***/ }), /***/ 54777: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2016 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); /** * @type {module:common/operation} * @private */ var operation_1 = __webpack_require__(37378); exports.Operation = operation_1.Operation; /** * @type {module:common/service} * @private */ var service_1 = __webpack_require__(61682); exports.Service = service_1.Service; /** * @type {module:common/serviceObject} * @private */ var service_object_1 = __webpack_require__(5674); exports.ServiceObject = service_object_1.ServiceObject; /** * @type {module:common/util} * @private */ var util_1 = __webpack_require__(12221); exports.ApiError = util_1.ApiError; exports.util = util_1.util; //# sourceMappingURL=index.js.map /***/ }), /***/ 37378: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2016 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); /*! * @module common/operation */ const service_object_1 = __webpack_require__(5674); const util_1 = __webpack_require__(31669); // eslint-disable-next-line @typescript-eslint/no-explicit-any class Operation extends service_object_1.ServiceObject { /** * An Operation object allows you to interact with APIs that take longer to * process things. * * @constructor * @alias module:common/operation * * @param {object} config - Configuration object. * @param {module:common/service|module:common/serviceObject|module:common/grpcService|module:common/grpcServiceObject} config.parent - The parent object. */ constructor(config) { const methods = { /** * Checks to see if an operation exists. */ exists: true, /** * Retrieves the operation. */ get: true, /** * Retrieves metadata for the operation. */ getMetadata: { reqOpts: { name: config.id, }, }, }; config = Object.assign({ baseUrl: '', }, config); // eslint-disable-next-line @typescript-eslint/no-explicit-any config.methods = (config.methods || methods); super(config); this.completeListeners = 0; this.hasActiveListeners = false; this.listenForEvents_(); } /** * Wraps the `complete` and `error` events in a Promise. * * @return {Promise} */ promise() { return new Promise((resolve, reject) => { this.on('error', reject).on('complete', (metadata) => { resolve([metadata]); }); }); } /** * Begin listening for events on the operation. This method keeps track of how * many "complete" listeners are registered and removed, making sure polling * is handled automatically. * * As long as there is one active "complete" listener, the connection is open. * When there are no more listeners, the polling stops. * * @private */ listenForEvents_() { this.on('newListener', (event) => { if (event === 'complete') { this.completeListeners++; if (!this.hasActiveListeners) { this.hasActiveListeners = true; this.startPolling_(); } } }); this.on('removeListener', (event) => { if (event === 'complete' && --this.completeListeners === 0) { this.hasActiveListeners = false; } }); } /** * Poll for a status update. Returns null for an incomplete * status, and metadata for a complete status. * * @private */ poll_(callback) { this.getMetadata((err, body) => { if (err || body.error) { callback(err || body.error); return; } if (!body.done) { callback(null); return; } callback(null, body); }); } /** * Poll `getMetadata` to check the operation's status. This runs a loop to * ping the API on an interval. * * Note: This method is automatically called once a "complete" event handler * is registered on the operation. * * @private */ async startPolling_() { if (!this.hasActiveListeners) { return; } try { const metadata = await util_1.promisify(this.poll_.bind(this))(); if (!metadata) { setTimeout(this.startPolling_.bind(this), this.pollIntervalMs || 500); return; } this.emit('complete', metadata); } catch (err) { this.emit('error', err); } } } exports.Operation = Operation; //# sourceMappingURL=operation.js.map /***/ }), /***/ 5674: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2015 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); /*! * @module common/service-object */ const promisify_1 = __webpack_require__(19203); const arrify = __webpack_require__(61546); const events_1 = __webpack_require__(28614); const extend = __webpack_require__(38171); const util_1 = __webpack_require__(12221); /** * ServiceObject is a base class, meant to be inherited from by a "service * object," like a BigQuery dataset or Storage bucket. * * Most of the time, these objects share common functionality; they can be * created or deleted, and you can get or set their metadata. * * By inheriting from this class, a service object will be extended with these * shared behaviors. Note that any method can be overridden when the service * object requires specific behavior. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any class ServiceObject extends events_1.EventEmitter { /* * @constructor * @alias module:common/service-object * * @private * * @param {object} config - Configuration object. * @param {string} config.baseUrl - The base URL to make API requests to. * @param {string} config.createMethod - The method which creates this object. * @param {string=} config.id - The identifier of the object. For example, the * name of a Storage bucket or Pub/Sub topic. * @param {object=} config.methods - A map of each method name that should be inherited. * @param {object} config.methods[].reqOpts - Default request options for this * particular method. A common use case is when `setMetadata` requires a * `PUT` method to override the default `PATCH`. * @param {object} config.parent - The parent service instance. For example, an * instance of Storage if the object is Bucket. */ constructor(config) { super(); this.metadata = {}; this.baseUrl = config.baseUrl; this.parent = config.parent; // Parent class. this.id = config.id; // Name or ID (e.g. dataset ID, bucket name, etc). this.createMethod = config.createMethod; this.methods = config.methods || {}; this.interceptors = []; this.pollIntervalMs = config.pollIntervalMs; if (config.methods) { // This filters the ServiceObject instance (e.g. a "File") to only have // the configured methods. We make a couple of exceptions for core- // functionality ("request()" and "getRequestInterceptors()") Object.getOwnPropertyNames(ServiceObject.prototype) .filter(methodName => { return ( // All ServiceObjects need `request` and `getRequestInterceptors`. // clang-format off !/^request/.test(methodName) && !/^getRequestInterceptors/.test(methodName) && // clang-format on // The ServiceObject didn't redefine the method. // eslint-disable-next-line @typescript-eslint/no-explicit-any this[methodName] === // eslint-disable-next-line @typescript-eslint/no-explicit-any ServiceObject.prototype[methodName] && // This method isn't wanted. !config.methods[methodName]); }) .forEach(methodName => { // eslint-disable-next-line @typescript-eslint/no-explicit-any this[methodName] = undefined; }); } } create(optionsOrCallback, callback) { // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; const args = [this.id]; if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; } if (typeof optionsOrCallback === 'object') { args.push(optionsOrCallback); } // Wrap the callback to return *this* instance of the object, not the // newly-created one. // tslint: disable-next-line no-any function onCreate(...args) { const [err, instance] = args; if (!err) { self.metadata = instance.metadata; args[1] = self; // replace the created `instance` with this one. } callback(...args); } args.push(onCreate); // eslint-disable-next-line prefer-spread this.createMethod.apply(null, args); } delete(optionsOrCallback, cb) { const [options, callback] = util_1.util.maybeOptionsOrCallback(optionsOrCallback, cb); const ignoreNotFound = options.ignoreNotFound; delete options.ignoreNotFound; const methodConfig = (typeof this.methods.delete === 'object' && this.methods.delete) || {}; const reqOpts = extend(true, { method: 'DELETE', uri: '', }, methodConfig.reqOpts, { qs: options, }); // The `request` method may have been overridden to hold any special // behavior. Ensure we call the original `request` method. ServiceObject.prototype.request.call(this, reqOpts, (err, ...args) => { if (err) { if (err.code === 404 && ignoreNotFound) { err = null; } } callback(err, ...args); }); } exists(optionsOrCallback, cb) { const [options, callback] = util_1.util.maybeOptionsOrCallback(optionsOrCallback, cb); this.get(options, err => { if (err) { if (err.code === 404) { callback(null, false); } else { callback(err); } return; } callback(null, true); }); } get(optionsOrCallback, cb) { // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; const [opts, callback] = util_1.util.maybeOptionsOrCallback(optionsOrCallback, cb); const options = Object.assign({}, opts); const autoCreate = options.autoCreate && typeof this.create === 'function'; delete options.autoCreate; function onCreate(err, instance, apiResponse) { if (err) { if (err.code === 409) { self.get(options, callback); return; } callback(err, null, apiResponse); return; } callback(null, instance, apiResponse); } this.getMetadata(options, (err, metadata) => { if (err) { if (err.code === 404 && autoCreate) { const args = []; if (Object.keys(options).length > 0) { args.push(options); } args.push(onCreate); self.create(...args); return; } callback(err, null, metadata); return; } callback(null, self, metadata); }); } getMetadata(optionsOrCallback, cb) { const [options, callback] = util_1.util.maybeOptionsOrCallback(optionsOrCallback, cb); const methodConfig = (typeof this.methods.getMetadata === 'object' && this.methods.getMetadata) || {}; const reqOpts = extend(true, { uri: '', }, methodConfig.reqOpts, { qs: options, }); // The `request` method may have been overridden to hold any special // behavior. Ensure we call the original `request` method. ServiceObject.prototype.request.call(this, reqOpts, (err, body, res) => { this.metadata = body; callback(err, this.metadata, res); }); } /** * Return the user's custom request interceptors. */ getRequestInterceptors() { // Interceptors should be returned in the order they were assigned. const localInterceptors = this.interceptors .filter(interceptor => typeof interceptor.request === 'function') .map(interceptor => interceptor.request); return this.parent.getRequestInterceptors().concat(localInterceptors); } setMetadata(metadata, optionsOrCallback, cb) { const [options, callback] = util_1.util.maybeOptionsOrCallback(optionsOrCallback, cb); const methodConfig = (typeof this.methods.setMetadata === 'object' && this.methods.setMetadata) || {}; const reqOpts = extend(true, {}, { method: 'PATCH', uri: '', }, methodConfig.reqOpts, { json: metadata, qs: options, }); // The `request` method may have been overridden to hold any special // behavior. Ensure we call the original `request` method. ServiceObject.prototype.request.call(this, reqOpts, (err, body, res) => { this.metadata = body; callback(err, this.metadata, res); }); } request_(reqOpts, callback) { reqOpts = extend(true, {}, reqOpts); const isAbsoluteUrl = reqOpts.uri.indexOf('http') === 0; const uriComponents = [this.baseUrl, this.id || '', reqOpts.uri]; if (isAbsoluteUrl) { uriComponents.splice(0, uriComponents.indexOf(reqOpts.uri)); } reqOpts.uri = uriComponents .filter(x => x.trim()) // Limit to non-empty strings. .map(uriComponent => { const trimSlashesRegex = /^\/*|\/*$/g; return uriComponent.replace(trimSlashesRegex, ''); }) .join('/'); const childInterceptors = arrify(reqOpts.interceptors_); const localInterceptors = [].slice.call(this.interceptors); reqOpts.interceptors_ = childInterceptors.concat(localInterceptors); if (reqOpts.shouldReturnStream) { return this.parent.requestStream(reqOpts); } this.parent.request(reqOpts, callback); } request(reqOpts, callback) { this.request_(reqOpts, callback); } /** * Make an authenticated API request. * * @param {object} reqOpts - Request options that are passed to `request`. * @param {string} reqOpts.uri - A URI relative to the baseUrl. */ requestStream(reqOpts) { const opts = extend(true, reqOpts, { shouldReturnStream: true }); return this.request_(opts); } } exports.ServiceObject = ServiceObject; promisify_1.promisifyAll(ServiceObject, { exclude: ['getRequestInterceptors'] }); //# sourceMappingURL=service-object.js.map /***/ }), /***/ 61682: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2015 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); /*! * @module common/service */ const arrify = __webpack_require__(61546); const extend = __webpack_require__(38171); const util_1 = __webpack_require__(12221); const PROJECT_ID_TOKEN = '{{projectId}}'; class Service { /** * Service is a base class, meant to be inherited from by a "service," like * BigQuery or Storage. * * This handles making authenticated requests by exposing a `makeReq_` * function. * * @constructor * @alias module:common/service * * @param {object} config - Configuration object. * @param {string} config.baseUrl - The base URL to make API requests to. * @param {string[]} config.scopes - The scopes required for the request. * @param {object=} options - [Configuration object](#/docs). */ constructor(config, options = {}) { this.baseUrl = config.baseUrl; this.apiEndpoint = config.apiEndpoint; this.timeout = options.timeout; this.globalInterceptors = arrify(options.interceptors_); this.interceptors = []; this.packageJson = config.packageJson; this.projectId = options.projectId || PROJECT_ID_TOKEN; this.projectIdRequired = config.projectIdRequired !== false; this.providedUserAgent = options.userAgent; const reqCfg = extend({}, config, { projectIdRequired: this.projectIdRequired, projectId: this.projectId, authClient: options.authClient, credentials: options.credentials, keyFile: options.keyFilename, email: options.email, token: options.token, }); this.makeAuthenticatedRequest = util_1.util.makeAuthenticatedRequestFactory(reqCfg); this.authClient = this.makeAuthenticatedRequest.authClient; this.getCredentials = this.makeAuthenticatedRequest.getCredentials; const isCloudFunctionEnv = !!process.env.FUNCTION_NAME; if (isCloudFunctionEnv) { this.interceptors.push({ request(reqOpts) { reqOpts.forever = false; return reqOpts; }, }); } } /** * Return the user's custom request interceptors. */ getRequestInterceptors() { // Interceptors should be returned in the order they were assigned. return [].slice .call(this.globalInterceptors) .concat(this.interceptors) .filter(interceptor => typeof interceptor.request === 'function') .map(interceptor => interceptor.request); } getProjectId(callback) { if (!callback) { return this.getProjectIdAsync(); } this.getProjectIdAsync().then(p => callback(null, p), callback); } async getProjectIdAsync() { const projectId = await this.authClient.getProjectId(); if (this.projectId === PROJECT_ID_TOKEN && projectId) { this.projectId = projectId; } return this.projectId; } request_(reqOpts, callback) { reqOpts = extend(true, {}, reqOpts, { timeout: this.timeout }); const isAbsoluteUrl = reqOpts.uri.indexOf('http') === 0; const uriComponents = [this.baseUrl]; if (this.projectIdRequired) { uriComponents.push('projects'); uriComponents.push(this.projectId); } uriComponents.push(reqOpts.uri); if (isAbsoluteUrl) { uriComponents.splice(0, uriComponents.indexOf(reqOpts.uri)); } reqOpts.uri = uriComponents .map(uriComponent => { const trimSlashesRegex = /^\/*|\/*$/g; return uriComponent.replace(trimSlashesRegex, ''); }) .join('/') // Some URIs have colon separators. // Bad: https://.../projects/:list // Good: https://.../projects:list .replace(/\/:/g, ':'); const requestInterceptors = this.getRequestInterceptors(); arrify(reqOpts.interceptors_).forEach(interceptor => { if (typeof interceptor.request === 'function') { requestInterceptors.push(interceptor.request); } }); requestInterceptors.forEach(requestInterceptor => { reqOpts = requestInterceptor(reqOpts); }); delete reqOpts.interceptors_; const pkg = this.packageJson; let userAgent = util_1.util.getUserAgentFromPackageJson(pkg); if (this.providedUserAgent) { userAgent = `${this.providedUserAgent} ${userAgent}`; } reqOpts.headers = extend({}, reqOpts.headers, { 'User-Agent': userAgent, 'x-goog-api-client': `gl-node/${process.versions.node} gccl/${pkg.version}`, }); if (reqOpts.shouldReturnStream) { return this.makeAuthenticatedRequest(reqOpts); } else { this.makeAuthenticatedRequest(reqOpts, callback); } } /** * Make an authenticated API request. * * @param {object} reqOpts - Request options that are passed to `request`. * @param {string} reqOpts.uri - A URI relative to the baseUrl. * @param {function} callback - The callback function passed to `request`. */ request(reqOpts, callback) { Service.prototype.request_.call(this, reqOpts, callback); } /** * Make an authenticated API request. * * @param {object} reqOpts - Request options that are passed to `request`. * @param {string} reqOpts.uri - A URI relative to the baseUrl. */ requestStream(reqOpts) { const opts = extend(true, reqOpts, { shouldReturnStream: true }); return Service.prototype.request_.call(this, opts); } } exports.Service = Service; //# sourceMappingURL=service.js.map /***/ }), /***/ 12221: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2014 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); /*! * @module common/util */ const projectify_1 = __webpack_require__(3497); const ent = __webpack_require__(1151); const extend = __webpack_require__(38171); const google_auth_library_1 = __webpack_require__(20810); const retryRequest = __webpack_require__(63515); const stream_1 = __webpack_require__(92413); const teeny_request_1 = __webpack_require__(6886); // eslint-disable-next-line @typescript-eslint/no-var-requires const duplexify = __webpack_require__(76599); const requestDefaults = { timeout: 60000, gzip: true, forever: true, pool: { maxSockets: Infinity, }, }; /** * Default behavior: Automatically retry retriable server errors. * * @const {boolean} * @private */ const AUTO_RETRY_DEFAULT = true; /** * Default behavior: Only attempt to retry retriable errors 3 times. * * @const {number} * @private */ const MAX_RETRY_DEFAULT = 3; /** * Custom error type for API errors. * * @param {object} errorBody - Error object. */ class ApiError extends Error { constructor(errorBodyOrMessage) { super(); if (typeof errorBodyOrMessage !== 'object') { this.message = errorBodyOrMessage || ''; return; } const errorBody = errorBodyOrMessage; this.code = errorBody.code; this.errors = errorBody.errors; this.response = errorBody.response; try { this.errors = JSON.parse(this.response.body).error.errors; } catch (e) { this.errors = errorBody.errors; } this.message = ApiError.createMultiErrorMessage(errorBody, this.errors); Error.captureStackTrace(this); } /** * Pieces together an error message by combining all unique error messages * returned from a single GoogleError * * @private * * @param {GoogleErrorBody} err The original error. * @param {GoogleInnerError[]} [errors] Inner errors, if any. * @returns {string} */ static createMultiErrorMessage(err, errors) { const messages = new Set(); if (err.message) { messages.add(err.message); } if (errors && errors.length) { errors.forEach(({ message }) => messages.add(message)); } else if (err.response && err.response.body) { messages.add(ent.decode(err.response.body.toString())); } else if (!err.message) { messages.add('A failure occurred during this request.'); } let messageArr = Array.from(messages); if (messageArr.length > 1) { messageArr = messageArr.map((message, i) => ` ${i + 1}. ${message}`); messageArr.unshift('Multiple errors occurred during the request. Please see the `errors` array for complete details.\n'); messageArr.push('\n'); } return messageArr.join('\n'); } } exports.ApiError = ApiError; /** * Custom error type for partial errors returned from the API. * * @param {object} b - Error object. */ class PartialFailureError extends Error { constructor(b) { super(); const errorObject = b; this.errors = errorObject.errors; this.name = 'PartialFailureError'; this.response = errorObject.response; this.message = ApiError.createMultiErrorMessage(errorObject, this.errors); } } exports.PartialFailureError = PartialFailureError; class Util { constructor() { this.ApiError = ApiError; this.PartialFailureError = PartialFailureError; } /** * No op. * * @example * function doSomething(callback) { * callback = callback || noop; * } */ noop() { } /** * Uniformly process an API response. * * @param {*} err - Error value. * @param {*} resp - Response value. * @param {*} body - Body value. * @param {function} callback - The callback function. */ handleResp(err, resp, body, callback) { callback = callback || util.noop; const parsedResp = extend(true, { err: err || null }, resp && util.parseHttpRespMessage(resp), body && util.parseHttpRespBody(body)); // Assign the parsed body to resp.body, even if { json: false } was passed // as a request option. // We assume that nobody uses the previously unparsed value of resp.body. if (!parsedResp.err && resp && typeof parsedResp.body === 'object') { parsedResp.resp.body = parsedResp.body; } if (parsedResp.err && resp) { parsedResp.err.response = resp; } callback(parsedResp.err, parsedResp.body, parsedResp.resp); } /** * Sniff an incoming HTTP response message for errors. * * @param {object} httpRespMessage - An incoming HTTP response message from `request`. * @return {object} parsedHttpRespMessage - The parsed response. * @param {?error} parsedHttpRespMessage.err - An error detected. * @param {object} parsedHttpRespMessage.resp - The original response object. */ parseHttpRespMessage(httpRespMessage) { const parsedHttpRespMessage = { resp: httpRespMessage, }; if (httpRespMessage.statusCode < 200 || httpRespMessage.statusCode > 299) { // Unknown error. Format according to ApiError standard. parsedHttpRespMessage.err = new ApiError({ errors: new Array(), code: httpRespMessage.statusCode, message: httpRespMessage.statusMessage, response: httpRespMessage, }); } return parsedHttpRespMessage; } /** * Parse the response body from an HTTP request. * * @param {object} body - The response body. * @return {object} parsedHttpRespMessage - The parsed response. * @param {?error} parsedHttpRespMessage.err - An error detected. * @param {object} parsedHttpRespMessage.body - The original body value provided * will try to be JSON.parse'd. If it's successful, the parsed value will * be returned here, otherwise the original value and an error will be returned. */ parseHttpRespBody(body) { const parsedHttpRespBody = { body, }; if (typeof body === 'string') { try { parsedHttpRespBody.body = JSON.parse(body); } catch (err) { parsedHttpRespBody.body = body; } } if (parsedHttpRespBody.body && parsedHttpRespBody.body.error) { // Error from JSON API. parsedHttpRespBody.err = new ApiError(parsedHttpRespBody.body.error); } return parsedHttpRespBody; } /** * Take a Duplexify stream, fetch an authenticated connection header, and * create an outgoing writable stream. * * @param {Duplexify} dup - Duplexify stream. * @param {object} options - Configuration object. * @param {module:common/connection} options.connection - A connection instance used to get a token with and send the request through. * @param {object} options.metadata - Metadata to send at the head of the request. * @param {object} options.request - Request object, in the format of a standard Node.js http.request() object. * @param {string=} options.request.method - Default: "POST". * @param {string=} options.request.qs.uploadType - Default: "multipart". * @param {string=} options.streamContentType - Default: "application/octet-stream". * @param {function} onComplete - Callback, executed after the writable Request stream has completed. */ makeWritableStream(dup, options, onComplete) { onComplete = onComplete || util.noop; const writeStream = new ProgressStream(); writeStream.on('progress', evt => dup.emit('progress', evt)); dup.setWritable(writeStream); const defaultReqOpts = { method: 'POST', qs: { uploadType: 'multipart', }, timeout: 0, maxRetries: 0, }; const metadata = options.metadata || {}; const reqOpts = extend(true, defaultReqOpts, options.request, { multipart: [ { 'Content-Type': 'application/json', body: JSON.stringify(metadata), }, { 'Content-Type': metadata.contentType || 'application/octet-stream', body: writeStream, }, ], }); options.makeAuthenticatedRequest(reqOpts, { onAuthenticated(err, authenticatedReqOpts) { if (err) { dup.destroy(err); return; } const request = teeny_request_1.teenyRequest.defaults(requestDefaults); request(authenticatedReqOpts, (err, resp, body) => { util.handleResp(err, resp, body, (err, data) => { if (err) { dup.destroy(err); return; } dup.emit('response', resp); onComplete(data); }); }); }, }); } /** * Returns true if the API request should be retried, given the error that was * given the first time the request was attempted. This is used for rate limit * related errors as well as intermittent server errors. * * @param {error} err - The API error to check if it is appropriate to retry. * @return {boolean} True if the API request should be retried, false otherwise. */ shouldRetryRequest(err) { if (err) { if ([408, 429, 500, 502, 503, 504].indexOf(err.code) !== -1) { return true; } if (err.errors) { for (const e of err.errors) { const reason = e.reason; if (reason === 'rateLimitExceeded') { return true; } if (reason === 'userRateLimitExceeded') { return true; } if (reason && reason.includes('EAI_AGAIN')) { return true; } } } } return false; } /** * Get a function for making authenticated requests. * * @param {object} config - Configuration object. * @param {boolean=} config.autoRetry - Automatically retry requests if the * response is related to rate limits or certain intermittent server * errors. We will exponentially backoff subsequent requests by default. * (default: true) * @param {object=} config.credentials - Credentials object. * @param {boolean=} config.customEndpoint - If true, just return the provided request options. Default: false. * @param {boolean=} config.useAuthWithCustomEndpoint - If true, will authenticate when using a custom endpoint. Default: false. * @param {string=} config.email - Account email address, required for PEM/P12 usage. * @param {number=} config.maxRetries - Maximum number of automatic retries attempted before returning the error. (default: 3) * @param {string=} config.keyFile - Path to a .json, .pem, or .p12 keyfile. * @param {array} config.scopes - Array of scopes required for the API. */ makeAuthenticatedRequestFactory(config) { const googleAutoAuthConfig = extend({}, config); if (googleAutoAuthConfig.projectId === '{{projectId}}') { delete googleAutoAuthConfig.projectId; } const authClient = googleAutoAuthConfig.authClient || new google_auth_library_1.GoogleAuth(googleAutoAuthConfig); function makeAuthenticatedRequest(reqOpts, optionsOrCallback) { let stream; let projectId; const reqConfig = extend({}, config); let activeRequest_; if (!optionsOrCallback) { stream = duplexify(); reqConfig.stream = stream; } const options = typeof optionsOrCallback === 'object' ? optionsOrCallback : undefined; const callback = typeof optionsOrCallback === 'function' ? optionsOrCallback : undefined; const onAuthenticated = (err, authenticatedReqOpts) => { const authLibraryError = err; const autoAuthFailed = err && err.message.indexOf('Could not load the default credentials') > -1; if (autoAuthFailed) { // Even though authentication failed, the API might not actually // care. authenticatedReqOpts = reqOpts; } if (!err || autoAuthFailed) { try { authenticatedReqOpts = util.decorateRequest(authenticatedReqOpts, projectId); err = null; } catch (e) { // A projectId was required, but we don't have one. // Re-use the "Could not load the default credentials error" if // auto auth failed. err = err || e; } } if (err) { if (stream) { stream.destroy(err); } else { const fn = options && options.onAuthenticated ? options.onAuthenticated : callback; fn(err); } return; } if (options && options.onAuthenticated) { options.onAuthenticated(null, authenticatedReqOpts); } else { activeRequest_ = util.makeRequest(authenticatedReqOpts, reqConfig, (apiResponseError, ...params) => { if (apiResponseError && apiResponseError.code === 401 && authLibraryError) { // Re-use the "Could not load the default credentials error" if // the API request failed due to missing credentials. apiResponseError = authLibraryError; } callback(apiResponseError, ...params); }); } }; Promise.all([ config.projectId && config.projectId !== '{{projectId}}' ? // The user provided a project ID. We don't need to check with the // auth client, it could be incorrect. new Promise(resolve => resolve(config.projectId)) : authClient.getProjectId(), reqConfig.customEndpoint && reqConfig.useAuthWithCustomEndpoint !== true ? // Using a custom API override. Do not use `google-auth-library` for // authentication. (ex: connecting to a local Datastore server) new Promise(resolve => resolve(reqOpts)) : authClient.authorizeRequest(reqOpts), ]) .then(([_projectId, authorizedReqOpts]) => { projectId = _projectId; onAuthenticated(null, authorizedReqOpts); }) .catch(onAuthenticated); if (stream) { return stream; } return { abort() { setImmediate(() => { if (activeRequest_) { activeRequest_.abort(); activeRequest_ = null; } }); }, }; } const mar = makeAuthenticatedRequest; mar.getCredentials = authClient.getCredentials.bind(authClient); mar.authClient = authClient; return mar; } /** * Make a request through the `retryRequest` module with built-in error * handling and exponential back off. * * @param {object} reqOpts - Request options in the format `request` expects. * @param {object=} config - Configuration object. * @param {boolean=} config.autoRetry - Automatically retry requests if the * response is related to rate limits or certain intermittent server * errors. We will exponentially backoff subsequent requests by default. * (default: true) * @param {number=} config.maxRetries - Maximum number of automatic retries * attempted before returning the error. (default: 3) * @param {object=} config.request - HTTP module for request calls. * @param {function} callback - The callback function. */ makeRequest(reqOpts, config, callback) { var _a, _b, _c, _d, _e, _f, _g; let autoRetryValue = AUTO_RETRY_DEFAULT; if (config.autoRetry !== undefined && ((_a = config.retryOptions) === null || _a === void 0 ? void 0 : _a.autoRetry) !== undefined) { throw new ApiError('autoRetry is deprecated. Use retryOptions.autoRetry instead.'); } else if (config.autoRetry !== undefined) { autoRetryValue = config.autoRetry; } else if (((_b = config.retryOptions) === null || _b === void 0 ? void 0 : _b.autoRetry) !== undefined) { autoRetryValue = config.retryOptions.autoRetry; } let maxRetryValue = MAX_RETRY_DEFAULT; if (config.maxRetries && ((_c = config.retryOptions) === null || _c === void 0 ? void 0 : _c.maxRetries)) { throw new ApiError('maxRetries is deprecated. Use retryOptions.maxRetries instead.'); } else if (config.maxRetries) { maxRetryValue = config.maxRetries; } else if ((_d = config.retryOptions) === null || _d === void 0 ? void 0 : _d.maxRetries) { maxRetryValue = config.retryOptions.maxRetries; } const options = { request: teeny_request_1.teenyRequest.defaults(requestDefaults), retries: autoRetryValue !== false ? maxRetryValue : 0, noResponseRetries: autoRetryValue !== false ? maxRetryValue : 0, shouldRetryFn(httpRespMessage) { var _a, _b; const err = util.parseHttpRespMessage(httpRespMessage).err; if ((_a = config.retryOptions) === null || _a === void 0 ? void 0 : _a.retryableErrorFn) { return err && ((_b = config.retryOptions) === null || _b === void 0 ? void 0 : _b.retryableErrorFn(err)); } return err && util.shouldRetryRequest(err); }, maxRetryDelay: (_e = config.retryOptions) === null || _e === void 0 ? void 0 : _e.maxRetryDelay, retryDelayMultiplier: (_f = config.retryOptions) === null || _f === void 0 ? void 0 : _f.retryDelayMultiplier, totalTimeout: (_g = config.retryOptions) === null || _g === void 0 ? void 0 : _g.totalTimeout, }; if (typeof reqOpts.maxRetries === 'number') { options.retries = reqOpts.maxRetries; } if (!config.stream) { return retryRequest(reqOpts, options, (err, response, body) => { util.handleResp(err, response, body, callback); }); } const dup = config.stream; // eslint-disable-next-line @typescript-eslint/no-explicit-any let requestStream; const isGetRequest = (reqOpts.method || 'GET').toUpperCase() === 'GET'; if (isGetRequest) { requestStream = retryRequest(reqOpts, options); dup.setReadable(requestStream); } else { // Streaming writable HTTP requests cannot be retried. requestStream = options.request(reqOpts); dup.setWritable(requestStream); } // Replay the Request events back to the stream. requestStream .on('error', dup.destroy.bind(dup)) .on('response', dup.emit.bind(dup, 'response')) .on('complete', dup.emit.bind(dup, 'complete')); dup.abort = requestStream.abort; return dup; } /** * Decorate the options about to be made in a request. * * @param {object} reqOpts - The options to be passed to `request`. * @param {string} projectId - The project ID. * @return {object} reqOpts - The decorated reqOpts. */ decorateRequest(reqOpts, projectId) { delete reqOpts.autoPaginate; delete reqOpts.autoPaginateVal; delete reqOpts.objectMode; if (reqOpts.qs !== null && typeof reqOpts.qs === 'object') { delete reqOpts.qs.autoPaginate; delete reqOpts.qs.autoPaginateVal; reqOpts.qs = projectify_1.replaceProjectIdToken(reqOpts.qs, projectId); } if (Array.isArray(reqOpts.multipart)) { reqOpts.multipart = reqOpts.multipart.map(part => { return projectify_1.replaceProjectIdToken(part, projectId); }); } if (reqOpts.json !== null && typeof reqOpts.json === 'object') { delete reqOpts.json.autoPaginate; delete reqOpts.json.autoPaginateVal; reqOpts.json = projectify_1.replaceProjectIdToken(reqOpts.json, projectId); } reqOpts.uri = projectify_1.replaceProjectIdToken(reqOpts.uri, projectId); return reqOpts; } // eslint-disable-next-line @typescript-eslint/no-explicit-any isCustomType(unknown, module) { function getConstructorName(obj) { return obj.constructor && obj.constructor.name.toLowerCase(); } const moduleNameParts = module.split('/'); const parentModuleName = moduleNameParts[0] && moduleNameParts[0].toLowerCase(); const subModuleName = moduleNameParts[1] && moduleNameParts[1].toLowerCase(); if (subModuleName && getConstructorName(unknown) !== subModuleName) { return false; } let walkingModule = unknown; // eslint-disable-next-line no-constant-condition while (true) { if (getConstructorName(walkingModule) === parentModuleName) { return true; } walkingModule = walkingModule.parent; if (!walkingModule) { return false; } } } /** * Create a properly-formatted User-Agent string from a package.json file. * * @param {object} packageJson - A module's package.json file. * @return {string} userAgent - The formatted User-Agent string. */ getUserAgentFromPackageJson(packageJson) { const hyphenatedPackageName = packageJson.name .replace('@google-cloud', 'gcloud-node') // For legacy purposes. .replace('/', '-'); // For UA spec-compliance purposes. return hyphenatedPackageName + '/' + packageJson.version; } /** * Given two parameters, figure out if this is either: * - Just a callback function * - An options object, and then a callback function * @param optionsOrCallback An options object or callback. * @param cb A potentially undefined callback. */ maybeOptionsOrCallback(optionsOrCallback, cb) { return typeof optionsOrCallback === 'function' ? [{}, optionsOrCallback] : [optionsOrCallback, cb]; } } exports.Util = Util; /** * Basic Passthrough Stream that records the number of bytes read * every time the cursor is moved. */ class ProgressStream extends stream_1.Transform { constructor() { super(...arguments); this.bytesRead = 0; } // eslint-disable-next-line @typescript-eslint/no-explicit-any _transform(chunk, encoding, callback) { this.bytesRead += chunk.length; this.emit('progress', { bytesWritten: this.bytesRead, contentLength: '*' }); this.push(chunk); callback(); } } const util = new Util(); exports.util = util; //# sourceMappingURL=util.js.map /***/ }), /***/ 86114: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ (function(global, factory) { /* global define, require, module */ /* AMD */ if (typeof define === 'function' && define.amd) define(["protobufjs/minimal"], factory); /* CommonJS */ else if ( true && module && module.exports) module.exports = factory(__webpack_require__(12263).protobufMinimal); })(this, function($protobuf) { "use strict"; // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots._google_cloud_logging_protos || ($protobuf.roots._google_cloud_logging_protos = {}); $root.google = (function() { /** * Namespace google. * @exports google * @namespace */ var google = {}; google.protobuf = (function() { /** * Namespace protobuf. * @memberof google * @namespace */ var protobuf = {}; protobuf.Duration = (function() { /** * Properties of a Duration. * @memberof google.protobuf * @interface IDuration * @property {number|Long|null} [seconds] Duration seconds * @property {number|null} [nanos] Duration nanos */ /** * Constructs a new Duration. * @memberof google.protobuf * @classdesc Represents a Duration. * @implements IDuration * @constructor * @param {google.protobuf.IDuration=} [properties] Properties to set */ function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Duration seconds. * @member {number|Long} seconds * @memberof google.protobuf.Duration * @instance */ Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Duration nanos. * @member {number} nanos * @memberof google.protobuf.Duration * @instance */ Duration.prototype.nanos = 0; /** * Creates a new Duration instance using the specified properties. * @function create * @memberof google.protobuf.Duration * @static * @param {google.protobuf.IDuration=} [properties] Properties to set * @returns {google.protobuf.Duration} Duration instance */ Duration.create = function create(properties) { return new Duration(properties); }; /** * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode * @memberof google.protobuf.Duration * @static * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Duration * @static * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Duration message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Duration.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.seconds = reader.int64(); break; case 2: message.nanos = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Duration message. * @function verify * @memberof google.protobuf.Duration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Duration.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.seconds != null && message.hasOwnProperty("seconds")) if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) return "seconds: integer|Long expected"; if (message.nanos != null && message.hasOwnProperty("nanos")) if (!$util.isInteger(message.nanos)) return "nanos: integer expected"; return null; }; /** * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object * @returns {google.protobuf.Duration} Duration */ Duration.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Duration) return object; var message = new $root.google.protobuf.Duration(); if (object.seconds != null) if ($util.Long) (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; else if (typeof object.seconds === "string") message.seconds = parseInt(object.seconds, 10); else if (typeof object.seconds === "number") message.seconds = object.seconds; else if (typeof object.seconds === "object") message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); if (object.nanos != null) message.nanos = object.nanos | 0; return message; }; /** * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Duration * @static * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.seconds = options.longs === String ? "0" : 0; object.nanos = 0; } if (message.seconds != null && message.hasOwnProperty("seconds")) if (typeof message.seconds === "number") object.seconds = options.longs === String ? String(message.seconds) : message.seconds; else object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; if (message.nanos != null && message.hasOwnProperty("nanos")) object.nanos = message.nanos; return object; }; /** * Converts this Duration to JSON. * @function toJSON * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Duration; })(); protobuf.FileDescriptorSet = (function() { /** * Properties of a FileDescriptorSet. * @memberof google.protobuf * @interface IFileDescriptorSet * @property {Array.|null} [file] FileDescriptorSet file */ /** * Constructs a new FileDescriptorSet. * @memberof google.protobuf * @classdesc Represents a FileDescriptorSet. * @implements IFileDescriptorSet * @constructor * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set */ function FileDescriptorSet(properties) { this.file = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileDescriptorSet file. * @member {Array.} file * @memberof google.protobuf.FileDescriptorSet * @instance */ FileDescriptorSet.prototype.file = $util.emptyArray; /** * Creates a new FileDescriptorSet instance using the specified properties. * @function create * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance */ FileDescriptorSet.create = function create(properties) { return new FileDescriptorSet(properties); }; /** * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encode * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.file != null && message.file.length) for (var i = 0; i < message.file.length; ++i) $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileDescriptorSet message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorSet.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.file && message.file.length)) message.file = []; message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileDescriptorSet message. * @function verify * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileDescriptorSet.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.file != null && message.hasOwnProperty("file")) { if (!Array.isArray(message.file)) return "file: array expected"; for (var i = 0; i < message.file.length; ++i) { var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); if (error) return "file." + error; } } return null; }; /** * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet */ FileDescriptorSet.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileDescriptorSet) return object; var message = new $root.google.protobuf.FileDescriptorSet(); if (object.file) { if (!Array.isArray(object.file)) throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); message.file = []; for (var i = 0; i < object.file.length; ++i) { if (typeof object.file[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); } } return message; }; /** * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileDescriptorSet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.file = []; if (message.file && message.file.length) { object.file = []; for (var j = 0; j < message.file.length; ++j) object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); } return object; }; /** * Converts this FileDescriptorSet to JSON. * @function toJSON * @memberof google.protobuf.FileDescriptorSet * @instance * @returns {Object.} JSON object */ FileDescriptorSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FileDescriptorSet; })(); protobuf.FileDescriptorProto = (function() { /** * Properties of a FileDescriptorProto. * @memberof google.protobuf * @interface IFileDescriptorProto * @property {string|null} [name] FileDescriptorProto name * @property {string|null} ["package"] FileDescriptorProto package * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service * @property {Array.|null} [extension] FileDescriptorProto extension * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo * @property {string|null} [syntax] FileDescriptorProto syntax */ /** * Constructs a new FileDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FileDescriptorProto. * @implements IFileDescriptorProto * @constructor * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set */ function FileDescriptorProto(properties) { this.dependency = []; this.publicDependency = []; this.weakDependency = []; this.messageType = []; this.enumType = []; this.service = []; this.extension = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileDescriptorProto name. * @member {string} name * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.name = ""; /** * FileDescriptorProto package. * @member {string} package * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype["package"] = ""; /** * FileDescriptorProto dependency. * @member {Array.} dependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.dependency = $util.emptyArray; /** * FileDescriptorProto publicDependency. * @member {Array.} publicDependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.publicDependency = $util.emptyArray; /** * FileDescriptorProto weakDependency. * @member {Array.} weakDependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; /** * FileDescriptorProto messageType. * @member {Array.} messageType * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.messageType = $util.emptyArray; /** * FileDescriptorProto enumType. * @member {Array.} enumType * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.enumType = $util.emptyArray; /** * FileDescriptorProto service. * @member {Array.} service * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.service = $util.emptyArray; /** * FileDescriptorProto extension. * @member {Array.} extension * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.extension = $util.emptyArray; /** * FileDescriptorProto options. * @member {google.protobuf.IFileOptions|null|undefined} options * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.options = null; /** * FileDescriptorProto sourceCodeInfo. * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.sourceCodeInfo = null; /** * FileDescriptorProto syntax. * @member {string} syntax * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.syntax = ""; /** * Creates a new FileDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance */ FileDescriptorProto.create = function create(properties) { return new FileDescriptorProto(properties); }; /** * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); if (message.messageType != null && message.messageType.length) for (var i = 0; i < message.messageType.length; ++i) $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.enumType != null && message.enumType.length) for (var i = 0; i < message.enumType.length; ++i) $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.service != null && message.service.length) for (var i = 0; i < message.service.length; ++i) $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; /** * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message["package"] = reader.string(); break; case 3: if (!(message.dependency && message.dependency.length)) message.dependency = []; message.dependency.push(reader.string()); break; case 10: if (!(message.publicDependency && message.publicDependency.length)) message.publicDependency = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.publicDependency.push(reader.int32()); } else message.publicDependency.push(reader.int32()); break; case 11: if (!(message.weakDependency && message.weakDependency.length)) message.weakDependency = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.weakDependency.push(reader.int32()); } else message.weakDependency.push(reader.int32()); break; case 4: if (!(message.messageType && message.messageType.length)) message.messageType = []; message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; case 5: if (!(message.enumType && message.enumType.length)) message.enumType = []; message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: if (!(message.service && message.service.length)) message.service = []; message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: if (!(message.extension && message.extension.length)) message.extension = []; message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); break; case 9: message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileDescriptorProto message. * @function verify * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message["package"] != null && message.hasOwnProperty("package")) if (!$util.isString(message["package"])) return "package: string expected"; if (message.dependency != null && message.hasOwnProperty("dependency")) { if (!Array.isArray(message.dependency)) return "dependency: array expected"; for (var i = 0; i < message.dependency.length; ++i) if (!$util.isString(message.dependency[i])) return "dependency: string[] expected"; } if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { if (!Array.isArray(message.publicDependency)) return "publicDependency: array expected"; for (var i = 0; i < message.publicDependency.length; ++i) if (!$util.isInteger(message.publicDependency[i])) return "publicDependency: integer[] expected"; } if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { if (!Array.isArray(message.weakDependency)) return "weakDependency: array expected"; for (var i = 0; i < message.weakDependency.length; ++i) if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; for (var i = 0; i < message.messageType.length; ++i) { var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); if (error) return "messageType." + error; } } if (message.enumType != null && message.hasOwnProperty("enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } } if (message.service != null && message.hasOwnProperty("service")) { if (!Array.isArray(message.service)) return "service: array expected"; for (var i = 0; i < message.service.length; ++i) { var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); if (error) return "service." + error; } } if (message.extension != null && message.hasOwnProperty("extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FileOptions.verify(message.options); if (error) return "options." + error; } if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); if (error) return "sourceCodeInfo." + error; } if (message.syntax != null && message.hasOwnProperty("syntax")) if (!$util.isString(message.syntax)) return "syntax: string expected"; return null; }; /** * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto */ FileDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileDescriptorProto) return object; var message = new $root.google.protobuf.FileDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object["package"] != null) message["package"] = String(object["package"]); if (object.dependency) { if (!Array.isArray(object.dependency)) throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); message.dependency = []; for (var i = 0; i < object.dependency.length; ++i) message.dependency[i] = String(object.dependency[i]); } if (object.publicDependency) { if (!Array.isArray(object.publicDependency)) throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); message.publicDependency = []; for (var i = 0; i < object.publicDependency.length; ++i) message.publicDependency[i] = object.publicDependency[i] | 0; } if (object.weakDependency) { if (!Array.isArray(object.weakDependency)) throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); message.weakDependency = []; for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); message.messageType = []; for (var i = 0; i < object.messageType.length; ++i) { if (typeof object.messageType[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); } } if (object.enumType) { if (!Array.isArray(object.enumType)) throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { if (typeof object.enumType[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); } } if (object.service) { if (!Array.isArray(object.service)) throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); message.service = []; for (var i = 0; i < object.service.length; ++i) { if (typeof object.service[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); } } if (object.extension) { if (!Array.isArray(object.extension)) throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { if (typeof object.extension[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FileOptions.fromObject(object.options); } if (object.sourceCodeInfo != null) { if (typeof object.sourceCodeInfo !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); } if (object.syntax != null) message.syntax = String(object.syntax); return message; }; /** * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.dependency = []; object.messageType = []; object.enumType = []; object.service = []; object.extension = []; object.publicDependency = []; object.weakDependency = []; } if (options.defaults) { object.name = ""; object["package"] = ""; object.options = null; object.sourceCodeInfo = null; object.syntax = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message["package"] != null && message.hasOwnProperty("package")) object["package"] = message["package"]; if (message.dependency && message.dependency.length) { object.dependency = []; for (var j = 0; j < message.dependency.length; ++j) object.dependency[j] = message.dependency[j]; } if (message.messageType && message.messageType.length) { object.messageType = []; for (var j = 0; j < message.messageType.length; ++j) object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); } if (message.enumType && message.enumType.length) { object.enumType = []; for (var j = 0; j < message.enumType.length; ++j) object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); } if (message.service && message.service.length) { object.service = []; for (var j = 0; j < message.service.length; ++j) object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); } if (message.extension && message.extension.length) { object.extension = []; for (var j = 0; j < message.extension.length; ++j) object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); if (message.publicDependency && message.publicDependency.length) { object.publicDependency = []; for (var j = 0; j < message.publicDependency.length; ++j) object.publicDependency[j] = message.publicDependency[j]; } if (message.weakDependency && message.weakDependency.length) { object.weakDependency = []; for (var j = 0; j < message.weakDependency.length; ++j) object.weakDependency[j] = message.weakDependency[j]; } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; return object; }; /** * Converts this FileDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.FileDescriptorProto * @instance * @returns {Object.} JSON object */ FileDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FileDescriptorProto; })(); protobuf.DescriptorProto = (function() { /** * Properties of a DescriptorProto. * @memberof google.protobuf * @interface IDescriptorProto * @property {string|null} [name] DescriptorProto name * @property {Array.|null} [field] DescriptorProto field * @property {Array.|null} [extension] DescriptorProto extension * @property {Array.|null} [nestedType] DescriptorProto nestedType * @property {Array.|null} [enumType] DescriptorProto enumType * @property {Array.|null} [extensionRange] DescriptorProto extensionRange * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName */ /** * Constructs a new DescriptorProto. * @memberof google.protobuf * @classdesc Represents a DescriptorProto. * @implements IDescriptorProto * @constructor * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set */ function DescriptorProto(properties) { this.field = []; this.extension = []; this.nestedType = []; this.enumType = []; this.extensionRange = []; this.oneofDecl = []; this.reservedRange = []; this.reservedName = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DescriptorProto name. * @member {string} name * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.name = ""; /** * DescriptorProto field. * @member {Array.} field * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.field = $util.emptyArray; /** * DescriptorProto extension. * @member {Array.} extension * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.extension = $util.emptyArray; /** * DescriptorProto nestedType. * @member {Array.} nestedType * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.nestedType = $util.emptyArray; /** * DescriptorProto enumType. * @member {Array.} enumType * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.enumType = $util.emptyArray; /** * DescriptorProto extensionRange. * @member {Array.} extensionRange * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.extensionRange = $util.emptyArray; /** * DescriptorProto oneofDecl. * @member {Array.} oneofDecl * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.oneofDecl = $util.emptyArray; /** * DescriptorProto options. * @member {google.protobuf.IMessageOptions|null|undefined} options * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.options = null; /** * DescriptorProto reservedRange. * @member {Array.} reservedRange * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.reservedRange = $util.emptyArray; /** * DescriptorProto reservedName. * @member {Array.} reservedName * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.reservedName = $util.emptyArray; /** * Creates a new DescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto} DescriptorProto instance */ DescriptorProto.create = function create(properties) { return new DescriptorProto(properties); }; /** * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.nestedType != null && message.nestedType.length) for (var i = 0; i < message.nestedType.length; ++i) $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.enumType != null && message.enumType.length) for (var i = 0; i < message.enumType.length; ++i) $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.extensionRange != null && message.extensionRange.length) for (var i = 0; i < message.extensionRange.length; ++i) $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); return writer; }; /** * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto} DescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.field && message.field.length)) message.field = []; message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: if (!(message.extension && message.extension.length)) message.extension = []; message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: if (!(message.nestedType && message.nestedType.length)) message.nestedType = []; message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; case 4: if (!(message.enumType && message.enumType.length)) message.enumType = []; message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: if (!(message.extensionRange && message.extensionRange.length)) message.extensionRange = []; message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); break; case 8: if (!(message.oneofDecl && message.oneofDecl.length)) message.oneofDecl = []; message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); break; case 9: if (!(message.reservedRange && message.reservedRange.length)) message.reservedRange = []; message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); break; case 10: if (!(message.reservedName && message.reservedName.length)) message.reservedName = []; message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto} DescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DescriptorProto message. * @function verify * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.field != null && message.hasOwnProperty("field")) { if (!Array.isArray(message.field)) return "field: array expected"; for (var i = 0; i < message.field.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); if (error) return "field." + error; } } if (message.extension != null && message.hasOwnProperty("extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.nestedType != null && message.hasOwnProperty("nestedType")) { if (!Array.isArray(message.nestedType)) return "nestedType: array expected"; for (var i = 0; i < message.nestedType.length; ++i) { var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); if (error) return "nestedType." + error; } } if (message.enumType != null && message.hasOwnProperty("enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } } if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { if (!Array.isArray(message.extensionRange)) return "extensionRange: array expected"; for (var i = 0; i < message.extensionRange.length; ++i) { var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); if (error) return "extensionRange." + error; } } if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { if (!Array.isArray(message.oneofDecl)) return "oneofDecl: array expected"; for (var i = 0; i < message.oneofDecl.length; ++i) { var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); if (error) return "oneofDecl." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MessageOptions.verify(message.options); if (error) return "options." + error; } if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } } if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } return null; }; /** * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto} DescriptorProto */ DescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto) return object; var message = new $root.google.protobuf.DescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.field) { if (!Array.isArray(object.field)) throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); message.field = []; for (var i = 0; i < object.field.length; ++i) { if (typeof object.field[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); } } if (object.extension) { if (!Array.isArray(object.extension)) throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { if (typeof object.extension[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); } } if (object.nestedType) { if (!Array.isArray(object.nestedType)) throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); message.nestedType = []; for (var i = 0; i < object.nestedType.length; ++i) { if (typeof object.nestedType[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); } } if (object.enumType) { if (!Array.isArray(object.enumType)) throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { if (typeof object.enumType[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); } } if (object.extensionRange) { if (!Array.isArray(object.extensionRange)) throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); message.extensionRange = []; for (var i = 0; i < object.extensionRange.length; ++i) { if (typeof object.extensionRange[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); } } if (object.oneofDecl) { if (!Array.isArray(object.oneofDecl)) throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); message.oneofDecl = []; for (var i = 0; i < object.oneofDecl.length; ++i) { if (typeof object.oneofDecl[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); } if (object.reservedRange) { if (!Array.isArray(object.reservedRange)) throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { if (typeof object.reservedRange[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); } } if (object.reservedName) { if (!Array.isArray(object.reservedName)) throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); message.reservedName = []; for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } return message; }; /** * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.DescriptorProto} message DescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.field = []; object.nestedType = []; object.enumType = []; object.extensionRange = []; object.extension = []; object.oneofDecl = []; object.reservedRange = []; object.reservedName = []; } if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.field && message.field.length) { object.field = []; for (var j = 0; j < message.field.length; ++j) object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); } if (message.nestedType && message.nestedType.length) { object.nestedType = []; for (var j = 0; j < message.nestedType.length; ++j) object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); } if (message.enumType && message.enumType.length) { object.enumType = []; for (var j = 0; j < message.enumType.length; ++j) object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); } if (message.extensionRange && message.extensionRange.length) { object.extensionRange = []; for (var j = 0; j < message.extensionRange.length; ++j) object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); } if (message.extension && message.extension.length) { object.extension = []; for (var j = 0; j < message.extension.length; ++j) object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); if (message.oneofDecl && message.oneofDecl.length) { object.oneofDecl = []; for (var j = 0; j < message.oneofDecl.length; ++j) object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); } if (message.reservedRange && message.reservedRange.length) { object.reservedRange = []; for (var j = 0; j < message.reservedRange.length; ++j) object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } return object; }; /** * Converts this DescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto * @instance * @returns {Object.} JSON object */ DescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; DescriptorProto.ExtensionRange = (function() { /** * Properties of an ExtensionRange. * @memberof google.protobuf.DescriptorProto * @interface IExtensionRange * @property {number|null} [start] ExtensionRange start * @property {number|null} [end] ExtensionRange end * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options */ /** * Constructs a new ExtensionRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents an ExtensionRange. * @implements IExtensionRange * @constructor * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set */ function ExtensionRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ExtensionRange start. * @member {number} start * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.start = 0; /** * ExtensionRange end. * @member {number} end * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.end = 0; /** * ExtensionRange options. * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.options = null; /** * Creates a new ExtensionRange instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance */ ExtensionRange.create = function create(properties) { return new ExtensionRange(properties); }; /** * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ExtensionRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; case 3: message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ExtensionRange message. * @function verify * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ExtensionRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange */ ExtensionRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) return object; var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ExtensionRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; object.options = null; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); return object; }; /** * Converts this ExtensionRange to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance * @returns {Object.} JSON object */ ExtensionRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ExtensionRange; })(); DescriptorProto.ReservedRange = (function() { /** * Properties of a ReservedRange. * @memberof google.protobuf.DescriptorProto * @interface IReservedRange * @property {number|null} [start] ReservedRange start * @property {number|null} [end] ReservedRange end */ /** * Constructs a new ReservedRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents a ReservedRange. * @implements IReservedRange * @constructor * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set */ function ReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ReservedRange start. * @member {number} start * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ ReservedRange.prototype.start = 0; /** * ReservedRange end. * @member {number} end * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ ReservedRange.prototype.end = 0; /** * Creates a new ReservedRange instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance */ ReservedRange.create = function create(properties) { return new ReservedRange(properties); }; /** * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ReservedRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ReservedRange message. * @function verify * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange */ ReservedRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) return object; var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this ReservedRange to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance * @returns {Object.} JSON object */ ReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ReservedRange; })(); return DescriptorProto; })(); protobuf.ExtensionRangeOptions = (function() { /** * Properties of an ExtensionRangeOptions. * @memberof google.protobuf * @interface IExtensionRangeOptions * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption */ /** * Constructs a new ExtensionRangeOptions. * @memberof google.protobuf * @classdesc Represents an ExtensionRangeOptions. * @implements IExtensionRangeOptions * @constructor * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set */ function ExtensionRangeOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ExtensionRangeOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.ExtensionRangeOptions * @instance */ ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new ExtensionRangeOptions instance using the specified properties. * @function create * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance */ ExtensionRangeOptions.create = function create(properties) { return new ExtensionRangeOptions(properties); }; /** * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ExtensionRangeOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRangeOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ExtensionRangeOptions message. * @function verify * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ExtensionRangeOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions */ ExtensionRangeOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ExtensionRangeOptions) return object; var message = new $root.google.protobuf.ExtensionRangeOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ExtensionRangeOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this ExtensionRangeOptions to JSON. * @function toJSON * @memberof google.protobuf.ExtensionRangeOptions * @instance * @returns {Object.} JSON object */ ExtensionRangeOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ExtensionRangeOptions; })(); protobuf.FieldDescriptorProto = (function() { /** * Properties of a FieldDescriptorProto. * @memberof google.protobuf * @interface IFieldDescriptorProto * @property {string|null} [name] FieldDescriptorProto name * @property {number|null} [number] FieldDescriptorProto number * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type * @property {string|null} [typeName] FieldDescriptorProto typeName * @property {string|null} [extendee] FieldDescriptorProto extendee * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex * @property {string|null} [jsonName] FieldDescriptorProto jsonName * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional */ /** * Constructs a new FieldDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FieldDescriptorProto. * @implements IFieldDescriptorProto * @constructor * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set */ function FieldDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldDescriptorProto name. * @member {string} name * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.name = ""; /** * FieldDescriptorProto number. * @member {number} number * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.number = 0; /** * FieldDescriptorProto label. * @member {google.protobuf.FieldDescriptorProto.Label} label * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.label = 1; /** * FieldDescriptorProto type. * @member {google.protobuf.FieldDescriptorProto.Type} type * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.type = 1; /** * FieldDescriptorProto typeName. * @member {string} typeName * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.typeName = ""; /** * FieldDescriptorProto extendee. * @member {string} extendee * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.extendee = ""; /** * FieldDescriptorProto defaultValue. * @member {string} defaultValue * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.defaultValue = ""; /** * FieldDescriptorProto oneofIndex. * @member {number} oneofIndex * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.oneofIndex = 0; /** * FieldDescriptorProto jsonName. * @member {string} jsonName * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.jsonName = ""; /** * FieldDescriptorProto options. * @member {google.protobuf.IFieldOptions|null|undefined} options * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.options = null; /** * FieldDescriptorProto proto3Optional. * @member {boolean} proto3Optional * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.proto3Optional = false; /** * Creates a new FieldDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance */ FieldDescriptorProto.create = function create(properties) { return new FieldDescriptorProto(properties); }; /** * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); return writer; }; /** * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 3: message.number = reader.int32(); break; case 4: message.label = reader.int32(); break; case 5: message.type = reader.int32(); break; case 6: message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: message.defaultValue = reader.string(); break; case 9: message.oneofIndex = reader.int32(); break; case 10: message.jsonName = reader.string(); break; case 8: message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); break; case 17: message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldDescriptorProto message. * @function verify * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; if (message.label != null && message.hasOwnProperty("label")) switch (message.label) { default: return "label: enum value expected"; case 1: case 2: case 3: break; } if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: return "type: enum value expected"; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: break; } if (message.typeName != null && message.hasOwnProperty("typeName")) if (!$util.isString(message.typeName)) return "typeName: string expected"; if (message.extendee != null && message.hasOwnProperty("extendee")) if (!$util.isString(message.extendee)) return "extendee: string expected"; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) if (!$util.isString(message.defaultValue)) return "defaultValue: string expected"; if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) if (!$util.isInteger(message.oneofIndex)) return "oneofIndex: integer expected"; if (message.jsonName != null && message.hasOwnProperty("jsonName")) if (!$util.isString(message.jsonName)) return "jsonName: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FieldOptions.verify(message.options); if (error) return "options." + error; } if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) if (typeof message.proto3Optional !== "boolean") return "proto3Optional: boolean expected"; return null; }; /** * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto */ FieldDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldDescriptorProto) return object; var message = new $root.google.protobuf.FieldDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.number != null) message.number = object.number | 0; switch (object.label) { case "LABEL_OPTIONAL": case 1: message.label = 1; break; case "LABEL_REQUIRED": case 2: message.label = 2; break; case "LABEL_REPEATED": case 3: message.label = 3; break; } switch (object.type) { case "TYPE_DOUBLE": case 1: message.type = 1; break; case "TYPE_FLOAT": case 2: message.type = 2; break; case "TYPE_INT64": case 3: message.type = 3; break; case "TYPE_UINT64": case 4: message.type = 4; break; case "TYPE_INT32": case 5: message.type = 5; break; case "TYPE_FIXED64": case 6: message.type = 6; break; case "TYPE_FIXED32": case 7: message.type = 7; break; case "TYPE_BOOL": case 8: message.type = 8; break; case "TYPE_STRING": case 9: message.type = 9; break; case "TYPE_GROUP": case 10: message.type = 10; break; case "TYPE_MESSAGE": case 11: message.type = 11; break; case "TYPE_BYTES": case 12: message.type = 12; break; case "TYPE_UINT32": case 13: message.type = 13; break; case "TYPE_ENUM": case 14: message.type = 14; break; case "TYPE_SFIXED32": case 15: message.type = 15; break; case "TYPE_SFIXED64": case 16: message.type = 16; break; case "TYPE_SINT32": case 17: message.type = 17; break; case "TYPE_SINT64": case 18: message.type = 18; break; } if (object.typeName != null) message.typeName = String(object.typeName); if (object.extendee != null) message.extendee = String(object.extendee); if (object.defaultValue != null) message.defaultValue = String(object.defaultValue); if (object.oneofIndex != null) message.oneofIndex = object.oneofIndex | 0; if (object.jsonName != null) message.jsonName = String(object.jsonName); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); } if (object.proto3Optional != null) message.proto3Optional = Boolean(object.proto3Optional); return message; }; /** * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.extendee = ""; object.number = 0; object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; object.type = options.enums === String ? "TYPE_DOUBLE" : 1; object.typeName = ""; object.defaultValue = ""; object.options = null; object.oneofIndex = 0; object.jsonName = ""; object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.extendee != null && message.hasOwnProperty("extendee")) object.extendee = message.extendee; if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) object.defaultValue = message.defaultValue; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) object.oneofIndex = message.oneofIndex; if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) object.proto3Optional = message.proto3Optional; return object; }; /** * Converts this FieldDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.FieldDescriptorProto * @instance * @returns {Object.} JSON object */ FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type * @enum {number} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value * @property {number} TYPE_UINT64=4 TYPE_UINT64 value * @property {number} TYPE_INT32=5 TYPE_INT32 value * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value * @property {number} TYPE_BOOL=8 TYPE_BOOL value * @property {number} TYPE_STRING=9 TYPE_STRING value * @property {number} TYPE_GROUP=10 TYPE_GROUP value * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value * @property {number} TYPE_BYTES=12 TYPE_BYTES value * @property {number} TYPE_UINT32=13 TYPE_UINT32 value * @property {number} TYPE_ENUM=14 TYPE_ENUM value * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value * @property {number} TYPE_SINT32=17 TYPE_SINT32 value * @property {number} TYPE_SINT64=18 TYPE_SINT64 value */ FieldDescriptorProto.Type = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "TYPE_DOUBLE"] = 1; values[valuesById[2] = "TYPE_FLOAT"] = 2; values[valuesById[3] = "TYPE_INT64"] = 3; values[valuesById[4] = "TYPE_UINT64"] = 4; values[valuesById[5] = "TYPE_INT32"] = 5; values[valuesById[6] = "TYPE_FIXED64"] = 6; values[valuesById[7] = "TYPE_FIXED32"] = 7; values[valuesById[8] = "TYPE_BOOL"] = 8; values[valuesById[9] = "TYPE_STRING"] = 9; values[valuesById[10] = "TYPE_GROUP"] = 10; values[valuesById[11] = "TYPE_MESSAGE"] = 11; values[valuesById[12] = "TYPE_BYTES"] = 12; values[valuesById[13] = "TYPE_UINT32"] = 13; values[valuesById[14] = "TYPE_ENUM"] = 14; values[valuesById[15] = "TYPE_SFIXED32"] = 15; values[valuesById[16] = "TYPE_SFIXED64"] = 16; values[valuesById[17] = "TYPE_SINT32"] = 17; values[valuesById[18] = "TYPE_SINT64"] = 18; return values; })(); /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value */ FieldDescriptorProto.Label = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "LABEL_OPTIONAL"] = 1; values[valuesById[2] = "LABEL_REQUIRED"] = 2; values[valuesById[3] = "LABEL_REPEATED"] = 3; return values; })(); return FieldDescriptorProto; })(); protobuf.OneofDescriptorProto = (function() { /** * Properties of an OneofDescriptorProto. * @memberof google.protobuf * @interface IOneofDescriptorProto * @property {string|null} [name] OneofDescriptorProto name * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options */ /** * Constructs a new OneofDescriptorProto. * @memberof google.protobuf * @classdesc Represents an OneofDescriptorProto. * @implements IOneofDescriptorProto * @constructor * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ function OneofDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OneofDescriptorProto name. * @member {string} name * @memberof google.protobuf.OneofDescriptorProto * @instance */ OneofDescriptorProto.prototype.name = ""; /** * OneofDescriptorProto options. * @member {google.protobuf.IOneofOptions|null|undefined} options * @memberof google.protobuf.OneofDescriptorProto * @instance */ OneofDescriptorProto.prototype.options = null; /** * Creates a new OneofDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance */ OneofDescriptorProto.create = function create(properties) { return new OneofDescriptorProto(properties); }; /** * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OneofDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OneofDescriptorProto message. * @function verify * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OneofDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.OneofOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ OneofDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; var message = new $root.google.protobuf.OneofDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OneofDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); return object; }; /** * Converts this OneofDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.OneofDescriptorProto * @instance * @returns {Object.} JSON object */ OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OneofDescriptorProto; })(); protobuf.EnumDescriptorProto = (function() { /** * Properties of an EnumDescriptorProto. * @memberof google.protobuf * @interface IEnumDescriptorProto * @property {string|null} [name] EnumDescriptorProto name * @property {Array.|null} [value] EnumDescriptorProto value * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName */ /** * Constructs a new EnumDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumDescriptorProto. * @implements IEnumDescriptorProto * @constructor * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ function EnumDescriptorProto(properties) { this.value = []; this.reservedRange = []; this.reservedName = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumDescriptorProto name. * @member {string} name * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.name = ""; /** * EnumDescriptorProto value. * @member {Array.} value * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.value = $util.emptyArray; /** * EnumDescriptorProto options. * @member {google.protobuf.IEnumOptions|null|undefined} options * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.options = null; /** * EnumDescriptorProto reservedRange. * @member {Array.} reservedRange * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; /** * EnumDescriptorProto reservedName. * @member {Array.} reservedName * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ EnumDescriptorProto.create = function create(properties) { return new EnumDescriptorProto(properties); }; /** * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); return writer; }; /** * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.value && message.value.length)) message.value = []; message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); break; case 4: if (!(message.reservedRange && message.reservedRange.length)) message.reservedRange = []; message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); break; case 5: if (!(message.reservedName && message.reservedName.length)) message.reservedName = []; message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumDescriptorProto message. * @function verify * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.value != null && message.hasOwnProperty("value")) { if (!Array.isArray(message.value)) return "value: array expected"; for (var i = 0; i < message.value.length; ++i) { var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); if (error) return "value." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumOptions.verify(message.options); if (error) return "options." + error; } if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } } if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } return null; }; /** * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ EnumDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; var message = new $root.google.protobuf.EnumDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.value) { if (!Array.isArray(object.value)) throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); message.value = []; for (var i = 0; i < object.value.length; ++i) { if (typeof object.value[i] !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); } if (object.reservedRange) { if (!Array.isArray(object.reservedRange)) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { if (typeof object.reservedRange[i] !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); } } if (object.reservedName) { if (!Array.isArray(object.reservedName)) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); message.reservedName = []; for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } return message; }; /** * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.value = []; object.reservedRange = []; object.reservedName = []; } if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.value && message.value.length) { object.value = []; for (var j = 0; j < message.value.length; ++j) object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); if (message.reservedRange && message.reservedRange.length) { object.reservedRange = []; for (var j = 0; j < message.reservedRange.length; ++j) object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } return object; }; /** * Converts this EnumDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.EnumDescriptorProto * @instance * @returns {Object.} JSON object */ EnumDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; EnumDescriptorProto.EnumReservedRange = (function() { /** * Properties of an EnumReservedRange. * @memberof google.protobuf.EnumDescriptorProto * @interface IEnumReservedRange * @property {number|null} [start] EnumReservedRange start * @property {number|null} [end] EnumReservedRange end */ /** * Constructs a new EnumReservedRange. * @memberof google.protobuf.EnumDescriptorProto * @classdesc Represents an EnumReservedRange. * @implements IEnumReservedRange * @constructor * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set */ function EnumReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumReservedRange start. * @member {number} start * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ EnumReservedRange.prototype.start = 0; /** * EnumReservedRange end. * @member {number} end * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ EnumReservedRange.prototype.end = 0; /** * Creates a new EnumReservedRange instance using the specified properties. * @function create * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance */ EnumReservedRange.create = function create(properties) { return new EnumReservedRange(properties); }; /** * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumReservedRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumReservedRange message. * @function verify * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange */ EnumReservedRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) return object; var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this EnumReservedRange to JSON. * @function toJSON * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance * @returns {Object.} JSON object */ EnumReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumReservedRange; })(); return EnumDescriptorProto; })(); protobuf.EnumValueDescriptorProto = (function() { /** * Properties of an EnumValueDescriptorProto. * @memberof google.protobuf * @interface IEnumValueDescriptorProto * @property {string|null} [name] EnumValueDescriptorProto name * @property {number|null} [number] EnumValueDescriptorProto number * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options */ /** * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumValueDescriptorProto. * @implements IEnumValueDescriptorProto * @constructor * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumValueDescriptorProto name. * @member {string} name * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.name = ""; /** * EnumValueDescriptorProto number. * @member {number} number * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.number = 0; /** * EnumValueDescriptorProto options. * @member {google.protobuf.IEnumValueOptions|null|undefined} options * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.options = null; /** * Creates a new EnumValueDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ EnumValueDescriptorProto.create = function create(properties) { return new EnumValueDescriptorProto(properties); }; /** * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.number = reader.int32(); break; case 3: message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumValueDescriptorProto message. * @function verify * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumValueDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumValueOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ EnumValueDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; var message = new $root.google.protobuf.EnumValueDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.number != null) message.number = object.number | 0; if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.number = 0; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); return object; }; /** * Converts this EnumValueDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumValueDescriptorProto; })(); protobuf.ServiceDescriptorProto = (function() { /** * Properties of a ServiceDescriptorProto. * @memberof google.protobuf * @interface IServiceDescriptorProto * @property {string|null} [name] ServiceDescriptorProto name * @property {Array.|null} [method] ServiceDescriptorProto method * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options */ /** * Constructs a new ServiceDescriptorProto. * @memberof google.protobuf * @classdesc Represents a ServiceDescriptorProto. * @implements IServiceDescriptorProto * @constructor * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ function ServiceDescriptorProto(properties) { this.method = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ServiceDescriptorProto name. * @member {string} name * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.name = ""; /** * ServiceDescriptorProto method. * @member {Array.} method * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.method = $util.emptyArray; /** * ServiceDescriptorProto options. * @member {google.protobuf.IServiceOptions|null|undefined} options * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.options = null; /** * Creates a new ServiceDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance */ ServiceDescriptorProto.create = function create(properties) { return new ServiceDescriptorProto(properties); }; /** * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ServiceDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.method && message.method.length)) message.method = []; message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ServiceDescriptorProto message. * @function verify * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ServiceDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.method != null && message.hasOwnProperty("method")) { if (!Array.isArray(message.method)) return "method: array expected"; for (var i = 0; i < message.method.length; ++i) { var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); if (error) return "method." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ServiceOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto */ ServiceDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ServiceDescriptorProto) return object; var message = new $root.google.protobuf.ServiceDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.method) { if (!Array.isArray(object.method)) throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); message.method = []; for (var i = 0; i < object.method.length; ++i) { if (typeof object.method[i] !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ServiceDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.method = []; if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.method && message.method.length) { object.method = []; for (var j = 0; j < message.method.length; ++j) object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; /** * Converts this ServiceDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.ServiceDescriptorProto * @instance * @returns {Object.} JSON object */ ServiceDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ServiceDescriptorProto; })(); protobuf.MethodDescriptorProto = (function() { /** * Properties of a MethodDescriptorProto. * @memberof google.protobuf * @interface IMethodDescriptorProto * @property {string|null} [name] MethodDescriptorProto name * @property {string|null} [inputType] MethodDescriptorProto inputType * @property {string|null} [outputType] MethodDescriptorProto outputType * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming */ /** * Constructs a new MethodDescriptorProto. * @memberof google.protobuf * @classdesc Represents a MethodDescriptorProto. * @implements IMethodDescriptorProto * @constructor * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ function MethodDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MethodDescriptorProto name. * @member {string} name * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.name = ""; /** * MethodDescriptorProto inputType. * @member {string} inputType * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.inputType = ""; /** * MethodDescriptorProto outputType. * @member {string} outputType * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.outputType = ""; /** * MethodDescriptorProto options. * @member {google.protobuf.IMethodOptions|null|undefined} options * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.options = null; /** * MethodDescriptorProto clientStreaming. * @member {boolean} clientStreaming * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.clientStreaming = false; /** * MethodDescriptorProto serverStreaming. * @member {boolean} serverStreaming * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.serverStreaming = false; /** * Creates a new MethodDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ MethodDescriptorProto.create = function create(properties) { return new MethodDescriptorProto(properties); }; /** * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; /** * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.inputType = reader.string(); break; case 3: message.outputType = reader.string(); break; case 4: message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); break; case 5: message.clientStreaming = reader.bool(); break; case 6: message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MethodDescriptorProto message. * @function verify * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MethodDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.inputType != null && message.hasOwnProperty("inputType")) if (!$util.isString(message.inputType)) return "inputType: string expected"; if (message.outputType != null && message.hasOwnProperty("outputType")) if (!$util.isString(message.outputType)) return "outputType: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MethodOptions.verify(message.options); if (error) return "options." + error; } if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) if (typeof message.clientStreaming !== "boolean") return "clientStreaming: boolean expected"; if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) if (typeof message.serverStreaming !== "boolean") return "serverStreaming: boolean expected"; return null; }; /** * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ MethodDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MethodDescriptorProto) return object; var message = new $root.google.protobuf.MethodDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.inputType != null) message.inputType = String(object.inputType); if (object.outputType != null) message.outputType = String(object.outputType); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); } if (object.clientStreaming != null) message.clientStreaming = Boolean(object.clientStreaming); if (object.serverStreaming != null) message.serverStreaming = Boolean(object.serverStreaming); return message; }; /** * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.inputType = ""; object.outputType = ""; object.options = null; object.clientStreaming = false; object.serverStreaming = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.inputType != null && message.hasOwnProperty("inputType")) object.inputType = message.inputType; if (message.outputType != null && message.hasOwnProperty("outputType")) object.outputType = message.outputType; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) object.clientStreaming = message.clientStreaming; if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) object.serverStreaming = message.serverStreaming; return object; }; /** * Converts this MethodDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MethodDescriptorProto; })(); protobuf.FileOptions = (function() { /** * Properties of a FileOptions. * @memberof google.protobuf * @interface IFileOptions * @property {string|null} [javaPackage] FileOptions javaPackage * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor * @property {string|null} [goPackage] FileOptions goPackage * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices * @property {boolean|null} [deprecated] FileOptions deprecated * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix * @property {string|null} [csharpNamespace] FileOptions csharpNamespace * @property {string|null} [swiftPrefix] FileOptions swiftPrefix * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix * @property {string|null} [phpNamespace] FileOptions phpNamespace * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition */ /** * Constructs a new FileOptions. * @memberof google.protobuf * @classdesc Represents a FileOptions. * @implements IFileOptions * @constructor * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ function FileOptions(properties) { this.uninterpretedOption = []; this[".google.api.resourceDefinition"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileOptions javaPackage. * @member {string} javaPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaPackage = ""; /** * FileOptions javaOuterClassname. * @member {string} javaOuterClassname * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaOuterClassname = ""; /** * FileOptions javaMultipleFiles. * @member {boolean} javaMultipleFiles * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaMultipleFiles = false; /** * FileOptions javaGenerateEqualsAndHash. * @member {boolean} javaGenerateEqualsAndHash * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaGenerateEqualsAndHash = false; /** * FileOptions javaStringCheckUtf8. * @member {boolean} javaStringCheckUtf8 * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaStringCheckUtf8 = false; /** * FileOptions optimizeFor. * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.optimizeFor = 1; /** * FileOptions goPackage. * @member {string} goPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.goPackage = ""; /** * FileOptions ccGenericServices. * @member {boolean} ccGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.ccGenericServices = false; /** * FileOptions javaGenericServices. * @member {boolean} javaGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaGenericServices = false; /** * FileOptions pyGenericServices. * @member {boolean} pyGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.pyGenericServices = false; /** * FileOptions phpGenericServices. * @member {boolean} phpGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpGenericServices = false; /** * FileOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.deprecated = false; /** * FileOptions ccEnableArenas. * @member {boolean} ccEnableArenas * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. * @member {string} objcClassPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.objcClassPrefix = ""; /** * FileOptions csharpNamespace. * @member {string} csharpNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.csharpNamespace = ""; /** * FileOptions swiftPrefix. * @member {string} swiftPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.swiftPrefix = ""; /** * FileOptions phpClassPrefix. * @member {string} phpClassPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpClassPrefix = ""; /** * FileOptions phpNamespace. * @member {string} phpNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpNamespace = ""; /** * FileOptions phpMetadataNamespace. * @member {string} phpMetadataNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpMetadataNamespace = ""; /** * FileOptions rubyPackage. * @member {string} rubyPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.rubyPackage = ""; /** * FileOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; /** * FileOptions .google.api.resourceDefinition. * @member {Array.} .google.api.resourceDefinition * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; /** * Creates a new FileOptions instance using the specified properties. * @function create * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions=} [properties] Properties to set * @returns {google.protobuf.FileOptions} FileOptions instance */ FileOptions.create = function create(properties) { return new FileOptions(properties); }; /** * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; /** * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileOptions} FileOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.javaPackage = reader.string(); break; case 8: message.javaOuterClassname = reader.string(); break; case 10: message.javaMultipleFiles = reader.bool(); break; case 20: message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: message.javaStringCheckUtf8 = reader.bool(); break; case 9: message.optimizeFor = reader.int32(); break; case 11: message.goPackage = reader.string(); break; case 16: message.ccGenericServices = reader.bool(); break; case 17: message.javaGenericServices = reader.bool(); break; case 18: message.pyGenericServices = reader.bool(); break; case 42: message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: message.ccEnableArenas = reader.bool(); break; case 36: message.objcClassPrefix = reader.string(); break; case 37: message.csharpNamespace = reader.string(); break; case 39: message.swiftPrefix = reader.string(); break; case 40: message.phpClassPrefix = reader.string(); break; case 41: message.phpNamespace = reader.string(); break; case 44: message.phpMetadataNamespace = reader.string(); break; case 45: message.rubyPackage = reader.string(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1053: if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) message[".google.api.resourceDefinition"] = []; message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileOptions} FileOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileOptions message. * @function verify * @memberof google.protobuf.FileOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) if (!$util.isString(message.javaPackage)) return "javaPackage: string expected"; if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) if (!$util.isString(message.javaOuterClassname)) return "javaOuterClassname: string expected"; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) if (typeof message.javaMultipleFiles !== "boolean") return "javaMultipleFiles: boolean expected"; if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) if (typeof message.javaGenerateEqualsAndHash !== "boolean") return "javaGenerateEqualsAndHash: boolean expected"; if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) if (typeof message.javaStringCheckUtf8 !== "boolean") return "javaStringCheckUtf8: boolean expected"; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) switch (message.optimizeFor) { default: return "optimizeFor: enum value expected"; case 1: case 2: case 3: break; } if (message.goPackage != null && message.hasOwnProperty("goPackage")) if (!$util.isString(message.goPackage)) return "goPackage: string expected"; if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) if (typeof message.ccGenericServices !== "boolean") return "ccGenericServices: boolean expected"; if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) if (typeof message.javaGenericServices !== "boolean") return "javaGenericServices: boolean expected"; if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) if (typeof message.pyGenericServices !== "boolean") return "pyGenericServices: boolean expected"; if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) if (typeof message.phpGenericServices !== "boolean") return "phpGenericServices: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) if (typeof message.ccEnableArenas !== "boolean") return "ccEnableArenas: boolean expected"; if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) if (!$util.isString(message.objcClassPrefix)) return "objcClassPrefix: string expected"; if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) if (!$util.isString(message.csharpNamespace)) return "csharpNamespace: string expected"; if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) if (!$util.isString(message.swiftPrefix)) return "swiftPrefix: string expected"; if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) if (!$util.isString(message.phpClassPrefix)) return "phpClassPrefix: string expected"; if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) if (!$util.isString(message.phpNamespace)) return "phpNamespace: string expected"; if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) if (!$util.isString(message.phpMetadataNamespace)) return "phpMetadataNamespace: string expected"; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) if (!$util.isString(message.rubyPackage)) return "rubyPackage: string expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { if (!Array.isArray(message[".google.api.resourceDefinition"])) return ".google.api.resourceDefinition: array expected"; for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); if (error) return ".google.api.resourceDefinition." + error; } } return null; }; /** * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileOptions} FileOptions */ FileOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileOptions) return object; var message = new $root.google.protobuf.FileOptions(); if (object.javaPackage != null) message.javaPackage = String(object.javaPackage); if (object.javaOuterClassname != null) message.javaOuterClassname = String(object.javaOuterClassname); if (object.javaMultipleFiles != null) message.javaMultipleFiles = Boolean(object.javaMultipleFiles); if (object.javaGenerateEqualsAndHash != null) message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { case "SPEED": case 1: message.optimizeFor = 1; break; case "CODE_SIZE": case 2: message.optimizeFor = 2; break; case "LITE_RUNTIME": case 3: message.optimizeFor = 3; break; } if (object.goPackage != null) message.goPackage = String(object.goPackage); if (object.ccGenericServices != null) message.ccGenericServices = Boolean(object.ccGenericServices); if (object.javaGenericServices != null) message.javaGenericServices = Boolean(object.javaGenericServices); if (object.pyGenericServices != null) message.pyGenericServices = Boolean(object.pyGenericServices); if (object.phpGenericServices != null) message.phpGenericServices = Boolean(object.phpGenericServices); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.ccEnableArenas != null) message.ccEnableArenas = Boolean(object.ccEnableArenas); if (object.objcClassPrefix != null) message.objcClassPrefix = String(object.objcClassPrefix); if (object.csharpNamespace != null) message.csharpNamespace = String(object.csharpNamespace); if (object.swiftPrefix != null) message.swiftPrefix = String(object.swiftPrefix); if (object.phpClassPrefix != null) message.phpClassPrefix = String(object.phpClassPrefix); if (object.phpNamespace != null) message.phpNamespace = String(object.phpNamespace); if (object.phpMetadataNamespace != null) message.phpMetadataNamespace = String(object.phpMetadataNamespace); if (object.rubyPackage != null) message.rubyPackage = String(object.rubyPackage); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.resourceDefinition"]) { if (!Array.isArray(object[".google.api.resourceDefinition"])) throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); message[".google.api.resourceDefinition"] = []; for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { if (typeof object[".google.api.resourceDefinition"][i] !== "object") throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); } } return message; }; /** * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; object[".google.api.resourceDefinition"] = []; } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; object.optimizeFor = options.enums === String ? "SPEED" : 1; object.javaMultipleFiles = false; object.goPackage = ""; object.ccGenericServices = false; object.javaGenericServices = false; object.pyGenericServices = false; object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; object.phpClassPrefix = ""; object.phpNamespace = ""; object.phpGenericServices = false; object.phpMetadataNamespace = ""; object.rubyPackage = ""; } if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) object.javaPackage = message.javaPackage; if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) object.goPackage = message.goPackage; if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) object.ccGenericServices = message.ccGenericServices; if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) object.javaGenericServices = message.javaGenericServices; if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) object.pyGenericServices = message.pyGenericServices; if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) object.javaStringCheckUtf8 = message.javaStringCheckUtf8; if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) object.ccEnableArenas = message.ccEnableArenas; if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) object.objcClassPrefix = message.objcClassPrefix; if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) object.csharpNamespace = message.csharpNamespace; if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) object.swiftPrefix = message.swiftPrefix; if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) object.phpClassPrefix = message.phpClassPrefix; if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) object.phpNamespace = message.phpNamespace; if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) object.phpGenericServices = message.phpGenericServices; if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) object.phpMetadataNamespace = message.phpMetadataNamespace; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) object.rubyPackage = message.rubyPackage; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { object[".google.api.resourceDefinition"] = []; for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); } return object; }; /** * Converts this FileOptions to JSON. * @function toJSON * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value */ FileOptions.OptimizeMode = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "SPEED"] = 1; values[valuesById[2] = "CODE_SIZE"] = 2; values[valuesById[3] = "LITE_RUNTIME"] = 3; return values; })(); return FileOptions; })(); protobuf.MessageOptions = (function() { /** * Properties of a MessageOptions. * @memberof google.protobuf * @interface IMessageOptions * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor * @property {boolean|null} [deprecated] MessageOptions deprecated * @property {boolean|null} [mapEntry] MessageOptions mapEntry * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ /** * Constructs a new MessageOptions. * @memberof google.protobuf * @classdesc Represents a MessageOptions. * @implements IMessageOptions * @constructor * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ function MessageOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MessageOptions messageSetWireFormat. * @member {boolean} messageSetWireFormat * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.messageSetWireFormat = false; /** * MessageOptions noStandardDescriptorAccessor. * @member {boolean} noStandardDescriptorAccessor * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.noStandardDescriptorAccessor = false; /** * MessageOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.deprecated = false; /** * MessageOptions mapEntry. * @member {boolean} mapEntry * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.mapEntry = false; /** * MessageOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; /** * MessageOptions .google.api.resource. * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype[".google.api.resource"] = null; /** * Creates a new MessageOptions instance using the specified properties. * @function create * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions=} [properties] Properties to set * @returns {google.protobuf.MessageOptions} MessageOptions instance */ MessageOptions.create = function create(properties) { return new MessageOptions(properties); }; /** * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; /** * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MessageOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessageOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.messageSetWireFormat = reader.bool(); break; case 2: message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: message.mapEntry = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1053: message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MessageOptions message. * @function verify * @memberof google.protobuf.MessageOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MessageOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) if (typeof message.messageSetWireFormat !== "boolean") return "messageSetWireFormat: boolean expected"; if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) if (typeof message.noStandardDescriptorAccessor !== "boolean") return "noStandardDescriptorAccessor: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) if (typeof message.mapEntry !== "boolean") return "mapEntry: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); if (error) return ".google.api.resource." + error; } return null; }; /** * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.MessageOptions} MessageOptions */ MessageOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MessageOptions) return object; var message = new $root.google.protobuf.MessageOptions(); if (object.messageSetWireFormat != null) message.messageSetWireFormat = Boolean(object.messageSetWireFormat); if (object.noStandardDescriptorAccessor != null) message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.mapEntry != null) message.mapEntry = Boolean(object.mapEntry); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.resource"] != null) { if (typeof object[".google.api.resource"] !== "object") throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); } return message; }; /** * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.messageSetWireFormat = false; object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) object.mapEntry = message.mapEntry; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); return object; }; /** * Converts this MessageOptions to JSON. * @function toJSON * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MessageOptions; })(); protobuf.FieldOptions = (function() { /** * Properties of a FieldOptions. * @memberof google.protobuf * @interface IFieldOptions * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype * @property {boolean|null} [packed] FieldOptions packed * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype * @property {boolean|null} [lazy] FieldOptions lazy * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** * Constructs a new FieldOptions. * @memberof google.protobuf * @classdesc Represents a FieldOptions. * @implements IFieldOptions * @constructor * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ function FieldOptions(properties) { this.uninterpretedOption = []; this[".google.api.fieldBehavior"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldOptions ctype. * @member {google.protobuf.FieldOptions.CType} ctype * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.ctype = 0; /** * FieldOptions packed. * @member {boolean} packed * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.packed = false; /** * FieldOptions jstype. * @member {google.protobuf.FieldOptions.JSType} jstype * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.jstype = 0; /** * FieldOptions lazy. * @member {boolean} lazy * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.lazy = false; /** * FieldOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.deprecated = false; /** * FieldOptions weak. * @member {boolean} weak * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.weak = false; /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** * FieldOptions .google.api.fieldBehavior. * @member {Array.} .google.api.fieldBehavior * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** * FieldOptions .google.api.resourceReference. * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype[".google.api.resourceReference"] = null; /** * Creates a new FieldOptions instance using the specified properties. * @function create * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions=} [properties] Properties to set * @returns {google.protobuf.FieldOptions} FieldOptions instance */ FieldOptions.create = function create(properties) { return new FieldOptions(properties); }; /** * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; /** * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.ctype = reader.int32(); break; case 2: message.packed = reader.bool(); break; case 6: message.jstype = reader.int32(); break; case 5: message.lazy = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 10: message.weak = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1052: if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message[".google.api.fieldBehavior"].push(reader.int32()); } else message[".google.api.fieldBehavior"].push(reader.int32()); break; case 1055: message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldOptions message. * @function verify * @memberof google.protobuf.FieldOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.ctype != null && message.hasOwnProperty("ctype")) switch (message.ctype) { default: return "ctype: enum value expected"; case 0: case 1: case 2: break; } if (message.packed != null && message.hasOwnProperty("packed")) if (typeof message.packed !== "boolean") return "packed: boolean expected"; if (message.jstype != null && message.hasOwnProperty("jstype")) switch (message.jstype) { default: return "jstype: enum value expected"; case 0: case 1: case 2: break; } if (message.lazy != null && message.hasOwnProperty("lazy")) if (typeof message.lazy !== "boolean") return "lazy: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.weak != null && message.hasOwnProperty("weak")) if (typeof message.weak !== "boolean") return "weak: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) switch (message[".google.api.fieldBehavior"][i]) { default: return ".google.api.fieldBehavior: enum value[] expected"; case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: break; } } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); if (error) return ".google.api.resourceReference." + error; } return null; }; /** * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldOptions} FieldOptions */ FieldOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldOptions) return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { case "STRING": case 0: message.ctype = 0; break; case "CORD": case 1: message.ctype = 1; break; case "STRING_PIECE": case 2: message.ctype = 2; break; } if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { case "JS_NORMAL": case 0: message.jstype = 0; break; case "JS_STRING": case 1: message.jstype = 1; break; case "JS_NUMBER": case 2: message.jstype = 2; break; } if (object.lazy != null) message.lazy = Boolean(object.lazy); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.weak != null) message.weak = Boolean(object.weak); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); message[".google.api.fieldBehavior"] = []; for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) switch (object[".google.api.fieldBehavior"][i]) { default: case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: message[".google.api.fieldBehavior"][i] = 0; break; case "OPTIONAL": case 1: message[".google.api.fieldBehavior"][i] = 1; break; case "REQUIRED": case 2: message[".google.api.fieldBehavior"][i] = 2; break; case "OUTPUT_ONLY": case 3: message[".google.api.fieldBehavior"][i] = 3; break; case "INPUT_ONLY": case 4: message[".google.api.fieldBehavior"][i] = 4; break; case "IMMUTABLE": case 5: message[".google.api.fieldBehavior"][i] = 5; break; case "UNORDERED_LIST": case 6: message[".google.api.fieldBehavior"][i] = 6; break; case "NON_EMPTY_DEFAULT": case 7: message[".google.api.fieldBehavior"][i] = 7; break; } } if (object[".google.api.resourceReference"] != null) { if (typeof object[".google.api.resourceReference"] !== "object") throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); } return message; }; /** * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; object[".google.api.fieldBehavior"] = []; } if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; object.packed = false; object.deprecated = false; object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { object[".google.api.fieldBehavior"] = []; for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); return object; }; /** * Converts this FieldOptions to JSON. * @function toJSON * @memberof google.protobuf.FieldOptions * @instance * @returns {Object.} JSON object */ FieldOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * CType enum. * @name google.protobuf.FieldOptions.CType * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value */ FieldOptions.CType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STRING"] = 0; values[valuesById[1] = "CORD"] = 1; values[valuesById[2] = "STRING_PIECE"] = 2; return values; })(); /** * JSType enum. * @name google.protobuf.FieldOptions.JSType * @enum {number} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value */ FieldOptions.JSType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "JS_NORMAL"] = 0; values[valuesById[1] = "JS_STRING"] = 1; values[valuesById[2] = "JS_NUMBER"] = 2; return values; })(); return FieldOptions; })(); protobuf.OneofOptions = (function() { /** * Properties of an OneofOptions. * @memberof google.protobuf * @interface IOneofOptions * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** * Constructs a new OneofOptions. * @memberof google.protobuf * @classdesc Represents an OneofOptions. * @implements IOneofOptions * @constructor * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ function OneofOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OneofOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.OneofOptions * @instance */ OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new OneofOptions instance using the specified properties. * @function create * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions=} [properties] Properties to set * @returns {google.protobuf.OneofOptions} OneofOptions instance */ OneofOptions.create = function create(properties) { return new OneofOptions(properties); }; /** * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OneofOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OneofOptions message. * @function verify * @memberof google.protobuf.OneofOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OneofOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.OneofOptions} OneofOptions */ OneofOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.OneofOptions) return object; var message = new $root.google.protobuf.OneofOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OneofOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this OneofOptions to JSON. * @function toJSON * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OneofOptions; })(); protobuf.EnumOptions = (function() { /** * Properties of an EnumOptions. * @memberof google.protobuf * @interface IEnumOptions * @property {boolean|null} [allowAlias] EnumOptions allowAlias * @property {boolean|null} [deprecated] EnumOptions deprecated * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** * Constructs a new EnumOptions. * @memberof google.protobuf * @classdesc Represents an EnumOptions. * @implements IEnumOptions * @constructor * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ function EnumOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumOptions allowAlias. * @member {boolean} allowAlias * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.allowAlias = false; /** * EnumOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.deprecated = false; /** * EnumOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new EnumOptions instance using the specified properties. * @function create * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions=} [properties] Properties to set * @returns {google.protobuf.EnumOptions} EnumOptions instance */ EnumOptions.create = function create(properties) { return new EnumOptions(properties); }; /** * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumOptions message. * @function verify * @memberof google.protobuf.EnumOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) if (typeof message.allowAlias !== "boolean") return "allowAlias: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumOptions} EnumOptions */ EnumOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumOptions) return object; var message = new $root.google.protobuf.EnumOptions(); if (object.allowAlias != null) message.allowAlias = Boolean(object.allowAlias); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.allowAlias = false; object.deprecated = false; } if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) object.allowAlias = message.allowAlias; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this EnumOptions to JSON. * @function toJSON * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumOptions; })(); protobuf.EnumValueOptions = (function() { /** * Properties of an EnumValueOptions. * @memberof google.protobuf * @interface IEnumValueOptions * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** * Constructs a new EnumValueOptions. * @memberof google.protobuf * @classdesc Represents an EnumValueOptions. * @implements IEnumValueOptions * @constructor * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ function EnumValueOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumValueOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.EnumValueOptions * @instance */ EnumValueOptions.prototype.deprecated = false; /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.EnumValueOptions * @instance */ EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new EnumValueOptions instance using the specified properties. * @function create * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ EnumValueOptions.create = function create(properties) { return new EnumValueOptions(properties); }; /** * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumValueOptions message. * @function verify * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumValueOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ EnumValueOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumValueOptions) return object; var message = new $root.google.protobuf.EnumValueOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumValueOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) object.deprecated = false; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this EnumValueOptions to JSON. * @function toJSON * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumValueOptions; })(); protobuf.ServiceOptions = (function() { /** * Properties of a ServiceOptions. * @memberof google.protobuf * @interface IServiceOptions * @property {boolean|null} [deprecated] ServiceOptions deprecated * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes */ /** * Constructs a new ServiceOptions. * @memberof google.protobuf * @classdesc Represents a ServiceOptions. * @implements IServiceOptions * @constructor * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ function ServiceOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ServiceOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype.deprecated = false; /** * ServiceOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** * ServiceOptions .google.api.defaultHost. * @member {string} .google.api.defaultHost * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** * ServiceOptions .google.api.oauthScopes. * @member {string} .google.api.oauthScopes * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype[".google.api.oauthScopes"] = ""; /** * Creates a new ServiceOptions instance using the specified properties. * @function create * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions=} [properties] Properties to set * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ ServiceOptions.create = function create(properties) { return new ServiceOptions(properties); }; /** * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; /** * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 33: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1049: message[".google.api.defaultHost"] = reader.string(); break; case 1050: message[".google.api.oauthScopes"] = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ServiceOptions message. * @function verify * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ServiceOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) if (!$util.isString(message[".google.api.defaultHost"])) return ".google.api.defaultHost: string expected"; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) if (!$util.isString(message[".google.api.oauthScopes"])) return ".google.api.oauthScopes: string expected"; return null; }; /** * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.ServiceOptions} ServiceOptions */ ServiceOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ServiceOptions) return object; var message = new $root.google.protobuf.ServiceOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.defaultHost"] != null) message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); if (object[".google.api.oauthScopes"] != null) message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; /** * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.deprecated = false; object[".google.api.defaultHost"] = ""; object[".google.api.oauthScopes"] = ""; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; /** * Converts this ServiceOptions to JSON. * @function toJSON * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ServiceOptions; })(); protobuf.MethodOptions = (function() { /** * Properties of a MethodOptions. * @memberof google.protobuf * @interface IMethodOptions * @property {boolean|null} [deprecated] MethodOptions deprecated * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature */ /** * Constructs a new MethodOptions. * @memberof google.protobuf * @classdesc Represents a MethodOptions. * @implements IMethodOptions * @constructor * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ function MethodOptions(properties) { this.uninterpretedOption = []; this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MethodOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.deprecated = false; /** * MethodOptions idempotencyLevel. * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.idempotencyLevel = 0; /** * MethodOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** * MethodOptions .google.api.http. * @member {google.api.IHttpRule|null|undefined} .google.api.http * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.api.http"] = null; /** * MethodOptions .google.api.methodSignature. * @member {Array.} .google.api.methodSignature * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** * Creates a new MethodOptions instance using the specified properties. * @function create * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions=} [properties] Properties to set * @returns {google.protobuf.MethodOptions} MethodOptions instance */ MethodOptions.create = function create(properties) { return new MethodOptions(properties); }; /** * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; /** * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MethodOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 33: message.deprecated = reader.bool(); break; case 34: message.idempotencyLevel = reader.int32(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 72295728: message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; case 1051: if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) message[".google.api.methodSignature"] = []; message[".google.api.methodSignature"].push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MethodOptions message. * @function verify * @memberof google.protobuf.MethodOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) switch (message.idempotencyLevel) { default: return "idempotencyLevel: enum value expected"; case 0: case 1: case 2: break; } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); if (error) return ".google.api.http." + error; } if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { if (!Array.isArray(message[".google.api.methodSignature"])) return ".google.api.methodSignature: array expected"; for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) if (!$util.isString(message[".google.api.methodSignature"][i])) return ".google.api.methodSignature: string[] expected"; } return null; }; /** * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.MethodOptions} MethodOptions */ MethodOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MethodOptions) return object; var message = new $root.google.protobuf.MethodOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; break; case "NO_SIDE_EFFECTS": case 1: message.idempotencyLevel = 1; break; case "IDEMPOTENT": case 2: message.idempotencyLevel = 2; break; } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.http"] != null) { if (typeof object[".google.api.http"] !== "object") throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); } if (object[".google.api.methodSignature"]) { if (!Array.isArray(object[".google.api.methodSignature"])) throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); message[".google.api.methodSignature"] = []; for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } return message; }; /** * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; object[".google.api.methodSignature"] = []; } if (options.defaults) { object.deprecated = false; object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; object[".google.api.http"] = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { object[".google.api.methodSignature"] = []; for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; } if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; /** * Converts this MethodOptions to JSON. * @function toJSON * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel * @enum {number} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value */ MethodOptions.IdempotencyLevel = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; values[valuesById[2] = "IDEMPOTENT"] = 2; return values; })(); return MethodOptions; })(); protobuf.UninterpretedOption = (function() { /** * Properties of an UninterpretedOption. * @memberof google.protobuf * @interface IUninterpretedOption * @property {Array.|null} [name] UninterpretedOption name * @property {string|null} [identifierValue] UninterpretedOption identifierValue * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue * @property {number|null} [doubleValue] UninterpretedOption doubleValue * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue */ /** * Constructs a new UninterpretedOption. * @memberof google.protobuf * @classdesc Represents an UninterpretedOption. * @implements IUninterpretedOption * @constructor * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ function UninterpretedOption(properties) { this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UninterpretedOption name. * @member {Array.} name * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.name = $util.emptyArray; /** * UninterpretedOption identifierValue. * @member {string} identifierValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.identifierValue = ""; /** * UninterpretedOption positiveIntValue. * @member {number|Long} positiveIntValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * UninterpretedOption negativeIntValue. * @member {number|Long} negativeIntValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * UninterpretedOption doubleValue. * @member {number} doubleValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.doubleValue = 0; /** * UninterpretedOption stringValue. * @member {Uint8Array} stringValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** * UninterpretedOption aggregateValue. * @member {string} aggregateValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.aggregateValue = ""; /** * Creates a new UninterpretedOption instance using the specified properties. * @function create * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ UninterpretedOption.create = function create(properties) { return new UninterpretedOption(properties); }; /** * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: if (!(message.name && message.name.length)) message.name = []; message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; case 3: message.identifierValue = reader.string(); break; case 4: message.positiveIntValue = reader.uint64(); break; case 5: message.negativeIntValue = reader.int64(); break; case 6: message.doubleValue = reader.double(); break; case 7: message.stringValue = reader.bytes(); break; case 8: message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UninterpretedOption message. * @function verify * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UninterpretedOption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) { if (!Array.isArray(message.name)) return "name: array expected"; for (var i = 0; i < message.name.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); if (error) return "name." + error; } } if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) if (!$util.isString(message.identifierValue)) return "identifierValue: string expected"; if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) return "positiveIntValue: integer|Long expected"; if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) return "negativeIntValue: integer|Long expected"; if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; if (message.stringValue != null && message.hasOwnProperty("stringValue")) if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) return "stringValue: buffer expected"; if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) if (!$util.isString(message.aggregateValue)) return "aggregateValue: string expected"; return null; }; /** * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ UninterpretedOption.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.UninterpretedOption) return object; var message = new $root.google.protobuf.UninterpretedOption(); if (object.name) { if (!Array.isArray(object.name)) throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); message.name = []; for (var i = 0; i < object.name.length; ++i) { if (typeof object.name[i] !== "object") throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); } } if (object.identifierValue != null) message.identifierValue = String(object.identifierValue); if (object.positiveIntValue != null) if ($util.Long) (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; else if (typeof object.positiveIntValue === "string") message.positiveIntValue = parseInt(object.positiveIntValue, 10); else if (typeof object.positiveIntValue === "number") message.positiveIntValue = object.positiveIntValue; else if (typeof object.positiveIntValue === "object") message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); if (object.negativeIntValue != null) if ($util.Long) (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; else if (typeof object.negativeIntValue === "string") message.negativeIntValue = parseInt(object.negativeIntValue, 10); else if (typeof object.negativeIntValue === "number") message.negativeIntValue = object.negativeIntValue; else if (typeof object.negativeIntValue === "object") message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); if (object.doubleValue != null) message.doubleValue = Number(object.doubleValue); if (object.stringValue != null) if (typeof object.stringValue === "string") $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); else if (object.stringValue.length) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); return message; }; /** * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.name = []; if (options.defaults) { object.identifierValue = ""; if ($util.Long) { var long = new $util.Long(0, 0, true); object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.positiveIntValue = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.negativeIntValue = options.longs === String ? "0" : 0; object.doubleValue = 0; if (options.bytes === String) object.stringValue = ""; else { object.stringValue = []; if (options.bytes !== Array) object.stringValue = $util.newBuffer(object.stringValue); } object.aggregateValue = ""; } if (message.name && message.name.length) { object.name = []; for (var j = 0; j < message.name.length; ++j) object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); } if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) object.identifierValue = message.identifierValue; if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) if (typeof message.positiveIntValue === "number") object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; else object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) if (typeof message.negativeIntValue === "number") object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; else object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; if (message.stringValue != null && message.hasOwnProperty("stringValue")) object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) object.aggregateValue = message.aggregateValue; return object; }; /** * Converts this UninterpretedOption to JSON. * @function toJSON * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; UninterpretedOption.NamePart = (function() { /** * Properties of a NamePart. * @memberof google.protobuf.UninterpretedOption * @interface INamePart * @property {string} namePart NamePart namePart * @property {boolean} isExtension NamePart isExtension */ /** * Constructs a new NamePart. * @memberof google.protobuf.UninterpretedOption * @classdesc Represents a NamePart. * @implements INamePart * @constructor * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set */ function NamePart(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * NamePart namePart. * @member {string} namePart * @memberof google.protobuf.UninterpretedOption.NamePart * @instance */ NamePart.prototype.namePart = ""; /** * NamePart isExtension. * @member {boolean} isExtension * @memberof google.protobuf.UninterpretedOption.NamePart * @instance */ NamePart.prototype.isExtension = false; /** * Creates a new NamePart instance using the specified properties. * @function create * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance */ NamePart.create = function create(properties) { return new NamePart(properties); }; /** * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encode * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NamePart.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); return writer; }; /** * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NamePart.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a NamePart message from the specified reader or buffer. * @function decode * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NamePart.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.namePart = reader.string(); break; case 2: message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); break; } } if (!message.hasOwnProperty("namePart")) throw $util.ProtocolError("missing required 'namePart'", { instance: message }); if (!message.hasOwnProperty("isExtension")) throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; /** * Decodes a NamePart message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NamePart.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a NamePart message. * @function verify * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ NamePart.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (!$util.isString(message.namePart)) return "namePart: string expected"; if (typeof message.isExtension !== "boolean") return "isExtension: boolean expected"; return null; }; /** * Creates a NamePart message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart */ NamePart.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) return object; var message = new $root.google.protobuf.UninterpretedOption.NamePart(); if (object.namePart != null) message.namePart = String(object.namePart); if (object.isExtension != null) message.isExtension = Boolean(object.isExtension); return message; }; /** * Creates a plain object from a NamePart message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ NamePart.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.namePart = ""; object.isExtension = false; } if (message.namePart != null && message.hasOwnProperty("namePart")) object.namePart = message.namePart; if (message.isExtension != null && message.hasOwnProperty("isExtension")) object.isExtension = message.isExtension; return object; }; /** * Converts this NamePart to JSON. * @function toJSON * @memberof google.protobuf.UninterpretedOption.NamePart * @instance * @returns {Object.} JSON object */ NamePart.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return NamePart; })(); return UninterpretedOption; })(); protobuf.SourceCodeInfo = (function() { /** * Properties of a SourceCodeInfo. * @memberof google.protobuf * @interface ISourceCodeInfo * @property {Array.|null} [location] SourceCodeInfo location */ /** * Constructs a new SourceCodeInfo. * @memberof google.protobuf * @classdesc Represents a SourceCodeInfo. * @implements ISourceCodeInfo * @constructor * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ function SourceCodeInfo(properties) { this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SourceCodeInfo location. * @member {Array.} location * @memberof google.protobuf.SourceCodeInfo * @instance */ SourceCodeInfo.prototype.location = $util.emptyArray; /** * Creates a new SourceCodeInfo instance using the specified properties. * @function create * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ SourceCodeInfo.create = function create(properties) { return new SourceCodeInfo(properties); }; /** * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.location != null && message.location.length) for (var i = 0; i < message.location.length; ++i) $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.location && message.location.length)) message.location = []; message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SourceCodeInfo message. * @function verify * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SourceCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.location != null && message.hasOwnProperty("location")) { if (!Array.isArray(message.location)) return "location: array expected"; for (var i = 0; i < message.location.length; ++i) { var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); if (error) return "location." + error; } } return null; }; /** * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ SourceCodeInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; var message = new $root.google.protobuf.SourceCodeInfo(); if (object.location) { if (!Array.isArray(object.location)) throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); message.location = []; for (var i = 0; i < object.location.length; ++i) { if (typeof object.location[i] !== "object") throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); } } return message; }; /** * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.location = []; if (message.location && message.location.length) { object.location = []; for (var j = 0; j < message.location.length; ++j) object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); } return object; }; /** * Converts this SourceCodeInfo to JSON. * @function toJSON * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; SourceCodeInfo.Location = (function() { /** * Properties of a Location. * @memberof google.protobuf.SourceCodeInfo * @interface ILocation * @property {Array.|null} [path] Location path * @property {Array.|null} [span] Location span * @property {string|null} [leadingComments] Location leadingComments * @property {string|null} [trailingComments] Location trailingComments * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments */ /** * Constructs a new Location. * @memberof google.protobuf.SourceCodeInfo * @classdesc Represents a Location. * @implements ILocation * @constructor * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ function Location(properties) { this.path = []; this.span = []; this.leadingDetachedComments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Location path. * @member {Array.} path * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.path = $util.emptyArray; /** * Location span. * @member {Array.} span * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.span = $util.emptyArray; /** * Location leadingComments. * @member {string} leadingComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.leadingComments = ""; /** * Location trailingComments. * @member {string} trailingComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.trailingComments = ""; /** * Location leadingDetachedComments. * @member {Array.} leadingDetachedComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.leadingDetachedComments = $util.emptyArray; /** * Creates a new Location instance using the specified properties. * @function create * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ Location.create = function create(properties) { return new Location(properties); }; /** * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encode * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } if (message.span != null && message.span.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); for (var i = 0; i < message.span.length; ++i) writer.int32(message.span[i]); writer.ldelim(); } if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); return writer; }; /** * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Location message from the specified reader or buffer. * @function decode * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.path && message.path.length)) message.path = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.path.push(reader.int32()); } else message.path.push(reader.int32()); break; case 2: if (!(message.span && message.span.length)) message.span = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.span.push(reader.int32()); } else message.span.push(reader.int32()); break; case 3: message.leadingComments = reader.string(); break; case 4: message.trailingComments = reader.string(); break; case 6: if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) message.leadingDetachedComments = []; message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Location message. * @function verify * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Location.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { if (!Array.isArray(message.path)) return "path: array expected"; for (var i = 0; i < message.path.length; ++i) if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } if (message.span != null && message.hasOwnProperty("span")) { if (!Array.isArray(message.span)) return "span: array expected"; for (var i = 0; i < message.span.length; ++i) if (!$util.isInteger(message.span[i])) return "span: integer[] expected"; } if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) if (!$util.isString(message.leadingComments)) return "leadingComments: string expected"; if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) if (!$util.isString(message.trailingComments)) return "trailingComments: string expected"; if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { if (!Array.isArray(message.leadingDetachedComments)) return "leadingDetachedComments: array expected"; for (var i = 0; i < message.leadingDetachedComments.length; ++i) if (!$util.isString(message.leadingDetachedComments[i])) return "leadingDetachedComments: string[] expected"; } return null; }; /** * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo.Location} Location */ Location.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; var message = new $root.google.protobuf.SourceCodeInfo.Location(); if (object.path) { if (!Array.isArray(object.path)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } if (object.span) { if (!Array.isArray(object.span)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); message.span = []; for (var i = 0; i < object.span.length; ++i) message.span[i] = object.span[i] | 0; } if (object.leadingComments != null) message.leadingComments = String(object.leadingComments); if (object.trailingComments != null) message.trailingComments = String(object.trailingComments); if (object.leadingDetachedComments) { if (!Array.isArray(object.leadingDetachedComments)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); message.leadingDetachedComments = []; for (var i = 0; i < object.leadingDetachedComments.length; ++i) message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); } return message; }; /** * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.path = []; object.span = []; object.leadingDetachedComments = []; } if (options.defaults) { object.leadingComments = ""; object.trailingComments = ""; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } if (message.span && message.span.length) { object.span = []; for (var j = 0; j < message.span.length; ++j) object.span[j] = message.span[j]; } if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) object.leadingComments = message.leadingComments; if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) object.trailingComments = message.trailingComments; if (message.leadingDetachedComments && message.leadingDetachedComments.length) { object.leadingDetachedComments = []; for (var j = 0; j < message.leadingDetachedComments.length; ++j) object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; } return object; }; /** * Converts this Location to JSON. * @function toJSON * @memberof google.protobuf.SourceCodeInfo.Location * @instance * @returns {Object.} JSON object */ Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Location; })(); return SourceCodeInfo; })(); protobuf.GeneratedCodeInfo = (function() { /** * Properties of a GeneratedCodeInfo. * @memberof google.protobuf * @interface IGeneratedCodeInfo * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf * @classdesc Represents a GeneratedCodeInfo. * @implements IGeneratedCodeInfo * @constructor * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ function GeneratedCodeInfo(properties) { this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GeneratedCodeInfo annotation. * @member {Array.} annotation * @memberof google.protobuf.GeneratedCodeInfo * @instance */ GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ GeneratedCodeInfo.create = function create(properties) { return new GeneratedCodeInfo(properties); }; /** * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.annotation != null && message.annotation.length) for (var i = 0; i < message.annotation.length; ++i) $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.annotation && message.annotation.length)) message.annotation = []; message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GeneratedCodeInfo message. * @function verify * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GeneratedCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.annotation != null && message.hasOwnProperty("annotation")) { if (!Array.isArray(message.annotation)) return "annotation: array expected"; for (var i = 0; i < message.annotation.length; ++i) { var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); if (error) return "annotation." + error; } } return null; }; /** * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ GeneratedCodeInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; var message = new $root.google.protobuf.GeneratedCodeInfo(); if (object.annotation) { if (!Array.isArray(object.annotation)) throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); message.annotation = []; for (var i = 0; i < object.annotation.length; ++i) { if (typeof object.annotation[i] !== "object") throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); } } return message; }; /** * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GeneratedCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.annotation = []; if (message.annotation && message.annotation.length) { object.annotation = []; for (var j = 0; j < message.annotation.length; ++j) object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); } return object; }; /** * Converts this GeneratedCodeInfo to JSON. * @function toJSON * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; GeneratedCodeInfo.Annotation = (function() { /** * Properties of an Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @interface IAnnotation * @property {Array.|null} [path] Annotation path * @property {string|null} [sourceFile] Annotation sourceFile * @property {number|null} [begin] Annotation begin * @property {number|null} [end] Annotation end */ /** * Constructs a new Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @classdesc Represents an Annotation. * @implements IAnnotation * @constructor * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set */ function Annotation(properties) { this.path = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Annotation path. * @member {Array.} path * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.path = $util.emptyArray; /** * Annotation sourceFile. * @member {string} sourceFile * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.sourceFile = ""; /** * Annotation begin. * @member {number} begin * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.begin = 0; /** * Annotation end. * @member {number} end * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.end = 0; /** * Creates a new Annotation instance using the specified properties. * @function create * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance */ Annotation.create = function create(properties) { return new Annotation(properties); }; /** * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encode * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; /** * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Annotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Annotation message from the specified reader or buffer. * @function decode * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Annotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.path && message.path.length)) message.path = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.path.push(reader.int32()); } else message.path.push(reader.int32()); break; case 2: message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); break; case 4: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Annotation message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Annotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Annotation message. * @function verify * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Annotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { if (!Array.isArray(message.path)) return "path: array expected"; for (var i = 0; i < message.path.length; ++i) if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) if (!$util.isString(message.sourceFile)) return "sourceFile: string expected"; if (message.begin != null && message.hasOwnProperty("begin")) if (!$util.isInteger(message.begin)) return "begin: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation */ Annotation.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) return object; var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); if (object.path) { if (!Array.isArray(object.path)) throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } if (object.sourceFile != null) message.sourceFile = String(object.sourceFile); if (object.begin != null) message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from an Annotation message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Annotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.path = []; if (options.defaults) { object.sourceFile = ""; object.begin = 0; object.end = 0; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) object.sourceFile = message.sourceFile; if (message.begin != null && message.hasOwnProperty("begin")) object.begin = message.begin; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this Annotation to JSON. * @function toJSON * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance * @returns {Object.} JSON object */ Annotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Annotation; })(); return GeneratedCodeInfo; })(); protobuf.Struct = (function() { /** * Properties of a Struct. * @memberof google.protobuf * @interface IStruct * @property {Object.|null} [fields] Struct fields */ /** * Constructs a new Struct. * @memberof google.protobuf * @classdesc Represents a Struct. * @implements IStruct * @constructor * @param {google.protobuf.IStruct=} [properties] Properties to set */ function Struct(properties) { this.fields = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Struct fields. * @member {Object.} fields * @memberof google.protobuf.Struct * @instance */ Struct.prototype.fields = $util.emptyObject; /** * Creates a new Struct instance using the specified properties. * @function create * @memberof google.protobuf.Struct * @static * @param {google.protobuf.IStruct=} [properties] Properties to set * @returns {google.protobuf.Struct} Struct instance */ Struct.create = function create(properties) { return new Struct(properties); }; /** * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. * @function encode * @memberof google.protobuf.Struct * @static * @param {google.protobuf.IStruct} message Struct message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Struct.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } return writer; }; /** * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Struct * @static * @param {google.protobuf.IStruct} message Struct message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Struct.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Struct message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Struct * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Struct} Struct * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Struct.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (message.fields === $util.emptyObject) message.fields = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = null; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag2 & 7); break; } } message.fields[key] = value; break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Struct message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Struct * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Struct} Struct * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Struct.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Struct message. * @function verify * @memberof google.protobuf.Struct * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Struct.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.fields != null && message.hasOwnProperty("fields")) { if (!$util.isObject(message.fields)) return "fields: object expected"; var key = Object.keys(message.fields); for (var i = 0; i < key.length; ++i) { var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); if (error) return "fields." + error; } } return null; }; /** * Creates a Struct message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Struct * @static * @param {Object.} object Plain object * @returns {google.protobuf.Struct} Struct */ Struct.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Struct) return object; var message = new $root.google.protobuf.Struct(); if (object.fields) { if (typeof object.fields !== "object") throw TypeError(".google.protobuf.Struct.fields: object expected"); message.fields = {}; for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { if (typeof object.fields[keys[i]] !== "object") throw TypeError(".google.protobuf.Struct.fields: object expected"); message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); } } return message; }; /** * Creates a plain object from a Struct message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Struct * @static * @param {google.protobuf.Struct} message Struct * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Struct.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.fields = {}; var keys2; if (message.fields && (keys2 = Object.keys(message.fields)).length) { object.fields = {}; for (var j = 0; j < keys2.length; ++j) object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); } return object; }; /** * Converts this Struct to JSON. * @function toJSON * @memberof google.protobuf.Struct * @instance * @returns {Object.} JSON object */ Struct.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Struct; })(); protobuf.Value = (function() { /** * Properties of a Value. * @memberof google.protobuf * @interface IValue * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue * @property {number|null} [numberValue] Value numberValue * @property {string|null} [stringValue] Value stringValue * @property {boolean|null} [boolValue] Value boolValue * @property {google.protobuf.IStruct|null} [structValue] Value structValue * @property {google.protobuf.IListValue|null} [listValue] Value listValue */ /** * Constructs a new Value. * @memberof google.protobuf * @classdesc Represents a Value. * @implements IValue * @constructor * @param {google.protobuf.IValue=} [properties] Properties to set */ function Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Value nullValue. * @member {google.protobuf.NullValue|null|undefined} nullValue * @memberof google.protobuf.Value * @instance */ Value.prototype.nullValue = null; /** * Value numberValue. * @member {number|null|undefined} numberValue * @memberof google.protobuf.Value * @instance */ Value.prototype.numberValue = null; /** * Value stringValue. * @member {string|null|undefined} stringValue * @memberof google.protobuf.Value * @instance */ Value.prototype.stringValue = null; /** * Value boolValue. * @member {boolean|null|undefined} boolValue * @memberof google.protobuf.Value * @instance */ Value.prototype.boolValue = null; /** * Value structValue. * @member {google.protobuf.IStruct|null|undefined} structValue * @memberof google.protobuf.Value * @instance */ Value.prototype.structValue = null; /** * Value listValue. * @member {google.protobuf.IListValue|null|undefined} listValue * @memberof google.protobuf.Value * @instance */ Value.prototype.listValue = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Value kind. * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind * @memberof google.protobuf.Value * @instance */ Object.defineProperty(Value.prototype, "kind", { get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new Value instance using the specified properties. * @function create * @memberof google.protobuf.Value * @static * @param {google.protobuf.IValue=} [properties] Properties to set * @returns {google.protobuf.Value} Value instance */ Value.create = function create(properties) { return new Value(properties); }; /** * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. * @function encode * @memberof google.protobuf.Value * @static * @param {google.protobuf.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Value * @static * @param {google.protobuf.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Value message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.nullValue = reader.int32(); break; case 2: message.numberValue = reader.double(); break; case 3: message.stringValue = reader.string(); break; case 4: message.boolValue = reader.bool(); break; case 5: message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; case 6: message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Value message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Value message. * @function verify * @memberof google.protobuf.Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.nullValue != null && message.hasOwnProperty("nullValue")) { properties.kind = 1; switch (message.nullValue) { default: return "nullValue: enum value expected"; case 0: break; } } if (message.numberValue != null && message.hasOwnProperty("numberValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; if (typeof message.numberValue !== "number") return "numberValue: number expected"; } if (message.stringValue != null && message.hasOwnProperty("stringValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; if (!$util.isString(message.stringValue)) return "stringValue: string expected"; } if (message.boolValue != null && message.hasOwnProperty("boolValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; if (typeof message.boolValue !== "boolean") return "boolValue: boolean expected"; } if (message.structValue != null && message.hasOwnProperty("structValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; { var error = $root.google.protobuf.Struct.verify(message.structValue); if (error) return "structValue." + error; } } if (message.listValue != null && message.hasOwnProperty("listValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; { var error = $root.google.protobuf.ListValue.verify(message.listValue); if (error) return "listValue." + error; } } return null; }; /** * Creates a Value message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Value * @static * @param {Object.} object Plain object * @returns {google.protobuf.Value} Value */ Value.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Value) return object; var message = new $root.google.protobuf.Value(); switch (object.nullValue) { case "NULL_VALUE": case 0: message.nullValue = 0; break; } if (object.numberValue != null) message.numberValue = Number(object.numberValue); if (object.stringValue != null) message.stringValue = String(object.stringValue); if (object.boolValue != null) message.boolValue = Boolean(object.boolValue); if (object.structValue != null) { if (typeof object.structValue !== "object") throw TypeError(".google.protobuf.Value.structValue: object expected"); message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); } if (object.listValue != null) { if (typeof object.listValue !== "object") throw TypeError(".google.protobuf.Value.listValue: object expected"); message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); } return message; }; /** * Creates a plain object from a Value message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Value * @static * @param {google.protobuf.Value} message Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.nullValue != null && message.hasOwnProperty("nullValue")) { object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; if (options.oneofs) object.kind = "nullValue"; } if (message.numberValue != null && message.hasOwnProperty("numberValue")) { object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; if (options.oneofs) object.kind = "numberValue"; } if (message.stringValue != null && message.hasOwnProperty("stringValue")) { object.stringValue = message.stringValue; if (options.oneofs) object.kind = "stringValue"; } if (message.boolValue != null && message.hasOwnProperty("boolValue")) { object.boolValue = message.boolValue; if (options.oneofs) object.kind = "boolValue"; } if (message.structValue != null && message.hasOwnProperty("structValue")) { object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); if (options.oneofs) object.kind = "structValue"; } if (message.listValue != null && message.hasOwnProperty("listValue")) { object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); if (options.oneofs) object.kind = "listValue"; } return object; }; /** * Converts this Value to JSON. * @function toJSON * @memberof google.protobuf.Value * @instance * @returns {Object.} JSON object */ Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Value; })(); /** * NullValue enum. * @name google.protobuf.NullValue * @enum {number} * @property {number} NULL_VALUE=0 NULL_VALUE value */ protobuf.NullValue = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "NULL_VALUE"] = 0; return values; })(); protobuf.ListValue = (function() { /** * Properties of a ListValue. * @memberof google.protobuf * @interface IListValue * @property {Array.|null} [values] ListValue values */ /** * Constructs a new ListValue. * @memberof google.protobuf * @classdesc Represents a ListValue. * @implements IListValue * @constructor * @param {google.protobuf.IListValue=} [properties] Properties to set */ function ListValue(properties) { this.values = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListValue values. * @member {Array.} values * @memberof google.protobuf.ListValue * @instance */ ListValue.prototype.values = $util.emptyArray; /** * Creates a new ListValue instance using the specified properties. * @function create * @memberof google.protobuf.ListValue * @static * @param {google.protobuf.IListValue=} [properties] Properties to set * @returns {google.protobuf.ListValue} ListValue instance */ ListValue.create = function create(properties) { return new ListValue(properties); }; /** * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. * @function encode * @memberof google.protobuf.ListValue * @static * @param {google.protobuf.IListValue} message ListValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ListValue * @static * @param {google.protobuf.IListValue} message ListValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListValue message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ListValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ListValue} ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.values && message.values.length)) message.values = []; message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListValue message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ListValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ListValue} ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListValue message. * @function verify * @memberof google.protobuf.ListValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.values != null && message.hasOwnProperty("values")) { if (!Array.isArray(message.values)) return "values: array expected"; for (var i = 0; i < message.values.length; ++i) { var error = $root.google.protobuf.Value.verify(message.values[i]); if (error) return "values." + error; } } return null; }; /** * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ListValue * @static * @param {Object.} object Plain object * @returns {google.protobuf.ListValue} ListValue */ ListValue.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ListValue) return object; var message = new $root.google.protobuf.ListValue(); if (object.values) { if (!Array.isArray(object.values)) throw TypeError(".google.protobuf.ListValue.values: array expected"); message.values = []; for (var i = 0; i < object.values.length; ++i) { if (typeof object.values[i] !== "object") throw TypeError(".google.protobuf.ListValue.values: object expected"); message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); } } return message; }; /** * Creates a plain object from a ListValue message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ListValue * @static * @param {google.protobuf.ListValue} message ListValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.values = []; if (message.values && message.values.length) { object.values = []; for (var j = 0; j < message.values.length; ++j) object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); } return object; }; /** * Converts this ListValue to JSON. * @function toJSON * @memberof google.protobuf.ListValue * @instance * @returns {Object.} JSON object */ ListValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListValue; })(); protobuf.Any = (function() { /** * Properties of an Any. * @memberof google.protobuf * @interface IAny * @property {string|null} [type_url] Any type_url * @property {Uint8Array|null} [value] Any value */ /** * Constructs a new Any. * @memberof google.protobuf * @classdesc Represents an Any. * @implements IAny * @constructor * @param {google.protobuf.IAny=} [properties] Properties to set */ function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Any type_url. * @member {string} type_url * @memberof google.protobuf.Any * @instance */ Any.prototype.type_url = ""; /** * Any value. * @member {Uint8Array} value * @memberof google.protobuf.Any * @instance */ Any.prototype.value = $util.newBuffer([]); /** * Creates a new Any instance using the specified properties. * @function create * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny=} [properties] Properties to set * @returns {google.protobuf.Any} Any instance */ Any.create = function create(properties) { return new Any(properties); }; /** * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; /** * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Any message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type_url = reader.string(); break; case 2: message.value = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Any message. * @function verify * @memberof google.protobuf.Any * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Any.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type_url != null && message.hasOwnProperty("type_url")) if (!$util.isString(message.type_url)) return "type_url: string expected"; if (message.value != null && message.hasOwnProperty("value")) if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) return "value: buffer expected"; return null; }; /** * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object * @returns {google.protobuf.Any} Any */ Any.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Any) return object; var message = new $root.google.protobuf.Any(); if (object.type_url != null) message.type_url = String(object.type_url); if (object.value != null) if (typeof object.value === "string") $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); else if (object.value.length) message.value = object.value; return message; }; /** * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Any * @static * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Any.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.type_url = ""; if (options.bytes === String) object.value = ""; else { object.value = []; if (options.bytes !== Array) object.value = $util.newBuffer(object.value); } } if (message.type_url != null && message.hasOwnProperty("type_url")) object.type_url = message.type_url; if (message.value != null && message.hasOwnProperty("value")) object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** * Converts this Any to JSON. * @function toJSON * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Any; })(); protobuf.Timestamp = (function() { /** * Properties of a Timestamp. * @memberof google.protobuf * @interface ITimestamp * @property {number|Long|null} [seconds] Timestamp seconds * @property {number|null} [nanos] Timestamp nanos */ /** * Constructs a new Timestamp. * @memberof google.protobuf * @classdesc Represents a Timestamp. * @implements ITimestamp * @constructor * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Timestamp seconds. * @member {number|Long} seconds * @memberof google.protobuf.Timestamp * @instance */ Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Timestamp nanos. * @member {number} nanos * @memberof google.protobuf.Timestamp * @instance */ Timestamp.prototype.nanos = 0; /** * Creates a new Timestamp instance using the specified properties. * @function create * @memberof google.protobuf.Timestamp * @static * @param {google.protobuf.ITimestamp=} [properties] Properties to set * @returns {google.protobuf.Timestamp} Timestamp instance */ Timestamp.create = function create(properties) { return new Timestamp(properties); }; /** * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode * @memberof google.protobuf.Timestamp * @static * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Timestamp * @static * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Timestamp message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Timestamp.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.seconds = reader.int64(); break; case 2: message.nanos = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Timestamp message. * @function verify * @memberof google.protobuf.Timestamp * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Timestamp.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.seconds != null && message.hasOwnProperty("seconds")) if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) return "seconds: integer|Long expected"; if (message.nanos != null && message.hasOwnProperty("nanos")) if (!$util.isInteger(message.nanos)) return "nanos: integer expected"; return null; }; /** * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object * @returns {google.protobuf.Timestamp} Timestamp */ Timestamp.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Timestamp) return object; var message = new $root.google.protobuf.Timestamp(); if (object.seconds != null) if ($util.Long) (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; else if (typeof object.seconds === "string") message.seconds = parseInt(object.seconds, 10); else if (typeof object.seconds === "number") message.seconds = object.seconds; else if (typeof object.seconds === "object") message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); if (object.nanos != null) message.nanos = object.nanos | 0; return message; }; /** * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Timestamp * @static * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Timestamp.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.seconds = options.longs === String ? "0" : 0; object.nanos = 0; } if (message.seconds != null && message.hasOwnProperty("seconds")) if (typeof message.seconds === "number") object.seconds = options.longs === String ? String(message.seconds) : message.seconds; else object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; if (message.nanos != null && message.hasOwnProperty("nanos")) object.nanos = message.nanos; return object; }; /** * Converts this Timestamp to JSON. * @function toJSON * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Timestamp; })(); protobuf.Empty = (function() { /** * Properties of an Empty. * @memberof google.protobuf * @interface IEmpty */ /** * Constructs a new Empty. * @memberof google.protobuf * @classdesc Represents an Empty. * @implements IEmpty * @constructor * @param {google.protobuf.IEmpty=} [properties] Properties to set */ function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Creates a new Empty instance using the specified properties. * @function create * @memberof google.protobuf.Empty * @static * @param {google.protobuf.IEmpty=} [properties] Properties to set * @returns {google.protobuf.Empty} Empty instance */ Empty.create = function create(properties) { return new Empty(properties); }; /** * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode * @memberof google.protobuf.Empty * @static * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Empty * @static * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Empty message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Empty.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Empty message. * @function verify * @memberof google.protobuf.Empty * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Empty.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object * @returns {google.protobuf.Empty} Empty */ Empty.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Empty) return object; return new $root.google.protobuf.Empty(); }; /** * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Empty * @static * @param {google.protobuf.Empty} message Empty * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Empty.toObject = function toObject() { return {}; }; /** * Converts this Empty to JSON. * @function toJSON * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Empty; })(); protobuf.FieldMask = (function() { /** * Properties of a FieldMask. * @memberof google.protobuf * @interface IFieldMask * @property {Array.|null} [paths] FieldMask paths */ /** * Constructs a new FieldMask. * @memberof google.protobuf * @classdesc Represents a FieldMask. * @implements IFieldMask * @constructor * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ function FieldMask(properties) { this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldMask paths. * @member {Array.} paths * @memberof google.protobuf.FieldMask * @instance */ FieldMask.prototype.paths = $util.emptyArray; /** * Creates a new FieldMask instance using the specified properties. * @function create * @memberof google.protobuf.FieldMask * @static * @param {google.protobuf.IFieldMask=} [properties] Properties to set * @returns {google.protobuf.FieldMask} FieldMask instance */ FieldMask.create = function create(properties) { return new FieldMask(properties); }; /** * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldMask * @static * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldMask.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.paths != null && message.paths.length) for (var i = 0; i < message.paths.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); return writer; }; /** * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldMask * @static * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldMask message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldMask.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.paths && message.paths.length)) message.paths = []; message.paths.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldMask message. * @function verify * @memberof google.protobuf.FieldMask * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldMask.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.paths != null && message.hasOwnProperty("paths")) { if (!Array.isArray(message.paths)) return "paths: array expected"; for (var i = 0; i < message.paths.length; ++i) if (!$util.isString(message.paths[i])) return "paths: string[] expected"; } return null; }; /** * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldMask} FieldMask */ FieldMask.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldMask) return object; var message = new $root.google.protobuf.FieldMask(); if (object.paths) { if (!Array.isArray(object.paths)) throw TypeError(".google.protobuf.FieldMask.paths: array expected"); message.paths = []; for (var i = 0; i < object.paths.length; ++i) message.paths[i] = String(object.paths[i]); } return message; }; /** * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldMask * @static * @param {google.protobuf.FieldMask} message FieldMask * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldMask.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.paths = []; if (message.paths && message.paths.length) { object.paths = []; for (var j = 0; j < message.paths.length; ++j) object.paths[j] = message.paths[j]; } return object; }; /** * Converts this FieldMask to JSON. * @function toJSON * @memberof google.protobuf.FieldMask * @instance * @returns {Object.} JSON object */ FieldMask.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FieldMask; })(); return protobuf; })(); google.logging = (function() { /** * Namespace logging. * @memberof google * @namespace */ var logging = {}; logging.type = (function() { /** * Namespace type. * @memberof google.logging * @namespace */ var type = {}; type.HttpRequest = (function() { /** * Properties of a HttpRequest. * @memberof google.logging.type * @interface IHttpRequest * @property {string|null} [requestMethod] HttpRequest requestMethod * @property {string|null} [requestUrl] HttpRequest requestUrl * @property {number|Long|null} [requestSize] HttpRequest requestSize * @property {number|null} [status] HttpRequest status * @property {number|Long|null} [responseSize] HttpRequest responseSize * @property {string|null} [userAgent] HttpRequest userAgent * @property {string|null} [remoteIp] HttpRequest remoteIp * @property {string|null} [serverIp] HttpRequest serverIp * @property {string|null} [referer] HttpRequest referer * @property {google.protobuf.IDuration|null} [latency] HttpRequest latency * @property {boolean|null} [cacheLookup] HttpRequest cacheLookup * @property {boolean|null} [cacheHit] HttpRequest cacheHit * @property {boolean|null} [cacheValidatedWithOriginServer] HttpRequest cacheValidatedWithOriginServer * @property {number|Long|null} [cacheFillBytes] HttpRequest cacheFillBytes * @property {string|null} [protocol] HttpRequest protocol */ /** * Constructs a new HttpRequest. * @memberof google.logging.type * @classdesc Represents a HttpRequest. * @implements IHttpRequest * @constructor * @param {google.logging.type.IHttpRequest=} [properties] Properties to set */ function HttpRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * HttpRequest requestMethod. * @member {string} requestMethod * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.requestMethod = ""; /** * HttpRequest requestUrl. * @member {string} requestUrl * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.requestUrl = ""; /** * HttpRequest requestSize. * @member {number|Long} requestSize * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.requestSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * HttpRequest status. * @member {number} status * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.status = 0; /** * HttpRequest responseSize. * @member {number|Long} responseSize * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.responseSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * HttpRequest userAgent. * @member {string} userAgent * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.userAgent = ""; /** * HttpRequest remoteIp. * @member {string} remoteIp * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.remoteIp = ""; /** * HttpRequest serverIp. * @member {string} serverIp * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.serverIp = ""; /** * HttpRequest referer. * @member {string} referer * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.referer = ""; /** * HttpRequest latency. * @member {google.protobuf.IDuration|null|undefined} latency * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.latency = null; /** * HttpRequest cacheLookup. * @member {boolean} cacheLookup * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.cacheLookup = false; /** * HttpRequest cacheHit. * @member {boolean} cacheHit * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.cacheHit = false; /** * HttpRequest cacheValidatedWithOriginServer. * @member {boolean} cacheValidatedWithOriginServer * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.cacheValidatedWithOriginServer = false; /** * HttpRequest cacheFillBytes. * @member {number|Long} cacheFillBytes * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.cacheFillBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * HttpRequest protocol. * @member {string} protocol * @memberof google.logging.type.HttpRequest * @instance */ HttpRequest.prototype.protocol = ""; /** * Creates a new HttpRequest instance using the specified properties. * @function create * @memberof google.logging.type.HttpRequest * @static * @param {google.logging.type.IHttpRequest=} [properties] Properties to set * @returns {google.logging.type.HttpRequest} HttpRequest instance */ HttpRequest.create = function create(properties) { return new HttpRequest(properties); }; /** * Encodes the specified HttpRequest message. Does not implicitly {@link google.logging.type.HttpRequest.verify|verify} messages. * @function encode * @memberof google.logging.type.HttpRequest * @static * @param {google.logging.type.IHttpRequest} message HttpRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.requestMethod != null && Object.hasOwnProperty.call(message, "requestMethod")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestMethod); if (message.requestUrl != null && Object.hasOwnProperty.call(message, "requestUrl")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestUrl); if (message.requestSize != null && Object.hasOwnProperty.call(message, "requestSize")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.requestSize); if (message.status != null && Object.hasOwnProperty.call(message, "status")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); if (message.responseSize != null && Object.hasOwnProperty.call(message, "responseSize")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.responseSize); if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.userAgent); if (message.remoteIp != null && Object.hasOwnProperty.call(message, "remoteIp")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.remoteIp); if (message.referer != null && Object.hasOwnProperty.call(message, "referer")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.referer); if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.cacheHit); if (message.cacheValidatedWithOriginServer != null && Object.hasOwnProperty.call(message, "cacheValidatedWithOriginServer")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.cacheValidatedWithOriginServer); if (message.cacheLookup != null && Object.hasOwnProperty.call(message, "cacheLookup")) writer.uint32(/* id 11, wireType 0 =*/88).bool(message.cacheLookup); if (message.cacheFillBytes != null && Object.hasOwnProperty.call(message, "cacheFillBytes")) writer.uint32(/* id 12, wireType 0 =*/96).int64(message.cacheFillBytes); if (message.serverIp != null && Object.hasOwnProperty.call(message, "serverIp")) writer.uint32(/* id 13, wireType 2 =*/106).string(message.serverIp); if (message.latency != null && Object.hasOwnProperty.call(message, "latency")) $root.google.protobuf.Duration.encode(message.latency, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) writer.uint32(/* id 15, wireType 2 =*/122).string(message.protocol); return writer; }; /** * Encodes the specified HttpRequest message, length delimited. Does not implicitly {@link google.logging.type.HttpRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.type.HttpRequest * @static * @param {google.logging.type.IHttpRequest} message HttpRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a HttpRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.type.HttpRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.type.HttpRequest} HttpRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.type.HttpRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.requestMethod = reader.string(); break; case 2: message.requestUrl = reader.string(); break; case 3: message.requestSize = reader.int64(); break; case 4: message.status = reader.int32(); break; case 5: message.responseSize = reader.int64(); break; case 6: message.userAgent = reader.string(); break; case 7: message.remoteIp = reader.string(); break; case 13: message.serverIp = reader.string(); break; case 8: message.referer = reader.string(); break; case 14: message.latency = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 11: message.cacheLookup = reader.bool(); break; case 9: message.cacheHit = reader.bool(); break; case 10: message.cacheValidatedWithOriginServer = reader.bool(); break; case 12: message.cacheFillBytes = reader.int64(); break; case 15: message.protocol = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a HttpRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.type.HttpRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.type.HttpRequest} HttpRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a HttpRequest message. * @function verify * @memberof google.logging.type.HttpRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ HttpRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.requestMethod != null && message.hasOwnProperty("requestMethod")) if (!$util.isString(message.requestMethod)) return "requestMethod: string expected"; if (message.requestUrl != null && message.hasOwnProperty("requestUrl")) if (!$util.isString(message.requestUrl)) return "requestUrl: string expected"; if (message.requestSize != null && message.hasOwnProperty("requestSize")) if (!$util.isInteger(message.requestSize) && !(message.requestSize && $util.isInteger(message.requestSize.low) && $util.isInteger(message.requestSize.high))) return "requestSize: integer|Long expected"; if (message.status != null && message.hasOwnProperty("status")) if (!$util.isInteger(message.status)) return "status: integer expected"; if (message.responseSize != null && message.hasOwnProperty("responseSize")) if (!$util.isInteger(message.responseSize) && !(message.responseSize && $util.isInteger(message.responseSize.low) && $util.isInteger(message.responseSize.high))) return "responseSize: integer|Long expected"; if (message.userAgent != null && message.hasOwnProperty("userAgent")) if (!$util.isString(message.userAgent)) return "userAgent: string expected"; if (message.remoteIp != null && message.hasOwnProperty("remoteIp")) if (!$util.isString(message.remoteIp)) return "remoteIp: string expected"; if (message.serverIp != null && message.hasOwnProperty("serverIp")) if (!$util.isString(message.serverIp)) return "serverIp: string expected"; if (message.referer != null && message.hasOwnProperty("referer")) if (!$util.isString(message.referer)) return "referer: string expected"; if (message.latency != null && message.hasOwnProperty("latency")) { var error = $root.google.protobuf.Duration.verify(message.latency); if (error) return "latency." + error; } if (message.cacheLookup != null && message.hasOwnProperty("cacheLookup")) if (typeof message.cacheLookup !== "boolean") return "cacheLookup: boolean expected"; if (message.cacheHit != null && message.hasOwnProperty("cacheHit")) if (typeof message.cacheHit !== "boolean") return "cacheHit: boolean expected"; if (message.cacheValidatedWithOriginServer != null && message.hasOwnProperty("cacheValidatedWithOriginServer")) if (typeof message.cacheValidatedWithOriginServer !== "boolean") return "cacheValidatedWithOriginServer: boolean expected"; if (message.cacheFillBytes != null && message.hasOwnProperty("cacheFillBytes")) if (!$util.isInteger(message.cacheFillBytes) && !(message.cacheFillBytes && $util.isInteger(message.cacheFillBytes.low) && $util.isInteger(message.cacheFillBytes.high))) return "cacheFillBytes: integer|Long expected"; if (message.protocol != null && message.hasOwnProperty("protocol")) if (!$util.isString(message.protocol)) return "protocol: string expected"; return null; }; /** * Creates a HttpRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.type.HttpRequest * @static * @param {Object.} object Plain object * @returns {google.logging.type.HttpRequest} HttpRequest */ HttpRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.type.HttpRequest) return object; var message = new $root.google.logging.type.HttpRequest(); if (object.requestMethod != null) message.requestMethod = String(object.requestMethod); if (object.requestUrl != null) message.requestUrl = String(object.requestUrl); if (object.requestSize != null) if ($util.Long) (message.requestSize = $util.Long.fromValue(object.requestSize)).unsigned = false; else if (typeof object.requestSize === "string") message.requestSize = parseInt(object.requestSize, 10); else if (typeof object.requestSize === "number") message.requestSize = object.requestSize; else if (typeof object.requestSize === "object") message.requestSize = new $util.LongBits(object.requestSize.low >>> 0, object.requestSize.high >>> 0).toNumber(); if (object.status != null) message.status = object.status | 0; if (object.responseSize != null) if ($util.Long) (message.responseSize = $util.Long.fromValue(object.responseSize)).unsigned = false; else if (typeof object.responseSize === "string") message.responseSize = parseInt(object.responseSize, 10); else if (typeof object.responseSize === "number") message.responseSize = object.responseSize; else if (typeof object.responseSize === "object") message.responseSize = new $util.LongBits(object.responseSize.low >>> 0, object.responseSize.high >>> 0).toNumber(); if (object.userAgent != null) message.userAgent = String(object.userAgent); if (object.remoteIp != null) message.remoteIp = String(object.remoteIp); if (object.serverIp != null) message.serverIp = String(object.serverIp); if (object.referer != null) message.referer = String(object.referer); if (object.latency != null) { if (typeof object.latency !== "object") throw TypeError(".google.logging.type.HttpRequest.latency: object expected"); message.latency = $root.google.protobuf.Duration.fromObject(object.latency); } if (object.cacheLookup != null) message.cacheLookup = Boolean(object.cacheLookup); if (object.cacheHit != null) message.cacheHit = Boolean(object.cacheHit); if (object.cacheValidatedWithOriginServer != null) message.cacheValidatedWithOriginServer = Boolean(object.cacheValidatedWithOriginServer); if (object.cacheFillBytes != null) if ($util.Long) (message.cacheFillBytes = $util.Long.fromValue(object.cacheFillBytes)).unsigned = false; else if (typeof object.cacheFillBytes === "string") message.cacheFillBytes = parseInt(object.cacheFillBytes, 10); else if (typeof object.cacheFillBytes === "number") message.cacheFillBytes = object.cacheFillBytes; else if (typeof object.cacheFillBytes === "object") message.cacheFillBytes = new $util.LongBits(object.cacheFillBytes.low >>> 0, object.cacheFillBytes.high >>> 0).toNumber(); if (object.protocol != null) message.protocol = String(object.protocol); return message; }; /** * Creates a plain object from a HttpRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.type.HttpRequest * @static * @param {google.logging.type.HttpRequest} message HttpRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ HttpRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.requestMethod = ""; object.requestUrl = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); object.requestSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.requestSize = options.longs === String ? "0" : 0; object.status = 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.responseSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.responseSize = options.longs === String ? "0" : 0; object.userAgent = ""; object.remoteIp = ""; object.referer = ""; object.cacheHit = false; object.cacheValidatedWithOriginServer = false; object.cacheLookup = false; if ($util.Long) { var long = new $util.Long(0, 0, false); object.cacheFillBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.cacheFillBytes = options.longs === String ? "0" : 0; object.serverIp = ""; object.latency = null; object.protocol = ""; } if (message.requestMethod != null && message.hasOwnProperty("requestMethod")) object.requestMethod = message.requestMethod; if (message.requestUrl != null && message.hasOwnProperty("requestUrl")) object.requestUrl = message.requestUrl; if (message.requestSize != null && message.hasOwnProperty("requestSize")) if (typeof message.requestSize === "number") object.requestSize = options.longs === String ? String(message.requestSize) : message.requestSize; else object.requestSize = options.longs === String ? $util.Long.prototype.toString.call(message.requestSize) : options.longs === Number ? new $util.LongBits(message.requestSize.low >>> 0, message.requestSize.high >>> 0).toNumber() : message.requestSize; if (message.status != null && message.hasOwnProperty("status")) object.status = message.status; if (message.responseSize != null && message.hasOwnProperty("responseSize")) if (typeof message.responseSize === "number") object.responseSize = options.longs === String ? String(message.responseSize) : message.responseSize; else object.responseSize = options.longs === String ? $util.Long.prototype.toString.call(message.responseSize) : options.longs === Number ? new $util.LongBits(message.responseSize.low >>> 0, message.responseSize.high >>> 0).toNumber() : message.responseSize; if (message.userAgent != null && message.hasOwnProperty("userAgent")) object.userAgent = message.userAgent; if (message.remoteIp != null && message.hasOwnProperty("remoteIp")) object.remoteIp = message.remoteIp; if (message.referer != null && message.hasOwnProperty("referer")) object.referer = message.referer; if (message.cacheHit != null && message.hasOwnProperty("cacheHit")) object.cacheHit = message.cacheHit; if (message.cacheValidatedWithOriginServer != null && message.hasOwnProperty("cacheValidatedWithOriginServer")) object.cacheValidatedWithOriginServer = message.cacheValidatedWithOriginServer; if (message.cacheLookup != null && message.hasOwnProperty("cacheLookup")) object.cacheLookup = message.cacheLookup; if (message.cacheFillBytes != null && message.hasOwnProperty("cacheFillBytes")) if (typeof message.cacheFillBytes === "number") object.cacheFillBytes = options.longs === String ? String(message.cacheFillBytes) : message.cacheFillBytes; else object.cacheFillBytes = options.longs === String ? $util.Long.prototype.toString.call(message.cacheFillBytes) : options.longs === Number ? new $util.LongBits(message.cacheFillBytes.low >>> 0, message.cacheFillBytes.high >>> 0).toNumber() : message.cacheFillBytes; if (message.serverIp != null && message.hasOwnProperty("serverIp")) object.serverIp = message.serverIp; if (message.latency != null && message.hasOwnProperty("latency")) object.latency = $root.google.protobuf.Duration.toObject(message.latency, options); if (message.protocol != null && message.hasOwnProperty("protocol")) object.protocol = message.protocol; return object; }; /** * Converts this HttpRequest to JSON. * @function toJSON * @memberof google.logging.type.HttpRequest * @instance * @returns {Object.} JSON object */ HttpRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return HttpRequest; })(); /** * LogSeverity enum. * @name google.logging.type.LogSeverity * @enum {number} * @property {number} DEFAULT=0 DEFAULT value * @property {number} DEBUG=100 DEBUG value * @property {number} INFO=200 INFO value * @property {number} NOTICE=300 NOTICE value * @property {number} WARNING=400 WARNING value * @property {number} ERROR=500 ERROR value * @property {number} CRITICAL=600 CRITICAL value * @property {number} ALERT=700 ALERT value * @property {number} EMERGENCY=800 EMERGENCY value */ type.LogSeverity = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "DEFAULT"] = 0; values[valuesById[100] = "DEBUG"] = 100; values[valuesById[200] = "INFO"] = 200; values[valuesById[300] = "NOTICE"] = 300; values[valuesById[400] = "WARNING"] = 400; values[valuesById[500] = "ERROR"] = 500; values[valuesById[600] = "CRITICAL"] = 600; values[valuesById[700] = "ALERT"] = 700; values[valuesById[800] = "EMERGENCY"] = 800; return values; })(); return type; })(); logging.v2 = (function() { /** * Namespace v2. * @memberof google.logging * @namespace */ var v2 = {}; v2.LogEntry = (function() { /** * Properties of a LogEntry. * @memberof google.logging.v2 * @interface ILogEntry * @property {string|null} [logName] LogEntry logName * @property {google.api.IMonitoredResource|null} [resource] LogEntry resource * @property {google.protobuf.IAny|null} [protoPayload] LogEntry protoPayload * @property {string|null} [textPayload] LogEntry textPayload * @property {google.protobuf.IStruct|null} [jsonPayload] LogEntry jsonPayload * @property {google.protobuf.ITimestamp|null} [timestamp] LogEntry timestamp * @property {google.protobuf.ITimestamp|null} [receiveTimestamp] LogEntry receiveTimestamp * @property {google.logging.type.LogSeverity|null} [severity] LogEntry severity * @property {string|null} [insertId] LogEntry insertId * @property {google.logging.type.IHttpRequest|null} [httpRequest] LogEntry httpRequest * @property {Object.|null} [labels] LogEntry labels * @property {google.logging.v2.ILogEntryOperation|null} [operation] LogEntry operation * @property {string|null} [trace] LogEntry trace * @property {string|null} [spanId] LogEntry spanId * @property {boolean|null} [traceSampled] LogEntry traceSampled * @property {google.logging.v2.ILogEntrySourceLocation|null} [sourceLocation] LogEntry sourceLocation */ /** * Constructs a new LogEntry. * @memberof google.logging.v2 * @classdesc Represents a LogEntry. * @implements ILogEntry * @constructor * @param {google.logging.v2.ILogEntry=} [properties] Properties to set */ function LogEntry(properties) { this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LogEntry logName. * @member {string} logName * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.logName = ""; /** * LogEntry resource. * @member {google.api.IMonitoredResource|null|undefined} resource * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.resource = null; /** * LogEntry protoPayload. * @member {google.protobuf.IAny|null|undefined} protoPayload * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.protoPayload = null; /** * LogEntry textPayload. * @member {string|null|undefined} textPayload * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.textPayload = null; /** * LogEntry jsonPayload. * @member {google.protobuf.IStruct|null|undefined} jsonPayload * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.jsonPayload = null; /** * LogEntry timestamp. * @member {google.protobuf.ITimestamp|null|undefined} timestamp * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.timestamp = null; /** * LogEntry receiveTimestamp. * @member {google.protobuf.ITimestamp|null|undefined} receiveTimestamp * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.receiveTimestamp = null; /** * LogEntry severity. * @member {google.logging.type.LogSeverity} severity * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.severity = 0; /** * LogEntry insertId. * @member {string} insertId * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.insertId = ""; /** * LogEntry httpRequest. * @member {google.logging.type.IHttpRequest|null|undefined} httpRequest * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.httpRequest = null; /** * LogEntry labels. * @member {Object.} labels * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.labels = $util.emptyObject; /** * LogEntry operation. * @member {google.logging.v2.ILogEntryOperation|null|undefined} operation * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.operation = null; /** * LogEntry trace. * @member {string} trace * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.trace = ""; /** * LogEntry spanId. * @member {string} spanId * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.spanId = ""; /** * LogEntry traceSampled. * @member {boolean} traceSampled * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.traceSampled = false; /** * LogEntry sourceLocation. * @member {google.logging.v2.ILogEntrySourceLocation|null|undefined} sourceLocation * @memberof google.logging.v2.LogEntry * @instance */ LogEntry.prototype.sourceLocation = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * LogEntry payload. * @member {"protoPayload"|"textPayload"|"jsonPayload"|undefined} payload * @memberof google.logging.v2.LogEntry * @instance */ Object.defineProperty(LogEntry.prototype, "payload", { get: $util.oneOfGetter($oneOfFields = ["protoPayload", "textPayload", "jsonPayload"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new LogEntry instance using the specified properties. * @function create * @memberof google.logging.v2.LogEntry * @static * @param {google.logging.v2.ILogEntry=} [properties] Properties to set * @returns {google.logging.v2.LogEntry} LogEntry instance */ LogEntry.create = function create(properties) { return new LogEntry(properties); }; /** * Encodes the specified LogEntry message. Does not implicitly {@link google.logging.v2.LogEntry.verify|verify} messages. * @function encode * @memberof google.logging.v2.LogEntry * @static * @param {google.logging.v2.ILogEntry} message LogEntry message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogEntry.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.protoPayload != null && Object.hasOwnProperty.call(message, "protoPayload")) $root.google.protobuf.Any.encode(message.protoPayload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.textPayload != null && Object.hasOwnProperty.call(message, "textPayload")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.textPayload); if (message.insertId != null && Object.hasOwnProperty.call(message, "insertId")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.insertId); if (message.jsonPayload != null && Object.hasOwnProperty.call(message, "jsonPayload")) $root.google.protobuf.Struct.encode(message.jsonPayload, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.httpRequest != null && Object.hasOwnProperty.call(message, "httpRequest")) $root.google.logging.type.HttpRequest.encode(message.httpRequest, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.api.MonitoredResource.encode(message.resource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.severity); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.logName); if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) $root.google.logging.v2.LogEntryOperation.encode(message.operation, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) writer.uint32(/* id 22, wireType 2 =*/178).string(message.trace); if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) $root.google.logging.v2.LogEntrySourceLocation.encode(message.sourceLocation, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); if (message.receiveTimestamp != null && Object.hasOwnProperty.call(message, "receiveTimestamp")) $root.google.protobuf.Timestamp.encode(message.receiveTimestamp, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(/* id 27, wireType 2 =*/218).string(message.spanId); if (message.traceSampled != null && Object.hasOwnProperty.call(message, "traceSampled")) writer.uint32(/* id 30, wireType 0 =*/240).bool(message.traceSampled); return writer; }; /** * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.logging.v2.LogEntry.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.LogEntry * @static * @param {google.logging.v2.ILogEntry} message LogEntry message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogEntry.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LogEntry message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.LogEntry * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.LogEntry} LogEntry * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogEntry.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogEntry(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 12: message.logName = reader.string(); break; case 8: message.resource = $root.google.api.MonitoredResource.decode(reader, reader.uint32()); break; case 2: message.protoPayload = $root.google.protobuf.Any.decode(reader, reader.uint32()); break; case 3: message.textPayload = reader.string(); break; case 6: message.jsonPayload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; case 9: message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 24: message.receiveTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 10: message.severity = reader.int32(); break; case 4: message.insertId = reader.string(); break; case 7: message.httpRequest = $root.google.logging.type.HttpRequest.decode(reader, reader.uint32()); break; case 11: if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = reader.string(); break; default: reader.skipType(tag2 & 7); break; } } message.labels[key] = value; break; case 15: message.operation = $root.google.logging.v2.LogEntryOperation.decode(reader, reader.uint32()); break; case 22: message.trace = reader.string(); break; case 27: message.spanId = reader.string(); break; case 30: message.traceSampled = reader.bool(); break; case 23: message.sourceLocation = $root.google.logging.v2.LogEntrySourceLocation.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LogEntry message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.LogEntry * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.LogEntry} LogEntry * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogEntry.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LogEntry message. * @function verify * @memberof google.logging.v2.LogEntry * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LogEntry.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.logName != null && message.hasOwnProperty("logName")) if (!$util.isString(message.logName)) return "logName: string expected"; if (message.resource != null && message.hasOwnProperty("resource")) { var error = $root.google.api.MonitoredResource.verify(message.resource); if (error) return "resource." + error; } if (message.protoPayload != null && message.hasOwnProperty("protoPayload")) { properties.payload = 1; { var error = $root.google.protobuf.Any.verify(message.protoPayload); if (error) return "protoPayload." + error; } } if (message.textPayload != null && message.hasOwnProperty("textPayload")) { if (properties.payload === 1) return "payload: multiple values"; properties.payload = 1; if (!$util.isString(message.textPayload)) return "textPayload: string expected"; } if (message.jsonPayload != null && message.hasOwnProperty("jsonPayload")) { if (properties.payload === 1) return "payload: multiple values"; properties.payload = 1; { var error = $root.google.protobuf.Struct.verify(message.jsonPayload); if (error) return "jsonPayload." + error; } } if (message.timestamp != null && message.hasOwnProperty("timestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.timestamp); if (error) return "timestamp." + error; } if (message.receiveTimestamp != null && message.hasOwnProperty("receiveTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.receiveTimestamp); if (error) return "receiveTimestamp." + error; } if (message.severity != null && message.hasOwnProperty("severity")) switch (message.severity) { default: return "severity: enum value expected"; case 0: case 100: case 200: case 300: case 400: case 500: case 600: case 700: case 800: break; } if (message.insertId != null && message.hasOwnProperty("insertId")) if (!$util.isString(message.insertId)) return "insertId: string expected"; if (message.httpRequest != null && message.hasOwnProperty("httpRequest")) { var error = $root.google.logging.type.HttpRequest.verify(message.httpRequest); if (error) return "httpRequest." + error; } if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); for (var i = 0; i < key.length; ++i) if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } if (message.operation != null && message.hasOwnProperty("operation")) { var error = $root.google.logging.v2.LogEntryOperation.verify(message.operation); if (error) return "operation." + error; } if (message.trace != null && message.hasOwnProperty("trace")) if (!$util.isString(message.trace)) return "trace: string expected"; if (message.spanId != null && message.hasOwnProperty("spanId")) if (!$util.isString(message.spanId)) return "spanId: string expected"; if (message.traceSampled != null && message.hasOwnProperty("traceSampled")) if (typeof message.traceSampled !== "boolean") return "traceSampled: boolean expected"; if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) { var error = $root.google.logging.v2.LogEntrySourceLocation.verify(message.sourceLocation); if (error) return "sourceLocation." + error; } return null; }; /** * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.LogEntry * @static * @param {Object.} object Plain object * @returns {google.logging.v2.LogEntry} LogEntry */ LogEntry.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.LogEntry) return object; var message = new $root.google.logging.v2.LogEntry(); if (object.logName != null) message.logName = String(object.logName); if (object.resource != null) { if (typeof object.resource !== "object") throw TypeError(".google.logging.v2.LogEntry.resource: object expected"); message.resource = $root.google.api.MonitoredResource.fromObject(object.resource); } if (object.protoPayload != null) { if (typeof object.protoPayload !== "object") throw TypeError(".google.logging.v2.LogEntry.protoPayload: object expected"); message.protoPayload = $root.google.protobuf.Any.fromObject(object.protoPayload); } if (object.textPayload != null) message.textPayload = String(object.textPayload); if (object.jsonPayload != null) { if (typeof object.jsonPayload !== "object") throw TypeError(".google.logging.v2.LogEntry.jsonPayload: object expected"); message.jsonPayload = $root.google.protobuf.Struct.fromObject(object.jsonPayload); } if (object.timestamp != null) { if (typeof object.timestamp !== "object") throw TypeError(".google.logging.v2.LogEntry.timestamp: object expected"); message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); } if (object.receiveTimestamp != null) { if (typeof object.receiveTimestamp !== "object") throw TypeError(".google.logging.v2.LogEntry.receiveTimestamp: object expected"); message.receiveTimestamp = $root.google.protobuf.Timestamp.fromObject(object.receiveTimestamp); } switch (object.severity) { case "DEFAULT": case 0: message.severity = 0; break; case "DEBUG": case 100: message.severity = 100; break; case "INFO": case 200: message.severity = 200; break; case "NOTICE": case 300: message.severity = 300; break; case "WARNING": case 400: message.severity = 400; break; case "ERROR": case 500: message.severity = 500; break; case "CRITICAL": case 600: message.severity = 600; break; case "ALERT": case 700: message.severity = 700; break; case "EMERGENCY": case 800: message.severity = 800; break; } if (object.insertId != null) message.insertId = String(object.insertId); if (object.httpRequest != null) { if (typeof object.httpRequest !== "object") throw TypeError(".google.logging.v2.LogEntry.httpRequest: object expected"); message.httpRequest = $root.google.logging.type.HttpRequest.fromObject(object.httpRequest); } if (object.labels) { if (typeof object.labels !== "object") throw TypeError(".google.logging.v2.LogEntry.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } if (object.operation != null) { if (typeof object.operation !== "object") throw TypeError(".google.logging.v2.LogEntry.operation: object expected"); message.operation = $root.google.logging.v2.LogEntryOperation.fromObject(object.operation); } if (object.trace != null) message.trace = String(object.trace); if (object.spanId != null) message.spanId = String(object.spanId); if (object.traceSampled != null) message.traceSampled = Boolean(object.traceSampled); if (object.sourceLocation != null) { if (typeof object.sourceLocation !== "object") throw TypeError(".google.logging.v2.LogEntry.sourceLocation: object expected"); message.sourceLocation = $root.google.logging.v2.LogEntrySourceLocation.fromObject(object.sourceLocation); } return message; }; /** * Creates a plain object from a LogEntry message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.LogEntry * @static * @param {google.logging.v2.LogEntry} message LogEntry * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LogEntry.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { object.insertId = ""; object.httpRequest = null; object.resource = null; object.timestamp = null; object.severity = options.enums === String ? "DEFAULT" : 0; object.logName = ""; object.operation = null; object.trace = ""; object.sourceLocation = null; object.receiveTimestamp = null; object.spanId = ""; object.traceSampled = false; } if (message.protoPayload != null && message.hasOwnProperty("protoPayload")) { object.protoPayload = $root.google.protobuf.Any.toObject(message.protoPayload, options); if (options.oneofs) object.payload = "protoPayload"; } if (message.textPayload != null && message.hasOwnProperty("textPayload")) { object.textPayload = message.textPayload; if (options.oneofs) object.payload = "textPayload"; } if (message.insertId != null && message.hasOwnProperty("insertId")) object.insertId = message.insertId; if (message.jsonPayload != null && message.hasOwnProperty("jsonPayload")) { object.jsonPayload = $root.google.protobuf.Struct.toObject(message.jsonPayload, options); if (options.oneofs) object.payload = "jsonPayload"; } if (message.httpRequest != null && message.hasOwnProperty("httpRequest")) object.httpRequest = $root.google.logging.type.HttpRequest.toObject(message.httpRequest, options); if (message.resource != null && message.hasOwnProperty("resource")) object.resource = $root.google.api.MonitoredResource.toObject(message.resource, options); if (message.timestamp != null && message.hasOwnProperty("timestamp")) object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); if (message.severity != null && message.hasOwnProperty("severity")) object.severity = options.enums === String ? $root.google.logging.type.LogSeverity[message.severity] : message.severity; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.logName != null && message.hasOwnProperty("logName")) object.logName = message.logName; if (message.operation != null && message.hasOwnProperty("operation")) object.operation = $root.google.logging.v2.LogEntryOperation.toObject(message.operation, options); if (message.trace != null && message.hasOwnProperty("trace")) object.trace = message.trace; if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) object.sourceLocation = $root.google.logging.v2.LogEntrySourceLocation.toObject(message.sourceLocation, options); if (message.receiveTimestamp != null && message.hasOwnProperty("receiveTimestamp")) object.receiveTimestamp = $root.google.protobuf.Timestamp.toObject(message.receiveTimestamp, options); if (message.spanId != null && message.hasOwnProperty("spanId")) object.spanId = message.spanId; if (message.traceSampled != null && message.hasOwnProperty("traceSampled")) object.traceSampled = message.traceSampled; return object; }; /** * Converts this LogEntry to JSON. * @function toJSON * @memberof google.logging.v2.LogEntry * @instance * @returns {Object.} JSON object */ LogEntry.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return LogEntry; })(); v2.LogEntryOperation = (function() { /** * Properties of a LogEntryOperation. * @memberof google.logging.v2 * @interface ILogEntryOperation * @property {string|null} [id] LogEntryOperation id * @property {string|null} [producer] LogEntryOperation producer * @property {boolean|null} [first] LogEntryOperation first * @property {boolean|null} [last] LogEntryOperation last */ /** * Constructs a new LogEntryOperation. * @memberof google.logging.v2 * @classdesc Represents a LogEntryOperation. * @implements ILogEntryOperation * @constructor * @param {google.logging.v2.ILogEntryOperation=} [properties] Properties to set */ function LogEntryOperation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LogEntryOperation id. * @member {string} id * @memberof google.logging.v2.LogEntryOperation * @instance */ LogEntryOperation.prototype.id = ""; /** * LogEntryOperation producer. * @member {string} producer * @memberof google.logging.v2.LogEntryOperation * @instance */ LogEntryOperation.prototype.producer = ""; /** * LogEntryOperation first. * @member {boolean} first * @memberof google.logging.v2.LogEntryOperation * @instance */ LogEntryOperation.prototype.first = false; /** * LogEntryOperation last. * @member {boolean} last * @memberof google.logging.v2.LogEntryOperation * @instance */ LogEntryOperation.prototype.last = false; /** * Creates a new LogEntryOperation instance using the specified properties. * @function create * @memberof google.logging.v2.LogEntryOperation * @static * @param {google.logging.v2.ILogEntryOperation=} [properties] Properties to set * @returns {google.logging.v2.LogEntryOperation} LogEntryOperation instance */ LogEntryOperation.create = function create(properties) { return new LogEntryOperation(properties); }; /** * Encodes the specified LogEntryOperation message. Does not implicitly {@link google.logging.v2.LogEntryOperation.verify|verify} messages. * @function encode * @memberof google.logging.v2.LogEntryOperation * @static * @param {google.logging.v2.ILogEntryOperation} message LogEntryOperation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogEntryOperation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); if (message.producer != null && Object.hasOwnProperty.call(message, "producer")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.producer); if (message.first != null && Object.hasOwnProperty.call(message, "first")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.first); if (message.last != null && Object.hasOwnProperty.call(message, "last")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.last); return writer; }; /** * Encodes the specified LogEntryOperation message, length delimited. Does not implicitly {@link google.logging.v2.LogEntryOperation.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.LogEntryOperation * @static * @param {google.logging.v2.ILogEntryOperation} message LogEntryOperation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogEntryOperation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LogEntryOperation message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.LogEntryOperation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.LogEntryOperation} LogEntryOperation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogEntryOperation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogEntryOperation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.id = reader.string(); break; case 2: message.producer = reader.string(); break; case 3: message.first = reader.bool(); break; case 4: message.last = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LogEntryOperation message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.LogEntryOperation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.LogEntryOperation} LogEntryOperation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogEntryOperation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LogEntryOperation message. * @function verify * @memberof google.logging.v2.LogEntryOperation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LogEntryOperation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.id != null && message.hasOwnProperty("id")) if (!$util.isString(message.id)) return "id: string expected"; if (message.producer != null && message.hasOwnProperty("producer")) if (!$util.isString(message.producer)) return "producer: string expected"; if (message.first != null && message.hasOwnProperty("first")) if (typeof message.first !== "boolean") return "first: boolean expected"; if (message.last != null && message.hasOwnProperty("last")) if (typeof message.last !== "boolean") return "last: boolean expected"; return null; }; /** * Creates a LogEntryOperation message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.LogEntryOperation * @static * @param {Object.} object Plain object * @returns {google.logging.v2.LogEntryOperation} LogEntryOperation */ LogEntryOperation.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.LogEntryOperation) return object; var message = new $root.google.logging.v2.LogEntryOperation(); if (object.id != null) message.id = String(object.id); if (object.producer != null) message.producer = String(object.producer); if (object.first != null) message.first = Boolean(object.first); if (object.last != null) message.last = Boolean(object.last); return message; }; /** * Creates a plain object from a LogEntryOperation message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.LogEntryOperation * @static * @param {google.logging.v2.LogEntryOperation} message LogEntryOperation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LogEntryOperation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.id = ""; object.producer = ""; object.first = false; object.last = false; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; if (message.producer != null && message.hasOwnProperty("producer")) object.producer = message.producer; if (message.first != null && message.hasOwnProperty("first")) object.first = message.first; if (message.last != null && message.hasOwnProperty("last")) object.last = message.last; return object; }; /** * Converts this LogEntryOperation to JSON. * @function toJSON * @memberof google.logging.v2.LogEntryOperation * @instance * @returns {Object.} JSON object */ LogEntryOperation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return LogEntryOperation; })(); v2.LogEntrySourceLocation = (function() { /** * Properties of a LogEntrySourceLocation. * @memberof google.logging.v2 * @interface ILogEntrySourceLocation * @property {string|null} [file] LogEntrySourceLocation file * @property {number|Long|null} [line] LogEntrySourceLocation line * @property {string|null} ["function"] LogEntrySourceLocation function */ /** * Constructs a new LogEntrySourceLocation. * @memberof google.logging.v2 * @classdesc Represents a LogEntrySourceLocation. * @implements ILogEntrySourceLocation * @constructor * @param {google.logging.v2.ILogEntrySourceLocation=} [properties] Properties to set */ function LogEntrySourceLocation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LogEntrySourceLocation file. * @member {string} file * @memberof google.logging.v2.LogEntrySourceLocation * @instance */ LogEntrySourceLocation.prototype.file = ""; /** * LogEntrySourceLocation line. * @member {number|Long} line * @memberof google.logging.v2.LogEntrySourceLocation * @instance */ LogEntrySourceLocation.prototype.line = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * LogEntrySourceLocation function. * @member {string} function * @memberof google.logging.v2.LogEntrySourceLocation * @instance */ LogEntrySourceLocation.prototype["function"] = ""; /** * Creates a new LogEntrySourceLocation instance using the specified properties. * @function create * @memberof google.logging.v2.LogEntrySourceLocation * @static * @param {google.logging.v2.ILogEntrySourceLocation=} [properties] Properties to set * @returns {google.logging.v2.LogEntrySourceLocation} LogEntrySourceLocation instance */ LogEntrySourceLocation.create = function create(properties) { return new LogEntrySourceLocation(properties); }; /** * Encodes the specified LogEntrySourceLocation message. Does not implicitly {@link google.logging.v2.LogEntrySourceLocation.verify|verify} messages. * @function encode * @memberof google.logging.v2.LogEntrySourceLocation * @static * @param {google.logging.v2.ILogEntrySourceLocation} message LogEntrySourceLocation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogEntrySourceLocation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.file != null && Object.hasOwnProperty.call(message, "file")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.file); if (message.line != null && Object.hasOwnProperty.call(message, "line")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.line); if (message["function"] != null && Object.hasOwnProperty.call(message, "function")) writer.uint32(/* id 3, wireType 2 =*/26).string(message["function"]); return writer; }; /** * Encodes the specified LogEntrySourceLocation message, length delimited. Does not implicitly {@link google.logging.v2.LogEntrySourceLocation.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.LogEntrySourceLocation * @static * @param {google.logging.v2.ILogEntrySourceLocation} message LogEntrySourceLocation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogEntrySourceLocation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LogEntrySourceLocation message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.LogEntrySourceLocation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.LogEntrySourceLocation} LogEntrySourceLocation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogEntrySourceLocation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogEntrySourceLocation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.file = reader.string(); break; case 2: message.line = reader.int64(); break; case 3: message["function"] = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LogEntrySourceLocation message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.LogEntrySourceLocation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.LogEntrySourceLocation} LogEntrySourceLocation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogEntrySourceLocation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LogEntrySourceLocation message. * @function verify * @memberof google.logging.v2.LogEntrySourceLocation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LogEntrySourceLocation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.file != null && message.hasOwnProperty("file")) if (!$util.isString(message.file)) return "file: string expected"; if (message.line != null && message.hasOwnProperty("line")) if (!$util.isInteger(message.line) && !(message.line && $util.isInteger(message.line.low) && $util.isInteger(message.line.high))) return "line: integer|Long expected"; if (message["function"] != null && message.hasOwnProperty("function")) if (!$util.isString(message["function"])) return "function: string expected"; return null; }; /** * Creates a LogEntrySourceLocation message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.LogEntrySourceLocation * @static * @param {Object.} object Plain object * @returns {google.logging.v2.LogEntrySourceLocation} LogEntrySourceLocation */ LogEntrySourceLocation.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.LogEntrySourceLocation) return object; var message = new $root.google.logging.v2.LogEntrySourceLocation(); if (object.file != null) message.file = String(object.file); if (object.line != null) if ($util.Long) (message.line = $util.Long.fromValue(object.line)).unsigned = false; else if (typeof object.line === "string") message.line = parseInt(object.line, 10); else if (typeof object.line === "number") message.line = object.line; else if (typeof object.line === "object") message.line = new $util.LongBits(object.line.low >>> 0, object.line.high >>> 0).toNumber(); if (object["function"] != null) message["function"] = String(object["function"]); return message; }; /** * Creates a plain object from a LogEntrySourceLocation message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.LogEntrySourceLocation * @static * @param {google.logging.v2.LogEntrySourceLocation} message LogEntrySourceLocation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LogEntrySourceLocation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.file = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); object.line = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.line = options.longs === String ? "0" : 0; object["function"] = ""; } if (message.file != null && message.hasOwnProperty("file")) object.file = message.file; if (message.line != null && message.hasOwnProperty("line")) if (typeof message.line === "number") object.line = options.longs === String ? String(message.line) : message.line; else object.line = options.longs === String ? $util.Long.prototype.toString.call(message.line) : options.longs === Number ? new $util.LongBits(message.line.low >>> 0, message.line.high >>> 0).toNumber() : message.line; if (message["function"] != null && message.hasOwnProperty("function")) object["function"] = message["function"]; return object; }; /** * Converts this LogEntrySourceLocation to JSON. * @function toJSON * @memberof google.logging.v2.LogEntrySourceLocation * @instance * @returns {Object.} JSON object */ LogEntrySourceLocation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return LogEntrySourceLocation; })(); v2.LoggingServiceV2 = (function() { /** * Constructs a new LoggingServiceV2 service. * @memberof google.logging.v2 * @classdesc Represents a LoggingServiceV2 * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function LoggingServiceV2(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (LoggingServiceV2.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LoggingServiceV2; /** * Creates new LoggingServiceV2 service using the specified rpc implementation. * @function create * @memberof google.logging.v2.LoggingServiceV2 * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {LoggingServiceV2} RPC service. Useful where requests and/or responses are streamed. */ LoggingServiceV2.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link google.logging.v2.LoggingServiceV2#deleteLog}. * @memberof google.logging.v2.LoggingServiceV2 * @typedef DeleteLogCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls DeleteLog. * @function deleteLog * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IDeleteLogRequest} request DeleteLogRequest message or plain object * @param {google.logging.v2.LoggingServiceV2.DeleteLogCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(LoggingServiceV2.prototype.deleteLog = function deleteLog(request, callback) { return this.rpcCall(deleteLog, $root.google.logging.v2.DeleteLogRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteLog" }); /** * Calls DeleteLog. * @function deleteLog * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IDeleteLogRequest} request DeleteLogRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.LoggingServiceV2#writeLogEntries}. * @memberof google.logging.v2.LoggingServiceV2 * @typedef WriteLogEntriesCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.WriteLogEntriesResponse} [response] WriteLogEntriesResponse */ /** * Calls WriteLogEntries. * @function writeLogEntries * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IWriteLogEntriesRequest} request WriteLogEntriesRequest message or plain object * @param {google.logging.v2.LoggingServiceV2.WriteLogEntriesCallback} callback Node-style callback called with the error, if any, and WriteLogEntriesResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(LoggingServiceV2.prototype.writeLogEntries = function writeLogEntries(request, callback) { return this.rpcCall(writeLogEntries, $root.google.logging.v2.WriteLogEntriesRequest, $root.google.logging.v2.WriteLogEntriesResponse, request, callback); }, "name", { value: "WriteLogEntries" }); /** * Calls WriteLogEntries. * @function writeLogEntries * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IWriteLogEntriesRequest} request WriteLogEntriesRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.LoggingServiceV2#listLogEntries}. * @memberof google.logging.v2.LoggingServiceV2 * @typedef ListLogEntriesCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.ListLogEntriesResponse} [response] ListLogEntriesResponse */ /** * Calls ListLogEntries. * @function listLogEntries * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IListLogEntriesRequest} request ListLogEntriesRequest message or plain object * @param {google.logging.v2.LoggingServiceV2.ListLogEntriesCallback} callback Node-style callback called with the error, if any, and ListLogEntriesResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(LoggingServiceV2.prototype.listLogEntries = function listLogEntries(request, callback) { return this.rpcCall(listLogEntries, $root.google.logging.v2.ListLogEntriesRequest, $root.google.logging.v2.ListLogEntriesResponse, request, callback); }, "name", { value: "ListLogEntries" }); /** * Calls ListLogEntries. * @function listLogEntries * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IListLogEntriesRequest} request ListLogEntriesRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.LoggingServiceV2#listMonitoredResourceDescriptors}. * @memberof google.logging.v2.LoggingServiceV2 * @typedef ListMonitoredResourceDescriptorsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.ListMonitoredResourceDescriptorsResponse} [response] ListMonitoredResourceDescriptorsResponse */ /** * Calls ListMonitoredResourceDescriptors. * @function listMonitoredResourceDescriptors * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest} request ListMonitoredResourceDescriptorsRequest message or plain object * @param {google.logging.v2.LoggingServiceV2.ListMonitoredResourceDescriptorsCallback} callback Node-style callback called with the error, if any, and ListMonitoredResourceDescriptorsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(LoggingServiceV2.prototype.listMonitoredResourceDescriptors = function listMonitoredResourceDescriptors(request, callback) { return this.rpcCall(listMonitoredResourceDescriptors, $root.google.logging.v2.ListMonitoredResourceDescriptorsRequest, $root.google.logging.v2.ListMonitoredResourceDescriptorsResponse, request, callback); }, "name", { value: "ListMonitoredResourceDescriptors" }); /** * Calls ListMonitoredResourceDescriptors. * @function listMonitoredResourceDescriptors * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest} request ListMonitoredResourceDescriptorsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.LoggingServiceV2#listLogs}. * @memberof google.logging.v2.LoggingServiceV2 * @typedef ListLogsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.ListLogsResponse} [response] ListLogsResponse */ /** * Calls ListLogs. * @function listLogs * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IListLogsRequest} request ListLogsRequest message or plain object * @param {google.logging.v2.LoggingServiceV2.ListLogsCallback} callback Node-style callback called with the error, if any, and ListLogsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(LoggingServiceV2.prototype.listLogs = function listLogs(request, callback) { return this.rpcCall(listLogs, $root.google.logging.v2.ListLogsRequest, $root.google.logging.v2.ListLogsResponse, request, callback); }, "name", { value: "ListLogs" }); /** * Calls ListLogs. * @function listLogs * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.IListLogsRequest} request ListLogsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.LoggingServiceV2#tailLogEntries}. * @memberof google.logging.v2.LoggingServiceV2 * @typedef TailLogEntriesCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.TailLogEntriesResponse} [response] TailLogEntriesResponse */ /** * Calls TailLogEntries. * @function tailLogEntries * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.ITailLogEntriesRequest} request TailLogEntriesRequest message or plain object * @param {google.logging.v2.LoggingServiceV2.TailLogEntriesCallback} callback Node-style callback called with the error, if any, and TailLogEntriesResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(LoggingServiceV2.prototype.tailLogEntries = function tailLogEntries(request, callback) { return this.rpcCall(tailLogEntries, $root.google.logging.v2.TailLogEntriesRequest, $root.google.logging.v2.TailLogEntriesResponse, request, callback); }, "name", { value: "TailLogEntries" }); /** * Calls TailLogEntries. * @function tailLogEntries * @memberof google.logging.v2.LoggingServiceV2 * @instance * @param {google.logging.v2.ITailLogEntriesRequest} request TailLogEntriesRequest message or plain object * @returns {Promise} Promise * @variation 2 */ return LoggingServiceV2; })(); v2.DeleteLogRequest = (function() { /** * Properties of a DeleteLogRequest. * @memberof google.logging.v2 * @interface IDeleteLogRequest * @property {string|null} [logName] DeleteLogRequest logName */ /** * Constructs a new DeleteLogRequest. * @memberof google.logging.v2 * @classdesc Represents a DeleteLogRequest. * @implements IDeleteLogRequest * @constructor * @param {google.logging.v2.IDeleteLogRequest=} [properties] Properties to set */ function DeleteLogRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DeleteLogRequest logName. * @member {string} logName * @memberof google.logging.v2.DeleteLogRequest * @instance */ DeleteLogRequest.prototype.logName = ""; /** * Creates a new DeleteLogRequest instance using the specified properties. * @function create * @memberof google.logging.v2.DeleteLogRequest * @static * @param {google.logging.v2.IDeleteLogRequest=} [properties] Properties to set * @returns {google.logging.v2.DeleteLogRequest} DeleteLogRequest instance */ DeleteLogRequest.create = function create(properties) { return new DeleteLogRequest(properties); }; /** * Encodes the specified DeleteLogRequest message. Does not implicitly {@link google.logging.v2.DeleteLogRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.DeleteLogRequest * @static * @param {google.logging.v2.IDeleteLogRequest} message DeleteLogRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteLogRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.logName); return writer; }; /** * Encodes the specified DeleteLogRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLogRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.DeleteLogRequest * @static * @param {google.logging.v2.IDeleteLogRequest} message DeleteLogRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteLogRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DeleteLogRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.DeleteLogRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.DeleteLogRequest} DeleteLogRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteLogRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteLogRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.logName = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DeleteLogRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.DeleteLogRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.DeleteLogRequest} DeleteLogRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteLogRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DeleteLogRequest message. * @function verify * @memberof google.logging.v2.DeleteLogRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DeleteLogRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.logName != null && message.hasOwnProperty("logName")) if (!$util.isString(message.logName)) return "logName: string expected"; return null; }; /** * Creates a DeleteLogRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.DeleteLogRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.DeleteLogRequest} DeleteLogRequest */ DeleteLogRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.DeleteLogRequest) return object; var message = new $root.google.logging.v2.DeleteLogRequest(); if (object.logName != null) message.logName = String(object.logName); return message; }; /** * Creates a plain object from a DeleteLogRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.DeleteLogRequest * @static * @param {google.logging.v2.DeleteLogRequest} message DeleteLogRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DeleteLogRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.logName = ""; if (message.logName != null && message.hasOwnProperty("logName")) object.logName = message.logName; return object; }; /** * Converts this DeleteLogRequest to JSON. * @function toJSON * @memberof google.logging.v2.DeleteLogRequest * @instance * @returns {Object.} JSON object */ DeleteLogRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DeleteLogRequest; })(); v2.WriteLogEntriesRequest = (function() { /** * Properties of a WriteLogEntriesRequest. * @memberof google.logging.v2 * @interface IWriteLogEntriesRequest * @property {string|null} [logName] WriteLogEntriesRequest logName * @property {google.api.IMonitoredResource|null} [resource] WriteLogEntriesRequest resource * @property {Object.|null} [labels] WriteLogEntriesRequest labels * @property {Array.|null} [entries] WriteLogEntriesRequest entries * @property {boolean|null} [partialSuccess] WriteLogEntriesRequest partialSuccess * @property {boolean|null} [dryRun] WriteLogEntriesRequest dryRun */ /** * Constructs a new WriteLogEntriesRequest. * @memberof google.logging.v2 * @classdesc Represents a WriteLogEntriesRequest. * @implements IWriteLogEntriesRequest * @constructor * @param {google.logging.v2.IWriteLogEntriesRequest=} [properties] Properties to set */ function WriteLogEntriesRequest(properties) { this.labels = {}; this.entries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * WriteLogEntriesRequest logName. * @member {string} logName * @memberof google.logging.v2.WriteLogEntriesRequest * @instance */ WriteLogEntriesRequest.prototype.logName = ""; /** * WriteLogEntriesRequest resource. * @member {google.api.IMonitoredResource|null|undefined} resource * @memberof google.logging.v2.WriteLogEntriesRequest * @instance */ WriteLogEntriesRequest.prototype.resource = null; /** * WriteLogEntriesRequest labels. * @member {Object.} labels * @memberof google.logging.v2.WriteLogEntriesRequest * @instance */ WriteLogEntriesRequest.prototype.labels = $util.emptyObject; /** * WriteLogEntriesRequest entries. * @member {Array.} entries * @memberof google.logging.v2.WriteLogEntriesRequest * @instance */ WriteLogEntriesRequest.prototype.entries = $util.emptyArray; /** * WriteLogEntriesRequest partialSuccess. * @member {boolean} partialSuccess * @memberof google.logging.v2.WriteLogEntriesRequest * @instance */ WriteLogEntriesRequest.prototype.partialSuccess = false; /** * WriteLogEntriesRequest dryRun. * @member {boolean} dryRun * @memberof google.logging.v2.WriteLogEntriesRequest * @instance */ WriteLogEntriesRequest.prototype.dryRun = false; /** * Creates a new WriteLogEntriesRequest instance using the specified properties. * @function create * @memberof google.logging.v2.WriteLogEntriesRequest * @static * @param {google.logging.v2.IWriteLogEntriesRequest=} [properties] Properties to set * @returns {google.logging.v2.WriteLogEntriesRequest} WriteLogEntriesRequest instance */ WriteLogEntriesRequest.create = function create(properties) { return new WriteLogEntriesRequest(properties); }; /** * Encodes the specified WriteLogEntriesRequest message. Does not implicitly {@link google.logging.v2.WriteLogEntriesRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.WriteLogEntriesRequest * @static * @param {google.logging.v2.IWriteLogEntriesRequest} message WriteLogEntriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WriteLogEntriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.logName); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.api.MonitoredResource.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); if (message.entries != null && message.entries.length) for (var i = 0; i < message.entries.length; ++i) $root.google.logging.v2.LogEntry.encode(message.entries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.partialSuccess); if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.dryRun); return writer; }; /** * Encodes the specified WriteLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.WriteLogEntriesRequest * @static * @param {google.logging.v2.IWriteLogEntriesRequest} message WriteLogEntriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WriteLogEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a WriteLogEntriesRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.WriteLogEntriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.WriteLogEntriesRequest} WriteLogEntriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WriteLogEntriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.WriteLogEntriesRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.logName = reader.string(); break; case 2: message.resource = $root.google.api.MonitoredResource.decode(reader, reader.uint32()); break; case 3: if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = reader.string(); break; default: reader.skipType(tag2 & 7); break; } } message.labels[key] = value; break; case 4: if (!(message.entries && message.entries.length)) message.entries = []; message.entries.push($root.google.logging.v2.LogEntry.decode(reader, reader.uint32())); break; case 5: message.partialSuccess = reader.bool(); break; case 6: message.dryRun = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a WriteLogEntriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.WriteLogEntriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.WriteLogEntriesRequest} WriteLogEntriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WriteLogEntriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a WriteLogEntriesRequest message. * @function verify * @memberof google.logging.v2.WriteLogEntriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ WriteLogEntriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.logName != null && message.hasOwnProperty("logName")) if (!$util.isString(message.logName)) return "logName: string expected"; if (message.resource != null && message.hasOwnProperty("resource")) { var error = $root.google.api.MonitoredResource.verify(message.resource); if (error) return "resource." + error; } if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); for (var i = 0; i < key.length; ++i) if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } if (message.entries != null && message.hasOwnProperty("entries")) { if (!Array.isArray(message.entries)) return "entries: array expected"; for (var i = 0; i < message.entries.length; ++i) { var error = $root.google.logging.v2.LogEntry.verify(message.entries[i]); if (error) return "entries." + error; } } if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) if (typeof message.partialSuccess !== "boolean") return "partialSuccess: boolean expected"; if (message.dryRun != null && message.hasOwnProperty("dryRun")) if (typeof message.dryRun !== "boolean") return "dryRun: boolean expected"; return null; }; /** * Creates a WriteLogEntriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.WriteLogEntriesRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.WriteLogEntriesRequest} WriteLogEntriesRequest */ WriteLogEntriesRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.WriteLogEntriesRequest) return object; var message = new $root.google.logging.v2.WriteLogEntriesRequest(); if (object.logName != null) message.logName = String(object.logName); if (object.resource != null) { if (typeof object.resource !== "object") throw TypeError(".google.logging.v2.WriteLogEntriesRequest.resource: object expected"); message.resource = $root.google.api.MonitoredResource.fromObject(object.resource); } if (object.labels) { if (typeof object.labels !== "object") throw TypeError(".google.logging.v2.WriteLogEntriesRequest.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } if (object.entries) { if (!Array.isArray(object.entries)) throw TypeError(".google.logging.v2.WriteLogEntriesRequest.entries: array expected"); message.entries = []; for (var i = 0; i < object.entries.length; ++i) { if (typeof object.entries[i] !== "object") throw TypeError(".google.logging.v2.WriteLogEntriesRequest.entries: object expected"); message.entries[i] = $root.google.logging.v2.LogEntry.fromObject(object.entries[i]); } } if (object.partialSuccess != null) message.partialSuccess = Boolean(object.partialSuccess); if (object.dryRun != null) message.dryRun = Boolean(object.dryRun); return message; }; /** * Creates a plain object from a WriteLogEntriesRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.WriteLogEntriesRequest * @static * @param {google.logging.v2.WriteLogEntriesRequest} message WriteLogEntriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ WriteLogEntriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.entries = []; if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { object.logName = ""; object.resource = null; object.partialSuccess = false; object.dryRun = false; } if (message.logName != null && message.hasOwnProperty("logName")) object.logName = message.logName; if (message.resource != null && message.hasOwnProperty("resource")) object.resource = $root.google.api.MonitoredResource.toObject(message.resource, options); var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.entries && message.entries.length) { object.entries = []; for (var j = 0; j < message.entries.length; ++j) object.entries[j] = $root.google.logging.v2.LogEntry.toObject(message.entries[j], options); } if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object.partialSuccess = message.partialSuccess; if (message.dryRun != null && message.hasOwnProperty("dryRun")) object.dryRun = message.dryRun; return object; }; /** * Converts this WriteLogEntriesRequest to JSON. * @function toJSON * @memberof google.logging.v2.WriteLogEntriesRequest * @instance * @returns {Object.} JSON object */ WriteLogEntriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return WriteLogEntriesRequest; })(); v2.WriteLogEntriesResponse = (function() { /** * Properties of a WriteLogEntriesResponse. * @memberof google.logging.v2 * @interface IWriteLogEntriesResponse */ /** * Constructs a new WriteLogEntriesResponse. * @memberof google.logging.v2 * @classdesc Represents a WriteLogEntriesResponse. * @implements IWriteLogEntriesResponse * @constructor * @param {google.logging.v2.IWriteLogEntriesResponse=} [properties] Properties to set */ function WriteLogEntriesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Creates a new WriteLogEntriesResponse instance using the specified properties. * @function create * @memberof google.logging.v2.WriteLogEntriesResponse * @static * @param {google.logging.v2.IWriteLogEntriesResponse=} [properties] Properties to set * @returns {google.logging.v2.WriteLogEntriesResponse} WriteLogEntriesResponse instance */ WriteLogEntriesResponse.create = function create(properties) { return new WriteLogEntriesResponse(properties); }; /** * Encodes the specified WriteLogEntriesResponse message. Does not implicitly {@link google.logging.v2.WriteLogEntriesResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.WriteLogEntriesResponse * @static * @param {google.logging.v2.IWriteLogEntriesResponse} message WriteLogEntriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WriteLogEntriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** * Encodes the specified WriteLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.WriteLogEntriesResponse * @static * @param {google.logging.v2.IWriteLogEntriesResponse} message WriteLogEntriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WriteLogEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a WriteLogEntriesResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.WriteLogEntriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.WriteLogEntriesResponse} WriteLogEntriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WriteLogEntriesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.WriteLogEntriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a WriteLogEntriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.WriteLogEntriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.WriteLogEntriesResponse} WriteLogEntriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WriteLogEntriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a WriteLogEntriesResponse message. * @function verify * @memberof google.logging.v2.WriteLogEntriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ WriteLogEntriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** * Creates a WriteLogEntriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.WriteLogEntriesResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.WriteLogEntriesResponse} WriteLogEntriesResponse */ WriteLogEntriesResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.WriteLogEntriesResponse) return object; return new $root.google.logging.v2.WriteLogEntriesResponse(); }; /** * Creates a plain object from a WriteLogEntriesResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.WriteLogEntriesResponse * @static * @param {google.logging.v2.WriteLogEntriesResponse} message WriteLogEntriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ WriteLogEntriesResponse.toObject = function toObject() { return {}; }; /** * Converts this WriteLogEntriesResponse to JSON. * @function toJSON * @memberof google.logging.v2.WriteLogEntriesResponse * @instance * @returns {Object.} JSON object */ WriteLogEntriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return WriteLogEntriesResponse; })(); v2.WriteLogEntriesPartialErrors = (function() { /** * Properties of a WriteLogEntriesPartialErrors. * @memberof google.logging.v2 * @interface IWriteLogEntriesPartialErrors * @property {Object.|null} [logEntryErrors] WriteLogEntriesPartialErrors logEntryErrors */ /** * Constructs a new WriteLogEntriesPartialErrors. * @memberof google.logging.v2 * @classdesc Represents a WriteLogEntriesPartialErrors. * @implements IWriteLogEntriesPartialErrors * @constructor * @param {google.logging.v2.IWriteLogEntriesPartialErrors=} [properties] Properties to set */ function WriteLogEntriesPartialErrors(properties) { this.logEntryErrors = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * WriteLogEntriesPartialErrors logEntryErrors. * @member {Object.} logEntryErrors * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @instance */ WriteLogEntriesPartialErrors.prototype.logEntryErrors = $util.emptyObject; /** * Creates a new WriteLogEntriesPartialErrors instance using the specified properties. * @function create * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @static * @param {google.logging.v2.IWriteLogEntriesPartialErrors=} [properties] Properties to set * @returns {google.logging.v2.WriteLogEntriesPartialErrors} WriteLogEntriesPartialErrors instance */ WriteLogEntriesPartialErrors.create = function create(properties) { return new WriteLogEntriesPartialErrors(properties); }; /** * Encodes the specified WriteLogEntriesPartialErrors message. Does not implicitly {@link google.logging.v2.WriteLogEntriesPartialErrors.verify|verify} messages. * @function encode * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @static * @param {google.logging.v2.IWriteLogEntriesPartialErrors} message WriteLogEntriesPartialErrors message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WriteLogEntriesPartialErrors.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.logEntryErrors != null && Object.hasOwnProperty.call(message, "logEntryErrors")) for (var keys = Object.keys(message.logEntryErrors), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); $root.google.rpc.Status.encode(message.logEntryErrors[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } return writer; }; /** * Encodes the specified WriteLogEntriesPartialErrors message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesPartialErrors.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @static * @param {google.logging.v2.IWriteLogEntriesPartialErrors} message WriteLogEntriesPartialErrors message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WriteLogEntriesPartialErrors.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a WriteLogEntriesPartialErrors message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.WriteLogEntriesPartialErrors} WriteLogEntriesPartialErrors * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WriteLogEntriesPartialErrors.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.WriteLogEntriesPartialErrors(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (message.logEntryErrors === $util.emptyObject) message.logEntryErrors = {}; var end2 = reader.uint32() + reader.pos; key = 0; value = null; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.int32(); break; case 2: value = $root.google.rpc.Status.decode(reader, reader.uint32()); break; default: reader.skipType(tag2 & 7); break; } } message.logEntryErrors[key] = value; break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a WriteLogEntriesPartialErrors message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.WriteLogEntriesPartialErrors} WriteLogEntriesPartialErrors * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WriteLogEntriesPartialErrors.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a WriteLogEntriesPartialErrors message. * @function verify * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ WriteLogEntriesPartialErrors.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.logEntryErrors != null && message.hasOwnProperty("logEntryErrors")) { if (!$util.isObject(message.logEntryErrors)) return "logEntryErrors: object expected"; var key = Object.keys(message.logEntryErrors); for (var i = 0; i < key.length; ++i) { if (!$util.key32Re.test(key[i])) return "logEntryErrors: integer key{k:int32} expected"; { var error = $root.google.rpc.Status.verify(message.logEntryErrors[key[i]]); if (error) return "logEntryErrors." + error; } } } return null; }; /** * Creates a WriteLogEntriesPartialErrors message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @static * @param {Object.} object Plain object * @returns {google.logging.v2.WriteLogEntriesPartialErrors} WriteLogEntriesPartialErrors */ WriteLogEntriesPartialErrors.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.WriteLogEntriesPartialErrors) return object; var message = new $root.google.logging.v2.WriteLogEntriesPartialErrors(); if (object.logEntryErrors) { if (typeof object.logEntryErrors !== "object") throw TypeError(".google.logging.v2.WriteLogEntriesPartialErrors.logEntryErrors: object expected"); message.logEntryErrors = {}; for (var keys = Object.keys(object.logEntryErrors), i = 0; i < keys.length; ++i) { if (typeof object.logEntryErrors[keys[i]] !== "object") throw TypeError(".google.logging.v2.WriteLogEntriesPartialErrors.logEntryErrors: object expected"); message.logEntryErrors[keys[i]] = $root.google.rpc.Status.fromObject(object.logEntryErrors[keys[i]]); } } return message; }; /** * Creates a plain object from a WriteLogEntriesPartialErrors message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @static * @param {google.logging.v2.WriteLogEntriesPartialErrors} message WriteLogEntriesPartialErrors * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ WriteLogEntriesPartialErrors.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.logEntryErrors = {}; var keys2; if (message.logEntryErrors && (keys2 = Object.keys(message.logEntryErrors)).length) { object.logEntryErrors = {}; for (var j = 0; j < keys2.length; ++j) object.logEntryErrors[keys2[j]] = $root.google.rpc.Status.toObject(message.logEntryErrors[keys2[j]], options); } return object; }; /** * Converts this WriteLogEntriesPartialErrors to JSON. * @function toJSON * @memberof google.logging.v2.WriteLogEntriesPartialErrors * @instance * @returns {Object.} JSON object */ WriteLogEntriesPartialErrors.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return WriteLogEntriesPartialErrors; })(); v2.ListLogEntriesRequest = (function() { /** * Properties of a ListLogEntriesRequest. * @memberof google.logging.v2 * @interface IListLogEntriesRequest * @property {Array.|null} [resourceNames] ListLogEntriesRequest resourceNames * @property {string|null} [filter] ListLogEntriesRequest filter * @property {string|null} [orderBy] ListLogEntriesRequest orderBy * @property {number|null} [pageSize] ListLogEntriesRequest pageSize * @property {string|null} [pageToken] ListLogEntriesRequest pageToken */ /** * Constructs a new ListLogEntriesRequest. * @memberof google.logging.v2 * @classdesc Represents a ListLogEntriesRequest. * @implements IListLogEntriesRequest * @constructor * @param {google.logging.v2.IListLogEntriesRequest=} [properties] Properties to set */ function ListLogEntriesRequest(properties) { this.resourceNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListLogEntriesRequest resourceNames. * @member {Array.} resourceNames * @memberof google.logging.v2.ListLogEntriesRequest * @instance */ ListLogEntriesRequest.prototype.resourceNames = $util.emptyArray; /** * ListLogEntriesRequest filter. * @member {string} filter * @memberof google.logging.v2.ListLogEntriesRequest * @instance */ ListLogEntriesRequest.prototype.filter = ""; /** * ListLogEntriesRequest orderBy. * @member {string} orderBy * @memberof google.logging.v2.ListLogEntriesRequest * @instance */ ListLogEntriesRequest.prototype.orderBy = ""; /** * ListLogEntriesRequest pageSize. * @member {number} pageSize * @memberof google.logging.v2.ListLogEntriesRequest * @instance */ ListLogEntriesRequest.prototype.pageSize = 0; /** * ListLogEntriesRequest pageToken. * @member {string} pageToken * @memberof google.logging.v2.ListLogEntriesRequest * @instance */ ListLogEntriesRequest.prototype.pageToken = ""; /** * Creates a new ListLogEntriesRequest instance using the specified properties. * @function create * @memberof google.logging.v2.ListLogEntriesRequest * @static * @param {google.logging.v2.IListLogEntriesRequest=} [properties] Properties to set * @returns {google.logging.v2.ListLogEntriesRequest} ListLogEntriesRequest instance */ ListLogEntriesRequest.create = function create(properties) { return new ListLogEntriesRequest(properties); }; /** * Encodes the specified ListLogEntriesRequest message. Does not implicitly {@link google.logging.v2.ListLogEntriesRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListLogEntriesRequest * @static * @param {google.logging.v2.IListLogEntriesRequest} message ListLogEntriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogEntriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); if (message.resourceNames != null && message.resourceNames.length) for (var i = 0; i < message.resourceNames.length; ++i) writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceNames[i]); return writer; }; /** * Encodes the specified ListLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogEntriesRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListLogEntriesRequest * @static * @param {google.logging.v2.IListLogEntriesRequest} message ListLogEntriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListLogEntriesRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListLogEntriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListLogEntriesRequest} ListLogEntriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogEntriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogEntriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 8: if (!(message.resourceNames && message.resourceNames.length)) message.resourceNames = []; message.resourceNames.push(reader.string()); break; case 2: message.filter = reader.string(); break; case 3: message.orderBy = reader.string(); break; case 4: message.pageSize = reader.int32(); break; case 5: message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListLogEntriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListLogEntriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListLogEntriesRequest} ListLogEntriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogEntriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListLogEntriesRequest message. * @function verify * @memberof google.logging.v2.ListLogEntriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListLogEntriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.resourceNames != null && message.hasOwnProperty("resourceNames")) { if (!Array.isArray(message.resourceNames)) return "resourceNames: array expected"; for (var i = 0; i < message.resourceNames.length; ++i) if (!$util.isString(message.resourceNames[i])) return "resourceNames: string[] expected"; } if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; if (message.orderBy != null && message.hasOwnProperty("orderBy")) if (!$util.isString(message.orderBy)) return "orderBy: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; }; /** * Creates a ListLogEntriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListLogEntriesRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListLogEntriesRequest} ListLogEntriesRequest */ ListLogEntriesRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListLogEntriesRequest) return object; var message = new $root.google.logging.v2.ListLogEntriesRequest(); if (object.resourceNames) { if (!Array.isArray(object.resourceNames)) throw TypeError(".google.logging.v2.ListLogEntriesRequest.resourceNames: array expected"); message.resourceNames = []; for (var i = 0; i < object.resourceNames.length; ++i) message.resourceNames[i] = String(object.resourceNames[i]); } if (object.filter != null) message.filter = String(object.filter); if (object.orderBy != null) message.orderBy = String(object.orderBy); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); return message; }; /** * Creates a plain object from a ListLogEntriesRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListLogEntriesRequest * @static * @param {google.logging.v2.ListLogEntriesRequest} message ListLogEntriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListLogEntriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.resourceNames = []; if (options.defaults) { object.filter = ""; object.orderBy = ""; object.pageSize = 0; object.pageToken = ""; } if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.orderBy != null && message.hasOwnProperty("orderBy")) object.orderBy = message.orderBy; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.resourceNames && message.resourceNames.length) { object.resourceNames = []; for (var j = 0; j < message.resourceNames.length; ++j) object.resourceNames[j] = message.resourceNames[j]; } return object; }; /** * Converts this ListLogEntriesRequest to JSON. * @function toJSON * @memberof google.logging.v2.ListLogEntriesRequest * @instance * @returns {Object.} JSON object */ ListLogEntriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListLogEntriesRequest; })(); v2.ListLogEntriesResponse = (function() { /** * Properties of a ListLogEntriesResponse. * @memberof google.logging.v2 * @interface IListLogEntriesResponse * @property {Array.|null} [entries] ListLogEntriesResponse entries * @property {string|null} [nextPageToken] ListLogEntriesResponse nextPageToken */ /** * Constructs a new ListLogEntriesResponse. * @memberof google.logging.v2 * @classdesc Represents a ListLogEntriesResponse. * @implements IListLogEntriesResponse * @constructor * @param {google.logging.v2.IListLogEntriesResponse=} [properties] Properties to set */ function ListLogEntriesResponse(properties) { this.entries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListLogEntriesResponse entries. * @member {Array.} entries * @memberof google.logging.v2.ListLogEntriesResponse * @instance */ ListLogEntriesResponse.prototype.entries = $util.emptyArray; /** * ListLogEntriesResponse nextPageToken. * @member {string} nextPageToken * @memberof google.logging.v2.ListLogEntriesResponse * @instance */ ListLogEntriesResponse.prototype.nextPageToken = ""; /** * Creates a new ListLogEntriesResponse instance using the specified properties. * @function create * @memberof google.logging.v2.ListLogEntriesResponse * @static * @param {google.logging.v2.IListLogEntriesResponse=} [properties] Properties to set * @returns {google.logging.v2.ListLogEntriesResponse} ListLogEntriesResponse instance */ ListLogEntriesResponse.create = function create(properties) { return new ListLogEntriesResponse(properties); }; /** * Encodes the specified ListLogEntriesResponse message. Does not implicitly {@link google.logging.v2.ListLogEntriesResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListLogEntriesResponse * @static * @param {google.logging.v2.IListLogEntriesResponse} message ListLogEntriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogEntriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.entries != null && message.entries.length) for (var i = 0; i < message.entries.length; ++i) $root.google.logging.v2.LogEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogEntriesResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListLogEntriesResponse * @static * @param {google.logging.v2.IListLogEntriesResponse} message ListLogEntriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListLogEntriesResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListLogEntriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListLogEntriesResponse} ListLogEntriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogEntriesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogEntriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.entries && message.entries.length)) message.entries = []; message.entries.push($root.google.logging.v2.LogEntry.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListLogEntriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListLogEntriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListLogEntriesResponse} ListLogEntriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogEntriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListLogEntriesResponse message. * @function verify * @memberof google.logging.v2.ListLogEntriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListLogEntriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.entries != null && message.hasOwnProperty("entries")) { if (!Array.isArray(message.entries)) return "entries: array expected"; for (var i = 0; i < message.entries.length; ++i) { var error = $root.google.logging.v2.LogEntry.verify(message.entries[i]); if (error) return "entries." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListLogEntriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListLogEntriesResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListLogEntriesResponse} ListLogEntriesResponse */ ListLogEntriesResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListLogEntriesResponse) return object; var message = new $root.google.logging.v2.ListLogEntriesResponse(); if (object.entries) { if (!Array.isArray(object.entries)) throw TypeError(".google.logging.v2.ListLogEntriesResponse.entries: array expected"); message.entries = []; for (var i = 0; i < object.entries.length; ++i) { if (typeof object.entries[i] !== "object") throw TypeError(".google.logging.v2.ListLogEntriesResponse.entries: object expected"); message.entries[i] = $root.google.logging.v2.LogEntry.fromObject(object.entries[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListLogEntriesResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListLogEntriesResponse * @static * @param {google.logging.v2.ListLogEntriesResponse} message ListLogEntriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListLogEntriesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.entries = []; if (options.defaults) object.nextPageToken = ""; if (message.entries && message.entries.length) { object.entries = []; for (var j = 0; j < message.entries.length; ++j) object.entries[j] = $root.google.logging.v2.LogEntry.toObject(message.entries[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListLogEntriesResponse to JSON. * @function toJSON * @memberof google.logging.v2.ListLogEntriesResponse * @instance * @returns {Object.} JSON object */ ListLogEntriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListLogEntriesResponse; })(); v2.ListMonitoredResourceDescriptorsRequest = (function() { /** * Properties of a ListMonitoredResourceDescriptorsRequest. * @memberof google.logging.v2 * @interface IListMonitoredResourceDescriptorsRequest * @property {number|null} [pageSize] ListMonitoredResourceDescriptorsRequest pageSize * @property {string|null} [pageToken] ListMonitoredResourceDescriptorsRequest pageToken */ /** * Constructs a new ListMonitoredResourceDescriptorsRequest. * @memberof google.logging.v2 * @classdesc Represents a ListMonitoredResourceDescriptorsRequest. * @implements IListMonitoredResourceDescriptorsRequest * @constructor * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest=} [properties] Properties to set */ function ListMonitoredResourceDescriptorsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListMonitoredResourceDescriptorsRequest pageSize. * @member {number} pageSize * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @instance */ ListMonitoredResourceDescriptorsRequest.prototype.pageSize = 0; /** * ListMonitoredResourceDescriptorsRequest pageToken. * @member {string} pageToken * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @instance */ ListMonitoredResourceDescriptorsRequest.prototype.pageToken = ""; /** * Creates a new ListMonitoredResourceDescriptorsRequest instance using the specified properties. * @function create * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @static * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest=} [properties] Properties to set * @returns {google.logging.v2.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest instance */ ListMonitoredResourceDescriptorsRequest.create = function create(properties) { return new ListMonitoredResourceDescriptorsRequest(properties); }; /** * Encodes the specified ListMonitoredResourceDescriptorsRequest message. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @static * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListMonitoredResourceDescriptorsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); return writer; }; /** * Encodes the specified ListMonitoredResourceDescriptorsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @static * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListMonitoredResourceDescriptorsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListMonitoredResourceDescriptorsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListMonitoredResourceDescriptorsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.pageSize = reader.int32(); break; case 2: message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListMonitoredResourceDescriptorsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListMonitoredResourceDescriptorsRequest message. * @function verify * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListMonitoredResourceDescriptorsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; }; /** * Creates a ListMonitoredResourceDescriptorsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest */ ListMonitoredResourceDescriptorsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListMonitoredResourceDescriptorsRequest) return object; var message = new $root.google.logging.v2.ListMonitoredResourceDescriptorsRequest(); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); return message; }; /** * Creates a plain object from a ListMonitoredResourceDescriptorsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @static * @param {google.logging.v2.ListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListMonitoredResourceDescriptorsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.pageSize = 0; object.pageToken = ""; } if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; return object; }; /** * Converts this ListMonitoredResourceDescriptorsRequest to JSON. * @function toJSON * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest * @instance * @returns {Object.} JSON object */ ListMonitoredResourceDescriptorsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListMonitoredResourceDescriptorsRequest; })(); v2.ListMonitoredResourceDescriptorsResponse = (function() { /** * Properties of a ListMonitoredResourceDescriptorsResponse. * @memberof google.logging.v2 * @interface IListMonitoredResourceDescriptorsResponse * @property {Array.|null} [resourceDescriptors] ListMonitoredResourceDescriptorsResponse resourceDescriptors * @property {string|null} [nextPageToken] ListMonitoredResourceDescriptorsResponse nextPageToken */ /** * Constructs a new ListMonitoredResourceDescriptorsResponse. * @memberof google.logging.v2 * @classdesc Represents a ListMonitoredResourceDescriptorsResponse. * @implements IListMonitoredResourceDescriptorsResponse * @constructor * @param {google.logging.v2.IListMonitoredResourceDescriptorsResponse=} [properties] Properties to set */ function ListMonitoredResourceDescriptorsResponse(properties) { this.resourceDescriptors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListMonitoredResourceDescriptorsResponse resourceDescriptors. * @member {Array.} resourceDescriptors * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @instance */ ListMonitoredResourceDescriptorsResponse.prototype.resourceDescriptors = $util.emptyArray; /** * ListMonitoredResourceDescriptorsResponse nextPageToken. * @member {string} nextPageToken * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @instance */ ListMonitoredResourceDescriptorsResponse.prototype.nextPageToken = ""; /** * Creates a new ListMonitoredResourceDescriptorsResponse instance using the specified properties. * @function create * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @static * @param {google.logging.v2.IListMonitoredResourceDescriptorsResponse=} [properties] Properties to set * @returns {google.logging.v2.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse instance */ ListMonitoredResourceDescriptorsResponse.create = function create(properties) { return new ListMonitoredResourceDescriptorsResponse(properties); }; /** * Encodes the specified ListMonitoredResourceDescriptorsResponse message. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @static * @param {google.logging.v2.IListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListMonitoredResourceDescriptorsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.resourceDescriptors != null && message.resourceDescriptors.length) for (var i = 0; i < message.resourceDescriptors.length; ++i) $root.google.api.MonitoredResourceDescriptor.encode(message.resourceDescriptors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListMonitoredResourceDescriptorsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @static * @param {google.logging.v2.IListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListMonitoredResourceDescriptorsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListMonitoredResourceDescriptorsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListMonitoredResourceDescriptorsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.resourceDescriptors && message.resourceDescriptors.length)) message.resourceDescriptors = []; message.resourceDescriptors.push($root.google.api.MonitoredResourceDescriptor.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListMonitoredResourceDescriptorsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListMonitoredResourceDescriptorsResponse message. * @function verify * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListMonitoredResourceDescriptorsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.resourceDescriptors != null && message.hasOwnProperty("resourceDescriptors")) { if (!Array.isArray(message.resourceDescriptors)) return "resourceDescriptors: array expected"; for (var i = 0; i < message.resourceDescriptors.length; ++i) { var error = $root.google.api.MonitoredResourceDescriptor.verify(message.resourceDescriptors[i]); if (error) return "resourceDescriptors." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListMonitoredResourceDescriptorsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse */ ListMonitoredResourceDescriptorsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListMonitoredResourceDescriptorsResponse) return object; var message = new $root.google.logging.v2.ListMonitoredResourceDescriptorsResponse(); if (object.resourceDescriptors) { if (!Array.isArray(object.resourceDescriptors)) throw TypeError(".google.logging.v2.ListMonitoredResourceDescriptorsResponse.resourceDescriptors: array expected"); message.resourceDescriptors = []; for (var i = 0; i < object.resourceDescriptors.length; ++i) { if (typeof object.resourceDescriptors[i] !== "object") throw TypeError(".google.logging.v2.ListMonitoredResourceDescriptorsResponse.resourceDescriptors: object expected"); message.resourceDescriptors[i] = $root.google.api.MonitoredResourceDescriptor.fromObject(object.resourceDescriptors[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListMonitoredResourceDescriptorsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @static * @param {google.logging.v2.ListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListMonitoredResourceDescriptorsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.resourceDescriptors = []; if (options.defaults) object.nextPageToken = ""; if (message.resourceDescriptors && message.resourceDescriptors.length) { object.resourceDescriptors = []; for (var j = 0; j < message.resourceDescriptors.length; ++j) object.resourceDescriptors[j] = $root.google.api.MonitoredResourceDescriptor.toObject(message.resourceDescriptors[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListMonitoredResourceDescriptorsResponse to JSON. * @function toJSON * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse * @instance * @returns {Object.} JSON object */ ListMonitoredResourceDescriptorsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListMonitoredResourceDescriptorsResponse; })(); v2.ListLogsRequest = (function() { /** * Properties of a ListLogsRequest. * @memberof google.logging.v2 * @interface IListLogsRequest * @property {string|null} [parent] ListLogsRequest parent * @property {number|null} [pageSize] ListLogsRequest pageSize * @property {string|null} [pageToken] ListLogsRequest pageToken * @property {Array.|null} [resourceNames] ListLogsRequest resourceNames */ /** * Constructs a new ListLogsRequest. * @memberof google.logging.v2 * @classdesc Represents a ListLogsRequest. * @implements IListLogsRequest * @constructor * @param {google.logging.v2.IListLogsRequest=} [properties] Properties to set */ function ListLogsRequest(properties) { this.resourceNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListLogsRequest parent. * @member {string} parent * @memberof google.logging.v2.ListLogsRequest * @instance */ ListLogsRequest.prototype.parent = ""; /** * ListLogsRequest pageSize. * @member {number} pageSize * @memberof google.logging.v2.ListLogsRequest * @instance */ ListLogsRequest.prototype.pageSize = 0; /** * ListLogsRequest pageToken. * @member {string} pageToken * @memberof google.logging.v2.ListLogsRequest * @instance */ ListLogsRequest.prototype.pageToken = ""; /** * ListLogsRequest resourceNames. * @member {Array.} resourceNames * @memberof google.logging.v2.ListLogsRequest * @instance */ ListLogsRequest.prototype.resourceNames = $util.emptyArray; /** * Creates a new ListLogsRequest instance using the specified properties. * @function create * @memberof google.logging.v2.ListLogsRequest * @static * @param {google.logging.v2.IListLogsRequest=} [properties] Properties to set * @returns {google.logging.v2.ListLogsRequest} ListLogsRequest instance */ ListLogsRequest.create = function create(properties) { return new ListLogsRequest(properties); }; /** * Encodes the specified ListLogsRequest message. Does not implicitly {@link google.logging.v2.ListLogsRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListLogsRequest * @static * @param {google.logging.v2.IListLogsRequest} message ListLogsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); if (message.resourceNames != null && message.resourceNames.length) for (var i = 0; i < message.resourceNames.length; ++i) writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceNames[i]); return writer; }; /** * Encodes the specified ListLogsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListLogsRequest * @static * @param {google.logging.v2.IListLogsRequest} message ListLogsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListLogsRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListLogsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListLogsRequest} ListLogsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.pageSize = reader.int32(); break; case 3: message.pageToken = reader.string(); break; case 8: if (!(message.resourceNames && message.resourceNames.length)) message.resourceNames = []; message.resourceNames.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListLogsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListLogsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListLogsRequest} ListLogsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListLogsRequest message. * @function verify * @memberof google.logging.v2.ListLogsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListLogsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; if (message.resourceNames != null && message.hasOwnProperty("resourceNames")) { if (!Array.isArray(message.resourceNames)) return "resourceNames: array expected"; for (var i = 0; i < message.resourceNames.length; ++i) if (!$util.isString(message.resourceNames[i])) return "resourceNames: string[] expected"; } return null; }; /** * Creates a ListLogsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListLogsRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListLogsRequest} ListLogsRequest */ ListLogsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListLogsRequest) return object; var message = new $root.google.logging.v2.ListLogsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.resourceNames) { if (!Array.isArray(object.resourceNames)) throw TypeError(".google.logging.v2.ListLogsRequest.resourceNames: array expected"); message.resourceNames = []; for (var i = 0; i < object.resourceNames.length; ++i) message.resourceNames[i] = String(object.resourceNames[i]); } return message; }; /** * Creates a plain object from a ListLogsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListLogsRequest * @static * @param {google.logging.v2.ListLogsRequest} message ListLogsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListLogsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.resourceNames = []; if (options.defaults) { object.parent = ""; object.pageSize = 0; object.pageToken = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.resourceNames && message.resourceNames.length) { object.resourceNames = []; for (var j = 0; j < message.resourceNames.length; ++j) object.resourceNames[j] = message.resourceNames[j]; } return object; }; /** * Converts this ListLogsRequest to JSON. * @function toJSON * @memberof google.logging.v2.ListLogsRequest * @instance * @returns {Object.} JSON object */ ListLogsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListLogsRequest; })(); v2.ListLogsResponse = (function() { /** * Properties of a ListLogsResponse. * @memberof google.logging.v2 * @interface IListLogsResponse * @property {Array.|null} [logNames] ListLogsResponse logNames * @property {string|null} [nextPageToken] ListLogsResponse nextPageToken */ /** * Constructs a new ListLogsResponse. * @memberof google.logging.v2 * @classdesc Represents a ListLogsResponse. * @implements IListLogsResponse * @constructor * @param {google.logging.v2.IListLogsResponse=} [properties] Properties to set */ function ListLogsResponse(properties) { this.logNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListLogsResponse logNames. * @member {Array.} logNames * @memberof google.logging.v2.ListLogsResponse * @instance */ ListLogsResponse.prototype.logNames = $util.emptyArray; /** * ListLogsResponse nextPageToken. * @member {string} nextPageToken * @memberof google.logging.v2.ListLogsResponse * @instance */ ListLogsResponse.prototype.nextPageToken = ""; /** * Creates a new ListLogsResponse instance using the specified properties. * @function create * @memberof google.logging.v2.ListLogsResponse * @static * @param {google.logging.v2.IListLogsResponse=} [properties] Properties to set * @returns {google.logging.v2.ListLogsResponse} ListLogsResponse instance */ ListLogsResponse.create = function create(properties) { return new ListLogsResponse(properties); }; /** * Encodes the specified ListLogsResponse message. Does not implicitly {@link google.logging.v2.ListLogsResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListLogsResponse * @static * @param {google.logging.v2.IListLogsResponse} message ListLogsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.logNames != null && message.logNames.length) for (var i = 0; i < message.logNames.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.logNames[i]); return writer; }; /** * Encodes the specified ListLogsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListLogsResponse * @static * @param {google.logging.v2.IListLogsResponse} message ListLogsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListLogsResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListLogsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListLogsResponse} ListLogsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 3: if (!(message.logNames && message.logNames.length)) message.logNames = []; message.logNames.push(reader.string()); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListLogsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListLogsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListLogsResponse} ListLogsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListLogsResponse message. * @function verify * @memberof google.logging.v2.ListLogsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListLogsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.logNames != null && message.hasOwnProperty("logNames")) { if (!Array.isArray(message.logNames)) return "logNames: array expected"; for (var i = 0; i < message.logNames.length; ++i) if (!$util.isString(message.logNames[i])) return "logNames: string[] expected"; } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListLogsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListLogsResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListLogsResponse} ListLogsResponse */ ListLogsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListLogsResponse) return object; var message = new $root.google.logging.v2.ListLogsResponse(); if (object.logNames) { if (!Array.isArray(object.logNames)) throw TypeError(".google.logging.v2.ListLogsResponse.logNames: array expected"); message.logNames = []; for (var i = 0; i < object.logNames.length; ++i) message.logNames[i] = String(object.logNames[i]); } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListLogsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListLogsResponse * @static * @param {google.logging.v2.ListLogsResponse} message ListLogsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListLogsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.logNames = []; if (options.defaults) object.nextPageToken = ""; if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; if (message.logNames && message.logNames.length) { object.logNames = []; for (var j = 0; j < message.logNames.length; ++j) object.logNames[j] = message.logNames[j]; } return object; }; /** * Converts this ListLogsResponse to JSON. * @function toJSON * @memberof google.logging.v2.ListLogsResponse * @instance * @returns {Object.} JSON object */ ListLogsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListLogsResponse; })(); v2.TailLogEntriesRequest = (function() { /** * Properties of a TailLogEntriesRequest. * @memberof google.logging.v2 * @interface ITailLogEntriesRequest * @property {Array.|null} [resourceNames] TailLogEntriesRequest resourceNames * @property {string|null} [filter] TailLogEntriesRequest filter * @property {google.protobuf.IDuration|null} [bufferWindow] TailLogEntriesRequest bufferWindow */ /** * Constructs a new TailLogEntriesRequest. * @memberof google.logging.v2 * @classdesc Represents a TailLogEntriesRequest. * @implements ITailLogEntriesRequest * @constructor * @param {google.logging.v2.ITailLogEntriesRequest=} [properties] Properties to set */ function TailLogEntriesRequest(properties) { this.resourceNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * TailLogEntriesRequest resourceNames. * @member {Array.} resourceNames * @memberof google.logging.v2.TailLogEntriesRequest * @instance */ TailLogEntriesRequest.prototype.resourceNames = $util.emptyArray; /** * TailLogEntriesRequest filter. * @member {string} filter * @memberof google.logging.v2.TailLogEntriesRequest * @instance */ TailLogEntriesRequest.prototype.filter = ""; /** * TailLogEntriesRequest bufferWindow. * @member {google.protobuf.IDuration|null|undefined} bufferWindow * @memberof google.logging.v2.TailLogEntriesRequest * @instance */ TailLogEntriesRequest.prototype.bufferWindow = null; /** * Creates a new TailLogEntriesRequest instance using the specified properties. * @function create * @memberof google.logging.v2.TailLogEntriesRequest * @static * @param {google.logging.v2.ITailLogEntriesRequest=} [properties] Properties to set * @returns {google.logging.v2.TailLogEntriesRequest} TailLogEntriesRequest instance */ TailLogEntriesRequest.create = function create(properties) { return new TailLogEntriesRequest(properties); }; /** * Encodes the specified TailLogEntriesRequest message. Does not implicitly {@link google.logging.v2.TailLogEntriesRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.TailLogEntriesRequest * @static * @param {google.logging.v2.ITailLogEntriesRequest} message TailLogEntriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ TailLogEntriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.resourceNames != null && message.resourceNames.length) for (var i = 0; i < message.resourceNames.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceNames[i]); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); if (message.bufferWindow != null && Object.hasOwnProperty.call(message, "bufferWindow")) $root.google.protobuf.Duration.encode(message.bufferWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified TailLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.TailLogEntriesRequest * @static * @param {google.logging.v2.ITailLogEntriesRequest} message TailLogEntriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ TailLogEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a TailLogEntriesRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.TailLogEntriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.TailLogEntriesRequest} TailLogEntriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TailLogEntriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.TailLogEntriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.resourceNames && message.resourceNames.length)) message.resourceNames = []; message.resourceNames.push(reader.string()); break; case 2: message.filter = reader.string(); break; case 3: message.bufferWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a TailLogEntriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.TailLogEntriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.TailLogEntriesRequest} TailLogEntriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TailLogEntriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a TailLogEntriesRequest message. * @function verify * @memberof google.logging.v2.TailLogEntriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ TailLogEntriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.resourceNames != null && message.hasOwnProperty("resourceNames")) { if (!Array.isArray(message.resourceNames)) return "resourceNames: array expected"; for (var i = 0; i < message.resourceNames.length; ++i) if (!$util.isString(message.resourceNames[i])) return "resourceNames: string[] expected"; } if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; if (message.bufferWindow != null && message.hasOwnProperty("bufferWindow")) { var error = $root.google.protobuf.Duration.verify(message.bufferWindow); if (error) return "bufferWindow." + error; } return null; }; /** * Creates a TailLogEntriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.TailLogEntriesRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.TailLogEntriesRequest} TailLogEntriesRequest */ TailLogEntriesRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.TailLogEntriesRequest) return object; var message = new $root.google.logging.v2.TailLogEntriesRequest(); if (object.resourceNames) { if (!Array.isArray(object.resourceNames)) throw TypeError(".google.logging.v2.TailLogEntriesRequest.resourceNames: array expected"); message.resourceNames = []; for (var i = 0; i < object.resourceNames.length; ++i) message.resourceNames[i] = String(object.resourceNames[i]); } if (object.filter != null) message.filter = String(object.filter); if (object.bufferWindow != null) { if (typeof object.bufferWindow !== "object") throw TypeError(".google.logging.v2.TailLogEntriesRequest.bufferWindow: object expected"); message.bufferWindow = $root.google.protobuf.Duration.fromObject(object.bufferWindow); } return message; }; /** * Creates a plain object from a TailLogEntriesRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.TailLogEntriesRequest * @static * @param {google.logging.v2.TailLogEntriesRequest} message TailLogEntriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ TailLogEntriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.resourceNames = []; if (options.defaults) { object.filter = ""; object.bufferWindow = null; } if (message.resourceNames && message.resourceNames.length) { object.resourceNames = []; for (var j = 0; j < message.resourceNames.length; ++j) object.resourceNames[j] = message.resourceNames[j]; } if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.bufferWindow != null && message.hasOwnProperty("bufferWindow")) object.bufferWindow = $root.google.protobuf.Duration.toObject(message.bufferWindow, options); return object; }; /** * Converts this TailLogEntriesRequest to JSON. * @function toJSON * @memberof google.logging.v2.TailLogEntriesRequest * @instance * @returns {Object.} JSON object */ TailLogEntriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return TailLogEntriesRequest; })(); v2.TailLogEntriesResponse = (function() { /** * Properties of a TailLogEntriesResponse. * @memberof google.logging.v2 * @interface ITailLogEntriesResponse * @property {Array.|null} [entries] TailLogEntriesResponse entries * @property {Array.|null} [suppressionInfo] TailLogEntriesResponse suppressionInfo */ /** * Constructs a new TailLogEntriesResponse. * @memberof google.logging.v2 * @classdesc Represents a TailLogEntriesResponse. * @implements ITailLogEntriesResponse * @constructor * @param {google.logging.v2.ITailLogEntriesResponse=} [properties] Properties to set */ function TailLogEntriesResponse(properties) { this.entries = []; this.suppressionInfo = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * TailLogEntriesResponse entries. * @member {Array.} entries * @memberof google.logging.v2.TailLogEntriesResponse * @instance */ TailLogEntriesResponse.prototype.entries = $util.emptyArray; /** * TailLogEntriesResponse suppressionInfo. * @member {Array.} suppressionInfo * @memberof google.logging.v2.TailLogEntriesResponse * @instance */ TailLogEntriesResponse.prototype.suppressionInfo = $util.emptyArray; /** * Creates a new TailLogEntriesResponse instance using the specified properties. * @function create * @memberof google.logging.v2.TailLogEntriesResponse * @static * @param {google.logging.v2.ITailLogEntriesResponse=} [properties] Properties to set * @returns {google.logging.v2.TailLogEntriesResponse} TailLogEntriesResponse instance */ TailLogEntriesResponse.create = function create(properties) { return new TailLogEntriesResponse(properties); }; /** * Encodes the specified TailLogEntriesResponse message. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.TailLogEntriesResponse * @static * @param {google.logging.v2.ITailLogEntriesResponse} message TailLogEntriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ TailLogEntriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.entries != null && message.entries.length) for (var i = 0; i < message.entries.length; ++i) $root.google.logging.v2.LogEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.suppressionInfo != null && message.suppressionInfo.length) for (var i = 0; i < message.suppressionInfo.length; ++i) $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.encode(message.suppressionInfo[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified TailLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.TailLogEntriesResponse * @static * @param {google.logging.v2.ITailLogEntriesResponse} message TailLogEntriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ TailLogEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a TailLogEntriesResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.TailLogEntriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.TailLogEntriesResponse} TailLogEntriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TailLogEntriesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.TailLogEntriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.entries && message.entries.length)) message.entries = []; message.entries.push($root.google.logging.v2.LogEntry.decode(reader, reader.uint32())); break; case 2: if (!(message.suppressionInfo && message.suppressionInfo.length)) message.suppressionInfo = []; message.suppressionInfo.push($root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a TailLogEntriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.TailLogEntriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.TailLogEntriesResponse} TailLogEntriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TailLogEntriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a TailLogEntriesResponse message. * @function verify * @memberof google.logging.v2.TailLogEntriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ TailLogEntriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.entries != null && message.hasOwnProperty("entries")) { if (!Array.isArray(message.entries)) return "entries: array expected"; for (var i = 0; i < message.entries.length; ++i) { var error = $root.google.logging.v2.LogEntry.verify(message.entries[i]); if (error) return "entries." + error; } } if (message.suppressionInfo != null && message.hasOwnProperty("suppressionInfo")) { if (!Array.isArray(message.suppressionInfo)) return "suppressionInfo: array expected"; for (var i = 0; i < message.suppressionInfo.length; ++i) { var error = $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.verify(message.suppressionInfo[i]); if (error) return "suppressionInfo." + error; } } return null; }; /** * Creates a TailLogEntriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.TailLogEntriesResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.TailLogEntriesResponse} TailLogEntriesResponse */ TailLogEntriesResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.TailLogEntriesResponse) return object; var message = new $root.google.logging.v2.TailLogEntriesResponse(); if (object.entries) { if (!Array.isArray(object.entries)) throw TypeError(".google.logging.v2.TailLogEntriesResponse.entries: array expected"); message.entries = []; for (var i = 0; i < object.entries.length; ++i) { if (typeof object.entries[i] !== "object") throw TypeError(".google.logging.v2.TailLogEntriesResponse.entries: object expected"); message.entries[i] = $root.google.logging.v2.LogEntry.fromObject(object.entries[i]); } } if (object.suppressionInfo) { if (!Array.isArray(object.suppressionInfo)) throw TypeError(".google.logging.v2.TailLogEntriesResponse.suppressionInfo: array expected"); message.suppressionInfo = []; for (var i = 0; i < object.suppressionInfo.length; ++i) { if (typeof object.suppressionInfo[i] !== "object") throw TypeError(".google.logging.v2.TailLogEntriesResponse.suppressionInfo: object expected"); message.suppressionInfo[i] = $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.fromObject(object.suppressionInfo[i]); } } return message; }; /** * Creates a plain object from a TailLogEntriesResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.TailLogEntriesResponse * @static * @param {google.logging.v2.TailLogEntriesResponse} message TailLogEntriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ TailLogEntriesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.entries = []; object.suppressionInfo = []; } if (message.entries && message.entries.length) { object.entries = []; for (var j = 0; j < message.entries.length; ++j) object.entries[j] = $root.google.logging.v2.LogEntry.toObject(message.entries[j], options); } if (message.suppressionInfo && message.suppressionInfo.length) { object.suppressionInfo = []; for (var j = 0; j < message.suppressionInfo.length; ++j) object.suppressionInfo[j] = $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.toObject(message.suppressionInfo[j], options); } return object; }; /** * Converts this TailLogEntriesResponse to JSON. * @function toJSON * @memberof google.logging.v2.TailLogEntriesResponse * @instance * @returns {Object.} JSON object */ TailLogEntriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; TailLogEntriesResponse.SuppressionInfo = (function() { /** * Properties of a SuppressionInfo. * @memberof google.logging.v2.TailLogEntriesResponse * @interface ISuppressionInfo * @property {google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason|null} [reason] SuppressionInfo reason * @property {number|null} [suppressedCount] SuppressionInfo suppressedCount */ /** * Constructs a new SuppressionInfo. * @memberof google.logging.v2.TailLogEntriesResponse * @classdesc Represents a SuppressionInfo. * @implements ISuppressionInfo * @constructor * @param {google.logging.v2.TailLogEntriesResponse.ISuppressionInfo=} [properties] Properties to set */ function SuppressionInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SuppressionInfo reason. * @member {google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason} reason * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @instance */ SuppressionInfo.prototype.reason = 0; /** * SuppressionInfo suppressedCount. * @member {number} suppressedCount * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @instance */ SuppressionInfo.prototype.suppressedCount = 0; /** * Creates a new SuppressionInfo instance using the specified properties. * @function create * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @static * @param {google.logging.v2.TailLogEntriesResponse.ISuppressionInfo=} [properties] Properties to set * @returns {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} SuppressionInfo instance */ SuppressionInfo.create = function create(properties) { return new SuppressionInfo(properties); }; /** * Encodes the specified SuppressionInfo message. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.SuppressionInfo.verify|verify} messages. * @function encode * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @static * @param {google.logging.v2.TailLogEntriesResponse.ISuppressionInfo} message SuppressionInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SuppressionInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason); if (message.suppressedCount != null && Object.hasOwnProperty.call(message, "suppressedCount")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.suppressedCount); return writer; }; /** * Encodes the specified SuppressionInfo message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.SuppressionInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @static * @param {google.logging.v2.TailLogEntriesResponse.ISuppressionInfo} message SuppressionInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SuppressionInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SuppressionInfo message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} SuppressionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SuppressionInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.reason = reader.int32(); break; case 2: message.suppressedCount = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SuppressionInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} SuppressionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SuppressionInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SuppressionInfo message. * @function verify * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SuppressionInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.reason != null && message.hasOwnProperty("reason")) switch (message.reason) { default: return "reason: enum value expected"; case 0: case 1: case 2: break; } if (message.suppressedCount != null && message.hasOwnProperty("suppressedCount")) if (!$util.isInteger(message.suppressedCount)) return "suppressedCount: integer expected"; return null; }; /** * Creates a SuppressionInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @static * @param {Object.} object Plain object * @returns {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} SuppressionInfo */ SuppressionInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo) return object; var message = new $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo(); switch (object.reason) { case "REASON_UNSPECIFIED": case 0: message.reason = 0; break; case "RATE_LIMIT": case 1: message.reason = 1; break; case "NOT_CONSUMED": case 2: message.reason = 2; break; } if (object.suppressedCount != null) message.suppressedCount = object.suppressedCount | 0; return message; }; /** * Creates a plain object from a SuppressionInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @static * @param {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} message SuppressionInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ SuppressionInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.reason = options.enums === String ? "REASON_UNSPECIFIED" : 0; object.suppressedCount = 0; } if (message.reason != null && message.hasOwnProperty("reason")) object.reason = options.enums === String ? $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason[message.reason] : message.reason; if (message.suppressedCount != null && message.hasOwnProperty("suppressedCount")) object.suppressedCount = message.suppressedCount; return object; }; /** * Converts this SuppressionInfo to JSON. * @function toJSON * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo * @instance * @returns {Object.} JSON object */ SuppressionInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Reason enum. * @name google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason * @enum {number} * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value * @property {number} RATE_LIMIT=1 RATE_LIMIT value * @property {number} NOT_CONSUMED=2 NOT_CONSUMED value */ SuppressionInfo.Reason = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; values[valuesById[1] = "RATE_LIMIT"] = 1; values[valuesById[2] = "NOT_CONSUMED"] = 2; return values; })(); return SuppressionInfo; })(); return TailLogEntriesResponse; })(); v2.ConfigServiceV2 = (function() { /** * Constructs a new ConfigServiceV2 service. * @memberof google.logging.v2 * @classdesc Represents a ConfigServiceV2 * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function ConfigServiceV2(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (ConfigServiceV2.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ConfigServiceV2; /** * Creates new ConfigServiceV2 service using the specified rpc implementation. * @function create * @memberof google.logging.v2.ConfigServiceV2 * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {ConfigServiceV2} RPC service. Useful where requests and/or responses are streamed. */ ConfigServiceV2.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#listBuckets}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef ListBucketsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.ListBucketsResponse} [response] ListBucketsResponse */ /** * Calls ListBuckets. * @function listBuckets * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IListBucketsRequest} request ListBucketsRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.ListBucketsCallback} callback Node-style callback called with the error, if any, and ListBucketsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.listBuckets = function listBuckets(request, callback) { return this.rpcCall(listBuckets, $root.google.logging.v2.ListBucketsRequest, $root.google.logging.v2.ListBucketsResponse, request, callback); }, "name", { value: "ListBuckets" }); /** * Calls ListBuckets. * @function listBuckets * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IListBucketsRequest} request ListBucketsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#getBucket}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef GetBucketCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogBucket} [response] LogBucket */ /** * Calls GetBucket. * @function getBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetBucketRequest} request GetBucketRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.GetBucketCallback} callback Node-style callback called with the error, if any, and LogBucket * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.getBucket = function getBucket(request, callback) { return this.rpcCall(getBucket, $root.google.logging.v2.GetBucketRequest, $root.google.logging.v2.LogBucket, request, callback); }, "name", { value: "GetBucket" }); /** * Calls GetBucket. * @function getBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetBucketRequest} request GetBucketRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#createBucket}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef CreateBucketCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogBucket} [response] LogBucket */ /** * Calls CreateBucket. * @function createBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.ICreateBucketRequest} request CreateBucketRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.CreateBucketCallback} callback Node-style callback called with the error, if any, and LogBucket * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.createBucket = function createBucket(request, callback) { return this.rpcCall(createBucket, $root.google.logging.v2.CreateBucketRequest, $root.google.logging.v2.LogBucket, request, callback); }, "name", { value: "CreateBucket" }); /** * Calls CreateBucket. * @function createBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.ICreateBucketRequest} request CreateBucketRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#updateBucket}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef UpdateBucketCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogBucket} [response] LogBucket */ /** * Calls UpdateBucket. * @function updateBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateBucketRequest} request UpdateBucketRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.UpdateBucketCallback} callback Node-style callback called with the error, if any, and LogBucket * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.updateBucket = function updateBucket(request, callback) { return this.rpcCall(updateBucket, $root.google.logging.v2.UpdateBucketRequest, $root.google.logging.v2.LogBucket, request, callback); }, "name", { value: "UpdateBucket" }); /** * Calls UpdateBucket. * @function updateBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateBucketRequest} request UpdateBucketRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#deleteBucket}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef DeleteBucketCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls DeleteBucket. * @function deleteBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IDeleteBucketRequest} request DeleteBucketRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.DeleteBucketCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.deleteBucket = function deleteBucket(request, callback) { return this.rpcCall(deleteBucket, $root.google.logging.v2.DeleteBucketRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteBucket" }); /** * Calls DeleteBucket. * @function deleteBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IDeleteBucketRequest} request DeleteBucketRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#undeleteBucket}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef UndeleteBucketCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls UndeleteBucket. * @function undeleteBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUndeleteBucketRequest} request UndeleteBucketRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.UndeleteBucketCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.undeleteBucket = function undeleteBucket(request, callback) { return this.rpcCall(undeleteBucket, $root.google.logging.v2.UndeleteBucketRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "UndeleteBucket" }); /** * Calls UndeleteBucket. * @function undeleteBucket * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUndeleteBucketRequest} request UndeleteBucketRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#listViews}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef ListViewsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.ListViewsResponse} [response] ListViewsResponse */ /** * Calls ListViews. * @function listViews * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IListViewsRequest} request ListViewsRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.ListViewsCallback} callback Node-style callback called with the error, if any, and ListViewsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.listViews = function listViews(request, callback) { return this.rpcCall(listViews, $root.google.logging.v2.ListViewsRequest, $root.google.logging.v2.ListViewsResponse, request, callback); }, "name", { value: "ListViews" }); /** * Calls ListViews. * @function listViews * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IListViewsRequest} request ListViewsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#getView}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef GetViewCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogView} [response] LogView */ /** * Calls GetView. * @function getView * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetViewRequest} request GetViewRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.GetViewCallback} callback Node-style callback called with the error, if any, and LogView * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.getView = function getView(request, callback) { return this.rpcCall(getView, $root.google.logging.v2.GetViewRequest, $root.google.logging.v2.LogView, request, callback); }, "name", { value: "GetView" }); /** * Calls GetView. * @function getView * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetViewRequest} request GetViewRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#createView}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef CreateViewCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogView} [response] LogView */ /** * Calls CreateView. * @function createView * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.ICreateViewRequest} request CreateViewRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.CreateViewCallback} callback Node-style callback called with the error, if any, and LogView * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.createView = function createView(request, callback) { return this.rpcCall(createView, $root.google.logging.v2.CreateViewRequest, $root.google.logging.v2.LogView, request, callback); }, "name", { value: "CreateView" }); /** * Calls CreateView. * @function createView * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.ICreateViewRequest} request CreateViewRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#updateView}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef UpdateViewCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogView} [response] LogView */ /** * Calls UpdateView. * @function updateView * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateViewRequest} request UpdateViewRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.UpdateViewCallback} callback Node-style callback called with the error, if any, and LogView * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.updateView = function updateView(request, callback) { return this.rpcCall(updateView, $root.google.logging.v2.UpdateViewRequest, $root.google.logging.v2.LogView, request, callback); }, "name", { value: "UpdateView" }); /** * Calls UpdateView. * @function updateView * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateViewRequest} request UpdateViewRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#deleteView}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef DeleteViewCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls DeleteView. * @function deleteView * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IDeleteViewRequest} request DeleteViewRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.DeleteViewCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.deleteView = function deleteView(request, callback) { return this.rpcCall(deleteView, $root.google.logging.v2.DeleteViewRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteView" }); /** * Calls DeleteView. * @function deleteView * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IDeleteViewRequest} request DeleteViewRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#listSinks}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef ListSinksCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.ListSinksResponse} [response] ListSinksResponse */ /** * Calls ListSinks. * @function listSinks * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IListSinksRequest} request ListSinksRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.ListSinksCallback} callback Node-style callback called with the error, if any, and ListSinksResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.listSinks = function listSinks(request, callback) { return this.rpcCall(listSinks, $root.google.logging.v2.ListSinksRequest, $root.google.logging.v2.ListSinksResponse, request, callback); }, "name", { value: "ListSinks" }); /** * Calls ListSinks. * @function listSinks * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IListSinksRequest} request ListSinksRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#getSink}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef GetSinkCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogSink} [response] LogSink */ /** * Calls GetSink. * @function getSink * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetSinkRequest} request GetSinkRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.GetSinkCallback} callback Node-style callback called with the error, if any, and LogSink * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.getSink = function getSink(request, callback) { return this.rpcCall(getSink, $root.google.logging.v2.GetSinkRequest, $root.google.logging.v2.LogSink, request, callback); }, "name", { value: "GetSink" }); /** * Calls GetSink. * @function getSink * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetSinkRequest} request GetSinkRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#createSink}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef CreateSinkCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogSink} [response] LogSink */ /** * Calls CreateSink. * @function createSink * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.ICreateSinkRequest} request CreateSinkRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.CreateSinkCallback} callback Node-style callback called with the error, if any, and LogSink * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.createSink = function createSink(request, callback) { return this.rpcCall(createSink, $root.google.logging.v2.CreateSinkRequest, $root.google.logging.v2.LogSink, request, callback); }, "name", { value: "CreateSink" }); /** * Calls CreateSink. * @function createSink * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.ICreateSinkRequest} request CreateSinkRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#updateSink}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef UpdateSinkCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogSink} [response] LogSink */ /** * Calls UpdateSink. * @function updateSink * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateSinkRequest} request UpdateSinkRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.UpdateSinkCallback} callback Node-style callback called with the error, if any, and LogSink * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.updateSink = function updateSink(request, callback) { return this.rpcCall(updateSink, $root.google.logging.v2.UpdateSinkRequest, $root.google.logging.v2.LogSink, request, callback); }, "name", { value: "UpdateSink" }); /** * Calls UpdateSink. * @function updateSink * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateSinkRequest} request UpdateSinkRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#deleteSink}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef DeleteSinkCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls DeleteSink. * @function deleteSink * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IDeleteSinkRequest} request DeleteSinkRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.DeleteSinkCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.deleteSink = function deleteSink(request, callback) { return this.rpcCall(deleteSink, $root.google.logging.v2.DeleteSinkRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteSink" }); /** * Calls DeleteSink. * @function deleteSink * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IDeleteSinkRequest} request DeleteSinkRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#listExclusions}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef ListExclusionsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.ListExclusionsResponse} [response] ListExclusionsResponse */ /** * Calls ListExclusions. * @function listExclusions * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IListExclusionsRequest} request ListExclusionsRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.ListExclusionsCallback} callback Node-style callback called with the error, if any, and ListExclusionsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.listExclusions = function listExclusions(request, callback) { return this.rpcCall(listExclusions, $root.google.logging.v2.ListExclusionsRequest, $root.google.logging.v2.ListExclusionsResponse, request, callback); }, "name", { value: "ListExclusions" }); /** * Calls ListExclusions. * @function listExclusions * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IListExclusionsRequest} request ListExclusionsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#getExclusion}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef GetExclusionCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogExclusion} [response] LogExclusion */ /** * Calls GetExclusion. * @function getExclusion * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetExclusionRequest} request GetExclusionRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.GetExclusionCallback} callback Node-style callback called with the error, if any, and LogExclusion * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.getExclusion = function getExclusion(request, callback) { return this.rpcCall(getExclusion, $root.google.logging.v2.GetExclusionRequest, $root.google.logging.v2.LogExclusion, request, callback); }, "name", { value: "GetExclusion" }); /** * Calls GetExclusion. * @function getExclusion * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetExclusionRequest} request GetExclusionRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#createExclusion}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef CreateExclusionCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogExclusion} [response] LogExclusion */ /** * Calls CreateExclusion. * @function createExclusion * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.ICreateExclusionRequest} request CreateExclusionRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.CreateExclusionCallback} callback Node-style callback called with the error, if any, and LogExclusion * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.createExclusion = function createExclusion(request, callback) { return this.rpcCall(createExclusion, $root.google.logging.v2.CreateExclusionRequest, $root.google.logging.v2.LogExclusion, request, callback); }, "name", { value: "CreateExclusion" }); /** * Calls CreateExclusion. * @function createExclusion * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.ICreateExclusionRequest} request CreateExclusionRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#updateExclusion}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef UpdateExclusionCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogExclusion} [response] LogExclusion */ /** * Calls UpdateExclusion. * @function updateExclusion * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateExclusionRequest} request UpdateExclusionRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.UpdateExclusionCallback} callback Node-style callback called with the error, if any, and LogExclusion * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.updateExclusion = function updateExclusion(request, callback) { return this.rpcCall(updateExclusion, $root.google.logging.v2.UpdateExclusionRequest, $root.google.logging.v2.LogExclusion, request, callback); }, "name", { value: "UpdateExclusion" }); /** * Calls UpdateExclusion. * @function updateExclusion * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateExclusionRequest} request UpdateExclusionRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#deleteExclusion}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef DeleteExclusionCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls DeleteExclusion. * @function deleteExclusion * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IDeleteExclusionRequest} request DeleteExclusionRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.DeleteExclusionCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.deleteExclusion = function deleteExclusion(request, callback) { return this.rpcCall(deleteExclusion, $root.google.logging.v2.DeleteExclusionRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteExclusion" }); /** * Calls DeleteExclusion. * @function deleteExclusion * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IDeleteExclusionRequest} request DeleteExclusionRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#getCmekSettings}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef GetCmekSettingsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.CmekSettings} [response] CmekSettings */ /** * Calls GetCmekSettings. * @function getCmekSettings * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetCmekSettingsRequest} request GetCmekSettingsRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.GetCmekSettingsCallback} callback Node-style callback called with the error, if any, and CmekSettings * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.getCmekSettings = function getCmekSettings(request, callback) { return this.rpcCall(getCmekSettings, $root.google.logging.v2.GetCmekSettingsRequest, $root.google.logging.v2.CmekSettings, request, callback); }, "name", { value: "GetCmekSettings" }); /** * Calls GetCmekSettings. * @function getCmekSettings * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IGetCmekSettingsRequest} request GetCmekSettingsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.ConfigServiceV2#updateCmekSettings}. * @memberof google.logging.v2.ConfigServiceV2 * @typedef UpdateCmekSettingsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.CmekSettings} [response] CmekSettings */ /** * Calls UpdateCmekSettings. * @function updateCmekSettings * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateCmekSettingsRequest} request UpdateCmekSettingsRequest message or plain object * @param {google.logging.v2.ConfigServiceV2.UpdateCmekSettingsCallback} callback Node-style callback called with the error, if any, and CmekSettings * @returns {undefined} * @variation 1 */ Object.defineProperty(ConfigServiceV2.prototype.updateCmekSettings = function updateCmekSettings(request, callback) { return this.rpcCall(updateCmekSettings, $root.google.logging.v2.UpdateCmekSettingsRequest, $root.google.logging.v2.CmekSettings, request, callback); }, "name", { value: "UpdateCmekSettings" }); /** * Calls UpdateCmekSettings. * @function updateCmekSettings * @memberof google.logging.v2.ConfigServiceV2 * @instance * @param {google.logging.v2.IUpdateCmekSettingsRequest} request UpdateCmekSettingsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ return ConfigServiceV2; })(); v2.LogBucket = (function() { /** * Properties of a LogBucket. * @memberof google.logging.v2 * @interface ILogBucket * @property {string|null} [name] LogBucket name * @property {string|null} [description] LogBucket description * @property {google.protobuf.ITimestamp|null} [createTime] LogBucket createTime * @property {google.protobuf.ITimestamp|null} [updateTime] LogBucket updateTime * @property {number|null} [retentionDays] LogBucket retentionDays * @property {boolean|null} [locked] LogBucket locked * @property {google.logging.v2.LifecycleState|null} [lifecycleState] LogBucket lifecycleState */ /** * Constructs a new LogBucket. * @memberof google.logging.v2 * @classdesc Represents a LogBucket. * @implements ILogBucket * @constructor * @param {google.logging.v2.ILogBucket=} [properties] Properties to set */ function LogBucket(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LogBucket name. * @member {string} name * @memberof google.logging.v2.LogBucket * @instance */ LogBucket.prototype.name = ""; /** * LogBucket description. * @member {string} description * @memberof google.logging.v2.LogBucket * @instance */ LogBucket.prototype.description = ""; /** * LogBucket createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime * @memberof google.logging.v2.LogBucket * @instance */ LogBucket.prototype.createTime = null; /** * LogBucket updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime * @memberof google.logging.v2.LogBucket * @instance */ LogBucket.prototype.updateTime = null; /** * LogBucket retentionDays. * @member {number} retentionDays * @memberof google.logging.v2.LogBucket * @instance */ LogBucket.prototype.retentionDays = 0; /** * LogBucket locked. * @member {boolean} locked * @memberof google.logging.v2.LogBucket * @instance */ LogBucket.prototype.locked = false; /** * LogBucket lifecycleState. * @member {google.logging.v2.LifecycleState} lifecycleState * @memberof google.logging.v2.LogBucket * @instance */ LogBucket.prototype.lifecycleState = 0; /** * Creates a new LogBucket instance using the specified properties. * @function create * @memberof google.logging.v2.LogBucket * @static * @param {google.logging.v2.ILogBucket=} [properties] Properties to set * @returns {google.logging.v2.LogBucket} LogBucket instance */ LogBucket.create = function create(properties) { return new LogBucket(properties); }; /** * Encodes the specified LogBucket message. Does not implicitly {@link google.logging.v2.LogBucket.verify|verify} messages. * @function encode * @memberof google.logging.v2.LogBucket * @static * @param {google.logging.v2.ILogBucket} message LogBucket message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogBucket.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.locked); if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.retentionDays); if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.lifecycleState); return writer; }; /** * Encodes the specified LogBucket message, length delimited. Does not implicitly {@link google.logging.v2.LogBucket.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.LogBucket * @static * @param {google.logging.v2.ILogBucket} message LogBucket message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogBucket.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LogBucket message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.LogBucket * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.LogBucket} LogBucket * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogBucket.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogBucket(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 3: message.description = reader.string(); break; case 4: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 5: message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 11: message.retentionDays = reader.int32(); break; case 9: message.locked = reader.bool(); break; case 12: message.lifecycleState = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LogBucket message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.LogBucket * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.LogBucket} LogBucket * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogBucket.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LogBucket message. * @function verify * @memberof google.logging.v2.LogBucket * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LogBucket.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) return "createTime." + error; } if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) return "updateTime." + error; } if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) if (!$util.isInteger(message.retentionDays)) return "retentionDays: integer expected"; if (message.locked != null && message.hasOwnProperty("locked")) if (typeof message.locked !== "boolean") return "locked: boolean expected"; if (message.lifecycleState != null && message.hasOwnProperty("lifecycleState")) switch (message.lifecycleState) { default: return "lifecycleState: enum value expected"; case 0: case 1: case 2: break; } return null; }; /** * Creates a LogBucket message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.LogBucket * @static * @param {Object.} object Plain object * @returns {google.logging.v2.LogBucket} LogBucket */ LogBucket.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.LogBucket) return object; var message = new $root.google.logging.v2.LogBucket(); if (object.name != null) message.name = String(object.name); if (object.description != null) message.description = String(object.description); if (object.createTime != null) { if (typeof object.createTime !== "object") throw TypeError(".google.logging.v2.LogBucket.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.updateTime != null) { if (typeof object.updateTime !== "object") throw TypeError(".google.logging.v2.LogBucket.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } if (object.retentionDays != null) message.retentionDays = object.retentionDays | 0; if (object.locked != null) message.locked = Boolean(object.locked); switch (object.lifecycleState) { case "LIFECYCLE_STATE_UNSPECIFIED": case 0: message.lifecycleState = 0; break; case "ACTIVE": case 1: message.lifecycleState = 1; break; case "DELETE_REQUESTED": case 2: message.lifecycleState = 2; break; } return message; }; /** * Creates a plain object from a LogBucket message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.LogBucket * @static * @param {google.logging.v2.LogBucket} message LogBucket * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LogBucket.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.description = ""; object.createTime = null; object.updateTime = null; object.locked = false; object.retentionDays = 0; object.lifecycleState = options.enums === String ? "LIFECYCLE_STATE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.locked != null && message.hasOwnProperty("locked")) object.locked = message.locked; if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) object.retentionDays = message.retentionDays; if (message.lifecycleState != null && message.hasOwnProperty("lifecycleState")) object.lifecycleState = options.enums === String ? $root.google.logging.v2.LifecycleState[message.lifecycleState] : message.lifecycleState; return object; }; /** * Converts this LogBucket to JSON. * @function toJSON * @memberof google.logging.v2.LogBucket * @instance * @returns {Object.} JSON object */ LogBucket.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return LogBucket; })(); /** * LifecycleState enum. * @name google.logging.v2.LifecycleState * @enum {number} * @property {number} LIFECYCLE_STATE_UNSPECIFIED=0 LIFECYCLE_STATE_UNSPECIFIED value * @property {number} ACTIVE=1 ACTIVE value * @property {number} DELETE_REQUESTED=2 DELETE_REQUESTED value */ v2.LifecycleState = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "LIFECYCLE_STATE_UNSPECIFIED"] = 0; values[valuesById[1] = "ACTIVE"] = 1; values[valuesById[2] = "DELETE_REQUESTED"] = 2; return values; })(); v2.LogView = (function() { /** * Properties of a LogView. * @memberof google.logging.v2 * @interface ILogView * @property {string|null} [name] LogView name * @property {string|null} [description] LogView description * @property {google.protobuf.ITimestamp|null} [createTime] LogView createTime * @property {google.protobuf.ITimestamp|null} [updateTime] LogView updateTime * @property {string|null} [filter] LogView filter */ /** * Constructs a new LogView. * @memberof google.logging.v2 * @classdesc Represents a LogView. * @implements ILogView * @constructor * @param {google.logging.v2.ILogView=} [properties] Properties to set */ function LogView(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LogView name. * @member {string} name * @memberof google.logging.v2.LogView * @instance */ LogView.prototype.name = ""; /** * LogView description. * @member {string} description * @memberof google.logging.v2.LogView * @instance */ LogView.prototype.description = ""; /** * LogView createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime * @memberof google.logging.v2.LogView * @instance */ LogView.prototype.createTime = null; /** * LogView updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime * @memberof google.logging.v2.LogView * @instance */ LogView.prototype.updateTime = null; /** * LogView filter. * @member {string} filter * @memberof google.logging.v2.LogView * @instance */ LogView.prototype.filter = ""; /** * Creates a new LogView instance using the specified properties. * @function create * @memberof google.logging.v2.LogView * @static * @param {google.logging.v2.ILogView=} [properties] Properties to set * @returns {google.logging.v2.LogView} LogView instance */ LogView.create = function create(properties) { return new LogView(properties); }; /** * Encodes the specified LogView message. Does not implicitly {@link google.logging.v2.LogView.verify|verify} messages. * @function encode * @memberof google.logging.v2.LogView * @static * @param {google.logging.v2.ILogView} message LogView message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogView.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.filter); return writer; }; /** * Encodes the specified LogView message, length delimited. Does not implicitly {@link google.logging.v2.LogView.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.LogView * @static * @param {google.logging.v2.ILogView} message LogView message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogView.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LogView message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.LogView * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.LogView} LogView * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogView.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogView(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 3: message.description = reader.string(); break; case 4: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 5: message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 7: message.filter = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LogView message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.LogView * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.LogView} LogView * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogView.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LogView message. * @function verify * @memberof google.logging.v2.LogView * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LogView.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) return "createTime." + error; } if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) return "updateTime." + error; } if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; return null; }; /** * Creates a LogView message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.LogView * @static * @param {Object.} object Plain object * @returns {google.logging.v2.LogView} LogView */ LogView.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.LogView) return object; var message = new $root.google.logging.v2.LogView(); if (object.name != null) message.name = String(object.name); if (object.description != null) message.description = String(object.description); if (object.createTime != null) { if (typeof object.createTime !== "object") throw TypeError(".google.logging.v2.LogView.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.updateTime != null) { if (typeof object.updateTime !== "object") throw TypeError(".google.logging.v2.LogView.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } if (object.filter != null) message.filter = String(object.filter); return message; }; /** * Creates a plain object from a LogView message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.LogView * @static * @param {google.logging.v2.LogView} message LogView * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LogView.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.description = ""; object.createTime = null; object.updateTime = null; object.filter = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; return object; }; /** * Converts this LogView to JSON. * @function toJSON * @memberof google.logging.v2.LogView * @instance * @returns {Object.} JSON object */ LogView.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return LogView; })(); v2.LogSink = (function() { /** * Properties of a LogSink. * @memberof google.logging.v2 * @interface ILogSink * @property {string|null} [name] LogSink name * @property {string|null} [destination] LogSink destination * @property {string|null} [filter] LogSink filter * @property {string|null} [description] LogSink description * @property {boolean|null} [disabled] LogSink disabled * @property {Array.|null} [exclusions] LogSink exclusions * @property {google.logging.v2.LogSink.VersionFormat|null} [outputVersionFormat] LogSink outputVersionFormat * @property {string|null} [writerIdentity] LogSink writerIdentity * @property {boolean|null} [includeChildren] LogSink includeChildren * @property {google.logging.v2.IBigQueryOptions|null} [bigqueryOptions] LogSink bigqueryOptions * @property {google.protobuf.ITimestamp|null} [createTime] LogSink createTime * @property {google.protobuf.ITimestamp|null} [updateTime] LogSink updateTime */ /** * Constructs a new LogSink. * @memberof google.logging.v2 * @classdesc Represents a LogSink. * @implements ILogSink * @constructor * @param {google.logging.v2.ILogSink=} [properties] Properties to set */ function LogSink(properties) { this.exclusions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LogSink name. * @member {string} name * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.name = ""; /** * LogSink destination. * @member {string} destination * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.destination = ""; /** * LogSink filter. * @member {string} filter * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.filter = ""; /** * LogSink description. * @member {string} description * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.description = ""; /** * LogSink disabled. * @member {boolean} disabled * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.disabled = false; /** * LogSink exclusions. * @member {Array.} exclusions * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.exclusions = $util.emptyArray; /** * LogSink outputVersionFormat. * @member {google.logging.v2.LogSink.VersionFormat} outputVersionFormat * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.outputVersionFormat = 0; /** * LogSink writerIdentity. * @member {string} writerIdentity * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.writerIdentity = ""; /** * LogSink includeChildren. * @member {boolean} includeChildren * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.includeChildren = false; /** * LogSink bigqueryOptions. * @member {google.logging.v2.IBigQueryOptions|null|undefined} bigqueryOptions * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.bigqueryOptions = null; /** * LogSink createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.createTime = null; /** * LogSink updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime * @memberof google.logging.v2.LogSink * @instance */ LogSink.prototype.updateTime = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * LogSink options. * @member {"bigqueryOptions"|undefined} options * @memberof google.logging.v2.LogSink * @instance */ Object.defineProperty(LogSink.prototype, "options", { get: $util.oneOfGetter($oneOfFields = ["bigqueryOptions"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new LogSink instance using the specified properties. * @function create * @memberof google.logging.v2.LogSink * @static * @param {google.logging.v2.ILogSink=} [properties] Properties to set * @returns {google.logging.v2.LogSink} LogSink instance */ LogSink.create = function create(properties) { return new LogSink(properties); }; /** * Encodes the specified LogSink message. Does not implicitly {@link google.logging.v2.LogSink.verify|verify} messages. * @function encode * @memberof google.logging.v2.LogSink * @static * @param {google.logging.v2.ILogSink} message LogSink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogSink.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.destination); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); if (message.outputVersionFormat != null && Object.hasOwnProperty.call(message, "outputVersionFormat")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.outputVersionFormat); if (message.writerIdentity != null && Object.hasOwnProperty.call(message, "writerIdentity")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.writerIdentity); if (message.includeChildren != null && Object.hasOwnProperty.call(message, "includeChildren")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.includeChildren); if (message.bigqueryOptions != null && Object.hasOwnProperty.call(message, "bigqueryOptions")) $root.google.logging.v2.BigQueryOptions.encode(message.bigqueryOptions, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.exclusions != null && message.exclusions.length) for (var i = 0; i < message.exclusions.length; ++i) $root.google.logging.v2.LogExclusion.encode(message.exclusions[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 18, wireType 2 =*/146).string(message.description); if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) writer.uint32(/* id 19, wireType 0 =*/152).bool(message.disabled); return writer; }; /** * Encodes the specified LogSink message, length delimited. Does not implicitly {@link google.logging.v2.LogSink.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.LogSink * @static * @param {google.logging.v2.ILogSink} message LogSink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogSink.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LogSink message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.LogSink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.LogSink} LogSink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogSink.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogSink(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 3: message.destination = reader.string(); break; case 5: message.filter = reader.string(); break; case 18: message.description = reader.string(); break; case 19: message.disabled = reader.bool(); break; case 16: if (!(message.exclusions && message.exclusions.length)) message.exclusions = []; message.exclusions.push($root.google.logging.v2.LogExclusion.decode(reader, reader.uint32())); break; case 6: message.outputVersionFormat = reader.int32(); break; case 8: message.writerIdentity = reader.string(); break; case 9: message.includeChildren = reader.bool(); break; case 12: message.bigqueryOptions = $root.google.logging.v2.BigQueryOptions.decode(reader, reader.uint32()); break; case 13: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 14: message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LogSink message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.LogSink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.LogSink} LogSink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogSink.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LogSink message. * @function verify * @memberof google.logging.v2.LogSink * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LogSink.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.destination != null && message.hasOwnProperty("destination")) if (!$util.isString(message.destination)) return "destination: string expected"; if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; if (message.disabled != null && message.hasOwnProperty("disabled")) if (typeof message.disabled !== "boolean") return "disabled: boolean expected"; if (message.exclusions != null && message.hasOwnProperty("exclusions")) { if (!Array.isArray(message.exclusions)) return "exclusions: array expected"; for (var i = 0; i < message.exclusions.length; ++i) { var error = $root.google.logging.v2.LogExclusion.verify(message.exclusions[i]); if (error) return "exclusions." + error; } } if (message.outputVersionFormat != null && message.hasOwnProperty("outputVersionFormat")) switch (message.outputVersionFormat) { default: return "outputVersionFormat: enum value expected"; case 0: case 1: case 2: break; } if (message.writerIdentity != null && message.hasOwnProperty("writerIdentity")) if (!$util.isString(message.writerIdentity)) return "writerIdentity: string expected"; if (message.includeChildren != null && message.hasOwnProperty("includeChildren")) if (typeof message.includeChildren !== "boolean") return "includeChildren: boolean expected"; if (message.bigqueryOptions != null && message.hasOwnProperty("bigqueryOptions")) { properties.options = 1; { var error = $root.google.logging.v2.BigQueryOptions.verify(message.bigqueryOptions); if (error) return "bigqueryOptions." + error; } } if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) return "createTime." + error; } if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) return "updateTime." + error; } return null; }; /** * Creates a LogSink message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.LogSink * @static * @param {Object.} object Plain object * @returns {google.logging.v2.LogSink} LogSink */ LogSink.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.LogSink) return object; var message = new $root.google.logging.v2.LogSink(); if (object.name != null) message.name = String(object.name); if (object.destination != null) message.destination = String(object.destination); if (object.filter != null) message.filter = String(object.filter); if (object.description != null) message.description = String(object.description); if (object.disabled != null) message.disabled = Boolean(object.disabled); if (object.exclusions) { if (!Array.isArray(object.exclusions)) throw TypeError(".google.logging.v2.LogSink.exclusions: array expected"); message.exclusions = []; for (var i = 0; i < object.exclusions.length; ++i) { if (typeof object.exclusions[i] !== "object") throw TypeError(".google.logging.v2.LogSink.exclusions: object expected"); message.exclusions[i] = $root.google.logging.v2.LogExclusion.fromObject(object.exclusions[i]); } } switch (object.outputVersionFormat) { case "VERSION_FORMAT_UNSPECIFIED": case 0: message.outputVersionFormat = 0; break; case "V2": case 1: message.outputVersionFormat = 1; break; case "V1": case 2: message.outputVersionFormat = 2; break; } if (object.writerIdentity != null) message.writerIdentity = String(object.writerIdentity); if (object.includeChildren != null) message.includeChildren = Boolean(object.includeChildren); if (object.bigqueryOptions != null) { if (typeof object.bigqueryOptions !== "object") throw TypeError(".google.logging.v2.LogSink.bigqueryOptions: object expected"); message.bigqueryOptions = $root.google.logging.v2.BigQueryOptions.fromObject(object.bigqueryOptions); } if (object.createTime != null) { if (typeof object.createTime !== "object") throw TypeError(".google.logging.v2.LogSink.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.updateTime != null) { if (typeof object.updateTime !== "object") throw TypeError(".google.logging.v2.LogSink.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } return message; }; /** * Creates a plain object from a LogSink message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.LogSink * @static * @param {google.logging.v2.LogSink} message LogSink * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LogSink.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.exclusions = []; if (options.defaults) { object.name = ""; object.destination = ""; object.filter = ""; object.outputVersionFormat = options.enums === String ? "VERSION_FORMAT_UNSPECIFIED" : 0; object.writerIdentity = ""; object.includeChildren = false; object.createTime = null; object.updateTime = null; object.description = ""; object.disabled = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.destination != null && message.hasOwnProperty("destination")) object.destination = message.destination; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.outputVersionFormat != null && message.hasOwnProperty("outputVersionFormat")) object.outputVersionFormat = options.enums === String ? $root.google.logging.v2.LogSink.VersionFormat[message.outputVersionFormat] : message.outputVersionFormat; if (message.writerIdentity != null && message.hasOwnProperty("writerIdentity")) object.writerIdentity = message.writerIdentity; if (message.includeChildren != null && message.hasOwnProperty("includeChildren")) object.includeChildren = message.includeChildren; if (message.bigqueryOptions != null && message.hasOwnProperty("bigqueryOptions")) { object.bigqueryOptions = $root.google.logging.v2.BigQueryOptions.toObject(message.bigqueryOptions, options); if (options.oneofs) object.options = "bigqueryOptions"; } if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.exclusions && message.exclusions.length) { object.exclusions = []; for (var j = 0; j < message.exclusions.length; ++j) object.exclusions[j] = $root.google.logging.v2.LogExclusion.toObject(message.exclusions[j], options); } if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.disabled != null && message.hasOwnProperty("disabled")) object.disabled = message.disabled; return object; }; /** * Converts this LogSink to JSON. * @function toJSON * @memberof google.logging.v2.LogSink * @instance * @returns {Object.} JSON object */ LogSink.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * VersionFormat enum. * @name google.logging.v2.LogSink.VersionFormat * @enum {number} * @property {number} VERSION_FORMAT_UNSPECIFIED=0 VERSION_FORMAT_UNSPECIFIED value * @property {number} V2=1 V2 value * @property {number} V1=2 V1 value */ LogSink.VersionFormat = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "VERSION_FORMAT_UNSPECIFIED"] = 0; values[valuesById[1] = "V2"] = 1; values[valuesById[2] = "V1"] = 2; return values; })(); return LogSink; })(); v2.BigQueryOptions = (function() { /** * Properties of a BigQueryOptions. * @memberof google.logging.v2 * @interface IBigQueryOptions * @property {boolean|null} [usePartitionedTables] BigQueryOptions usePartitionedTables * @property {boolean|null} [usesTimestampColumnPartitioning] BigQueryOptions usesTimestampColumnPartitioning */ /** * Constructs a new BigQueryOptions. * @memberof google.logging.v2 * @classdesc Represents a BigQueryOptions. * @implements IBigQueryOptions * @constructor * @param {google.logging.v2.IBigQueryOptions=} [properties] Properties to set */ function BigQueryOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * BigQueryOptions usePartitionedTables. * @member {boolean} usePartitionedTables * @memberof google.logging.v2.BigQueryOptions * @instance */ BigQueryOptions.prototype.usePartitionedTables = false; /** * BigQueryOptions usesTimestampColumnPartitioning. * @member {boolean} usesTimestampColumnPartitioning * @memberof google.logging.v2.BigQueryOptions * @instance */ BigQueryOptions.prototype.usesTimestampColumnPartitioning = false; /** * Creates a new BigQueryOptions instance using the specified properties. * @function create * @memberof google.logging.v2.BigQueryOptions * @static * @param {google.logging.v2.IBigQueryOptions=} [properties] Properties to set * @returns {google.logging.v2.BigQueryOptions} BigQueryOptions instance */ BigQueryOptions.create = function create(properties) { return new BigQueryOptions(properties); }; /** * Encodes the specified BigQueryOptions message. Does not implicitly {@link google.logging.v2.BigQueryOptions.verify|verify} messages. * @function encode * @memberof google.logging.v2.BigQueryOptions * @static * @param {google.logging.v2.IBigQueryOptions} message BigQueryOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BigQueryOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.usePartitionedTables != null && Object.hasOwnProperty.call(message, "usePartitionedTables")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.usePartitionedTables); if (message.usesTimestampColumnPartitioning != null && Object.hasOwnProperty.call(message, "usesTimestampColumnPartitioning")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.usesTimestampColumnPartitioning); return writer; }; /** * Encodes the specified BigQueryOptions message, length delimited. Does not implicitly {@link google.logging.v2.BigQueryOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.BigQueryOptions * @static * @param {google.logging.v2.IBigQueryOptions} message BigQueryOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BigQueryOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a BigQueryOptions message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.BigQueryOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.BigQueryOptions} BigQueryOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BigQueryOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.BigQueryOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.usePartitionedTables = reader.bool(); break; case 3: message.usesTimestampColumnPartitioning = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a BigQueryOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.BigQueryOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.BigQueryOptions} BigQueryOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BigQueryOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a BigQueryOptions message. * @function verify * @memberof google.logging.v2.BigQueryOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ BigQueryOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.usePartitionedTables != null && message.hasOwnProperty("usePartitionedTables")) if (typeof message.usePartitionedTables !== "boolean") return "usePartitionedTables: boolean expected"; if (message.usesTimestampColumnPartitioning != null && message.hasOwnProperty("usesTimestampColumnPartitioning")) if (typeof message.usesTimestampColumnPartitioning !== "boolean") return "usesTimestampColumnPartitioning: boolean expected"; return null; }; /** * Creates a BigQueryOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.BigQueryOptions * @static * @param {Object.} object Plain object * @returns {google.logging.v2.BigQueryOptions} BigQueryOptions */ BigQueryOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.BigQueryOptions) return object; var message = new $root.google.logging.v2.BigQueryOptions(); if (object.usePartitionedTables != null) message.usePartitionedTables = Boolean(object.usePartitionedTables); if (object.usesTimestampColumnPartitioning != null) message.usesTimestampColumnPartitioning = Boolean(object.usesTimestampColumnPartitioning); return message; }; /** * Creates a plain object from a BigQueryOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.BigQueryOptions * @static * @param {google.logging.v2.BigQueryOptions} message BigQueryOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ BigQueryOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.usePartitionedTables = false; object.usesTimestampColumnPartitioning = false; } if (message.usePartitionedTables != null && message.hasOwnProperty("usePartitionedTables")) object.usePartitionedTables = message.usePartitionedTables; if (message.usesTimestampColumnPartitioning != null && message.hasOwnProperty("usesTimestampColumnPartitioning")) object.usesTimestampColumnPartitioning = message.usesTimestampColumnPartitioning; return object; }; /** * Converts this BigQueryOptions to JSON. * @function toJSON * @memberof google.logging.v2.BigQueryOptions * @instance * @returns {Object.} JSON object */ BigQueryOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return BigQueryOptions; })(); v2.ListBucketsRequest = (function() { /** * Properties of a ListBucketsRequest. * @memberof google.logging.v2 * @interface IListBucketsRequest * @property {string|null} [parent] ListBucketsRequest parent * @property {string|null} [pageToken] ListBucketsRequest pageToken * @property {number|null} [pageSize] ListBucketsRequest pageSize */ /** * Constructs a new ListBucketsRequest. * @memberof google.logging.v2 * @classdesc Represents a ListBucketsRequest. * @implements IListBucketsRequest * @constructor * @param {google.logging.v2.IListBucketsRequest=} [properties] Properties to set */ function ListBucketsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListBucketsRequest parent. * @member {string} parent * @memberof google.logging.v2.ListBucketsRequest * @instance */ ListBucketsRequest.prototype.parent = ""; /** * ListBucketsRequest pageToken. * @member {string} pageToken * @memberof google.logging.v2.ListBucketsRequest * @instance */ ListBucketsRequest.prototype.pageToken = ""; /** * ListBucketsRequest pageSize. * @member {number} pageSize * @memberof google.logging.v2.ListBucketsRequest * @instance */ ListBucketsRequest.prototype.pageSize = 0; /** * Creates a new ListBucketsRequest instance using the specified properties. * @function create * @memberof google.logging.v2.ListBucketsRequest * @static * @param {google.logging.v2.IListBucketsRequest=} [properties] Properties to set * @returns {google.logging.v2.ListBucketsRequest} ListBucketsRequest instance */ ListBucketsRequest.create = function create(properties) { return new ListBucketsRequest(properties); }; /** * Encodes the specified ListBucketsRequest message. Does not implicitly {@link google.logging.v2.ListBucketsRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListBucketsRequest * @static * @param {google.logging.v2.IListBucketsRequest} message ListBucketsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListBucketsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; /** * Encodes the specified ListBucketsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListBucketsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListBucketsRequest * @static * @param {google.logging.v2.IListBucketsRequest} message ListBucketsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListBucketsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListBucketsRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListBucketsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListBucketsRequest} ListBucketsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListBucketsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListBucketsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.pageToken = reader.string(); break; case 3: message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListBucketsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListBucketsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListBucketsRequest} ListBucketsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListBucketsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListBucketsRequest message. * @function verify * @memberof google.logging.v2.ListBucketsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListBucketsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; return null; }; /** * Creates a ListBucketsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListBucketsRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListBucketsRequest} ListBucketsRequest */ ListBucketsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListBucketsRequest) return object; var message = new $root.google.logging.v2.ListBucketsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) message.pageSize = object.pageSize | 0; return message; }; /** * Creates a plain object from a ListBucketsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListBucketsRequest * @static * @param {google.logging.v2.ListBucketsRequest} message ListBucketsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListBucketsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.pageToken = ""; object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; return object; }; /** * Converts this ListBucketsRequest to JSON. * @function toJSON * @memberof google.logging.v2.ListBucketsRequest * @instance * @returns {Object.} JSON object */ ListBucketsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListBucketsRequest; })(); v2.ListBucketsResponse = (function() { /** * Properties of a ListBucketsResponse. * @memberof google.logging.v2 * @interface IListBucketsResponse * @property {Array.|null} [buckets] ListBucketsResponse buckets * @property {string|null} [nextPageToken] ListBucketsResponse nextPageToken */ /** * Constructs a new ListBucketsResponse. * @memberof google.logging.v2 * @classdesc Represents a ListBucketsResponse. * @implements IListBucketsResponse * @constructor * @param {google.logging.v2.IListBucketsResponse=} [properties] Properties to set */ function ListBucketsResponse(properties) { this.buckets = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListBucketsResponse buckets. * @member {Array.} buckets * @memberof google.logging.v2.ListBucketsResponse * @instance */ ListBucketsResponse.prototype.buckets = $util.emptyArray; /** * ListBucketsResponse nextPageToken. * @member {string} nextPageToken * @memberof google.logging.v2.ListBucketsResponse * @instance */ ListBucketsResponse.prototype.nextPageToken = ""; /** * Creates a new ListBucketsResponse instance using the specified properties. * @function create * @memberof google.logging.v2.ListBucketsResponse * @static * @param {google.logging.v2.IListBucketsResponse=} [properties] Properties to set * @returns {google.logging.v2.ListBucketsResponse} ListBucketsResponse instance */ ListBucketsResponse.create = function create(properties) { return new ListBucketsResponse(properties); }; /** * Encodes the specified ListBucketsResponse message. Does not implicitly {@link google.logging.v2.ListBucketsResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListBucketsResponse * @static * @param {google.logging.v2.IListBucketsResponse} message ListBucketsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListBucketsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.buckets != null && message.buckets.length) for (var i = 0; i < message.buckets.length; ++i) $root.google.logging.v2.LogBucket.encode(message.buckets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListBucketsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListBucketsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListBucketsResponse * @static * @param {google.logging.v2.IListBucketsResponse} message ListBucketsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListBucketsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListBucketsResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListBucketsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListBucketsResponse} ListBucketsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListBucketsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListBucketsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.buckets && message.buckets.length)) message.buckets = []; message.buckets.push($root.google.logging.v2.LogBucket.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListBucketsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListBucketsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListBucketsResponse} ListBucketsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListBucketsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListBucketsResponse message. * @function verify * @memberof google.logging.v2.ListBucketsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListBucketsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.buckets != null && message.hasOwnProperty("buckets")) { if (!Array.isArray(message.buckets)) return "buckets: array expected"; for (var i = 0; i < message.buckets.length; ++i) { var error = $root.google.logging.v2.LogBucket.verify(message.buckets[i]); if (error) return "buckets." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListBucketsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListBucketsResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListBucketsResponse} ListBucketsResponse */ ListBucketsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListBucketsResponse) return object; var message = new $root.google.logging.v2.ListBucketsResponse(); if (object.buckets) { if (!Array.isArray(object.buckets)) throw TypeError(".google.logging.v2.ListBucketsResponse.buckets: array expected"); message.buckets = []; for (var i = 0; i < object.buckets.length; ++i) { if (typeof object.buckets[i] !== "object") throw TypeError(".google.logging.v2.ListBucketsResponse.buckets: object expected"); message.buckets[i] = $root.google.logging.v2.LogBucket.fromObject(object.buckets[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListBucketsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListBucketsResponse * @static * @param {google.logging.v2.ListBucketsResponse} message ListBucketsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListBucketsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.buckets = []; if (options.defaults) object.nextPageToken = ""; if (message.buckets && message.buckets.length) { object.buckets = []; for (var j = 0; j < message.buckets.length; ++j) object.buckets[j] = $root.google.logging.v2.LogBucket.toObject(message.buckets[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListBucketsResponse to JSON. * @function toJSON * @memberof google.logging.v2.ListBucketsResponse * @instance * @returns {Object.} JSON object */ ListBucketsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListBucketsResponse; })(); v2.CreateBucketRequest = (function() { /** * Properties of a CreateBucketRequest. * @memberof google.logging.v2 * @interface ICreateBucketRequest * @property {string|null} [parent] CreateBucketRequest parent * @property {string|null} [bucketId] CreateBucketRequest bucketId * @property {google.logging.v2.ILogBucket|null} [bucket] CreateBucketRequest bucket */ /** * Constructs a new CreateBucketRequest. * @memberof google.logging.v2 * @classdesc Represents a CreateBucketRequest. * @implements ICreateBucketRequest * @constructor * @param {google.logging.v2.ICreateBucketRequest=} [properties] Properties to set */ function CreateBucketRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CreateBucketRequest parent. * @member {string} parent * @memberof google.logging.v2.CreateBucketRequest * @instance */ CreateBucketRequest.prototype.parent = ""; /** * CreateBucketRequest bucketId. * @member {string} bucketId * @memberof google.logging.v2.CreateBucketRequest * @instance */ CreateBucketRequest.prototype.bucketId = ""; /** * CreateBucketRequest bucket. * @member {google.logging.v2.ILogBucket|null|undefined} bucket * @memberof google.logging.v2.CreateBucketRequest * @instance */ CreateBucketRequest.prototype.bucket = null; /** * Creates a new CreateBucketRequest instance using the specified properties. * @function create * @memberof google.logging.v2.CreateBucketRequest * @static * @param {google.logging.v2.ICreateBucketRequest=} [properties] Properties to set * @returns {google.logging.v2.CreateBucketRequest} CreateBucketRequest instance */ CreateBucketRequest.create = function create(properties) { return new CreateBucketRequest(properties); }; /** * Encodes the specified CreateBucketRequest message. Does not implicitly {@link google.logging.v2.CreateBucketRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.CreateBucketRequest * @static * @param {google.logging.v2.ICreateBucketRequest} message CreateBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.bucketId); if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) $root.google.logging.v2.LogBucket.encode(message.bucket, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified CreateBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateBucketRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.CreateBucketRequest * @static * @param {google.logging.v2.ICreateBucketRequest} message CreateBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CreateBucketRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.CreateBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.CreateBucketRequest} CreateBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateBucketRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateBucketRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.bucketId = reader.string(); break; case 3: message.bucket = $root.google.logging.v2.LogBucket.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CreateBucketRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.CreateBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.CreateBucketRequest} CreateBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateBucketRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CreateBucketRequest message. * @function verify * @memberof google.logging.v2.CreateBucketRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CreateBucketRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.bucketId != null && message.hasOwnProperty("bucketId")) if (!$util.isString(message.bucketId)) return "bucketId: string expected"; if (message.bucket != null && message.hasOwnProperty("bucket")) { var error = $root.google.logging.v2.LogBucket.verify(message.bucket); if (error) return "bucket." + error; } return null; }; /** * Creates a CreateBucketRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.CreateBucketRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.CreateBucketRequest} CreateBucketRequest */ CreateBucketRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.CreateBucketRequest) return object; var message = new $root.google.logging.v2.CreateBucketRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.bucketId != null) message.bucketId = String(object.bucketId); if (object.bucket != null) { if (typeof object.bucket !== "object") throw TypeError(".google.logging.v2.CreateBucketRequest.bucket: object expected"); message.bucket = $root.google.logging.v2.LogBucket.fromObject(object.bucket); } return message; }; /** * Creates a plain object from a CreateBucketRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.CreateBucketRequest * @static * @param {google.logging.v2.CreateBucketRequest} message CreateBucketRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CreateBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.bucketId = ""; object.bucket = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.bucketId != null && message.hasOwnProperty("bucketId")) object.bucketId = message.bucketId; if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = $root.google.logging.v2.LogBucket.toObject(message.bucket, options); return object; }; /** * Converts this CreateBucketRequest to JSON. * @function toJSON * @memberof google.logging.v2.CreateBucketRequest * @instance * @returns {Object.} JSON object */ CreateBucketRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CreateBucketRequest; })(); v2.UpdateBucketRequest = (function() { /** * Properties of an UpdateBucketRequest. * @memberof google.logging.v2 * @interface IUpdateBucketRequest * @property {string|null} [name] UpdateBucketRequest name * @property {google.logging.v2.ILogBucket|null} [bucket] UpdateBucketRequest bucket * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBucketRequest updateMask */ /** * Constructs a new UpdateBucketRequest. * @memberof google.logging.v2 * @classdesc Represents an UpdateBucketRequest. * @implements IUpdateBucketRequest * @constructor * @param {google.logging.v2.IUpdateBucketRequest=} [properties] Properties to set */ function UpdateBucketRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UpdateBucketRequest name. * @member {string} name * @memberof google.logging.v2.UpdateBucketRequest * @instance */ UpdateBucketRequest.prototype.name = ""; /** * UpdateBucketRequest bucket. * @member {google.logging.v2.ILogBucket|null|undefined} bucket * @memberof google.logging.v2.UpdateBucketRequest * @instance */ UpdateBucketRequest.prototype.bucket = null; /** * UpdateBucketRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask * @memberof google.logging.v2.UpdateBucketRequest * @instance */ UpdateBucketRequest.prototype.updateMask = null; /** * Creates a new UpdateBucketRequest instance using the specified properties. * @function create * @memberof google.logging.v2.UpdateBucketRequest * @static * @param {google.logging.v2.IUpdateBucketRequest=} [properties] Properties to set * @returns {google.logging.v2.UpdateBucketRequest} UpdateBucketRequest instance */ UpdateBucketRequest.create = function create(properties) { return new UpdateBucketRequest(properties); }; /** * Encodes the specified UpdateBucketRequest message. Does not implicitly {@link google.logging.v2.UpdateBucketRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.UpdateBucketRequest * @static * @param {google.logging.v2.IUpdateBucketRequest} message UpdateBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) $root.google.logging.v2.LogBucket.encode(message.bucket, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** * Encodes the specified UpdateBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateBucketRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.UpdateBucketRequest * @static * @param {google.logging.v2.IUpdateBucketRequest} message UpdateBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UpdateBucketRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.UpdateBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.UpdateBucketRequest} UpdateBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateBucketRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateBucketRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.bucket = $root.google.logging.v2.LogBucket.decode(reader, reader.uint32()); break; case 4: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UpdateBucketRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.UpdateBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.UpdateBucketRequest} UpdateBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateBucketRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UpdateBucketRequest message. * @function verify * @memberof google.logging.v2.UpdateBucketRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UpdateBucketRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.bucket != null && message.hasOwnProperty("bucket")) { var error = $root.google.logging.v2.LogBucket.verify(message.bucket); if (error) return "bucket." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) return "updateMask." + error; } return null; }; /** * Creates an UpdateBucketRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.UpdateBucketRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.UpdateBucketRequest} UpdateBucketRequest */ UpdateBucketRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.UpdateBucketRequest) return object; var message = new $root.google.logging.v2.UpdateBucketRequest(); if (object.name != null) message.name = String(object.name); if (object.bucket != null) { if (typeof object.bucket !== "object") throw TypeError(".google.logging.v2.UpdateBucketRequest.bucket: object expected"); message.bucket = $root.google.logging.v2.LogBucket.fromObject(object.bucket); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") throw TypeError(".google.logging.v2.UpdateBucketRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** * Creates a plain object from an UpdateBucketRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.UpdateBucketRequest * @static * @param {google.logging.v2.UpdateBucketRequest} message UpdateBucketRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UpdateBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.bucket = null; object.updateMask = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.bucket != null && message.hasOwnProperty("bucket")) object.bucket = $root.google.logging.v2.LogBucket.toObject(message.bucket, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** * Converts this UpdateBucketRequest to JSON. * @function toJSON * @memberof google.logging.v2.UpdateBucketRequest * @instance * @returns {Object.} JSON object */ UpdateBucketRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return UpdateBucketRequest; })(); v2.GetBucketRequest = (function() { /** * Properties of a GetBucketRequest. * @memberof google.logging.v2 * @interface IGetBucketRequest * @property {string|null} [name] GetBucketRequest name */ /** * Constructs a new GetBucketRequest. * @memberof google.logging.v2 * @classdesc Represents a GetBucketRequest. * @implements IGetBucketRequest * @constructor * @param {google.logging.v2.IGetBucketRequest=} [properties] Properties to set */ function GetBucketRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetBucketRequest name. * @member {string} name * @memberof google.logging.v2.GetBucketRequest * @instance */ GetBucketRequest.prototype.name = ""; /** * Creates a new GetBucketRequest instance using the specified properties. * @function create * @memberof google.logging.v2.GetBucketRequest * @static * @param {google.logging.v2.IGetBucketRequest=} [properties] Properties to set * @returns {google.logging.v2.GetBucketRequest} GetBucketRequest instance */ GetBucketRequest.create = function create(properties) { return new GetBucketRequest(properties); }; /** * Encodes the specified GetBucketRequest message. Does not implicitly {@link google.logging.v2.GetBucketRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.GetBucketRequest * @static * @param {google.logging.v2.IGetBucketRequest} message GetBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified GetBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetBucketRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.GetBucketRequest * @static * @param {google.logging.v2.IGetBucketRequest} message GetBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetBucketRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.GetBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.GetBucketRequest} GetBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetBucketRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetBucketRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetBucketRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.GetBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.GetBucketRequest} GetBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetBucketRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetBucketRequest message. * @function verify * @memberof google.logging.v2.GetBucketRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetBucketRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a GetBucketRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.GetBucketRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.GetBucketRequest} GetBucketRequest */ GetBucketRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.GetBucketRequest) return object; var message = new $root.google.logging.v2.GetBucketRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a GetBucketRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.GetBucketRequest * @static * @param {google.logging.v2.GetBucketRequest} message GetBucketRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this GetBucketRequest to JSON. * @function toJSON * @memberof google.logging.v2.GetBucketRequest * @instance * @returns {Object.} JSON object */ GetBucketRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetBucketRequest; })(); v2.DeleteBucketRequest = (function() { /** * Properties of a DeleteBucketRequest. * @memberof google.logging.v2 * @interface IDeleteBucketRequest * @property {string|null} [name] DeleteBucketRequest name */ /** * Constructs a new DeleteBucketRequest. * @memberof google.logging.v2 * @classdesc Represents a DeleteBucketRequest. * @implements IDeleteBucketRequest * @constructor * @param {google.logging.v2.IDeleteBucketRequest=} [properties] Properties to set */ function DeleteBucketRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DeleteBucketRequest name. * @member {string} name * @memberof google.logging.v2.DeleteBucketRequest * @instance */ DeleteBucketRequest.prototype.name = ""; /** * Creates a new DeleteBucketRequest instance using the specified properties. * @function create * @memberof google.logging.v2.DeleteBucketRequest * @static * @param {google.logging.v2.IDeleteBucketRequest=} [properties] Properties to set * @returns {google.logging.v2.DeleteBucketRequest} DeleteBucketRequest instance */ DeleteBucketRequest.create = function create(properties) { return new DeleteBucketRequest(properties); }; /** * Encodes the specified DeleteBucketRequest message. Does not implicitly {@link google.logging.v2.DeleteBucketRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.DeleteBucketRequest * @static * @param {google.logging.v2.IDeleteBucketRequest} message DeleteBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified DeleteBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteBucketRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.DeleteBucketRequest * @static * @param {google.logging.v2.IDeleteBucketRequest} message DeleteBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DeleteBucketRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.DeleteBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.DeleteBucketRequest} DeleteBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteBucketRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteBucketRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DeleteBucketRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.DeleteBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.DeleteBucketRequest} DeleteBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteBucketRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DeleteBucketRequest message. * @function verify * @memberof google.logging.v2.DeleteBucketRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DeleteBucketRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a DeleteBucketRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.DeleteBucketRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.DeleteBucketRequest} DeleteBucketRequest */ DeleteBucketRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.DeleteBucketRequest) return object; var message = new $root.google.logging.v2.DeleteBucketRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a DeleteBucketRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.DeleteBucketRequest * @static * @param {google.logging.v2.DeleteBucketRequest} message DeleteBucketRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DeleteBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this DeleteBucketRequest to JSON. * @function toJSON * @memberof google.logging.v2.DeleteBucketRequest * @instance * @returns {Object.} JSON object */ DeleteBucketRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DeleteBucketRequest; })(); v2.UndeleteBucketRequest = (function() { /** * Properties of an UndeleteBucketRequest. * @memberof google.logging.v2 * @interface IUndeleteBucketRequest * @property {string|null} [name] UndeleteBucketRequest name */ /** * Constructs a new UndeleteBucketRequest. * @memberof google.logging.v2 * @classdesc Represents an UndeleteBucketRequest. * @implements IUndeleteBucketRequest * @constructor * @param {google.logging.v2.IUndeleteBucketRequest=} [properties] Properties to set */ function UndeleteBucketRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UndeleteBucketRequest name. * @member {string} name * @memberof google.logging.v2.UndeleteBucketRequest * @instance */ UndeleteBucketRequest.prototype.name = ""; /** * Creates a new UndeleteBucketRequest instance using the specified properties. * @function create * @memberof google.logging.v2.UndeleteBucketRequest * @static * @param {google.logging.v2.IUndeleteBucketRequest=} [properties] Properties to set * @returns {google.logging.v2.UndeleteBucketRequest} UndeleteBucketRequest instance */ UndeleteBucketRequest.create = function create(properties) { return new UndeleteBucketRequest(properties); }; /** * Encodes the specified UndeleteBucketRequest message. Does not implicitly {@link google.logging.v2.UndeleteBucketRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.UndeleteBucketRequest * @static * @param {google.logging.v2.IUndeleteBucketRequest} message UndeleteBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UndeleteBucketRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified UndeleteBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.UndeleteBucketRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.UndeleteBucketRequest * @static * @param {google.logging.v2.IUndeleteBucketRequest} message UndeleteBucketRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UndeleteBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UndeleteBucketRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.UndeleteBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.UndeleteBucketRequest} UndeleteBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UndeleteBucketRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UndeleteBucketRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UndeleteBucketRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.UndeleteBucketRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.UndeleteBucketRequest} UndeleteBucketRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UndeleteBucketRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UndeleteBucketRequest message. * @function verify * @memberof google.logging.v2.UndeleteBucketRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UndeleteBucketRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates an UndeleteBucketRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.UndeleteBucketRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.UndeleteBucketRequest} UndeleteBucketRequest */ UndeleteBucketRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.UndeleteBucketRequest) return object; var message = new $root.google.logging.v2.UndeleteBucketRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from an UndeleteBucketRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.UndeleteBucketRequest * @static * @param {google.logging.v2.UndeleteBucketRequest} message UndeleteBucketRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UndeleteBucketRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this UndeleteBucketRequest to JSON. * @function toJSON * @memberof google.logging.v2.UndeleteBucketRequest * @instance * @returns {Object.} JSON object */ UndeleteBucketRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return UndeleteBucketRequest; })(); v2.ListViewsRequest = (function() { /** * Properties of a ListViewsRequest. * @memberof google.logging.v2 * @interface IListViewsRequest * @property {string|null} [parent] ListViewsRequest parent * @property {string|null} [pageToken] ListViewsRequest pageToken * @property {number|null} [pageSize] ListViewsRequest pageSize */ /** * Constructs a new ListViewsRequest. * @memberof google.logging.v2 * @classdesc Represents a ListViewsRequest. * @implements IListViewsRequest * @constructor * @param {google.logging.v2.IListViewsRequest=} [properties] Properties to set */ function ListViewsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListViewsRequest parent. * @member {string} parent * @memberof google.logging.v2.ListViewsRequest * @instance */ ListViewsRequest.prototype.parent = ""; /** * ListViewsRequest pageToken. * @member {string} pageToken * @memberof google.logging.v2.ListViewsRequest * @instance */ ListViewsRequest.prototype.pageToken = ""; /** * ListViewsRequest pageSize. * @member {number} pageSize * @memberof google.logging.v2.ListViewsRequest * @instance */ ListViewsRequest.prototype.pageSize = 0; /** * Creates a new ListViewsRequest instance using the specified properties. * @function create * @memberof google.logging.v2.ListViewsRequest * @static * @param {google.logging.v2.IListViewsRequest=} [properties] Properties to set * @returns {google.logging.v2.ListViewsRequest} ListViewsRequest instance */ ListViewsRequest.create = function create(properties) { return new ListViewsRequest(properties); }; /** * Encodes the specified ListViewsRequest message. Does not implicitly {@link google.logging.v2.ListViewsRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListViewsRequest * @static * @param {google.logging.v2.IListViewsRequest} message ListViewsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListViewsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; /** * Encodes the specified ListViewsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListViewsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListViewsRequest * @static * @param {google.logging.v2.IListViewsRequest} message ListViewsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListViewsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListViewsRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListViewsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListViewsRequest} ListViewsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListViewsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListViewsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.pageToken = reader.string(); break; case 3: message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListViewsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListViewsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListViewsRequest} ListViewsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListViewsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListViewsRequest message. * @function verify * @memberof google.logging.v2.ListViewsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListViewsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; return null; }; /** * Creates a ListViewsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListViewsRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListViewsRequest} ListViewsRequest */ ListViewsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListViewsRequest) return object; var message = new $root.google.logging.v2.ListViewsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) message.pageSize = object.pageSize | 0; return message; }; /** * Creates a plain object from a ListViewsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListViewsRequest * @static * @param {google.logging.v2.ListViewsRequest} message ListViewsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListViewsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.pageToken = ""; object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; return object; }; /** * Converts this ListViewsRequest to JSON. * @function toJSON * @memberof google.logging.v2.ListViewsRequest * @instance * @returns {Object.} JSON object */ ListViewsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListViewsRequest; })(); v2.ListViewsResponse = (function() { /** * Properties of a ListViewsResponse. * @memberof google.logging.v2 * @interface IListViewsResponse * @property {Array.|null} [views] ListViewsResponse views * @property {string|null} [nextPageToken] ListViewsResponse nextPageToken */ /** * Constructs a new ListViewsResponse. * @memberof google.logging.v2 * @classdesc Represents a ListViewsResponse. * @implements IListViewsResponse * @constructor * @param {google.logging.v2.IListViewsResponse=} [properties] Properties to set */ function ListViewsResponse(properties) { this.views = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListViewsResponse views. * @member {Array.} views * @memberof google.logging.v2.ListViewsResponse * @instance */ ListViewsResponse.prototype.views = $util.emptyArray; /** * ListViewsResponse nextPageToken. * @member {string} nextPageToken * @memberof google.logging.v2.ListViewsResponse * @instance */ ListViewsResponse.prototype.nextPageToken = ""; /** * Creates a new ListViewsResponse instance using the specified properties. * @function create * @memberof google.logging.v2.ListViewsResponse * @static * @param {google.logging.v2.IListViewsResponse=} [properties] Properties to set * @returns {google.logging.v2.ListViewsResponse} ListViewsResponse instance */ ListViewsResponse.create = function create(properties) { return new ListViewsResponse(properties); }; /** * Encodes the specified ListViewsResponse message. Does not implicitly {@link google.logging.v2.ListViewsResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListViewsResponse * @static * @param {google.logging.v2.IListViewsResponse} message ListViewsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListViewsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.views != null && message.views.length) for (var i = 0; i < message.views.length; ++i) $root.google.logging.v2.LogView.encode(message.views[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListViewsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListViewsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListViewsResponse * @static * @param {google.logging.v2.IListViewsResponse} message ListViewsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListViewsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListViewsResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListViewsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListViewsResponse} ListViewsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListViewsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListViewsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.views && message.views.length)) message.views = []; message.views.push($root.google.logging.v2.LogView.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListViewsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListViewsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListViewsResponse} ListViewsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListViewsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListViewsResponse message. * @function verify * @memberof google.logging.v2.ListViewsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListViewsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.views != null && message.hasOwnProperty("views")) { if (!Array.isArray(message.views)) return "views: array expected"; for (var i = 0; i < message.views.length; ++i) { var error = $root.google.logging.v2.LogView.verify(message.views[i]); if (error) return "views." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListViewsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListViewsResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListViewsResponse} ListViewsResponse */ ListViewsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListViewsResponse) return object; var message = new $root.google.logging.v2.ListViewsResponse(); if (object.views) { if (!Array.isArray(object.views)) throw TypeError(".google.logging.v2.ListViewsResponse.views: array expected"); message.views = []; for (var i = 0; i < object.views.length; ++i) { if (typeof object.views[i] !== "object") throw TypeError(".google.logging.v2.ListViewsResponse.views: object expected"); message.views[i] = $root.google.logging.v2.LogView.fromObject(object.views[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListViewsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListViewsResponse * @static * @param {google.logging.v2.ListViewsResponse} message ListViewsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListViewsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.views = []; if (options.defaults) object.nextPageToken = ""; if (message.views && message.views.length) { object.views = []; for (var j = 0; j < message.views.length; ++j) object.views[j] = $root.google.logging.v2.LogView.toObject(message.views[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListViewsResponse to JSON. * @function toJSON * @memberof google.logging.v2.ListViewsResponse * @instance * @returns {Object.} JSON object */ ListViewsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListViewsResponse; })(); v2.CreateViewRequest = (function() { /** * Properties of a CreateViewRequest. * @memberof google.logging.v2 * @interface ICreateViewRequest * @property {string|null} [parent] CreateViewRequest parent * @property {string|null} [viewId] CreateViewRequest viewId * @property {google.logging.v2.ILogView|null} [view] CreateViewRequest view */ /** * Constructs a new CreateViewRequest. * @memberof google.logging.v2 * @classdesc Represents a CreateViewRequest. * @implements ICreateViewRequest * @constructor * @param {google.logging.v2.ICreateViewRequest=} [properties] Properties to set */ function CreateViewRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CreateViewRequest parent. * @member {string} parent * @memberof google.logging.v2.CreateViewRequest * @instance */ CreateViewRequest.prototype.parent = ""; /** * CreateViewRequest viewId. * @member {string} viewId * @memberof google.logging.v2.CreateViewRequest * @instance */ CreateViewRequest.prototype.viewId = ""; /** * CreateViewRequest view. * @member {google.logging.v2.ILogView|null|undefined} view * @memberof google.logging.v2.CreateViewRequest * @instance */ CreateViewRequest.prototype.view = null; /** * Creates a new CreateViewRequest instance using the specified properties. * @function create * @memberof google.logging.v2.CreateViewRequest * @static * @param {google.logging.v2.ICreateViewRequest=} [properties] Properties to set * @returns {google.logging.v2.CreateViewRequest} CreateViewRequest instance */ CreateViewRequest.create = function create(properties) { return new CreateViewRequest(properties); }; /** * Encodes the specified CreateViewRequest message. Does not implicitly {@link google.logging.v2.CreateViewRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.CreateViewRequest * @static * @param {google.logging.v2.ICreateViewRequest} message CreateViewRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateViewRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.viewId != null && Object.hasOwnProperty.call(message, "viewId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.viewId); if (message.view != null && Object.hasOwnProperty.call(message, "view")) $root.google.logging.v2.LogView.encode(message.view, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified CreateViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateViewRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.CreateViewRequest * @static * @param {google.logging.v2.ICreateViewRequest} message CreateViewRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateViewRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CreateViewRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.CreateViewRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.CreateViewRequest} CreateViewRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateViewRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateViewRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.viewId = reader.string(); break; case 3: message.view = $root.google.logging.v2.LogView.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CreateViewRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.CreateViewRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.CreateViewRequest} CreateViewRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateViewRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CreateViewRequest message. * @function verify * @memberof google.logging.v2.CreateViewRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CreateViewRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.viewId != null && message.hasOwnProperty("viewId")) if (!$util.isString(message.viewId)) return "viewId: string expected"; if (message.view != null && message.hasOwnProperty("view")) { var error = $root.google.logging.v2.LogView.verify(message.view); if (error) return "view." + error; } return null; }; /** * Creates a CreateViewRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.CreateViewRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.CreateViewRequest} CreateViewRequest */ CreateViewRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.CreateViewRequest) return object; var message = new $root.google.logging.v2.CreateViewRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.viewId != null) message.viewId = String(object.viewId); if (object.view != null) { if (typeof object.view !== "object") throw TypeError(".google.logging.v2.CreateViewRequest.view: object expected"); message.view = $root.google.logging.v2.LogView.fromObject(object.view); } return message; }; /** * Creates a plain object from a CreateViewRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.CreateViewRequest * @static * @param {google.logging.v2.CreateViewRequest} message CreateViewRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CreateViewRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.viewId = ""; object.view = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.viewId != null && message.hasOwnProperty("viewId")) object.viewId = message.viewId; if (message.view != null && message.hasOwnProperty("view")) object.view = $root.google.logging.v2.LogView.toObject(message.view, options); return object; }; /** * Converts this CreateViewRequest to JSON. * @function toJSON * @memberof google.logging.v2.CreateViewRequest * @instance * @returns {Object.} JSON object */ CreateViewRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CreateViewRequest; })(); v2.UpdateViewRequest = (function() { /** * Properties of an UpdateViewRequest. * @memberof google.logging.v2 * @interface IUpdateViewRequest * @property {string|null} [name] UpdateViewRequest name * @property {google.logging.v2.ILogView|null} [view] UpdateViewRequest view * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateViewRequest updateMask */ /** * Constructs a new UpdateViewRequest. * @memberof google.logging.v2 * @classdesc Represents an UpdateViewRequest. * @implements IUpdateViewRequest * @constructor * @param {google.logging.v2.IUpdateViewRequest=} [properties] Properties to set */ function UpdateViewRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UpdateViewRequest name. * @member {string} name * @memberof google.logging.v2.UpdateViewRequest * @instance */ UpdateViewRequest.prototype.name = ""; /** * UpdateViewRequest view. * @member {google.logging.v2.ILogView|null|undefined} view * @memberof google.logging.v2.UpdateViewRequest * @instance */ UpdateViewRequest.prototype.view = null; /** * UpdateViewRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask * @memberof google.logging.v2.UpdateViewRequest * @instance */ UpdateViewRequest.prototype.updateMask = null; /** * Creates a new UpdateViewRequest instance using the specified properties. * @function create * @memberof google.logging.v2.UpdateViewRequest * @static * @param {google.logging.v2.IUpdateViewRequest=} [properties] Properties to set * @returns {google.logging.v2.UpdateViewRequest} UpdateViewRequest instance */ UpdateViewRequest.create = function create(properties) { return new UpdateViewRequest(properties); }; /** * Encodes the specified UpdateViewRequest message. Does not implicitly {@link google.logging.v2.UpdateViewRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.UpdateViewRequest * @static * @param {google.logging.v2.IUpdateViewRequest} message UpdateViewRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateViewRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.view != null && Object.hasOwnProperty.call(message, "view")) $root.google.logging.v2.LogView.encode(message.view, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** * Encodes the specified UpdateViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateViewRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.UpdateViewRequest * @static * @param {google.logging.v2.IUpdateViewRequest} message UpdateViewRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateViewRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UpdateViewRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.UpdateViewRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.UpdateViewRequest} UpdateViewRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateViewRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateViewRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.view = $root.google.logging.v2.LogView.decode(reader, reader.uint32()); break; case 4: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UpdateViewRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.UpdateViewRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.UpdateViewRequest} UpdateViewRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateViewRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UpdateViewRequest message. * @function verify * @memberof google.logging.v2.UpdateViewRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UpdateViewRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.view != null && message.hasOwnProperty("view")) { var error = $root.google.logging.v2.LogView.verify(message.view); if (error) return "view." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) return "updateMask." + error; } return null; }; /** * Creates an UpdateViewRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.UpdateViewRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.UpdateViewRequest} UpdateViewRequest */ UpdateViewRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.UpdateViewRequest) return object; var message = new $root.google.logging.v2.UpdateViewRequest(); if (object.name != null) message.name = String(object.name); if (object.view != null) { if (typeof object.view !== "object") throw TypeError(".google.logging.v2.UpdateViewRequest.view: object expected"); message.view = $root.google.logging.v2.LogView.fromObject(object.view); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") throw TypeError(".google.logging.v2.UpdateViewRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** * Creates a plain object from an UpdateViewRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.UpdateViewRequest * @static * @param {google.logging.v2.UpdateViewRequest} message UpdateViewRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UpdateViewRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.view = null; object.updateMask = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.view != null && message.hasOwnProperty("view")) object.view = $root.google.logging.v2.LogView.toObject(message.view, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** * Converts this UpdateViewRequest to JSON. * @function toJSON * @memberof google.logging.v2.UpdateViewRequest * @instance * @returns {Object.} JSON object */ UpdateViewRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return UpdateViewRequest; })(); v2.GetViewRequest = (function() { /** * Properties of a GetViewRequest. * @memberof google.logging.v2 * @interface IGetViewRequest * @property {string|null} [name] GetViewRequest name */ /** * Constructs a new GetViewRequest. * @memberof google.logging.v2 * @classdesc Represents a GetViewRequest. * @implements IGetViewRequest * @constructor * @param {google.logging.v2.IGetViewRequest=} [properties] Properties to set */ function GetViewRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetViewRequest name. * @member {string} name * @memberof google.logging.v2.GetViewRequest * @instance */ GetViewRequest.prototype.name = ""; /** * Creates a new GetViewRequest instance using the specified properties. * @function create * @memberof google.logging.v2.GetViewRequest * @static * @param {google.logging.v2.IGetViewRequest=} [properties] Properties to set * @returns {google.logging.v2.GetViewRequest} GetViewRequest instance */ GetViewRequest.create = function create(properties) { return new GetViewRequest(properties); }; /** * Encodes the specified GetViewRequest message. Does not implicitly {@link google.logging.v2.GetViewRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.GetViewRequest * @static * @param {google.logging.v2.IGetViewRequest} message GetViewRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetViewRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified GetViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetViewRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.GetViewRequest * @static * @param {google.logging.v2.IGetViewRequest} message GetViewRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetViewRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetViewRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.GetViewRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.GetViewRequest} GetViewRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetViewRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetViewRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetViewRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.GetViewRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.GetViewRequest} GetViewRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetViewRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetViewRequest message. * @function verify * @memberof google.logging.v2.GetViewRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetViewRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a GetViewRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.GetViewRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.GetViewRequest} GetViewRequest */ GetViewRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.GetViewRequest) return object; var message = new $root.google.logging.v2.GetViewRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a GetViewRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.GetViewRequest * @static * @param {google.logging.v2.GetViewRequest} message GetViewRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetViewRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this GetViewRequest to JSON. * @function toJSON * @memberof google.logging.v2.GetViewRequest * @instance * @returns {Object.} JSON object */ GetViewRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetViewRequest; })(); v2.DeleteViewRequest = (function() { /** * Properties of a DeleteViewRequest. * @memberof google.logging.v2 * @interface IDeleteViewRequest * @property {string|null} [name] DeleteViewRequest name */ /** * Constructs a new DeleteViewRequest. * @memberof google.logging.v2 * @classdesc Represents a DeleteViewRequest. * @implements IDeleteViewRequest * @constructor * @param {google.logging.v2.IDeleteViewRequest=} [properties] Properties to set */ function DeleteViewRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DeleteViewRequest name. * @member {string} name * @memberof google.logging.v2.DeleteViewRequest * @instance */ DeleteViewRequest.prototype.name = ""; /** * Creates a new DeleteViewRequest instance using the specified properties. * @function create * @memberof google.logging.v2.DeleteViewRequest * @static * @param {google.logging.v2.IDeleteViewRequest=} [properties] Properties to set * @returns {google.logging.v2.DeleteViewRequest} DeleteViewRequest instance */ DeleteViewRequest.create = function create(properties) { return new DeleteViewRequest(properties); }; /** * Encodes the specified DeleteViewRequest message. Does not implicitly {@link google.logging.v2.DeleteViewRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.DeleteViewRequest * @static * @param {google.logging.v2.IDeleteViewRequest} message DeleteViewRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteViewRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified DeleteViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteViewRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.DeleteViewRequest * @static * @param {google.logging.v2.IDeleteViewRequest} message DeleteViewRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteViewRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DeleteViewRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.DeleteViewRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.DeleteViewRequest} DeleteViewRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteViewRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteViewRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DeleteViewRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.DeleteViewRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.DeleteViewRequest} DeleteViewRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteViewRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DeleteViewRequest message. * @function verify * @memberof google.logging.v2.DeleteViewRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DeleteViewRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a DeleteViewRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.DeleteViewRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.DeleteViewRequest} DeleteViewRequest */ DeleteViewRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.DeleteViewRequest) return object; var message = new $root.google.logging.v2.DeleteViewRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a DeleteViewRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.DeleteViewRequest * @static * @param {google.logging.v2.DeleteViewRequest} message DeleteViewRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DeleteViewRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this DeleteViewRequest to JSON. * @function toJSON * @memberof google.logging.v2.DeleteViewRequest * @instance * @returns {Object.} JSON object */ DeleteViewRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DeleteViewRequest; })(); v2.ListSinksRequest = (function() { /** * Properties of a ListSinksRequest. * @memberof google.logging.v2 * @interface IListSinksRequest * @property {string|null} [parent] ListSinksRequest parent * @property {string|null} [pageToken] ListSinksRequest pageToken * @property {number|null} [pageSize] ListSinksRequest pageSize */ /** * Constructs a new ListSinksRequest. * @memberof google.logging.v2 * @classdesc Represents a ListSinksRequest. * @implements IListSinksRequest * @constructor * @param {google.logging.v2.IListSinksRequest=} [properties] Properties to set */ function ListSinksRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListSinksRequest parent. * @member {string} parent * @memberof google.logging.v2.ListSinksRequest * @instance */ ListSinksRequest.prototype.parent = ""; /** * ListSinksRequest pageToken. * @member {string} pageToken * @memberof google.logging.v2.ListSinksRequest * @instance */ ListSinksRequest.prototype.pageToken = ""; /** * ListSinksRequest pageSize. * @member {number} pageSize * @memberof google.logging.v2.ListSinksRequest * @instance */ ListSinksRequest.prototype.pageSize = 0; /** * Creates a new ListSinksRequest instance using the specified properties. * @function create * @memberof google.logging.v2.ListSinksRequest * @static * @param {google.logging.v2.IListSinksRequest=} [properties] Properties to set * @returns {google.logging.v2.ListSinksRequest} ListSinksRequest instance */ ListSinksRequest.create = function create(properties) { return new ListSinksRequest(properties); }; /** * Encodes the specified ListSinksRequest message. Does not implicitly {@link google.logging.v2.ListSinksRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListSinksRequest * @static * @param {google.logging.v2.IListSinksRequest} message ListSinksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListSinksRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; /** * Encodes the specified ListSinksRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListSinksRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListSinksRequest * @static * @param {google.logging.v2.IListSinksRequest} message ListSinksRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListSinksRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListSinksRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListSinksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListSinksRequest} ListSinksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListSinksRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListSinksRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.pageToken = reader.string(); break; case 3: message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListSinksRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListSinksRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListSinksRequest} ListSinksRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListSinksRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListSinksRequest message. * @function verify * @memberof google.logging.v2.ListSinksRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListSinksRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; return null; }; /** * Creates a ListSinksRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListSinksRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListSinksRequest} ListSinksRequest */ ListSinksRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListSinksRequest) return object; var message = new $root.google.logging.v2.ListSinksRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) message.pageSize = object.pageSize | 0; return message; }; /** * Creates a plain object from a ListSinksRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListSinksRequest * @static * @param {google.logging.v2.ListSinksRequest} message ListSinksRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListSinksRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.pageToken = ""; object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; return object; }; /** * Converts this ListSinksRequest to JSON. * @function toJSON * @memberof google.logging.v2.ListSinksRequest * @instance * @returns {Object.} JSON object */ ListSinksRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListSinksRequest; })(); v2.ListSinksResponse = (function() { /** * Properties of a ListSinksResponse. * @memberof google.logging.v2 * @interface IListSinksResponse * @property {Array.|null} [sinks] ListSinksResponse sinks * @property {string|null} [nextPageToken] ListSinksResponse nextPageToken */ /** * Constructs a new ListSinksResponse. * @memberof google.logging.v2 * @classdesc Represents a ListSinksResponse. * @implements IListSinksResponse * @constructor * @param {google.logging.v2.IListSinksResponse=} [properties] Properties to set */ function ListSinksResponse(properties) { this.sinks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListSinksResponse sinks. * @member {Array.} sinks * @memberof google.logging.v2.ListSinksResponse * @instance */ ListSinksResponse.prototype.sinks = $util.emptyArray; /** * ListSinksResponse nextPageToken. * @member {string} nextPageToken * @memberof google.logging.v2.ListSinksResponse * @instance */ ListSinksResponse.prototype.nextPageToken = ""; /** * Creates a new ListSinksResponse instance using the specified properties. * @function create * @memberof google.logging.v2.ListSinksResponse * @static * @param {google.logging.v2.IListSinksResponse=} [properties] Properties to set * @returns {google.logging.v2.ListSinksResponse} ListSinksResponse instance */ ListSinksResponse.create = function create(properties) { return new ListSinksResponse(properties); }; /** * Encodes the specified ListSinksResponse message. Does not implicitly {@link google.logging.v2.ListSinksResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListSinksResponse * @static * @param {google.logging.v2.IListSinksResponse} message ListSinksResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListSinksResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.sinks != null && message.sinks.length) for (var i = 0; i < message.sinks.length; ++i) $root.google.logging.v2.LogSink.encode(message.sinks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListSinksResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListSinksResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListSinksResponse * @static * @param {google.logging.v2.IListSinksResponse} message ListSinksResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListSinksResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListSinksResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListSinksResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListSinksResponse} ListSinksResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListSinksResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListSinksResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.sinks && message.sinks.length)) message.sinks = []; message.sinks.push($root.google.logging.v2.LogSink.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListSinksResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListSinksResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListSinksResponse} ListSinksResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListSinksResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListSinksResponse message. * @function verify * @memberof google.logging.v2.ListSinksResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListSinksResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.sinks != null && message.hasOwnProperty("sinks")) { if (!Array.isArray(message.sinks)) return "sinks: array expected"; for (var i = 0; i < message.sinks.length; ++i) { var error = $root.google.logging.v2.LogSink.verify(message.sinks[i]); if (error) return "sinks." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListSinksResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListSinksResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListSinksResponse} ListSinksResponse */ ListSinksResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListSinksResponse) return object; var message = new $root.google.logging.v2.ListSinksResponse(); if (object.sinks) { if (!Array.isArray(object.sinks)) throw TypeError(".google.logging.v2.ListSinksResponse.sinks: array expected"); message.sinks = []; for (var i = 0; i < object.sinks.length; ++i) { if (typeof object.sinks[i] !== "object") throw TypeError(".google.logging.v2.ListSinksResponse.sinks: object expected"); message.sinks[i] = $root.google.logging.v2.LogSink.fromObject(object.sinks[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListSinksResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListSinksResponse * @static * @param {google.logging.v2.ListSinksResponse} message ListSinksResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListSinksResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.sinks = []; if (options.defaults) object.nextPageToken = ""; if (message.sinks && message.sinks.length) { object.sinks = []; for (var j = 0; j < message.sinks.length; ++j) object.sinks[j] = $root.google.logging.v2.LogSink.toObject(message.sinks[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListSinksResponse to JSON. * @function toJSON * @memberof google.logging.v2.ListSinksResponse * @instance * @returns {Object.} JSON object */ ListSinksResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListSinksResponse; })(); v2.GetSinkRequest = (function() { /** * Properties of a GetSinkRequest. * @memberof google.logging.v2 * @interface IGetSinkRequest * @property {string|null} [sinkName] GetSinkRequest sinkName */ /** * Constructs a new GetSinkRequest. * @memberof google.logging.v2 * @classdesc Represents a GetSinkRequest. * @implements IGetSinkRequest * @constructor * @param {google.logging.v2.IGetSinkRequest=} [properties] Properties to set */ function GetSinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetSinkRequest sinkName. * @member {string} sinkName * @memberof google.logging.v2.GetSinkRequest * @instance */ GetSinkRequest.prototype.sinkName = ""; /** * Creates a new GetSinkRequest instance using the specified properties. * @function create * @memberof google.logging.v2.GetSinkRequest * @static * @param {google.logging.v2.IGetSinkRequest=} [properties] Properties to set * @returns {google.logging.v2.GetSinkRequest} GetSinkRequest instance */ GetSinkRequest.create = function create(properties) { return new GetSinkRequest(properties); }; /** * Encodes the specified GetSinkRequest message. Does not implicitly {@link google.logging.v2.GetSinkRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.GetSinkRequest * @static * @param {google.logging.v2.IGetSinkRequest} message GetSinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetSinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sinkName); return writer; }; /** * Encodes the specified GetSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetSinkRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.GetSinkRequest * @static * @param {google.logging.v2.IGetSinkRequest} message GetSinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetSinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetSinkRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.GetSinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.GetSinkRequest} GetSinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetSinkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetSinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.sinkName = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetSinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.GetSinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.GetSinkRequest} GetSinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetSinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetSinkRequest message. * @function verify * @memberof google.logging.v2.GetSinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetSinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.sinkName != null && message.hasOwnProperty("sinkName")) if (!$util.isString(message.sinkName)) return "sinkName: string expected"; return null; }; /** * Creates a GetSinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.GetSinkRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.GetSinkRequest} GetSinkRequest */ GetSinkRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.GetSinkRequest) return object; var message = new $root.google.logging.v2.GetSinkRequest(); if (object.sinkName != null) message.sinkName = String(object.sinkName); return message; }; /** * Creates a plain object from a GetSinkRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.GetSinkRequest * @static * @param {google.logging.v2.GetSinkRequest} message GetSinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetSinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.sinkName = ""; if (message.sinkName != null && message.hasOwnProperty("sinkName")) object.sinkName = message.sinkName; return object; }; /** * Converts this GetSinkRequest to JSON. * @function toJSON * @memberof google.logging.v2.GetSinkRequest * @instance * @returns {Object.} JSON object */ GetSinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetSinkRequest; })(); v2.CreateSinkRequest = (function() { /** * Properties of a CreateSinkRequest. * @memberof google.logging.v2 * @interface ICreateSinkRequest * @property {string|null} [parent] CreateSinkRequest parent * @property {google.logging.v2.ILogSink|null} [sink] CreateSinkRequest sink * @property {boolean|null} [uniqueWriterIdentity] CreateSinkRequest uniqueWriterIdentity */ /** * Constructs a new CreateSinkRequest. * @memberof google.logging.v2 * @classdesc Represents a CreateSinkRequest. * @implements ICreateSinkRequest * @constructor * @param {google.logging.v2.ICreateSinkRequest=} [properties] Properties to set */ function CreateSinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CreateSinkRequest parent. * @member {string} parent * @memberof google.logging.v2.CreateSinkRequest * @instance */ CreateSinkRequest.prototype.parent = ""; /** * CreateSinkRequest sink. * @member {google.logging.v2.ILogSink|null|undefined} sink * @memberof google.logging.v2.CreateSinkRequest * @instance */ CreateSinkRequest.prototype.sink = null; /** * CreateSinkRequest uniqueWriterIdentity. * @member {boolean} uniqueWriterIdentity * @memberof google.logging.v2.CreateSinkRequest * @instance */ CreateSinkRequest.prototype.uniqueWriterIdentity = false; /** * Creates a new CreateSinkRequest instance using the specified properties. * @function create * @memberof google.logging.v2.CreateSinkRequest * @static * @param {google.logging.v2.ICreateSinkRequest=} [properties] Properties to set * @returns {google.logging.v2.CreateSinkRequest} CreateSinkRequest instance */ CreateSinkRequest.create = function create(properties) { return new CreateSinkRequest(properties); }; /** * Encodes the specified CreateSinkRequest message. Does not implicitly {@link google.logging.v2.CreateSinkRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.CreateSinkRequest * @static * @param {google.logging.v2.ICreateSinkRequest} message CreateSinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateSinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) $root.google.logging.v2.LogSink.encode(message.sink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.uniqueWriterIdentity != null && Object.hasOwnProperty.call(message, "uniqueWriterIdentity")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.uniqueWriterIdentity); return writer; }; /** * Encodes the specified CreateSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateSinkRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.CreateSinkRequest * @static * @param {google.logging.v2.ICreateSinkRequest} message CreateSinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateSinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CreateSinkRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.CreateSinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.CreateSinkRequest} CreateSinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateSinkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateSinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.sink = $root.google.logging.v2.LogSink.decode(reader, reader.uint32()); break; case 3: message.uniqueWriterIdentity = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CreateSinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.CreateSinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.CreateSinkRequest} CreateSinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateSinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CreateSinkRequest message. * @function verify * @memberof google.logging.v2.CreateSinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CreateSinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.sink != null && message.hasOwnProperty("sink")) { var error = $root.google.logging.v2.LogSink.verify(message.sink); if (error) return "sink." + error; } if (message.uniqueWriterIdentity != null && message.hasOwnProperty("uniqueWriterIdentity")) if (typeof message.uniqueWriterIdentity !== "boolean") return "uniqueWriterIdentity: boolean expected"; return null; }; /** * Creates a CreateSinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.CreateSinkRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.CreateSinkRequest} CreateSinkRequest */ CreateSinkRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.CreateSinkRequest) return object; var message = new $root.google.logging.v2.CreateSinkRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.sink != null) { if (typeof object.sink !== "object") throw TypeError(".google.logging.v2.CreateSinkRequest.sink: object expected"); message.sink = $root.google.logging.v2.LogSink.fromObject(object.sink); } if (object.uniqueWriterIdentity != null) message.uniqueWriterIdentity = Boolean(object.uniqueWriterIdentity); return message; }; /** * Creates a plain object from a CreateSinkRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.CreateSinkRequest * @static * @param {google.logging.v2.CreateSinkRequest} message CreateSinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CreateSinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.sink = null; object.uniqueWriterIdentity = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.sink != null && message.hasOwnProperty("sink")) object.sink = $root.google.logging.v2.LogSink.toObject(message.sink, options); if (message.uniqueWriterIdentity != null && message.hasOwnProperty("uniqueWriterIdentity")) object.uniqueWriterIdentity = message.uniqueWriterIdentity; return object; }; /** * Converts this CreateSinkRequest to JSON. * @function toJSON * @memberof google.logging.v2.CreateSinkRequest * @instance * @returns {Object.} JSON object */ CreateSinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CreateSinkRequest; })(); v2.UpdateSinkRequest = (function() { /** * Properties of an UpdateSinkRequest. * @memberof google.logging.v2 * @interface IUpdateSinkRequest * @property {string|null} [sinkName] UpdateSinkRequest sinkName * @property {google.logging.v2.ILogSink|null} [sink] UpdateSinkRequest sink * @property {boolean|null} [uniqueWriterIdentity] UpdateSinkRequest uniqueWriterIdentity * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSinkRequest updateMask */ /** * Constructs a new UpdateSinkRequest. * @memberof google.logging.v2 * @classdesc Represents an UpdateSinkRequest. * @implements IUpdateSinkRequest * @constructor * @param {google.logging.v2.IUpdateSinkRequest=} [properties] Properties to set */ function UpdateSinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UpdateSinkRequest sinkName. * @member {string} sinkName * @memberof google.logging.v2.UpdateSinkRequest * @instance */ UpdateSinkRequest.prototype.sinkName = ""; /** * UpdateSinkRequest sink. * @member {google.logging.v2.ILogSink|null|undefined} sink * @memberof google.logging.v2.UpdateSinkRequest * @instance */ UpdateSinkRequest.prototype.sink = null; /** * UpdateSinkRequest uniqueWriterIdentity. * @member {boolean} uniqueWriterIdentity * @memberof google.logging.v2.UpdateSinkRequest * @instance */ UpdateSinkRequest.prototype.uniqueWriterIdentity = false; /** * UpdateSinkRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask * @memberof google.logging.v2.UpdateSinkRequest * @instance */ UpdateSinkRequest.prototype.updateMask = null; /** * Creates a new UpdateSinkRequest instance using the specified properties. * @function create * @memberof google.logging.v2.UpdateSinkRequest * @static * @param {google.logging.v2.IUpdateSinkRequest=} [properties] Properties to set * @returns {google.logging.v2.UpdateSinkRequest} UpdateSinkRequest instance */ UpdateSinkRequest.create = function create(properties) { return new UpdateSinkRequest(properties); }; /** * Encodes the specified UpdateSinkRequest message. Does not implicitly {@link google.logging.v2.UpdateSinkRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.UpdateSinkRequest * @static * @param {google.logging.v2.IUpdateSinkRequest} message UpdateSinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateSinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sinkName); if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) $root.google.logging.v2.LogSink.encode(message.sink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.uniqueWriterIdentity != null && Object.hasOwnProperty.call(message, "uniqueWriterIdentity")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.uniqueWriterIdentity); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** * Encodes the specified UpdateSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateSinkRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.UpdateSinkRequest * @static * @param {google.logging.v2.IUpdateSinkRequest} message UpdateSinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateSinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UpdateSinkRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.UpdateSinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.UpdateSinkRequest} UpdateSinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateSinkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateSinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.sinkName = reader.string(); break; case 2: message.sink = $root.google.logging.v2.LogSink.decode(reader, reader.uint32()); break; case 3: message.uniqueWriterIdentity = reader.bool(); break; case 4: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UpdateSinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.UpdateSinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.UpdateSinkRequest} UpdateSinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateSinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UpdateSinkRequest message. * @function verify * @memberof google.logging.v2.UpdateSinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UpdateSinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.sinkName != null && message.hasOwnProperty("sinkName")) if (!$util.isString(message.sinkName)) return "sinkName: string expected"; if (message.sink != null && message.hasOwnProperty("sink")) { var error = $root.google.logging.v2.LogSink.verify(message.sink); if (error) return "sink." + error; } if (message.uniqueWriterIdentity != null && message.hasOwnProperty("uniqueWriterIdentity")) if (typeof message.uniqueWriterIdentity !== "boolean") return "uniqueWriterIdentity: boolean expected"; if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) return "updateMask." + error; } return null; }; /** * Creates an UpdateSinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.UpdateSinkRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.UpdateSinkRequest} UpdateSinkRequest */ UpdateSinkRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.UpdateSinkRequest) return object; var message = new $root.google.logging.v2.UpdateSinkRequest(); if (object.sinkName != null) message.sinkName = String(object.sinkName); if (object.sink != null) { if (typeof object.sink !== "object") throw TypeError(".google.logging.v2.UpdateSinkRequest.sink: object expected"); message.sink = $root.google.logging.v2.LogSink.fromObject(object.sink); } if (object.uniqueWriterIdentity != null) message.uniqueWriterIdentity = Boolean(object.uniqueWriterIdentity); if (object.updateMask != null) { if (typeof object.updateMask !== "object") throw TypeError(".google.logging.v2.UpdateSinkRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** * Creates a plain object from an UpdateSinkRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.UpdateSinkRequest * @static * @param {google.logging.v2.UpdateSinkRequest} message UpdateSinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UpdateSinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.sinkName = ""; object.sink = null; object.uniqueWriterIdentity = false; object.updateMask = null; } if (message.sinkName != null && message.hasOwnProperty("sinkName")) object.sinkName = message.sinkName; if (message.sink != null && message.hasOwnProperty("sink")) object.sink = $root.google.logging.v2.LogSink.toObject(message.sink, options); if (message.uniqueWriterIdentity != null && message.hasOwnProperty("uniqueWriterIdentity")) object.uniqueWriterIdentity = message.uniqueWriterIdentity; if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** * Converts this UpdateSinkRequest to JSON. * @function toJSON * @memberof google.logging.v2.UpdateSinkRequest * @instance * @returns {Object.} JSON object */ UpdateSinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return UpdateSinkRequest; })(); v2.DeleteSinkRequest = (function() { /** * Properties of a DeleteSinkRequest. * @memberof google.logging.v2 * @interface IDeleteSinkRequest * @property {string|null} [sinkName] DeleteSinkRequest sinkName */ /** * Constructs a new DeleteSinkRequest. * @memberof google.logging.v2 * @classdesc Represents a DeleteSinkRequest. * @implements IDeleteSinkRequest * @constructor * @param {google.logging.v2.IDeleteSinkRequest=} [properties] Properties to set */ function DeleteSinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DeleteSinkRequest sinkName. * @member {string} sinkName * @memberof google.logging.v2.DeleteSinkRequest * @instance */ DeleteSinkRequest.prototype.sinkName = ""; /** * Creates a new DeleteSinkRequest instance using the specified properties. * @function create * @memberof google.logging.v2.DeleteSinkRequest * @static * @param {google.logging.v2.IDeleteSinkRequest=} [properties] Properties to set * @returns {google.logging.v2.DeleteSinkRequest} DeleteSinkRequest instance */ DeleteSinkRequest.create = function create(properties) { return new DeleteSinkRequest(properties); }; /** * Encodes the specified DeleteSinkRequest message. Does not implicitly {@link google.logging.v2.DeleteSinkRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.DeleteSinkRequest * @static * @param {google.logging.v2.IDeleteSinkRequest} message DeleteSinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteSinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sinkName); return writer; }; /** * Encodes the specified DeleteSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteSinkRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.DeleteSinkRequest * @static * @param {google.logging.v2.IDeleteSinkRequest} message DeleteSinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteSinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DeleteSinkRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.DeleteSinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.DeleteSinkRequest} DeleteSinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteSinkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteSinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.sinkName = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DeleteSinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.DeleteSinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.DeleteSinkRequest} DeleteSinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteSinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DeleteSinkRequest message. * @function verify * @memberof google.logging.v2.DeleteSinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DeleteSinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.sinkName != null && message.hasOwnProperty("sinkName")) if (!$util.isString(message.sinkName)) return "sinkName: string expected"; return null; }; /** * Creates a DeleteSinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.DeleteSinkRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.DeleteSinkRequest} DeleteSinkRequest */ DeleteSinkRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.DeleteSinkRequest) return object; var message = new $root.google.logging.v2.DeleteSinkRequest(); if (object.sinkName != null) message.sinkName = String(object.sinkName); return message; }; /** * Creates a plain object from a DeleteSinkRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.DeleteSinkRequest * @static * @param {google.logging.v2.DeleteSinkRequest} message DeleteSinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DeleteSinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.sinkName = ""; if (message.sinkName != null && message.hasOwnProperty("sinkName")) object.sinkName = message.sinkName; return object; }; /** * Converts this DeleteSinkRequest to JSON. * @function toJSON * @memberof google.logging.v2.DeleteSinkRequest * @instance * @returns {Object.} JSON object */ DeleteSinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DeleteSinkRequest; })(); v2.LogExclusion = (function() { /** * Properties of a LogExclusion. * @memberof google.logging.v2 * @interface ILogExclusion * @property {string|null} [name] LogExclusion name * @property {string|null} [description] LogExclusion description * @property {string|null} [filter] LogExclusion filter * @property {boolean|null} [disabled] LogExclusion disabled * @property {google.protobuf.ITimestamp|null} [createTime] LogExclusion createTime * @property {google.protobuf.ITimestamp|null} [updateTime] LogExclusion updateTime */ /** * Constructs a new LogExclusion. * @memberof google.logging.v2 * @classdesc Represents a LogExclusion. * @implements ILogExclusion * @constructor * @param {google.logging.v2.ILogExclusion=} [properties] Properties to set */ function LogExclusion(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LogExclusion name. * @member {string} name * @memberof google.logging.v2.LogExclusion * @instance */ LogExclusion.prototype.name = ""; /** * LogExclusion description. * @member {string} description * @memberof google.logging.v2.LogExclusion * @instance */ LogExclusion.prototype.description = ""; /** * LogExclusion filter. * @member {string} filter * @memberof google.logging.v2.LogExclusion * @instance */ LogExclusion.prototype.filter = ""; /** * LogExclusion disabled. * @member {boolean} disabled * @memberof google.logging.v2.LogExclusion * @instance */ LogExclusion.prototype.disabled = false; /** * LogExclusion createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime * @memberof google.logging.v2.LogExclusion * @instance */ LogExclusion.prototype.createTime = null; /** * LogExclusion updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime * @memberof google.logging.v2.LogExclusion * @instance */ LogExclusion.prototype.updateTime = null; /** * Creates a new LogExclusion instance using the specified properties. * @function create * @memberof google.logging.v2.LogExclusion * @static * @param {google.logging.v2.ILogExclusion=} [properties] Properties to set * @returns {google.logging.v2.LogExclusion} LogExclusion instance */ LogExclusion.create = function create(properties) { return new LogExclusion(properties); }; /** * Encodes the specified LogExclusion message. Does not implicitly {@link google.logging.v2.LogExclusion.verify|verify} messages. * @function encode * @memberof google.logging.v2.LogExclusion * @static * @param {google.logging.v2.ILogExclusion} message LogExclusion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogExclusion.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disabled); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** * Encodes the specified LogExclusion message, length delimited. Does not implicitly {@link google.logging.v2.LogExclusion.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.LogExclusion * @static * @param {google.logging.v2.ILogExclusion} message LogExclusion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogExclusion.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LogExclusion message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.LogExclusion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.LogExclusion} LogExclusion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogExclusion.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogExclusion(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.description = reader.string(); break; case 3: message.filter = reader.string(); break; case 4: message.disabled = reader.bool(); break; case 5: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 6: message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LogExclusion message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.LogExclusion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.LogExclusion} LogExclusion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogExclusion.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LogExclusion message. * @function verify * @memberof google.logging.v2.LogExclusion * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LogExclusion.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; if (message.disabled != null && message.hasOwnProperty("disabled")) if (typeof message.disabled !== "boolean") return "disabled: boolean expected"; if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) return "createTime." + error; } if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) return "updateTime." + error; } return null; }; /** * Creates a LogExclusion message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.LogExclusion * @static * @param {Object.} object Plain object * @returns {google.logging.v2.LogExclusion} LogExclusion */ LogExclusion.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.LogExclusion) return object; var message = new $root.google.logging.v2.LogExclusion(); if (object.name != null) message.name = String(object.name); if (object.description != null) message.description = String(object.description); if (object.filter != null) message.filter = String(object.filter); if (object.disabled != null) message.disabled = Boolean(object.disabled); if (object.createTime != null) { if (typeof object.createTime !== "object") throw TypeError(".google.logging.v2.LogExclusion.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.updateTime != null) { if (typeof object.updateTime !== "object") throw TypeError(".google.logging.v2.LogExclusion.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } return message; }; /** * Creates a plain object from a LogExclusion message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.LogExclusion * @static * @param {google.logging.v2.LogExclusion} message LogExclusion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LogExclusion.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.description = ""; object.filter = ""; object.disabled = false; object.createTime = null; object.updateTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.disabled != null && message.hasOwnProperty("disabled")) object.disabled = message.disabled; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** * Converts this LogExclusion to JSON. * @function toJSON * @memberof google.logging.v2.LogExclusion * @instance * @returns {Object.} JSON object */ LogExclusion.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return LogExclusion; })(); v2.ListExclusionsRequest = (function() { /** * Properties of a ListExclusionsRequest. * @memberof google.logging.v2 * @interface IListExclusionsRequest * @property {string|null} [parent] ListExclusionsRequest parent * @property {string|null} [pageToken] ListExclusionsRequest pageToken * @property {number|null} [pageSize] ListExclusionsRequest pageSize */ /** * Constructs a new ListExclusionsRequest. * @memberof google.logging.v2 * @classdesc Represents a ListExclusionsRequest. * @implements IListExclusionsRequest * @constructor * @param {google.logging.v2.IListExclusionsRequest=} [properties] Properties to set */ function ListExclusionsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListExclusionsRequest parent. * @member {string} parent * @memberof google.logging.v2.ListExclusionsRequest * @instance */ ListExclusionsRequest.prototype.parent = ""; /** * ListExclusionsRequest pageToken. * @member {string} pageToken * @memberof google.logging.v2.ListExclusionsRequest * @instance */ ListExclusionsRequest.prototype.pageToken = ""; /** * ListExclusionsRequest pageSize. * @member {number} pageSize * @memberof google.logging.v2.ListExclusionsRequest * @instance */ ListExclusionsRequest.prototype.pageSize = 0; /** * Creates a new ListExclusionsRequest instance using the specified properties. * @function create * @memberof google.logging.v2.ListExclusionsRequest * @static * @param {google.logging.v2.IListExclusionsRequest=} [properties] Properties to set * @returns {google.logging.v2.ListExclusionsRequest} ListExclusionsRequest instance */ ListExclusionsRequest.create = function create(properties) { return new ListExclusionsRequest(properties); }; /** * Encodes the specified ListExclusionsRequest message. Does not implicitly {@link google.logging.v2.ListExclusionsRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListExclusionsRequest * @static * @param {google.logging.v2.IListExclusionsRequest} message ListExclusionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListExclusionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; /** * Encodes the specified ListExclusionsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListExclusionsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListExclusionsRequest * @static * @param {google.logging.v2.IListExclusionsRequest} message ListExclusionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListExclusionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListExclusionsRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListExclusionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListExclusionsRequest} ListExclusionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListExclusionsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListExclusionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.pageToken = reader.string(); break; case 3: message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListExclusionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListExclusionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListExclusionsRequest} ListExclusionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListExclusionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListExclusionsRequest message. * @function verify * @memberof google.logging.v2.ListExclusionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListExclusionsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; return null; }; /** * Creates a ListExclusionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListExclusionsRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListExclusionsRequest} ListExclusionsRequest */ ListExclusionsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListExclusionsRequest) return object; var message = new $root.google.logging.v2.ListExclusionsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) message.pageSize = object.pageSize | 0; return message; }; /** * Creates a plain object from a ListExclusionsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListExclusionsRequest * @static * @param {google.logging.v2.ListExclusionsRequest} message ListExclusionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListExclusionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.pageToken = ""; object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; return object; }; /** * Converts this ListExclusionsRequest to JSON. * @function toJSON * @memberof google.logging.v2.ListExclusionsRequest * @instance * @returns {Object.} JSON object */ ListExclusionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListExclusionsRequest; })(); v2.ListExclusionsResponse = (function() { /** * Properties of a ListExclusionsResponse. * @memberof google.logging.v2 * @interface IListExclusionsResponse * @property {Array.|null} [exclusions] ListExclusionsResponse exclusions * @property {string|null} [nextPageToken] ListExclusionsResponse nextPageToken */ /** * Constructs a new ListExclusionsResponse. * @memberof google.logging.v2 * @classdesc Represents a ListExclusionsResponse. * @implements IListExclusionsResponse * @constructor * @param {google.logging.v2.IListExclusionsResponse=} [properties] Properties to set */ function ListExclusionsResponse(properties) { this.exclusions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListExclusionsResponse exclusions. * @member {Array.} exclusions * @memberof google.logging.v2.ListExclusionsResponse * @instance */ ListExclusionsResponse.prototype.exclusions = $util.emptyArray; /** * ListExclusionsResponse nextPageToken. * @member {string} nextPageToken * @memberof google.logging.v2.ListExclusionsResponse * @instance */ ListExclusionsResponse.prototype.nextPageToken = ""; /** * Creates a new ListExclusionsResponse instance using the specified properties. * @function create * @memberof google.logging.v2.ListExclusionsResponse * @static * @param {google.logging.v2.IListExclusionsResponse=} [properties] Properties to set * @returns {google.logging.v2.ListExclusionsResponse} ListExclusionsResponse instance */ ListExclusionsResponse.create = function create(properties) { return new ListExclusionsResponse(properties); }; /** * Encodes the specified ListExclusionsResponse message. Does not implicitly {@link google.logging.v2.ListExclusionsResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListExclusionsResponse * @static * @param {google.logging.v2.IListExclusionsResponse} message ListExclusionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListExclusionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.exclusions != null && message.exclusions.length) for (var i = 0; i < message.exclusions.length; ++i) $root.google.logging.v2.LogExclusion.encode(message.exclusions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListExclusionsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListExclusionsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListExclusionsResponse * @static * @param {google.logging.v2.IListExclusionsResponse} message ListExclusionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListExclusionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListExclusionsResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListExclusionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListExclusionsResponse} ListExclusionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListExclusionsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListExclusionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.exclusions && message.exclusions.length)) message.exclusions = []; message.exclusions.push($root.google.logging.v2.LogExclusion.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListExclusionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListExclusionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListExclusionsResponse} ListExclusionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListExclusionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListExclusionsResponse message. * @function verify * @memberof google.logging.v2.ListExclusionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListExclusionsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.exclusions != null && message.hasOwnProperty("exclusions")) { if (!Array.isArray(message.exclusions)) return "exclusions: array expected"; for (var i = 0; i < message.exclusions.length; ++i) { var error = $root.google.logging.v2.LogExclusion.verify(message.exclusions[i]); if (error) return "exclusions." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListExclusionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListExclusionsResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListExclusionsResponse} ListExclusionsResponse */ ListExclusionsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListExclusionsResponse) return object; var message = new $root.google.logging.v2.ListExclusionsResponse(); if (object.exclusions) { if (!Array.isArray(object.exclusions)) throw TypeError(".google.logging.v2.ListExclusionsResponse.exclusions: array expected"); message.exclusions = []; for (var i = 0; i < object.exclusions.length; ++i) { if (typeof object.exclusions[i] !== "object") throw TypeError(".google.logging.v2.ListExclusionsResponse.exclusions: object expected"); message.exclusions[i] = $root.google.logging.v2.LogExclusion.fromObject(object.exclusions[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListExclusionsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListExclusionsResponse * @static * @param {google.logging.v2.ListExclusionsResponse} message ListExclusionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListExclusionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.exclusions = []; if (options.defaults) object.nextPageToken = ""; if (message.exclusions && message.exclusions.length) { object.exclusions = []; for (var j = 0; j < message.exclusions.length; ++j) object.exclusions[j] = $root.google.logging.v2.LogExclusion.toObject(message.exclusions[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListExclusionsResponse to JSON. * @function toJSON * @memberof google.logging.v2.ListExclusionsResponse * @instance * @returns {Object.} JSON object */ ListExclusionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListExclusionsResponse; })(); v2.GetExclusionRequest = (function() { /** * Properties of a GetExclusionRequest. * @memberof google.logging.v2 * @interface IGetExclusionRequest * @property {string|null} [name] GetExclusionRequest name */ /** * Constructs a new GetExclusionRequest. * @memberof google.logging.v2 * @classdesc Represents a GetExclusionRequest. * @implements IGetExclusionRequest * @constructor * @param {google.logging.v2.IGetExclusionRequest=} [properties] Properties to set */ function GetExclusionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetExclusionRequest name. * @member {string} name * @memberof google.logging.v2.GetExclusionRequest * @instance */ GetExclusionRequest.prototype.name = ""; /** * Creates a new GetExclusionRequest instance using the specified properties. * @function create * @memberof google.logging.v2.GetExclusionRequest * @static * @param {google.logging.v2.IGetExclusionRequest=} [properties] Properties to set * @returns {google.logging.v2.GetExclusionRequest} GetExclusionRequest instance */ GetExclusionRequest.create = function create(properties) { return new GetExclusionRequest(properties); }; /** * Encodes the specified GetExclusionRequest message. Does not implicitly {@link google.logging.v2.GetExclusionRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.GetExclusionRequest * @static * @param {google.logging.v2.IGetExclusionRequest} message GetExclusionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetExclusionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified GetExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetExclusionRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.GetExclusionRequest * @static * @param {google.logging.v2.IGetExclusionRequest} message GetExclusionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetExclusionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetExclusionRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.GetExclusionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.GetExclusionRequest} GetExclusionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetExclusionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetExclusionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetExclusionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.GetExclusionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.GetExclusionRequest} GetExclusionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetExclusionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetExclusionRequest message. * @function verify * @memberof google.logging.v2.GetExclusionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetExclusionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a GetExclusionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.GetExclusionRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.GetExclusionRequest} GetExclusionRequest */ GetExclusionRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.GetExclusionRequest) return object; var message = new $root.google.logging.v2.GetExclusionRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a GetExclusionRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.GetExclusionRequest * @static * @param {google.logging.v2.GetExclusionRequest} message GetExclusionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetExclusionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this GetExclusionRequest to JSON. * @function toJSON * @memberof google.logging.v2.GetExclusionRequest * @instance * @returns {Object.} JSON object */ GetExclusionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetExclusionRequest; })(); v2.CreateExclusionRequest = (function() { /** * Properties of a CreateExclusionRequest. * @memberof google.logging.v2 * @interface ICreateExclusionRequest * @property {string|null} [parent] CreateExclusionRequest parent * @property {google.logging.v2.ILogExclusion|null} [exclusion] CreateExclusionRequest exclusion */ /** * Constructs a new CreateExclusionRequest. * @memberof google.logging.v2 * @classdesc Represents a CreateExclusionRequest. * @implements ICreateExclusionRequest * @constructor * @param {google.logging.v2.ICreateExclusionRequest=} [properties] Properties to set */ function CreateExclusionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CreateExclusionRequest parent. * @member {string} parent * @memberof google.logging.v2.CreateExclusionRequest * @instance */ CreateExclusionRequest.prototype.parent = ""; /** * CreateExclusionRequest exclusion. * @member {google.logging.v2.ILogExclusion|null|undefined} exclusion * @memberof google.logging.v2.CreateExclusionRequest * @instance */ CreateExclusionRequest.prototype.exclusion = null; /** * Creates a new CreateExclusionRequest instance using the specified properties. * @function create * @memberof google.logging.v2.CreateExclusionRequest * @static * @param {google.logging.v2.ICreateExclusionRequest=} [properties] Properties to set * @returns {google.logging.v2.CreateExclusionRequest} CreateExclusionRequest instance */ CreateExclusionRequest.create = function create(properties) { return new CreateExclusionRequest(properties); }; /** * Encodes the specified CreateExclusionRequest message. Does not implicitly {@link google.logging.v2.CreateExclusionRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.CreateExclusionRequest * @static * @param {google.logging.v2.ICreateExclusionRequest} message CreateExclusionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateExclusionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) $root.google.logging.v2.LogExclusion.encode(message.exclusion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified CreateExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateExclusionRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.CreateExclusionRequest * @static * @param {google.logging.v2.ICreateExclusionRequest} message CreateExclusionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateExclusionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CreateExclusionRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.CreateExclusionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.CreateExclusionRequest} CreateExclusionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateExclusionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateExclusionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.exclusion = $root.google.logging.v2.LogExclusion.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CreateExclusionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.CreateExclusionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.CreateExclusionRequest} CreateExclusionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateExclusionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CreateExclusionRequest message. * @function verify * @memberof google.logging.v2.CreateExclusionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CreateExclusionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.exclusion != null && message.hasOwnProperty("exclusion")) { var error = $root.google.logging.v2.LogExclusion.verify(message.exclusion); if (error) return "exclusion." + error; } return null; }; /** * Creates a CreateExclusionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.CreateExclusionRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.CreateExclusionRequest} CreateExclusionRequest */ CreateExclusionRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.CreateExclusionRequest) return object; var message = new $root.google.logging.v2.CreateExclusionRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.exclusion != null) { if (typeof object.exclusion !== "object") throw TypeError(".google.logging.v2.CreateExclusionRequest.exclusion: object expected"); message.exclusion = $root.google.logging.v2.LogExclusion.fromObject(object.exclusion); } return message; }; /** * Creates a plain object from a CreateExclusionRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.CreateExclusionRequest * @static * @param {google.logging.v2.CreateExclusionRequest} message CreateExclusionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CreateExclusionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.exclusion = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.exclusion != null && message.hasOwnProperty("exclusion")) object.exclusion = $root.google.logging.v2.LogExclusion.toObject(message.exclusion, options); return object; }; /** * Converts this CreateExclusionRequest to JSON. * @function toJSON * @memberof google.logging.v2.CreateExclusionRequest * @instance * @returns {Object.} JSON object */ CreateExclusionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CreateExclusionRequest; })(); v2.UpdateExclusionRequest = (function() { /** * Properties of an UpdateExclusionRequest. * @memberof google.logging.v2 * @interface IUpdateExclusionRequest * @property {string|null} [name] UpdateExclusionRequest name * @property {google.logging.v2.ILogExclusion|null} [exclusion] UpdateExclusionRequest exclusion * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExclusionRequest updateMask */ /** * Constructs a new UpdateExclusionRequest. * @memberof google.logging.v2 * @classdesc Represents an UpdateExclusionRequest. * @implements IUpdateExclusionRequest * @constructor * @param {google.logging.v2.IUpdateExclusionRequest=} [properties] Properties to set */ function UpdateExclusionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UpdateExclusionRequest name. * @member {string} name * @memberof google.logging.v2.UpdateExclusionRequest * @instance */ UpdateExclusionRequest.prototype.name = ""; /** * UpdateExclusionRequest exclusion. * @member {google.logging.v2.ILogExclusion|null|undefined} exclusion * @memberof google.logging.v2.UpdateExclusionRequest * @instance */ UpdateExclusionRequest.prototype.exclusion = null; /** * UpdateExclusionRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask * @memberof google.logging.v2.UpdateExclusionRequest * @instance */ UpdateExclusionRequest.prototype.updateMask = null; /** * Creates a new UpdateExclusionRequest instance using the specified properties. * @function create * @memberof google.logging.v2.UpdateExclusionRequest * @static * @param {google.logging.v2.IUpdateExclusionRequest=} [properties] Properties to set * @returns {google.logging.v2.UpdateExclusionRequest} UpdateExclusionRequest instance */ UpdateExclusionRequest.create = function create(properties) { return new UpdateExclusionRequest(properties); }; /** * Encodes the specified UpdateExclusionRequest message. Does not implicitly {@link google.logging.v2.UpdateExclusionRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.UpdateExclusionRequest * @static * @param {google.logging.v2.IUpdateExclusionRequest} message UpdateExclusionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateExclusionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) $root.google.logging.v2.LogExclusion.encode(message.exclusion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified UpdateExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateExclusionRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.UpdateExclusionRequest * @static * @param {google.logging.v2.IUpdateExclusionRequest} message UpdateExclusionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateExclusionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UpdateExclusionRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.UpdateExclusionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.UpdateExclusionRequest} UpdateExclusionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateExclusionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateExclusionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.exclusion = $root.google.logging.v2.LogExclusion.decode(reader, reader.uint32()); break; case 3: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UpdateExclusionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.UpdateExclusionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.UpdateExclusionRequest} UpdateExclusionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateExclusionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UpdateExclusionRequest message. * @function verify * @memberof google.logging.v2.UpdateExclusionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UpdateExclusionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.exclusion != null && message.hasOwnProperty("exclusion")) { var error = $root.google.logging.v2.LogExclusion.verify(message.exclusion); if (error) return "exclusion." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) return "updateMask." + error; } return null; }; /** * Creates an UpdateExclusionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.UpdateExclusionRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.UpdateExclusionRequest} UpdateExclusionRequest */ UpdateExclusionRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.UpdateExclusionRequest) return object; var message = new $root.google.logging.v2.UpdateExclusionRequest(); if (object.name != null) message.name = String(object.name); if (object.exclusion != null) { if (typeof object.exclusion !== "object") throw TypeError(".google.logging.v2.UpdateExclusionRequest.exclusion: object expected"); message.exclusion = $root.google.logging.v2.LogExclusion.fromObject(object.exclusion); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") throw TypeError(".google.logging.v2.UpdateExclusionRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** * Creates a plain object from an UpdateExclusionRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.UpdateExclusionRequest * @static * @param {google.logging.v2.UpdateExclusionRequest} message UpdateExclusionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UpdateExclusionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.exclusion = null; object.updateMask = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.exclusion != null && message.hasOwnProperty("exclusion")) object.exclusion = $root.google.logging.v2.LogExclusion.toObject(message.exclusion, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** * Converts this UpdateExclusionRequest to JSON. * @function toJSON * @memberof google.logging.v2.UpdateExclusionRequest * @instance * @returns {Object.} JSON object */ UpdateExclusionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return UpdateExclusionRequest; })(); v2.DeleteExclusionRequest = (function() { /** * Properties of a DeleteExclusionRequest. * @memberof google.logging.v2 * @interface IDeleteExclusionRequest * @property {string|null} [name] DeleteExclusionRequest name */ /** * Constructs a new DeleteExclusionRequest. * @memberof google.logging.v2 * @classdesc Represents a DeleteExclusionRequest. * @implements IDeleteExclusionRequest * @constructor * @param {google.logging.v2.IDeleteExclusionRequest=} [properties] Properties to set */ function DeleteExclusionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DeleteExclusionRequest name. * @member {string} name * @memberof google.logging.v2.DeleteExclusionRequest * @instance */ DeleteExclusionRequest.prototype.name = ""; /** * Creates a new DeleteExclusionRequest instance using the specified properties. * @function create * @memberof google.logging.v2.DeleteExclusionRequest * @static * @param {google.logging.v2.IDeleteExclusionRequest=} [properties] Properties to set * @returns {google.logging.v2.DeleteExclusionRequest} DeleteExclusionRequest instance */ DeleteExclusionRequest.create = function create(properties) { return new DeleteExclusionRequest(properties); }; /** * Encodes the specified DeleteExclusionRequest message. Does not implicitly {@link google.logging.v2.DeleteExclusionRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.DeleteExclusionRequest * @static * @param {google.logging.v2.IDeleteExclusionRequest} message DeleteExclusionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteExclusionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified DeleteExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteExclusionRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.DeleteExclusionRequest * @static * @param {google.logging.v2.IDeleteExclusionRequest} message DeleteExclusionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteExclusionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DeleteExclusionRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.DeleteExclusionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.DeleteExclusionRequest} DeleteExclusionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteExclusionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteExclusionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DeleteExclusionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.DeleteExclusionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.DeleteExclusionRequest} DeleteExclusionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteExclusionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DeleteExclusionRequest message. * @function verify * @memberof google.logging.v2.DeleteExclusionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DeleteExclusionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a DeleteExclusionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.DeleteExclusionRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.DeleteExclusionRequest} DeleteExclusionRequest */ DeleteExclusionRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.DeleteExclusionRequest) return object; var message = new $root.google.logging.v2.DeleteExclusionRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a DeleteExclusionRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.DeleteExclusionRequest * @static * @param {google.logging.v2.DeleteExclusionRequest} message DeleteExclusionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DeleteExclusionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this DeleteExclusionRequest to JSON. * @function toJSON * @memberof google.logging.v2.DeleteExclusionRequest * @instance * @returns {Object.} JSON object */ DeleteExclusionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DeleteExclusionRequest; })(); v2.GetCmekSettingsRequest = (function() { /** * Properties of a GetCmekSettingsRequest. * @memberof google.logging.v2 * @interface IGetCmekSettingsRequest * @property {string|null} [name] GetCmekSettingsRequest name */ /** * Constructs a new GetCmekSettingsRequest. * @memberof google.logging.v2 * @classdesc Represents a GetCmekSettingsRequest. * @implements IGetCmekSettingsRequest * @constructor * @param {google.logging.v2.IGetCmekSettingsRequest=} [properties] Properties to set */ function GetCmekSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetCmekSettingsRequest name. * @member {string} name * @memberof google.logging.v2.GetCmekSettingsRequest * @instance */ GetCmekSettingsRequest.prototype.name = ""; /** * Creates a new GetCmekSettingsRequest instance using the specified properties. * @function create * @memberof google.logging.v2.GetCmekSettingsRequest * @static * @param {google.logging.v2.IGetCmekSettingsRequest=} [properties] Properties to set * @returns {google.logging.v2.GetCmekSettingsRequest} GetCmekSettingsRequest instance */ GetCmekSettingsRequest.create = function create(properties) { return new GetCmekSettingsRequest(properties); }; /** * Encodes the specified GetCmekSettingsRequest message. Does not implicitly {@link google.logging.v2.GetCmekSettingsRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.GetCmekSettingsRequest * @static * @param {google.logging.v2.IGetCmekSettingsRequest} message GetCmekSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetCmekSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified GetCmekSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetCmekSettingsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.GetCmekSettingsRequest * @static * @param {google.logging.v2.IGetCmekSettingsRequest} message GetCmekSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetCmekSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetCmekSettingsRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.GetCmekSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.GetCmekSettingsRequest} GetCmekSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetCmekSettingsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetCmekSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetCmekSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.GetCmekSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.GetCmekSettingsRequest} GetCmekSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetCmekSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetCmekSettingsRequest message. * @function verify * @memberof google.logging.v2.GetCmekSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetCmekSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a GetCmekSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.GetCmekSettingsRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.GetCmekSettingsRequest} GetCmekSettingsRequest */ GetCmekSettingsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.GetCmekSettingsRequest) return object; var message = new $root.google.logging.v2.GetCmekSettingsRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a GetCmekSettingsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.GetCmekSettingsRequest * @static * @param {google.logging.v2.GetCmekSettingsRequest} message GetCmekSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetCmekSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this GetCmekSettingsRequest to JSON. * @function toJSON * @memberof google.logging.v2.GetCmekSettingsRequest * @instance * @returns {Object.} JSON object */ GetCmekSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetCmekSettingsRequest; })(); v2.UpdateCmekSettingsRequest = (function() { /** * Properties of an UpdateCmekSettingsRequest. * @memberof google.logging.v2 * @interface IUpdateCmekSettingsRequest * @property {string|null} [name] UpdateCmekSettingsRequest name * @property {google.logging.v2.ICmekSettings|null} [cmekSettings] UpdateCmekSettingsRequest cmekSettings * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCmekSettingsRequest updateMask */ /** * Constructs a new UpdateCmekSettingsRequest. * @memberof google.logging.v2 * @classdesc Represents an UpdateCmekSettingsRequest. * @implements IUpdateCmekSettingsRequest * @constructor * @param {google.logging.v2.IUpdateCmekSettingsRequest=} [properties] Properties to set */ function UpdateCmekSettingsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UpdateCmekSettingsRequest name. * @member {string} name * @memberof google.logging.v2.UpdateCmekSettingsRequest * @instance */ UpdateCmekSettingsRequest.prototype.name = ""; /** * UpdateCmekSettingsRequest cmekSettings. * @member {google.logging.v2.ICmekSettings|null|undefined} cmekSettings * @memberof google.logging.v2.UpdateCmekSettingsRequest * @instance */ UpdateCmekSettingsRequest.prototype.cmekSettings = null; /** * UpdateCmekSettingsRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask * @memberof google.logging.v2.UpdateCmekSettingsRequest * @instance */ UpdateCmekSettingsRequest.prototype.updateMask = null; /** * Creates a new UpdateCmekSettingsRequest instance using the specified properties. * @function create * @memberof google.logging.v2.UpdateCmekSettingsRequest * @static * @param {google.logging.v2.IUpdateCmekSettingsRequest=} [properties] Properties to set * @returns {google.logging.v2.UpdateCmekSettingsRequest} UpdateCmekSettingsRequest instance */ UpdateCmekSettingsRequest.create = function create(properties) { return new UpdateCmekSettingsRequest(properties); }; /** * Encodes the specified UpdateCmekSettingsRequest message. Does not implicitly {@link google.logging.v2.UpdateCmekSettingsRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.UpdateCmekSettingsRequest * @static * @param {google.logging.v2.IUpdateCmekSettingsRequest} message UpdateCmekSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateCmekSettingsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.cmekSettings != null && Object.hasOwnProperty.call(message, "cmekSettings")) $root.google.logging.v2.CmekSettings.encode(message.cmekSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified UpdateCmekSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateCmekSettingsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.UpdateCmekSettingsRequest * @static * @param {google.logging.v2.IUpdateCmekSettingsRequest} message UpdateCmekSettingsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateCmekSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UpdateCmekSettingsRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.UpdateCmekSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.UpdateCmekSettingsRequest} UpdateCmekSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateCmekSettingsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateCmekSettingsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.cmekSettings = $root.google.logging.v2.CmekSettings.decode(reader, reader.uint32()); break; case 3: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UpdateCmekSettingsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.UpdateCmekSettingsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.UpdateCmekSettingsRequest} UpdateCmekSettingsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateCmekSettingsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UpdateCmekSettingsRequest message. * @function verify * @memberof google.logging.v2.UpdateCmekSettingsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UpdateCmekSettingsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.cmekSettings != null && message.hasOwnProperty("cmekSettings")) { var error = $root.google.logging.v2.CmekSettings.verify(message.cmekSettings); if (error) return "cmekSettings." + error; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) return "updateMask." + error; } return null; }; /** * Creates an UpdateCmekSettingsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.UpdateCmekSettingsRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.UpdateCmekSettingsRequest} UpdateCmekSettingsRequest */ UpdateCmekSettingsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.UpdateCmekSettingsRequest) return object; var message = new $root.google.logging.v2.UpdateCmekSettingsRequest(); if (object.name != null) message.name = String(object.name); if (object.cmekSettings != null) { if (typeof object.cmekSettings !== "object") throw TypeError(".google.logging.v2.UpdateCmekSettingsRequest.cmekSettings: object expected"); message.cmekSettings = $root.google.logging.v2.CmekSettings.fromObject(object.cmekSettings); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") throw TypeError(".google.logging.v2.UpdateCmekSettingsRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** * Creates a plain object from an UpdateCmekSettingsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.UpdateCmekSettingsRequest * @static * @param {google.logging.v2.UpdateCmekSettingsRequest} message UpdateCmekSettingsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UpdateCmekSettingsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.cmekSettings = null; object.updateMask = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.cmekSettings != null && message.hasOwnProperty("cmekSettings")) object.cmekSettings = $root.google.logging.v2.CmekSettings.toObject(message.cmekSettings, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** * Converts this UpdateCmekSettingsRequest to JSON. * @function toJSON * @memberof google.logging.v2.UpdateCmekSettingsRequest * @instance * @returns {Object.} JSON object */ UpdateCmekSettingsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return UpdateCmekSettingsRequest; })(); v2.CmekSettings = (function() { /** * Properties of a CmekSettings. * @memberof google.logging.v2 * @interface ICmekSettings * @property {string|null} [name] CmekSettings name * @property {string|null} [kmsKeyName] CmekSettings kmsKeyName * @property {string|null} [serviceAccountId] CmekSettings serviceAccountId */ /** * Constructs a new CmekSettings. * @memberof google.logging.v2 * @classdesc Represents a CmekSettings. * @implements ICmekSettings * @constructor * @param {google.logging.v2.ICmekSettings=} [properties] Properties to set */ function CmekSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CmekSettings name. * @member {string} name * @memberof google.logging.v2.CmekSettings * @instance */ CmekSettings.prototype.name = ""; /** * CmekSettings kmsKeyName. * @member {string} kmsKeyName * @memberof google.logging.v2.CmekSettings * @instance */ CmekSettings.prototype.kmsKeyName = ""; /** * CmekSettings serviceAccountId. * @member {string} serviceAccountId * @memberof google.logging.v2.CmekSettings * @instance */ CmekSettings.prototype.serviceAccountId = ""; /** * Creates a new CmekSettings instance using the specified properties. * @function create * @memberof google.logging.v2.CmekSettings * @static * @param {google.logging.v2.ICmekSettings=} [properties] Properties to set * @returns {google.logging.v2.CmekSettings} CmekSettings instance */ CmekSettings.create = function create(properties) { return new CmekSettings(properties); }; /** * Encodes the specified CmekSettings message. Does not implicitly {@link google.logging.v2.CmekSettings.verify|verify} messages. * @function encode * @memberof google.logging.v2.CmekSettings * @static * @param {google.logging.v2.ICmekSettings} message CmekSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CmekSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); if (message.serviceAccountId != null && Object.hasOwnProperty.call(message, "serviceAccountId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceAccountId); return writer; }; /** * Encodes the specified CmekSettings message, length delimited. Does not implicitly {@link google.logging.v2.CmekSettings.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.CmekSettings * @static * @param {google.logging.v2.ICmekSettings} message CmekSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CmekSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CmekSettings message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.CmekSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.CmekSettings} CmekSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CmekSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CmekSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.kmsKeyName = reader.string(); break; case 3: message.serviceAccountId = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CmekSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.CmekSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.CmekSettings} CmekSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CmekSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CmekSettings message. * @function verify * @memberof google.logging.v2.CmekSettings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CmekSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) if (!$util.isString(message.kmsKeyName)) return "kmsKeyName: string expected"; if (message.serviceAccountId != null && message.hasOwnProperty("serviceAccountId")) if (!$util.isString(message.serviceAccountId)) return "serviceAccountId: string expected"; return null; }; /** * Creates a CmekSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.CmekSettings * @static * @param {Object.} object Plain object * @returns {google.logging.v2.CmekSettings} CmekSettings */ CmekSettings.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.CmekSettings) return object; var message = new $root.google.logging.v2.CmekSettings(); if (object.name != null) message.name = String(object.name); if (object.kmsKeyName != null) message.kmsKeyName = String(object.kmsKeyName); if (object.serviceAccountId != null) message.serviceAccountId = String(object.serviceAccountId); return message; }; /** * Creates a plain object from a CmekSettings message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.CmekSettings * @static * @param {google.logging.v2.CmekSettings} message CmekSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CmekSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.kmsKeyName = ""; object.serviceAccountId = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) object.kmsKeyName = message.kmsKeyName; if (message.serviceAccountId != null && message.hasOwnProperty("serviceAccountId")) object.serviceAccountId = message.serviceAccountId; return object; }; /** * Converts this CmekSettings to JSON. * @function toJSON * @memberof google.logging.v2.CmekSettings * @instance * @returns {Object.} JSON object */ CmekSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CmekSettings; })(); v2.MetricsServiceV2 = (function() { /** * Constructs a new MetricsServiceV2 service. * @memberof google.logging.v2 * @classdesc Represents a MetricsServiceV2 * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function MetricsServiceV2(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (MetricsServiceV2.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsServiceV2; /** * Creates new MetricsServiceV2 service using the specified rpc implementation. * @function create * @memberof google.logging.v2.MetricsServiceV2 * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {MetricsServiceV2} RPC service. Useful where requests and/or responses are streamed. */ MetricsServiceV2.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link google.logging.v2.MetricsServiceV2#listLogMetrics}. * @memberof google.logging.v2.MetricsServiceV2 * @typedef ListLogMetricsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.ListLogMetricsResponse} [response] ListLogMetricsResponse */ /** * Calls ListLogMetrics. * @function listLogMetrics * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.IListLogMetricsRequest} request ListLogMetricsRequest message or plain object * @param {google.logging.v2.MetricsServiceV2.ListLogMetricsCallback} callback Node-style callback called with the error, if any, and ListLogMetricsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(MetricsServiceV2.prototype.listLogMetrics = function listLogMetrics(request, callback) { return this.rpcCall(listLogMetrics, $root.google.logging.v2.ListLogMetricsRequest, $root.google.logging.v2.ListLogMetricsResponse, request, callback); }, "name", { value: "ListLogMetrics" }); /** * Calls ListLogMetrics. * @function listLogMetrics * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.IListLogMetricsRequest} request ListLogMetricsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.MetricsServiceV2#getLogMetric}. * @memberof google.logging.v2.MetricsServiceV2 * @typedef GetLogMetricCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogMetric} [response] LogMetric */ /** * Calls GetLogMetric. * @function getLogMetric * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.IGetLogMetricRequest} request GetLogMetricRequest message or plain object * @param {google.logging.v2.MetricsServiceV2.GetLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric * @returns {undefined} * @variation 1 */ Object.defineProperty(MetricsServiceV2.prototype.getLogMetric = function getLogMetric(request, callback) { return this.rpcCall(getLogMetric, $root.google.logging.v2.GetLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); }, "name", { value: "GetLogMetric" }); /** * Calls GetLogMetric. * @function getLogMetric * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.IGetLogMetricRequest} request GetLogMetricRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.MetricsServiceV2#createLogMetric}. * @memberof google.logging.v2.MetricsServiceV2 * @typedef CreateLogMetricCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogMetric} [response] LogMetric */ /** * Calls CreateLogMetric. * @function createLogMetric * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.ICreateLogMetricRequest} request CreateLogMetricRequest message or plain object * @param {google.logging.v2.MetricsServiceV2.CreateLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric * @returns {undefined} * @variation 1 */ Object.defineProperty(MetricsServiceV2.prototype.createLogMetric = function createLogMetric(request, callback) { return this.rpcCall(createLogMetric, $root.google.logging.v2.CreateLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); }, "name", { value: "CreateLogMetric" }); /** * Calls CreateLogMetric. * @function createLogMetric * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.ICreateLogMetricRequest} request CreateLogMetricRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.MetricsServiceV2#updateLogMetric}. * @memberof google.logging.v2.MetricsServiceV2 * @typedef UpdateLogMetricCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.logging.v2.LogMetric} [response] LogMetric */ /** * Calls UpdateLogMetric. * @function updateLogMetric * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.IUpdateLogMetricRequest} request UpdateLogMetricRequest message or plain object * @param {google.logging.v2.MetricsServiceV2.UpdateLogMetricCallback} callback Node-style callback called with the error, if any, and LogMetric * @returns {undefined} * @variation 1 */ Object.defineProperty(MetricsServiceV2.prototype.updateLogMetric = function updateLogMetric(request, callback) { return this.rpcCall(updateLogMetric, $root.google.logging.v2.UpdateLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); }, "name", { value: "UpdateLogMetric" }); /** * Calls UpdateLogMetric. * @function updateLogMetric * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.IUpdateLogMetricRequest} request UpdateLogMetricRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.logging.v2.MetricsServiceV2#deleteLogMetric}. * @memberof google.logging.v2.MetricsServiceV2 * @typedef DeleteLogMetricCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls DeleteLogMetric. * @function deleteLogMetric * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.IDeleteLogMetricRequest} request DeleteLogMetricRequest message or plain object * @param {google.logging.v2.MetricsServiceV2.DeleteLogMetricCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(MetricsServiceV2.prototype.deleteLogMetric = function deleteLogMetric(request, callback) { return this.rpcCall(deleteLogMetric, $root.google.logging.v2.DeleteLogMetricRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteLogMetric" }); /** * Calls DeleteLogMetric. * @function deleteLogMetric * @memberof google.logging.v2.MetricsServiceV2 * @instance * @param {google.logging.v2.IDeleteLogMetricRequest} request DeleteLogMetricRequest message or plain object * @returns {Promise} Promise * @variation 2 */ return MetricsServiceV2; })(); v2.LogMetric = (function() { /** * Properties of a LogMetric. * @memberof google.logging.v2 * @interface ILogMetric * @property {string|null} [name] LogMetric name * @property {string|null} [description] LogMetric description * @property {string|null} [filter] LogMetric filter * @property {google.api.IMetricDescriptor|null} [metricDescriptor] LogMetric metricDescriptor * @property {string|null} [valueExtractor] LogMetric valueExtractor * @property {Object.|null} [labelExtractors] LogMetric labelExtractors * @property {google.api.Distribution.IBucketOptions|null} [bucketOptions] LogMetric bucketOptions * @property {google.protobuf.ITimestamp|null} [createTime] LogMetric createTime * @property {google.protobuf.ITimestamp|null} [updateTime] LogMetric updateTime * @property {google.logging.v2.LogMetric.ApiVersion|null} [version] LogMetric version */ /** * Constructs a new LogMetric. * @memberof google.logging.v2 * @classdesc Represents a LogMetric. * @implements ILogMetric * @constructor * @param {google.logging.v2.ILogMetric=} [properties] Properties to set */ function LogMetric(properties) { this.labelExtractors = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LogMetric name. * @member {string} name * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.name = ""; /** * LogMetric description. * @member {string} description * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.description = ""; /** * LogMetric filter. * @member {string} filter * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.filter = ""; /** * LogMetric metricDescriptor. * @member {google.api.IMetricDescriptor|null|undefined} metricDescriptor * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.metricDescriptor = null; /** * LogMetric valueExtractor. * @member {string} valueExtractor * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.valueExtractor = ""; /** * LogMetric labelExtractors. * @member {Object.} labelExtractors * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.labelExtractors = $util.emptyObject; /** * LogMetric bucketOptions. * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.bucketOptions = null; /** * LogMetric createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.createTime = null; /** * LogMetric updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.updateTime = null; /** * LogMetric version. * @member {google.logging.v2.LogMetric.ApiVersion} version * @memberof google.logging.v2.LogMetric * @instance */ LogMetric.prototype.version = 0; /** * Creates a new LogMetric instance using the specified properties. * @function create * @memberof google.logging.v2.LogMetric * @static * @param {google.logging.v2.ILogMetric=} [properties] Properties to set * @returns {google.logging.v2.LogMetric} LogMetric instance */ LogMetric.create = function create(properties) { return new LogMetric(properties); }; /** * Encodes the specified LogMetric message. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. * @function encode * @memberof google.logging.v2.LogMetric * @static * @param {google.logging.v2.ILogMetric} message LogMetric message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogMetric.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.version); if (message.metricDescriptor != null && Object.hasOwnProperty.call(message, "metricDescriptor")) $root.google.api.MetricDescriptor.encode(message.metricDescriptor, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.valueExtractor != null && Object.hasOwnProperty.call(message, "valueExtractor")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.valueExtractor); if (message.labelExtractors != null && Object.hasOwnProperty.call(message, "labelExtractors")) for (var keys = Object.keys(message.labelExtractors), i = 0; i < keys.length; ++i) writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labelExtractors[keys[i]]).ldelim(); if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) $root.google.api.Distribution.BucketOptions.encode(message.bucketOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** * Encodes the specified LogMetric message, length delimited. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.LogMetric * @static * @param {google.logging.v2.ILogMetric} message LogMetric message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LogMetric.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LogMetric message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.LogMetric * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.LogMetric} LogMetric * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogMetric.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogMetric(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.description = reader.string(); break; case 3: message.filter = reader.string(); break; case 5: message.metricDescriptor = $root.google.api.MetricDescriptor.decode(reader, reader.uint32()); break; case 6: message.valueExtractor = reader.string(); break; case 7: if (message.labelExtractors === $util.emptyObject) message.labelExtractors = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = reader.string(); break; default: reader.skipType(tag2 & 7); break; } } message.labelExtractors[key] = value; break; case 8: message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32()); break; case 9: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 10: message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 4: message.version = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LogMetric message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.LogMetric * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.LogMetric} LogMetric * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LogMetric.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LogMetric message. * @function verify * @memberof google.logging.v2.LogMetric * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LogMetric.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) { var error = $root.google.api.MetricDescriptor.verify(message.metricDescriptor); if (error) return "metricDescriptor." + error; } if (message.valueExtractor != null && message.hasOwnProperty("valueExtractor")) if (!$util.isString(message.valueExtractor)) return "valueExtractor: string expected"; if (message.labelExtractors != null && message.hasOwnProperty("labelExtractors")) { if (!$util.isObject(message.labelExtractors)) return "labelExtractors: object expected"; var key = Object.keys(message.labelExtractors); for (var i = 0; i < key.length; ++i) if (!$util.isString(message.labelExtractors[key[i]])) return "labelExtractors: string{k:string} expected"; } if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) { var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions); if (error) return "bucketOptions." + error; } if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) return "createTime." + error; } if (message.updateTime != null && message.hasOwnProperty("updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) return "updateTime." + error; } if (message.version != null && message.hasOwnProperty("version")) switch (message.version) { default: return "version: enum value expected"; case 0: case 1: break; } return null; }; /** * Creates a LogMetric message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.LogMetric * @static * @param {Object.} object Plain object * @returns {google.logging.v2.LogMetric} LogMetric */ LogMetric.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.LogMetric) return object; var message = new $root.google.logging.v2.LogMetric(); if (object.name != null) message.name = String(object.name); if (object.description != null) message.description = String(object.description); if (object.filter != null) message.filter = String(object.filter); if (object.metricDescriptor != null) { if (typeof object.metricDescriptor !== "object") throw TypeError(".google.logging.v2.LogMetric.metricDescriptor: object expected"); message.metricDescriptor = $root.google.api.MetricDescriptor.fromObject(object.metricDescriptor); } if (object.valueExtractor != null) message.valueExtractor = String(object.valueExtractor); if (object.labelExtractors) { if (typeof object.labelExtractors !== "object") throw TypeError(".google.logging.v2.LogMetric.labelExtractors: object expected"); message.labelExtractors = {}; for (var keys = Object.keys(object.labelExtractors), i = 0; i < keys.length; ++i) message.labelExtractors[keys[i]] = String(object.labelExtractors[keys[i]]); } if (object.bucketOptions != null) { if (typeof object.bucketOptions !== "object") throw TypeError(".google.logging.v2.LogMetric.bucketOptions: object expected"); message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions); } if (object.createTime != null) { if (typeof object.createTime !== "object") throw TypeError(".google.logging.v2.LogMetric.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.updateTime != null) { if (typeof object.updateTime !== "object") throw TypeError(".google.logging.v2.LogMetric.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } switch (object.version) { case "V2": case 0: message.version = 0; break; case "V1": case 1: message.version = 1; break; } return message; }; /** * Creates a plain object from a LogMetric message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.LogMetric * @static * @param {google.logging.v2.LogMetric} message LogMetric * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LogMetric.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.labelExtractors = {}; if (options.defaults) { object.name = ""; object.description = ""; object.filter = ""; object.version = options.enums === String ? "V2" : 0; object.metricDescriptor = null; object.valueExtractor = ""; object.bucketOptions = null; object.createTime = null; object.updateTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.version != null && message.hasOwnProperty("version")) object.version = options.enums === String ? $root.google.logging.v2.LogMetric.ApiVersion[message.version] : message.version; if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) object.metricDescriptor = $root.google.api.MetricDescriptor.toObject(message.metricDescriptor, options); if (message.valueExtractor != null && message.hasOwnProperty("valueExtractor")) object.valueExtractor = message.valueExtractor; var keys2; if (message.labelExtractors && (keys2 = Object.keys(message.labelExtractors)).length) { object.labelExtractors = {}; for (var j = 0; j < keys2.length; ++j) object.labelExtractors[keys2[j]] = message.labelExtractors[keys2[j]]; } if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options); if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** * Converts this LogMetric to JSON. * @function toJSON * @memberof google.logging.v2.LogMetric * @instance * @returns {Object.} JSON object */ LogMetric.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * ApiVersion enum. * @name google.logging.v2.LogMetric.ApiVersion * @enum {number} * @property {number} V2=0 V2 value * @property {number} V1=1 V1 value */ LogMetric.ApiVersion = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "V2"] = 0; values[valuesById[1] = "V1"] = 1; return values; })(); return LogMetric; })(); v2.ListLogMetricsRequest = (function() { /** * Properties of a ListLogMetricsRequest. * @memberof google.logging.v2 * @interface IListLogMetricsRequest * @property {string|null} [parent] ListLogMetricsRequest parent * @property {string|null} [pageToken] ListLogMetricsRequest pageToken * @property {number|null} [pageSize] ListLogMetricsRequest pageSize */ /** * Constructs a new ListLogMetricsRequest. * @memberof google.logging.v2 * @classdesc Represents a ListLogMetricsRequest. * @implements IListLogMetricsRequest * @constructor * @param {google.logging.v2.IListLogMetricsRequest=} [properties] Properties to set */ function ListLogMetricsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListLogMetricsRequest parent. * @member {string} parent * @memberof google.logging.v2.ListLogMetricsRequest * @instance */ ListLogMetricsRequest.prototype.parent = ""; /** * ListLogMetricsRequest pageToken. * @member {string} pageToken * @memberof google.logging.v2.ListLogMetricsRequest * @instance */ ListLogMetricsRequest.prototype.pageToken = ""; /** * ListLogMetricsRequest pageSize. * @member {number} pageSize * @memberof google.logging.v2.ListLogMetricsRequest * @instance */ ListLogMetricsRequest.prototype.pageSize = 0; /** * Creates a new ListLogMetricsRequest instance using the specified properties. * @function create * @memberof google.logging.v2.ListLogMetricsRequest * @static * @param {google.logging.v2.IListLogMetricsRequest=} [properties] Properties to set * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest instance */ ListLogMetricsRequest.create = function create(properties) { return new ListLogMetricsRequest(properties); }; /** * Encodes the specified ListLogMetricsRequest message. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListLogMetricsRequest * @static * @param {google.logging.v2.IListLogMetricsRequest} message ListLogMetricsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogMetricsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); return writer; }; /** * Encodes the specified ListLogMetricsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListLogMetricsRequest * @static * @param {google.logging.v2.IListLogMetricsRequest} message ListLogMetricsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListLogMetricsRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListLogMetricsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogMetricsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogMetricsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.pageToken = reader.string(); break; case 3: message.pageSize = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListLogMetricsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListLogMetricsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogMetricsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListLogMetricsRequest message. * @function verify * @memberof google.logging.v2.ListLogMetricsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListLogMetricsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; return null; }; /** * Creates a ListLogMetricsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListLogMetricsRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListLogMetricsRequest} ListLogMetricsRequest */ ListLogMetricsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListLogMetricsRequest) return object; var message = new $root.google.logging.v2.ListLogMetricsRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.pageSize != null) message.pageSize = object.pageSize | 0; return message; }; /** * Creates a plain object from a ListLogMetricsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListLogMetricsRequest * @static * @param {google.logging.v2.ListLogMetricsRequest} message ListLogMetricsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListLogMetricsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.pageToken = ""; object.pageSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; return object; }; /** * Converts this ListLogMetricsRequest to JSON. * @function toJSON * @memberof google.logging.v2.ListLogMetricsRequest * @instance * @returns {Object.} JSON object */ ListLogMetricsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListLogMetricsRequest; })(); v2.ListLogMetricsResponse = (function() { /** * Properties of a ListLogMetricsResponse. * @memberof google.logging.v2 * @interface IListLogMetricsResponse * @property {Array.|null} [metrics] ListLogMetricsResponse metrics * @property {string|null} [nextPageToken] ListLogMetricsResponse nextPageToken */ /** * Constructs a new ListLogMetricsResponse. * @memberof google.logging.v2 * @classdesc Represents a ListLogMetricsResponse. * @implements IListLogMetricsResponse * @constructor * @param {google.logging.v2.IListLogMetricsResponse=} [properties] Properties to set */ function ListLogMetricsResponse(properties) { this.metrics = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListLogMetricsResponse metrics. * @member {Array.} metrics * @memberof google.logging.v2.ListLogMetricsResponse * @instance */ ListLogMetricsResponse.prototype.metrics = $util.emptyArray; /** * ListLogMetricsResponse nextPageToken. * @member {string} nextPageToken * @memberof google.logging.v2.ListLogMetricsResponse * @instance */ ListLogMetricsResponse.prototype.nextPageToken = ""; /** * Creates a new ListLogMetricsResponse instance using the specified properties. * @function create * @memberof google.logging.v2.ListLogMetricsResponse * @static * @param {google.logging.v2.IListLogMetricsResponse=} [properties] Properties to set * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse instance */ ListLogMetricsResponse.create = function create(properties) { return new ListLogMetricsResponse(properties); }; /** * Encodes the specified ListLogMetricsResponse message. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. * @function encode * @memberof google.logging.v2.ListLogMetricsResponse * @static * @param {google.logging.v2.IListLogMetricsResponse} message ListLogMetricsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogMetricsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.metrics != null && message.metrics.length) for (var i = 0; i < message.metrics.length; ++i) $root.google.logging.v2.LogMetric.encode(message.metrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListLogMetricsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogMetricsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.ListLogMetricsResponse * @static * @param {google.logging.v2.IListLogMetricsResponse} message ListLogMetricsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLogMetricsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListLogMetricsResponse message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.ListLogMetricsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogMetricsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogMetricsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.metrics && message.metrics.length)) message.metrics = []; message.metrics.push($root.google.logging.v2.LogMetric.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListLogMetricsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.ListLogMetricsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLogMetricsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListLogMetricsResponse message. * @function verify * @memberof google.logging.v2.ListLogMetricsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListLogMetricsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.metrics != null && message.hasOwnProperty("metrics")) { if (!Array.isArray(message.metrics)) return "metrics: array expected"; for (var i = 0; i < message.metrics.length; ++i) { var error = $root.google.logging.v2.LogMetric.verify(message.metrics[i]); if (error) return "metrics." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListLogMetricsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.ListLogMetricsResponse * @static * @param {Object.} object Plain object * @returns {google.logging.v2.ListLogMetricsResponse} ListLogMetricsResponse */ ListLogMetricsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.ListLogMetricsResponse) return object; var message = new $root.google.logging.v2.ListLogMetricsResponse(); if (object.metrics) { if (!Array.isArray(object.metrics)) throw TypeError(".google.logging.v2.ListLogMetricsResponse.metrics: array expected"); message.metrics = []; for (var i = 0; i < object.metrics.length; ++i) { if (typeof object.metrics[i] !== "object") throw TypeError(".google.logging.v2.ListLogMetricsResponse.metrics: object expected"); message.metrics[i] = $root.google.logging.v2.LogMetric.fromObject(object.metrics[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListLogMetricsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.ListLogMetricsResponse * @static * @param {google.logging.v2.ListLogMetricsResponse} message ListLogMetricsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListLogMetricsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.metrics = []; if (options.defaults) object.nextPageToken = ""; if (message.metrics && message.metrics.length) { object.metrics = []; for (var j = 0; j < message.metrics.length; ++j) object.metrics[j] = $root.google.logging.v2.LogMetric.toObject(message.metrics[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListLogMetricsResponse to JSON. * @function toJSON * @memberof google.logging.v2.ListLogMetricsResponse * @instance * @returns {Object.} JSON object */ ListLogMetricsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListLogMetricsResponse; })(); v2.GetLogMetricRequest = (function() { /** * Properties of a GetLogMetricRequest. * @memberof google.logging.v2 * @interface IGetLogMetricRequest * @property {string|null} [metricName] GetLogMetricRequest metricName */ /** * Constructs a new GetLogMetricRequest. * @memberof google.logging.v2 * @classdesc Represents a GetLogMetricRequest. * @implements IGetLogMetricRequest * @constructor * @param {google.logging.v2.IGetLogMetricRequest=} [properties] Properties to set */ function GetLogMetricRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetLogMetricRequest metricName. * @member {string} metricName * @memberof google.logging.v2.GetLogMetricRequest * @instance */ GetLogMetricRequest.prototype.metricName = ""; /** * Creates a new GetLogMetricRequest instance using the specified properties. * @function create * @memberof google.logging.v2.GetLogMetricRequest * @static * @param {google.logging.v2.IGetLogMetricRequest=} [properties] Properties to set * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest instance */ GetLogMetricRequest.create = function create(properties) { return new GetLogMetricRequest(properties); }; /** * Encodes the specified GetLogMetricRequest message. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.GetLogMetricRequest * @static * @param {google.logging.v2.IGetLogMetricRequest} message GetLogMetricRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetLogMetricRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); return writer; }; /** * Encodes the specified GetLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetLogMetricRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.GetLogMetricRequest * @static * @param {google.logging.v2.IGetLogMetricRequest} message GetLogMetricRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetLogMetricRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.GetLogMetricRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetLogMetricRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetLogMetricRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.metricName = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetLogMetricRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.GetLogMetricRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetLogMetricRequest message. * @function verify * @memberof google.logging.v2.GetLogMetricRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetLogMetricRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.metricName != null && message.hasOwnProperty("metricName")) if (!$util.isString(message.metricName)) return "metricName: string expected"; return null; }; /** * Creates a GetLogMetricRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.GetLogMetricRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.GetLogMetricRequest} GetLogMetricRequest */ GetLogMetricRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.GetLogMetricRequest) return object; var message = new $root.google.logging.v2.GetLogMetricRequest(); if (object.metricName != null) message.metricName = String(object.metricName); return message; }; /** * Creates a plain object from a GetLogMetricRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.GetLogMetricRequest * @static * @param {google.logging.v2.GetLogMetricRequest} message GetLogMetricRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetLogMetricRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.metricName = ""; if (message.metricName != null && message.hasOwnProperty("metricName")) object.metricName = message.metricName; return object; }; /** * Converts this GetLogMetricRequest to JSON. * @function toJSON * @memberof google.logging.v2.GetLogMetricRequest * @instance * @returns {Object.} JSON object */ GetLogMetricRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetLogMetricRequest; })(); v2.CreateLogMetricRequest = (function() { /** * Properties of a CreateLogMetricRequest. * @memberof google.logging.v2 * @interface ICreateLogMetricRequest * @property {string|null} [parent] CreateLogMetricRequest parent * @property {google.logging.v2.ILogMetric|null} [metric] CreateLogMetricRequest metric */ /** * Constructs a new CreateLogMetricRequest. * @memberof google.logging.v2 * @classdesc Represents a CreateLogMetricRequest. * @implements ICreateLogMetricRequest * @constructor * @param {google.logging.v2.ICreateLogMetricRequest=} [properties] Properties to set */ function CreateLogMetricRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CreateLogMetricRequest parent. * @member {string} parent * @memberof google.logging.v2.CreateLogMetricRequest * @instance */ CreateLogMetricRequest.prototype.parent = ""; /** * CreateLogMetricRequest metric. * @member {google.logging.v2.ILogMetric|null|undefined} metric * @memberof google.logging.v2.CreateLogMetricRequest * @instance */ CreateLogMetricRequest.prototype.metric = null; /** * Creates a new CreateLogMetricRequest instance using the specified properties. * @function create * @memberof google.logging.v2.CreateLogMetricRequest * @static * @param {google.logging.v2.ICreateLogMetricRequest=} [properties] Properties to set * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest instance */ CreateLogMetricRequest.create = function create(properties) { return new CreateLogMetricRequest(properties); }; /** * Encodes the specified CreateLogMetricRequest message. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.CreateLogMetricRequest * @static * @param {google.logging.v2.ICreateLogMetricRequest} message CreateLogMetricRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateLogMetricRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) $root.google.logging.v2.LogMetric.encode(message.metric, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified CreateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateLogMetricRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.CreateLogMetricRequest * @static * @param {google.logging.v2.ICreateLogMetricRequest} message CreateLogMetricRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CreateLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CreateLogMetricRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.CreateLogMetricRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateLogMetricRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateLogMetricRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; case 2: message.metric = $root.google.logging.v2.LogMetric.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CreateLogMetricRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.CreateLogMetricRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CreateLogMetricRequest message. * @function verify * @memberof google.logging.v2.CreateLogMetricRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CreateLogMetricRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; if (message.metric != null && message.hasOwnProperty("metric")) { var error = $root.google.logging.v2.LogMetric.verify(message.metric); if (error) return "metric." + error; } return null; }; /** * Creates a CreateLogMetricRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.CreateLogMetricRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.CreateLogMetricRequest} CreateLogMetricRequest */ CreateLogMetricRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.CreateLogMetricRequest) return object; var message = new $root.google.logging.v2.CreateLogMetricRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.metric != null) { if (typeof object.metric !== "object") throw TypeError(".google.logging.v2.CreateLogMetricRequest.metric: object expected"); message.metric = $root.google.logging.v2.LogMetric.fromObject(object.metric); } return message; }; /** * Creates a plain object from a CreateLogMetricRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.CreateLogMetricRequest * @static * @param {google.logging.v2.CreateLogMetricRequest} message CreateLogMetricRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CreateLogMetricRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; object.metric = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.metric != null && message.hasOwnProperty("metric")) object.metric = $root.google.logging.v2.LogMetric.toObject(message.metric, options); return object; }; /** * Converts this CreateLogMetricRequest to JSON. * @function toJSON * @memberof google.logging.v2.CreateLogMetricRequest * @instance * @returns {Object.} JSON object */ CreateLogMetricRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CreateLogMetricRequest; })(); v2.UpdateLogMetricRequest = (function() { /** * Properties of an UpdateLogMetricRequest. * @memberof google.logging.v2 * @interface IUpdateLogMetricRequest * @property {string|null} [metricName] UpdateLogMetricRequest metricName * @property {google.logging.v2.ILogMetric|null} [metric] UpdateLogMetricRequest metric */ /** * Constructs a new UpdateLogMetricRequest. * @memberof google.logging.v2 * @classdesc Represents an UpdateLogMetricRequest. * @implements IUpdateLogMetricRequest * @constructor * @param {google.logging.v2.IUpdateLogMetricRequest=} [properties] Properties to set */ function UpdateLogMetricRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UpdateLogMetricRequest metricName. * @member {string} metricName * @memberof google.logging.v2.UpdateLogMetricRequest * @instance */ UpdateLogMetricRequest.prototype.metricName = ""; /** * UpdateLogMetricRequest metric. * @member {google.logging.v2.ILogMetric|null|undefined} metric * @memberof google.logging.v2.UpdateLogMetricRequest * @instance */ UpdateLogMetricRequest.prototype.metric = null; /** * Creates a new UpdateLogMetricRequest instance using the specified properties. * @function create * @memberof google.logging.v2.UpdateLogMetricRequest * @static * @param {google.logging.v2.IUpdateLogMetricRequest=} [properties] Properties to set * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest instance */ UpdateLogMetricRequest.create = function create(properties) { return new UpdateLogMetricRequest(properties); }; /** * Encodes the specified UpdateLogMetricRequest message. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.UpdateLogMetricRequest * @static * @param {google.logging.v2.IUpdateLogMetricRequest} message UpdateLogMetricRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateLogMetricRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) $root.google.logging.v2.LogMetric.encode(message.metric, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified UpdateLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateLogMetricRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.UpdateLogMetricRequest * @static * @param {google.logging.v2.IUpdateLogMetricRequest} message UpdateLogMetricRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UpdateLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UpdateLogMetricRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.UpdateLogMetricRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateLogMetricRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateLogMetricRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.metricName = reader.string(); break; case 2: message.metric = $root.google.logging.v2.LogMetric.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UpdateLogMetricRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.UpdateLogMetricRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UpdateLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UpdateLogMetricRequest message. * @function verify * @memberof google.logging.v2.UpdateLogMetricRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UpdateLogMetricRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.metricName != null && message.hasOwnProperty("metricName")) if (!$util.isString(message.metricName)) return "metricName: string expected"; if (message.metric != null && message.hasOwnProperty("metric")) { var error = $root.google.logging.v2.LogMetric.verify(message.metric); if (error) return "metric." + error; } return null; }; /** * Creates an UpdateLogMetricRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.UpdateLogMetricRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.UpdateLogMetricRequest} UpdateLogMetricRequest */ UpdateLogMetricRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.UpdateLogMetricRequest) return object; var message = new $root.google.logging.v2.UpdateLogMetricRequest(); if (object.metricName != null) message.metricName = String(object.metricName); if (object.metric != null) { if (typeof object.metric !== "object") throw TypeError(".google.logging.v2.UpdateLogMetricRequest.metric: object expected"); message.metric = $root.google.logging.v2.LogMetric.fromObject(object.metric); } return message; }; /** * Creates a plain object from an UpdateLogMetricRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.UpdateLogMetricRequest * @static * @param {google.logging.v2.UpdateLogMetricRequest} message UpdateLogMetricRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UpdateLogMetricRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.metricName = ""; object.metric = null; } if (message.metricName != null && message.hasOwnProperty("metricName")) object.metricName = message.metricName; if (message.metric != null && message.hasOwnProperty("metric")) object.metric = $root.google.logging.v2.LogMetric.toObject(message.metric, options); return object; }; /** * Converts this UpdateLogMetricRequest to JSON. * @function toJSON * @memberof google.logging.v2.UpdateLogMetricRequest * @instance * @returns {Object.} JSON object */ UpdateLogMetricRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return UpdateLogMetricRequest; })(); v2.DeleteLogMetricRequest = (function() { /** * Properties of a DeleteLogMetricRequest. * @memberof google.logging.v2 * @interface IDeleteLogMetricRequest * @property {string|null} [metricName] DeleteLogMetricRequest metricName */ /** * Constructs a new DeleteLogMetricRequest. * @memberof google.logging.v2 * @classdesc Represents a DeleteLogMetricRequest. * @implements IDeleteLogMetricRequest * @constructor * @param {google.logging.v2.IDeleteLogMetricRequest=} [properties] Properties to set */ function DeleteLogMetricRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DeleteLogMetricRequest metricName. * @member {string} metricName * @memberof google.logging.v2.DeleteLogMetricRequest * @instance */ DeleteLogMetricRequest.prototype.metricName = ""; /** * Creates a new DeleteLogMetricRequest instance using the specified properties. * @function create * @memberof google.logging.v2.DeleteLogMetricRequest * @static * @param {google.logging.v2.IDeleteLogMetricRequest=} [properties] Properties to set * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest instance */ DeleteLogMetricRequest.create = function create(properties) { return new DeleteLogMetricRequest(properties); }; /** * Encodes the specified DeleteLogMetricRequest message. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. * @function encode * @memberof google.logging.v2.DeleteLogMetricRequest * @static * @param {google.logging.v2.IDeleteLogMetricRequest} message DeleteLogMetricRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteLogMetricRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); return writer; }; /** * Encodes the specified DeleteLogMetricRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLogMetricRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.logging.v2.DeleteLogMetricRequest * @static * @param {google.logging.v2.IDeleteLogMetricRequest} message DeleteLogMetricRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DeleteLogMetricRequest message from the specified reader or buffer. * @function decode * @memberof google.logging.v2.DeleteLogMetricRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteLogMetricRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteLogMetricRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.metricName = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DeleteLogMetricRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.logging.v2.DeleteLogMetricRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteLogMetricRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DeleteLogMetricRequest message. * @function verify * @memberof google.logging.v2.DeleteLogMetricRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DeleteLogMetricRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.metricName != null && message.hasOwnProperty("metricName")) if (!$util.isString(message.metricName)) return "metricName: string expected"; return null; }; /** * Creates a DeleteLogMetricRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.logging.v2.DeleteLogMetricRequest * @static * @param {Object.} object Plain object * @returns {google.logging.v2.DeleteLogMetricRequest} DeleteLogMetricRequest */ DeleteLogMetricRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.logging.v2.DeleteLogMetricRequest) return object; var message = new $root.google.logging.v2.DeleteLogMetricRequest(); if (object.metricName != null) message.metricName = String(object.metricName); return message; }; /** * Creates a plain object from a DeleteLogMetricRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.logging.v2.DeleteLogMetricRequest * @static * @param {google.logging.v2.DeleteLogMetricRequest} message DeleteLogMetricRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DeleteLogMetricRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.metricName = ""; if (message.metricName != null && message.hasOwnProperty("metricName")) object.metricName = message.metricName; return object; }; /** * Converts this DeleteLogMetricRequest to JSON. * @function toJSON * @memberof google.logging.v2.DeleteLogMetricRequest * @instance * @returns {Object.} JSON object */ DeleteLogMetricRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DeleteLogMetricRequest; })(); return v2; })(); return logging; })(); google.api = (function() { /** * Namespace api. * @memberof google * @namespace */ var api = {}; api.Http = (function() { /** * Properties of a Http. * @memberof google.api * @interface IHttp * @property {Array.|null} [rules] Http rules * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** * Constructs a new Http. * @memberof google.api * @classdesc Represents a Http. * @implements IHttp * @constructor * @param {google.api.IHttp=} [properties] Properties to set */ function Http(properties) { this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Http rules. * @member {Array.} rules * @memberof google.api.Http * @instance */ Http.prototype.rules = $util.emptyArray; /** * Http fullyDecodeReservedExpansion. * @member {boolean} fullyDecodeReservedExpansion * @memberof google.api.Http * @instance */ Http.prototype.fullyDecodeReservedExpansion = false; /** * Creates a new Http instance using the specified properties. * @function create * @memberof google.api.Http * @static * @param {google.api.IHttp=} [properties] Properties to set * @returns {google.api.Http} Http instance */ Http.create = function create(properties) { return new Http(properties); }; /** * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode * @memberof google.api.Http * @static * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.rules != null && message.rules.length) for (var i = 0; i < message.rules.length; ++i) $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Http * @static * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Http message from the specified reader or buffer. * @function decode * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Http.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.rules && message.rules.length)) message.rules = []; message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Http message. * @function verify * @memberof google.api.Http * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.rules != null && message.hasOwnProperty("rules")) { if (!Array.isArray(message.rules)) return "rules: array expected"; for (var i = 0; i < message.rules.length; ++i) { var error = $root.google.api.HttpRule.verify(message.rules[i]); if (error) return "rules." + error; } } if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) if (typeof message.fullyDecodeReservedExpansion !== "boolean") return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Http * @static * @param {Object.} object Plain object * @returns {google.api.Http} Http */ Http.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Http) return object; var message = new $root.google.api.Http(); if (object.rules) { if (!Array.isArray(object.rules)) throw TypeError(".google.api.Http.rules: array expected"); message.rules = []; for (var i = 0; i < object.rules.length; ++i) { if (typeof object.rules[i] !== "object") throw TypeError(".google.api.Http.rules: object expected"); message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); } } if (object.fullyDecodeReservedExpansion != null) message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Http * @static * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.rules = []; if (options.defaults) object.fullyDecodeReservedExpansion = false; if (message.rules && message.rules.length) { object.rules = []; for (var j = 0; j < message.rules.length; ++j) object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** * Converts this Http to JSON. * @function toJSON * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Http; })(); api.HttpRule = (function() { /** * Properties of a HttpRule. * @memberof google.api * @interface IHttpRule * @property {string|null} [selector] HttpRule selector * @property {string|null} [get] HttpRule get * @property {string|null} [put] HttpRule put * @property {string|null} [post] HttpRule post * @property {string|null} ["delete"] HttpRule delete * @property {string|null} [patch] HttpRule patch * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom * @property {string|null} [body] HttpRule body * @property {string|null} [responseBody] HttpRule responseBody * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ /** * Constructs a new HttpRule. * @memberof google.api * @classdesc Represents a HttpRule. * @implements IHttpRule * @constructor * @param {google.api.IHttpRule=} [properties] Properties to set */ function HttpRule(properties) { this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * HttpRule selector. * @member {string} selector * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.selector = ""; /** * HttpRule get. * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.get = null; /** * HttpRule put. * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.put = null; /** * HttpRule post. * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.post = null; /** * HttpRule delete. * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ HttpRule.prototype["delete"] = null; /** * HttpRule patch. * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.patch = null; /** * HttpRule custom. * @member {google.api.ICustomHttpPattern|null|undefined} custom * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.custom = null; /** * HttpRule body. * @member {string} body * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.body = ""; /** * HttpRule responseBody. * @member {string} responseBody * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.responseBody = ""; /** * HttpRule additionalBindings. * @member {Array.} additionalBindings * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.additionalBindings = $util.emptyArray; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * HttpRule pattern. * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern * @memberof google.api.HttpRule * @instance */ Object.defineProperty(HttpRule.prototype, "pattern", { get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new HttpRule instance using the specified properties. * @function create * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule=} [properties] Properties to set * @returns {google.api.HttpRule} HttpRule instance */ HttpRule.create = function create(properties) { return new HttpRule(properties); }; /** * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.additionalBindings != null && message.additionalBindings.length) for (var i = 0; i < message.additionalBindings.length; ++i) $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a HttpRule message from the specified reader or buffer. * @function decode * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.selector = reader.string(); break; case 2: message.get = reader.string(); break; case 3: message.put = reader.string(); break; case 4: message.post = reader.string(); break; case 5: message["delete"] = reader.string(); break; case 6: message.patch = reader.string(); break; case 8: message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); break; case 7: message.body = reader.string(); break; case 12: message.responseBody = reader.string(); break; case 11: if (!(message.additionalBindings && message.additionalBindings.length)) message.additionalBindings = []; message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a HttpRule message. * @function verify * @memberof google.api.HttpRule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.selector != null && message.hasOwnProperty("selector")) if (!$util.isString(message.selector)) return "selector: string expected"; if (message.get != null && message.hasOwnProperty("get")) { properties.pattern = 1; if (!$util.isString(message.get)) return "get: string expected"; } if (message.put != null && message.hasOwnProperty("put")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.put)) return "put: string expected"; } if (message.post != null && message.hasOwnProperty("post")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.post)) return "post: string expected"; } if (message["delete"] != null && message.hasOwnProperty("delete")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message["delete"])) return "delete: string expected"; } if (message.patch != null && message.hasOwnProperty("patch")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.patch)) return "patch: string expected"; } if (message.custom != null && message.hasOwnProperty("custom")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; { var error = $root.google.api.CustomHttpPattern.verify(message.custom); if (error) return "custom." + error; } } if (message.body != null && message.hasOwnProperty("body")) if (!$util.isString(message.body)) return "body: string expected"; if (message.responseBody != null && message.hasOwnProperty("responseBody")) if (!$util.isString(message.responseBody)) return "responseBody: string expected"; if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { if (!Array.isArray(message.additionalBindings)) return "additionalBindings: array expected"; for (var i = 0; i < message.additionalBindings.length; ++i) { var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); if (error) return "additionalBindings." + error; } } return null; }; /** * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object * @returns {google.api.HttpRule} HttpRule */ HttpRule.fromObject = function fromObject(object) { if (object instanceof $root.google.api.HttpRule) return object; var message = new $root.google.api.HttpRule(); if (object.selector != null) message.selector = String(object.selector); if (object.get != null) message.get = String(object.get); if (object.put != null) message.put = String(object.put); if (object.post != null) message.post = String(object.post); if (object["delete"] != null) message["delete"] = String(object["delete"]); if (object.patch != null) message.patch = String(object.patch); if (object.custom != null) { if (typeof object.custom !== "object") throw TypeError(".google.api.HttpRule.custom: object expected"); message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); } if (object.body != null) message.body = String(object.body); if (object.responseBody != null) message.responseBody = String(object.responseBody); if (object.additionalBindings) { if (!Array.isArray(object.additionalBindings)) throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); message.additionalBindings = []; for (var i = 0; i < object.additionalBindings.length; ++i) { if (typeof object.additionalBindings[i] !== "object") throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); } } return message; }; /** * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject * @memberof google.api.HttpRule * @static * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.additionalBindings = []; if (options.defaults) { object.selector = ""; object.body = ""; object.responseBody = ""; } if (message.selector != null && message.hasOwnProperty("selector")) object.selector = message.selector; if (message.get != null && message.hasOwnProperty("get")) { object.get = message.get; if (options.oneofs) object.pattern = "get"; } if (message.put != null && message.hasOwnProperty("put")) { object.put = message.put; if (options.oneofs) object.pattern = "put"; } if (message.post != null && message.hasOwnProperty("post")) { object.post = message.post; if (options.oneofs) object.pattern = "post"; } if (message["delete"] != null && message.hasOwnProperty("delete")) { object["delete"] = message["delete"]; if (options.oneofs) object.pattern = "delete"; } if (message.patch != null && message.hasOwnProperty("patch")) { object.patch = message.patch; if (options.oneofs) object.pattern = "patch"; } if (message.body != null && message.hasOwnProperty("body")) object.body = message.body; if (message.custom != null && message.hasOwnProperty("custom")) { object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); if (options.oneofs) object.pattern = "custom"; } if (message.additionalBindings && message.additionalBindings.length) { object.additionalBindings = []; for (var j = 0; j < message.additionalBindings.length; ++j) object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); } if (message.responseBody != null && message.hasOwnProperty("responseBody")) object.responseBody = message.responseBody; return object; }; /** * Converts this HttpRule to JSON. * @function toJSON * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return HttpRule; })(); api.CustomHttpPattern = (function() { /** * Properties of a CustomHttpPattern. * @memberof google.api * @interface ICustomHttpPattern * @property {string|null} [kind] CustomHttpPattern kind * @property {string|null} [path] CustomHttpPattern path */ /** * Constructs a new CustomHttpPattern. * @memberof google.api * @classdesc Represents a CustomHttpPattern. * @implements ICustomHttpPattern * @constructor * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CustomHttpPattern kind. * @member {string} kind * @memberof google.api.CustomHttpPattern * @instance */ CustomHttpPattern.prototype.kind = ""; /** * CustomHttpPattern path. * @member {string} path * @memberof google.api.CustomHttpPattern * @instance */ CustomHttpPattern.prototype.path = ""; /** * Creates a new CustomHttpPattern instance using the specified properties. * @function create * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern=} [properties] Properties to set * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ CustomHttpPattern.create = function create(properties) { return new CustomHttpPattern(properties); }; /** * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomHttpPattern.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.kind = reader.string(); break; case 2: message.path = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CustomHttpPattern message. * @function verify * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.kind != null && message.hasOwnProperty("kind")) if (!$util.isString(message.kind)) return "kind: string expected"; if (message.path != null && message.hasOwnProperty("path")) if (!$util.isString(message.path)) return "path: string expected"; return null; }; /** * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ CustomHttpPattern.fromObject = function fromObject(object) { if (object instanceof $root.google.api.CustomHttpPattern) return object; var message = new $root.google.api.CustomHttpPattern(); if (object.kind != null) message.kind = String(object.kind); if (object.path != null) message.path = String(object.path); return message; }; /** * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject * @memberof google.api.CustomHttpPattern * @static * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.kind = ""; object.path = ""; } if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; if (message.path != null && message.hasOwnProperty("path")) object.path = message.path; return object; }; /** * Converts this CustomHttpPattern to JSON. * @function toJSON * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CustomHttpPattern; })(); /** * FieldBehavior enum. * @name google.api.FieldBehavior * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value * @property {number} INPUT_ONLY=4 INPUT_ONLY value * @property {number} IMMUTABLE=5 IMMUTABLE value * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; values[valuesById[1] = "OPTIONAL"] = 1; values[valuesById[2] = "REQUIRED"] = 2; values[valuesById[3] = "OUTPUT_ONLY"] = 3; values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; values[valuesById[6] = "UNORDERED_LIST"] = 6; values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; return values; })(); api.MonitoredResourceDescriptor = (function() { /** * Properties of a MonitoredResourceDescriptor. * @memberof google.api * @interface IMonitoredResourceDescriptor * @property {string|null} [name] MonitoredResourceDescriptor name * @property {string|null} [type] MonitoredResourceDescriptor type * @property {string|null} [displayName] MonitoredResourceDescriptor displayName * @property {string|null} [description] MonitoredResourceDescriptor description * @property {Array.|null} [labels] MonitoredResourceDescriptor labels * @property {google.api.LaunchStage|null} [launchStage] MonitoredResourceDescriptor launchStage */ /** * Constructs a new MonitoredResourceDescriptor. * @memberof google.api * @classdesc Represents a MonitoredResourceDescriptor. * @implements IMonitoredResourceDescriptor * @constructor * @param {google.api.IMonitoredResourceDescriptor=} [properties] Properties to set */ function MonitoredResourceDescriptor(properties) { this.labels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MonitoredResourceDescriptor name. * @member {string} name * @memberof google.api.MonitoredResourceDescriptor * @instance */ MonitoredResourceDescriptor.prototype.name = ""; /** * MonitoredResourceDescriptor type. * @member {string} type * @memberof google.api.MonitoredResourceDescriptor * @instance */ MonitoredResourceDescriptor.prototype.type = ""; /** * MonitoredResourceDescriptor displayName. * @member {string} displayName * @memberof google.api.MonitoredResourceDescriptor * @instance */ MonitoredResourceDescriptor.prototype.displayName = ""; /** * MonitoredResourceDescriptor description. * @member {string} description * @memberof google.api.MonitoredResourceDescriptor * @instance */ MonitoredResourceDescriptor.prototype.description = ""; /** * MonitoredResourceDescriptor labels. * @member {Array.} labels * @memberof google.api.MonitoredResourceDescriptor * @instance */ MonitoredResourceDescriptor.prototype.labels = $util.emptyArray; /** * MonitoredResourceDescriptor launchStage. * @member {google.api.LaunchStage} launchStage * @memberof google.api.MonitoredResourceDescriptor * @instance */ MonitoredResourceDescriptor.prototype.launchStage = 0; /** * Creates a new MonitoredResourceDescriptor instance using the specified properties. * @function create * @memberof google.api.MonitoredResourceDescriptor * @static * @param {google.api.IMonitoredResourceDescriptor=} [properties] Properties to set * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor instance */ MonitoredResourceDescriptor.create = function create(properties) { return new MonitoredResourceDescriptor(properties); }; /** * Encodes the specified MonitoredResourceDescriptor message. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. * @function encode * @memberof google.api.MonitoredResourceDescriptor * @static * @param {google.api.IMonitoredResourceDescriptor} message MonitoredResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MonitoredResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); if (message.labels != null && message.labels.length) for (var i = 0; i < message.labels.length; ++i) $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.launchStage); return writer; }; /** * Encodes the specified MonitoredResourceDescriptor message, length delimited. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. * @function encodeDelimited * @memberof google.api.MonitoredResourceDescriptor * @static * @param {google.api.IMonitoredResourceDescriptor} message MonitoredResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MonitoredResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer. * @function decode * @memberof google.api.MonitoredResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MonitoredResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MonitoredResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 5: message.name = reader.string(); break; case 1: message.type = reader.string(); break; case 2: message.displayName = reader.string(); break; case 3: message.description = reader.string(); break; case 4: if (!(message.labels && message.labels.length)) message.labels = []; message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); break; case 7: message.launchStage = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.MonitoredResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MonitoredResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MonitoredResourceDescriptor message. * @function verify * @memberof google.api.MonitoredResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MonitoredResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; if (message.labels != null && message.hasOwnProperty("labels")) { if (!Array.isArray(message.labels)) return "labels: array expected"; for (var i = 0; i < message.labels.length; ++i) { var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); if (error) return "labels." + error; } } if (message.launchStage != null && message.hasOwnProperty("launchStage")) switch (message.launchStage) { default: return "launchStage: enum value expected"; case 0: case 6: case 7: case 1: case 2: case 3: case 4: case 5: break; } return null; }; /** * Creates a MonitoredResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.MonitoredResourceDescriptor * @static * @param {Object.} object Plain object * @returns {google.api.MonitoredResourceDescriptor} MonitoredResourceDescriptor */ MonitoredResourceDescriptor.fromObject = function fromObject(object) { if (object instanceof $root.google.api.MonitoredResourceDescriptor) return object; var message = new $root.google.api.MonitoredResourceDescriptor(); if (object.name != null) message.name = String(object.name); if (object.type != null) message.type = String(object.type); if (object.displayName != null) message.displayName = String(object.displayName); if (object.description != null) message.description = String(object.description); if (object.labels) { if (!Array.isArray(object.labels)) throw TypeError(".google.api.MonitoredResourceDescriptor.labels: array expected"); message.labels = []; for (var i = 0; i < object.labels.length; ++i) { if (typeof object.labels[i] !== "object") throw TypeError(".google.api.MonitoredResourceDescriptor.labels: object expected"); message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); } } switch (object.launchStage) { case "LAUNCH_STAGE_UNSPECIFIED": case 0: message.launchStage = 0; break; case "UNIMPLEMENTED": case 6: message.launchStage = 6; break; case "PRELAUNCH": case 7: message.launchStage = 7; break; case "EARLY_ACCESS": case 1: message.launchStage = 1; break; case "ALPHA": case 2: message.launchStage = 2; break; case "BETA": case 3: message.launchStage = 3; break; case "GA": case 4: message.launchStage = 4; break; case "DEPRECATED": case 5: message.launchStage = 5; break; } return message; }; /** * Creates a plain object from a MonitoredResourceDescriptor message. Also converts values to other types if specified. * @function toObject * @memberof google.api.MonitoredResourceDescriptor * @static * @param {google.api.MonitoredResourceDescriptor} message MonitoredResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MonitoredResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.labels = []; if (options.defaults) { object.type = ""; object.displayName = ""; object.description = ""; object.name = ""; object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.labels && message.labels.length) { object.labels = []; for (var j = 0; j < message.labels.length; ++j) object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.launchStage != null && message.hasOwnProperty("launchStage")) object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; return object; }; /** * Converts this MonitoredResourceDescriptor to JSON. * @function toJSON * @memberof google.api.MonitoredResourceDescriptor * @instance * @returns {Object.} JSON object */ MonitoredResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MonitoredResourceDescriptor; })(); api.MonitoredResource = (function() { /** * Properties of a MonitoredResource. * @memberof google.api * @interface IMonitoredResource * @property {string|null} [type] MonitoredResource type * @property {Object.|null} [labels] MonitoredResource labels */ /** * Constructs a new MonitoredResource. * @memberof google.api * @classdesc Represents a MonitoredResource. * @implements IMonitoredResource * @constructor * @param {google.api.IMonitoredResource=} [properties] Properties to set */ function MonitoredResource(properties) { this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MonitoredResource type. * @member {string} type * @memberof google.api.MonitoredResource * @instance */ MonitoredResource.prototype.type = ""; /** * MonitoredResource labels. * @member {Object.} labels * @memberof google.api.MonitoredResource * @instance */ MonitoredResource.prototype.labels = $util.emptyObject; /** * Creates a new MonitoredResource instance using the specified properties. * @function create * @memberof google.api.MonitoredResource * @static * @param {google.api.IMonitoredResource=} [properties] Properties to set * @returns {google.api.MonitoredResource} MonitoredResource instance */ MonitoredResource.create = function create(properties) { return new MonitoredResource(properties); }; /** * Encodes the specified MonitoredResource message. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. * @function encode * @memberof google.api.MonitoredResource * @static * @param {google.api.IMonitoredResource} message MonitoredResource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MonitoredResource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** * Encodes the specified MonitoredResource message, length delimited. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. * @function encodeDelimited * @memberof google.api.MonitoredResource * @static * @param {google.api.IMonitoredResource} message MonitoredResource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MonitoredResource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MonitoredResource message from the specified reader or buffer. * @function decode * @memberof google.api.MonitoredResource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.MonitoredResource} MonitoredResource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MonitoredResource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MonitoredResource(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type = reader.string(); break; case 2: if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = reader.string(); break; default: reader.skipType(tag2 & 7); break; } } message.labels[key] = value; break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MonitoredResource message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.MonitoredResource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.MonitoredResource} MonitoredResource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MonitoredResource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MonitoredResource message. * @function verify * @memberof google.api.MonitoredResource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MonitoredResource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); for (var i = 0; i < key.length; ++i) if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } return null; }; /** * Creates a MonitoredResource message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.MonitoredResource * @static * @param {Object.} object Plain object * @returns {google.api.MonitoredResource} MonitoredResource */ MonitoredResource.fromObject = function fromObject(object) { if (object instanceof $root.google.api.MonitoredResource) return object; var message = new $root.google.api.MonitoredResource(); if (object.type != null) message.type = String(object.type); if (object.labels) { if (typeof object.labels !== "object") throw TypeError(".google.api.MonitoredResource.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } return message; }; /** * Creates a plain object from a MonitoredResource message. Also converts values to other types if specified. * @function toObject * @memberof google.api.MonitoredResource * @static * @param {google.api.MonitoredResource} message MonitoredResource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MonitoredResource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.labels = {}; if (options.defaults) object.type = ""; if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } return object; }; /** * Converts this MonitoredResource to JSON. * @function toJSON * @memberof google.api.MonitoredResource * @instance * @returns {Object.} JSON object */ MonitoredResource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MonitoredResource; })(); api.MonitoredResourceMetadata = (function() { /** * Properties of a MonitoredResourceMetadata. * @memberof google.api * @interface IMonitoredResourceMetadata * @property {google.protobuf.IStruct|null} [systemLabels] MonitoredResourceMetadata systemLabels * @property {Object.|null} [userLabels] MonitoredResourceMetadata userLabels */ /** * Constructs a new MonitoredResourceMetadata. * @memberof google.api * @classdesc Represents a MonitoredResourceMetadata. * @implements IMonitoredResourceMetadata * @constructor * @param {google.api.IMonitoredResourceMetadata=} [properties] Properties to set */ function MonitoredResourceMetadata(properties) { this.userLabels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MonitoredResourceMetadata systemLabels. * @member {google.protobuf.IStruct|null|undefined} systemLabels * @memberof google.api.MonitoredResourceMetadata * @instance */ MonitoredResourceMetadata.prototype.systemLabels = null; /** * MonitoredResourceMetadata userLabels. * @member {Object.} userLabels * @memberof google.api.MonitoredResourceMetadata * @instance */ MonitoredResourceMetadata.prototype.userLabels = $util.emptyObject; /** * Creates a new MonitoredResourceMetadata instance using the specified properties. * @function create * @memberof google.api.MonitoredResourceMetadata * @static * @param {google.api.IMonitoredResourceMetadata=} [properties] Properties to set * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata instance */ MonitoredResourceMetadata.create = function create(properties) { return new MonitoredResourceMetadata(properties); }; /** * Encodes the specified MonitoredResourceMetadata message. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. * @function encode * @memberof google.api.MonitoredResourceMetadata * @static * @param {google.api.IMonitoredResourceMetadata} message MonitoredResourceMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MonitoredResourceMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) $root.google.protobuf.Struct.encode(message.systemLabels, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) for (var keys = Object.keys(message.userLabels), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim(); return writer; }; /** * Encodes the specified MonitoredResourceMetadata message, length delimited. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. * @function encodeDelimited * @memberof google.api.MonitoredResourceMetadata * @static * @param {google.api.IMonitoredResourceMetadata} message MonitoredResourceMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MonitoredResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MonitoredResourceMetadata message from the specified reader or buffer. * @function decode * @memberof google.api.MonitoredResourceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MonitoredResourceMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MonitoredResourceMetadata(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.systemLabels = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; case 2: if (message.userLabels === $util.emptyObject) message.userLabels = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = reader.string(); break; default: reader.skipType(tag2 & 7); break; } } message.userLabels[key] = value; break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MonitoredResourceMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.MonitoredResourceMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MonitoredResourceMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MonitoredResourceMetadata message. * @function verify * @memberof google.api.MonitoredResourceMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MonitoredResourceMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) { var error = $root.google.protobuf.Struct.verify(message.systemLabels); if (error) return "systemLabels." + error; } if (message.userLabels != null && message.hasOwnProperty("userLabels")) { if (!$util.isObject(message.userLabels)) return "userLabels: object expected"; var key = Object.keys(message.userLabels); for (var i = 0; i < key.length; ++i) if (!$util.isString(message.userLabels[key[i]])) return "userLabels: string{k:string} expected"; } return null; }; /** * Creates a MonitoredResourceMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.MonitoredResourceMetadata * @static * @param {Object.} object Plain object * @returns {google.api.MonitoredResourceMetadata} MonitoredResourceMetadata */ MonitoredResourceMetadata.fromObject = function fromObject(object) { if (object instanceof $root.google.api.MonitoredResourceMetadata) return object; var message = new $root.google.api.MonitoredResourceMetadata(); if (object.systemLabels != null) { if (typeof object.systemLabels !== "object") throw TypeError(".google.api.MonitoredResourceMetadata.systemLabels: object expected"); message.systemLabels = $root.google.protobuf.Struct.fromObject(object.systemLabels); } if (object.userLabels) { if (typeof object.userLabels !== "object") throw TypeError(".google.api.MonitoredResourceMetadata.userLabels: object expected"); message.userLabels = {}; for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); } return message; }; /** * Creates a plain object from a MonitoredResourceMetadata message. Also converts values to other types if specified. * @function toObject * @memberof google.api.MonitoredResourceMetadata * @static * @param {google.api.MonitoredResourceMetadata} message MonitoredResourceMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MonitoredResourceMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.userLabels = {}; if (options.defaults) object.systemLabels = null; if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) object.systemLabels = $root.google.protobuf.Struct.toObject(message.systemLabels, options); var keys2; if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { object.userLabels = {}; for (var j = 0; j < keys2.length; ++j) object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; } return object; }; /** * Converts this MonitoredResourceMetadata to JSON. * @function toJSON * @memberof google.api.MonitoredResourceMetadata * @instance * @returns {Object.} JSON object */ MonitoredResourceMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MonitoredResourceMetadata; })(); api.LabelDescriptor = (function() { /** * Properties of a LabelDescriptor. * @memberof google.api * @interface ILabelDescriptor * @property {string|null} [key] LabelDescriptor key * @property {google.api.LabelDescriptor.ValueType|null} [valueType] LabelDescriptor valueType * @property {string|null} [description] LabelDescriptor description */ /** * Constructs a new LabelDescriptor. * @memberof google.api * @classdesc Represents a LabelDescriptor. * @implements ILabelDescriptor * @constructor * @param {google.api.ILabelDescriptor=} [properties] Properties to set */ function LabelDescriptor(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * LabelDescriptor key. * @member {string} key * @memberof google.api.LabelDescriptor * @instance */ LabelDescriptor.prototype.key = ""; /** * LabelDescriptor valueType. * @member {google.api.LabelDescriptor.ValueType} valueType * @memberof google.api.LabelDescriptor * @instance */ LabelDescriptor.prototype.valueType = 0; /** * LabelDescriptor description. * @member {string} description * @memberof google.api.LabelDescriptor * @instance */ LabelDescriptor.prototype.description = ""; /** * Creates a new LabelDescriptor instance using the specified properties. * @function create * @memberof google.api.LabelDescriptor * @static * @param {google.api.ILabelDescriptor=} [properties] Properties to set * @returns {google.api.LabelDescriptor} LabelDescriptor instance */ LabelDescriptor.create = function create(properties) { return new LabelDescriptor(properties); }; /** * Encodes the specified LabelDescriptor message. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. * @function encode * @memberof google.api.LabelDescriptor * @static * @param {google.api.ILabelDescriptor} message LabelDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LabelDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.key != null && Object.hasOwnProperty.call(message, "key")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.valueType); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; /** * Encodes the specified LabelDescriptor message, length delimited. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. * @function encodeDelimited * @memberof google.api.LabelDescriptor * @static * @param {google.api.ILabelDescriptor} message LabelDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ LabelDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a LabelDescriptor message from the specified reader or buffer. * @function decode * @memberof google.api.LabelDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.LabelDescriptor} LabelDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LabelDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.LabelDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.key = reader.string(); break; case 2: message.valueType = reader.int32(); break; case 3: message.description = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a LabelDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.LabelDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.LabelDescriptor} LabelDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ LabelDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a LabelDescriptor message. * @function verify * @memberof google.api.LabelDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ LabelDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.key != null && message.hasOwnProperty("key")) if (!$util.isString(message.key)) return "key: string expected"; if (message.valueType != null && message.hasOwnProperty("valueType")) switch (message.valueType) { default: return "valueType: enum value expected"; case 0: case 1: case 2: break; } if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; return null; }; /** * Creates a LabelDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.LabelDescriptor * @static * @param {Object.} object Plain object * @returns {google.api.LabelDescriptor} LabelDescriptor */ LabelDescriptor.fromObject = function fromObject(object) { if (object instanceof $root.google.api.LabelDescriptor) return object; var message = new $root.google.api.LabelDescriptor(); if (object.key != null) message.key = String(object.key); switch (object.valueType) { case "STRING": case 0: message.valueType = 0; break; case "BOOL": case 1: message.valueType = 1; break; case "INT64": case 2: message.valueType = 2; break; } if (object.description != null) message.description = String(object.description); return message; }; /** * Creates a plain object from a LabelDescriptor message. Also converts values to other types if specified. * @function toObject * @memberof google.api.LabelDescriptor * @static * @param {google.api.LabelDescriptor} message LabelDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ LabelDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.key = ""; object.valueType = options.enums === String ? "STRING" : 0; object.description = ""; } if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; if (message.valueType != null && message.hasOwnProperty("valueType")) object.valueType = options.enums === String ? $root.google.api.LabelDescriptor.ValueType[message.valueType] : message.valueType; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; return object; }; /** * Converts this LabelDescriptor to JSON. * @function toJSON * @memberof google.api.LabelDescriptor * @instance * @returns {Object.} JSON object */ LabelDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * ValueType enum. * @name google.api.LabelDescriptor.ValueType * @enum {number} * @property {number} STRING=0 STRING value * @property {number} BOOL=1 BOOL value * @property {number} INT64=2 INT64 value */ LabelDescriptor.ValueType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STRING"] = 0; values[valuesById[1] = "BOOL"] = 1; values[valuesById[2] = "INT64"] = 2; return values; })(); return LabelDescriptor; })(); /** * LaunchStage enum. * @name google.api.LaunchStage * @enum {number} * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value * @property {number} PRELAUNCH=7 PRELAUNCH value * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value * @property {number} ALPHA=2 ALPHA value * @property {number} BETA=3 BETA value * @property {number} GA=4 GA value * @property {number} DEPRECATED=5 DEPRECATED value */ api.LaunchStage = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; values[valuesById[6] = "UNIMPLEMENTED"] = 6; values[valuesById[7] = "PRELAUNCH"] = 7; values[valuesById[1] = "EARLY_ACCESS"] = 1; values[valuesById[2] = "ALPHA"] = 2; values[valuesById[3] = "BETA"] = 3; values[valuesById[4] = "GA"] = 4; values[valuesById[5] = "DEPRECATED"] = 5; return values; })(); api.ResourceDescriptor = (function() { /** * Properties of a ResourceDescriptor. * @memberof google.api * @interface IResourceDescriptor * @property {string|null} [type] ResourceDescriptor type * @property {Array.|null} [pattern] ResourceDescriptor pattern * @property {string|null} [nameField] ResourceDescriptor nameField * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history * @property {string|null} [plural] ResourceDescriptor plural * @property {string|null} [singular] ResourceDescriptor singular * @property {Array.|null} [style] ResourceDescriptor style */ /** * Constructs a new ResourceDescriptor. * @memberof google.api * @classdesc Represents a ResourceDescriptor. * @implements IResourceDescriptor * @constructor * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ function ResourceDescriptor(properties) { this.pattern = []; this.style = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ResourceDescriptor type. * @member {string} type * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.type = ""; /** * ResourceDescriptor pattern. * @member {Array.} pattern * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.pattern = $util.emptyArray; /** * ResourceDescriptor nameField. * @member {string} nameField * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.nameField = ""; /** * ResourceDescriptor history. * @member {google.api.ResourceDescriptor.History} history * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.history = 0; /** * ResourceDescriptor plural. * @member {string} plural * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.plural = ""; /** * ResourceDescriptor singular. * @member {string} singular * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.singular = ""; /** * ResourceDescriptor style. * @member {Array.} style * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.style = $util.emptyArray; /** * Creates a new ResourceDescriptor instance using the specified properties. * @function create * @memberof google.api.ResourceDescriptor * @static * @param {google.api.IResourceDescriptor=} [properties] Properties to set * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ ResourceDescriptor.create = function create(properties) { return new ResourceDescriptor(properties); }; /** * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode * @memberof google.api.ResourceDescriptor * @static * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.pattern != null && message.pattern.length) for (var i = 0; i < message.pattern.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); if (message.style != null && message.style.length) { writer.uint32(/* id 10, wireType 2 =*/82).fork(); for (var i = 0; i < message.style.length; ++i) writer.int32(message.style[i]); writer.ldelim(); } return writer; }; /** * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited * @memberof google.api.ResourceDescriptor * @static * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type = reader.string(); break; case 2: if (!(message.pattern && message.pattern.length)) message.pattern = []; message.pattern.push(reader.string()); break; case 3: message.nameField = reader.string(); break; case 4: message.history = reader.int32(); break; case 5: message.plural = reader.string(); break; case 6: message.singular = reader.string(); break; case 10: if (!(message.style && message.style.length)) message.style = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.style.push(reader.int32()); } else message.style.push(reader.int32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ResourceDescriptor message. * @function verify * @memberof google.api.ResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.pattern != null && message.hasOwnProperty("pattern")) { if (!Array.isArray(message.pattern)) return "pattern: array expected"; for (var i = 0; i < message.pattern.length; ++i) if (!$util.isString(message.pattern[i])) return "pattern: string[] expected"; } if (message.nameField != null && message.hasOwnProperty("nameField")) if (!$util.isString(message.nameField)) return "nameField: string expected"; if (message.history != null && message.hasOwnProperty("history")) switch (message.history) { default: return "history: enum value expected"; case 0: case 1: case 2: break; } if (message.plural != null && message.hasOwnProperty("plural")) if (!$util.isString(message.plural)) return "plural: string expected"; if (message.singular != null && message.hasOwnProperty("singular")) if (!$util.isString(message.singular)) return "singular: string expected"; if (message.style != null && message.hasOwnProperty("style")) { if (!Array.isArray(message.style)) return "style: array expected"; for (var i = 0; i < message.style.length; ++i) switch (message.style[i]) { default: return "style: enum value[] expected"; case 0: case 1: break; } } return null; }; /** * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ ResourceDescriptor.fromObject = function fromObject(object) { if (object instanceof $root.google.api.ResourceDescriptor) return object; var message = new $root.google.api.ResourceDescriptor(); if (object.type != null) message.type = String(object.type); if (object.pattern) { if (!Array.isArray(object.pattern)) throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); message.pattern = []; for (var i = 0; i < object.pattern.length; ++i) message.pattern[i] = String(object.pattern[i]); } if (object.nameField != null) message.nameField = String(object.nameField); switch (object.history) { case "HISTORY_UNSPECIFIED": case 0: message.history = 0; break; case "ORIGINALLY_SINGLE_PATTERN": case 1: message.history = 1; break; case "FUTURE_MULTI_PATTERN": case 2: message.history = 2; break; } if (object.plural != null) message.plural = String(object.plural); if (object.singular != null) message.singular = String(object.singular); if (object.style) { if (!Array.isArray(object.style)) throw TypeError(".google.api.ResourceDescriptor.style: array expected"); message.style = []; for (var i = 0; i < object.style.length; ++i) switch (object.style[i]) { default: case "STYLE_UNSPECIFIED": case 0: message.style[i] = 0; break; case "DECLARATIVE_FRIENDLY": case 1: message.style[i] = 1; break; } } return message; }; /** * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject * @memberof google.api.ResourceDescriptor * @static * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.pattern = []; object.style = []; } if (options.defaults) { object.type = ""; object.nameField = ""; object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; object.plural = ""; object.singular = ""; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; if (message.pattern && message.pattern.length) { object.pattern = []; for (var j = 0; j < message.pattern.length; ++j) object.pattern[j] = message.pattern[j]; } if (message.nameField != null && message.hasOwnProperty("nameField")) object.nameField = message.nameField; if (message.history != null && message.hasOwnProperty("history")) object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; if (message.plural != null && message.hasOwnProperty("plural")) object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) object.singular = message.singular; if (message.style && message.style.length) { object.style = []; for (var j = 0; j < message.style.length; ++j) object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; } return object; }; /** * Converts this ResourceDescriptor to JSON. * @function toJSON * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * History enum. * @name google.api.ResourceDescriptor.History * @enum {number} * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value */ ResourceDescriptor.History = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; return values; })(); /** * Style enum. * @name google.api.ResourceDescriptor.Style * @enum {number} * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value */ ResourceDescriptor.Style = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; return values; })(); return ResourceDescriptor; })(); api.ResourceReference = (function() { /** * Properties of a ResourceReference. * @memberof google.api * @interface IResourceReference * @property {string|null} [type] ResourceReference type * @property {string|null} [childType] ResourceReference childType */ /** * Constructs a new ResourceReference. * @memberof google.api * @classdesc Represents a ResourceReference. * @implements IResourceReference * @constructor * @param {google.api.IResourceReference=} [properties] Properties to set */ function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ResourceReference type. * @member {string} type * @memberof google.api.ResourceReference * @instance */ ResourceReference.prototype.type = ""; /** * ResourceReference childType. * @member {string} childType * @memberof google.api.ResourceReference * @instance */ ResourceReference.prototype.childType = ""; /** * Creates a new ResourceReference instance using the specified properties. * @function create * @memberof google.api.ResourceReference * @static * @param {google.api.IResourceReference=} [properties] Properties to set * @returns {google.api.ResourceReference} ResourceReference instance */ ResourceReference.create = function create(properties) { return new ResourceReference(properties); }; /** * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode * @memberof google.api.ResourceReference * @static * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited * @memberof google.api.ResourceReference * @static * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ResourceReference message from the specified reader or buffer. * @function decode * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ResourceReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type = reader.string(); break; case 2: message.childType = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ResourceReference message. * @function verify * @memberof google.api.ResourceReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.childType != null && message.hasOwnProperty("childType")) if (!$util.isString(message.childType)) return "childType: string expected"; return null; }; /** * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object * @returns {google.api.ResourceReference} ResourceReference */ ResourceReference.fromObject = function fromObject(object) { if (object instanceof $root.google.api.ResourceReference) return object; var message = new $root.google.api.ResourceReference(); if (object.type != null) message.type = String(object.type); if (object.childType != null) message.childType = String(object.childType); return message; }; /** * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject * @memberof google.api.ResourceReference * @static * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.type = ""; object.childType = ""; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; if (message.childType != null && message.hasOwnProperty("childType")) object.childType = message.childType; return object; }; /** * Converts this ResourceReference to JSON. * @function toJSON * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ResourceReference; })(); api.Distribution = (function() { /** * Properties of a Distribution. * @memberof google.api * @interface IDistribution * @property {number|Long|null} [count] Distribution count * @property {number|null} [mean] Distribution mean * @property {number|null} [sumOfSquaredDeviation] Distribution sumOfSquaredDeviation * @property {google.api.Distribution.IRange|null} [range] Distribution range * @property {google.api.Distribution.IBucketOptions|null} [bucketOptions] Distribution bucketOptions * @property {Array.|null} [bucketCounts] Distribution bucketCounts * @property {Array.|null} [exemplars] Distribution exemplars */ /** * Constructs a new Distribution. * @memberof google.api * @classdesc Represents a Distribution. * @implements IDistribution * @constructor * @param {google.api.IDistribution=} [properties] Properties to set */ function Distribution(properties) { this.bucketCounts = []; this.exemplars = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Distribution count. * @member {number|Long} count * @memberof google.api.Distribution * @instance */ Distribution.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Distribution mean. * @member {number} mean * @memberof google.api.Distribution * @instance */ Distribution.prototype.mean = 0; /** * Distribution sumOfSquaredDeviation. * @member {number} sumOfSquaredDeviation * @memberof google.api.Distribution * @instance */ Distribution.prototype.sumOfSquaredDeviation = 0; /** * Distribution range. * @member {google.api.Distribution.IRange|null|undefined} range * @memberof google.api.Distribution * @instance */ Distribution.prototype.range = null; /** * Distribution bucketOptions. * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions * @memberof google.api.Distribution * @instance */ Distribution.prototype.bucketOptions = null; /** * Distribution bucketCounts. * @member {Array.} bucketCounts * @memberof google.api.Distribution * @instance */ Distribution.prototype.bucketCounts = $util.emptyArray; /** * Distribution exemplars. * @member {Array.} exemplars * @memberof google.api.Distribution * @instance */ Distribution.prototype.exemplars = $util.emptyArray; /** * Creates a new Distribution instance using the specified properties. * @function create * @memberof google.api.Distribution * @static * @param {google.api.IDistribution=} [properties] Properties to set * @returns {google.api.Distribution} Distribution instance */ Distribution.create = function create(properties) { return new Distribution(properties); }; /** * Encodes the specified Distribution message. Does not implicitly {@link google.api.Distribution.verify|verify} messages. * @function encode * @memberof google.api.Distribution * @static * @param {google.api.IDistribution} message Distribution message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Distribution.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); if (message.mean != null && Object.hasOwnProperty.call(message, "mean")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.mean); if (message.sumOfSquaredDeviation != null && Object.hasOwnProperty.call(message, "sumOfSquaredDeviation")) writer.uint32(/* id 3, wireType 1 =*/25).double(message.sumOfSquaredDeviation); if (message.range != null && Object.hasOwnProperty.call(message, "range")) $root.google.api.Distribution.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) $root.google.api.Distribution.BucketOptions.encode(message.bucketOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.bucketCounts != null && message.bucketCounts.length) { writer.uint32(/* id 7, wireType 2 =*/58).fork(); for (var i = 0; i < message.bucketCounts.length; ++i) writer.int64(message.bucketCounts[i]); writer.ldelim(); } if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.google.api.Distribution.Exemplar.encode(message.exemplars[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** * Encodes the specified Distribution message, length delimited. Does not implicitly {@link google.api.Distribution.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Distribution * @static * @param {google.api.IDistribution} message Distribution message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Distribution.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Distribution message from the specified reader or buffer. * @function decode * @memberof google.api.Distribution * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Distribution} Distribution * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Distribution.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.count = reader.int64(); break; case 2: message.mean = reader.double(); break; case 3: message.sumOfSquaredDeviation = reader.double(); break; case 4: message.range = $root.google.api.Distribution.Range.decode(reader, reader.uint32()); break; case 6: message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32()); break; case 7: if (!(message.bucketCounts && message.bucketCounts.length)) message.bucketCounts = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.bucketCounts.push(reader.int64()); } else message.bucketCounts.push(reader.int64()); break; case 10: if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; message.exemplars.push($root.google.api.Distribution.Exemplar.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Distribution message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Distribution * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Distribution} Distribution * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Distribution.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Distribution message. * @function verify * @memberof google.api.Distribution * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Distribution.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.count != null && message.hasOwnProperty("count")) if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; if (message.mean != null && message.hasOwnProperty("mean")) if (typeof message.mean !== "number") return "mean: number expected"; if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) if (typeof message.sumOfSquaredDeviation !== "number") return "sumOfSquaredDeviation: number expected"; if (message.range != null && message.hasOwnProperty("range")) { var error = $root.google.api.Distribution.Range.verify(message.range); if (error) return "range." + error; } if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) { var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions); if (error) return "bucketOptions." + error; } if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; for (var i = 0; i < message.bucketCounts.length; ++i) if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) return "bucketCounts: integer|Long[] expected"; } if (message.exemplars != null && message.hasOwnProperty("exemplars")) { if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; for (var i = 0; i < message.exemplars.length; ++i) { var error = $root.google.api.Distribution.Exemplar.verify(message.exemplars[i]); if (error) return "exemplars." + error; } } return null; }; /** * Creates a Distribution message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Distribution * @static * @param {Object.} object Plain object * @returns {google.api.Distribution} Distribution */ Distribution.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Distribution) return object; var message = new $root.google.api.Distribution(); if (object.count != null) if ($util.Long) (message.count = $util.Long.fromValue(object.count)).unsigned = false; else if (typeof object.count === "string") message.count = parseInt(object.count, 10); else if (typeof object.count === "number") message.count = object.count; else if (typeof object.count === "object") message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); if (object.mean != null) message.mean = Number(object.mean); if (object.sumOfSquaredDeviation != null) message.sumOfSquaredDeviation = Number(object.sumOfSquaredDeviation); if (object.range != null) { if (typeof object.range !== "object") throw TypeError(".google.api.Distribution.range: object expected"); message.range = $root.google.api.Distribution.Range.fromObject(object.range); } if (object.bucketOptions != null) { if (typeof object.bucketOptions !== "object") throw TypeError(".google.api.Distribution.bucketOptions: object expected"); message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions); } if (object.bucketCounts) { if (!Array.isArray(object.bucketCounts)) throw TypeError(".google.api.Distribution.bucketCounts: array expected"); message.bucketCounts = []; for (var i = 0; i < object.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object.bucketCounts[i])).unsigned = false; else if (typeof object.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object.bucketCounts[i], 10); else if (typeof object.bucketCounts[i] === "number") message.bucketCounts[i] = object.bucketCounts[i]; else if (typeof object.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object.bucketCounts[i].low >>> 0, object.bucketCounts[i].high >>> 0).toNumber(); } if (object.exemplars) { if (!Array.isArray(object.exemplars)) throw TypeError(".google.api.Distribution.exemplars: array expected"); message.exemplars = []; for (var i = 0; i < object.exemplars.length; ++i) { if (typeof object.exemplars[i] !== "object") throw TypeError(".google.api.Distribution.exemplars: object expected"); message.exemplars[i] = $root.google.api.Distribution.Exemplar.fromObject(object.exemplars[i]); } } return message; }; /** * Creates a plain object from a Distribution message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Distribution * @static * @param {google.api.Distribution} message Distribution * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Distribution.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.bucketCounts = []; object.exemplars = []; } if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.count = options.longs === String ? "0" : 0; object.mean = 0; object.sumOfSquaredDeviation = 0; object.range = null; object.bucketOptions = null; } if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object.count = options.longs === String ? String(message.count) : message.count; else object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; if (message.mean != null && message.hasOwnProperty("mean")) object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) object.sumOfSquaredDeviation = options.json && !isFinite(message.sumOfSquaredDeviation) ? String(message.sumOfSquaredDeviation) : message.sumOfSquaredDeviation; if (message.range != null && message.hasOwnProperty("range")) object.range = $root.google.api.Distribution.Range.toObject(message.range, options); if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options); if (message.bucketCounts && message.bucketCounts.length) { object.bucketCounts = []; for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; else object.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; } if (message.exemplars && message.exemplars.length) { object.exemplars = []; for (var j = 0; j < message.exemplars.length; ++j) object.exemplars[j] = $root.google.api.Distribution.Exemplar.toObject(message.exemplars[j], options); } return object; }; /** * Converts this Distribution to JSON. * @function toJSON * @memberof google.api.Distribution * @instance * @returns {Object.} JSON object */ Distribution.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; Distribution.Range = (function() { /** * Properties of a Range. * @memberof google.api.Distribution * @interface IRange * @property {number|null} [min] Range min * @property {number|null} [max] Range max */ /** * Constructs a new Range. * @memberof google.api.Distribution * @classdesc Represents a Range. * @implements IRange * @constructor * @param {google.api.Distribution.IRange=} [properties] Properties to set */ function Range(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Range min. * @member {number} min * @memberof google.api.Distribution.Range * @instance */ Range.prototype.min = 0; /** * Range max. * @member {number} max * @memberof google.api.Distribution.Range * @instance */ Range.prototype.max = 0; /** * Creates a new Range instance using the specified properties. * @function create * @memberof google.api.Distribution.Range * @static * @param {google.api.Distribution.IRange=} [properties] Properties to set * @returns {google.api.Distribution.Range} Range instance */ Range.create = function create(properties) { return new Range(properties); }; /** * Encodes the specified Range message. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. * @function encode * @memberof google.api.Distribution.Range * @static * @param {google.api.Distribution.IRange} message Range message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Range.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.min != null && Object.hasOwnProperty.call(message, "min")) writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); if (message.max != null && Object.hasOwnProperty.call(message, "max")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); return writer; }; /** * Encodes the specified Range message, length delimited. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Distribution.Range * @static * @param {google.api.Distribution.IRange} message Range message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Range.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Range message from the specified reader or buffer. * @function decode * @memberof google.api.Distribution.Range * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Distribution.Range} Range * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Range.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.Range(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.min = reader.double(); break; case 2: message.max = reader.double(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Range message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Distribution.Range * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Distribution.Range} Range * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Range.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Range message. * @function verify * @memberof google.api.Distribution.Range * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Range.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.min != null && message.hasOwnProperty("min")) if (typeof message.min !== "number") return "min: number expected"; if (message.max != null && message.hasOwnProperty("max")) if (typeof message.max !== "number") return "max: number expected"; return null; }; /** * Creates a Range message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Distribution.Range * @static * @param {Object.} object Plain object * @returns {google.api.Distribution.Range} Range */ Range.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Distribution.Range) return object; var message = new $root.google.api.Distribution.Range(); if (object.min != null) message.min = Number(object.min); if (object.max != null) message.max = Number(object.max); return message; }; /** * Creates a plain object from a Range message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Distribution.Range * @static * @param {google.api.Distribution.Range} message Range * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Range.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.min = 0; object.max = 0; } if (message.min != null && message.hasOwnProperty("min")) object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; if (message.max != null && message.hasOwnProperty("max")) object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; return object; }; /** * Converts this Range to JSON. * @function toJSON * @memberof google.api.Distribution.Range * @instance * @returns {Object.} JSON object */ Range.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Range; })(); Distribution.BucketOptions = (function() { /** * Properties of a BucketOptions. * @memberof google.api.Distribution * @interface IBucketOptions * @property {google.api.Distribution.BucketOptions.ILinear|null} [linearBuckets] BucketOptions linearBuckets * @property {google.api.Distribution.BucketOptions.IExponential|null} [exponentialBuckets] BucketOptions exponentialBuckets * @property {google.api.Distribution.BucketOptions.IExplicit|null} [explicitBuckets] BucketOptions explicitBuckets */ /** * Constructs a new BucketOptions. * @memberof google.api.Distribution * @classdesc Represents a BucketOptions. * @implements IBucketOptions * @constructor * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set */ function BucketOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * BucketOptions linearBuckets. * @member {google.api.Distribution.BucketOptions.ILinear|null|undefined} linearBuckets * @memberof google.api.Distribution.BucketOptions * @instance */ BucketOptions.prototype.linearBuckets = null; /** * BucketOptions exponentialBuckets. * @member {google.api.Distribution.BucketOptions.IExponential|null|undefined} exponentialBuckets * @memberof google.api.Distribution.BucketOptions * @instance */ BucketOptions.prototype.exponentialBuckets = null; /** * BucketOptions explicitBuckets. * @member {google.api.Distribution.BucketOptions.IExplicit|null|undefined} explicitBuckets * @memberof google.api.Distribution.BucketOptions * @instance */ BucketOptions.prototype.explicitBuckets = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * BucketOptions options. * @member {"linearBuckets"|"exponentialBuckets"|"explicitBuckets"|undefined} options * @memberof google.api.Distribution.BucketOptions * @instance */ Object.defineProperty(BucketOptions.prototype, "options", { get: $util.oneOfGetter($oneOfFields = ["linearBuckets", "exponentialBuckets", "explicitBuckets"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new BucketOptions instance using the specified properties. * @function create * @memberof google.api.Distribution.BucketOptions * @static * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set * @returns {google.api.Distribution.BucketOptions} BucketOptions instance */ BucketOptions.create = function create(properties) { return new BucketOptions(properties); }; /** * Encodes the specified BucketOptions message. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. * @function encode * @memberof google.api.Distribution.BucketOptions * @static * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BucketOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.linearBuckets != null && Object.hasOwnProperty.call(message, "linearBuckets")) $root.google.api.Distribution.BucketOptions.Linear.encode(message.linearBuckets, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.exponentialBuckets != null && Object.hasOwnProperty.call(message, "exponentialBuckets")) $root.google.api.Distribution.BucketOptions.Exponential.encode(message.exponentialBuckets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.explicitBuckets != null && Object.hasOwnProperty.call(message, "explicitBuckets")) $root.google.api.Distribution.BucketOptions.Explicit.encode(message.explicitBuckets, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified BucketOptions message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Distribution.BucketOptions * @static * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BucketOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a BucketOptions message from the specified reader or buffer. * @function decode * @memberof google.api.Distribution.BucketOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Distribution.BucketOptions} BucketOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BucketOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.decode(reader, reader.uint32()); break; case 2: message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.decode(reader, reader.uint32()); break; case 3: message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a BucketOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Distribution.BucketOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Distribution.BucketOptions} BucketOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BucketOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a BucketOptions message. * @function verify * @memberof google.api.Distribution.BucketOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ BucketOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { properties.options = 1; { var error = $root.google.api.Distribution.BucketOptions.Linear.verify(message.linearBuckets); if (error) return "linearBuckets." + error; } } if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { if (properties.options === 1) return "options: multiple values"; properties.options = 1; { var error = $root.google.api.Distribution.BucketOptions.Exponential.verify(message.exponentialBuckets); if (error) return "exponentialBuckets." + error; } } if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { if (properties.options === 1) return "options: multiple values"; properties.options = 1; { var error = $root.google.api.Distribution.BucketOptions.Explicit.verify(message.explicitBuckets); if (error) return "explicitBuckets." + error; } } return null; }; /** * Creates a BucketOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Distribution.BucketOptions * @static * @param {Object.} object Plain object * @returns {google.api.Distribution.BucketOptions} BucketOptions */ BucketOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Distribution.BucketOptions) return object; var message = new $root.google.api.Distribution.BucketOptions(); if (object.linearBuckets != null) { if (typeof object.linearBuckets !== "object") throw TypeError(".google.api.Distribution.BucketOptions.linearBuckets: object expected"); message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.fromObject(object.linearBuckets); } if (object.exponentialBuckets != null) { if (typeof object.exponentialBuckets !== "object") throw TypeError(".google.api.Distribution.BucketOptions.exponentialBuckets: object expected"); message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.fromObject(object.exponentialBuckets); } if (object.explicitBuckets != null) { if (typeof object.explicitBuckets !== "object") throw TypeError(".google.api.Distribution.BucketOptions.explicitBuckets: object expected"); message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.fromObject(object.explicitBuckets); } return message; }; /** * Creates a plain object from a BucketOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Distribution.BucketOptions * @static * @param {google.api.Distribution.BucketOptions} message BucketOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ BucketOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { object.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.toObject(message.linearBuckets, options); if (options.oneofs) object.options = "linearBuckets"; } if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { object.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.toObject(message.exponentialBuckets, options); if (options.oneofs) object.options = "exponentialBuckets"; } if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { object.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.toObject(message.explicitBuckets, options); if (options.oneofs) object.options = "explicitBuckets"; } return object; }; /** * Converts this BucketOptions to JSON. * @function toJSON * @memberof google.api.Distribution.BucketOptions * @instance * @returns {Object.} JSON object */ BucketOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; BucketOptions.Linear = (function() { /** * Properties of a Linear. * @memberof google.api.Distribution.BucketOptions * @interface ILinear * @property {number|null} [numFiniteBuckets] Linear numFiniteBuckets * @property {number|null} [width] Linear width * @property {number|null} [offset] Linear offset */ /** * Constructs a new Linear. * @memberof google.api.Distribution.BucketOptions * @classdesc Represents a Linear. * @implements ILinear * @constructor * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set */ function Linear(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Linear numFiniteBuckets. * @member {number} numFiniteBuckets * @memberof google.api.Distribution.BucketOptions.Linear * @instance */ Linear.prototype.numFiniteBuckets = 0; /** * Linear width. * @member {number} width * @memberof google.api.Distribution.BucketOptions.Linear * @instance */ Linear.prototype.width = 0; /** * Linear offset. * @member {number} offset * @memberof google.api.Distribution.BucketOptions.Linear * @instance */ Linear.prototype.offset = 0; /** * Creates a new Linear instance using the specified properties. * @function create * @memberof google.api.Distribution.BucketOptions.Linear * @static * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set * @returns {google.api.Distribution.BucketOptions.Linear} Linear instance */ Linear.create = function create(properties) { return new Linear(properties); }; /** * Encodes the specified Linear message. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. * @function encode * @memberof google.api.Distribution.BucketOptions.Linear * @static * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Linear.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); if (message.width != null && Object.hasOwnProperty.call(message, "width")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.width); if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) writer.uint32(/* id 3, wireType 1 =*/25).double(message.offset); return writer; }; /** * Encodes the specified Linear message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Distribution.BucketOptions.Linear * @static * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Linear.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Linear message from the specified reader or buffer. * @function decode * @memberof google.api.Distribution.BucketOptions.Linear * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Distribution.BucketOptions.Linear} Linear * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Linear.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Linear(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.numFiniteBuckets = reader.int32(); break; case 2: message.width = reader.double(); break; case 3: message.offset = reader.double(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Linear message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Distribution.BucketOptions.Linear * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Distribution.BucketOptions.Linear} Linear * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Linear.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Linear message. * @function verify * @memberof google.api.Distribution.BucketOptions.Linear * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Linear.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) if (!$util.isInteger(message.numFiniteBuckets)) return "numFiniteBuckets: integer expected"; if (message.width != null && message.hasOwnProperty("width")) if (typeof message.width !== "number") return "width: number expected"; if (message.offset != null && message.hasOwnProperty("offset")) if (typeof message.offset !== "number") return "offset: number expected"; return null; }; /** * Creates a Linear message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Distribution.BucketOptions.Linear * @static * @param {Object.} object Plain object * @returns {google.api.Distribution.BucketOptions.Linear} Linear */ Linear.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Distribution.BucketOptions.Linear) return object; var message = new $root.google.api.Distribution.BucketOptions.Linear(); if (object.numFiniteBuckets != null) message.numFiniteBuckets = object.numFiniteBuckets | 0; if (object.width != null) message.width = Number(object.width); if (object.offset != null) message.offset = Number(object.offset); return message; }; /** * Creates a plain object from a Linear message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Distribution.BucketOptions.Linear * @static * @param {google.api.Distribution.BucketOptions.Linear} message Linear * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Linear.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.numFiniteBuckets = 0; object.width = 0; object.offset = 0; } if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) object.numFiniteBuckets = message.numFiniteBuckets; if (message.width != null && message.hasOwnProperty("width")) object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; if (message.offset != null && message.hasOwnProperty("offset")) object.offset = options.json && !isFinite(message.offset) ? String(message.offset) : message.offset; return object; }; /** * Converts this Linear to JSON. * @function toJSON * @memberof google.api.Distribution.BucketOptions.Linear * @instance * @returns {Object.} JSON object */ Linear.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Linear; })(); BucketOptions.Exponential = (function() { /** * Properties of an Exponential. * @memberof google.api.Distribution.BucketOptions * @interface IExponential * @property {number|null} [numFiniteBuckets] Exponential numFiniteBuckets * @property {number|null} [growthFactor] Exponential growthFactor * @property {number|null} [scale] Exponential scale */ /** * Constructs a new Exponential. * @memberof google.api.Distribution.BucketOptions * @classdesc Represents an Exponential. * @implements IExponential * @constructor * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set */ function Exponential(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Exponential numFiniteBuckets. * @member {number} numFiniteBuckets * @memberof google.api.Distribution.BucketOptions.Exponential * @instance */ Exponential.prototype.numFiniteBuckets = 0; /** * Exponential growthFactor. * @member {number} growthFactor * @memberof google.api.Distribution.BucketOptions.Exponential * @instance */ Exponential.prototype.growthFactor = 0; /** * Exponential scale. * @member {number} scale * @memberof google.api.Distribution.BucketOptions.Exponential * @instance */ Exponential.prototype.scale = 0; /** * Creates a new Exponential instance using the specified properties. * @function create * @memberof google.api.Distribution.BucketOptions.Exponential * @static * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential instance */ Exponential.create = function create(properties) { return new Exponential(properties); }; /** * Encodes the specified Exponential message. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. * @function encode * @memberof google.api.Distribution.BucketOptions.Exponential * @static * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Exponential.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); if (message.growthFactor != null && Object.hasOwnProperty.call(message, "growthFactor")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.growthFactor); if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) writer.uint32(/* id 3, wireType 1 =*/25).double(message.scale); return writer; }; /** * Encodes the specified Exponential message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Distribution.BucketOptions.Exponential * @static * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Exponential.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Exponential message from the specified reader or buffer. * @function decode * @memberof google.api.Distribution.BucketOptions.Exponential * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Exponential.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Exponential(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.numFiniteBuckets = reader.int32(); break; case 2: message.growthFactor = reader.double(); break; case 3: message.scale = reader.double(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Exponential message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Distribution.BucketOptions.Exponential * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Exponential.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Exponential message. * @function verify * @memberof google.api.Distribution.BucketOptions.Exponential * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Exponential.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) if (!$util.isInteger(message.numFiniteBuckets)) return "numFiniteBuckets: integer expected"; if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) if (typeof message.growthFactor !== "number") return "growthFactor: number expected"; if (message.scale != null && message.hasOwnProperty("scale")) if (typeof message.scale !== "number") return "scale: number expected"; return null; }; /** * Creates an Exponential message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Distribution.BucketOptions.Exponential * @static * @param {Object.} object Plain object * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential */ Exponential.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Distribution.BucketOptions.Exponential) return object; var message = new $root.google.api.Distribution.BucketOptions.Exponential(); if (object.numFiniteBuckets != null) message.numFiniteBuckets = object.numFiniteBuckets | 0; if (object.growthFactor != null) message.growthFactor = Number(object.growthFactor); if (object.scale != null) message.scale = Number(object.scale); return message; }; /** * Creates a plain object from an Exponential message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Distribution.BucketOptions.Exponential * @static * @param {google.api.Distribution.BucketOptions.Exponential} message Exponential * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Exponential.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.numFiniteBuckets = 0; object.growthFactor = 0; object.scale = 0; } if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) object.numFiniteBuckets = message.numFiniteBuckets; if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) object.growthFactor = options.json && !isFinite(message.growthFactor) ? String(message.growthFactor) : message.growthFactor; if (message.scale != null && message.hasOwnProperty("scale")) object.scale = options.json && !isFinite(message.scale) ? String(message.scale) : message.scale; return object; }; /** * Converts this Exponential to JSON. * @function toJSON * @memberof google.api.Distribution.BucketOptions.Exponential * @instance * @returns {Object.} JSON object */ Exponential.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Exponential; })(); BucketOptions.Explicit = (function() { /** * Properties of an Explicit. * @memberof google.api.Distribution.BucketOptions * @interface IExplicit * @property {Array.|null} [bounds] Explicit bounds */ /** * Constructs a new Explicit. * @memberof google.api.Distribution.BucketOptions * @classdesc Represents an Explicit. * @implements IExplicit * @constructor * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set */ function Explicit(properties) { this.bounds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Explicit bounds. * @member {Array.} bounds * @memberof google.api.Distribution.BucketOptions.Explicit * @instance */ Explicit.prototype.bounds = $util.emptyArray; /** * Creates a new Explicit instance using the specified properties. * @function create * @memberof google.api.Distribution.BucketOptions.Explicit * @static * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit instance */ Explicit.create = function create(properties) { return new Explicit(properties); }; /** * Encodes the specified Explicit message. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. * @function encode * @memberof google.api.Distribution.BucketOptions.Explicit * @static * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Explicit.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.bounds != null && message.bounds.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.bounds.length; ++i) writer.double(message.bounds[i]); writer.ldelim(); } return writer; }; /** * Encodes the specified Explicit message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Distribution.BucketOptions.Explicit * @static * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Explicit.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Explicit message from the specified reader or buffer. * @function decode * @memberof google.api.Distribution.BucketOptions.Explicit * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Explicit.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Explicit(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.bounds && message.bounds.length)) message.bounds = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.bounds.push(reader.double()); } else message.bounds.push(reader.double()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Explicit message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Distribution.BucketOptions.Explicit * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Explicit.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Explicit message. * @function verify * @memberof google.api.Distribution.BucketOptions.Explicit * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Explicit.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.bounds != null && message.hasOwnProperty("bounds")) { if (!Array.isArray(message.bounds)) return "bounds: array expected"; for (var i = 0; i < message.bounds.length; ++i) if (typeof message.bounds[i] !== "number") return "bounds: number[] expected"; } return null; }; /** * Creates an Explicit message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Distribution.BucketOptions.Explicit * @static * @param {Object.} object Plain object * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit */ Explicit.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Distribution.BucketOptions.Explicit) return object; var message = new $root.google.api.Distribution.BucketOptions.Explicit(); if (object.bounds) { if (!Array.isArray(object.bounds)) throw TypeError(".google.api.Distribution.BucketOptions.Explicit.bounds: array expected"); message.bounds = []; for (var i = 0; i < object.bounds.length; ++i) message.bounds[i] = Number(object.bounds[i]); } return message; }; /** * Creates a plain object from an Explicit message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Distribution.BucketOptions.Explicit * @static * @param {google.api.Distribution.BucketOptions.Explicit} message Explicit * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Explicit.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.bounds = []; if (message.bounds && message.bounds.length) { object.bounds = []; for (var j = 0; j < message.bounds.length; ++j) object.bounds[j] = options.json && !isFinite(message.bounds[j]) ? String(message.bounds[j]) : message.bounds[j]; } return object; }; /** * Converts this Explicit to JSON. * @function toJSON * @memberof google.api.Distribution.BucketOptions.Explicit * @instance * @returns {Object.} JSON object */ Explicit.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Explicit; })(); return BucketOptions; })(); Distribution.Exemplar = (function() { /** * Properties of an Exemplar. * @memberof google.api.Distribution * @interface IExemplar * @property {number|null} [value] Exemplar value * @property {google.protobuf.ITimestamp|null} [timestamp] Exemplar timestamp * @property {Array.|null} [attachments] Exemplar attachments */ /** * Constructs a new Exemplar. * @memberof google.api.Distribution * @classdesc Represents an Exemplar. * @implements IExemplar * @constructor * @param {google.api.Distribution.IExemplar=} [properties] Properties to set */ function Exemplar(properties) { this.attachments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Exemplar value. * @member {number} value * @memberof google.api.Distribution.Exemplar * @instance */ Exemplar.prototype.value = 0; /** * Exemplar timestamp. * @member {google.protobuf.ITimestamp|null|undefined} timestamp * @memberof google.api.Distribution.Exemplar * @instance */ Exemplar.prototype.timestamp = null; /** * Exemplar attachments. * @member {Array.} attachments * @memberof google.api.Distribution.Exemplar * @instance */ Exemplar.prototype.attachments = $util.emptyArray; /** * Creates a new Exemplar instance using the specified properties. * @function create * @memberof google.api.Distribution.Exemplar * @static * @param {google.api.Distribution.IExemplar=} [properties] Properties to set * @returns {google.api.Distribution.Exemplar} Exemplar instance */ Exemplar.create = function create(properties) { return new Exemplar(properties); }; /** * Encodes the specified Exemplar message. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. * @function encode * @memberof google.api.Distribution.Exemplar * @static * @param {google.api.Distribution.IExemplar} message Exemplar message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Exemplar.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.attachments != null && message.attachments.length) for (var i = 0; i < message.attachments.length; ++i) $root.google.protobuf.Any.encode(message.attachments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Distribution.Exemplar * @static * @param {google.api.Distribution.IExemplar} message Exemplar message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Exemplar.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Exemplar message from the specified reader or buffer. * @function decode * @memberof google.api.Distribution.Exemplar * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Distribution.Exemplar} Exemplar * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Exemplar.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.Exemplar(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.value = reader.double(); break; case 2: message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: if (!(message.attachments && message.attachments.length)) message.attachments = []; message.attachments.push($root.google.protobuf.Any.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Exemplar message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Distribution.Exemplar * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Distribution.Exemplar} Exemplar * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Exemplar.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Exemplar message. * @function verify * @memberof google.api.Distribution.Exemplar * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Exemplar.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.value != null && message.hasOwnProperty("value")) if (typeof message.value !== "number") return "value: number expected"; if (message.timestamp != null && message.hasOwnProperty("timestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.timestamp); if (error) return "timestamp." + error; } if (message.attachments != null && message.hasOwnProperty("attachments")) { if (!Array.isArray(message.attachments)) return "attachments: array expected"; for (var i = 0; i < message.attachments.length; ++i) { var error = $root.google.protobuf.Any.verify(message.attachments[i]); if (error) return "attachments." + error; } } return null; }; /** * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Distribution.Exemplar * @static * @param {Object.} object Plain object * @returns {google.api.Distribution.Exemplar} Exemplar */ Exemplar.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Distribution.Exemplar) return object; var message = new $root.google.api.Distribution.Exemplar(); if (object.value != null) message.value = Number(object.value); if (object.timestamp != null) { if (typeof object.timestamp !== "object") throw TypeError(".google.api.Distribution.Exemplar.timestamp: object expected"); message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); } if (object.attachments) { if (!Array.isArray(object.attachments)) throw TypeError(".google.api.Distribution.Exemplar.attachments: array expected"); message.attachments = []; for (var i = 0; i < object.attachments.length; ++i) { if (typeof object.attachments[i] !== "object") throw TypeError(".google.api.Distribution.Exemplar.attachments: object expected"); message.attachments[i] = $root.google.protobuf.Any.fromObject(object.attachments[i]); } } return message; }; /** * Creates a plain object from an Exemplar message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Distribution.Exemplar * @static * @param {google.api.Distribution.Exemplar} message Exemplar * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Exemplar.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.attachments = []; if (options.defaults) { object.value = 0; object.timestamp = null; } if (message.value != null && message.hasOwnProperty("value")) object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; if (message.timestamp != null && message.hasOwnProperty("timestamp")) object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); if (message.attachments && message.attachments.length) { object.attachments = []; for (var j = 0; j < message.attachments.length; ++j) object.attachments[j] = $root.google.protobuf.Any.toObject(message.attachments[j], options); } return object; }; /** * Converts this Exemplar to JSON. * @function toJSON * @memberof google.api.Distribution.Exemplar * @instance * @returns {Object.} JSON object */ Exemplar.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Exemplar; })(); return Distribution; })(); api.MetricDescriptor = (function() { /** * Properties of a MetricDescriptor. * @memberof google.api * @interface IMetricDescriptor * @property {string|null} [name] MetricDescriptor name * @property {string|null} [type] MetricDescriptor type * @property {Array.|null} [labels] MetricDescriptor labels * @property {google.api.MetricDescriptor.MetricKind|null} [metricKind] MetricDescriptor metricKind * @property {google.api.MetricDescriptor.ValueType|null} [valueType] MetricDescriptor valueType * @property {string|null} [unit] MetricDescriptor unit * @property {string|null} [description] MetricDescriptor description * @property {string|null} [displayName] MetricDescriptor displayName * @property {google.api.MetricDescriptor.IMetricDescriptorMetadata|null} [metadata] MetricDescriptor metadata * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptor launchStage * @property {Array.|null} [monitoredResourceTypes] MetricDescriptor monitoredResourceTypes */ /** * Constructs a new MetricDescriptor. * @memberof google.api * @classdesc Represents a MetricDescriptor. * @implements IMetricDescriptor * @constructor * @param {google.api.IMetricDescriptor=} [properties] Properties to set */ function MetricDescriptor(properties) { this.labels = []; this.monitoredResourceTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MetricDescriptor name. * @member {string} name * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.name = ""; /** * MetricDescriptor type. * @member {string} type * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.type = ""; /** * MetricDescriptor labels. * @member {Array.} labels * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.labels = $util.emptyArray; /** * MetricDescriptor metricKind. * @member {google.api.MetricDescriptor.MetricKind} metricKind * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.metricKind = 0; /** * MetricDescriptor valueType. * @member {google.api.MetricDescriptor.ValueType} valueType * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.valueType = 0; /** * MetricDescriptor unit. * @member {string} unit * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.unit = ""; /** * MetricDescriptor description. * @member {string} description * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.description = ""; /** * MetricDescriptor displayName. * @member {string} displayName * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.displayName = ""; /** * MetricDescriptor metadata. * @member {google.api.MetricDescriptor.IMetricDescriptorMetadata|null|undefined} metadata * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.metadata = null; /** * MetricDescriptor launchStage. * @member {google.api.LaunchStage} launchStage * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.launchStage = 0; /** * MetricDescriptor monitoredResourceTypes. * @member {Array.} monitoredResourceTypes * @memberof google.api.MetricDescriptor * @instance */ MetricDescriptor.prototype.monitoredResourceTypes = $util.emptyArray; /** * Creates a new MetricDescriptor instance using the specified properties. * @function create * @memberof google.api.MetricDescriptor * @static * @param {google.api.IMetricDescriptor=} [properties] Properties to set * @returns {google.api.MetricDescriptor} MetricDescriptor instance */ MetricDescriptor.create = function create(properties) { return new MetricDescriptor(properties); }; /** * Encodes the specified MetricDescriptor message. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. * @function encode * @memberof google.api.MetricDescriptor * @static * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MetricDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.labels != null && message.labels.length) for (var i = 0; i < message.labels.length; ++i) $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.metricKind != null && Object.hasOwnProperty.call(message, "metricKind")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.metricKind); if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.valueType); if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.unit); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.displayName); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.type); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) $root.google.api.MetricDescriptor.MetricDescriptorMetadata.encode(message.metadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.launchStage); if (message.monitoredResourceTypes != null && message.monitoredResourceTypes.length) for (var i = 0; i < message.monitoredResourceTypes.length; ++i) writer.uint32(/* id 13, wireType 2 =*/106).string(message.monitoredResourceTypes[i]); return writer; }; /** * Encodes the specified MetricDescriptor message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. * @function encodeDelimited * @memberof google.api.MetricDescriptor * @static * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MetricDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MetricDescriptor message from the specified reader or buffer. * @function decode * @memberof google.api.MetricDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.MetricDescriptor} MetricDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MetricDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MetricDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 8: message.type = reader.string(); break; case 2: if (!(message.labels && message.labels.length)) message.labels = []; message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); break; case 3: message.metricKind = reader.int32(); break; case 4: message.valueType = reader.int32(); break; case 5: message.unit = reader.string(); break; case 6: message.description = reader.string(); break; case 7: message.displayName = reader.string(); break; case 10: message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.decode(reader, reader.uint32()); break; case 12: message.launchStage = reader.int32(); break; case 13: if (!(message.monitoredResourceTypes && message.monitoredResourceTypes.length)) message.monitoredResourceTypes = []; message.monitoredResourceTypes.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.MetricDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.MetricDescriptor} MetricDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MetricDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MetricDescriptor message. * @function verify * @memberof google.api.MetricDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MetricDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.labels != null && message.hasOwnProperty("labels")) { if (!Array.isArray(message.labels)) return "labels: array expected"; for (var i = 0; i < message.labels.length; ++i) { var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); if (error) return "labels." + error; } } if (message.metricKind != null && message.hasOwnProperty("metricKind")) switch (message.metricKind) { default: return "metricKind: enum value expected"; case 0: case 1: case 2: case 3: break; } if (message.valueType != null && message.hasOwnProperty("valueType")) switch (message.valueType) { default: return "valueType: enum value expected"; case 0: case 1: case 2: case 3: case 4: case 5: case 6: break; } if (message.unit != null && message.hasOwnProperty("unit")) if (!$util.isString(message.unit)) return "unit: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; if (message.metadata != null && message.hasOwnProperty("metadata")) { var error = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.verify(message.metadata); if (error) return "metadata." + error; } if (message.launchStage != null && message.hasOwnProperty("launchStage")) switch (message.launchStage) { default: return "launchStage: enum value expected"; case 0: case 6: case 7: case 1: case 2: case 3: case 4: case 5: break; } if (message.monitoredResourceTypes != null && message.hasOwnProperty("monitoredResourceTypes")) { if (!Array.isArray(message.monitoredResourceTypes)) return "monitoredResourceTypes: array expected"; for (var i = 0; i < message.monitoredResourceTypes.length; ++i) if (!$util.isString(message.monitoredResourceTypes[i])) return "monitoredResourceTypes: string[] expected"; } return null; }; /** * Creates a MetricDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.MetricDescriptor * @static * @param {Object.} object Plain object * @returns {google.api.MetricDescriptor} MetricDescriptor */ MetricDescriptor.fromObject = function fromObject(object) { if (object instanceof $root.google.api.MetricDescriptor) return object; var message = new $root.google.api.MetricDescriptor(); if (object.name != null) message.name = String(object.name); if (object.type != null) message.type = String(object.type); if (object.labels) { if (!Array.isArray(object.labels)) throw TypeError(".google.api.MetricDescriptor.labels: array expected"); message.labels = []; for (var i = 0; i < object.labels.length; ++i) { if (typeof object.labels[i] !== "object") throw TypeError(".google.api.MetricDescriptor.labels: object expected"); message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); } } switch (object.metricKind) { case "METRIC_KIND_UNSPECIFIED": case 0: message.metricKind = 0; break; case "GAUGE": case 1: message.metricKind = 1; break; case "DELTA": case 2: message.metricKind = 2; break; case "CUMULATIVE": case 3: message.metricKind = 3; break; } switch (object.valueType) { case "VALUE_TYPE_UNSPECIFIED": case 0: message.valueType = 0; break; case "BOOL": case 1: message.valueType = 1; break; case "INT64": case 2: message.valueType = 2; break; case "DOUBLE": case 3: message.valueType = 3; break; case "STRING": case 4: message.valueType = 4; break; case "DISTRIBUTION": case 5: message.valueType = 5; break; case "MONEY": case 6: message.valueType = 6; break; } if (object.unit != null) message.unit = String(object.unit); if (object.description != null) message.description = String(object.description); if (object.displayName != null) message.displayName = String(object.displayName); if (object.metadata != null) { if (typeof object.metadata !== "object") throw TypeError(".google.api.MetricDescriptor.metadata: object expected"); message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.fromObject(object.metadata); } switch (object.launchStage) { case "LAUNCH_STAGE_UNSPECIFIED": case 0: message.launchStage = 0; break; case "UNIMPLEMENTED": case 6: message.launchStage = 6; break; case "PRELAUNCH": case 7: message.launchStage = 7; break; case "EARLY_ACCESS": case 1: message.launchStage = 1; break; case "ALPHA": case 2: message.launchStage = 2; break; case "BETA": case 3: message.launchStage = 3; break; case "GA": case 4: message.launchStage = 4; break; case "DEPRECATED": case 5: message.launchStage = 5; break; } if (object.monitoredResourceTypes) { if (!Array.isArray(object.monitoredResourceTypes)) throw TypeError(".google.api.MetricDescriptor.monitoredResourceTypes: array expected"); message.monitoredResourceTypes = []; for (var i = 0; i < object.monitoredResourceTypes.length; ++i) message.monitoredResourceTypes[i] = String(object.monitoredResourceTypes[i]); } return message; }; /** * Creates a plain object from a MetricDescriptor message. Also converts values to other types if specified. * @function toObject * @memberof google.api.MetricDescriptor * @static * @param {google.api.MetricDescriptor} message MetricDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MetricDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.labels = []; object.monitoredResourceTypes = []; } if (options.defaults) { object.name = ""; object.metricKind = options.enums === String ? "METRIC_KIND_UNSPECIFIED" : 0; object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; object.unit = ""; object.description = ""; object.displayName = ""; object.type = ""; object.metadata = null; object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.labels && message.labels.length) { object.labels = []; for (var j = 0; j < message.labels.length; ++j) object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); } if (message.metricKind != null && message.hasOwnProperty("metricKind")) object.metricKind = options.enums === String ? $root.google.api.MetricDescriptor.MetricKind[message.metricKind] : message.metricKind; if (message.valueType != null && message.hasOwnProperty("valueType")) object.valueType = options.enums === String ? $root.google.api.MetricDescriptor.ValueType[message.valueType] : message.valueType; if (message.unit != null && message.hasOwnProperty("unit")) object.unit = message.unit; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; if (message.metadata != null && message.hasOwnProperty("metadata")) object.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject(message.metadata, options); if (message.launchStage != null && message.hasOwnProperty("launchStage")) object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; if (message.monitoredResourceTypes && message.monitoredResourceTypes.length) { object.monitoredResourceTypes = []; for (var j = 0; j < message.monitoredResourceTypes.length; ++j) object.monitoredResourceTypes[j] = message.monitoredResourceTypes[j]; } return object; }; /** * Converts this MetricDescriptor to JSON. * @function toJSON * @memberof google.api.MetricDescriptor * @instance * @returns {Object.} JSON object */ MetricDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; MetricDescriptor.MetricDescriptorMetadata = (function() { /** * Properties of a MetricDescriptorMetadata. * @memberof google.api.MetricDescriptor * @interface IMetricDescriptorMetadata * @property {google.api.LaunchStage|null} [launchStage] MetricDescriptorMetadata launchStage * @property {google.protobuf.IDuration|null} [samplePeriod] MetricDescriptorMetadata samplePeriod * @property {google.protobuf.IDuration|null} [ingestDelay] MetricDescriptorMetadata ingestDelay */ /** * Constructs a new MetricDescriptorMetadata. * @memberof google.api.MetricDescriptor * @classdesc Represents a MetricDescriptorMetadata. * @implements IMetricDescriptorMetadata * @constructor * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set */ function MetricDescriptorMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MetricDescriptorMetadata launchStage. * @member {google.api.LaunchStage} launchStage * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @instance */ MetricDescriptorMetadata.prototype.launchStage = 0; /** * MetricDescriptorMetadata samplePeriod. * @member {google.protobuf.IDuration|null|undefined} samplePeriod * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @instance */ MetricDescriptorMetadata.prototype.samplePeriod = null; /** * MetricDescriptorMetadata ingestDelay. * @member {google.protobuf.IDuration|null|undefined} ingestDelay * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @instance */ MetricDescriptorMetadata.prototype.ingestDelay = null; /** * Creates a new MetricDescriptorMetadata instance using the specified properties. * @function create * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata=} [properties] Properties to set * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata instance */ MetricDescriptorMetadata.create = function create(properties) { return new MetricDescriptorMetadata(properties); }; /** * Encodes the specified MetricDescriptorMetadata message. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. * @function encode * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata} message MetricDescriptorMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MetricDescriptorMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.launchStage); if (message.samplePeriod != null && Object.hasOwnProperty.call(message, "samplePeriod")) $root.google.protobuf.Duration.encode(message.samplePeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.ingestDelay != null && Object.hasOwnProperty.call(message, "ingestDelay")) $root.google.protobuf.Duration.encode(message.ingestDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified MetricDescriptorMetadata message, length delimited. Does not implicitly {@link google.api.MetricDescriptor.MetricDescriptorMetadata.verify|verify} messages. * @function encodeDelimited * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {google.api.MetricDescriptor.IMetricDescriptorMetadata} message MetricDescriptorMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MetricDescriptorMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MetricDescriptorMetadata message from the specified reader or buffer. * @function decode * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MetricDescriptorMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MetricDescriptor.MetricDescriptorMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.launchStage = reader.int32(); break; case 2: message.samplePeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 3: message.ingestDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MetricDescriptorMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MetricDescriptorMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MetricDescriptorMetadata message. * @function verify * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MetricDescriptorMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.launchStage != null && message.hasOwnProperty("launchStage")) switch (message.launchStage) { default: return "launchStage: enum value expected"; case 0: case 6: case 7: case 1: case 2: case 3: case 4: case 5: break; } if (message.samplePeriod != null && message.hasOwnProperty("samplePeriod")) { var error = $root.google.protobuf.Duration.verify(message.samplePeriod); if (error) return "samplePeriod." + error; } if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) { var error = $root.google.protobuf.Duration.verify(message.ingestDelay); if (error) return "ingestDelay." + error; } return null; }; /** * Creates a MetricDescriptorMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {Object.} object Plain object * @returns {google.api.MetricDescriptor.MetricDescriptorMetadata} MetricDescriptorMetadata */ MetricDescriptorMetadata.fromObject = function fromObject(object) { if (object instanceof $root.google.api.MetricDescriptor.MetricDescriptorMetadata) return object; var message = new $root.google.api.MetricDescriptor.MetricDescriptorMetadata(); switch (object.launchStage) { case "LAUNCH_STAGE_UNSPECIFIED": case 0: message.launchStage = 0; break; case "UNIMPLEMENTED": case 6: message.launchStage = 6; break; case "PRELAUNCH": case 7: message.launchStage = 7; break; case "EARLY_ACCESS": case 1: message.launchStage = 1; break; case "ALPHA": case 2: message.launchStage = 2; break; case "BETA": case 3: message.launchStage = 3; break; case "GA": case 4: message.launchStage = 4; break; case "DEPRECATED": case 5: message.launchStage = 5; break; } if (object.samplePeriod != null) { if (typeof object.samplePeriod !== "object") throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.samplePeriod: object expected"); message.samplePeriod = $root.google.protobuf.Duration.fromObject(object.samplePeriod); } if (object.ingestDelay != null) { if (typeof object.ingestDelay !== "object") throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.ingestDelay: object expected"); message.ingestDelay = $root.google.protobuf.Duration.fromObject(object.ingestDelay); } return message; }; /** * Creates a plain object from a MetricDescriptorMetadata message. Also converts values to other types if specified. * @function toObject * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @static * @param {google.api.MetricDescriptor.MetricDescriptorMetadata} message MetricDescriptorMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MetricDescriptorMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; object.samplePeriod = null; object.ingestDelay = null; } if (message.launchStage != null && message.hasOwnProperty("launchStage")) object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; if (message.samplePeriod != null && message.hasOwnProperty("samplePeriod")) object.samplePeriod = $root.google.protobuf.Duration.toObject(message.samplePeriod, options); if (message.ingestDelay != null && message.hasOwnProperty("ingestDelay")) object.ingestDelay = $root.google.protobuf.Duration.toObject(message.ingestDelay, options); return object; }; /** * Converts this MetricDescriptorMetadata to JSON. * @function toJSON * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata * @instance * @returns {Object.} JSON object */ MetricDescriptorMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MetricDescriptorMetadata; })(); /** * MetricKind enum. * @name google.api.MetricDescriptor.MetricKind * @enum {number} * @property {number} METRIC_KIND_UNSPECIFIED=0 METRIC_KIND_UNSPECIFIED value * @property {number} GAUGE=1 GAUGE value * @property {number} DELTA=2 DELTA value * @property {number} CUMULATIVE=3 CUMULATIVE value */ MetricDescriptor.MetricKind = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "METRIC_KIND_UNSPECIFIED"] = 0; values[valuesById[1] = "GAUGE"] = 1; values[valuesById[2] = "DELTA"] = 2; values[valuesById[3] = "CUMULATIVE"] = 3; return values; })(); /** * ValueType enum. * @name google.api.MetricDescriptor.ValueType * @enum {number} * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value * @property {number} BOOL=1 BOOL value * @property {number} INT64=2 INT64 value * @property {number} DOUBLE=3 DOUBLE value * @property {number} STRING=4 STRING value * @property {number} DISTRIBUTION=5 DISTRIBUTION value * @property {number} MONEY=6 MONEY value */ MetricDescriptor.ValueType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "BOOL"] = 1; values[valuesById[2] = "INT64"] = 2; values[valuesById[3] = "DOUBLE"] = 3; values[valuesById[4] = "STRING"] = 4; values[valuesById[5] = "DISTRIBUTION"] = 5; values[valuesById[6] = "MONEY"] = 6; return values; })(); return MetricDescriptor; })(); api.Metric = (function() { /** * Properties of a Metric. * @memberof google.api * @interface IMetric * @property {string|null} [type] Metric type * @property {Object.|null} [labels] Metric labels */ /** * Constructs a new Metric. * @memberof google.api * @classdesc Represents a Metric. * @implements IMetric * @constructor * @param {google.api.IMetric=} [properties] Properties to set */ function Metric(properties) { this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Metric type. * @member {string} type * @memberof google.api.Metric * @instance */ Metric.prototype.type = ""; /** * Metric labels. * @member {Object.} labels * @memberof google.api.Metric * @instance */ Metric.prototype.labels = $util.emptyObject; /** * Creates a new Metric instance using the specified properties. * @function create * @memberof google.api.Metric * @static * @param {google.api.IMetric=} [properties] Properties to set * @returns {google.api.Metric} Metric instance */ Metric.create = function create(properties) { return new Metric(properties); }; /** * Encodes the specified Metric message. Does not implicitly {@link google.api.Metric.verify|verify} messages. * @function encode * @memberof google.api.Metric * @static * @param {google.api.IMetric} message Metric message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Metric.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); return writer; }; /** * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.api.Metric.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Metric * @static * @param {google.api.IMetric} message Metric message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Metric.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Metric message from the specified reader or buffer. * @function decode * @memberof google.api.Metric * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Metric} Metric * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Metric.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Metric(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 3: message.type = reader.string(); break; case 2: if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = reader.string(); break; default: reader.skipType(tag2 & 7); break; } } message.labels[key] = value; break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Metric message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Metric * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Metric} Metric * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Metric.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Metric message. * @function verify * @memberof google.api.Metric * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Metric.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); for (var i = 0; i < key.length; ++i) if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } return null; }; /** * Creates a Metric message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Metric * @static * @param {Object.} object Plain object * @returns {google.api.Metric} Metric */ Metric.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Metric) return object; var message = new $root.google.api.Metric(); if (object.type != null) message.type = String(object.type); if (object.labels) { if (typeof object.labels !== "object") throw TypeError(".google.api.Metric.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } return message; }; /** * Creates a plain object from a Metric message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Metric * @static * @param {google.api.Metric} message Metric * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Metric.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.labels = {}; if (options.defaults) object.type = ""; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; return object; }; /** * Converts this Metric to JSON. * @function toJSON * @memberof google.api.Metric * @instance * @returns {Object.} JSON object */ Metric.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Metric; })(); return api; })(); google.rpc = (function() { /** * Namespace rpc. * @memberof google * @namespace */ var rpc = {}; rpc.Status = (function() { /** * Properties of a Status. * @memberof google.rpc * @interface IStatus * @property {number|null} [code] Status code * @property {string|null} [message] Status message * @property {Array.|null} [details] Status details */ /** * Constructs a new Status. * @memberof google.rpc * @classdesc Represents a Status. * @implements IStatus * @constructor * @param {google.rpc.IStatus=} [properties] Properties to set */ function Status(properties) { this.details = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Status code. * @member {number} code * @memberof google.rpc.Status * @instance */ Status.prototype.code = 0; /** * Status message. * @member {string} message * @memberof google.rpc.Status * @instance */ Status.prototype.message = ""; /** * Status details. * @member {Array.} details * @memberof google.rpc.Status * @instance */ Status.prototype.details = $util.emptyArray; /** * Creates a new Status instance using the specified properties. * @function create * @memberof google.rpc.Status * @static * @param {google.rpc.IStatus=} [properties] Properties to set * @returns {google.rpc.Status} Status instance */ Status.create = function create(properties) { return new Status(properties); }; /** * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encode * @memberof google.rpc.Status * @static * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.details != null && message.details.length) for (var i = 0; i < message.details.length; ++i) $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encodeDelimited * @memberof google.rpc.Status * @static * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Status.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Status message from the specified reader or buffer. * @function decode * @memberof google.rpc.Status * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.rpc.Status} Status * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Status.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.code = reader.int32(); break; case 2: message.message = reader.string(); break; case 3: if (!(message.details && message.details.length)) message.details = []; message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Status message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.rpc.Status * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.rpc.Status} Status * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Status.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Status message. * @function verify * @memberof google.rpc.Status * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Status.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.code != null && message.hasOwnProperty("code")) if (!$util.isInteger(message.code)) return "code: integer expected"; if (message.message != null && message.hasOwnProperty("message")) if (!$util.isString(message.message)) return "message: string expected"; if (message.details != null && message.hasOwnProperty("details")) { if (!Array.isArray(message.details)) return "details: array expected"; for (var i = 0; i < message.details.length; ++i) { var error = $root.google.protobuf.Any.verify(message.details[i]); if (error) return "details." + error; } } return null; }; /** * Creates a Status message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.rpc.Status * @static * @param {Object.} object Plain object * @returns {google.rpc.Status} Status */ Status.fromObject = function fromObject(object) { if (object instanceof $root.google.rpc.Status) return object; var message = new $root.google.rpc.Status(); if (object.code != null) message.code = object.code | 0; if (object.message != null) message.message = String(object.message); if (object.details) { if (!Array.isArray(object.details)) throw TypeError(".google.rpc.Status.details: array expected"); message.details = []; for (var i = 0; i < object.details.length; ++i) { if (typeof object.details[i] !== "object") throw TypeError(".google.rpc.Status.details: object expected"); message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); } } return message; }; /** * Creates a plain object from a Status message. Also converts values to other types if specified. * @function toObject * @memberof google.rpc.Status * @static * @param {google.rpc.Status} message Status * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Status.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.details = []; if (options.defaults) { object.code = 0; object.message = ""; } if (message.code != null && message.hasOwnProperty("code")) object.code = message.code; if (message.message != null && message.hasOwnProperty("message")) object.message = message.message; if (message.details && message.details.length) { object.details = []; for (var j = 0; j < message.details.length; ++j) object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); } return object; }; /** * Converts this Status to JSON. * @function toJSON * @memberof google.rpc.Status * @instance * @returns {Object.} JSON object */ Status.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Status; })(); return rpc; })(); return google; })(); return $root; }); /***/ }), /***/ 96569: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Entry = exports.TRACE_SAMPLED_KEY = exports.TRACE_KEY = exports.SPAN_ID_KEY = exports.SOURCE_LOCATION_KEY = exports.OPERATION_KEY = exports.LABELS_KEY = exports.INSERT_ID_KEY = void 0; // eslint-disable-next-line @typescript-eslint/no-var-requires const EventId = __webpack_require__(97271); const extend = __webpack_require__(38171); const common_1 = __webpack_require__(29150); const http_request_1 = __webpack_require__(71881); const context_1 = __webpack_require__(39237); const eventId = new EventId(); exports.INSERT_ID_KEY = 'logging.googleapis.com/insertId'; exports.LABELS_KEY = 'logging.googleapis.com/labels'; exports.OPERATION_KEY = 'logging.googleapis.com/operation'; exports.SOURCE_LOCATION_KEY = 'logging.googleapis.com/sourceLocation'; exports.SPAN_ID_KEY = 'logging.googleapis.com/spanId'; exports.TRACE_KEY = 'logging.googleapis.com/trace'; exports.TRACE_SAMPLED_KEY = 'logging.googleapis.com/trace_sampled'; /** * Create an entry object to define new data to insert into a meta. * * Note, {@link https://cloud.google.com/logging/quotas|Cloud Logging Quotas and limits} * dictates that the maximum log entry size, including all * {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry|LogEntry Resource properties}, * cannot exceed approximately 256 KB. * * See {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry|LogEntry JSON representation} * * @class * * @param {?object} [metadata] See a * [LogEntry * Resource](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry). * @param {object|string} data The data to use as the value for this log * entry. * * If providing an object, these value types are supported: * - `String` * - `Number` * - `Boolean` * - `Buffer` * - `Object` * - `Array` * * Any other types are stringified with `String(value)`. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const syslog = logging.log('syslog'); * * const metadata = { * resource: { * type: 'gce_instance', * labels: { * zone: 'global', * instance_id: '3' * } * } * }; * * const entry = syslog.entry(metadata, { * delegate: 'my_username' * }); * * syslog.alert(entry, (err, apiResponse) => { * if (!err) { * // Log entry inserted successfully. * } * }); * * //- * // You will also receive `Entry` objects when using * // Logging#getEntries() and Log#getEntries(). * //- * logging.getEntries((err, entries) => { * if (!err) { * // entries[0].data = The data value from the log entry. * } * }); * ``` */ class Entry { constructor(metadata, data) { /** * @name Entry#metadata * @type {object} * @property {Date} timestamp * @property {number} insertId */ this.metadata = extend({ timestamp: new Date(), }, metadata); // JavaScript date has a very coarse granularity (millisecond), which makes // it quite likely that multiple log entries would have the same timestamp. // The Logging API doesn't guarantee to preserve insertion order for entries // with the same timestamp. The service does use `insertId` as a secondary // ordering for entries with the same timestamp. `insertId` needs to be // globally unique (within the project) however. // // We use a globally unique monotonically increasing EventId as the // insertId. this.metadata.insertId = this.metadata.insertId || eventId.new(); /** * @name Entry#data * @type {object} */ this.data = data; } /** * Serialize an entry to the format the API expects. Read more: * https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry * * @param {object} [options] Configuration object. * @param {boolean} [options.removeCircular] Replace circular references in an * object with a string value, `[Circular]`. * @param {string} [projectId] GCP Project ID. */ toJSON(options = {}, projectId = '') { const entry = extend(true, {}, this.metadata); // Format log message if (Object.prototype.toString.call(this.data) === '[object Object]') { entry.jsonPayload = common_1.objToStruct(this.data, { removeCircular: !!options.removeCircular, stringify: true, }); } else if (typeof this.data === 'string') { entry.textPayload = this.data; } // Format log timestamp if (entry.timestamp instanceof Date) { const seconds = entry.timestamp.getTime() / 1000; const secondsRounded = Math.floor(seconds); entry.timestamp = { seconds: secondsRounded, nanos: Math.floor((seconds - secondsRounded) * 1e9), }; } else if (typeof entry.timestamp === 'string') { entry.timestamp = common_1.zuluToDateObj(entry.timestamp); } // Format httpRequest const req = this.metadata.httpRequest; if (http_request_1.isRawHttpRequest(req)) { entry.httpRequest = http_request_1.makeHttpRequestData(req); // Format trace and span const traceContext = this.extractTraceFromHeaders(projectId); if (traceContext) { if (!this.metadata.trace && traceContext.trace) entry.trace = traceContext.trace; if (!this.metadata.spanId && traceContext.spanId) entry.spanId = traceContext.spanId; if (this.metadata.traceSampled === undefined) entry.traceSampled = traceContext.traceSampled; } } return entry; } /** * Serialize an entry to a standard format for any transports, e.g. agents. * Read more: https://cloud.google.com/logging/docs/structured-logging */ toStructuredJSON(projectId = '') { const meta = this.metadata; // Mask out the keys that need to be renamed. /* eslint-disable @typescript-eslint/no-unused-vars */ const { textPayload, jsonPayload, insertId, trace, spanId, traceSampled, operation, sourceLocation, labels, ...validKeys } = meta; /* eslint-enable @typescript-eslint/no-unused-vars */ const entry = extend(true, {}, validKeys); // Re-map keys names. entry[exports.LABELS_KEY] = meta.labels ? Object.assign({}, meta.labels) : undefined; entry[exports.INSERT_ID_KEY] = meta.insertId || undefined; entry[exports.TRACE_KEY] = meta.trace || undefined; entry[exports.SPAN_ID_KEY] = meta.spanId || undefined; entry[exports.TRACE_SAMPLED_KEY] = 'traceSampled' in meta && meta.traceSampled !== null ? meta.traceSampled : undefined; // Format log payload. entry.message = meta.textPayload || meta.jsonPayload || meta.protoPayload || undefined; entry.message = this.data || entry.message; // Format timestamp if (meta.timestamp instanceof Date) { entry.timestamp = meta.timestamp.toISOString(); } // Format httprequest const req = meta.httpRequest; if (http_request_1.isRawHttpRequest(req)) { entry.httpRequest = http_request_1.makeHttpRequestData(req); // Detected trace context from headers if applicable. const traceContext = this.extractTraceFromHeaders(projectId); if (traceContext) { if (!entry[exports.TRACE_KEY] && traceContext.trace) entry[exports.TRACE_KEY] = traceContext.trace; if (!entry[exports.SPAN_ID_KEY] && traceContext.spanId) entry[exports.SPAN_ID_KEY] = traceContext.spanId; if (entry[exports.TRACE_SAMPLED_KEY] === undefined) entry[exports.TRACE_SAMPLED_KEY] = traceContext.traceSampled; } } return entry; } /** * extractTraceFromHeaders extracts trace and span information from raw HTTP * request headers only. * @private */ extractTraceFromHeaders(projectId) { const rawReq = this.metadata.httpRequest; if (rawReq && 'headers' in rawReq) { return context_1.getOrInjectContext(rawReq, projectId, false); } return null; } /** * Create an Entry object from an API response, such as `entries:list`. * * @private * * @param {object} entry An API representation of an entry. See a * {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry| LogEntry}. * @returns {Entry} */ static fromApiResponse_(entry) { let data = entry[entry.payload]; if (entry.payload === 'jsonPayload') { data = common_1.structToObj(data); } const serializedEntry = new Entry(entry, data); if (entry.timestamp) { let ms = Number(entry.timestamp.seconds) * 1000; ms += Number(entry.timestamp.nanos) / 1e6; serializedEntry.metadata.timestamp = new Date(ms); } return serializedEntry; } } exports.Entry = Entry; //# sourceMappingURL=entry.js.map /***/ }), /***/ 9341: /***/ ((module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.v2 = exports.protos = exports.Logging = exports.Sink = exports.LogSync = exports.formatLogName = exports.assignSeverityToEntries = exports.Severity = exports.Log = exports.Entry = exports.detectServiceContext = exports.middleware = void 0; const common_1 = __webpack_require__(54777); const paginator_1 = __webpack_require__(46412); const projectify_1 = __webpack_require__(3497); const promisify_1 = __webpack_require__(19203); const arrify = __webpack_require__(61546); const extend = __webpack_require__(38171); const gax = __webpack_require__(12263); // eslint-disable-next-line @typescript-eslint/no-var-requires const pumpify = __webpack_require__(40212); const streamEvents = __webpack_require__(79626); const middleware = __webpack_require__(83870); exports.middleware = middleware; const metadata_1 = __webpack_require__(60675); Object.defineProperty(exports, "detectServiceContext", ({ enumerable: true, get: function () { return metadata_1.detectServiceContext; } })); const version = __webpack_require__(87989)/* .version */ .i8; // eslint-disable-next-line @typescript-eslint/no-var-requires const v2 = __webpack_require__(5863); exports.v2 = v2; const entry_1 = __webpack_require__(96569); Object.defineProperty(exports, "Entry", ({ enumerable: true, get: function () { return entry_1.Entry; } })); const log_common_1 = __webpack_require__(41077); Object.defineProperty(exports, "Severity", ({ enumerable: true, get: function () { return log_common_1.Severity; } })); Object.defineProperty(exports, "formatLogName", ({ enumerable: true, get: function () { return log_common_1.formatLogName; } })); Object.defineProperty(exports, "assignSeverityToEntries", ({ enumerable: true, get: function () { return log_common_1.assignSeverityToEntries; } })); const log_1 = __webpack_require__(33259); Object.defineProperty(exports, "Log", ({ enumerable: true, get: function () { return log_1.Log; } })); const log_sync_1 = __webpack_require__(3929); Object.defineProperty(exports, "LogSync", ({ enumerable: true, get: function () { return log_sync_1.LogSync; } })); const sink_1 = __webpack_require__(5764); Object.defineProperty(exports, "Sink", ({ enumerable: true, get: function () { return sink_1.Sink; } })); const stream_1 = __webpack_require__(92413); /** * @typedef {object} ClientConfig * @property {string} [projectId] The project ID from the Google Developer's * Console, e.g. 'grape-spaceship-123'. We will also check the environment * variable `GCLOUD_PROJECT` for your project ID. If your app is running in * an environment which supports {@link * https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application * Application Default Credentials}, your project ID will be detected * automatically. * @property {string} [keyFilename] Full path to the a .json, .pem, or .p12 key * downloaded from the Google Developers Console. If you provide a path to a * JSON file, the `projectId` option above is not necessary. NOTE: .pem and * .p12 require you to specify the `email` option as well. * @property {string} [email] Account email address. Required when using a .pem * or .p12 keyFilename. * @property {object} [credentials] Credentials object. * @property {string} [credentials.client_email] * @property {string} [credentials.private_key] * @property {boolean} [autoRetry=true] Automatically retry requests if the * response is related to rate limits or certain intermittent server errors. * We will exponentially backoff subsequent requests by default. * @property {number} [maxRetries=3] Maximum number of automatic retries * attempted before returning the error. * @property {Constructor} [promise] Custom promise module to use instead of * native Promises. */ /** * {@link https://cloud.google.com/logging/docs| Cloud Logging} allows you to * store, search, analyze, monitor, and alert on log data and events from Google * Cloud Platform and Amazon Web Services (AWS). * * @class * * See {@link https://cloud.google.com/logging/docs| What is Cloud Logging?} * * See {@link https://cloud.google.com/logging/docs/api| Introduction to the Cloud Logging API} * * See {@link https://www.npmjs.com/package/@google-cloud/logging-bunyan| Logging to Google Cloud from Bunyan} * * See {@link https://www.npmjs.com/package/@google-cloud/logging-winston| Logging to Google Cloud from Winston} * * @param {ClientConfig} [options] Configuration options. * * @example Import the client library * ``` * const {Logging} = require('@google-cloud/logging'); * * ``` * @example Create a client that uses Application Default Credentials (ADC): * ``` * const logging = new Logging(); * * ``` * @example Create a client with explicitcredentials: * ``` * const logging = new Logging({ projectId: * 'your-project-id', keyFilename: '/path/to/keyfile.json' * }); * * ``` * @example include:samples/quickstart.js * region_tag:logging_quickstart * Full quickstart example: */ class Logging { constructor(options) { // Determine what scopes are needed. // It is the union of the scopes on all three clients. const scopes = []; const clientClasses = [ v2.ConfigServiceV2Client, v2.LoggingServiceV2Client, v2.MetricsServiceV2Client, ]; for (const clientClass of clientClasses) { for (const scope of clientClass.scopes) { if (scopes.indexOf(scope) === -1) { scopes.push(scope); } } } const options_ = extend({ libName: 'gccl', libVersion: version, scopes, }, options); this.api = {}; this.auth = new gax.GoogleAuth(options_); this.options = options_; this.projectId = this.options.projectId || '{{projectId}}'; this.configService = new v2.ConfigServiceV2Client(this.options); this.loggingService = new v2.LoggingServiceV2Client(this.options); } // jscs:disable maximumLineLength /** * Create a sink. * * See {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks|Sink Overview} * See {@link https://cloud.google.com/logging/docs/view/advanced_filters|Advanced Logs Filters} * See {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/create|projects.sinks.create API Documentation} * * @param {string} name Name of the sink. * @param {CreateSinkRequest} config Config to set for the sink. * @param {CreateSinkCallback} [callback] Callback function. * @returns {Promise} * @throws {Error} If a name is not provided. * @throws {Error} if a config object is not provided. * @see Sink#create * * @example * ``` * const {Storage} = require('@google-cloud/storage'); * const storage = new Storage({ * projectId: 'grape-spaceship-123' * }); * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * * const config = { * destination: storage.bucket('logging-bucket'), * filter: 'severity = ALERT' * }; * * function callback(err, sink, apiResponse) { * // `sink` is a Sink object. * } * * logging.createSink('new-sink-name', config, callback); * * //- * // If the callback is omitted, we'll return a Promise. * //- * logging.createSink('new-sink-name', config).then(data => { * const sink = data[0]; * const apiResponse = data[1]; * }); * * ``` * @example include:samples/sinks.js * region_tag:logging_create_sink * Another example: */ async createSink(name, config) { if (typeof name !== 'string') { throw new Error('A sink name must be provided.'); } if (typeof config !== 'object') { throw new Error('A sink configuration object must be provided.'); } if (common_1.util.isCustomType(config.destination, 'bigquery/dataset')) { await this.setAclForDataset_(config); } if (common_1.util.isCustomType(config.destination, 'pubsub/topic')) { await this.setAclForTopic_(config); } if (common_1.util.isCustomType(config.destination, 'storage/bucket')) { await this.setAclForBucket_(config); } const reqOpts = { parent: 'projects/' + this.projectId, sink: extend({}, config, { name }), uniqueWriterIdentity: config.uniqueWriterIdentity, }; delete reqOpts.sink.gaxOptions; delete reqOpts.sink.uniqueWriterIdentity; await this.setProjectId(reqOpts); const [resp] = await this.configService.createSink(reqOpts, config.gaxOptions); const sink = this.sink(resp.name); sink.metadata = resp; return [sink, resp]; } /** * Create an entry object. * * Using this method will not itself make any API requests. You will use * the object returned in other API calls, such as * {@link Log#write}. * * Note, {@link https://cloud.google.com/logging/quotas|Cloud Logging Quotas and limits} * dictates that the maximum log entry size, including all * [LogEntry Resource properties]{@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry}, * cannot exceed _approximately_ 256 KB. * * See {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry|LogEntry JSON representation} * * @param {?object|?string} [resource] See a * [Monitored * Resource](https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource). * @param {object|string} data The data to use as the value for this log * entry. * @returns {Entry} * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * * const resource = { * type: 'gce_instance', * labels: { * zone: 'global', * instance_id: '3' * } * }; * * const entry = logging.entry(resource, { * delegate: 'my_username' * }); * * entry.toJSON(); * // { * // resource: { * // type: 'gce_instance', * // labels: { * // zone: 'global', * // instance_id: '3' * // } * // }, * // jsonPayload: { * // delegate: 'my_username' * // } * // } * ``` */ entry(resource, data) { return new entry_1.Entry(resource, data); } async getEntries(opts) { const options = opts ? opts : {}; // By default, sort entries by descending timestamp let reqOpts = extend({ orderBy: 'timestamp desc' }, options); // By default, filter entries to last 24 hours only const time = new Date(); time.setDate(time.getDate() - 1); const timeFilter = `timestamp >= "${time.toISOString()}"`; if (!options.filter) { reqOpts = extend({ filter: timeFilter }, reqOpts); } else if (!options.filter.includes('timestamp')) { reqOpts.filter += ` AND ${timeFilter}`; } reqOpts.resourceNames = arrify(reqOpts.resourceNames); this.projectId = await this.auth.getProjectId(); const resourceName = 'projects/' + this.projectId; if (reqOpts.resourceNames.indexOf(resourceName) === -1) { reqOpts.resourceNames.push(resourceName); } delete reqOpts.autoPaginate; delete reqOpts.gaxOptions; const gaxOptions = extend({ autoPaginate: options.autoPaginate, }, options.gaxOptions); const resp = await this.loggingService.listLogEntries(reqOpts, gaxOptions); const [entries] = resp; if (entries) { resp[0] = entries.map(entry_1.Entry.fromApiResponse_); } return resp; } /** * List the {@link Entry} objects in your logs as a readable object * stream. * * @method Logging#getEntriesStream * @param {GetEntriesRequest} [query] Query object for listing entries. * @returns {ReadableStream} A readable stream that emits {@link Entry} * instances. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * * logging.getEntriesStream() * .on('error', console.error) * .on('data', entry => { * // `entry` is a Cloud Logging entry object. * // See the `data` property to read the data from the entry. * }) * .on('end', function() { * // All entries retrieved. * }); * * //- * // If you anticipate many results, you can end a stream early to prevent * // unnecessary processing and API requests. * //- * logging.getEntriesStream() * .on('data', function(entry) { * this.end(); * }); * ``` */ getEntriesStream(options = {}) { let requestStream; const userStream = streamEvents(pumpify.obj()); userStream.abort = () => { if (requestStream) { requestStream.abort(); } }; const toEntryStream = new stream_1.Transform({ objectMode: true, transform: (chunk, encoding, callback) => { callback(null, entry_1.Entry.fromApiResponse_(chunk)); }, }); userStream.once('reading', () => { this.auth.getProjectId().then(projectId => { this.projectId = projectId; if (options.log) { if (options.filter) { options.filter = `(${options.filter}) AND logName="${log_common_1.formatLogName(this.projectId, options.log)}"`; } else { options.filter = `logName="${log_common_1.formatLogName(this.projectId, options.log)}"`; } delete options.log; } const reqOpts = extend({ orderBy: 'timestamp desc', }, options); reqOpts.resourceNames = arrify(reqOpts.resourceNames); reqOpts.resourceNames.push(`projects/${this.projectId}`); delete reqOpts.autoPaginate; delete reqOpts.gaxOptions; const gaxOptions = extend({ autoPaginate: options.autoPaginate, }, options.gaxOptions); let gaxStream; requestStream = streamEvents(new stream_1.PassThrough({ objectMode: true })); requestStream.abort = () => { if (gaxStream && gaxStream.cancel) { gaxStream.cancel(); } }; // eslint-disable-next-line @typescript-eslint/no-explicit-any if (!global.GCLOUD_SANDBOX_ENV) { requestStream.once('reading', () => { try { gaxStream = this.loggingService.listLogEntriesStream(reqOpts, gaxOptions); } catch (error) { requestStream.destroy(error); return; } gaxStream .on('error', err => { requestStream.destroy(err); }) .pipe(requestStream); return; }); } // eslint-disable-next-line @typescript-eslint/no-explicit-any userStream.setPipeline(requestStream, toEntryStream); }); }); return userStream; } /** * Query object for streaming entries. * * @typedef {object} TailEntriesRequest * @property {Array.|string} [resourceNames] Names of project * resources to stream logs out of. * @property {string} [filter] An * [advanced logs * filter](https://cloud.google.com/logging/docs/view/advanced_filters). An * empty filter matches all log entries. * @property {number} [bufferWindow=2] A setting to balance the tradeoff * between viewing the log entries as they are being written and viewing * them in ascending order. * @property {string} [log] A name of the log specifying to only return * entries from this log. * @property {object} [gaxOptions] Request configuration options, outlined * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. */ /** * Streaming read of live logs as log entries are ingested. Until the stream * is terminated, it will continue reading logs. * * @method Logging#tailEntries * @param {TailEntriesRequest} [query] Query object for tailing entries. * @returns {DuplexStream} A duplex stream that emits TailEntriesResponses * containing an array of {@link Entry} instances. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * * logging.tailEntries() * .on('error', console.error) * .on('data', resp => { * console.log(resp.entries); * console.log(resp.suppressionInfo); * }) * .on('end', function() { * // All entries retrieved. * }); * * //- * // If you anticipate many results, you can end a stream early to prevent * // unnecessary processing and API requests. * //- * logging.getEntriesStream() * .on('data', function(entry) { * this.end(); * }); * ``` */ tailEntries(options = {}) { const userStream = streamEvents(pumpify.obj()); // eslint-disable-next-line @typescript-eslint/no-explicit-any let gaxStream; userStream.abort = () => { if (gaxStream && gaxStream.cancel) { gaxStream.cancel(); } }; const transformStream = new stream_1.Transform({ objectMode: true, transform: (chunk, encoding, callback) => { callback(null, (() => { const formattedEntries = []; chunk.entries.forEach((entry) => { formattedEntries.push(entry_1.Entry.fromApiResponse_(entry)); }); const resp = { entries: formattedEntries, suppressionInfo: chunk.suppressionInfo, }; return resp; })()); }, }); this.auth.getProjectId().then(projectId => { this.projectId = projectId; if (options.log) { if (options.filter) { options.filter = `(${options.filter}) AND logName="${log_common_1.formatLogName(this.projectId, options.log)}"`; } else { options.filter = `logName="${log_common_1.formatLogName(this.projectId, options.log)}"`; } } options.resourceNames = arrify(options.resourceNames); options.resourceNames.push(`projects/${this.projectId}`); const writeOptions = { resourceNames: options.resourceNames, ...(options.filter && { filter: options.filter }), ...(options.bufferWindow && { bufferwindow: options.bufferWindow }), }; // eslint-disable-next-line @typescript-eslint/no-explicit-any if (!global.GCLOUD_SANDBOX_ENV) { gaxStream = this.loggingService.tailLogEntries(options.gaxOptions); // Write can only be called once in a single tail streaming session. gaxStream.write(writeOptions); // eslint-disable-next-line @typescript-eslint/no-explicit-any userStream.setPipeline(gaxStream, transformStream); } }); return userStream; } async getLogs(opts) { const options = opts ? opts : {}; this.projectId = await this.auth.getProjectId(); const reqOpts = extend({}, options, { parent: 'projects/' + this.projectId, }); delete reqOpts.autoPaginate; delete reqOpts.gaxOptions; const gaxOptions = extend({ autoPaginate: options.autoPaginate, }, options.gaxOptions); const resp = await this.loggingService.listLogs(reqOpts, gaxOptions); const [logs] = resp; if (logs) { resp[0] = logs.map((logName) => this.log(logName)); } return resp; } /** * List the {@link Log} objects in your project as a readable object stream. * * @method Logging#getLogsStream * @param {GetLogsRequest} [query] Query object for listing entries. * @returns {ReadableStream} A readable stream that emits {@link Log} * instances. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * * logging.getLogsStream() * .on('error', console.error) * .on('data', log => { * // `log` is a Cloud Logging log object. * }) * .on('end', function() { * // All logs retrieved. * }); * * //- * // If you anticipate many results, you can end a stream early to prevent * // unnecessary processing and API requests. * //- * logging.getLogsStream() * .on('data', log => { * this.end(); * }); * ``` */ getLogsStream(options = {}) { options = options || {}; let requestStream; const userStream = streamEvents(pumpify.obj()); userStream.abort = () => { if (requestStream) { requestStream.abort(); } }; const toLogStream = new stream_1.Transform({ objectMode: true, transform: (chunk, encoding, callback) => { callback(null, this.log(chunk)); }, }); userStream.once('reading', () => { this.auth.getProjectId().then(projectId => { this.projectId = projectId; const reqOpts = extend({}, options, { parent: 'projects/' + this.projectId, }); delete reqOpts.gaxOptions; const gaxOptions = extend({ autoPaginate: options.autoPaginate, }, options.gaxOptions); let gaxStream; requestStream = streamEvents(new stream_1.PassThrough({ objectMode: true })); requestStream.abort = () => { if (gaxStream && gaxStream.cancel) { gaxStream.cancel(); } }; requestStream.once('reading', () => { try { gaxStream = this.loggingService.listLogsStream(reqOpts, gaxOptions); } catch (error) { requestStream.destroy(error); return; } gaxStream .on('error', err => { requestStream.destroy(err); }) .pipe(requestStream); return; }); // eslint-disable-next-line @typescript-eslint/no-explicit-any userStream.setPipeline(requestStream, toLogStream); }); }); return userStream; } async getSinks(opts) { const options = opts ? opts : {}; this.projectId = await this.auth.getProjectId(); const reqOpts = extend({}, options, { parent: 'projects/' + this.projectId, }); delete reqOpts.autoPaginate; delete reqOpts.gaxOptions; const gaxOptions = extend({ autoPaginate: options.autoPaginate, }, options.gaxOptions); const resp = await this.configService.listSinks(reqOpts, gaxOptions); const [sinks] = resp; if (sinks) { resp[0] = sinks.map((sink) => { const sinkInstance = this.sink(sink.name); sinkInstance.metadata = sink; return sinkInstance; }); } return resp; } /** * Get the {@link Sink} objects associated with this project as a * readable object stream. * * @method Logging#getSinksStream * @param {GetSinksRequest} [query] Query object for listing sinks. * @returns {ReadableStream} A readable stream that emits {@link Sink} * instances. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * * logging.getSinksStream() * .on('error', console.error) * .on('data', sink => { * // `sink` is a Sink object. * }) * .on('end', function() { * // All sinks retrieved. * }); * * //- * // If you anticipate many results, you can end a stream early to prevent * // unnecessary processing and API requests. * //- * logging.getSinksStream() * .on('data', function(sink) { * this.end(); * }); * ``` */ getSinksStream(options) { // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; options = options || {}; let requestStream; const userStream = streamEvents(pumpify.obj()); userStream.abort = () => { if (requestStream) { requestStream.abort(); } }; const toSinkStream = new stream_1.Transform({ objectMode: true, transform: (chunk, encoding, callback) => { const sinkInstance = self.sink(chunk.name); sinkInstance.metadata = chunk; callback(null, sinkInstance); }, }); userStream.once('reading', () => { this.auth.getProjectId().then(projectId => { this.projectId = projectId; const reqOpts = extend({}, options, { parent: 'projects/' + self.projectId, }); delete reqOpts.gaxOptions; const gaxOptions = extend({ autoPaginate: options.autoPaginate, }, options.gaxOptions); let gaxStream; requestStream = streamEvents(new stream_1.PassThrough({ objectMode: true })); requestStream.abort = () => { if (gaxStream && gaxStream.cancel) { gaxStream.cancel(); } }; // eslint-disable-next-line @typescript-eslint/no-explicit-any if (!global.GCLOUD_SANDBOX_ENV) { requestStream.once('reading', () => { try { gaxStream = this.configService.listSinksStream(reqOpts, gaxOptions); } catch (error) { requestStream.destroy(error); return; } gaxStream .on('error', err => { requestStream.destroy(err); }) .pipe(requestStream); return; }); } // eslint-disable-next-line @typescript-eslint/no-explicit-any userStream.setPipeline(requestStream, toSinkStream); }); }); return userStream; } /** * Get a reference to a Cloud Logging log. * * See {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.logs|Log Overview} * * @param {string} name Name of the existing log. * @param {object} [options] Configuration object. * @param {boolean} [options.removeCircular] Replace circular references in * logged objects with a string value, `[Circular]`. (Default: false) * @returns {Log} * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.log('my-log'); * ``` */ log(name, options) { return new log_1.Log(this, name, options); } /** * Get a reference to a Cloud Logging logSync. * * @param {string} name Name of the existing log. * @param {object} transport An optional write stream. * @returns {LogSync} * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * * // Optional: enrich logs with additional context * await logging.setProjectId(); * await logging.setDetectedResource(); * * // Default transport writes to process.stdout * const log = logging.logSync('my-log'); * ``` */ logSync(name, transport) { return new log_sync_1.LogSync(this, name, transport); } /** * Get a reference to a Cloud Logging sink. * * See {@link https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks|Sink Overview} * * @param {string} name Name of the existing sink. * @returns {Sink} * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const sink = logging.sink('my-sink'); * ``` */ sink(name) { return new sink_1.Sink(this, name); } /** * Funnel all API requests through this method, to be sure we have a project * ID. * * @param {object} config Configuration object. * @param {object} config.gaxOpts GAX options. * @param {function} config.method The gax method to call. * @param {object} config.reqOpts Request options. * @param {function} [callback] Callback function. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any request(config, callback) { // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; const isStreamMode = !callback; let gaxStream; let stream; if (isStreamMode) { stream = streamEvents(new stream_1.PassThrough({ objectMode: true })); stream.abort = () => { if (gaxStream && gaxStream.cancel) { gaxStream.cancel(); } }; stream.once('reading', makeRequestStream); } else { makeRequestCallback(); } function prepareGaxRequest(callback) { self.auth.getProjectId((err, projectId) => { if (err) { callback(err); return; } self.projectId = projectId; let gaxClient = self.api[config.client]; if (!gaxClient) { // Lazily instantiate client. gaxClient = new v2[config.client](self.options); self.api[config.client] = gaxClient; } let reqOpts = extend(true, {}, config.reqOpts); reqOpts = projectify_1.replaceProjectIdToken(reqOpts, projectId); const requestFn = gaxClient[config.method].bind(gaxClient, reqOpts, config.gaxOpts); callback(null, requestFn); }); } function makeRequestCallback() { // eslint-disable-next-line @typescript-eslint/no-explicit-any if (global.GCLOUD_SANDBOX_ENV) { return; } prepareGaxRequest((err, requestFn) => { if (err) { callback(err); return; } requestFn(callback); }); } function makeRequestStream() { // eslint-disable-next-line @typescript-eslint/no-explicit-any if (global.GCLOUD_SANDBOX_ENV) { return new stream_1.PassThrough({ objectMode: true }); } prepareGaxRequest((err, requestFn) => { if (err) { stream.destroy(err); return; } gaxStream = requestFn(); gaxStream .on('error', err => { stream.destroy(err); }) .pipe(stream); }); return; } return stream; } /** * This method is called when creating a sink with a Bucket destination. The * bucket must first grant proper ACL access to the Cloud Logging * account. * * The parameters are the same as what {@link Logging#createSink} accepts. * * @private */ async setAclForBucket_(config) { const bucket = config.destination; // eslint-disable-next-line @typescript-eslint/no-explicit-any await bucket.acl.owners.addGroup('cloud-logs@google.com'); config.destination = 'storage.googleapis.com/' + bucket.name; } /** * This method is called when creating a sink with a Dataset destination. The * dataset must first grant proper ACL access to the Cloud Logging * account. * * The parameters are the same as what {@link Logging#createSink} accepts. * * @private */ async setAclForDataset_(config) { const dataset = config.destination; const [metadata] = await dataset.getMetadata(); // eslint-disable-next-line @typescript-eslint/no-explicit-any const access = [].slice.call(arrify(metadata.access)); access.push({ role: 'WRITER', groupByEmail: 'cloud-logs@google.com', }); await dataset.setMetadata({ access, }); const baseUrl = 'bigquery.googleapis.com'; const pId = dataset.parent.projectId; const dId = dataset.id; config.destination = `${baseUrl}/projects/${pId}/datasets/${dId}`; } /** * This method is called when creating a sink with a Topic destination. The * topic must first grant proper ACL access to the Cloud Logging * account. * * The parameters are the same as what {@link Logging#createSink} accepts. * * @private */ async setAclForTopic_(config) { const topic = config.destination; const [policy] = await topic.iam.getPolicy(); policy.bindings = arrify(policy.bindings); policy.bindings.push({ role: 'roles/pubsub.publisher', members: ['serviceAccount:cloud-logs@system.gserviceaccount.com'], }); await topic.iam.setPolicy(policy); const baseUrl = 'pubsub.googleapis.com'; const topicName = topic.name; config.destination = `${baseUrl}/${topicName}`; } /** * setProjectId detects and sets a projectId string on the Logging instance. * It can be invoked once to ensure ensuing LogSync entries have a projectID. * @param reqOpts */ // eslint-disable-next-line @typescript-eslint/no-unused-vars async setProjectId(reqOpts) { if (this.projectId === '{{projectId}}') this.projectId = await this.auth.getProjectId(); if (reqOpts) reqOpts = projectify_1.replaceProjectIdToken(reqOpts, this.projectId); } /** * setResource detects and sets a detectedresource object on the Logging * instance. It can be invoked once to ensure ensuing LogSync entries contain * resource context. */ async setDetectedResource() { if (!this.detectedResource) { this.detectedResource = await metadata_1.getDefaultResource(this.auth); } } } exports.Logging = Logging; /*! Developer Documentation * All async methods (except for streams) will execute a callback in the event * that a callback is provided. */ promisify_1.callbackifyAll(Logging, { exclude: ['request'], }); /*! Developer Documentation * * These methods can be auto-paginated. */ paginator_1.paginator.extend(Logging, ['getEntries', 'getLogs', 'getSinks']); /** * Reference to the low-level auto-generated clients for the V2 Logging service. * * @type {object} * @property {constructor} LoggingServiceV2Client * Reference to {@link v2.LoggingServiceV2Client} * @property {constructor} ConfigServiceV2Client * Reference to {@link v2.ConfigServiceV2Client} * @property {constructor} MetricsServiceV2Client * Reference to {@link v2.MetricsServiceV2Client} */ module.exports.v2 = v2; const protos = __webpack_require__(86114); exports.protos = protos; //# sourceMappingURL=index.js.map /***/ }), /***/ 3929: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LogSync = void 0; /** * This is a helper library for synchronously writing logs to any transport. */ const arrify = __webpack_require__(61546); const entry_1 = __webpack_require__(96569); const log_common_1 = __webpack_require__(41077); /** * A logSync is a named collection of entries in structured log format. In Cloud * Logging, structured logs refer to log entries that use the jsonPayload field * to add structure to their payloads. In most GCP environments, like GKE and * Cloud Functions, structured logs written to process.stdout are automatically * picked up and formatted by logging agents. * * Recommended for Serverless environment logging, especially where async log * calls made by the `Log` class can be dropped by the CPU. * * See {@link https://cloud.google.com/logging/docs/structured-logging|Structured Logging} * * @class * * @param {Logging} logging {@link Logging} instance. * @param {string} name Name of the logSync. * @param {Writable} [transport] transport A custom writable transport stream. * Default: process.stdout. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('mylog'); * ``` */ class LogSync { // not projectId, formattedname is expected constructor(logging, name, transport) { this.formattedName_ = log_common_1.formatLogName(logging.projectId, name); this.logging = logging; /** * @name Log#name * @type {string} */ this.name = this.formattedName_.split('/').pop(); // Default to writing to stdout this.transport = transport || process.stdout; } /** * Write a log entry with a severity of "ALERT". * * This is a simple wrapper around {@link LogSync#write}. All arguments are * the same as documented there. * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('my-log'); * * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.alert(entry); * ``` */ alert(entry, options) { this.write(log_common_1.assignSeverityToEntries(entry, 'ALERT'), options); } /** * Write a log entry with a severity of "CRITICAL". * * This is a simple wrapper around {@link LogSync#write}. All arguments are * the same as documented there. * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('my-log'); * * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.critical(entry); * ``` */ critical(entry, options) { this.write(log_common_1.assignSeverityToEntries(entry, 'CRITICAL'), options); } /** * Write a log entry with a severity of "DEBUG". * * This is a simple wrapper around {@link LogSync#write}. All arguments are * the same as documented there. * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('my-log'); * * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.debug(entry); * ``` */ debug(entry, options) { this.write(log_common_1.assignSeverityToEntries(entry, 'DEBUG'), options); } /** * Write a log entry with a severity of "EMERGENCY". * * This is a simple wrapper around {@link LogSync#write}. All arguments are * the same as documented there. * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('my-log'); * * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.emergency(entry); * ``` */ emergency(entry, options) { this.write(log_common_1.assignSeverityToEntries(entry, 'EMERGENCY'), options); } entry(metadataOrData, data) { let metadata; if (!data && (metadataOrData === null || metadataOrData === void 0 ? void 0 : metadataOrData.hasOwnProperty('httpRequest'))) { // If user logs entry(metadata.httpRequest) metadata = metadataOrData; data = {}; } else if (!data) { // If user logs entry(message) data = metadataOrData; metadata = {}; } else { // If user logs entry(metadata, message) metadata = metadataOrData; } return this.logging.entry(metadata, data); } /** * Write a log entry with a severity of "ERROR". * * This is a simple wrapper around {@link LogSync#write}. All arguments are * the same as documented there. * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('my-log'); * * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.error(entry); * ``` */ error(entry, options) { this.write(log_common_1.assignSeverityToEntries(entry, 'ERROR'), options); } /** * Write a log entry with a severity of "INFO". * * This is a simple wrapper around {@link LogSync#write}. All arguments are * the same as documented there. * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('my-log'); * * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.info(entry); * ``` */ info(entry, options) { this.write(log_common_1.assignSeverityToEntries(entry, 'INFO'), options); } /** * Write a log entry with a severity of "NOTICE". * * This is a simple wrapper around {@link LogSync#write}. All arguments are * the same as documented there. * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('my-log'); * * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.notice(entry); * ``` */ notice(entry, options) { this.write(log_common_1.assignSeverityToEntries(entry, 'NOTICE'), options); } /** * Write a log entry with a severity of "WARNING". * * This is a simple wrapper around {@link LogSync#write}. All arguments are * the same as documented there. * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.logSync('my-log'); * * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.warning(entry); * ``` */ warning(entry, options) { this.write(log_common_1.assignSeverityToEntries(entry, 'WARNING'), options); } /** * Write log entries to a custom transport (default: process.stdout). * * @param {Entry|Entry[]} entry A log entry, or array of entries, to write. * @param {?WriteOptions} [options] Write options * * @example * ``` * const entry = log.entry('gce_instance', { * instance: 'my_instance' * }); * * log.write(entry); * * //- * // You may also pass multiple log entries to write. * //- * const secondEntry = log.entry('compute.googleapis.com', { * user: 'my_username' * }); * * log.write([entry, secondEntry]); * * //- * // To save some steps, you can also pass in plain values as your entries. * // Note, however, that you must provide a configuration object to specify * // the resource. * //- * const entries = [ * { * user: 'my_username' * }, * { * home: process.env.HOME * } * ]; * * const options = { * resource: 'compute.googleapis.com' * }; * * log.write(entries, options); * * log.write(entries); * }); * ``` */ write(entry, opts) { var _a; const options = opts ? opts : {}; // We expect projectId and resource to be set before this fn is called... let structuredEntries; this.formattedName_ = log_common_1.formatLogName(this.logging.projectId, this.name); try { structuredEntries = arrify(entry).map(entry => { if (!(entry instanceof entry_1.Entry)) { entry = this.entry(entry); } return entry.toStructuredJSON(this.logging.projectId); }); for (const entry of structuredEntries) { entry.logName = this.formattedName_; entry.resource = log_common_1.snakecaseKeys((_a = options.resource) === null || _a === void 0 ? void 0 : _a.labels) || entry.resource || this.logging.detectedResource; entry[entry_1.LABELS_KEY] = options.labels || entry[entry_1.LABELS_KEY]; this.transport.write(JSON.stringify(entry) + '\n'); } } catch (err) { // Ignore errors (client libraries do not panic). } } } exports.LogSync = LogSync; //# sourceMappingURL=log-sync.js.map /***/ }), /***/ 33259: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Log = void 0; const arrify = __webpack_require__(61546); const promisify_1 = __webpack_require__(19203); const dotProp = __webpack_require__(82042); const extend = __webpack_require__(38171); const entry_1 = __webpack_require__(96569); const log_common_1 = __webpack_require__(41077); /** * A log is a named collection of entries, each entry representing a timestamped * event. Logs can be produced by Google Cloud Platform services, by third-party * services, or by your applications. For example, the log `apache-access` is * produced by the Apache Web Server, but the log * `compute.googleapis.com/activity_log` is produced by Google Compute Engine. * * See {@link https://cloud.google.com/logging/docs/basic-concepts#logs|Introduction to Logs} * * @class * * @param {Logging} logging {@link Logging} instance. * @param {string} name Name of the log. * @param {object} [options] Configuration object. * @param {boolean} [options.removeCircular] Replace circular references in * logged objects with a string value, `[Circular]`. (Default: false) * @param {number} [options.maxEntrySize] A max entry size * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.log('syslog'); * ``` */ class Log { constructor(logging, name, options) { options = options || {}; this.formattedName_ = log_common_1.formatLogName(logging.projectId, name); this.removeCircular_ = options.removeCircular === true; this.maxEntrySize = options.maxEntrySize; this.logging = logging; /** * @name Log#name * @type {string} */ this.name = this.formattedName_.split('/').pop(); } alert(entry, options) { return this.write(log_common_1.assignSeverityToEntries(entry, 'ALERT'), options); } critical(entry, options) { return this.write(log_common_1.assignSeverityToEntries(entry, 'CRITICAL'), options); } debug(entry, options) { return this.write(log_common_1.assignSeverityToEntries(entry, 'DEBUG'), options); } async delete(gaxOptions) { const projectId = await this.logging.auth.getProjectId(); this.formattedName_ = log_common_1.formatLogName(projectId, this.name); const reqOpts = { logName: this.formattedName_, }; return this.logging.loggingService.deleteLog(reqOpts, gaxOptions); } emergency(entry, options) { return this.write(log_common_1.assignSeverityToEntries(entry, 'EMERGENCY'), options); } entry(metadataOrData, data) { let metadata; if (!data && (metadataOrData === null || metadataOrData === void 0 ? void 0 : metadataOrData.hasOwnProperty('httpRequest'))) { // If user logs entry(metadata.httpRequest) metadata = metadataOrData; data = {}; } else if (!data) { // If user logs entry(message) data = metadataOrData; metadata = {}; } else { // If user logs entry(metadata, message) metadata = metadataOrData; } return this.logging.entry(metadata, data); } error(entry, options) { return this.write(log_common_1.assignSeverityToEntries(entry, 'ERROR'), options); } async getEntries(opts) { const options = extend({}, opts); const projectId = await this.logging.auth.getProjectId(); this.formattedName_ = log_common_1.formatLogName(projectId, this.name); if (options.filter && !options.filter.includes('logName=')) { options.filter = `(${options.filter}) AND logName="${this.formattedName_}"`; } else if (!options.filter) { options.filter = `logName="${this.formattedName_}"`; } return this.logging.getEntries(options); } /** * This method is a wrapper around {module:logging#getEntriesStream}, but with * a filter specified to only return {module:logging/entry} objects from this * log. * * @method Log#getEntriesStream * @param {GetEntriesRequest} [query] Query object for listing entries. * @returns {ReadableStream} A readable stream that emits {@link Entry} * instances. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.log('my-log'); * * log.getEntriesStream() * .on('error', console.error) * .on('data', entry => { * // `entry` is a Cloud Logging entry object. * // See the `data` property to read the data from the entry. * }) * .on('end', function() { * // All entries retrieved. * }); * * //- * // If you anticipate many results, you can end a stream early to prevent * // unnecessary processing and API requests. * //- * log.getEntriesStream() * .on('data', function(entry) { * this.end(); * }); * ``` */ getEntriesStream(options) { options = extend({ log: this.name, }, options); return this.logging.getEntriesStream(options); } /** * This method is a wrapper around {module:logging#tailEntries}, but with * a filter specified to only return {module:logging/entry} objects from this * log. * * @method Log#tailEntries * @param {TailEntriesRequest} [query] Query object for tailing entries. * @returns {DuplexStream} A duplex stream that emits TailEntriesResponses * containing an array of {@link Entry} instances. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const log = logging.log('my-log'); * * log.tailEntries() * .on('error', console.error) * .on('data', resp => { * console.log(resp.entries); * console.log(resp.suppressionInfo); * }) * .on('end', function() { * // All entries retrieved. * }); * * //- * // If you anticipate many results, you can end a stream early to prevent * // unnecessary processing and API requests. * //- * log.tailEntries() * .on('data', function(entry) { * this.end(); * }); * ``` */ tailEntries(options) { options = extend({ log: this.name, }, options); return this.logging.tailEntries(options); } info(entry, options) { return this.write(log_common_1.assignSeverityToEntries(entry, 'INFO'), options); } notice(entry, options) { return this.write(log_common_1.assignSeverityToEntries(entry, 'NOTICE'), options); } warning(entry, options) { return this.write(log_common_1.assignSeverityToEntries(entry, 'WARNING'), options); } async write(entry, opts) { const options = opts ? opts : {}; // Extract projectId & resource from Logging - inject & memoize if not. await this.logging.setProjectId(); this.formattedName_ = log_common_1.formatLogName(this.logging.projectId, this.name); const resource = await this.getOrSetResource(options); // Extract & format additional context from individual entries. const decoratedEntries = this.decorateEntries(arrify(entry)); this.truncateEntries(decoratedEntries); // Clobber `labels` and `resource` fields with WriteOptions from the user. const reqOpts = extend({ logName: this.formattedName_, entries: decoratedEntries, resource, }, options); delete reqOpts.gaxOptions; return this.logging.loggingService.writeLogEntries(reqOpts, options.gaxOptions); } /** * getOrSetResource looks for GCP service context first at the user * declaration level (snakecasing keys), then in the Logging instance, * before finally detecting a resource from the environment. * The resource is then memoized at the Logging instance level for future use. * * @param options * @private */ async getOrSetResource(options) { if (options.resource) { if (options.resource.labels) log_common_1.snakecaseKeys(options.resource.labels); return options.resource; } await this.logging.setDetectedResource(); return this.logging.detectedResource; } /** * All entries are passed through here in order be formatted and serialized. * User provided Entry values are formatted per LogEntry specifications. * Read more about the LogEntry format: * https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry * * @private * * @param {object[]} entries - Entry objects. * @returns {object[]} Serialized entries. * @throws if there is an error during serialization. */ decorateEntries(entries) { return entries.map(entry => { if (!(entry instanceof entry_1.Entry)) { entry = this.entry(entry); } return entry.toJSON({ removeCircular: this.removeCircular_, }, this.logging.projectId); }); } // TODO consider refactoring `truncateEntries` so that it does not mutate /** * Truncate log entries at maxEntrySize, so that error is not thrown, see: * https://cloud.google.com/logging/quotas * * @private * * @param {object|string} the JSON log entry. * @returns {object|string} truncated JSON log entry. */ truncateEntries(entries) { return entries.forEach(entry => { if (this.maxEntrySize === undefined) return; const payloadSize = JSON.stringify(entry).length; if (payloadSize < this.maxEntrySize) return; let delta = payloadSize - this.maxEntrySize; if (entry.textPayload) { entry.textPayload = entry.textPayload.slice(0, Math.max(entry.textPayload.length - delta, 0)); } else { const fieldsToTruncate = [ // Winston: 'jsonPayload.fields.metadata.structValue.fields.stack.stringValue', // Bunyan: 'jsonPayload.fields.msg.stringValue', 'jsonPayload.fields.err.structValue.fields.stack.stringValue', 'jsonPayload.fields.err.structValue.fields.message.stringValue', // All: 'jsonPayload.fields.message.stringValue', ]; for (const field of fieldsToTruncate) { const msg = dotProp.get(entry, field, ''); if (msg !== '') { dotProp.set(entry, field, msg.slice(0, Math.max(msg.length - delta, 0))); delta -= Math.min(msg.length, delta); } } } }); } // TODO: in a future breaking release, delete this extranenous function. /** * Return an array of log entries with the desired severity assigned. * * @private * * @param {object|object[]} entries - Log entries. * @param {string} severity - The desired severity level. */ static assignSeverityToEntries_(entries, severity) { return log_common_1.assignSeverityToEntries(entries, severity); } // TODO: in a future breaking release, delete this extranenous function. /** * Format the name of a log. A log's full name is in the format of * 'projects/{projectId}/logs/{logName}'. * * @private * * @returns {string} */ static formatName_(projectId, name) { return log_common_1.formatLogName(projectId, name); } } exports.Log = Log; /*! Developer Documentation * * All async methods (except for streams) will call a callback in the event * that a callback is provided . */ promisify_1.callbackifyAll(Log, { exclude: ['entry', 'getEntriesStream'] }); //# sourceMappingURL=log.js.map /***/ }), /***/ 27474: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; /*! * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); __exportStar(__webpack_require__(81321), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 81321: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.makeMiddleware = void 0; const onFinished = __webpack_require__(24694); const context_1 = __webpack_require__(39237); const http_request_1 = __webpack_require__(71881); /** * Generates an express middleware that installs a request-specific logger on * the `request` object. It optionally can do HttpRequest timing that can be * used for generating request logs. This can be used to integrate with logging * libraries such as winston and bunyan. * * @param projectId Generated traceIds will be associated with this project. * @param makeChildLogger A function that generates logger instances that will * be installed onto `req` as `req.log`. The logger should include the trace in * each log entry's metadata (associated with the LOGGING_TRACE_KEY property. * @param emitRequestLog Optional. A function that will emit a parent request * log. While some environments like GAE and GCF emit parent request logs * automatically, other environments do not. When provided this function will be * called with a populated `CloudLoggingHttpRequest` which can be emitted as * request log. */ function makeMiddleware(projectId, makeChildLogger, emitRequestLog) { return (req, res, next) => { // TODO(ofrobots): use high-resolution timer. const requestStartMs = Date.now(); // Detect & establish context if we were the first actor to detect lack of // context so traceContext is always available when using middleware. const traceContext = context_1.getOrInjectContext(req, projectId, true); // Install a child logger on the request object, with detected trace and // span. req.log = makeChildLogger(traceContext.trace, traceContext.spanId, traceContext.traceSampled); // Emit a 'Request Log' on the parent logger, with detected trace and // span. if (emitRequestLog) { onFinished(res, () => { const latencyMs = Date.now() - requestStartMs; const httpRequest = http_request_1.makeHttpRequestData(req, res, latencyMs); emitRequestLog(httpRequest, traceContext.trace, traceContext.spanId, traceContext.traceSampled); }); } next(); }; } exports.makeMiddleware = makeMiddleware; //# sourceMappingURL=make-middleware.js.map /***/ }), /***/ 83870: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.express = void 0; const express = __webpack_require__(27474); exports.express = express; //# sourceMappingURL=index.js.map /***/ }), /***/ 5764: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Sink = void 0; const promisify_1 = __webpack_require__(19203); const extend = __webpack_require__(38171); /** * A sink is an object that lets you to specify a set of log entries to export * to a particular destination. Cloud Logging lets you export log entries * to destinations including Cloud Storage buckets (for long term log * storage), Google BigQuery datasets (for log analysis), Google Pub/Sub (for * streaming to other applications). * * See {@link https://cloud.google.com/logging/docs/basic-concepts#sinks|Introduction to Sinks} * * @class * * @param {Logging} logging {@link Logging} instance. * @param {string} name Name of the sink. * * @example * ``` * const {Logging} = require('@google-cloud/logging'); * const logging = new Logging(); * const sink = logging.sink('my-sink'); * ``` */ class Sink { constructor(logging, name) { this.logging = logging; /** * @name Sink#name * @type {string} */ this.name = name; this.formattedName_ = 'projects/' + logging.projectId + '/sinks/' + name; } create(config) { return this.logging.createSink(this.name, config); } async delete(gaxOptions) { const projectId = await this.logging.auth.getProjectId(); this.formattedName_ = 'projects/' + projectId + '/sinks/' + this.name; const reqOpts = { sinkName: this.formattedName_, }; return this.logging.configService.deleteSink(reqOpts, gaxOptions); } async getMetadata(gaxOptions) { const projectId = await this.logging.auth.getProjectId(); this.formattedName_ = 'projects/' + projectId + '/sinks/' + this.name; const reqOpts = { sinkName: this.formattedName_, }; [this.metadata] = await this.logging.configService.getSink(reqOpts, gaxOptions); return [this.metadata]; } setFilter(filter) { return this.setMetadata({ filter, }); } async setMetadata(metadata) { const [currentMetadata] = await this.getMetadata(); const uniqueWriterIdentity = metadata.uniqueWriterIdentity; delete metadata.uniqueWriterIdentity; let reqOpts = { sinkName: this.formattedName_, sink: extend({}, currentMetadata, metadata), }; delete reqOpts.sink.gaxOptions; // Add user specified uniqueWriterIdentity boolean, if any. reqOpts = { ...reqOpts, ...(uniqueWriterIdentity && { uniqueWriterIdentity }), }; [this.metadata] = await this.logging.configService.updateSink(reqOpts, metadata.gaxOptions); return [this.metadata]; } } exports.Sink = Sink; /*! Developer Documentation * * All async methods (except for streams) will call a callbakc in the event * that a callback is provided. */ promisify_1.callbackifyAll(Sink); //# sourceMappingURL=sink.js.map /***/ }), /***/ 29150: /***/ ((__unused_webpack_module, exports) => { "use strict"; /*! * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.zuluToDateObj = exports.decodeValue = exports.structToObj = exports.ObjectToStructConverter = exports.objToStruct = void 0; function objToStruct(obj, options) { return new ObjectToStructConverter(options).convert(obj); } exports.objToStruct = objToStruct; class ObjectToStructConverter { /** * A class that can be used to convert an object to a struct. Optionally this * class can be used to erase/throw on circular references during conversion. * * @private * * @param {object=} options - Configuration object. * @param {boolean} options.removeCircular - Remove circular references in the * object with a placeholder string. (Default: `false`) * @param {boolean} options.stringify - Stringify un-recognized types. (Default: * `false`) */ constructor(options) { options = options || {}; this.seenObjects = new Set(); this.removeCircular = options.removeCircular === true; this.stringify = options.stringify === true; } /** * Begin the conversion process from a JS object to an encoded gRPC Value * message. * * @param {*} value - The input value. * @return {object} - The encoded value. * * @example * ``` * ObjectToStructConverter.convert({ * aString: 'Hi' * }); * // { * // fields: { * // aString: { * // stringValue: 'Hello!' * // } * // } * // } * ``` */ // eslint-disable-next-line @typescript-eslint/no-explicit-any convert(obj) { const convertedObject = { fields: {}, }; this.seenObjects.add(obj); for (const prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { const value = obj[prop]; if (value === undefined) { continue; } // eslint-disable-next-line @typescript-eslint/no-explicit-any convertedObject.fields[prop] = this.encodeValue_(value); } } this.seenObjects.delete(obj); return convertedObject; } /** * Convert a raw value to a type-denoted protobuf message-friendly object. * * @private * * @param {*} value - The input value. * @return {*} - The encoded value. * * @example * ``` * ObjectToStructConverter.encodeValue('Hi'); * // { * // stringValue: 'Hello!' * // } * ``` */ // eslint-disable-next-line @typescript-eslint/no-explicit-any encodeValue_(value) { let convertedValue; if (value === null) { convertedValue = { nullValue: 0, }; } else if (typeof value === 'number') { convertedValue = { numberValue: value, }; } else if (typeof value === 'string') { convertedValue = { stringValue: value, }; } else if (typeof value === 'boolean') { convertedValue = { boolValue: value, }; } else if (Buffer.isBuffer(value)) { convertedValue = { blobValue: value, }; } else if (Array.isArray(value)) { convertedValue = { listValue: { values: value.map(this.encodeValue_.bind(this)), }, }; } else if (Object.prototype.toString.call(value) === '[object Object]') { if (this.seenObjects.has(value)) { // Circular reference. if (!this.removeCircular) { throw new Error([ 'This object contains a circular reference. To automatically', 'remove it, set the `removeCircular` option to true.', ].join(' ')); } convertedValue = { stringValue: '[Circular]', }; } else { convertedValue = { structValue: this.convert(value), }; } } else { if (!this.stringify) { throw new Error('Value of type ' + typeof value + ' not recognized.'); } convertedValue = { stringValue: String(value), }; } return convertedValue; } } exports.ObjectToStructConverter = ObjectToStructConverter; /** * Condense a protobuf Struct into an object of only its values. * * @private * * @param {object} struct - A protobuf Struct message. * @return {object} - The simplified object. * * @example * ``` * GrpcService.structToObj_({ * fields: { * name: { * kind: 'stringValue', * stringValue: 'Stephen' * } * } * }); * // { * // name: 'Stephen' * // } * ``` */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function structToObj(struct) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const convertedObject = {}; for (const prop in struct.fields) { // eslint-disable-next-line no-prototype-builtins if (struct.fields.hasOwnProperty(prop)) { const value = struct.fields[prop]; convertedObject[prop] = decodeValue(value); } } return convertedObject; } exports.structToObj = structToObj; /** * Decode a protobuf Struct's value. * * @param {object} value - A Struct's Field message. * @return {*} - The decoded value. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function decodeValue(value) { switch (value.kind) { case 'structValue': { return structToObj(value.structValue); } case 'nullValue': { return null; } case 'listValue': { return value.listValue.values.map(decodeValue); } default: { return value[value.kind]; } } } exports.decodeValue = decodeValue; /** * zuluToDateObj RFC3339 "Zulu" timestamp into a format that can be parsed to * a JS Date Object. * @param zuluTime */ function zuluToDateObj(zuluTime) { var _a; const ms = Date.parse(zuluTime.split(/[.,Z]/)[0] + 'Z'); const reNano = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.(\d{0,9})Z$/; const nanoSecs = (_a = zuluTime.match(reNano)) === null || _a === void 0 ? void 0 : _a[1]; return { seconds: ms ? Math.floor(ms / 1000) : 0, nanos: nanoSecs ? Number(nanoSecs.padEnd(9, '0')) : 0, }; } exports.zuluToDateObj = zuluToDateObj; //# sourceMappingURL=common.js.map /***/ }), /***/ 39237: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.parseTraceParentHeader = exports.parseXCloudTraceHeader = exports.getContextFromTraceParent = exports.getContextFromXCloudTrace = exports.getOrInjectContext = exports.makeHeaderWrapper = exports.W3C_TRACE_PARENT_HEADER = exports.X_CLOUD_TRACE_HEADER = void 0; const uuid = __webpack_require__(4552); const crypto = __webpack_require__(76417); /** Header that carries span context across Google infrastructure. */ exports.X_CLOUD_TRACE_HEADER = 'x-cloud-trace-context'; const SPAN_ID_RANDOM_BYTES = 8; const spanIdBuffer = Buffer.alloc(SPAN_ID_RANDOM_BYTES); const randomFillSync = crypto.randomFillSync; const randomBytes = crypto.randomBytes; const spanRandomBuffer = randomFillSync ? () => randomFillSync(spanIdBuffer) : () => randomBytes(SPAN_ID_RANDOM_BYTES); /** Header that carries span context across W3C compliant infrastructure. */ exports.W3C_TRACE_PARENT_HEADER = 'traceparent'; /** * makeHeaderWrapper returns a wrapper with set and get header functionality, * returning null if the incoming request object doesn't contain the 'header' * propery. * @param req */ function makeHeaderWrapper(req) { if (!req.headers) return null; const wrapper = { setHeader(name, value) { req.headers[name] = value; }, getHeader(name) { return req.headers[name]; }, }; return wrapper; } exports.makeHeaderWrapper = makeHeaderWrapper; /** * getOrInjectContext returns a CloudTraceContext with as many available trace * and span properties as possible. It examines HTTP headers for trace context. * Optionally, it can inject a Google compliant trace context when no context is * available from headers. * * @param req * @param projectId * @param inject */ function getOrInjectContext(req, projectId, inject) { const defaultContext = toCloudTraceContext({}, projectId); const wrapper = makeHeaderWrapper(req); if (wrapper) { // Detect 'traceparent' header. const traceContext = getContextFromTraceParent(wrapper, projectId); if (traceContext) return traceContext; // Detect 'X-Cloud-Trace-Context' header. const cloudContext = getContextFromXCloudTrace(wrapper, projectId); if (cloudContext) return cloudContext; // Optional: Generate and inject a context for the user as last resort. if (inject) { wrapper.setHeader(exports.X_CLOUD_TRACE_HEADER, makeCloudTraceHeader()); return getContextFromXCloudTrace(wrapper, projectId); } } return defaultContext; } exports.getOrInjectContext = getOrInjectContext; /** * toCloudTraceContext converts any context format to cloudTraceContext format. * @param context * @param projectId */ function toCloudTraceContext( // eslint-disable-next-line @typescript-eslint/no-explicit-any anyContext, projectId) { const context = { trace: '', }; if (anyContext === null || anyContext === void 0 ? void 0 : anyContext.trace) { context.trace = `projects/${projectId}/traces/${anyContext.trace}`; } if (anyContext === null || anyContext === void 0 ? void 0 : anyContext.spanId) { context.spanId = anyContext.spanId; } if ('traceSampled' in anyContext) { context.traceSampled = anyContext.traceSampled; } return context; } /** * makeCloudTraceHeader generates valid X-Cloud-Trace-Context trace and spanId. */ function makeCloudTraceHeader() { const trace = uuid.v4().replace(/-/g, ''); const spanId = spanRandomBuffer().toString('hex'); return `${trace}/${spanId}`; } /** * getContextFromXCloudTrace looks for the HTTP header 'x-cloud-trace-context' * per Google Cloud specifications for Cloud Tracing. * * @param headerWrapper * @param projectId */ function getContextFromXCloudTrace(headerWrapper, projectId) { const context = parseXCloudTraceHeader(headerWrapper); if (!context) return null; return toCloudTraceContext(context, projectId); } exports.getContextFromXCloudTrace = getContextFromXCloudTrace; /** * getOrInjectTraceParent looks for the HTTP header 'traceparent' * per W3C specifications for OpenTelemetry and OpenCensus * Read more about W3C protocol: https://www.w3.org/TR/trace-context/ * * @param headerWrapper * @param projectId */ function getContextFromTraceParent(headerWrapper, projectId) { const context = parseTraceParentHeader(headerWrapper); if (!context) return null; return toCloudTraceContext(context, projectId); } exports.getContextFromTraceParent = getContextFromTraceParent; /** * parseXCloudTraceHeader looks for trace context in `X-Cloud-Trace-Context` * header * @param headerWrapper */ function parseXCloudTraceHeader(headerWrapper) { var _a; const regex = /([a-f\d]+)?(\/?([a-f\d]+))?(;?o=(\d))?/; const match = (_a = headerWrapper .getHeader(exports.X_CLOUD_TRACE_HEADER)) === null || _a === void 0 ? void 0 : _a.toString().match(regex); if (!match) return null; return { trace: match[1], spanId: match[3], traceSampled: match[5] === '1', }; } exports.parseXCloudTraceHeader = parseXCloudTraceHeader; /** * parseTraceParentHeader is a custom implementation of the `parseTraceParent` * function in @opentelemetry-core/trace. * For more information see {@link https://www.w3.org/TR/trace-context/} * @param headerWrapper */ function parseTraceParentHeader(headerWrapper) { var _a; const VERSION_PART = '(?!ff)[\\da-f]{2}'; const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; const FLAGS_PART = '[\\da-f]{2}'; const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); const match = (_a = headerWrapper .getHeader(exports.W3C_TRACE_PARENT_HEADER)) === null || _a === void 0 ? void 0 : _a.toString().match(TRACE_PARENT_REGEX); if (!match) return null; // According to the specification the implementation should be compatible // with future versions. If there are more parts, we only reject it if it's using version 00 // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent if (match[1] === '00' && match[5]) return null; return { trace: match[2], spanId: match[3], traceSampled: parseInt(match[4], 16) === 1, }; } exports.parseTraceParentHeader = parseTraceParentHeader; //# sourceMappingURL=context.js.map /***/ }), /***/ 71881: /***/ ((__unused_webpack_module, exports) => { "use strict"; /*! * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isRawHttpRequest = exports.makeHttpRequestData = void 0; /** * makeHttpRequestData turns raw incoming HTTPRequests into structured * HTTPRequest objects interpreted by Cloud Logging. * * @param req * @param res * @param latencyMilliseconds */ function makeHttpRequestData(req, res, latencyMilliseconds) { let requestUrl, protocol, requestMethod, userAgent, referer, status, responseSize, latency; // Format request properties if (req.url) requestUrl = req.url; // OriginalURL overwrites inferred url if ('originalUrl' in req && req.originalUrl) requestUrl = req.originalUrl; // Format protocol from valid URL if (requestUrl) { try { const url = new URL(requestUrl); protocol = url.protocol; } catch (e) { // Library should not panic } } req.method ? (requestMethod = req.method) : null; if (req.headers && req.headers['user-agent']) { req.headers['user-agent'] ? (userAgent = req.headers['user-agent']) : null; req.headers['referer'] ? (referer = req.headers['referer']) : null; } // Format response properties if (res) { res.statusCode ? (status = res.statusCode) : null; responseSize = (res.getHeader && Number(res.getHeader('Content-Length'))) || 0; } // Format latency if (latencyMilliseconds) { latency = { seconds: Math.floor(latencyMilliseconds / 1e3), nanos: Math.floor((latencyMilliseconds % 1e3) * 1e6), }; } // Only include the property if its value exists return Object.assign({}, requestUrl ? { requestUrl } : null, protocol ? { protocol } : null, requestMethod ? { requestMethod } : null, userAgent ? { userAgent } : null, referer ? { referer } : null, responseSize ? { responseSize } : null, status ? { status } : null, latency ? { latency } : null); } exports.makeHttpRequestData = makeHttpRequestData; /** * isRawHttpRequest detects whether a request object extends the * http.IncomingMessage class. It should return true on HTTP compliant requests * and all requests created by an http.Server. * * @param req */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function isRawHttpRequest(req) { if (req && ('originalUrl' in req || 'headers' in req || 'method' in req || 'url' in req)) { return true; } return false; } exports.isRawHttpRequest = isRawHttpRequest; //# sourceMappingURL=http-request.js.map /***/ }), /***/ 41077: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.formatLogName = exports.assignSeverityToEntries = exports.snakecaseKeys = exports.Severity = void 0; /** * Common construct and functions used by both Log and LogSync */ const entry_1 = __webpack_require__(96569); const extend = __webpack_require__(38171); const arrify = __webpack_require__(61546); var Severity; (function (Severity) { Severity[Severity["emergency"] = 0] = "emergency"; Severity[Severity["alert"] = 1] = "alert"; Severity[Severity["critical"] = 2] = "critical"; Severity[Severity["error"] = 3] = "error"; Severity[Severity["warning"] = 4] = "warning"; Severity[Severity["notice"] = 5] = "notice"; Severity[Severity["info"] = 6] = "info"; Severity[Severity["debug"] = 7] = "debug"; })(Severity = exports.Severity || (exports.Severity = {})); /** * snakecaseKeys turns label keys from camel case to snake case. * @param labels */ function snakecaseKeys(labels) { for (const key in labels) { Object.defineProperty(labels, key.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`), Object.getOwnPropertyDescriptor(labels, key)); delete labels[key]; } return labels; } exports.snakecaseKeys = snakecaseKeys; /** * Return an array of log entries with the desired severity assigned. * * @private * * @param {object|object[]} entries - Log entries. * @param {string} severity - The desired severity level. */ function assignSeverityToEntries(entries, severity) { return arrify(entries).map(entry => { const metadata = extend(true, {}, entry.metadata, { severity, }); return extend(new entry_1.Entry(), entry, { metadata, }); }); } exports.assignSeverityToEntries = assignSeverityToEntries; /** * Format the name of a log. A log's full name is in the format of * 'projects/{projectId}/logs/{logName}'. * * @param projectId * @param name */ function formatLogName(projectId, name) { const path = 'projects/' + projectId + '/logs/'; name = name.replace(path, ''); if (decodeURIComponent(name) === name) { // The name has not been encoded yet. name = encodeURIComponent(name); } return path + name; } exports.formatLogName = formatLogName; //# sourceMappingURL=log-common.js.map /***/ }), /***/ 60675: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.detectServiceContext = exports.getDefaultResource = exports.getGlobalDescriptor = exports.getGKEDescriptor = exports.KUBERNETES_NAMESPACE_ID_PATH = exports.getGCEDescriptor = exports.getGAEDescriptor = exports.getCloudRunDescriptor = exports.getCloudFunctionDescriptor = void 0; const fs = __webpack_require__(35747); const gcpMetadata = __webpack_require__(3563); const google_auth_library_1 = __webpack_require__(20810); const util_1 = __webpack_require__(31669); const readFile = util_1.promisify(fs.readFile); function zoneFromQualifiedZone(qualified) { // Some parsing is necessary. Metadata service returns a fully // qualified zone name: 'projects/{projectId}/zones/{zone}'. Logging // wants just the zone part. // return qualified.split('/').pop(); } function regionFromQualifiedZone(qualified) { // Parses the region from the zone. Used for GCF and GCR which dynamically // allocate zones. const zone = zoneFromQualifiedZone(qualified); const region = zone === undefined ? undefined : zone.slice(0, zone.lastIndexOf('-')); return region; } /** * Create a descriptor for Cloud Functions. * * @returns {object} */ async function getCloudFunctionDescriptor() { // If the region is already available via an environment variable, don't delay the function by pinging metaserver. let region = undefined; if (!(process.env.GOOGLE_CLOUD_REGION || process.env.FUNCTION_REGION)) { const qualifiedZone = await gcpMetadata.instance('zone'); region = regionFromQualifiedZone(qualifiedZone); } /** * In GCF versions after Node 8, K_SERVICE is the preferred way to * get the function name. We still check for GOOGLE_CLOUD_REGION and FUNCTION_REGION for backwards Node runtime compatibility. */ return { type: 'cloud_function', labels: { function_name: process.env.K_SERVICE || process.env.FUNCTION_NAME, region: process.env.GOOGLE_CLOUD_REGION || process.env.FUNCTION_REGION || region, }, }; } exports.getCloudFunctionDescriptor = getCloudFunctionDescriptor; /** * Create a descriptor for Cloud Run. * * @returns {object} */ async function getCloudRunDescriptor() { const qualifiedZone = await gcpMetadata.instance('zone'); const location = regionFromQualifiedZone(qualifiedZone); return { type: 'cloud_run_revision', labels: { location, service_name: process.env.K_SERVICE, revision_name: process.env.K_REVISION, configuration_name: process.env.K_CONFIGURATION, }, }; } exports.getCloudRunDescriptor = getCloudRunDescriptor; /** * Create a descriptor for Google App Engine. * * @returns {object} */ async function getGAEDescriptor() { const qualifiedZone = await gcpMetadata.instance('zone'); const zone = zoneFromQualifiedZone(qualifiedZone); return { type: 'gae_app', labels: { module_id: process.env.GAE_SERVICE || process.env.GAE_MODULE_NAME, version_id: process.env.GAE_VERSION, zone, }, }; } exports.getGAEDescriptor = getGAEDescriptor; /** * Create a descriptor for Google Compute Engine. * @return {object} */ async function getGCEDescriptor() { const idResponse = await gcpMetadata.instance('id'); const zoneResponse = await gcpMetadata.instance('zone'); // Some parsing is necessary. Metadata service returns a fully // qualified zone name: 'projects/{projectId}/zones/{zone}'. Logging // wants just the zone part. // const zone = zoneFromQualifiedZone(zoneResponse); return { type: 'gce_instance', labels: { // idResponse can be BigNumber when the id too large for JavaScript // numbers. Use a toString() to uniformly convert to a string. instance_id: idResponse.toString(), zone, }, }; } exports.getGCEDescriptor = getGCEDescriptor; exports.KUBERNETES_NAMESPACE_ID_PATH = '/var/run/secrets/kubernetes.io/serviceaccount/namespace'; /** * Create a descriptor for Google Container Engine. * * @return {object} */ async function getGKEDescriptor() { // Cloud Logging Monitored Resource for 'container' requires // cluster_name and namespace_id fields. Note that these *need* to be // snake_case. The namespace_id is not easily available from inside the // container, but we can get the namespace_name. Logging has been using the // namespace_name in place of namespace_id for a while now. Log correlation // with metrics may not necessarily work however. // const resp = await gcpMetadata.instance('attributes/cluster-name'); const qualifiedZone = await gcpMetadata.instance('zone'); const location = zoneFromQualifiedZone(qualifiedZone); let namespace = ''; try { namespace = await readFile(exports.KUBERNETES_NAMESPACE_ID_PATH, 'utf8'); } catch (err) { // Ignore errors (leave namespace as a nil string). } return { type: 'k8s_container', labels: { location, cluster_name: resp, namespace_name: namespace, pod_name: process.env.HOSTNAME, // Users must manually supply container name for now. // This may be autodetected in the future, pending b/145137070. container_name: process.env.CONTAINER_NAME, }, }; } exports.getGKEDescriptor = getGKEDescriptor; /** * Create a global descriptor. * * @returns {object} */ function getGlobalDescriptor() { return { type: 'global', }; } exports.getGlobalDescriptor = getGlobalDescriptor; /** * Attempt to contact the metadata service and determine, * based on request success and environment variables, what type of resource * the library is operating on. */ async function getDefaultResource(auth) { const env = await auth.getEnv(); switch (env) { case google_auth_library_1.GCPEnv.KUBERNETES_ENGINE: return getGKEDescriptor().catch(() => getGlobalDescriptor()); case google_auth_library_1.GCPEnv.APP_ENGINE: return getGAEDescriptor().catch(() => getGlobalDescriptor()); case google_auth_library_1.GCPEnv.CLOUD_FUNCTIONS: return getCloudFunctionDescriptor().catch(() => getGlobalDescriptor()); case google_auth_library_1.GCPEnv.CLOUD_RUN: return getCloudRunDescriptor().catch(() => getGlobalDescriptor()); case google_auth_library_1.GCPEnv.COMPUTE_ENGINE: return getGCEDescriptor().catch(() => getGlobalDescriptor()); default: return getGlobalDescriptor(); } } exports.getDefaultResource = getDefaultResource; /** * For logged errors, users can provide a service context. This enables errors * to be picked up Cloud Error Reporting. For more information see * [this guide]{@link * https://cloud.google.com/error-reporting/docs/formatting-error-messages} and * the [official documentation]{@link * https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext}. */ async function detectServiceContext(auth) { const env = await auth.getEnv(); switch (env) { case google_auth_library_1.GCPEnv.APP_ENGINE: return { service: process.env.GAE_SERVICE || process.env.GAE_MODULE_NAME, version: process.env.GAE_VERSION || process.env.GAE_MODULE_VERSION, }; case google_auth_library_1.GCPEnv.CLOUD_FUNCTIONS: return { service: process.env.FUNCTION_NAME, }; // On Kubernetes we use the pod-name to describe the service. Currently, // we acquire the pod-name from within the pod through env var `HOSTNAME`. case google_auth_library_1.GCPEnv.KUBERNETES_ENGINE: return { service: process.env.HOSTNAME, }; case google_auth_library_1.GCPEnv.CLOUD_RUN: return { service: process.env.K_SERVICE, }; case google_auth_library_1.GCPEnv.COMPUTE_ENGINE: return null; default: return null; } } exports.detectServiceContext = detectServiceContext; //# sourceMappingURL=metadata.js.map /***/ }), /***/ 37965: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ConfigServiceV2Client = void 0; /* global window */ const gax = __webpack_require__(12263); const jsonProtos = __webpack_require__(54479); /** * Client JSON configuration object, loaded from * `src/v2/config_service_v2_client_config.json`. * This file defines retry strategy and timeouts for all API methods in this library. */ const gapicConfig = __webpack_require__(75821); const version = __webpack_require__(87989)/* .version */ .i8; /** * Service for configuring sinks used to route log entries. * @class * @memberof v2 */ class ConfigServiceV2Client { /** * Construct an instance of ConfigServiceV2Client. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` * if you need to override this behavior. */ constructor(opts) { var _a, _b; this._terminated = false; this.descriptors = { page: {}, stream: {}, longrunning: {}, batching: {}, }; // Ensure that options include all the required fields. const staticMembers = this.constructor; const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; } // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. this._opts = opts; // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; // Set defaultServicePath on the auth object. this.auth.defaultServicePath = staticMembers.servicePath; // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } else if (opts.fallback === 'rest') { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { billingAccountCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/cmekSettings'), billingAccountExclusionPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/exclusions/{exclusion}'), billingAccountLocationBucketPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}'), billingAccountLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}'), billingAccountLogPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/logs/{log}'), billingAccountSinkPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/sinks/{sink}'), folderCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/cmekSettings'), folderExclusionPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/exclusions/{exclusion}'), folderLocationBucketPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}'), folderLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}'), folderLogPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/logs/{log}'), folderSinkPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/sinks/{sink}'), locationPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}'), logMetricPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/metrics/{metric}'), organizationCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/cmekSettings'), organizationExclusionPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/exclusions/{exclusion}'), organizationLocationBucketPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}'), organizationLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}'), organizationLogPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/logs/{log}'), organizationSinkPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/sinks/{sink}'), projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'), projectCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/cmekSettings'), projectExclusionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/exclusions/{exclusion}'), projectLocationBucketPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}'), projectLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/views/{view}'), projectLogPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/logs/{log}'), projectSinkPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/sinks/{sink}'), }; // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { listBuckets: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'buckets'), listViews: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'views'), listSinks: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sinks'), listExclusions: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'exclusions'), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings('google.logging.v2.ConfigServiceV2', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') }); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. this.warn = gax.warn; } /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize() { // If the client stub promise is already initialized, return immediately. if (this.configServiceV2Stub) { return this.configServiceV2Stub; } // Put together the "service stub" for // google.logging.v2.ConfigServiceV2. this.configServiceV2Stub = this._gaxGrpc.createStub(this._opts.fallback ? this._protos.lookupService('google.logging.v2.ConfigServiceV2') : // eslint-disable-next-line @typescript-eslint/no-explicit-any this._protos.google.logging.v2.ConfigServiceV2, this._opts, this._providedCustomServicePath); // Iterate over each of the methods that the service provides // and create an API call method for each. const configServiceV2StubMethods = [ 'listBuckets', 'getBucket', 'createBucket', 'updateBucket', 'deleteBucket', 'undeleteBucket', 'listViews', 'getView', 'createView', 'updateView', 'deleteView', 'listSinks', 'getSink', 'createSink', 'updateSink', 'deleteSink', 'listExclusions', 'getExclusion', 'createExclusion', 'updateExclusion', 'deleteExclusion', 'getCmekSettings', 'updateCmekSettings', ]; for (const methodName of configServiceV2StubMethods) { const callPromise = this.configServiceV2Stub.then(stub => (...args) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; return func.apply(stub, args); }, (err) => () => { throw err; }); const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor); this.innerApiCalls[methodName] = apiCall; } return this.configServiceV2Stub; } /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ static get servicePath() { return 'logging.googleapis.com'; } /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. * @returns {string} The DNS address for this service. */ static get apiEndpoint() { return 'logging.googleapis.com'; } /** * The port for this API service. * @returns {number} The default port for this service. */ static get port() { return 443; } /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/cloud-platform.read-only', 'https://www.googleapis.com/auth/logging.admin', 'https://www.googleapis.com/auth/logging.read', ]; } /** * Return the project ID used by this class. * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId(callback) { if (callback) { this.auth.getProjectId(callback); return; } return this.auth.getProjectId(); } getBucket(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.getBucket(request, options, callback); } createBucket(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createBucket(request, options, callback); } updateBucket(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.updateBucket(request, options, callback); } deleteBucket(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.deleteBucket(request, options, callback); } undeleteBucket(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.undeleteBucket(request, options, callback); } getView(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.getView(request, options, callback); } createView(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createView(request, options, callback); } updateView(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.updateView(request, options, callback); } deleteView(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.deleteView(request, options, callback); } getSink(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ sink_name: request.sinkName || '', }); this.initialize(); return this.innerApiCalls.getSink(request, options, callback); } createSink(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createSink(request, options, callback); } updateSink(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ sink_name: request.sinkName || '', }); this.initialize(); return this.innerApiCalls.updateSink(request, options, callback); } deleteSink(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ sink_name: request.sinkName || '', }); this.initialize(); return this.innerApiCalls.deleteSink(request, options, callback); } getExclusion(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.getExclusion(request, options, callback); } createExclusion(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createExclusion(request, options, callback); } updateExclusion(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.updateExclusion(request, options, callback); } deleteExclusion(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.deleteExclusion(request, options, callback); } getCmekSettings(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.getCmekSettings(request, options, callback); } updateCmekSettings(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.updateCmekSettings(request, options, callback); } listBuckets(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listBuckets(request, options, callback); } /** * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent resource whose buckets are to be listed: * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" * * Note: The locations portion of the resource must be specified, but * supplying the character `-` in place of [LOCATION_ID] will return all * buckets. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [LogBucket]{@link google.logging.v2.LogBucket} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listBucketsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listBucketsStream(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listBuckets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBuckets.createStream(this.innerApiCalls.listBuckets, request, callSettings); } /** * Equivalent to `listBuckets`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent resource whose buckets are to be listed: * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" * * Note: The locations portion of the resource must be specified, but * supplying the character `-` in place of [LOCATION_ID] will return all * buckets. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [LogBucket]{@link google.logging.v2.LogBucket}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. * @example include:samples/generated/v2/config_service_v2.list_buckets.js * region_tag:logging_v2_generated_ConfigServiceV2_ListBuckets_async */ listBucketsAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listBuckets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBuckets.asyncIterate(this.innerApiCalls['listBuckets'], request, callSettings); } listViews(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listViews(request, options, callback); } /** * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The bucket whose views are to be listed: * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [LogView]{@link google.logging.v2.LogView} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listViewsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listViewsStream(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listViews']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listViews.createStream(this.innerApiCalls.listViews, request, callSettings); } /** * Equivalent to `listViews`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The bucket whose views are to be listed: * * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [LogView]{@link google.logging.v2.LogView}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. * @example include:samples/generated/v2/config_service_v2.list_views.js * region_tag:logging_v2_generated_ConfigServiceV2_ListViews_async */ listViewsAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listViews']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listViews.asyncIterate(this.innerApiCalls['listViews'], request, callSettings); } listSinks(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listSinks(request, options, callback); } /** * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent resource whose sinks are to be listed: * * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [LogSink]{@link google.logging.v2.LogSink} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listSinksAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listSinksStream(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSinks.createStream(this.innerApiCalls.listSinks, request, callSettings); } /** * Equivalent to `listSinks`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent resource whose sinks are to be listed: * * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [LogSink]{@link google.logging.v2.LogSink}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. * @example include:samples/generated/v2/config_service_v2.list_sinks.js * region_tag:logging_v2_generated_ConfigServiceV2_ListSinks_async */ listSinksAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listSinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listSinks.asyncIterate(this.innerApiCalls['listSinks'], request, callSettings); } listExclusions(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listExclusions(request, options, callback); } /** * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent resource whose exclusions are to be listed. * * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [LogExclusion]{@link google.logging.v2.LogExclusion} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listExclusionsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listExclusionsStream(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listExclusions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listExclusions.createStream(this.innerApiCalls.listExclusions, request, callSettings); } /** * Equivalent to `listExclusions`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent resource whose exclusions are to be listed. * * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [LogExclusion]{@link google.logging.v2.LogExclusion}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. * @example include:samples/generated/v2/config_service_v2.list_exclusions.js * region_tag:logging_v2_generated_ConfigServiceV2_ListExclusions_async */ listExclusionsAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listExclusions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listExclusions.asyncIterate(this.innerApiCalls['listExclusions'], request, callSettings); } // -------------------- // -- Path templates -- // -------------------- /** * Return a fully-qualified billingAccountCmekSettings resource name string. * * @param {string} billing_account * @returns {string} Resource name string. */ billingAccountCmekSettingsPath(billingAccount) { return this.pathTemplates.billingAccountCmekSettingsPathTemplate.render({ billing_account: billingAccount, }); } /** * Parse the billing_account from BillingAccountCmekSettings resource. * * @param {string} billingAccountCmekSettingsName * A fully-qualified path representing billing_account_cmekSettings resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountCmekSettingsName(billingAccountCmekSettingsName) { return this.pathTemplates.billingAccountCmekSettingsPathTemplate.match(billingAccountCmekSettingsName).billing_account; } /** * Return a fully-qualified billingAccountExclusion resource name string. * * @param {string} billing_account * @param {string} exclusion * @returns {string} Resource name string. */ billingAccountExclusionPath(billingAccount, exclusion) { return this.pathTemplates.billingAccountExclusionPathTemplate.render({ billing_account: billingAccount, exclusion: exclusion, }); } /** * Parse the billing_account from BillingAccountExclusion resource. * * @param {string} billingAccountExclusionName * A fully-qualified path representing billing_account_exclusion resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountExclusionName(billingAccountExclusionName) { return this.pathTemplates.billingAccountExclusionPathTemplate.match(billingAccountExclusionName).billing_account; } /** * Parse the exclusion from BillingAccountExclusion resource. * * @param {string} billingAccountExclusionName * A fully-qualified path representing billing_account_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromBillingAccountExclusionName(billingAccountExclusionName) { return this.pathTemplates.billingAccountExclusionPathTemplate.match(billingAccountExclusionName).exclusion; } /** * Return a fully-qualified billingAccountLocationBucket resource name string. * * @param {string} billing_account * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ billingAccountLocationBucketPath(billingAccount, location, bucket) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.render({ billing_account: billingAccount, location: location, bucket: bucket, }); } /** * Parse the billing_account from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).billing_account; } /** * Parse the location from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).location; } /** * Parse the bucket from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).bucket; } /** * Return a fully-qualified billingAccountLocationBucketView resource name string. * * @param {string} billing_account * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ billingAccountLocationBucketViewPath(billingAccount, location, bucket, view) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.render({ billing_account: billingAccount, location: location, bucket: bucket, view: view, }); } /** * Parse the billing_account from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).billing_account; } /** * Parse the location from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).location; } /** * Parse the bucket from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).bucket; } /** * Parse the view from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).view; } /** * Return a fully-qualified billingAccountLog resource name string. * * @param {string} billing_account * @param {string} log * @returns {string} Resource name string. */ billingAccountLogPath(billingAccount, log) { return this.pathTemplates.billingAccountLogPathTemplate.render({ billing_account: billingAccount, log: log, }); } /** * Parse the billing_account from BillingAccountLog resource. * * @param {string} billingAccountLogName * A fully-qualified path representing billing_account_log resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLogName(billingAccountLogName) { return this.pathTemplates.billingAccountLogPathTemplate.match(billingAccountLogName).billing_account; } /** * Parse the log from BillingAccountLog resource. * * @param {string} billingAccountLogName * A fully-qualified path representing billing_account_log resource. * @returns {string} A string representing the log. */ matchLogFromBillingAccountLogName(billingAccountLogName) { return this.pathTemplates.billingAccountLogPathTemplate.match(billingAccountLogName).log; } /** * Return a fully-qualified billingAccountSink resource name string. * * @param {string} billing_account * @param {string} sink * @returns {string} Resource name string. */ billingAccountSinkPath(billingAccount, sink) { return this.pathTemplates.billingAccountSinkPathTemplate.render({ billing_account: billingAccount, sink: sink, }); } /** * Parse the billing_account from BillingAccountSink resource. * * @param {string} billingAccountSinkName * A fully-qualified path representing billing_account_sink resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountSinkName(billingAccountSinkName) { return this.pathTemplates.billingAccountSinkPathTemplate.match(billingAccountSinkName).billing_account; } /** * Parse the sink from BillingAccountSink resource. * * @param {string} billingAccountSinkName * A fully-qualified path representing billing_account_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromBillingAccountSinkName(billingAccountSinkName) { return this.pathTemplates.billingAccountSinkPathTemplate.match(billingAccountSinkName).sink; } /** * Return a fully-qualified folderCmekSettings resource name string. * * @param {string} folder * @returns {string} Resource name string. */ folderCmekSettingsPath(folder) { return this.pathTemplates.folderCmekSettingsPathTemplate.render({ folder: folder, }); } /** * Parse the folder from FolderCmekSettings resource. * * @param {string} folderCmekSettingsName * A fully-qualified path representing folder_cmekSettings resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderCmekSettingsName(folderCmekSettingsName) { return this.pathTemplates.folderCmekSettingsPathTemplate.match(folderCmekSettingsName).folder; } /** * Return a fully-qualified folderExclusion resource name string. * * @param {string} folder * @param {string} exclusion * @returns {string} Resource name string. */ folderExclusionPath(folder, exclusion) { return this.pathTemplates.folderExclusionPathTemplate.render({ folder: folder, exclusion: exclusion, }); } /** * Parse the folder from FolderExclusion resource. * * @param {string} folderExclusionName * A fully-qualified path representing folder_exclusion resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderExclusionName(folderExclusionName) { return this.pathTemplates.folderExclusionPathTemplate.match(folderExclusionName).folder; } /** * Parse the exclusion from FolderExclusion resource. * * @param {string} folderExclusionName * A fully-qualified path representing folder_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromFolderExclusionName(folderExclusionName) { return this.pathTemplates.folderExclusionPathTemplate.match(folderExclusionName).exclusion; } /** * Return a fully-qualified folderLocationBucket resource name string. * * @param {string} folder * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ folderLocationBucketPath(folder, location, bucket) { return this.pathTemplates.folderLocationBucketPathTemplate.render({ folder: folder, location: location, bucket: bucket, }); } /** * Parse the folder from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).folder; } /** * Parse the location from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).location; } /** * Parse the bucket from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).bucket; } /** * Return a fully-qualified folderLocationBucketView resource name string. * * @param {string} folder * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ folderLocationBucketViewPath(folder, location, bucket, view) { return this.pathTemplates.folderLocationBucketViewPathTemplate.render({ folder: folder, location: location, bucket: bucket, view: view, }); } /** * Parse the folder from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).folder; } /** * Parse the location from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).location; } /** * Parse the bucket from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).bucket; } /** * Parse the view from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).view; } /** * Return a fully-qualified folderLog resource name string. * * @param {string} folder * @param {string} log * @returns {string} Resource name string. */ folderLogPath(folder, log) { return this.pathTemplates.folderLogPathTemplate.render({ folder: folder, log: log, }); } /** * Parse the folder from FolderLog resource. * * @param {string} folderLogName * A fully-qualified path representing folder_log resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLogName(folderLogName) { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).folder; } /** * Parse the log from FolderLog resource. * * @param {string} folderLogName * A fully-qualified path representing folder_log resource. * @returns {string} A string representing the log. */ matchLogFromFolderLogName(folderLogName) { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).log; } /** * Return a fully-qualified folderSink resource name string. * * @param {string} folder * @param {string} sink * @returns {string} Resource name string. */ folderSinkPath(folder, sink) { return this.pathTemplates.folderSinkPathTemplate.render({ folder: folder, sink: sink, }); } /** * Parse the folder from FolderSink resource. * * @param {string} folderSinkName * A fully-qualified path representing folder_sink resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderSinkName(folderSinkName) { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName) .folder; } /** * Parse the sink from FolderSink resource. * * @param {string} folderSinkName * A fully-qualified path representing folder_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromFolderSinkName(folderSinkName) { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; } /** * Return a fully-qualified location resource name string. * * @param {string} project * @param {string} location * @returns {string} Resource name string. */ locationPath(project, location) { return this.pathTemplates.locationPathTemplate.render({ project: project, location: location, }); } /** * Parse the project from Location resource. * * @param {string} locationName * A fully-qualified path representing Location resource. * @returns {string} A string representing the project. */ matchProjectFromLocationName(locationName) { return this.pathTemplates.locationPathTemplate.match(locationName).project; } /** * Parse the location from Location resource. * * @param {string} locationName * A fully-qualified path representing Location resource. * @returns {string} A string representing the location. */ matchLocationFromLocationName(locationName) { return this.pathTemplates.locationPathTemplate.match(locationName).location; } /** * Return a fully-qualified logMetric resource name string. * * @param {string} project * @param {string} metric * @returns {string} Resource name string. */ logMetricPath(project, metric) { return this.pathTemplates.logMetricPathTemplate.render({ project: project, metric: metric, }); } /** * Parse the project from LogMetric resource. * * @param {string} logMetricName * A fully-qualified path representing LogMetric resource. * @returns {string} A string representing the project. */ matchProjectFromLogMetricName(logMetricName) { return this.pathTemplates.logMetricPathTemplate.match(logMetricName) .project; } /** * Parse the metric from LogMetric resource. * * @param {string} logMetricName * A fully-qualified path representing LogMetric resource. * @returns {string} A string representing the metric. */ matchMetricFromLogMetricName(logMetricName) { return this.pathTemplates.logMetricPathTemplate.match(logMetricName).metric; } /** * Return a fully-qualified organizationCmekSettings resource name string. * * @param {string} organization * @returns {string} Resource name string. */ organizationCmekSettingsPath(organization) { return this.pathTemplates.organizationCmekSettingsPathTemplate.render({ organization: organization, }); } /** * Parse the organization from OrganizationCmekSettings resource. * * @param {string} organizationCmekSettingsName * A fully-qualified path representing organization_cmekSettings resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationCmekSettingsName(organizationCmekSettingsName) { return this.pathTemplates.organizationCmekSettingsPathTemplate.match(organizationCmekSettingsName).organization; } /** * Return a fully-qualified organizationExclusion resource name string. * * @param {string} organization * @param {string} exclusion * @returns {string} Resource name string. */ organizationExclusionPath(organization, exclusion) { return this.pathTemplates.organizationExclusionPathTemplate.render({ organization: organization, exclusion: exclusion, }); } /** * Parse the organization from OrganizationExclusion resource. * * @param {string} organizationExclusionName * A fully-qualified path representing organization_exclusion resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationExclusionName(organizationExclusionName) { return this.pathTemplates.organizationExclusionPathTemplate.match(organizationExclusionName).organization; } /** * Parse the exclusion from OrganizationExclusion resource. * * @param {string} organizationExclusionName * A fully-qualified path representing organization_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromOrganizationExclusionName(organizationExclusionName) { return this.pathTemplates.organizationExclusionPathTemplate.match(organizationExclusionName).exclusion; } /** * Return a fully-qualified organizationLocationBucket resource name string. * * @param {string} organization * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ organizationLocationBucketPath(organization, location, bucket) { return this.pathTemplates.organizationLocationBucketPathTemplate.render({ organization: organization, location: location, bucket: bucket, }); } /** * Parse the organization from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).organization; } /** * Parse the location from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).location; } /** * Parse the bucket from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).bucket; } /** * Return a fully-qualified organizationLocationBucketView resource name string. * * @param {string} organization * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ organizationLocationBucketViewPath(organization, location, bucket, view) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.render({ organization: organization, location: location, bucket: bucket, view: view, }); } /** * Parse the organization from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).organization; } /** * Parse the location from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).location; } /** * Parse the bucket from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).bucket; } /** * Parse the view from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).view; } /** * Return a fully-qualified organizationLog resource name string. * * @param {string} organization * @param {string} log * @returns {string} Resource name string. */ organizationLogPath(organization, log) { return this.pathTemplates.organizationLogPathTemplate.render({ organization: organization, log: log, }); } /** * Parse the organization from OrganizationLog resource. * * @param {string} organizationLogName * A fully-qualified path representing organization_log resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLogName(organizationLogName) { return this.pathTemplates.organizationLogPathTemplate.match(organizationLogName).organization; } /** * Parse the log from OrganizationLog resource. * * @param {string} organizationLogName * A fully-qualified path representing organization_log resource. * @returns {string} A string representing the log. */ matchLogFromOrganizationLogName(organizationLogName) { return this.pathTemplates.organizationLogPathTemplate.match(organizationLogName).log; } /** * Return a fully-qualified organizationSink resource name string. * * @param {string} organization * @param {string} sink * @returns {string} Resource name string. */ organizationSinkPath(organization, sink) { return this.pathTemplates.organizationSinkPathTemplate.render({ organization: organization, sink: sink, }); } /** * Parse the organization from OrganizationSink resource. * * @param {string} organizationSinkName * A fully-qualified path representing organization_sink resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationSinkName(organizationSinkName) { return this.pathTemplates.organizationSinkPathTemplate.match(organizationSinkName).organization; } /** * Parse the sink from OrganizationSink resource. * * @param {string} organizationSinkName * A fully-qualified path representing organization_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromOrganizationSinkName(organizationSinkName) { return this.pathTemplates.organizationSinkPathTemplate.match(organizationSinkName).sink; } /** * Return a fully-qualified project resource name string. * * @param {string} project * @returns {string} Resource name string. */ projectPath(project) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); } /** * Parse the project from Project resource. * * @param {string} projectName * A fully-qualified path representing Project resource. * @returns {string} A string representing the project. */ matchProjectFromProjectName(projectName) { return this.pathTemplates.projectPathTemplate.match(projectName).project; } /** * Return a fully-qualified projectCmekSettings resource name string. * * @param {string} project * @returns {string} Resource name string. */ projectCmekSettingsPath(project) { return this.pathTemplates.projectCmekSettingsPathTemplate.render({ project: project, }); } /** * Parse the project from ProjectCmekSettings resource. * * @param {string} projectCmekSettingsName * A fully-qualified path representing project_cmekSettings resource. * @returns {string} A string representing the project. */ matchProjectFromProjectCmekSettingsName(projectCmekSettingsName) { return this.pathTemplates.projectCmekSettingsPathTemplate.match(projectCmekSettingsName).project; } /** * Return a fully-qualified projectExclusion resource name string. * * @param {string} project * @param {string} exclusion * @returns {string} Resource name string. */ projectExclusionPath(project, exclusion) { return this.pathTemplates.projectExclusionPathTemplate.render({ project: project, exclusion: exclusion, }); } /** * Parse the project from ProjectExclusion resource. * * @param {string} projectExclusionName * A fully-qualified path representing project_exclusion resource. * @returns {string} A string representing the project. */ matchProjectFromProjectExclusionName(projectExclusionName) { return this.pathTemplates.projectExclusionPathTemplate.match(projectExclusionName).project; } /** * Parse the exclusion from ProjectExclusion resource. * * @param {string} projectExclusionName * A fully-qualified path representing project_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromProjectExclusionName(projectExclusionName) { return this.pathTemplates.projectExclusionPathTemplate.match(projectExclusionName).exclusion; } /** * Return a fully-qualified projectLocationBucket resource name string. * * @param {string} project * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ projectLocationBucketPath(project, location, bucket) { return this.pathTemplates.projectLocationBucketPathTemplate.render({ project: project, location: location, bucket: bucket, }); } /** * Parse the project from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).project; } /** * Parse the location from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).location; } /** * Parse the bucket from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).bucket; } /** * Return a fully-qualified projectLocationBucketView resource name string. * * @param {string} project * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ projectLocationBucketViewPath(project, location, bucket, view) { return this.pathTemplates.projectLocationBucketViewPathTemplate.render({ project: project, location: location, bucket: bucket, view: view, }); } /** * Parse the project from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).project; } /** * Parse the location from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).location; } /** * Parse the bucket from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).bucket; } /** * Parse the view from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).view; } /** * Return a fully-qualified projectLog resource name string. * * @param {string} project * @param {string} log * @returns {string} Resource name string. */ projectLogPath(project, log) { return this.pathTemplates.projectLogPathTemplate.render({ project: project, log: log, }); } /** * Parse the project from ProjectLog resource. * * @param {string} projectLogName * A fully-qualified path representing project_log resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLogName(projectLogName) { return this.pathTemplates.projectLogPathTemplate.match(projectLogName) .project; } /** * Parse the log from ProjectLog resource. * * @param {string} projectLogName * A fully-qualified path representing project_log resource. * @returns {string} A string representing the log. */ matchLogFromProjectLogName(projectLogName) { return this.pathTemplates.projectLogPathTemplate.match(projectLogName).log; } /** * Return a fully-qualified projectSink resource name string. * * @param {string} project * @param {string} sink * @returns {string} Resource name string. */ projectSinkPath(project, sink) { return this.pathTemplates.projectSinkPathTemplate.render({ project: project, sink: sink, }); } /** * Parse the project from ProjectSink resource. * * @param {string} projectSinkName * A fully-qualified path representing project_sink resource. * @returns {string} A string representing the project. */ matchProjectFromProjectSinkName(projectSinkName) { return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) .project; } /** * Parse the sink from ProjectSink resource. * * @param {string} projectSinkName * A fully-qualified path representing project_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromProjectSinkName(projectSinkName) { return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) .sink; } /** * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. * @returns {Promise} A promise that resolves when the client is closed. */ close() { this.initialize(); if (!this._terminated) { return this.configServiceV2Stub.then(stub => { this._terminated = true; stub.close(); }); } return Promise.resolve(); } } exports.ConfigServiceV2Client = ConfigServiceV2Client; //# sourceMappingURL=config_service_v2_client.js.map /***/ }), /***/ 5863: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** Object.defineProperty(exports, "__esModule", ({ value: true })); var config_service_v2_client_1 = __webpack_require__(37965); Object.defineProperty(exports, "ConfigServiceV2Client", ({ enumerable: true, get: function () { return config_service_v2_client_1.ConfigServiceV2Client; } })); var logging_service_v2_client_1 = __webpack_require__(814); Object.defineProperty(exports, "LoggingServiceV2Client", ({ enumerable: true, get: function () { return logging_service_v2_client_1.LoggingServiceV2Client; } })); var metrics_service_v2_client_1 = __webpack_require__(47516); Object.defineProperty(exports, "MetricsServiceV2Client", ({ enumerable: true, get: function () { return metrics_service_v2_client_1.MetricsServiceV2Client; } })); //# sourceMappingURL=index.js.map /***/ }), /***/ 814: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LoggingServiceV2Client = void 0; /* global window */ const gax = __webpack_require__(12263); const jsonProtos = __webpack_require__(54479); /** * Client JSON configuration object, loaded from * `src/v2/logging_service_v2_client_config.json`. * This file defines retry strategy and timeouts for all API methods in this library. */ const gapicConfig = __webpack_require__(22125); const version = __webpack_require__(87989)/* .version */ .i8; /** * Service for ingesting and querying logs. * @class * @memberof v2 */ class LoggingServiceV2Client { /** * Construct an instance of LoggingServiceV2Client. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` * if you need to override this behavior. */ constructor(opts) { var _a, _b; this._terminated = false; this.descriptors = { page: {}, stream: {}, longrunning: {}, batching: {}, }; // Ensure that options include all the required fields. const staticMembers = this.constructor; const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; } // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. this._opts = opts; // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; // Set defaultServicePath on the auth object. this.auth.defaultServicePath = staticMembers.servicePath; // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } else if (opts.fallback === 'rest') { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { billingAccountCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/cmekSettings'), billingAccountExclusionPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/exclusions/{exclusion}'), billingAccountLocationBucketPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}'), billingAccountLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}'), billingAccountLogPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/logs/{log}'), billingAccountSinkPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/sinks/{sink}'), folderCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/cmekSettings'), folderExclusionPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/exclusions/{exclusion}'), folderLocationBucketPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}'), folderLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}'), folderLogPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/logs/{log}'), folderSinkPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/sinks/{sink}'), logMetricPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/metrics/{metric}'), organizationCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/cmekSettings'), organizationExclusionPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/exclusions/{exclusion}'), organizationLocationBucketPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}'), organizationLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}'), organizationLogPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/logs/{log}'), organizationSinkPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/sinks/{sink}'), projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'), projectCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/cmekSettings'), projectExclusionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/exclusions/{exclusion}'), projectLocationBucketPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}'), projectLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/views/{view}'), projectLogPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/logs/{log}'), projectSinkPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/sinks/{sink}'), }; // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { listLogEntries: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'entries'), listMonitoredResourceDescriptors: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceDescriptors'), listLogs: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'logNames'), }; // Some of the methods on this service provide streaming responses. // Provide descriptors for these. this.descriptors.stream = { tailLogEntries: new this._gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); // Some methods on this API support automatically batching // requests; denote this. this.descriptors.batching = { writeLogEntries: new this._gaxModule.BundleDescriptor('entries', ['log_name', 'resource', 'labels'], null, gax.createByteLengthFunction( // eslint-disable-next-line @typescript-eslint/no-explicit-any protoFilesRoot.lookupType('google.logging.v2.LogEntry'))), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings('google.logging.v2.LoggingServiceV2', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') }); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. this.warn = gax.warn; } /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize() { var _a; // If the client stub promise is already initialized, return immediately. if (this.loggingServiceV2Stub) { return this.loggingServiceV2Stub; } // Put together the "service stub" for // google.logging.v2.LoggingServiceV2. this.loggingServiceV2Stub = this._gaxGrpc.createStub(this._opts.fallback ? this._protos.lookupService('google.logging.v2.LoggingServiceV2') : // eslint-disable-next-line @typescript-eslint/no-explicit-any this._protos.google.logging.v2.LoggingServiceV2, this._opts, this._providedCustomServicePath); // Iterate over each of the methods that the service provides // and create an API call method for each. const loggingServiceV2StubMethods = [ 'deleteLog', 'writeLogEntries', 'listLogEntries', 'listMonitoredResourceDescriptors', 'listLogs', 'tailLogEntries', ]; for (const methodName of loggingServiceV2StubMethods) { const callPromise = this.loggingServiceV2Stub.then(stub => (...args) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; return func.apply(stub, args); }, (err) => () => { throw err; }); const descriptor = this.descriptors.page[methodName] || this.descriptors.stream[methodName] || ((_a = this.descriptors.batching) === null || _a === void 0 ? void 0 : _a[methodName]) || undefined; const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor); this.innerApiCalls[methodName] = apiCall; } return this.loggingServiceV2Stub; } /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ static get servicePath() { return 'logging.googleapis.com'; } /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. * @returns {string} The DNS address for this service. */ static get apiEndpoint() { return 'logging.googleapis.com'; } /** * The port for this API service. * @returns {number} The default port for this service. */ static get port() { return 443; } /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/cloud-platform.read-only', 'https://www.googleapis.com/auth/logging.admin', 'https://www.googleapis.com/auth/logging.read', 'https://www.googleapis.com/auth/logging.write', ]; } /** * Return the project ID used by this class. * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId(callback) { if (callback) { this.auth.getProjectId(callback); return; } return this.auth.getProjectId(); } deleteLog(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ log_name: request.logName || '', }); this.initialize(); return this.innerApiCalls.deleteLog(request, options, callback); } writeLogEntries(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); return this.innerApiCalls.writeLogEntries(request, options, callback); } /** * Streaming read of log entries as they are ingested. Until the stream is * terminated, it will continue reading logs. * * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which is both readable and writable. It accepts objects * representing [TailLogEntriesRequest]{@link google.logging.v2.TailLogEntriesRequest} for write() method, and * will emit objects representing [TailLogEntriesResponse]{@link google.logging.v2.TailLogEntriesResponse} on 'data' event asynchronously. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) * for more details and examples. * @example include:samples/generated/v2/logging_service_v2.tail_log_entries.js * region_tag:logging_v2_generated_LoggingServiceV2_TailLogEntries_async */ tailLogEntries(options) { this.initialize(); return this.innerApiCalls.tailLogEntries(options); } listLogEntries(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); return this.innerApiCalls.listLogEntries(request, options, callback); } /** * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string[]} request.resourceNames * Required. Names of one or more parent resources from which to * retrieve log entries: * * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * * May alternatively be one or more views * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * * Projects listed in the `project_ids` field are added to this list. * @param {string} [request.filter] * Optional. A filter that chooses which log entries to return. See [Advanced * Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). * Only log entries that match the filter are returned. An empty filter * matches all log entries in the resources listed in `resource_names`. * Referencing a parent resource that is not listed in `resource_names` will * cause the filter to return no results. The maximum length of the filter is * 20000 characters. * @param {string} [request.orderBy] * Optional. How the results should be sorted. Presently, the only permitted * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first * option returns entries in order of increasing values of * `LogEntry.timestamp` (oldest first), and the second option returns entries * in order of decreasing timestamps (newest first). Entries with equal * timestamps are returned in order of their `insert_id` values. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Default is 50. If the value is negative or exceeds 1000, * the request is rejected. The presence of `next_page_token` in the * response indicates that more results might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `page_token` must be the value of * `next_page_token` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [LogEntry]{@link google.logging.v2.LogEntry} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listLogEntriesAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listLogEntriesStream(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; const defaultCallSettings = this._defaults['listLogEntries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogEntries.createStream(this.innerApiCalls.listLogEntries, request, callSettings); } /** * Equivalent to `listLogEntries`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string[]} request.resourceNames * Required. Names of one or more parent resources from which to * retrieve log entries: * * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * * May alternatively be one or more views * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * * Projects listed in the `project_ids` field are added to this list. * @param {string} [request.filter] * Optional. A filter that chooses which log entries to return. See [Advanced * Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). * Only log entries that match the filter are returned. An empty filter * matches all log entries in the resources listed in `resource_names`. * Referencing a parent resource that is not listed in `resource_names` will * cause the filter to return no results. The maximum length of the filter is * 20000 characters. * @param {string} [request.orderBy] * Optional. How the results should be sorted. Presently, the only permitted * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first * option returns entries in order of increasing values of * `LogEntry.timestamp` (oldest first), and the second option returns entries * in order of decreasing timestamps (newest first). Entries with equal * timestamps are returned in order of their `insert_id` values. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Default is 50. If the value is negative or exceeds 1000, * the request is rejected. The presence of `next_page_token` in the * response indicates that more results might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `page_token` must be the value of * `next_page_token` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [LogEntry]{@link google.logging.v2.LogEntry}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. * @example include:samples/generated/v2/logging_service_v2.list_log_entries.js * region_tag:logging_v2_generated_LoggingServiceV2_ListLogEntries_async */ listLogEntriesAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; const defaultCallSettings = this._defaults['listLogEntries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogEntries.asyncIterate(this.innerApiCalls['listLogEntries'], request, callSettings); } listMonitoredResourceDescriptors(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); return this.innerApiCalls.listMonitoredResourceDescriptors(request, options, callback); } /** * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listMonitoredResourceDescriptorsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listMonitoredResourceDescriptorsStream(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; const defaultCallSettings = this._defaults['listMonitoredResourceDescriptors']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listMonitoredResourceDescriptors.createStream(this.innerApiCalls.listMonitoredResourceDescriptors, request, callSettings); } /** * Equivalent to `listMonitoredResourceDescriptors`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. * @example include:samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js * region_tag:logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_async */ listMonitoredResourceDescriptorsAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; const defaultCallSettings = this._defaults['listMonitoredResourceDescriptors']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listMonitoredResourceDescriptors.asyncIterate(this.innerApiCalls['listMonitoredResourceDescriptors'], request, callSettings); } listLogs(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listLogs(request, options, callback); } /** * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The resource name that owns the logs: * * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {string[]} [request.resourceNames] * Optional. The resource name that owns the logs: * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * * To support legacy queries, it could also be: * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing string on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listLogsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listLogsStream(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listLogs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogs.createStream(this.innerApiCalls.listLogs, request, callSettings); } /** * Equivalent to `listLogs`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The resource name that owns the logs: * * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {string[]} [request.resourceNames] * Optional. The resource name that owns the logs: * projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] * * To support legacy queries, it could also be: * "projects/[PROJECT_ID]" * "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" * "folders/[FOLDER_ID]" * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * string. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. * @example include:samples/generated/v2/logging_service_v2.list_logs.js * region_tag:logging_v2_generated_LoggingServiceV2_ListLogs_async */ listLogsAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listLogs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogs.asyncIterate(this.innerApiCalls['listLogs'], request, callSettings); } // -------------------- // -- Path templates -- // -------------------- /** * Return a fully-qualified billingAccountCmekSettings resource name string. * * @param {string} billing_account * @returns {string} Resource name string. */ billingAccountCmekSettingsPath(billingAccount) { return this.pathTemplates.billingAccountCmekSettingsPathTemplate.render({ billing_account: billingAccount, }); } /** * Parse the billing_account from BillingAccountCmekSettings resource. * * @param {string} billingAccountCmekSettingsName * A fully-qualified path representing billing_account_cmekSettings resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountCmekSettingsName(billingAccountCmekSettingsName) { return this.pathTemplates.billingAccountCmekSettingsPathTemplate.match(billingAccountCmekSettingsName).billing_account; } /** * Return a fully-qualified billingAccountExclusion resource name string. * * @param {string} billing_account * @param {string} exclusion * @returns {string} Resource name string. */ billingAccountExclusionPath(billingAccount, exclusion) { return this.pathTemplates.billingAccountExclusionPathTemplate.render({ billing_account: billingAccount, exclusion: exclusion, }); } /** * Parse the billing_account from BillingAccountExclusion resource. * * @param {string} billingAccountExclusionName * A fully-qualified path representing billing_account_exclusion resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountExclusionName(billingAccountExclusionName) { return this.pathTemplates.billingAccountExclusionPathTemplate.match(billingAccountExclusionName).billing_account; } /** * Parse the exclusion from BillingAccountExclusion resource. * * @param {string} billingAccountExclusionName * A fully-qualified path representing billing_account_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromBillingAccountExclusionName(billingAccountExclusionName) { return this.pathTemplates.billingAccountExclusionPathTemplate.match(billingAccountExclusionName).exclusion; } /** * Return a fully-qualified billingAccountLocationBucket resource name string. * * @param {string} billing_account * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ billingAccountLocationBucketPath(billingAccount, location, bucket) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.render({ billing_account: billingAccount, location: location, bucket: bucket, }); } /** * Parse the billing_account from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).billing_account; } /** * Parse the location from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).location; } /** * Parse the bucket from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).bucket; } /** * Return a fully-qualified billingAccountLocationBucketView resource name string. * * @param {string} billing_account * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ billingAccountLocationBucketViewPath(billingAccount, location, bucket, view) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.render({ billing_account: billingAccount, location: location, bucket: bucket, view: view, }); } /** * Parse the billing_account from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).billing_account; } /** * Parse the location from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).location; } /** * Parse the bucket from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).bucket; } /** * Parse the view from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).view; } /** * Return a fully-qualified billingAccountLog resource name string. * * @param {string} billing_account * @param {string} log * @returns {string} Resource name string. */ billingAccountLogPath(billingAccount, log) { return this.pathTemplates.billingAccountLogPathTemplate.render({ billing_account: billingAccount, log: log, }); } /** * Parse the billing_account from BillingAccountLog resource. * * @param {string} billingAccountLogName * A fully-qualified path representing billing_account_log resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLogName(billingAccountLogName) { return this.pathTemplates.billingAccountLogPathTemplate.match(billingAccountLogName).billing_account; } /** * Parse the log from BillingAccountLog resource. * * @param {string} billingAccountLogName * A fully-qualified path representing billing_account_log resource. * @returns {string} A string representing the log. */ matchLogFromBillingAccountLogName(billingAccountLogName) { return this.pathTemplates.billingAccountLogPathTemplate.match(billingAccountLogName).log; } /** * Return a fully-qualified billingAccountSink resource name string. * * @param {string} billing_account * @param {string} sink * @returns {string} Resource name string. */ billingAccountSinkPath(billingAccount, sink) { return this.pathTemplates.billingAccountSinkPathTemplate.render({ billing_account: billingAccount, sink: sink, }); } /** * Parse the billing_account from BillingAccountSink resource. * * @param {string} billingAccountSinkName * A fully-qualified path representing billing_account_sink resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountSinkName(billingAccountSinkName) { return this.pathTemplates.billingAccountSinkPathTemplate.match(billingAccountSinkName).billing_account; } /** * Parse the sink from BillingAccountSink resource. * * @param {string} billingAccountSinkName * A fully-qualified path representing billing_account_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromBillingAccountSinkName(billingAccountSinkName) { return this.pathTemplates.billingAccountSinkPathTemplate.match(billingAccountSinkName).sink; } /** * Return a fully-qualified folderCmekSettings resource name string. * * @param {string} folder * @returns {string} Resource name string. */ folderCmekSettingsPath(folder) { return this.pathTemplates.folderCmekSettingsPathTemplate.render({ folder: folder, }); } /** * Parse the folder from FolderCmekSettings resource. * * @param {string} folderCmekSettingsName * A fully-qualified path representing folder_cmekSettings resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderCmekSettingsName(folderCmekSettingsName) { return this.pathTemplates.folderCmekSettingsPathTemplate.match(folderCmekSettingsName).folder; } /** * Return a fully-qualified folderExclusion resource name string. * * @param {string} folder * @param {string} exclusion * @returns {string} Resource name string. */ folderExclusionPath(folder, exclusion) { return this.pathTemplates.folderExclusionPathTemplate.render({ folder: folder, exclusion: exclusion, }); } /** * Parse the folder from FolderExclusion resource. * * @param {string} folderExclusionName * A fully-qualified path representing folder_exclusion resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderExclusionName(folderExclusionName) { return this.pathTemplates.folderExclusionPathTemplate.match(folderExclusionName).folder; } /** * Parse the exclusion from FolderExclusion resource. * * @param {string} folderExclusionName * A fully-qualified path representing folder_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromFolderExclusionName(folderExclusionName) { return this.pathTemplates.folderExclusionPathTemplate.match(folderExclusionName).exclusion; } /** * Return a fully-qualified folderLocationBucket resource name string. * * @param {string} folder * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ folderLocationBucketPath(folder, location, bucket) { return this.pathTemplates.folderLocationBucketPathTemplate.render({ folder: folder, location: location, bucket: bucket, }); } /** * Parse the folder from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).folder; } /** * Parse the location from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).location; } /** * Parse the bucket from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).bucket; } /** * Return a fully-qualified folderLocationBucketView resource name string. * * @param {string} folder * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ folderLocationBucketViewPath(folder, location, bucket, view) { return this.pathTemplates.folderLocationBucketViewPathTemplate.render({ folder: folder, location: location, bucket: bucket, view: view, }); } /** * Parse the folder from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).folder; } /** * Parse the location from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).location; } /** * Parse the bucket from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).bucket; } /** * Parse the view from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).view; } /** * Return a fully-qualified folderLog resource name string. * * @param {string} folder * @param {string} log * @returns {string} Resource name string. */ folderLogPath(folder, log) { return this.pathTemplates.folderLogPathTemplate.render({ folder: folder, log: log, }); } /** * Parse the folder from FolderLog resource. * * @param {string} folderLogName * A fully-qualified path representing folder_log resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLogName(folderLogName) { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).folder; } /** * Parse the log from FolderLog resource. * * @param {string} folderLogName * A fully-qualified path representing folder_log resource. * @returns {string} A string representing the log. */ matchLogFromFolderLogName(folderLogName) { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).log; } /** * Return a fully-qualified folderSink resource name string. * * @param {string} folder * @param {string} sink * @returns {string} Resource name string. */ folderSinkPath(folder, sink) { return this.pathTemplates.folderSinkPathTemplate.render({ folder: folder, sink: sink, }); } /** * Parse the folder from FolderSink resource. * * @param {string} folderSinkName * A fully-qualified path representing folder_sink resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderSinkName(folderSinkName) { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName) .folder; } /** * Parse the sink from FolderSink resource. * * @param {string} folderSinkName * A fully-qualified path representing folder_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromFolderSinkName(folderSinkName) { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; } /** * Return a fully-qualified logMetric resource name string. * * @param {string} project * @param {string} metric * @returns {string} Resource name string. */ logMetricPath(project, metric) { return this.pathTemplates.logMetricPathTemplate.render({ project: project, metric: metric, }); } /** * Parse the project from LogMetric resource. * * @param {string} logMetricName * A fully-qualified path representing LogMetric resource. * @returns {string} A string representing the project. */ matchProjectFromLogMetricName(logMetricName) { return this.pathTemplates.logMetricPathTemplate.match(logMetricName) .project; } /** * Parse the metric from LogMetric resource. * * @param {string} logMetricName * A fully-qualified path representing LogMetric resource. * @returns {string} A string representing the metric. */ matchMetricFromLogMetricName(logMetricName) { return this.pathTemplates.logMetricPathTemplate.match(logMetricName).metric; } /** * Return a fully-qualified organizationCmekSettings resource name string. * * @param {string} organization * @returns {string} Resource name string. */ organizationCmekSettingsPath(organization) { return this.pathTemplates.organizationCmekSettingsPathTemplate.render({ organization: organization, }); } /** * Parse the organization from OrganizationCmekSettings resource. * * @param {string} organizationCmekSettingsName * A fully-qualified path representing organization_cmekSettings resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationCmekSettingsName(organizationCmekSettingsName) { return this.pathTemplates.organizationCmekSettingsPathTemplate.match(organizationCmekSettingsName).organization; } /** * Return a fully-qualified organizationExclusion resource name string. * * @param {string} organization * @param {string} exclusion * @returns {string} Resource name string. */ organizationExclusionPath(organization, exclusion) { return this.pathTemplates.organizationExclusionPathTemplate.render({ organization: organization, exclusion: exclusion, }); } /** * Parse the organization from OrganizationExclusion resource. * * @param {string} organizationExclusionName * A fully-qualified path representing organization_exclusion resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationExclusionName(organizationExclusionName) { return this.pathTemplates.organizationExclusionPathTemplate.match(organizationExclusionName).organization; } /** * Parse the exclusion from OrganizationExclusion resource. * * @param {string} organizationExclusionName * A fully-qualified path representing organization_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromOrganizationExclusionName(organizationExclusionName) { return this.pathTemplates.organizationExclusionPathTemplate.match(organizationExclusionName).exclusion; } /** * Return a fully-qualified organizationLocationBucket resource name string. * * @param {string} organization * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ organizationLocationBucketPath(organization, location, bucket) { return this.pathTemplates.organizationLocationBucketPathTemplate.render({ organization: organization, location: location, bucket: bucket, }); } /** * Parse the organization from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).organization; } /** * Parse the location from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).location; } /** * Parse the bucket from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).bucket; } /** * Return a fully-qualified organizationLocationBucketView resource name string. * * @param {string} organization * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ organizationLocationBucketViewPath(organization, location, bucket, view) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.render({ organization: organization, location: location, bucket: bucket, view: view, }); } /** * Parse the organization from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).organization; } /** * Parse the location from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).location; } /** * Parse the bucket from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).bucket; } /** * Parse the view from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).view; } /** * Return a fully-qualified organizationLog resource name string. * * @param {string} organization * @param {string} log * @returns {string} Resource name string. */ organizationLogPath(organization, log) { return this.pathTemplates.organizationLogPathTemplate.render({ organization: organization, log: log, }); } /** * Parse the organization from OrganizationLog resource. * * @param {string} organizationLogName * A fully-qualified path representing organization_log resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLogName(organizationLogName) { return this.pathTemplates.organizationLogPathTemplate.match(organizationLogName).organization; } /** * Parse the log from OrganizationLog resource. * * @param {string} organizationLogName * A fully-qualified path representing organization_log resource. * @returns {string} A string representing the log. */ matchLogFromOrganizationLogName(organizationLogName) { return this.pathTemplates.organizationLogPathTemplate.match(organizationLogName).log; } /** * Return a fully-qualified organizationSink resource name string. * * @param {string} organization * @param {string} sink * @returns {string} Resource name string. */ organizationSinkPath(organization, sink) { return this.pathTemplates.organizationSinkPathTemplate.render({ organization: organization, sink: sink, }); } /** * Parse the organization from OrganizationSink resource. * * @param {string} organizationSinkName * A fully-qualified path representing organization_sink resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationSinkName(organizationSinkName) { return this.pathTemplates.organizationSinkPathTemplate.match(organizationSinkName).organization; } /** * Parse the sink from OrganizationSink resource. * * @param {string} organizationSinkName * A fully-qualified path representing organization_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromOrganizationSinkName(organizationSinkName) { return this.pathTemplates.organizationSinkPathTemplate.match(organizationSinkName).sink; } /** * Return a fully-qualified project resource name string. * * @param {string} project * @returns {string} Resource name string. */ projectPath(project) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); } /** * Parse the project from Project resource. * * @param {string} projectName * A fully-qualified path representing Project resource. * @returns {string} A string representing the project. */ matchProjectFromProjectName(projectName) { return this.pathTemplates.projectPathTemplate.match(projectName).project; } /** * Return a fully-qualified projectCmekSettings resource name string. * * @param {string} project * @returns {string} Resource name string. */ projectCmekSettingsPath(project) { return this.pathTemplates.projectCmekSettingsPathTemplate.render({ project: project, }); } /** * Parse the project from ProjectCmekSettings resource. * * @param {string} projectCmekSettingsName * A fully-qualified path representing project_cmekSettings resource. * @returns {string} A string representing the project. */ matchProjectFromProjectCmekSettingsName(projectCmekSettingsName) { return this.pathTemplates.projectCmekSettingsPathTemplate.match(projectCmekSettingsName).project; } /** * Return a fully-qualified projectExclusion resource name string. * * @param {string} project * @param {string} exclusion * @returns {string} Resource name string. */ projectExclusionPath(project, exclusion) { return this.pathTemplates.projectExclusionPathTemplate.render({ project: project, exclusion: exclusion, }); } /** * Parse the project from ProjectExclusion resource. * * @param {string} projectExclusionName * A fully-qualified path representing project_exclusion resource. * @returns {string} A string representing the project. */ matchProjectFromProjectExclusionName(projectExclusionName) { return this.pathTemplates.projectExclusionPathTemplate.match(projectExclusionName).project; } /** * Parse the exclusion from ProjectExclusion resource. * * @param {string} projectExclusionName * A fully-qualified path representing project_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromProjectExclusionName(projectExclusionName) { return this.pathTemplates.projectExclusionPathTemplate.match(projectExclusionName).exclusion; } /** * Return a fully-qualified projectLocationBucket resource name string. * * @param {string} project * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ projectLocationBucketPath(project, location, bucket) { return this.pathTemplates.projectLocationBucketPathTemplate.render({ project: project, location: location, bucket: bucket, }); } /** * Parse the project from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).project; } /** * Parse the location from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).location; } /** * Parse the bucket from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).bucket; } /** * Return a fully-qualified projectLocationBucketView resource name string. * * @param {string} project * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ projectLocationBucketViewPath(project, location, bucket, view) { return this.pathTemplates.projectLocationBucketViewPathTemplate.render({ project: project, location: location, bucket: bucket, view: view, }); } /** * Parse the project from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).project; } /** * Parse the location from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).location; } /** * Parse the bucket from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).bucket; } /** * Parse the view from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).view; } /** * Return a fully-qualified projectLog resource name string. * * @param {string} project * @param {string} log * @returns {string} Resource name string. */ projectLogPath(project, log) { return this.pathTemplates.projectLogPathTemplate.render({ project: project, log: log, }); } /** * Parse the project from ProjectLog resource. * * @param {string} projectLogName * A fully-qualified path representing project_log resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLogName(projectLogName) { return this.pathTemplates.projectLogPathTemplate.match(projectLogName) .project; } /** * Parse the log from ProjectLog resource. * * @param {string} projectLogName * A fully-qualified path representing project_log resource. * @returns {string} A string representing the log. */ matchLogFromProjectLogName(projectLogName) { return this.pathTemplates.projectLogPathTemplate.match(projectLogName).log; } /** * Return a fully-qualified projectSink resource name string. * * @param {string} project * @param {string} sink * @returns {string} Resource name string. */ projectSinkPath(project, sink) { return this.pathTemplates.projectSinkPathTemplate.render({ project: project, sink: sink, }); } /** * Parse the project from ProjectSink resource. * * @param {string} projectSinkName * A fully-qualified path representing project_sink resource. * @returns {string} A string representing the project. */ matchProjectFromProjectSinkName(projectSinkName) { return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) .project; } /** * Parse the sink from ProjectSink resource. * * @param {string} projectSinkName * A fully-qualified path representing project_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromProjectSinkName(projectSinkName) { return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) .sink; } /** * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. * @returns {Promise} A promise that resolves when the client is closed. */ close() { this.initialize(); if (!this._terminated) { return this.loggingServiceV2Stub.then(stub => { this._terminated = true; stub.close(); }); } return Promise.resolve(); } } exports.LoggingServiceV2Client = LoggingServiceV2Client; //# sourceMappingURL=logging_service_v2_client.js.map /***/ }), /***/ 47516: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MetricsServiceV2Client = void 0; /* global window */ const gax = __webpack_require__(12263); const jsonProtos = __webpack_require__(54479); /** * Client JSON configuration object, loaded from * `src/v2/metrics_service_v2_client_config.json`. * This file defines retry strategy and timeouts for all API methods in this library. */ const gapicConfig = __webpack_require__(95739); const version = __webpack_require__(87989)/* .version */ .i8; /** * Service for configuring logs-based metrics. * @class * @memberof v2 */ class MetricsServiceV2Client { /** * Construct an instance of MetricsServiceV2Client. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` * if you need to override this behavior. */ constructor(opts) { var _a, _b; this._terminated = false; this.descriptors = { page: {}, stream: {}, longrunning: {}, batching: {}, }; // Ensure that options include all the required fields. const staticMembers = this.constructor; const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; } // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. this._opts = opts; // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; // Set defaultServicePath on the auth object. this.auth.defaultServicePath = staticMembers.servicePath; // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } else if (opts.fallback === 'rest') { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { billingAccountCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/cmekSettings'), billingAccountExclusionPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/exclusions/{exclusion}'), billingAccountLocationBucketPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}'), billingAccountLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}'), billingAccountLogPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/logs/{log}'), billingAccountSinkPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/sinks/{sink}'), folderCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/cmekSettings'), folderExclusionPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/exclusions/{exclusion}'), folderLocationBucketPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}'), folderLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}'), folderLogPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/logs/{log}'), folderSinkPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/sinks/{sink}'), logMetricPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/metrics/{metric}'), organizationCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/cmekSettings'), organizationExclusionPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/exclusions/{exclusion}'), organizationLocationBucketPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}'), organizationLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}'), organizationLogPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/logs/{log}'), organizationSinkPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/sinks/{sink}'), projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'), projectCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/cmekSettings'), projectExclusionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/exclusions/{exclusion}'), projectLocationBucketPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}'), projectLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/views/{view}'), projectLogPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/logs/{log}'), projectSinkPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/sinks/{sink}'), }; // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { listLogMetrics: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metrics'), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings('google.logging.v2.MetricsServiceV2', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') }); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. this.warn = gax.warn; } /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize() { // If the client stub promise is already initialized, return immediately. if (this.metricsServiceV2Stub) { return this.metricsServiceV2Stub; } // Put together the "service stub" for // google.logging.v2.MetricsServiceV2. this.metricsServiceV2Stub = this._gaxGrpc.createStub(this._opts.fallback ? this._protos.lookupService('google.logging.v2.MetricsServiceV2') : // eslint-disable-next-line @typescript-eslint/no-explicit-any this._protos.google.logging.v2.MetricsServiceV2, this._opts, this._providedCustomServicePath); // Iterate over each of the methods that the service provides // and create an API call method for each. const metricsServiceV2StubMethods = [ 'listLogMetrics', 'getLogMetric', 'createLogMetric', 'updateLogMetric', 'deleteLogMetric', ]; for (const methodName of metricsServiceV2StubMethods) { const callPromise = this.metricsServiceV2Stub.then(stub => (...args) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; return func.apply(stub, args); }, (err) => () => { throw err; }); const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor); this.innerApiCalls[methodName] = apiCall; } return this.metricsServiceV2Stub; } /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ static get servicePath() { return 'logging.googleapis.com'; } /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. * @returns {string} The DNS address for this service. */ static get apiEndpoint() { return 'logging.googleapis.com'; } /** * The port for this API service. * @returns {number} The default port for this service. */ static get port() { return 443; } /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/cloud-platform.read-only', 'https://www.googleapis.com/auth/logging.admin', 'https://www.googleapis.com/auth/logging.read', 'https://www.googleapis.com/auth/logging.write', ]; } /** * Return the project ID used by this class. * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId(callback) { if (callback) { this.auth.getProjectId(callback); return; } return this.auth.getProjectId(); } getLogMetric(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ metric_name: request.metricName || '', }); this.initialize(); return this.innerApiCalls.getLogMetric(request, options, callback); } createLogMetric(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.createLogMetric(request, options, callback); } updateLogMetric(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ metric_name: request.metricName || '', }); this.initialize(); return this.innerApiCalls.updateLogMetric(request, options, callback); } deleteLogMetric(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ metric_name: request.metricName || '', }); this.initialize(); return this.innerApiCalls.deleteLogMetric(request, options, callback); } listLogMetrics(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); return this.innerApiCalls.listLogMetrics(request, options, callback); } /** * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project containing the metrics: * * "projects/[PROJECT_ID]" * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [LogMetric]{@link google.logging.v2.LogMetric} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listLogMetricsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ listLogMetricsStream(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listLogMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogMetrics.createStream(this.innerApiCalls.listLogMetrics, request, callSettings); } /** * Equivalent to `listLogMetrics`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the project containing the metrics: * * "projects/[PROJECT_ID]" * @param {string} [request.pageToken] * Optional. If present, then retrieve the next batch of results from the * preceding call to this method. `pageToken` must be the value of * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [LogMetric]{@link google.logging.v2.LogMetric}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. * @example include:samples/generated/v2/metrics_service_v2.list_log_metrics.js * region_tag:logging_v2_generated_MetricsServiceV2_ListLogMetrics_async */ listLogMetricsAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listLogMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listLogMetrics.asyncIterate(this.innerApiCalls['listLogMetrics'], request, callSettings); } // -------------------- // -- Path templates -- // -------------------- /** * Return a fully-qualified billingAccountCmekSettings resource name string. * * @param {string} billing_account * @returns {string} Resource name string. */ billingAccountCmekSettingsPath(billingAccount) { return this.pathTemplates.billingAccountCmekSettingsPathTemplate.render({ billing_account: billingAccount, }); } /** * Parse the billing_account from BillingAccountCmekSettings resource. * * @param {string} billingAccountCmekSettingsName * A fully-qualified path representing billing_account_cmekSettings resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountCmekSettingsName(billingAccountCmekSettingsName) { return this.pathTemplates.billingAccountCmekSettingsPathTemplate.match(billingAccountCmekSettingsName).billing_account; } /** * Return a fully-qualified billingAccountExclusion resource name string. * * @param {string} billing_account * @param {string} exclusion * @returns {string} Resource name string. */ billingAccountExclusionPath(billingAccount, exclusion) { return this.pathTemplates.billingAccountExclusionPathTemplate.render({ billing_account: billingAccount, exclusion: exclusion, }); } /** * Parse the billing_account from BillingAccountExclusion resource. * * @param {string} billingAccountExclusionName * A fully-qualified path representing billing_account_exclusion resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountExclusionName(billingAccountExclusionName) { return this.pathTemplates.billingAccountExclusionPathTemplate.match(billingAccountExclusionName).billing_account; } /** * Parse the exclusion from BillingAccountExclusion resource. * * @param {string} billingAccountExclusionName * A fully-qualified path representing billing_account_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromBillingAccountExclusionName(billingAccountExclusionName) { return this.pathTemplates.billingAccountExclusionPathTemplate.match(billingAccountExclusionName).exclusion; } /** * Return a fully-qualified billingAccountLocationBucket resource name string. * * @param {string} billing_account * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ billingAccountLocationBucketPath(billingAccount, location, bucket) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.render({ billing_account: billingAccount, location: location, bucket: bucket, }); } /** * Parse the billing_account from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).billing_account; } /** * Parse the location from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).location; } /** * Parse the bucket from BillingAccountLocationBucket resource. * * @param {string} billingAccountLocationBucketName * A fully-qualified path representing billing_account_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromBillingAccountLocationBucketName(billingAccountLocationBucketName) { return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).bucket; } /** * Return a fully-qualified billingAccountLocationBucketView resource name string. * * @param {string} billing_account * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ billingAccountLocationBucketViewPath(billingAccount, location, bucket, view) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.render({ billing_account: billingAccount, location: location, bucket: bucket, view: view, }); } /** * Parse the billing_account from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).billing_account; } /** * Parse the location from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).location; } /** * Parse the bucket from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).bucket; } /** * Parse the view from BillingAccountLocationBucketView resource. * * @param {string} billingAccountLocationBucketViewName * A fully-qualified path representing billing_account_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) { return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).view; } /** * Return a fully-qualified billingAccountLog resource name string. * * @param {string} billing_account * @param {string} log * @returns {string} Resource name string. */ billingAccountLogPath(billingAccount, log) { return this.pathTemplates.billingAccountLogPathTemplate.render({ billing_account: billingAccount, log: log, }); } /** * Parse the billing_account from BillingAccountLog resource. * * @param {string} billingAccountLogName * A fully-qualified path representing billing_account_log resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountLogName(billingAccountLogName) { return this.pathTemplates.billingAccountLogPathTemplate.match(billingAccountLogName).billing_account; } /** * Parse the log from BillingAccountLog resource. * * @param {string} billingAccountLogName * A fully-qualified path representing billing_account_log resource. * @returns {string} A string representing the log. */ matchLogFromBillingAccountLogName(billingAccountLogName) { return this.pathTemplates.billingAccountLogPathTemplate.match(billingAccountLogName).log; } /** * Return a fully-qualified billingAccountSink resource name string. * * @param {string} billing_account * @param {string} sink * @returns {string} Resource name string. */ billingAccountSinkPath(billingAccount, sink) { return this.pathTemplates.billingAccountSinkPathTemplate.render({ billing_account: billingAccount, sink: sink, }); } /** * Parse the billing_account from BillingAccountSink resource. * * @param {string} billingAccountSinkName * A fully-qualified path representing billing_account_sink resource. * @returns {string} A string representing the billing_account. */ matchBillingAccountFromBillingAccountSinkName(billingAccountSinkName) { return this.pathTemplates.billingAccountSinkPathTemplate.match(billingAccountSinkName).billing_account; } /** * Parse the sink from BillingAccountSink resource. * * @param {string} billingAccountSinkName * A fully-qualified path representing billing_account_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromBillingAccountSinkName(billingAccountSinkName) { return this.pathTemplates.billingAccountSinkPathTemplate.match(billingAccountSinkName).sink; } /** * Return a fully-qualified folderCmekSettings resource name string. * * @param {string} folder * @returns {string} Resource name string. */ folderCmekSettingsPath(folder) { return this.pathTemplates.folderCmekSettingsPathTemplate.render({ folder: folder, }); } /** * Parse the folder from FolderCmekSettings resource. * * @param {string} folderCmekSettingsName * A fully-qualified path representing folder_cmekSettings resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderCmekSettingsName(folderCmekSettingsName) { return this.pathTemplates.folderCmekSettingsPathTemplate.match(folderCmekSettingsName).folder; } /** * Return a fully-qualified folderExclusion resource name string. * * @param {string} folder * @param {string} exclusion * @returns {string} Resource name string. */ folderExclusionPath(folder, exclusion) { return this.pathTemplates.folderExclusionPathTemplate.render({ folder: folder, exclusion: exclusion, }); } /** * Parse the folder from FolderExclusion resource. * * @param {string} folderExclusionName * A fully-qualified path representing folder_exclusion resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderExclusionName(folderExclusionName) { return this.pathTemplates.folderExclusionPathTemplate.match(folderExclusionName).folder; } /** * Parse the exclusion from FolderExclusion resource. * * @param {string} folderExclusionName * A fully-qualified path representing folder_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromFolderExclusionName(folderExclusionName) { return this.pathTemplates.folderExclusionPathTemplate.match(folderExclusionName).exclusion; } /** * Return a fully-qualified folderLocationBucket resource name string. * * @param {string} folder * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ folderLocationBucketPath(folder, location, bucket) { return this.pathTemplates.folderLocationBucketPathTemplate.render({ folder: folder, location: location, bucket: bucket, }); } /** * Parse the folder from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).folder; } /** * Parse the location from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).location; } /** * Parse the bucket from FolderLocationBucket resource. * * @param {string} folderLocationBucketName * A fully-qualified path representing folder_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromFolderLocationBucketName(folderLocationBucketName) { return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).bucket; } /** * Return a fully-qualified folderLocationBucketView resource name string. * * @param {string} folder * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ folderLocationBucketViewPath(folder, location, bucket, view) { return this.pathTemplates.folderLocationBucketViewPathTemplate.render({ folder: folder, location: location, bucket: bucket, view: view, }); } /** * Parse the folder from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).folder; } /** * Parse the location from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).location; } /** * Parse the bucket from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).bucket; } /** * Parse the view from FolderLocationBucketView resource. * * @param {string} folderLocationBucketViewName * A fully-qualified path representing folder_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromFolderLocationBucketViewName(folderLocationBucketViewName) { return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).view; } /** * Return a fully-qualified folderLog resource name string. * * @param {string} folder * @param {string} log * @returns {string} Resource name string. */ folderLogPath(folder, log) { return this.pathTemplates.folderLogPathTemplate.render({ folder: folder, log: log, }); } /** * Parse the folder from FolderLog resource. * * @param {string} folderLogName * A fully-qualified path representing folder_log resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderLogName(folderLogName) { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).folder; } /** * Parse the log from FolderLog resource. * * @param {string} folderLogName * A fully-qualified path representing folder_log resource. * @returns {string} A string representing the log. */ matchLogFromFolderLogName(folderLogName) { return this.pathTemplates.folderLogPathTemplate.match(folderLogName).log; } /** * Return a fully-qualified folderSink resource name string. * * @param {string} folder * @param {string} sink * @returns {string} Resource name string. */ folderSinkPath(folder, sink) { return this.pathTemplates.folderSinkPathTemplate.render({ folder: folder, sink: sink, }); } /** * Parse the folder from FolderSink resource. * * @param {string} folderSinkName * A fully-qualified path representing folder_sink resource. * @returns {string} A string representing the folder. */ matchFolderFromFolderSinkName(folderSinkName) { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName) .folder; } /** * Parse the sink from FolderSink resource. * * @param {string} folderSinkName * A fully-qualified path representing folder_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromFolderSinkName(folderSinkName) { return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; } /** * Return a fully-qualified logMetric resource name string. * * @param {string} project * @param {string} metric * @returns {string} Resource name string. */ logMetricPath(project, metric) { return this.pathTemplates.logMetricPathTemplate.render({ project: project, metric: metric, }); } /** * Parse the project from LogMetric resource. * * @param {string} logMetricName * A fully-qualified path representing LogMetric resource. * @returns {string} A string representing the project. */ matchProjectFromLogMetricName(logMetricName) { return this.pathTemplates.logMetricPathTemplate.match(logMetricName) .project; } /** * Parse the metric from LogMetric resource. * * @param {string} logMetricName * A fully-qualified path representing LogMetric resource. * @returns {string} A string representing the metric. */ matchMetricFromLogMetricName(logMetricName) { return this.pathTemplates.logMetricPathTemplate.match(logMetricName).metric; } /** * Return a fully-qualified organizationCmekSettings resource name string. * * @param {string} organization * @returns {string} Resource name string. */ organizationCmekSettingsPath(organization) { return this.pathTemplates.organizationCmekSettingsPathTemplate.render({ organization: organization, }); } /** * Parse the organization from OrganizationCmekSettings resource. * * @param {string} organizationCmekSettingsName * A fully-qualified path representing organization_cmekSettings resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationCmekSettingsName(organizationCmekSettingsName) { return this.pathTemplates.organizationCmekSettingsPathTemplate.match(organizationCmekSettingsName).organization; } /** * Return a fully-qualified organizationExclusion resource name string. * * @param {string} organization * @param {string} exclusion * @returns {string} Resource name string. */ organizationExclusionPath(organization, exclusion) { return this.pathTemplates.organizationExclusionPathTemplate.render({ organization: organization, exclusion: exclusion, }); } /** * Parse the organization from OrganizationExclusion resource. * * @param {string} organizationExclusionName * A fully-qualified path representing organization_exclusion resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationExclusionName(organizationExclusionName) { return this.pathTemplates.organizationExclusionPathTemplate.match(organizationExclusionName).organization; } /** * Parse the exclusion from OrganizationExclusion resource. * * @param {string} organizationExclusionName * A fully-qualified path representing organization_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromOrganizationExclusionName(organizationExclusionName) { return this.pathTemplates.organizationExclusionPathTemplate.match(organizationExclusionName).exclusion; } /** * Return a fully-qualified organizationLocationBucket resource name string. * * @param {string} organization * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ organizationLocationBucketPath(organization, location, bucket) { return this.pathTemplates.organizationLocationBucketPathTemplate.render({ organization: organization, location: location, bucket: bucket, }); } /** * Parse the organization from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).organization; } /** * Parse the location from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).location; } /** * Parse the bucket from OrganizationLocationBucket resource. * * @param {string} organizationLocationBucketName * A fully-qualified path representing organization_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromOrganizationLocationBucketName(organizationLocationBucketName) { return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).bucket; } /** * Return a fully-qualified organizationLocationBucketView resource name string. * * @param {string} organization * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ organizationLocationBucketViewPath(organization, location, bucket, view) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.render({ organization: organization, location: location, bucket: bucket, view: view, }); } /** * Parse the organization from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).organization; } /** * Parse the location from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).location; } /** * Parse the bucket from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).bucket; } /** * Parse the view from OrganizationLocationBucketView resource. * * @param {string} organizationLocationBucketViewName * A fully-qualified path representing organization_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) { return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).view; } /** * Return a fully-qualified organizationLog resource name string. * * @param {string} organization * @param {string} log * @returns {string} Resource name string. */ organizationLogPath(organization, log) { return this.pathTemplates.organizationLogPathTemplate.render({ organization: organization, log: log, }); } /** * Parse the organization from OrganizationLog resource. * * @param {string} organizationLogName * A fully-qualified path representing organization_log resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationLogName(organizationLogName) { return this.pathTemplates.organizationLogPathTemplate.match(organizationLogName).organization; } /** * Parse the log from OrganizationLog resource. * * @param {string} organizationLogName * A fully-qualified path representing organization_log resource. * @returns {string} A string representing the log. */ matchLogFromOrganizationLogName(organizationLogName) { return this.pathTemplates.organizationLogPathTemplate.match(organizationLogName).log; } /** * Return a fully-qualified organizationSink resource name string. * * @param {string} organization * @param {string} sink * @returns {string} Resource name string. */ organizationSinkPath(organization, sink) { return this.pathTemplates.organizationSinkPathTemplate.render({ organization: organization, sink: sink, }); } /** * Parse the organization from OrganizationSink resource. * * @param {string} organizationSinkName * A fully-qualified path representing organization_sink resource. * @returns {string} A string representing the organization. */ matchOrganizationFromOrganizationSinkName(organizationSinkName) { return this.pathTemplates.organizationSinkPathTemplate.match(organizationSinkName).organization; } /** * Parse the sink from OrganizationSink resource. * * @param {string} organizationSinkName * A fully-qualified path representing organization_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromOrganizationSinkName(organizationSinkName) { return this.pathTemplates.organizationSinkPathTemplate.match(organizationSinkName).sink; } /** * Return a fully-qualified project resource name string. * * @param {string} project * @returns {string} Resource name string. */ projectPath(project) { return this.pathTemplates.projectPathTemplate.render({ project: project, }); } /** * Parse the project from Project resource. * * @param {string} projectName * A fully-qualified path representing Project resource. * @returns {string} A string representing the project. */ matchProjectFromProjectName(projectName) { return this.pathTemplates.projectPathTemplate.match(projectName).project; } /** * Return a fully-qualified projectCmekSettings resource name string. * * @param {string} project * @returns {string} Resource name string. */ projectCmekSettingsPath(project) { return this.pathTemplates.projectCmekSettingsPathTemplate.render({ project: project, }); } /** * Parse the project from ProjectCmekSettings resource. * * @param {string} projectCmekSettingsName * A fully-qualified path representing project_cmekSettings resource. * @returns {string} A string representing the project. */ matchProjectFromProjectCmekSettingsName(projectCmekSettingsName) { return this.pathTemplates.projectCmekSettingsPathTemplate.match(projectCmekSettingsName).project; } /** * Return a fully-qualified projectExclusion resource name string. * * @param {string} project * @param {string} exclusion * @returns {string} Resource name string. */ projectExclusionPath(project, exclusion) { return this.pathTemplates.projectExclusionPathTemplate.render({ project: project, exclusion: exclusion, }); } /** * Parse the project from ProjectExclusion resource. * * @param {string} projectExclusionName * A fully-qualified path representing project_exclusion resource. * @returns {string} A string representing the project. */ matchProjectFromProjectExclusionName(projectExclusionName) { return this.pathTemplates.projectExclusionPathTemplate.match(projectExclusionName).project; } /** * Parse the exclusion from ProjectExclusion resource. * * @param {string} projectExclusionName * A fully-qualified path representing project_exclusion resource. * @returns {string} A string representing the exclusion. */ matchExclusionFromProjectExclusionName(projectExclusionName) { return this.pathTemplates.projectExclusionPathTemplate.match(projectExclusionName).exclusion; } /** * Return a fully-qualified projectLocationBucket resource name string. * * @param {string} project * @param {string} location * @param {string} bucket * @returns {string} Resource name string. */ projectLocationBucketPath(project, location, bucket) { return this.pathTemplates.projectLocationBucketPathTemplate.render({ project: project, location: location, bucket: bucket, }); } /** * Parse the project from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).project; } /** * Parse the location from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the location. */ matchLocationFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).location; } /** * Parse the bucket from ProjectLocationBucket resource. * * @param {string} projectLocationBucketName * A fully-qualified path representing project_location_bucket resource. * @returns {string} A string representing the bucket. */ matchBucketFromProjectLocationBucketName(projectLocationBucketName) { return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).bucket; } /** * Return a fully-qualified projectLocationBucketView resource name string. * * @param {string} project * @param {string} location * @param {string} bucket * @param {string} view * @returns {string} Resource name string. */ projectLocationBucketViewPath(project, location, bucket, view) { return this.pathTemplates.projectLocationBucketViewPathTemplate.render({ project: project, location: location, bucket: bucket, view: view, }); } /** * Parse the project from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).project; } /** * Parse the location from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the location. */ matchLocationFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).location; } /** * Parse the bucket from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the bucket. */ matchBucketFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).bucket; } /** * Parse the view from ProjectLocationBucketView resource. * * @param {string} projectLocationBucketViewName * A fully-qualified path representing project_location_bucket_view resource. * @returns {string} A string representing the view. */ matchViewFromProjectLocationBucketViewName(projectLocationBucketViewName) { return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).view; } /** * Return a fully-qualified projectLog resource name string. * * @param {string} project * @param {string} log * @returns {string} Resource name string. */ projectLogPath(project, log) { return this.pathTemplates.projectLogPathTemplate.render({ project: project, log: log, }); } /** * Parse the project from ProjectLog resource. * * @param {string} projectLogName * A fully-qualified path representing project_log resource. * @returns {string} A string representing the project. */ matchProjectFromProjectLogName(projectLogName) { return this.pathTemplates.projectLogPathTemplate.match(projectLogName) .project; } /** * Parse the log from ProjectLog resource. * * @param {string} projectLogName * A fully-qualified path representing project_log resource. * @returns {string} A string representing the log. */ matchLogFromProjectLogName(projectLogName) { return this.pathTemplates.projectLogPathTemplate.match(projectLogName).log; } /** * Return a fully-qualified projectSink resource name string. * * @param {string} project * @param {string} sink * @returns {string} Resource name string. */ projectSinkPath(project, sink) { return this.pathTemplates.projectSinkPathTemplate.render({ project: project, sink: sink, }); } /** * Parse the project from ProjectSink resource. * * @param {string} projectSinkName * A fully-qualified path representing project_sink resource. * @returns {string} A string representing the project. */ matchProjectFromProjectSinkName(projectSinkName) { return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) .project; } /** * Parse the sink from ProjectSink resource. * * @param {string} projectSinkName * A fully-qualified path representing project_sink resource. * @returns {string} A string representing the sink. */ matchSinkFromProjectSinkName(projectSinkName) { return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) .sink; } /** * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. * @returns {Promise} A promise that resolves when the client is closed. */ close() { this.initialize(); if (!this._terminated) { return this.metricsServiceV2Stub.then(stub => { this._terminated = true; stub.close(); }); } return Promise.resolve(); } } exports.MetricsServiceV2Client = MetricsServiceV2Client; //# sourceMappingURL=metrics_service_v2_client.js.map /***/ }), /***/ 46412: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ResourceStream = exports.paginator = exports.Paginator = void 0; /*! * @module common/paginator */ const arrify = __webpack_require__(61546); const extend = __webpack_require__(38171); const resource_stream_1 = __webpack_require__(72199); Object.defineProperty(exports, "ResourceStream", ({ enumerable: true, get: function () { return resource_stream_1.ResourceStream; } })); /*! Developer Documentation * * paginator is used to auto-paginate `nextQuery` methods as well as * streamifying them. * * Before: * * search.query('done=true', function(err, results, nextQuery) { * search.query(nextQuery, function(err, results, nextQuery) {}); * }); * * After: * * search.query('done=true', function(err, results) {}); * * Methods to extend should be written to accept callbacks and return a * `nextQuery`. */ class Paginator { /** * Cache the original method, then overwrite it on the Class's prototype. * * @param {function} Class - The parent class of the methods to extend. * @param {string|string[]} methodNames - Name(s) of the methods to extend. */ // tslint:disable-next-line:variable-name extend(Class, methodNames) { methodNames = arrify(methodNames); methodNames.forEach(methodName => { const originalMethod = Class.prototype[methodName]; // map the original method to a private member Class.prototype[methodName + '_'] = originalMethod; // overwrite the original to auto-paginate /* eslint-disable @typescript-eslint/no-explicit-any */ Class.prototype[methodName] = function (...args) { const parsedArguments = paginator.parseArguments_(args); return paginator.run_(parsedArguments, originalMethod.bind(this)); }; }); } /** * Wraps paginated API calls in a readable object stream. * * This method simply calls the nextQuery recursively, emitting results to a * stream. The stream ends when `nextQuery` is null. * * `maxResults` will act as a cap for how many results are fetched and emitted * to the stream. * * @param {string} methodName - Name of the method to streamify. * @return {function} - Wrapped function. */ /* eslint-disable @typescript-eslint/no-explicit-any */ streamify(methodName) { return function ( /* eslint-disable @typescript-eslint/no-explicit-any */ ...args) { const parsedArguments = paginator.parseArguments_(args); const originalMethod = this[methodName + '_'] || this[methodName]; return paginator.runAsStream_(parsedArguments, originalMethod.bind(this)); }; } /** * Parse a pseudo-array `arguments` for a query and callback. * * @param {array} args - The original `arguments` pseduo-array that the original * method received. */ /* eslint-disable @typescript-eslint/no-explicit-any */ parseArguments_(args) { let query; let autoPaginate = true; let maxApiCalls = -1; let maxResults = -1; let callback; const firstArgument = args[0]; const lastArgument = args[args.length - 1]; if (typeof firstArgument === 'function') { callback = firstArgument; } else { query = firstArgument; } if (typeof lastArgument === 'function') { callback = lastArgument; } if (typeof query === 'object') { query = extend(true, {}, query); // Check if the user only asked for a certain amount of results. if (query.maxResults && typeof query.maxResults === 'number') { // `maxResults` is used API-wide. maxResults = query.maxResults; } else if (typeof query.pageSize === 'number') { // `pageSize` is Pub/Sub's `maxResults`. maxResults = query.pageSize; } if (query.maxApiCalls && typeof query.maxApiCalls === 'number') { maxApiCalls = query.maxApiCalls; delete query.maxApiCalls; } // maxResults is the user specified limit. if (maxResults !== -1 || query.autoPaginate === false) { autoPaginate = false; } } const parsedArguments = { query: query || {}, autoPaginate, maxApiCalls, maxResults, callback, }; parsedArguments.streamOptions = extend(true, {}, parsedArguments.query); delete parsedArguments.streamOptions.autoPaginate; delete parsedArguments.streamOptions.maxResults; delete parsedArguments.streamOptions.pageSize; return parsedArguments; } /** * This simply checks to see if `autoPaginate` is set or not, if it's true * then we buffer all results, otherwise simply call the original method. * * @param {array} parsedArguments - Parsed arguments from the original method * call. * @param {object=|string=} parsedArguments.query - Query object. This is most * commonly an object, but to make the API more simple, it can also be a * string in some places. * @param {function=} parsedArguments.callback - Callback function. * @param {boolean} parsedArguments.autoPaginate - Auto-pagination enabled. * @param {boolean} parsedArguments.maxApiCalls - Maximum API calls to make. * @param {number} parsedArguments.maxResults - Maximum results to return. * @param {function} originalMethod - The cached method that accepts a callback * and returns `nextQuery` to receive more results. */ run_(parsedArguments, originalMethod) { const query = parsedArguments.query; const callback = parsedArguments.callback; if (!parsedArguments.autoPaginate) { return originalMethod(query, callback); } const results = new Array(); const promise = new Promise((resolve, reject) => { paginator .runAsStream_(parsedArguments, originalMethod) .on('error', reject) .on('data', (data) => results.push(data)) .on('end', () => resolve(results)); }); if (!callback) { return promise.then(results => [results]); } promise.then(results => callback(null, results), (err) => callback(err)); } /** * This method simply calls the nextQuery recursively, emitting results to a * stream. The stream ends when `nextQuery` is null. * * `maxResults` will act as a cap for how many results are fetched and emitted * to the stream. * * @param {object=|string=} parsedArguments.query - Query object. This is most * commonly an object, but to make the API more simple, it can also be a * string in some places. * @param {function=} parsedArguments.callback - Callback function. * @param {boolean} parsedArguments.autoPaginate - Auto-pagination enabled. * @param {boolean} parsedArguments.maxApiCalls - Maximum API calls to make. * @param {number} parsedArguments.maxResults - Maximum results to return. * @param {function} originalMethod - The cached method that accepts a callback * and returns `nextQuery` to receive more results. * @return {stream} - Readable object stream. */ /* eslint-disable @typescript-eslint/no-explicit-any */ runAsStream_(parsedArguments, originalMethod) { return new resource_stream_1.ResourceStream(parsedArguments, originalMethod); } } exports.Paginator = Paginator; const paginator = new Paginator(); exports.paginator = paginator; //# sourceMappingURL=index.js.map /***/ }), /***/ 72199: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright 2019 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ResourceStream = void 0; const stream_1 = __webpack_require__(92413); class ResourceStream extends stream_1.Transform { constructor(args, requestFn) { const options = Object.assign({ objectMode: true }, args.streamOptions); super(options); this._ended = false; this._maxApiCalls = args.maxApiCalls === -1 ? Infinity : args.maxApiCalls; this._nextQuery = args.query; this._reading = false; this._requestFn = requestFn; this._requestsMade = 0; this._resultsToSend = args.maxResults === -1 ? Infinity : args.maxResults; } /* eslint-disable @typescript-eslint/no-explicit-any */ end(...args) { this._ended = true; return super.end(...args); } _read() { if (this._reading) { return; } this._reading = true; // Wrap in a try/catch to catch input linting errors, e.g. // an invalid BigQuery query. These errors are thrown in an // async fashion, which makes them un-catchable by the user. try { this._requestFn(this._nextQuery, (err, results, nextQuery) => { if (err) { this.destroy(err); return; } this._nextQuery = nextQuery; if (this._resultsToSend !== Infinity) { results = results.splice(0, this._resultsToSend); this._resultsToSend -= results.length; } let more = true; for (const result of results) { if (this._ended) { break; } more = this.push(result); } const isFinished = !this._nextQuery || this._resultsToSend < 1; const madeMaxCalls = ++this._requestsMade >= this._maxApiCalls; if (isFinished || madeMaxCalls) { this.end(); } if (more && !this._ended) { setImmediate(() => this._read()); } this._reading = false; }); } catch (e) { this.destroy(e); } } } exports.ResourceStream = ResourceStream; //# sourceMappingURL=resource-stream.js.map /***/ }), /***/ 3497: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const stream_1 = __webpack_require__(92413); // Copyright 2014 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * Populate the `{{projectId}}` placeholder. * * @throws {Error} If a projectId is required, but one is not provided. * * @param {*} - Any input value that may contain a placeholder. Arrays and objects will be looped. * @param {string} projectId - A projectId. If not provided * @return {*} - The original argument with all placeholders populated. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function replaceProjectIdToken(value, projectId) { if (Array.isArray(value)) { value = value.map(v => replaceProjectIdToken(v, projectId)); } if (value !== null && typeof value === 'object' && !(value instanceof Buffer) && !(value instanceof stream_1.Stream) && typeof value.hasOwnProperty === 'function') { for (const opt in value) { // eslint-disable-next-line no-prototype-builtins if (value.hasOwnProperty(opt)) { value[opt] = replaceProjectIdToken(value[opt], projectId); } } } if (typeof value === 'string' && value.indexOf('{{projectId}}') > -1) { if (!projectId || projectId === '{{projectId}}') { throw new MissingProjectIdError(); } value = value.replace(/{{projectId}}/g, projectId); } return value; } exports.replaceProjectIdToken = replaceProjectIdToken; /** * Custom error type for missing project ID errors. */ class MissingProjectIdError extends Error { constructor() { super(...arguments); this.message = `Sorry, we cannot connect to Cloud Services without a project ID. You may specify one with an environment variable named "GOOGLE_CLOUD_PROJECT".`.replace(/ +/g, ' '); } } exports.MissingProjectIdError = MissingProjectIdError; //# sourceMappingURL=index.js.map /***/ }), /***/ 19203: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* eslint-disable prefer-rest-params */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.callbackifyAll = exports.callbackify = exports.promisifyAll = exports.promisify = void 0; /** * Wraps a callback style function to conditionally return a promise. * * @param {function} originalMethod - The method to promisify. * @param {object=} options - Promise options. * @param {boolean} options.singular - Resolve the promise with single arg instead of an array. * @return {function} wrapped */ function promisify(originalMethod, options) { if (originalMethod.promisified_) { return originalMethod; } options = options || {}; const slice = Array.prototype.slice; // tslint:disable-next-line:no-any const wrapper = function () { let last; for (last = arguments.length - 1; last >= 0; last--) { const arg = arguments[last]; if (typeof arg === 'undefined') { continue; // skip trailing undefined. } if (typeof arg !== 'function') { break; // non-callback last argument found. } return originalMethod.apply(this, arguments); } // peel trailing undefined. const args = slice.call(arguments, 0, last + 1); // tslint:disable-next-line:variable-name let PromiseCtor = Promise; // Because dedupe will likely create a single install of // @google-cloud/common to be shared amongst all modules, we need to // localize it at the Service level. if (this && this.Promise) { PromiseCtor = this.Promise; } return new PromiseCtor((resolve, reject) => { // tslint:disable-next-line:no-any args.push((...args) => { const callbackArgs = slice.call(args); const err = callbackArgs.shift(); if (err) { return reject(err); } if (options.singular && callbackArgs.length === 1) { resolve(callbackArgs[0]); } else { resolve(callbackArgs); } }); originalMethod.apply(this, args); }); }; wrapper.promisified_ = true; return wrapper; } exports.promisify = promisify; /** * Promisifies certain Class methods. This will not promisify private or * streaming methods. * * @param {module:common/service} Class - Service class. * @param {object=} options - Configuration object. */ // tslint:disable-next-line:variable-name function promisifyAll(Class, options) { const exclude = (options && options.exclude) || []; const ownPropertyNames = Object.getOwnPropertyNames(Class.prototype); const methods = ownPropertyNames.filter(methodName => { // clang-format off return (!exclude.includes(methodName) && typeof Class.prototype[methodName] === 'function' && // is it a function? !/(^_|(Stream|_)|promise$)|^constructor$/.test(methodName) // is it promisable? ); // clang-format on }); methods.forEach(methodName => { const originalMethod = Class.prototype[methodName]; if (!originalMethod.promisified_) { Class.prototype[methodName] = exports.promisify(originalMethod, options); } }); } exports.promisifyAll = promisifyAll; /** * Wraps a promisy type function to conditionally call a callback function. * * @param {function} originalMethod - The method to callbackify. * @param {object=} options - Callback options. * @param {boolean} options.singular - Pass to the callback a single arg instead of an array. * @return {function} wrapped */ function callbackify(originalMethod) { if (originalMethod.callbackified_) { return originalMethod; } // tslint:disable-next-line:no-any const wrapper = function () { if (typeof arguments[arguments.length - 1] !== 'function') { return originalMethod.apply(this, arguments); } const cb = Array.prototype.pop.call(arguments); originalMethod.apply(this, arguments).then( // tslint:disable-next-line:no-any (res) => { res = Array.isArray(res) ? res : [res]; cb(null, ...res); }, (err) => cb(err)); }; wrapper.callbackified_ = true; return wrapper; } exports.callbackify = callbackify; /** * Callbackifies certain Class methods. This will not callbackify private or * streaming methods. * * @param {module:common/service} Class - Service class. * @param {object=} options - Configuration object. */ function callbackifyAll( // tslint:disable-next-line:variable-name Class, options) { const exclude = (options && options.exclude) || []; const ownPropertyNames = Object.getOwnPropertyNames(Class.prototype); const methods = ownPropertyNames.filter(methodName => { // clang-format off return (!exclude.includes(methodName) && typeof Class.prototype[methodName] === 'function' && // is it a function? !/^_|(Stream|_)|^constructor$/.test(methodName) // is it callbackifyable? ); // clang-format on }); methods.forEach(methodName => { const originalMethod = Class.prototype[methodName]; if (!originalMethod.callbackified_) { Class.prototype[methodName] = exports.callbackify(originalMethod); } }); } exports.callbackifyAll = callbackifyAll; //# sourceMappingURL=index.js.map /***/ }), /***/ 8258: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addAdminServicesToServer = exports.registerAdminService = void 0; const registeredAdminServices = []; function registerAdminService(getServiceDefinition, getHandlers) { registeredAdminServices.push({ getServiceDefinition, getHandlers }); } exports.registerAdminService = registerAdminService; function addAdminServicesToServer(server) { for (const { getServiceDefinition, getHandlers } of registeredAdminServices) { server.addService(getServiceDefinition(), getHandlers()); } } exports.addAdminServicesToServer = addAdminServicesToServer; //# sourceMappingURL=admin.js.map /***/ }), /***/ 34186: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BackoffTimeout = void 0; const INITIAL_BACKOFF_MS = 1000; const BACKOFF_MULTIPLIER = 1.6; const MAX_BACKOFF_MS = 120000; const BACKOFF_JITTER = 0.2; /** * Get a number uniformly at random in the range [min, max) * @param min * @param max */ function uniformRandom(min, max) { return Math.random() * (max - min) + min; } class BackoffTimeout { constructor(callback, options) { this.callback = callback; this.initialDelay = INITIAL_BACKOFF_MS; this.multiplier = BACKOFF_MULTIPLIER; this.maxDelay = MAX_BACKOFF_MS; this.jitter = BACKOFF_JITTER; this.running = false; this.hasRef = true; if (options) { if (options.initialDelay) { this.initialDelay = options.initialDelay; } if (options.multiplier) { this.multiplier = options.multiplier; } if (options.jitter) { this.jitter = options.jitter; } if (options.maxDelay) { this.maxDelay = options.maxDelay; } } this.nextDelay = this.initialDelay; this.timerId = setTimeout(() => { }, 0); clearTimeout(this.timerId); } /** * Call the callback after the current amount of delay time */ runOnce() { var _a, _b; this.running = true; this.timerId = setTimeout(() => { this.callback(); this.running = false; }, this.nextDelay); if (!this.hasRef) { (_b = (_a = this.timerId).unref) === null || _b === void 0 ? void 0 : _b.call(_a); } const nextBackoff = Math.min(this.nextDelay * this.multiplier, this.maxDelay); const jitterMagnitude = nextBackoff * this.jitter; this.nextDelay = nextBackoff + uniformRandom(-jitterMagnitude, jitterMagnitude); } /** * Stop the timer. The callback will not be called until `runOnce` is called * again. */ stop() { clearTimeout(this.timerId); this.running = false; } /** * Reset the delay time to its initial value. */ reset() { this.nextDelay = this.initialDelay; } isRunning() { return this.running; } ref() { var _a, _b; this.hasRef = true; (_b = (_a = this.timerId).ref) === null || _b === void 0 ? void 0 : _b.call(_a); } unref() { var _a, _b; this.hasRef = false; (_b = (_a = this.timerId).unref) === null || _b === void 0 ? void 0 : _b.call(_a); } } exports.BackoffTimeout = BackoffTimeout; //# sourceMappingURL=backoff-timeout.js.map /***/ }), /***/ 86380: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CallCredentialsFilterFactory = exports.CallCredentialsFilter = void 0; const filter_1 = __webpack_require__(43392); const constants_1 = __webpack_require__(90634); const uri_parser_1 = __webpack_require__(65974); class CallCredentialsFilter extends filter_1.BaseFilter { constructor(channel, stream) { var _a, _b; super(); this.channel = channel; this.stream = stream; this.channel = channel; this.stream = stream; const splitPath = stream.getMethod().split('/'); let serviceName = ''; /* The standard path format is "/{serviceName}/{methodName}", so if we split * by '/', the first item should be empty and the second should be the * service name */ if (splitPath.length >= 2) { serviceName = splitPath[1]; } const hostname = (_b = (_a = uri_parser_1.splitHostPort(stream.getHost())) === null || _a === void 0 ? void 0 : _a.host) !== null && _b !== void 0 ? _b : 'localhost'; /* Currently, call credentials are only allowed on HTTPS connections, so we * can assume that the scheme is "https" */ this.serviceUrl = `https://${hostname}/${serviceName}`; } async sendMetadata(metadata) { const credentials = this.stream.getCredentials(); const credsMetadata = credentials.generateMetadata({ service_url: this.serviceUrl, }); const resultMetadata = await metadata; try { resultMetadata.merge(await credsMetadata); } catch (error) { this.stream.cancelWithStatus(constants_1.Status.UNAUTHENTICATED, `Failed to retrieve auth metadata with error: ${error.message}`); return Promise.reject('Failed to retrieve auth metadata'); } if (resultMetadata.get('authorization').length > 1) { this.stream.cancelWithStatus(constants_1.Status.INTERNAL, '"authorization" metadata cannot have multiple values'); return Promise.reject('"authorization" metadata cannot have multiple values'); } return resultMetadata; } } exports.CallCredentialsFilter = CallCredentialsFilter; class CallCredentialsFilterFactory { constructor(channel) { this.channel = channel; this.channel = channel; } createFilter(callStream) { return new CallCredentialsFilter(this.channel, callStream); } } exports.CallCredentialsFilterFactory = CallCredentialsFilterFactory; //# sourceMappingURL=call-credentials-filter.js.map /***/ }), /***/ 21426: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CallCredentials = void 0; const metadata_1 = __webpack_require__(83665); function isCurrentOauth2Client(client) { return ('getRequestHeaders' in client && typeof client.getRequestHeaders === 'function'); } /** * A class that represents a generic method of adding authentication-related * metadata on a per-request basis. */ class CallCredentials { /** * Creates a new CallCredentials object from a given function that generates * Metadata objects. * @param metadataGenerator A function that accepts a set of options, and * generates a Metadata object based on these options, which is passed back * to the caller via a supplied (err, metadata) callback. */ static createFromMetadataGenerator(metadataGenerator) { return new SingleCallCredentials(metadataGenerator); } /** * Create a gRPC credential from a Google credential object. * @param googleCredentials The authentication client to use. * @return The resulting CallCredentials object. */ static createFromGoogleCredential(googleCredentials) { return CallCredentials.createFromMetadataGenerator((options, callback) => { let getHeaders; if (isCurrentOauth2Client(googleCredentials)) { getHeaders = googleCredentials.getRequestHeaders(options.service_url); } else { getHeaders = new Promise((resolve, reject) => { googleCredentials.getRequestMetadata(options.service_url, (err, headers) => { if (err) { reject(err); return; } resolve(headers); }); }); } getHeaders.then((headers) => { const metadata = new metadata_1.Metadata(); for (const key of Object.keys(headers)) { metadata.add(key, headers[key]); } callback(null, metadata); }, (err) => { callback(err); }); }); } static createEmpty() { return new EmptyCallCredentials(); } } exports.CallCredentials = CallCredentials; class ComposedCallCredentials extends CallCredentials { constructor(creds) { super(); this.creds = creds; } async generateMetadata(options) { const base = new metadata_1.Metadata(); const generated = await Promise.all(this.creds.map((cred) => cred.generateMetadata(options))); for (const gen of generated) { base.merge(gen); } return base; } compose(other) { return new ComposedCallCredentials(this.creds.concat([other])); } _equals(other) { if (this === other) { return true; } if (other instanceof ComposedCallCredentials) { return this.creds.every((value, index) => value._equals(other.creds[index])); } else { return false; } } } class SingleCallCredentials extends CallCredentials { constructor(metadataGenerator) { super(); this.metadataGenerator = metadataGenerator; } generateMetadata(options) { return new Promise((resolve, reject) => { this.metadataGenerator(options, (err, metadata) => { if (metadata !== undefined) { resolve(metadata); } else { reject(err); } }); }); } compose(other) { return new ComposedCallCredentials([this, other]); } _equals(other) { if (this === other) { return true; } if (other instanceof SingleCallCredentials) { return this.metadataGenerator === other.metadataGenerator; } else { return false; } } } class EmptyCallCredentials extends CallCredentials { generateMetadata(options) { return Promise.resolve(new metadata_1.Metadata()); } compose(other) { return other; } _equals(other) { return other instanceof EmptyCallCredentials; } } //# sourceMappingURL=call-credentials.js.map /***/ }), /***/ 78988: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Http2CallStream = exports.InterceptingListenerImpl = exports.isInterceptingListener = void 0; const http2 = __webpack_require__(97565); const os = __webpack_require__(12087); const constants_1 = __webpack_require__(90634); const metadata_1 = __webpack_require__(83665); const stream_decoder_1 = __webpack_require__(16575); const logging = __webpack_require__(35993); const constants_2 = __webpack_require__(90634); const TRACER_NAME = 'call_stream'; const { HTTP2_HEADER_STATUS, HTTP2_HEADER_CONTENT_TYPE, NGHTTP2_CANCEL, } = http2.constants; /** * Should do approximately the same thing as util.getSystemErrorName but the * TypeScript types don't have that function for some reason so I just made my * own. * @param errno */ function getSystemErrorName(errno) { for (const [name, num] of Object.entries(os.constants.errno)) { if (num === errno) { return name; } } return 'Unknown system error ' + errno; } function getMinDeadline(deadlineList) { let minValue = Infinity; for (const deadline of deadlineList) { const deadlineMsecs = deadline instanceof Date ? deadline.getTime() : deadline; if (deadlineMsecs < minValue) { minValue = deadlineMsecs; } } return minValue; } function isInterceptingListener(listener) { return (listener.onReceiveMetadata !== undefined && listener.onReceiveMetadata.length === 1); } exports.isInterceptingListener = isInterceptingListener; class InterceptingListenerImpl { constructor(listener, nextListener) { this.listener = listener; this.nextListener = nextListener; this.processingMetadata = false; this.hasPendingMessage = false; this.processingMessage = false; this.pendingStatus = null; } processPendingMessage() { if (this.hasPendingMessage) { this.nextListener.onReceiveMessage(this.pendingMessage); this.pendingMessage = null; this.hasPendingMessage = false; } } processPendingStatus() { if (this.pendingStatus) { this.nextListener.onReceiveStatus(this.pendingStatus); } } onReceiveMetadata(metadata) { this.processingMetadata = true; this.listener.onReceiveMetadata(metadata, (metadata) => { this.processingMetadata = false; this.nextListener.onReceiveMetadata(metadata); this.processPendingMessage(); this.processPendingStatus(); }); } // eslint-disable-next-line @typescript-eslint/no-explicit-any onReceiveMessage(message) { /* If this listener processes messages asynchronously, the last message may * be reordered with respect to the status */ this.processingMessage = true; this.listener.onReceiveMessage(message, (msg) => { this.processingMessage = false; if (this.processingMetadata) { this.pendingMessage = msg; this.hasPendingMessage = true; } else { this.nextListener.onReceiveMessage(msg); this.processPendingStatus(); } }); } onReceiveStatus(status) { this.listener.onReceiveStatus(status, (processedStatus) => { if (this.processingMetadata || this.processingMessage) { this.pendingStatus = processedStatus; } else { this.nextListener.onReceiveStatus(processedStatus); } }); } } exports.InterceptingListenerImpl = InterceptingListenerImpl; class Http2CallStream { constructor(methodName, channel, options, filterStackFactory, channelCallCredentials, callNumber) { this.methodName = methodName; this.channel = channel; this.options = options; this.channelCallCredentials = channelCallCredentials; this.callNumber = callNumber; this.http2Stream = null; this.pendingRead = false; this.isWriteFilterPending = false; this.pendingWrite = null; this.pendingWriteCallback = null; this.writesClosed = false; this.decoder = new stream_decoder_1.StreamDecoder(); this.isReadFilterPending = false; this.canPush = false; /** * Indicates that an 'end' event has come from the http2 stream, so there * will be no more data events. */ this.readsClosed = false; this.statusOutput = false; this.unpushedReadMessages = []; this.unfilteredReadMessages = []; // Status code mapped from :status. To be used if grpc-status is not received this.mappedStatusCode = constants_1.Status.UNKNOWN; // This is populated (non-null) if and only if the call has ended this.finalStatus = null; this.subchannel = null; this.listener = null; this.internalError = null; this.configDeadline = Infinity; this.statusWatchers = []; this.streamEndWatchers = []; this.callStatsTracker = null; this.filterStack = filterStackFactory.createFilter(this); this.credentials = channelCallCredentials; this.disconnectListener = () => { this.endCall({ code: constants_1.Status.UNAVAILABLE, details: 'Connection dropped', metadata: new metadata_1.Metadata(), }); }; if (this.options.parentCall && this.options.flags & constants_1.Propagate.CANCELLATION) { this.options.parentCall.on('cancelled', () => { this.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled by parent call'); }); } } outputStatus() { /* Precondition: this.finalStatus !== null */ if (this.listener && !this.statusOutput) { this.statusOutput = true; const filteredStatus = this.filterStack.receiveTrailers(this.finalStatus); this.statusWatchers.forEach(watcher => watcher(filteredStatus)); /* We delay the actual action of bubbling up the status to insulate the * cleanup code in this class from any errors that may be thrown in the * upper layers as a result of bubbling up the status. In particular, * if the status is not OK, the "error" event may be emitted * synchronously at the top level, which will result in a thrown error if * the user does not handle that event. */ process.nextTick(() => { var _a; (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveStatus(filteredStatus); }); if (this.subchannel) { this.subchannel.callUnref(); this.subchannel.removeDisconnectListener(this.disconnectListener); } } } trace(text) { logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, '[' + this.callNumber + '] ' + text); } /** * On first call, emits a 'status' event with the given StatusObject. * Subsequent calls are no-ops. * @param status The status of the call. */ endCall(status) { /* If the status is OK and a new status comes in (e.g. from a * deserialization failure), that new status takes priority */ if (this.finalStatus === null || this.finalStatus.code === constants_1.Status.OK) { this.trace('ended with status: code=' + status.code + ' details="' + status.details + '"'); this.finalStatus = status; this.maybeOutputStatus(); } this.destroyHttp2Stream(); } maybeOutputStatus() { if (this.finalStatus !== null) { /* The combination check of readsClosed and that the two message buffer * arrays are empty checks that there all incoming data has been fully * processed */ if (this.finalStatus.code !== constants_1.Status.OK || (this.readsClosed && this.unpushedReadMessages.length === 0 && this.unfilteredReadMessages.length === 0 && !this.isReadFilterPending)) { this.outputStatus(); } } } push(message) { this.trace('pushing to reader message of length ' + (message instanceof Buffer ? message.length : null)); this.canPush = false; process.nextTick(() => { var _a; /* If we have already output the status any later messages should be * ignored, and can cause out-of-order operation errors higher up in the * stack. Checking as late as possible here to avoid any race conditions. */ if (this.statusOutput) { return; } (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveMessage(message); this.maybeOutputStatus(); }); } handleFilterError(error) { this.cancelWithStatus(constants_1.Status.INTERNAL, error.message); } handleFilteredRead(message) { /* If we the call has already ended with an error, we don't want to do * anything with this message. Dropping it on the floor is correct * behavior */ if (this.finalStatus !== null && this.finalStatus.code !== constants_1.Status.OK) { this.maybeOutputStatus(); return; } this.isReadFilterPending = false; if (this.canPush) { this.http2Stream.pause(); this.push(message); } else { this.trace('unpushedReadMessages.push message of length ' + message.length); this.unpushedReadMessages.push(message); } if (this.unfilteredReadMessages.length > 0) { /* nextMessage is guaranteed not to be undefined because unfilteredReadMessages is non-empty */ const nextMessage = this.unfilteredReadMessages.shift(); this.filterReceivedMessage(nextMessage); } } filterReceivedMessage(framedMessage) { /* If we the call has already ended with an error, we don't want to do * anything with this message. Dropping it on the floor is correct * behavior */ if (this.finalStatus !== null && this.finalStatus.code !== constants_1.Status.OK) { this.maybeOutputStatus(); return; } this.trace('filterReceivedMessage of length ' + framedMessage.length); this.isReadFilterPending = true; this.filterStack .receiveMessage(Promise.resolve(framedMessage)) .then(this.handleFilteredRead.bind(this), this.handleFilterError.bind(this)); } tryPush(messageBytes) { if (this.isReadFilterPending) { this.trace('unfilteredReadMessages.push message of length ' + (messageBytes && messageBytes.length)); this.unfilteredReadMessages.push(messageBytes); } else { this.filterReceivedMessage(messageBytes); } } handleTrailers(headers) { this.streamEndWatchers.forEach(watcher => watcher(true)); let headersString = ''; for (const header of Object.keys(headers)) { headersString += '\t\t' + header + ': ' + headers[header] + '\n'; } this.trace('Received server trailers:\n' + headersString); let metadata; try { metadata = metadata_1.Metadata.fromHttp2Headers(headers); } catch (e) { metadata = new metadata_1.Metadata(); } const metadataMap = metadata.getMap(); let code = this.mappedStatusCode; if (code === constants_1.Status.UNKNOWN && typeof metadataMap['grpc-status'] === 'string') { const receivedStatus = Number(metadataMap['grpc-status']); if (receivedStatus in constants_1.Status) { code = receivedStatus; this.trace('received status code ' + receivedStatus + ' from server'); } metadata.remove('grpc-status'); } let details = ''; if (typeof metadataMap['grpc-message'] === 'string') { details = decodeURI(metadataMap['grpc-message']); metadata.remove('grpc-message'); this.trace('received status details string "' + details + '" from server'); } const status = { code, details, metadata }; // This is a no-op if the call was already ended when handling headers. this.endCall(status); } writeMessageToStream(message, callback) { var _a; (_a = this.callStatsTracker) === null || _a === void 0 ? void 0 : _a.addMessageSent(); this.http2Stream.write(message, callback); } attachHttp2Stream(stream, subchannel, extraFilters, callStatsTracker) { this.filterStack.push(extraFilters); if (this.finalStatus !== null) { stream.close(NGHTTP2_CANCEL); } else { this.trace('attachHttp2Stream from subchannel ' + subchannel.getAddress()); this.http2Stream = stream; this.subchannel = subchannel; this.callStatsTracker = callStatsTracker; subchannel.addDisconnectListener(this.disconnectListener); subchannel.callRef(); stream.on('response', (headers, flags) => { var _a; let headersString = ''; for (const header of Object.keys(headers)) { headersString += '\t\t' + header + ': ' + headers[header] + '\n'; } this.trace('Received server headers:\n' + headersString); switch (headers[':status']) { // TODO(murgatroid99): handle 100 and 101 case 400: this.mappedStatusCode = constants_1.Status.INTERNAL; break; case 401: this.mappedStatusCode = constants_1.Status.UNAUTHENTICATED; break; case 403: this.mappedStatusCode = constants_1.Status.PERMISSION_DENIED; break; case 404: this.mappedStatusCode = constants_1.Status.UNIMPLEMENTED; break; case 429: case 502: case 503: case 504: this.mappedStatusCode = constants_1.Status.UNAVAILABLE; break; default: this.mappedStatusCode = constants_1.Status.UNKNOWN; } if (flags & http2.constants.NGHTTP2_FLAG_END_STREAM) { this.handleTrailers(headers); } else { let metadata; try { metadata = metadata_1.Metadata.fromHttp2Headers(headers); } catch (error) { this.endCall({ code: constants_1.Status.UNKNOWN, details: error.message, metadata: new metadata_1.Metadata(), }); return; } try { const finalMetadata = this.filterStack.receiveMetadata(metadata); (_a = this.listener) === null || _a === void 0 ? void 0 : _a.onReceiveMetadata(finalMetadata); } catch (error) { this.endCall({ code: constants_1.Status.UNKNOWN, details: error.message, metadata: new metadata_1.Metadata(), }); } } }); stream.on('trailers', this.handleTrailers.bind(this)); stream.on('data', (data) => { this.trace('receive HTTP/2 data frame of length ' + data.length); const messages = this.decoder.write(data); for (const message of messages) { this.trace('parsed message of length ' + message.length); this.callStatsTracker.addMessageReceived(); this.tryPush(message); } }); stream.on('end', () => { this.readsClosed = true; this.maybeOutputStatus(); }); stream.on('close', () => { /* Use process.next tick to ensure that this code happens after any * "error" event that may be emitted at about the same time, so that * we can bubble up the error message from that event. */ process.nextTick(() => { var _a; this.trace('HTTP/2 stream closed with code ' + stream.rstCode); /* If we have a final status with an OK status code, that means that * we have received all of the messages and we have processed the * trailers and the call completed successfully, so it doesn't matter * how the stream ends after that */ if (((_a = this.finalStatus) === null || _a === void 0 ? void 0 : _a.code) === constants_1.Status.OK) { return; } let code; let details = ''; switch (stream.rstCode) { case http2.constants.NGHTTP2_NO_ERROR: /* If we get a NO_ERROR code and we already have a status, the * stream completed properly and we just haven't fully processed * it yet */ if (this.finalStatus !== null) { return; } code = constants_1.Status.INTERNAL; details = `Received RST_STREAM with code ${stream.rstCode}`; break; case http2.constants.NGHTTP2_REFUSED_STREAM: code = constants_1.Status.UNAVAILABLE; details = 'Stream refused by server'; break; case http2.constants.NGHTTP2_CANCEL: code = constants_1.Status.CANCELLED; details = 'Call cancelled'; break; case http2.constants.NGHTTP2_ENHANCE_YOUR_CALM: code = constants_1.Status.RESOURCE_EXHAUSTED; details = 'Bandwidth exhausted'; break; case http2.constants.NGHTTP2_INADEQUATE_SECURITY: code = constants_1.Status.PERMISSION_DENIED; details = 'Protocol not secure enough'; break; case http2.constants.NGHTTP2_INTERNAL_ERROR: code = constants_1.Status.INTERNAL; if (this.internalError === null) { /* This error code was previously handled in the default case, and * there are several instances of it online, so I wanted to * preserve the original error message so that people find existing * information in searches, but also include the more recognizable * "Internal server error" message. */ details = `Received RST_STREAM with code ${stream.rstCode} (Internal server error)`; } else { if (this.internalError.code === 'ECONNRESET' || this.internalError.code === 'ETIMEDOUT') { code = constants_1.Status.UNAVAILABLE; details = this.internalError.message; } else { /* The "Received RST_STREAM with code ..." error is preserved * here for continuity with errors reported online, but the * error message at the end will probably be more relevant in * most cases. */ details = `Received RST_STREAM with code ${stream.rstCode} triggered by internal client error: ${this.internalError.message}`; } } break; default: code = constants_1.Status.INTERNAL; details = `Received RST_STREAM with code ${stream.rstCode}`; } // This is a no-op if trailers were received at all. // This is OK, because status codes emitted here correspond to more // catastrophic issues that prevent us from receiving trailers in the // first place. this.endCall({ code, details, metadata: new metadata_1.Metadata() }); }); }); stream.on('error', (err) => { /* We need an error handler here to stop "Uncaught Error" exceptions * from bubbling up. However, errors here should all correspond to * "close" events, where we will handle the error more granularly */ /* Specifically looking for stream errors that were *not* constructed * from a RST_STREAM response here: * https://github.com/nodejs/node/blob/8b8620d580314050175983402dfddf2674e8e22a/lib/internal/http2/core.js#L2267 */ if (err.code !== 'ERR_HTTP2_STREAM_ERROR') { this.trace('Node error event: message=' + err.message + ' code=' + err.code + ' errno=' + getSystemErrorName(err.errno) + ' syscall=' + err.syscall); this.internalError = err; } this.streamEndWatchers.forEach(watcher => watcher(false)); }); if (!this.pendingRead) { stream.pause(); } if (this.pendingWrite) { if (!this.pendingWriteCallback) { throw new Error('Invalid state in write handling code'); } this.trace('sending data chunk of length ' + this.pendingWrite.length + ' (deferred)'); try { this.writeMessageToStream(this.pendingWrite, this.pendingWriteCallback); } catch (error) { this.endCall({ code: constants_1.Status.UNAVAILABLE, details: `Write failed with error ${error.message}`, metadata: new metadata_1.Metadata() }); } } this.maybeCloseWrites(); } } start(metadata, listener) { this.trace('Sending metadata'); this.listener = listener; this.channel._startCallStream(this, metadata); this.maybeOutputStatus(); } destroyHttp2Stream() { var _a; // The http2 stream could already have been destroyed if cancelWithStatus // is called in response to an internal http2 error. if (this.http2Stream !== null && !this.http2Stream.destroyed) { /* If the call has ended with an OK status, communicate that when closing * the stream, partly to avoid a situation in which we detect an error * RST_STREAM as a result after we have the status */ let code; if (((_a = this.finalStatus) === null || _a === void 0 ? void 0 : _a.code) === constants_1.Status.OK) { code = http2.constants.NGHTTP2_NO_ERROR; } else { code = http2.constants.NGHTTP2_CANCEL; } this.trace('close http2 stream with code ' + code); this.http2Stream.close(code); } } cancelWithStatus(status, details) { this.trace('cancelWithStatus code: ' + status + ' details: "' + details + '"'); this.endCall({ code: status, details, metadata: new metadata_1.Metadata() }); } getDeadline() { const deadlineList = [this.options.deadline]; if (this.options.parentCall && this.options.flags & constants_1.Propagate.DEADLINE) { deadlineList.push(this.options.parentCall.getDeadline()); } if (this.configDeadline) { deadlineList.push(this.configDeadline); } return getMinDeadline(deadlineList); } getCredentials() { return this.credentials; } setCredentials(credentials) { this.credentials = this.channelCallCredentials.compose(credentials); } getStatus() { return this.finalStatus; } getPeer() { var _a, _b; return (_b = (_a = this.subchannel) === null || _a === void 0 ? void 0 : _a.getAddress()) !== null && _b !== void 0 ? _b : this.channel.getTarget(); } getMethod() { return this.methodName; } getHost() { return this.options.host; } setConfigDeadline(configDeadline) { this.configDeadline = configDeadline; } addStatusWatcher(watcher) { this.statusWatchers.push(watcher); } addStreamEndWatcher(watcher) { this.streamEndWatchers.push(watcher); } addFilters(extraFilters) { this.filterStack.push(extraFilters); } startRead() { /* If the stream has ended with an error, we should not emit any more * messages and we should communicate that the stream has ended */ if (this.finalStatus !== null && this.finalStatus.code !== constants_1.Status.OK) { this.readsClosed = true; this.maybeOutputStatus(); return; } this.canPush = true; if (this.http2Stream === null) { this.pendingRead = true; } else { if (this.unpushedReadMessages.length > 0) { const nextMessage = this.unpushedReadMessages.shift(); this.push(nextMessage); return; } /* Only resume reading from the http2Stream if we don't have any pending * messages to emit */ this.http2Stream.resume(); } } maybeCloseWrites() { if (this.writesClosed && !this.isWriteFilterPending && this.http2Stream !== null) { this.trace('calling end() on HTTP/2 stream'); this.http2Stream.end(); } } sendMessageWithContext(context, message) { var _a; this.trace('write() called with message of length ' + message.length); const writeObj = { message, flags: context.flags, }; const cb = (_a = context.callback) !== null && _a !== void 0 ? _a : (() => { }); this.isWriteFilterPending = true; this.filterStack.sendMessage(Promise.resolve(writeObj)).then((message) => { this.isWriteFilterPending = false; if (this.http2Stream === null) { this.trace('deferring writing data chunk of length ' + message.message.length); this.pendingWrite = message.message; this.pendingWriteCallback = cb; } else { this.trace('sending data chunk of length ' + message.message.length); try { this.writeMessageToStream(message.message, cb); } catch (error) { this.endCall({ code: constants_1.Status.UNAVAILABLE, details: `Write failed with error ${error.message}`, metadata: new metadata_1.Metadata() }); } this.maybeCloseWrites(); } }, this.handleFilterError.bind(this)); } halfClose() { this.trace('end() called'); this.writesClosed = true; this.maybeCloseWrites(); } } exports.Http2CallStream = Http2CallStream; //# sourceMappingURL=call-stream.js.map /***/ }), /***/ 97453: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ClientDuplexStreamImpl = exports.ClientWritableStreamImpl = exports.ClientReadableStreamImpl = exports.ClientUnaryCallImpl = exports.callErrorFromStatus = void 0; const events_1 = __webpack_require__(28614); const stream_1 = __webpack_require__(92413); const constants_1 = __webpack_require__(90634); /** * Construct a ServiceError from a StatusObject. This function exists primarily * as an attempt to make the error stack trace clearly communicate that the * error is not necessarily a problem in gRPC itself. * @param status */ function callErrorFromStatus(status) { const message = `${status.code} ${constants_1.Status[status.code]}: ${status.details}`; return Object.assign(new Error(message), status); } exports.callErrorFromStatus = callErrorFromStatus; class ClientUnaryCallImpl extends events_1.EventEmitter { constructor() { super(); } cancel() { var _a; (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client'); } getPeer() { var _a, _b; return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown'; } } exports.ClientUnaryCallImpl = ClientUnaryCallImpl; class ClientReadableStreamImpl extends stream_1.Readable { constructor(deserialize) { super({ objectMode: true }); this.deserialize = deserialize; } cancel() { var _a; (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client'); } getPeer() { var _a, _b; return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown'; } _read(_size) { var _a; (_a = this.call) === null || _a === void 0 ? void 0 : _a.startRead(); } } exports.ClientReadableStreamImpl = ClientReadableStreamImpl; class ClientWritableStreamImpl extends stream_1.Writable { constructor(serialize) { super({ objectMode: true }); this.serialize = serialize; } cancel() { var _a; (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client'); } getPeer() { var _a, _b; return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown'; } _write(chunk, encoding, cb) { var _a; const context = { callback: cb, }; const flags = Number(encoding); if (!Number.isNaN(flags)) { context.flags = flags; } (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendMessageWithContext(context, chunk); } _final(cb) { var _a; (_a = this.call) === null || _a === void 0 ? void 0 : _a.halfClose(); cb(); } } exports.ClientWritableStreamImpl = ClientWritableStreamImpl; class ClientDuplexStreamImpl extends stream_1.Duplex { constructor(serialize, deserialize) { super({ objectMode: true }); this.serialize = serialize; this.deserialize = deserialize; } cancel() { var _a; (_a = this.call) === null || _a === void 0 ? void 0 : _a.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client'); } getPeer() { var _a, _b; return (_b = (_a = this.call) === null || _a === void 0 ? void 0 : _a.getPeer()) !== null && _b !== void 0 ? _b : 'unknown'; } _read(_size) { var _a; (_a = this.call) === null || _a === void 0 ? void 0 : _a.startRead(); } _write(chunk, encoding, cb) { var _a; const context = { callback: cb, }; const flags = Number(encoding); if (!Number.isNaN(flags)) { context.flags = flags; } (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendMessageWithContext(context, chunk); } _final(cb) { var _a; (_a = this.call) === null || _a === void 0 ? void 0 : _a.halfClose(); cb(); } } exports.ClientDuplexStreamImpl = ClientDuplexStreamImpl; //# sourceMappingURL=call.js.map /***/ }), /***/ 44030: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ChannelCredentials = void 0; const tls_1 = __webpack_require__(4016); const call_credentials_1 = __webpack_require__(21426); const tls_helpers_1 = __webpack_require__(86581); // eslint-disable-next-line @typescript-eslint/no-explicit-any function verifyIsBufferOrNull(obj, friendlyName) { if (obj && !(obj instanceof Buffer)) { throw new TypeError(`${friendlyName}, if provided, must be a Buffer.`); } } function bufferOrNullEqual(buf1, buf2) { if (buf1 === null && buf2 === null) { return true; } else { return buf1 !== null && buf2 !== null && buf1.equals(buf2); } } /** * A class that contains credentials for communicating over a channel, as well * as a set of per-call credentials, which are applied to every method call made * over a channel initialized with an instance of this class. */ class ChannelCredentials { constructor(callCredentials) { this.callCredentials = callCredentials || call_credentials_1.CallCredentials.createEmpty(); } /** * Gets the set of per-call credentials associated with this instance. */ _getCallCredentials() { return this.callCredentials; } /** * Return a new ChannelCredentials instance with a given set of credentials. * The resulting instance can be used to construct a Channel that communicates * over TLS. * @param rootCerts The root certificate data. * @param privateKey The client certificate private key, if available. * @param certChain The client certificate key chain, if available. */ static createSsl(rootCerts, privateKey, certChain, verifyOptions) { verifyIsBufferOrNull(rootCerts, 'Root certificate'); verifyIsBufferOrNull(privateKey, 'Private key'); verifyIsBufferOrNull(certChain, 'Certificate chain'); if (privateKey && !certChain) { throw new Error('Private key must be given with accompanying certificate chain'); } if (!privateKey && certChain) { throw new Error('Certificate chain must be given with accompanying private key'); } return new SecureChannelCredentialsImpl(rootCerts || tls_helpers_1.getDefaultRootsData(), privateKey || null, certChain || null, verifyOptions || {}); } /** * Return a new ChannelCredentials instance with no credentials. */ static createInsecure() { return new InsecureChannelCredentialsImpl(); } } exports.ChannelCredentials = ChannelCredentials; class InsecureChannelCredentialsImpl extends ChannelCredentials { constructor(callCredentials) { super(callCredentials); } compose(callCredentials) { throw new Error('Cannot compose insecure credentials'); } _getConnectionOptions() { return null; } _isSecure() { return false; } _equals(other) { return other instanceof InsecureChannelCredentialsImpl; } } class SecureChannelCredentialsImpl extends ChannelCredentials { constructor(rootCerts, privateKey, certChain, verifyOptions) { super(); this.rootCerts = rootCerts; this.privateKey = privateKey; this.certChain = certChain; this.verifyOptions = verifyOptions; const secureContext = tls_1.createSecureContext({ ca: rootCerts || undefined, key: privateKey || undefined, cert: certChain || undefined, ciphers: tls_helpers_1.CIPHER_SUITES, }); this.connectionOptions = { secureContext }; if (verifyOptions && verifyOptions.checkServerIdentity) { this.connectionOptions.checkServerIdentity = (host, cert) => { return verifyOptions.checkServerIdentity(host, { raw: cert.raw }); }; } } compose(callCredentials) { const combinedCallCredentials = this.callCredentials.compose(callCredentials); return new ComposedChannelCredentialsImpl(this, combinedCallCredentials); } _getConnectionOptions() { // Copy to prevent callers from mutating this.connectionOptions return Object.assign({}, this.connectionOptions); } _isSecure() { return true; } _equals(other) { if (this === other) { return true; } if (other instanceof SecureChannelCredentialsImpl) { if (!bufferOrNullEqual(this.rootCerts, other.rootCerts)) { return false; } if (!bufferOrNullEqual(this.privateKey, other.privateKey)) { return false; } if (!bufferOrNullEqual(this.certChain, other.certChain)) { return false; } return (this.verifyOptions.checkServerIdentity === other.verifyOptions.checkServerIdentity); } else { return false; } } } class ComposedChannelCredentialsImpl extends ChannelCredentials { constructor(channelCredentials, callCreds) { super(callCreds); this.channelCredentials = channelCredentials; } compose(callCredentials) { const combinedCallCredentials = this.callCredentials.compose(callCredentials); return new ComposedChannelCredentialsImpl(this.channelCredentials, combinedCallCredentials); } _getConnectionOptions() { return this.channelCredentials._getConnectionOptions(); } _isSecure() { return true; } _equals(other) { if (this === other) { return true; } if (other instanceof ComposedChannelCredentialsImpl) { return (this.channelCredentials._equals(other.channelCredentials) && this.callCredentials._equals(other.callCredentials)); } else { return false; } } } //# sourceMappingURL=channel-credentials.js.map /***/ }), /***/ 99810: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.channelOptionsEqual = exports.recognizedOptions = void 0; /** * This is for checking provided options at runtime. This is an object for * easier membership checking. */ exports.recognizedOptions = { 'grpc.ssl_target_name_override': true, 'grpc.primary_user_agent': true, 'grpc.secondary_user_agent': true, 'grpc.default_authority': true, 'grpc.keepalive_time_ms': true, 'grpc.keepalive_timeout_ms': true, 'grpc.keepalive_permit_without_calls': true, 'grpc.service_config': true, 'grpc.max_concurrent_streams': true, 'grpc.initial_reconnect_backoff_ms': true, 'grpc.max_reconnect_backoff_ms': true, 'grpc.use_local_subchannel_pool': true, 'grpc.max_send_message_length': true, 'grpc.max_receive_message_length': true, 'grpc.enable_http_proxy': true, 'grpc.enable_channelz': true, 'grpc-node.max_session_memory': true, }; function channelOptionsEqual(options1, options2) { const keys1 = Object.keys(options1).sort(); const keys2 = Object.keys(options2).sort(); if (keys1.length !== keys2.length) { return false; } for (let i = 0; i < keys1.length; i += 1) { if (keys1[i] !== keys2[i]) { return false; } if (options1[keys1[i]] !== options2[keys2[i]]) { return false; } } return true; } exports.channelOptionsEqual = channelOptionsEqual; //# sourceMappingURL=channel-options.js.map /***/ }), /***/ 13860: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ChannelImplementation = void 0; const call_stream_1 = __webpack_require__(78988); const channel_credentials_1 = __webpack_require__(44030); const resolving_load_balancer_1 = __webpack_require__(19192); const subchannel_pool_1 = __webpack_require__(39780); const picker_1 = __webpack_require__(81611); const constants_1 = __webpack_require__(90634); const filter_stack_1 = __webpack_require__(66450); const call_credentials_filter_1 = __webpack_require__(86380); const deadline_filter_1 = __webpack_require__(81217); const compression_filter_1 = __webpack_require__(47616); const resolver_1 = __webpack_require__(31594); const logging_1 = __webpack_require__(35993); const max_message_size_filter_1 = __webpack_require__(30659); const http_proxy_1 = __webpack_require__(24000); const uri_parser_1 = __webpack_require__(65974); const connectivity_state_1 = __webpack_require__(80878); const channelz_1 = __webpack_require__(79975); /** * See https://nodejs.org/api/timers.html#timers_setinterval_callback_delay_args */ const MAX_TIMEOUT_TIME = 2147483647; let nextCallNumber = 0; function getNewCallNumber() { const callNumber = nextCallNumber; nextCallNumber += 1; if (nextCallNumber >= Number.MAX_SAFE_INTEGER) { nextCallNumber = 0; } return callNumber; } class ChannelImplementation { constructor(target, credentials, options) { var _a, _b, _c; this.credentials = credentials; this.options = options; this.connectivityState = connectivity_state_1.ConnectivityState.IDLE; this.currentPicker = new picker_1.UnavailablePicker(); /** * Calls queued up to get a call config. Should only be populated before the * first time the resolver returns a result, which includes the ConfigSelector. */ this.configSelectionQueue = []; this.pickQueue = []; this.connectivityStateWatchers = []; this.configSelector = null; // Channelz info this.channelzEnabled = true; this.callTracker = new channelz_1.ChannelzCallTracker(); this.childrenTracker = new channelz_1.ChannelzChildrenTracker(); if (typeof target !== 'string') { throw new TypeError('Channel target must be a string'); } if (!(credentials instanceof channel_credentials_1.ChannelCredentials)) { throw new TypeError('Channel credentials must be a ChannelCredentials object'); } if (options) { if (typeof options !== 'object') { throw new TypeError('Channel options must be an object'); } } this.originalTarget = target; const originalTargetUri = uri_parser_1.parseUri(target); if (originalTargetUri === null) { throw new Error(`Could not parse target name "${target}"`); } /* This ensures that the target has a scheme that is registered with the * resolver */ const defaultSchemeMapResult = resolver_1.mapUriDefaultScheme(originalTargetUri); if (defaultSchemeMapResult === null) { throw new Error(`Could not find a default scheme for target name "${target}"`); } this.callRefTimer = setInterval(() => { }, MAX_TIMEOUT_TIME); (_b = (_a = this.callRefTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); if (this.options['grpc.enable_channelz'] === 0) { this.channelzEnabled = false; } this.channelzTrace = new channelz_1.ChannelzTrace(); if (this.channelzEnabled) { this.channelzRef = channelz_1.registerChannelzChannel(target, () => this.getChannelzInfo()); this.channelzTrace.addTrace('CT_INFO', 'Channel created'); } else { // Dummy channelz ref that will never be used this.channelzRef = { kind: 'channel', id: -1, name: '' }; } if (this.options['grpc.default_authority']) { this.defaultAuthority = this.options['grpc.default_authority']; } else { this.defaultAuthority = resolver_1.getDefaultAuthority(defaultSchemeMapResult); } const proxyMapResult = http_proxy_1.mapProxyName(defaultSchemeMapResult, options); this.target = proxyMapResult.target; this.options = Object.assign({}, this.options, proxyMapResult.extraOptions); /* The global boolean parameter to getSubchannelPool has the inverse meaning to what * the grpc.use_local_subchannel_pool channel option means. */ this.subchannelPool = subchannel_pool_1.getSubchannelPool(((_c = options['grpc.use_local_subchannel_pool']) !== null && _c !== void 0 ? _c : 0) === 0); const channelControlHelper = { createSubchannel: (subchannelAddress, subchannelArgs) => { const subchannel = this.subchannelPool.getOrCreateSubchannel(this.target, subchannelAddress, Object.assign({}, this.options, subchannelArgs), this.credentials); if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_INFO', 'Created subchannel or used existing subchannel', subchannel.getChannelzRef()); } return subchannel; }, updateState: (connectivityState, picker) => { this.currentPicker = picker; const queueCopy = this.pickQueue.slice(); this.pickQueue = []; this.callRefTimerUnref(); for (const { callStream, callMetadata, callConfig, dynamicFilters } of queueCopy) { this.tryPick(callStream, callMetadata, callConfig, dynamicFilters); } this.updateState(connectivityState); }, requestReresolution: () => { // This should never be called. throw new Error('Resolving load balancer should never call requestReresolution'); }, addChannelzChild: (child) => { if (this.channelzEnabled) { this.childrenTracker.refChild(child); } }, removeChannelzChild: (child) => { if (this.channelzEnabled) { this.childrenTracker.unrefChild(child); } } }; this.resolvingLoadBalancer = new resolving_load_balancer_1.ResolvingLoadBalancer(this.target, channelControlHelper, options, (configSelector) => { if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_INFO', 'Address resolution succeeded'); } this.configSelector = configSelector; /* We process the queue asynchronously to ensure that the corresponding * load balancer update has completed. */ process.nextTick(() => { const localQueue = this.configSelectionQueue; this.configSelectionQueue = []; this.callRefTimerUnref(); for (const { callStream, callMetadata } of localQueue) { this.tryGetConfig(callStream, callMetadata); } this.configSelectionQueue = []; }); }, (status) => { if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_WARNING', 'Address resolution failed with code ' + status.code + ' and details "' + status.details + '"'); } if (this.configSelectionQueue.length > 0) { this.trace('Name resolution failed with calls queued for config selection'); } const localQueue = this.configSelectionQueue; this.configSelectionQueue = []; this.callRefTimerUnref(); for (const { callStream, callMetadata } of localQueue) { if (callMetadata.getOptions().waitForReady) { this.callRefTimerRef(); this.configSelectionQueue.push({ callStream, callMetadata }); } else { callStream.cancelWithStatus(status.code, status.details); } } }); this.filterStackFactory = new filter_stack_1.FilterStackFactory([ new call_credentials_filter_1.CallCredentialsFilterFactory(this), new deadline_filter_1.DeadlineFilterFactory(this), new max_message_size_filter_1.MaxMessageSizeFilterFactory(this.options), new compression_filter_1.CompressionFilterFactory(this), ]); this.trace('Channel constructed with options ' + JSON.stringify(options, undefined, 2)); } getChannelzInfo() { return { target: this.originalTarget, state: this.connectivityState, trace: this.channelzTrace, callTracker: this.callTracker, children: this.childrenTracker.getChildLists() }; } trace(text, verbosityOverride) { logging_1.trace(verbosityOverride !== null && verbosityOverride !== void 0 ? verbosityOverride : constants_1.LogVerbosity.DEBUG, 'channel', '(' + this.channelzRef.id + ') ' + uri_parser_1.uriToString(this.target) + ' ' + text); } callRefTimerRef() { var _a, _b, _c, _d; // If the hasRef function does not exist, always run the code if (!((_b = (_a = this.callRefTimer).hasRef) === null || _b === void 0 ? void 0 : _b.call(_a))) { this.trace('callRefTimer.ref | configSelectionQueue.length=' + this.configSelectionQueue.length + ' pickQueue.length=' + this.pickQueue.length); (_d = (_c = this.callRefTimer).ref) === null || _d === void 0 ? void 0 : _d.call(_c); } } callRefTimerUnref() { var _a, _b; // If the hasRef function does not exist, always run the code if (!this.callRefTimer.hasRef || this.callRefTimer.hasRef()) { this.trace('callRefTimer.unref | configSelectionQueue.length=' + this.configSelectionQueue.length + ' pickQueue.length=' + this.pickQueue.length); (_b = (_a = this.callRefTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); } } pushPick(callStream, callMetadata, callConfig, dynamicFilters) { this.pickQueue.push({ callStream, callMetadata, callConfig, dynamicFilters }); this.callRefTimerRef(); } /** * Check the picker output for the given call and corresponding metadata, * and take any relevant actions. Should not be called while iterating * over pickQueue. * @param callStream * @param callMetadata */ tryPick(callStream, callMetadata, callConfig, dynamicFilters) { var _a, _b, _c; const pickResult = this.currentPicker.pick({ metadata: callMetadata, extraPickInfo: callConfig.pickInformation, }); this.trace('Pick result: ' + picker_1.PickResultType[pickResult.pickResultType] + ' subchannel: ' + ((_a = pickResult.subchannel) === null || _a === void 0 ? void 0 : _a.getAddress()) + ' status: ' + ((_b = pickResult.status) === null || _b === void 0 ? void 0 : _b.code) + ' ' + ((_c = pickResult.status) === null || _c === void 0 ? void 0 : _c.details)); switch (pickResult.pickResultType) { case picker_1.PickResultType.COMPLETE: if (pickResult.subchannel === null) { callStream.cancelWithStatus(constants_1.Status.UNAVAILABLE, 'Request dropped by load balancing policy'); // End the call with an error } else { /* If the subchannel is not in the READY state, that indicates a bug * somewhere in the load balancer or picker. So, we log an error and * queue the pick to be tried again later. */ if (pickResult.subchannel.getConnectivityState() !== connectivity_state_1.ConnectivityState.READY) { logging_1.log(constants_1.LogVerbosity.ERROR, 'Error: COMPLETE pick result subchannel ' + pickResult.subchannel.getAddress() + ' has state ' + connectivity_state_1.ConnectivityState[pickResult.subchannel.getConnectivityState()]); this.pushPick(callStream, callMetadata, callConfig, dynamicFilters); break; } /* We need to clone the callMetadata here because the transparent * retry code in the promise resolution handler use the same * callMetadata object, so it needs to stay unmodified */ callStream.filterStack .sendMetadata(Promise.resolve(callMetadata.clone())) .then((finalMetadata) => { var _a, _b; const subchannelState = pickResult.subchannel.getConnectivityState(); if (subchannelState === connectivity_state_1.ConnectivityState.READY) { try { const pickExtraFilters = pickResult.extraFilterFactories.map(factory => factory.createFilter(callStream)); pickResult.subchannel.startCallStream(finalMetadata, callStream, [...dynamicFilters, ...pickExtraFilters]); /* If we reach this point, the call stream has started * successfully */ (_a = callConfig.onCommitted) === null || _a === void 0 ? void 0 : _a.call(callConfig); (_b = pickResult.onCallStarted) === null || _b === void 0 ? void 0 : _b.call(pickResult); } catch (error) { if (error.code === 'ERR_HTTP2_GOAWAY_SESSION') { /* An error here indicates that something went wrong with * the picked subchannel's http2 stream right before we * tried to start the stream. We are handling a promise * result here, so this is asynchronous with respect to the * original tryPick call, so calling it again is not * recursive. We call tryPick immediately instead of * queueing this pick again because handling the queue is * triggered by state changes, and we want to immediately * check if the state has already changed since the * previous tryPick call. We do this instead of cancelling * the stream because the correct behavior may be * re-queueing instead, based on the logic in the rest of * tryPick */ this.trace('Failed to start call on picked subchannel ' + pickResult.subchannel.getAddress() + ' with error ' + error.message + '. Retrying pick', constants_1.LogVerbosity.INFO); this.tryPick(callStream, callMetadata, callConfig, dynamicFilters); } else { this.trace('Failed to start call on picked subchanel ' + pickResult.subchannel.getAddress() + ' with error ' + error.message + '. Ending call', constants_1.LogVerbosity.INFO); callStream.cancelWithStatus(constants_1.Status.INTERNAL, `Failed to start HTTP/2 stream with error: ${error.message}`); } } } else { /* The logic for doing this here is the same as in the catch * block above */ this.trace('Picked subchannel ' + pickResult.subchannel.getAddress() + ' has state ' + connectivity_state_1.ConnectivityState[subchannelState] + ' after metadata filters. Retrying pick', constants_1.LogVerbosity.INFO); this.tryPick(callStream, callMetadata, callConfig, dynamicFilters); } }, (error) => { // We assume the error code isn't 0 (Status.OK) callStream.cancelWithStatus(typeof error.code === 'number' ? error.code : constants_1.Status.UNKNOWN, `Getting metadata from plugin failed with error: ${error.message}`); }); } break; case picker_1.PickResultType.QUEUE: this.pushPick(callStream, callMetadata, callConfig, dynamicFilters); break; case picker_1.PickResultType.TRANSIENT_FAILURE: if (callMetadata.getOptions().waitForReady) { this.pushPick(callStream, callMetadata, callConfig, dynamicFilters); } else { callStream.cancelWithStatus(pickResult.status.code, pickResult.status.details); } break; case picker_1.PickResultType.DROP: callStream.cancelWithStatus(pickResult.status.code, pickResult.status.details); break; default: throw new Error(`Invalid state: unknown pickResultType ${pickResult.pickResultType}`); } } removeConnectivityStateWatcher(watcherObject) { const watcherIndex = this.connectivityStateWatchers.findIndex((value) => value === watcherObject); if (watcherIndex >= 0) { this.connectivityStateWatchers.splice(watcherIndex, 1); } } updateState(newState) { logging_1.trace(constants_1.LogVerbosity.DEBUG, 'connectivity_state', '(' + this.channelzRef.id + ') ' + uri_parser_1.uriToString(this.target) + ' ' + connectivity_state_1.ConnectivityState[this.connectivityState] + ' -> ' + connectivity_state_1.ConnectivityState[newState]); if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_INFO', connectivity_state_1.ConnectivityState[this.connectivityState] + ' -> ' + connectivity_state_1.ConnectivityState[newState]); } this.connectivityState = newState; const watchersCopy = this.connectivityStateWatchers.slice(); for (const watcherObject of watchersCopy) { if (newState !== watcherObject.currentState) { if (watcherObject.timer) { clearTimeout(watcherObject.timer); } this.removeConnectivityStateWatcher(watcherObject); watcherObject.callback(); } } } tryGetConfig(stream, metadata) { if (stream.getStatus() !== null) { /* If the stream has a status, it has already finished and we don't need * to take any more actions on it. */ return; } if (this.configSelector === null) { /* This branch will only be taken at the beginning of the channel's life, * before the resolver ever returns a result. So, the * ResolvingLoadBalancer may be idle and if so it needs to be kicked * because it now has a pending request. */ this.resolvingLoadBalancer.exitIdle(); this.configSelectionQueue.push({ callStream: stream, callMetadata: metadata, }); this.callRefTimerRef(); } else { const callConfig = this.configSelector(stream.getMethod(), metadata); if (callConfig.status === constants_1.Status.OK) { if (callConfig.methodConfig.timeout) { const deadline = new Date(); deadline.setSeconds(deadline.getSeconds() + callConfig.methodConfig.timeout.seconds); deadline.setMilliseconds(deadline.getMilliseconds() + callConfig.methodConfig.timeout.nanos / 1000000); stream.setConfigDeadline(deadline); // Refreshing the filters makes the deadline filter pick up the new deadline stream.filterStack.refresh(); } if (callConfig.dynamicFilterFactories.length > 0) { /* These dynamicFilters are the mechanism for implementing gRFC A39: * https://github.com/grpc/proposal/blob/master/A39-xds-http-filters.md * We run them here instead of with the rest of the filters because * that spec says "the xDS HTTP filters will run in between name * resolution and load balancing". * * We use the filter stack here to simplify the multi-filter async * waterfall logic, but we pass along the underlying list of filters * to avoid having nested filter stacks when combining it with the * original filter stack. We do not pass along the original filter * factory list because these filters may need to persist data * between sending headers and other operations. */ const dynamicFilterStackFactory = new filter_stack_1.FilterStackFactory(callConfig.dynamicFilterFactories); const dynamicFilterStack = dynamicFilterStackFactory.createFilter(stream); dynamicFilterStack.sendMetadata(Promise.resolve(metadata)).then(filteredMetadata => { this.tryPick(stream, filteredMetadata, callConfig, dynamicFilterStack.getFilters()); }); } else { this.tryPick(stream, metadata, callConfig, []); } } else { stream.cancelWithStatus(callConfig.status, 'Failed to route call to method ' + stream.getMethod()); } } } _startCallStream(stream, metadata) { this.tryGetConfig(stream, metadata.clone()); } close() { this.resolvingLoadBalancer.destroy(); this.updateState(connectivity_state_1.ConnectivityState.SHUTDOWN); clearInterval(this.callRefTimer); if (this.channelzEnabled) { channelz_1.unregisterChannelzRef(this.channelzRef); } this.subchannelPool.unrefUnusedSubchannels(); } getTarget() { return uri_parser_1.uriToString(this.target); } getConnectivityState(tryToConnect) { const connectivityState = this.connectivityState; if (tryToConnect) { this.resolvingLoadBalancer.exitIdle(); } return connectivityState; } watchConnectivityState(currentState, deadline, callback) { if (this.connectivityState === connectivity_state_1.ConnectivityState.SHUTDOWN) { throw new Error('Channel has been shut down'); } let timer = null; if (deadline !== Infinity) { const deadlineDate = deadline instanceof Date ? deadline : new Date(deadline); const now = new Date(); if (deadline === -Infinity || deadlineDate <= now) { process.nextTick(callback, new Error('Deadline passed without connectivity state change')); return; } timer = setTimeout(() => { this.removeConnectivityStateWatcher(watcherObject); callback(new Error('Deadline passed without connectivity state change')); }, deadlineDate.getTime() - now.getTime()); } const watcherObject = { currentState, callback, timer, }; this.connectivityStateWatchers.push(watcherObject); } /** * Get the channelz reference object for this channel. The returned value is * garbage if channelz is disabled for this channel. * @returns */ getChannelzRef() { return this.channelzRef; } createCall(method, deadline, host, parentCall, propagateFlags) { if (typeof method !== 'string') { throw new TypeError('Channel#createCall: method must be a string'); } if (!(typeof deadline === 'number' || deadline instanceof Date)) { throw new TypeError('Channel#createCall: deadline must be a number or Date'); } if (this.connectivityState === connectivity_state_1.ConnectivityState.SHUTDOWN) { throw new Error('Channel has been shut down'); } const callNumber = getNewCallNumber(); this.trace('createCall [' + callNumber + '] method="' + method + '", deadline=' + deadline); const finalOptions = { deadline: deadline, flags: propagateFlags !== null && propagateFlags !== void 0 ? propagateFlags : constants_1.Propagate.DEFAULTS, host: host !== null && host !== void 0 ? host : this.defaultAuthority, parentCall: parentCall, }; const stream = new call_stream_1.Http2CallStream(method, this, finalOptions, this.filterStackFactory, this.credentials._getCallCredentials(), callNumber); if (this.channelzEnabled) { this.callTracker.addCallStarted(); stream.addStatusWatcher(status => { if (status.code === constants_1.Status.OK) { this.callTracker.addCallSucceeded(); } else { this.callTracker.addCallFailed(); } }); } return stream; } } exports.ChannelImplementation = ChannelImplementation; //# sourceMappingURL=channel.js.map /***/ }), /***/ 79975: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = exports.getChannelzServiceDefinition = exports.getChannelzHandlers = exports.unregisterChannelzRef = exports.registerChannelzSocket = exports.registerChannelzServer = exports.registerChannelzSubchannel = exports.registerChannelzChannel = exports.ChannelzCallTracker = exports.ChannelzChildrenTracker = exports.ChannelzTrace = void 0; const net_1 = __webpack_require__(11631); const connectivity_state_1 = __webpack_require__(80878); const constants_1 = __webpack_require__(90634); const subchannel_address_1 = __webpack_require__(99905); const admin_1 = __webpack_require__(8258); const make_client_1 = __webpack_require__(38541); function channelRefToMessage(ref) { return { channel_id: ref.id, name: ref.name }; } function subchannelRefToMessage(ref) { return { subchannel_id: ref.id, name: ref.name }; } function serverRefToMessage(ref) { return { server_id: ref.id }; } function socketRefToMessage(ref) { return { socket_id: ref.id, name: ref.name }; } /** * The loose upper bound on the number of events that should be retained in a * trace. This may be exceeded by up to a factor of 2. Arbitrarily chosen as a * number that should be large enough to contain the recent relevant * information, but small enough to not use excessive memory. */ const TARGET_RETAINED_TRACES = 32; class ChannelzTrace { constructor() { this.events = []; this.eventsLogged = 0; this.creationTimestamp = new Date(); } addTrace(severity, description, child) { const timestamp = new Date(); this.events.push({ description: description, severity: severity, timestamp: timestamp, childChannel: (child === null || child === void 0 ? void 0 : child.kind) === 'channel' ? child : undefined, childSubchannel: (child === null || child === void 0 ? void 0 : child.kind) === 'subchannel' ? child : undefined }); // Whenever the trace array gets too large, discard the first half if (this.events.length >= TARGET_RETAINED_TRACES * 2) { this.events = this.events.slice(TARGET_RETAINED_TRACES); } this.eventsLogged += 1; } getTraceMessage() { return { creation_timestamp: dateToProtoTimestamp(this.creationTimestamp), num_events_logged: this.eventsLogged, events: this.events.map(event => { return { description: event.description, severity: event.severity, timestamp: dateToProtoTimestamp(event.timestamp), channel_ref: event.childChannel ? channelRefToMessage(event.childChannel) : null, subchannel_ref: event.childSubchannel ? subchannelRefToMessage(event.childSubchannel) : null }; }) }; } } exports.ChannelzTrace = ChannelzTrace; class ChannelzChildrenTracker { constructor() { this.channelChildren = new Map(); this.subchannelChildren = new Map(); this.socketChildren = new Map(); } refChild(child) { var _a, _b, _c; switch (child.kind) { case 'channel': { let trackedChild = (_a = this.channelChildren.get(child.id)) !== null && _a !== void 0 ? _a : { ref: child, count: 0 }; trackedChild.count += 1; this.channelChildren.set(child.id, trackedChild); break; } case 'subchannel': { let trackedChild = (_b = this.subchannelChildren.get(child.id)) !== null && _b !== void 0 ? _b : { ref: child, count: 0 }; trackedChild.count += 1; this.subchannelChildren.set(child.id, trackedChild); break; } case 'socket': { let trackedChild = (_c = this.socketChildren.get(child.id)) !== null && _c !== void 0 ? _c : { ref: child, count: 0 }; trackedChild.count += 1; this.socketChildren.set(child.id, trackedChild); break; } } } unrefChild(child) { switch (child.kind) { case 'channel': { let trackedChild = this.channelChildren.get(child.id); if (trackedChild !== undefined) { trackedChild.count -= 1; if (trackedChild.count === 0) { this.channelChildren.delete(child.id); } else { this.channelChildren.set(child.id, trackedChild); } } break; } case 'subchannel': { let trackedChild = this.subchannelChildren.get(child.id); if (trackedChild !== undefined) { trackedChild.count -= 1; if (trackedChild.count === 0) { this.subchannelChildren.delete(child.id); } else { this.subchannelChildren.set(child.id, trackedChild); } } break; } case 'socket': { let trackedChild = this.socketChildren.get(child.id); if (trackedChild !== undefined) { trackedChild.count -= 1; if (trackedChild.count === 0) { this.socketChildren.delete(child.id); } else { this.socketChildren.set(child.id, trackedChild); } } break; } } } getChildLists() { const channels = []; for (const { ref } of this.channelChildren.values()) { channels.push(ref); } const subchannels = []; for (const { ref } of this.subchannelChildren.values()) { subchannels.push(ref); } const sockets = []; for (const { ref } of this.socketChildren.values()) { sockets.push(ref); } return { channels, subchannels, sockets }; } } exports.ChannelzChildrenTracker = ChannelzChildrenTracker; class ChannelzCallTracker { constructor() { this.callsStarted = 0; this.callsSucceeded = 0; this.callsFailed = 0; this.lastCallStartedTimestamp = null; } addCallStarted() { this.callsStarted += 1; this.lastCallStartedTimestamp = new Date(); } addCallSucceeded() { this.callsSucceeded += 1; } addCallFailed() { this.callsFailed += 1; } } exports.ChannelzCallTracker = ChannelzCallTracker; let nextId = 1; function getNextId() { return nextId++; } const channels = []; const subchannels = []; const servers = []; const sockets = []; function registerChannelzChannel(name, getInfo) { const id = getNextId(); const ref = { id, name, kind: 'channel' }; channels[id] = { ref, getInfo }; return ref; } exports.registerChannelzChannel = registerChannelzChannel; function registerChannelzSubchannel(name, getInfo) { const id = getNextId(); const ref = { id, name, kind: 'subchannel' }; subchannels[id] = { ref, getInfo }; return ref; } exports.registerChannelzSubchannel = registerChannelzSubchannel; function registerChannelzServer(getInfo) { const id = getNextId(); const ref = { id, kind: 'server' }; servers[id] = { ref, getInfo }; return ref; } exports.registerChannelzServer = registerChannelzServer; function registerChannelzSocket(name, getInfo) { const id = getNextId(); const ref = { id, name, kind: 'socket' }; sockets[id] = { ref, getInfo }; return ref; } exports.registerChannelzSocket = registerChannelzSocket; function unregisterChannelzRef(ref) { switch (ref.kind) { case 'channel': delete channels[ref.id]; return; case 'subchannel': delete subchannels[ref.id]; return; case 'server': delete servers[ref.id]; return; case 'socket': delete sockets[ref.id]; return; } } exports.unregisterChannelzRef = unregisterChannelzRef; /** * Parse a single section of an IPv6 address as two bytes * @param addressSection A hexadecimal string of length up to 4 * @returns The pair of bytes representing this address section */ function parseIPv6Section(addressSection) { const numberValue = Number.parseInt(addressSection, 16); return [numberValue / 256 | 0, numberValue % 256]; } /** * Parse a chunk of an IPv6 address string to some number of bytes * @param addressChunk Some number of segments of up to 4 hexadecimal * characters each, joined by colons. * @returns The list of bytes representing this address chunk */ function parseIPv6Chunk(addressChunk) { if (addressChunk === '') { return []; } const bytePairs = addressChunk.split(':').map(section => parseIPv6Section(section)); const result = []; return result.concat(...bytePairs); } /** * Converts an IPv4 or IPv6 address from string representation to binary * representation * @param ipAddress an IP address in standard IPv4 or IPv6 text format * @returns */ function ipAddressStringToBuffer(ipAddress) { if (net_1.isIPv4(ipAddress)) { return Buffer.from(Uint8Array.from(ipAddress.split('.').map(segment => Number.parseInt(segment)))); } else if (net_1.isIPv6(ipAddress)) { let leftSection; let rightSection; const doubleColonIndex = ipAddress.indexOf('::'); if (doubleColonIndex === -1) { leftSection = ipAddress; rightSection = ''; } else { leftSection = ipAddress.substring(0, doubleColonIndex); rightSection = ipAddress.substring(doubleColonIndex + 2); } const leftBuffer = Buffer.from(parseIPv6Chunk(leftSection)); const rightBuffer = Buffer.from(parseIPv6Chunk(rightSection)); const middleBuffer = Buffer.alloc(16 - leftBuffer.length - rightBuffer.length, 0); return Buffer.concat([leftBuffer, middleBuffer, rightBuffer]); } else { return null; } } function connectivityStateToMessage(state) { switch (state) { case connectivity_state_1.ConnectivityState.CONNECTING: return { state: 'CONNECTING' }; case connectivity_state_1.ConnectivityState.IDLE: return { state: 'IDLE' }; case connectivity_state_1.ConnectivityState.READY: return { state: 'READY' }; case connectivity_state_1.ConnectivityState.SHUTDOWN: return { state: 'SHUTDOWN' }; case connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE: return { state: 'TRANSIENT_FAILURE' }; default: return { state: 'UNKNOWN' }; } } function dateToProtoTimestamp(date) { if (!date) { return null; } const millisSinceEpoch = date.getTime(); return { seconds: (millisSinceEpoch / 1000) | 0, nanos: (millisSinceEpoch % 1000) * 1000000 }; } function getChannelMessage(channelEntry) { const resolvedInfo = channelEntry.getInfo(); return { ref: channelRefToMessage(channelEntry.ref), data: { target: resolvedInfo.target, state: connectivityStateToMessage(resolvedInfo.state), calls_started: resolvedInfo.callTracker.callsStarted, calls_succeeded: resolvedInfo.callTracker.callsSucceeded, calls_failed: resolvedInfo.callTracker.callsFailed, last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), trace: resolvedInfo.trace.getTraceMessage() }, channel_ref: resolvedInfo.children.channels.map(ref => channelRefToMessage(ref)), subchannel_ref: resolvedInfo.children.subchannels.map(ref => subchannelRefToMessage(ref)) }; } function GetChannel(call, callback) { const channelId = Number.parseInt(call.request.channel_id); const channelEntry = channels[channelId]; if (channelEntry === undefined) { callback({ 'code': constants_1.Status.NOT_FOUND, 'details': 'No channel data found for id ' + channelId }); return; } callback(null, { channel: getChannelMessage(channelEntry) }); } function GetTopChannels(call, callback) { const maxResults = Number.parseInt(call.request.max_results); const resultList = []; let i = Number.parseInt(call.request.start_channel_id); for (; i < channels.length; i++) { const channelEntry = channels[i]; if (channelEntry === undefined) { continue; } resultList.push(getChannelMessage(channelEntry)); if (resultList.length >= maxResults) { break; } } callback(null, { channel: resultList, end: i >= servers.length }); } function getServerMessage(serverEntry) { const resolvedInfo = serverEntry.getInfo(); return { ref: serverRefToMessage(serverEntry.ref), data: { calls_started: resolvedInfo.callTracker.callsStarted, calls_succeeded: resolvedInfo.callTracker.callsSucceeded, calls_failed: resolvedInfo.callTracker.callsFailed, last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), trace: resolvedInfo.trace.getTraceMessage() }, listen_socket: resolvedInfo.listenerChildren.sockets.map(ref => socketRefToMessage(ref)) }; } function GetServer(call, callback) { const serverId = Number.parseInt(call.request.server_id); const serverEntry = servers[serverId]; if (serverEntry === undefined) { callback({ 'code': constants_1.Status.NOT_FOUND, 'details': 'No server data found for id ' + serverId }); return; } callback(null, { server: getServerMessage(serverEntry) }); } function GetServers(call, callback) { const maxResults = Number.parseInt(call.request.max_results); const resultList = []; let i = Number.parseInt(call.request.start_server_id); for (; i < servers.length; i++) { const serverEntry = servers[i]; if (serverEntry === undefined) { continue; } resultList.push(getServerMessage(serverEntry)); if (resultList.length >= maxResults) { break; } } callback(null, { server: resultList, end: i >= servers.length }); } function GetSubchannel(call, callback) { const subchannelId = Number.parseInt(call.request.subchannel_id); const subchannelEntry = subchannels[subchannelId]; if (subchannelEntry === undefined) { callback({ 'code': constants_1.Status.NOT_FOUND, 'details': 'No subchannel data found for id ' + subchannelId }); return; } const resolvedInfo = subchannelEntry.getInfo(); const subchannelMessage = { ref: subchannelRefToMessage(subchannelEntry.ref), data: { target: resolvedInfo.target, state: connectivityStateToMessage(resolvedInfo.state), calls_started: resolvedInfo.callTracker.callsStarted, calls_succeeded: resolvedInfo.callTracker.callsSucceeded, calls_failed: resolvedInfo.callTracker.callsFailed, last_call_started_timestamp: dateToProtoTimestamp(resolvedInfo.callTracker.lastCallStartedTimestamp), trace: resolvedInfo.trace.getTraceMessage() }, socket_ref: resolvedInfo.children.sockets.map(ref => socketRefToMessage(ref)) }; callback(null, { subchannel: subchannelMessage }); } function subchannelAddressToAddressMessage(subchannelAddress) { var _a; if (subchannel_address_1.isTcpSubchannelAddress(subchannelAddress)) { return { address: 'tcpip_address', tcpip_address: { ip_address: (_a = ipAddressStringToBuffer(subchannelAddress.host)) !== null && _a !== void 0 ? _a : undefined, port: subchannelAddress.port } }; } else { return { address: 'uds_address', uds_address: { filename: subchannelAddress.path } }; } } function GetSocket(call, callback) { var _a, _b, _c, _d, _e; const socketId = Number.parseInt(call.request.socket_id); const socketEntry = sockets[socketId]; if (socketEntry === undefined) { callback({ 'code': constants_1.Status.NOT_FOUND, 'details': 'No socket data found for id ' + socketId }); return; } const resolvedInfo = socketEntry.getInfo(); const securityMessage = resolvedInfo.security ? { model: 'tls', tls: { cipher_suite: resolvedInfo.security.cipherSuiteStandardName ? 'standard_name' : 'other_name', standard_name: (_a = resolvedInfo.security.cipherSuiteStandardName) !== null && _a !== void 0 ? _a : undefined, other_name: (_b = resolvedInfo.security.cipherSuiteOtherName) !== null && _b !== void 0 ? _b : undefined, local_certificate: (_c = resolvedInfo.security.localCertificate) !== null && _c !== void 0 ? _c : undefined, remote_certificate: (_d = resolvedInfo.security.remoteCertificate) !== null && _d !== void 0 ? _d : undefined } } : null; const socketMessage = { ref: socketRefToMessage(socketEntry.ref), local: resolvedInfo.localAddress ? subchannelAddressToAddressMessage(resolvedInfo.localAddress) : null, remote: resolvedInfo.remoteAddress ? subchannelAddressToAddressMessage(resolvedInfo.remoteAddress) : null, remote_name: (_e = resolvedInfo.remoteName) !== null && _e !== void 0 ? _e : undefined, security: securityMessage, data: { keep_alives_sent: resolvedInfo.keepAlivesSent, streams_started: resolvedInfo.streamsStarted, streams_succeeded: resolvedInfo.streamsSucceeded, streams_failed: resolvedInfo.streamsFailed, last_local_stream_created_timestamp: dateToProtoTimestamp(resolvedInfo.lastLocalStreamCreatedTimestamp), last_remote_stream_created_timestamp: dateToProtoTimestamp(resolvedInfo.lastRemoteStreamCreatedTimestamp), messages_received: resolvedInfo.messagesReceived, messages_sent: resolvedInfo.messagesSent, last_message_received_timestamp: dateToProtoTimestamp(resolvedInfo.lastMessageReceivedTimestamp), last_message_sent_timestamp: dateToProtoTimestamp(resolvedInfo.lastMessageSentTimestamp), local_flow_control_window: resolvedInfo.localFlowControlWindow ? { value: resolvedInfo.localFlowControlWindow } : null, remote_flow_control_window: resolvedInfo.remoteFlowControlWindow ? { value: resolvedInfo.remoteFlowControlWindow } : null, } }; callback(null, { socket: socketMessage }); } function GetServerSockets(call, callback) { const serverId = Number.parseInt(call.request.server_id); const serverEntry = servers[serverId]; if (serverEntry === undefined) { callback({ 'code': constants_1.Status.NOT_FOUND, 'details': 'No server data found for id ' + serverId }); return; } const startId = Number.parseInt(call.request.start_socket_id); const maxResults = Number.parseInt(call.request.max_results); const resolvedInfo = serverEntry.getInfo(); // If we wanted to include listener sockets in the result, this line would // instead say // const allSockets = resolvedInfo.listenerChildren.sockets.concat(resolvedInfo.sessionChildren.sockets).sort((ref1, ref2) => ref1.id - ref2.id); const allSockets = resolvedInfo.sessionChildren.sockets.sort((ref1, ref2) => ref1.id - ref2.id); const resultList = []; let i = 0; for (; i < allSockets.length; i++) { if (allSockets[i].id >= startId) { resultList.push(socketRefToMessage(allSockets[i])); if (resultList.length >= maxResults) { break; } } } callback(null, { socket_ref: resultList, end: i >= allSockets.length }); } function getChannelzHandlers() { return { GetChannel, GetTopChannels, GetServer, GetServers, GetSubchannel, GetSocket, GetServerSockets }; } exports.getChannelzHandlers = getChannelzHandlers; let loadedChannelzDefinition = null; function getChannelzServiceDefinition() { if (loadedChannelzDefinition) { return loadedChannelzDefinition; } /* The purpose of this complexity is to avoid loading @grpc/proto-loader at * runtime for users who will not use/enable channelz. */ const loaderLoadSync = __webpack_require__(98171).loadSync; const loadedProto = loaderLoadSync('channelz.proto', { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true, includeDirs: [ `${__dirname}/../../proto` ] }); const channelzGrpcObject = make_client_1.loadPackageDefinition(loadedProto); loadedChannelzDefinition = channelzGrpcObject.grpc.channelz.v1.Channelz.service; return loadedChannelzDefinition; } exports.getChannelzServiceDefinition = getChannelzServiceDefinition; function setup() { admin_1.registerAdminService(getChannelzServiceDefinition, getChannelzHandlers); } exports.setup = setup; //# sourceMappingURL=channelz.js.map /***/ }), /***/ 82127: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getInterceptingCall = exports.InterceptingCall = exports.RequesterBuilder = exports.ListenerBuilder = exports.InterceptorConfigurationError = void 0; const metadata_1 = __webpack_require__(83665); const call_stream_1 = __webpack_require__(78988); const constants_1 = __webpack_require__(90634); /** * Error class associated with passing both interceptors and interceptor * providers to a client constructor or as call options. */ class InterceptorConfigurationError extends Error { constructor(message) { super(message); this.name = 'InterceptorConfigurationError'; Error.captureStackTrace(this, InterceptorConfigurationError); } } exports.InterceptorConfigurationError = InterceptorConfigurationError; class ListenerBuilder { constructor() { this.metadata = undefined; this.message = undefined; this.status = undefined; } withOnReceiveMetadata(onReceiveMetadata) { this.metadata = onReceiveMetadata; return this; } withOnReceiveMessage(onReceiveMessage) { this.message = onReceiveMessage; return this; } withOnReceiveStatus(onReceiveStatus) { this.status = onReceiveStatus; return this; } build() { return { onReceiveMetadata: this.metadata, onReceiveMessage: this.message, onReceiveStatus: this.status, }; } } exports.ListenerBuilder = ListenerBuilder; class RequesterBuilder { constructor() { this.start = undefined; this.message = undefined; this.halfClose = undefined; this.cancel = undefined; } withStart(start) { this.start = start; return this; } withSendMessage(sendMessage) { this.message = sendMessage; return this; } withHalfClose(halfClose) { this.halfClose = halfClose; return this; } withCancel(cancel) { this.cancel = cancel; return this; } build() { return { start: this.start, sendMessage: this.message, halfClose: this.halfClose, cancel: this.cancel, }; } } exports.RequesterBuilder = RequesterBuilder; /** * A Listener with a default pass-through implementation of each method. Used * for filling out Listeners with some methods omitted. */ const defaultListener = { onReceiveMetadata: (metadata, next) => { next(metadata); }, onReceiveMessage: (message, next) => { next(message); }, onReceiveStatus: (status, next) => { next(status); }, }; /** * A Requester with a default pass-through implementation of each method. Used * for filling out Requesters with some methods omitted. */ const defaultRequester = { start: (metadata, listener, next) => { next(metadata, listener); }, sendMessage: (message, next) => { next(message); }, halfClose: (next) => { next(); }, cancel: (next) => { next(); }, }; class InterceptingCall { constructor(nextCall, requester) { var _a, _b, _c, _d; this.nextCall = nextCall; /** * Indicates that metadata has been passed to the requester's start * method but it has not been passed to the corresponding next callback */ this.processingMetadata = false; /** * Message context for a pending message that is waiting for */ this.pendingMessageContext = null; /** * Indicates that a message has been passed to the requester's sendMessage * method but it has not been passed to the corresponding next callback */ this.processingMessage = false; /** * Indicates that a status was received but could not be propagated because * a message was still being processed. */ this.pendingHalfClose = false; if (requester) { this.requester = { start: (_a = requester.start) !== null && _a !== void 0 ? _a : defaultRequester.start, sendMessage: (_b = requester.sendMessage) !== null && _b !== void 0 ? _b : defaultRequester.sendMessage, halfClose: (_c = requester.halfClose) !== null && _c !== void 0 ? _c : defaultRequester.halfClose, cancel: (_d = requester.cancel) !== null && _d !== void 0 ? _d : defaultRequester.cancel, }; } else { this.requester = defaultRequester; } } cancelWithStatus(status, details) { this.requester.cancel(() => { this.nextCall.cancelWithStatus(status, details); }); } getPeer() { return this.nextCall.getPeer(); } processPendingMessage() { if (this.pendingMessageContext) { this.nextCall.sendMessageWithContext(this.pendingMessageContext, this.pendingMessage); this.pendingMessageContext = null; this.pendingMessage = null; } } processPendingHalfClose() { if (this.pendingHalfClose) { this.nextCall.halfClose(); } } start(metadata, interceptingListener) { var _a, _b, _c, _d, _e, _f; const fullInterceptingListener = { onReceiveMetadata: (_b = (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.bind(interceptingListener)) !== null && _b !== void 0 ? _b : ((metadata) => { }), onReceiveMessage: (_d = (_c = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMessage) === null || _c === void 0 ? void 0 : _c.bind(interceptingListener)) !== null && _d !== void 0 ? _d : ((message) => { }), onReceiveStatus: (_f = (_e = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _e === void 0 ? void 0 : _e.bind(interceptingListener)) !== null && _f !== void 0 ? _f : ((status) => { }), }; this.processingMetadata = true; this.requester.start(metadata, fullInterceptingListener, (md, listener) => { var _a, _b, _c; this.processingMetadata = false; let finalInterceptingListener; if (call_stream_1.isInterceptingListener(listener)) { finalInterceptingListener = listener; } else { const fullListener = { onReceiveMetadata: (_a = listener.onReceiveMetadata) !== null && _a !== void 0 ? _a : defaultListener.onReceiveMetadata, onReceiveMessage: (_b = listener.onReceiveMessage) !== null && _b !== void 0 ? _b : defaultListener.onReceiveMessage, onReceiveStatus: (_c = listener.onReceiveStatus) !== null && _c !== void 0 ? _c : defaultListener.onReceiveStatus, }; finalInterceptingListener = new call_stream_1.InterceptingListenerImpl(fullListener, fullInterceptingListener); } this.nextCall.start(md, finalInterceptingListener); this.processPendingMessage(); this.processPendingHalfClose(); }); } // eslint-disable-next-line @typescript-eslint/no-explicit-any sendMessageWithContext(context, message) { this.processingMessage = true; this.requester.sendMessage(message, (finalMessage) => { this.processingMessage = false; if (this.processingMetadata) { this.pendingMessageContext = context; this.pendingMessage = message; } else { this.nextCall.sendMessageWithContext(context, finalMessage); this.processPendingHalfClose(); } }); } // eslint-disable-next-line @typescript-eslint/no-explicit-any sendMessage(message) { this.sendMessageWithContext({}, message); } startRead() { this.nextCall.startRead(); } halfClose() { this.requester.halfClose(() => { if (this.processingMetadata || this.processingMessage) { this.pendingHalfClose = true; } else { this.nextCall.halfClose(); } }); } setCredentials(credentials) { this.nextCall.setCredentials(credentials); } } exports.InterceptingCall = InterceptingCall; function getCall(channel, path, options) { var _a, _b; const deadline = (_a = options.deadline) !== null && _a !== void 0 ? _a : Infinity; const host = options.host; const parent = (_b = options.parent) !== null && _b !== void 0 ? _b : null; const propagateFlags = options.propagate_flags; const credentials = options.credentials; const call = channel.createCall(path, deadline, host, parent, propagateFlags); if (credentials) { call.setCredentials(credentials); } return call; } /** * InterceptingCall implementation that directly owns the underlying Call * object and handles serialization and deseraizliation. */ class BaseInterceptingCall { constructor(call, // eslint-disable-next-line @typescript-eslint/no-explicit-any methodDefinition) { this.call = call; this.methodDefinition = methodDefinition; } cancelWithStatus(status, details) { this.call.cancelWithStatus(status, details); } getPeer() { return this.call.getPeer(); } setCredentials(credentials) { this.call.setCredentials(credentials); } // eslint-disable-next-line @typescript-eslint/no-explicit-any sendMessageWithContext(context, message) { let serialized; try { serialized = this.methodDefinition.requestSerialize(message); } catch (e) { this.call.cancelWithStatus(constants_1.Status.INTERNAL, `Request message serialization failure: ${e.message}`); return; } this.call.sendMessageWithContext(context, serialized); } // eslint-disable-next-line @typescript-eslint/no-explicit-any sendMessage(message) { this.sendMessageWithContext({}, message); } start(metadata, interceptingListener) { let readError = null; this.call.start(metadata, { onReceiveMetadata: (metadata) => { var _a; (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, metadata); }, onReceiveMessage: (message) => { var _a; // eslint-disable-next-line @typescript-eslint/no-explicit-any let deserialized; try { deserialized = this.methodDefinition.responseDeserialize(message); } catch (e) { readError = { code: constants_1.Status.INTERNAL, details: `Response message parsing error: ${e.message}`, metadata: new metadata_1.Metadata(), }; this.call.cancelWithStatus(readError.code, readError.details); return; } (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, deserialized); }, onReceiveStatus: (status) => { var _a, _b; if (readError) { (_a = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _a === void 0 ? void 0 : _a.call(interceptingListener, readError); } else { (_b = interceptingListener === null || interceptingListener === void 0 ? void 0 : interceptingListener.onReceiveStatus) === null || _b === void 0 ? void 0 : _b.call(interceptingListener, status); } }, }); } startRead() { this.call.startRead(); } halfClose() { this.call.halfClose(); } } /** * BaseInterceptingCall with special-cased behavior for methods with unary * responses. */ class BaseUnaryInterceptingCall extends BaseInterceptingCall { // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(call, methodDefinition) { super(call, methodDefinition); } start(metadata, listener) { var _a, _b; let receivedMessage = false; const wrapperListener = { onReceiveMetadata: (_b = (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMetadata) === null || _a === void 0 ? void 0 : _a.bind(listener)) !== null && _b !== void 0 ? _b : ((metadata) => { }), // eslint-disable-next-line @typescript-eslint/no-explicit-any onReceiveMessage: (message) => { var _a; receivedMessage = true; (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(listener, message); }, onReceiveStatus: (status) => { var _a, _b; if (!receivedMessage) { (_a = listener === null || listener === void 0 ? void 0 : listener.onReceiveMessage) === null || _a === void 0 ? void 0 : _a.call(listener, null); } (_b = listener === null || listener === void 0 ? void 0 : listener.onReceiveStatus) === null || _b === void 0 ? void 0 : _b.call(listener, status); }, }; super.start(metadata, wrapperListener); this.call.startRead(); } } /** * BaseInterceptingCall with special-cased behavior for methods with streaming * responses. */ class BaseStreamingInterceptingCall extends BaseInterceptingCall { } function getBottomInterceptingCall(channel, options, // eslint-disable-next-line @typescript-eslint/no-explicit-any methodDefinition) { const call = getCall(channel, methodDefinition.path, options); if (methodDefinition.responseStream) { return new BaseStreamingInterceptingCall(call, methodDefinition); } else { return new BaseUnaryInterceptingCall(call, methodDefinition); } } function getInterceptingCall(interceptorArgs, // eslint-disable-next-line @typescript-eslint/no-explicit-any methodDefinition, options, channel) { if (interceptorArgs.clientInterceptors.length > 0 && interceptorArgs.clientInterceptorProviders.length > 0) { throw new InterceptorConfigurationError('Both interceptors and interceptor_providers were passed as options ' + 'to the client constructor. Only one of these is allowed.'); } if (interceptorArgs.callInterceptors.length > 0 && interceptorArgs.callInterceptorProviders.length > 0) { throw new InterceptorConfigurationError('Both interceptors and interceptor_providers were passed as call ' + 'options. Only one of these is allowed.'); } let interceptors = []; // Interceptors passed to the call override interceptors passed to the client constructor if (interceptorArgs.callInterceptors.length > 0 || interceptorArgs.callInterceptorProviders.length > 0) { interceptors = [] .concat(interceptorArgs.callInterceptors, interceptorArgs.callInterceptorProviders.map((provider) => provider(methodDefinition))) .filter((interceptor) => interceptor); // Filter out falsy values when providers return nothing } else { interceptors = [] .concat(interceptorArgs.clientInterceptors, interceptorArgs.clientInterceptorProviders.map((provider) => provider(methodDefinition))) .filter((interceptor) => interceptor); // Filter out falsy values when providers return nothing } const interceptorOptions = Object.assign({}, options, { method_definition: methodDefinition, }); /* For each interceptor in the list, the nextCall function passed to it is * based on the next interceptor in the list, using a nextCall function * constructed with the following interceptor in the list, and so on. The * initialValue, which is effectively at the end of the list, is a nextCall * function that invokes getBottomInterceptingCall, the result of which * handles (de)serialization and also gets the underlying call from the * channel. */ const getCall = interceptors.reduceRight((nextCall, nextInterceptor) => { return (currentOptions) => nextInterceptor(currentOptions, nextCall); }, (finalOptions) => getBottomInterceptingCall(channel, finalOptions, methodDefinition)); return getCall(interceptorOptions); } exports.getInterceptingCall = getInterceptingCall; //# sourceMappingURL=client-interceptors.js.map /***/ }), /***/ 87172: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Client = void 0; const call_1 = __webpack_require__(97453); const channel_1 = __webpack_require__(13860); const connectivity_state_1 = __webpack_require__(80878); const constants_1 = __webpack_require__(90634); const metadata_1 = __webpack_require__(83665); const client_interceptors_1 = __webpack_require__(82127); const CHANNEL_SYMBOL = Symbol(); const INTERCEPTOR_SYMBOL = Symbol(); const INTERCEPTOR_PROVIDER_SYMBOL = Symbol(); const CALL_INVOCATION_TRANSFORMER_SYMBOL = Symbol(); function isFunction(arg) { return typeof arg === 'function'; } /** * A generic gRPC client. Primarily useful as a base class for all generated * clients. */ class Client { constructor(address, credentials, options = {}) { var _a, _b; options = Object.assign({}, options); this[INTERCEPTOR_SYMBOL] = (_a = options.interceptors) !== null && _a !== void 0 ? _a : []; delete options.interceptors; this[INTERCEPTOR_PROVIDER_SYMBOL] = (_b = options.interceptor_providers) !== null && _b !== void 0 ? _b : []; delete options.interceptor_providers; if (this[INTERCEPTOR_SYMBOL].length > 0 && this[INTERCEPTOR_PROVIDER_SYMBOL].length > 0) { throw new Error('Both interceptors and interceptor_providers were passed as options ' + 'to the client constructor. Only one of these is allowed.'); } this[CALL_INVOCATION_TRANSFORMER_SYMBOL] = options.callInvocationTransformer; delete options.callInvocationTransformer; if (options.channelOverride) { this[CHANNEL_SYMBOL] = options.channelOverride; } else if (options.channelFactoryOverride) { const channelFactoryOverride = options.channelFactoryOverride; delete options.channelFactoryOverride; this[CHANNEL_SYMBOL] = channelFactoryOverride(address, credentials, options); } else { this[CHANNEL_SYMBOL] = new channel_1.ChannelImplementation(address, credentials, options); } } close() { this[CHANNEL_SYMBOL].close(); } getChannel() { return this[CHANNEL_SYMBOL]; } waitForReady(deadline, callback) { const checkState = (err) => { if (err) { callback(new Error('Failed to connect before the deadline')); return; } let newState; try { newState = this[CHANNEL_SYMBOL].getConnectivityState(true); } catch (e) { callback(new Error('The channel has been closed')); return; } if (newState === connectivity_state_1.ConnectivityState.READY) { callback(); } else { try { this[CHANNEL_SYMBOL].watchConnectivityState(newState, deadline, checkState); } catch (e) { callback(new Error('The channel has been closed')); } } }; setImmediate(checkState); } checkOptionalUnaryResponseArguments(arg1, arg2, arg3) { if (isFunction(arg1)) { return { metadata: new metadata_1.Metadata(), options: {}, callback: arg1 }; } else if (isFunction(arg2)) { if (arg1 instanceof metadata_1.Metadata) { return { metadata: arg1, options: {}, callback: arg2 }; } else { return { metadata: new metadata_1.Metadata(), options: arg1, callback: arg2 }; } } else { if (!(arg1 instanceof metadata_1.Metadata && arg2 instanceof Object && isFunction(arg3))) { throw new Error('Incorrect arguments passed'); } return { metadata: arg1, options: arg2, callback: arg3 }; } } makeUnaryRequest(method, serialize, deserialize, argument, metadata, options, callback) { var _a, _b; const checkedArguments = this.checkOptionalUnaryResponseArguments(metadata, options, callback); const methodDefinition = { path: method, requestStream: false, responseStream: false, requestSerialize: serialize, responseDeserialize: deserialize, }; let callProperties = { argument: argument, metadata: checkedArguments.metadata, call: new call_1.ClientUnaryCallImpl(), channel: this[CHANNEL_SYMBOL], methodDefinition: methodDefinition, callOptions: checkedArguments.options, callback: checkedArguments.callback, }; if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties); } const emitter = callProperties.call; const interceptorArgs = { clientInterceptors: this[INTERCEPTOR_SYMBOL], clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [], callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [], }; const call = client_interceptors_1.getInterceptingCall(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel); /* This needs to happen before the emitter is used. Unfortunately we can't * enforce this with the type system. We need to construct this emitter * before calling the CallInvocationTransformer, and we need to create the * call after that. */ emitter.call = call; if (callProperties.callOptions.credentials) { call.setCredentials(callProperties.callOptions.credentials); } let responseMessage = null; let receivedStatus = false; call.start(callProperties.metadata, { onReceiveMetadata: (metadata) => { emitter.emit('metadata', metadata); }, // eslint-disable-next-line @typescript-eslint/no-explicit-any onReceiveMessage(message) { if (responseMessage !== null) { call.cancelWithStatus(constants_1.Status.INTERNAL, 'Too many responses received'); } responseMessage = message; }, onReceiveStatus(status) { if (receivedStatus) { return; } receivedStatus = true; if (status.code === constants_1.Status.OK) { callProperties.callback(null, responseMessage); } else { callProperties.callback(call_1.callErrorFromStatus(status)); } emitter.emit('status', status); }, }); call.sendMessage(argument); call.halfClose(); return emitter; } makeClientStreamRequest(method, serialize, deserialize, metadata, options, callback) { var _a, _b; const checkedArguments = this.checkOptionalUnaryResponseArguments(metadata, options, callback); const methodDefinition = { path: method, requestStream: true, responseStream: false, requestSerialize: serialize, responseDeserialize: deserialize, }; let callProperties = { metadata: checkedArguments.metadata, call: new call_1.ClientWritableStreamImpl(serialize), channel: this[CHANNEL_SYMBOL], methodDefinition: methodDefinition, callOptions: checkedArguments.options, callback: checkedArguments.callback, }; if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties); } const emitter = callProperties.call; const interceptorArgs = { clientInterceptors: this[INTERCEPTOR_SYMBOL], clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [], callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [], }; const call = client_interceptors_1.getInterceptingCall(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel); /* This needs to happen before the emitter is used. Unfortunately we can't * enforce this with the type system. We need to construct this emitter * before calling the CallInvocationTransformer, and we need to create the * call after that. */ emitter.call = call; if (callProperties.callOptions.credentials) { call.setCredentials(callProperties.callOptions.credentials); } let responseMessage = null; let receivedStatus = false; call.start(callProperties.metadata, { onReceiveMetadata: (metadata) => { emitter.emit('metadata', metadata); }, // eslint-disable-next-line @typescript-eslint/no-explicit-any onReceiveMessage(message) { if (responseMessage !== null) { call.cancelWithStatus(constants_1.Status.INTERNAL, 'Too many responses received'); } responseMessage = message; }, onReceiveStatus(status) { if (receivedStatus) { return; } receivedStatus = true; if (status.code === constants_1.Status.OK) { callProperties.callback(null, responseMessage); } else { callProperties.callback(call_1.callErrorFromStatus(status)); } emitter.emit('status', status); }, }); return emitter; } checkMetadataAndOptions(arg1, arg2) { let metadata; let options; if (arg1 instanceof metadata_1.Metadata) { metadata = arg1; if (arg2) { options = arg2; } else { options = {}; } } else { if (arg1) { options = arg1; } else { options = {}; } metadata = new metadata_1.Metadata(); } return { metadata, options }; } makeServerStreamRequest(method, serialize, deserialize, argument, metadata, options) { var _a, _b; const checkedArguments = this.checkMetadataAndOptions(metadata, options); const methodDefinition = { path: method, requestStream: false, responseStream: true, requestSerialize: serialize, responseDeserialize: deserialize, }; let callProperties = { argument: argument, metadata: checkedArguments.metadata, call: new call_1.ClientReadableStreamImpl(deserialize), channel: this[CHANNEL_SYMBOL], methodDefinition: methodDefinition, callOptions: checkedArguments.options, }; if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties); } const stream = callProperties.call; const interceptorArgs = { clientInterceptors: this[INTERCEPTOR_SYMBOL], clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [], callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [], }; const call = client_interceptors_1.getInterceptingCall(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel); /* This needs to happen before the emitter is used. Unfortunately we can't * enforce this with the type system. We need to construct this emitter * before calling the CallInvocationTransformer, and we need to create the * call after that. */ stream.call = call; if (callProperties.callOptions.credentials) { call.setCredentials(callProperties.callOptions.credentials); } let receivedStatus = false; call.start(callProperties.metadata, { onReceiveMetadata(metadata) { stream.emit('metadata', metadata); }, // eslint-disable-next-line @typescript-eslint/no-explicit-any onReceiveMessage(message) { stream.push(message); }, onReceiveStatus(status) { if (receivedStatus) { return; } receivedStatus = true; stream.push(null); if (status.code !== constants_1.Status.OK) { stream.emit('error', call_1.callErrorFromStatus(status)); } stream.emit('status', status); }, }); call.sendMessage(argument); call.halfClose(); return stream; } makeBidiStreamRequest(method, serialize, deserialize, metadata, options) { var _a, _b; const checkedArguments = this.checkMetadataAndOptions(metadata, options); const methodDefinition = { path: method, requestStream: true, responseStream: true, requestSerialize: serialize, responseDeserialize: deserialize, }; let callProperties = { metadata: checkedArguments.metadata, call: new call_1.ClientDuplexStreamImpl(serialize, deserialize), channel: this[CHANNEL_SYMBOL], methodDefinition: methodDefinition, callOptions: checkedArguments.options, }; if (this[CALL_INVOCATION_TRANSFORMER_SYMBOL]) { callProperties = this[CALL_INVOCATION_TRANSFORMER_SYMBOL](callProperties); } const stream = callProperties.call; const interceptorArgs = { clientInterceptors: this[INTERCEPTOR_SYMBOL], clientInterceptorProviders: this[INTERCEPTOR_PROVIDER_SYMBOL], callInterceptors: (_a = callProperties.callOptions.interceptors) !== null && _a !== void 0 ? _a : [], callInterceptorProviders: (_b = callProperties.callOptions.interceptor_providers) !== null && _b !== void 0 ? _b : [], }; const call = client_interceptors_1.getInterceptingCall(interceptorArgs, callProperties.methodDefinition, callProperties.callOptions, callProperties.channel); /* This needs to happen before the emitter is used. Unfortunately we can't * enforce this with the type system. We need to construct this emitter * before calling the CallInvocationTransformer, and we need to create the * call after that. */ stream.call = call; if (callProperties.callOptions.credentials) { call.setCredentials(callProperties.callOptions.credentials); } let receivedStatus = false; call.start(callProperties.metadata, { onReceiveMetadata(metadata) { stream.emit('metadata', metadata); }, onReceiveMessage(message) { stream.push(message); }, onReceiveStatus(status) { if (receivedStatus) { return; } receivedStatus = true; stream.push(null); if (status.code !== constants_1.Status.OK) { stream.emit('error', call_1.callErrorFromStatus(status)); } stream.emit('status', status); }, }); return stream; } } exports.Client = Client; //# sourceMappingURL=client.js.map /***/ }), /***/ 47616: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CompressionFilterFactory = exports.CompressionFilter = void 0; const zlib = __webpack_require__(78761); const filter_1 = __webpack_require__(43392); class CompressionHandler { /** * @param message Raw uncompressed message bytes * @param compress Indicates whether the message should be compressed * @return Framed message, compressed if applicable */ async writeMessage(message, compress) { let messageBuffer = message; if (compress) { messageBuffer = await this.compressMessage(messageBuffer); } const output = Buffer.allocUnsafe(messageBuffer.length + 5); output.writeUInt8(compress ? 1 : 0, 0); output.writeUInt32BE(messageBuffer.length, 1); messageBuffer.copy(output, 5); return output; } /** * @param data Framed message, possibly compressed * @return Uncompressed message */ async readMessage(data) { const compressed = data.readUInt8(0) === 1; let messageBuffer = data.slice(5); if (compressed) { messageBuffer = await this.decompressMessage(messageBuffer); } return messageBuffer; } } class IdentityHandler extends CompressionHandler { async compressMessage(message) { return message; } async writeMessage(message, compress) { const output = Buffer.allocUnsafe(message.length + 5); /* With "identity" compression, messages should always be marked as * uncompressed */ output.writeUInt8(0, 0); output.writeUInt32BE(message.length, 1); message.copy(output, 5); return output; } decompressMessage(message) { return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity')); } } class DeflateHandler extends CompressionHandler { compressMessage(message) { return new Promise((resolve, reject) => { zlib.deflate(message, (err, output) => { if (err) { reject(err); } else { resolve(output); } }); }); } decompressMessage(message) { return new Promise((resolve, reject) => { zlib.inflate(message, (err, output) => { if (err) { reject(err); } else { resolve(output); } }); }); } } class GzipHandler extends CompressionHandler { compressMessage(message) { return new Promise((resolve, reject) => { zlib.gzip(message, (err, output) => { if (err) { reject(err); } else { resolve(output); } }); }); } decompressMessage(message) { return new Promise((resolve, reject) => { zlib.unzip(message, (err, output) => { if (err) { reject(err); } else { resolve(output); } }); }); } } class UnknownHandler extends CompressionHandler { constructor(compressionName) { super(); this.compressionName = compressionName; } compressMessage(message) { return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`)); } decompressMessage(message) { // This should be unreachable return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`)); } } function getCompressionHandler(compressionName) { switch (compressionName) { case 'identity': return new IdentityHandler(); case 'deflate': return new DeflateHandler(); case 'gzip': return new GzipHandler(); default: return new UnknownHandler(compressionName); } } class CompressionFilter extends filter_1.BaseFilter { constructor() { super(...arguments); this.sendCompression = new IdentityHandler(); this.receiveCompression = new IdentityHandler(); } async sendMetadata(metadata) { const headers = await metadata; headers.set('grpc-accept-encoding', 'identity,deflate,gzip'); headers.set('accept-encoding', 'identity'); return headers; } receiveMetadata(metadata) { const receiveEncoding = metadata.get('grpc-encoding'); if (receiveEncoding.length > 0) { const encoding = receiveEncoding[0]; if (typeof encoding === 'string') { this.receiveCompression = getCompressionHandler(encoding); } } metadata.remove('grpc-encoding'); metadata.remove('grpc-accept-encoding'); return metadata; } async sendMessage(message) { /* This filter is special. The input message is the bare message bytes, * and the output is a framed and possibly compressed message. For this * reason, this filter should be at the bottom of the filter stack */ const resolvedMessage = await message; const compress = resolvedMessage.flags === undefined ? false : (resolvedMessage.flags & 2 /* NoCompress */) === 0; return { message: await this.sendCompression.writeMessage(resolvedMessage.message, compress), flags: resolvedMessage.flags, }; } async receiveMessage(message) { /* This filter is also special. The input message is framed and possibly * compressed, and the output message is deframed and uncompressed. So * this is another reason that this filter should be at the bottom of the * filter stack. */ return this.receiveCompression.readMessage(await message); } } exports.CompressionFilter = CompressionFilter; class CompressionFilterFactory { constructor(channel) { this.channel = channel; } createFilter(callStream) { return new CompressionFilter(); } } exports.CompressionFilterFactory = CompressionFilterFactory; //# sourceMappingURL=compression-filter.js.map /***/ }), /***/ 80878: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ConnectivityState = void 0; var ConnectivityState; (function (ConnectivityState) { ConnectivityState[ConnectivityState["IDLE"] = 0] = "IDLE"; ConnectivityState[ConnectivityState["CONNECTING"] = 1] = "CONNECTING"; ConnectivityState[ConnectivityState["READY"] = 2] = "READY"; ConnectivityState[ConnectivityState["TRANSIENT_FAILURE"] = 3] = "TRANSIENT_FAILURE"; ConnectivityState[ConnectivityState["SHUTDOWN"] = 4] = "SHUTDOWN"; })(ConnectivityState = exports.ConnectivityState || (exports.ConnectivityState = {})); //# sourceMappingURL=connectivity-state.js.map /***/ }), /***/ 90634: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = exports.DEFAULT_MAX_SEND_MESSAGE_LENGTH = exports.Propagate = exports.LogVerbosity = exports.Status = void 0; var Status; (function (Status) { Status[Status["OK"] = 0] = "OK"; Status[Status["CANCELLED"] = 1] = "CANCELLED"; Status[Status["UNKNOWN"] = 2] = "UNKNOWN"; Status[Status["INVALID_ARGUMENT"] = 3] = "INVALID_ARGUMENT"; Status[Status["DEADLINE_EXCEEDED"] = 4] = "DEADLINE_EXCEEDED"; Status[Status["NOT_FOUND"] = 5] = "NOT_FOUND"; Status[Status["ALREADY_EXISTS"] = 6] = "ALREADY_EXISTS"; Status[Status["PERMISSION_DENIED"] = 7] = "PERMISSION_DENIED"; Status[Status["RESOURCE_EXHAUSTED"] = 8] = "RESOURCE_EXHAUSTED"; Status[Status["FAILED_PRECONDITION"] = 9] = "FAILED_PRECONDITION"; Status[Status["ABORTED"] = 10] = "ABORTED"; Status[Status["OUT_OF_RANGE"] = 11] = "OUT_OF_RANGE"; Status[Status["UNIMPLEMENTED"] = 12] = "UNIMPLEMENTED"; Status[Status["INTERNAL"] = 13] = "INTERNAL"; Status[Status["UNAVAILABLE"] = 14] = "UNAVAILABLE"; Status[Status["DATA_LOSS"] = 15] = "DATA_LOSS"; Status[Status["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED"; })(Status = exports.Status || (exports.Status = {})); var LogVerbosity; (function (LogVerbosity) { LogVerbosity[LogVerbosity["DEBUG"] = 0] = "DEBUG"; LogVerbosity[LogVerbosity["INFO"] = 1] = "INFO"; LogVerbosity[LogVerbosity["ERROR"] = 2] = "ERROR"; LogVerbosity[LogVerbosity["NONE"] = 3] = "NONE"; })(LogVerbosity = exports.LogVerbosity || (exports.LogVerbosity = {})); /** * NOTE: This enum is not currently used in any implemented API in this * library. It is included only for type parity with the other implementation. */ var Propagate; (function (Propagate) { Propagate[Propagate["DEADLINE"] = 1] = "DEADLINE"; Propagate[Propagate["CENSUS_STATS_CONTEXT"] = 2] = "CENSUS_STATS_CONTEXT"; Propagate[Propagate["CENSUS_TRACING_CONTEXT"] = 4] = "CENSUS_TRACING_CONTEXT"; Propagate[Propagate["CANCELLATION"] = 8] = "CANCELLATION"; // https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/propagation_bits.h#L43 Propagate[Propagate["DEFAULTS"] = 65535] = "DEFAULTS"; })(Propagate = exports.Propagate || (exports.Propagate = {})); // -1 means unlimited exports.DEFAULT_MAX_SEND_MESSAGE_LENGTH = -1; // 4 MB default exports.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH = 4 * 1024 * 1024; //# sourceMappingURL=constants.js.map /***/ }), /***/ 81217: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DeadlineFilterFactory = exports.DeadlineFilter = void 0; const constants_1 = __webpack_require__(90634); const filter_1 = __webpack_require__(43392); const units = [ ['m', 1], ['S', 1000], ['M', 60 * 1000], ['H', 60 * 60 * 1000], ]; function getDeadline(deadline) { const now = new Date().getTime(); const timeoutMs = Math.max(deadline - now, 0); for (const [unit, factor] of units) { const amount = timeoutMs / factor; if (amount < 1e8) { return String(Math.ceil(amount)) + unit; } } throw new Error('Deadline is too far in the future'); } class DeadlineFilter extends filter_1.BaseFilter { constructor(channel, callStream) { super(); this.channel = channel; this.callStream = callStream; this.timer = null; this.deadline = Infinity; this.retreiveDeadline(); this.runTimer(); } retreiveDeadline() { const callDeadline = this.callStream.getDeadline(); if (callDeadline instanceof Date) { this.deadline = callDeadline.getTime(); } else { this.deadline = callDeadline; } } runTimer() { var _a, _b; if (this.timer) { clearTimeout(this.timer); } const now = new Date().getTime(); const timeout = this.deadline - now; if (timeout <= 0) { process.nextTick(() => { this.callStream.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, 'Deadline exceeded'); }); } else if (this.deadline !== Infinity) { this.timer = setTimeout(() => { this.callStream.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, 'Deadline exceeded'); }, timeout); (_b = (_a = this.timer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); } } refresh() { this.retreiveDeadline(); this.runTimer(); } async sendMetadata(metadata) { if (this.deadline === Infinity) { return metadata; } /* The input metadata promise depends on the original channel.connect() * promise, so when it is complete that implies that the channel is * connected */ const finalMetadata = await metadata; const timeoutString = getDeadline(this.deadline); finalMetadata.set('grpc-timeout', timeoutString); return finalMetadata; } receiveTrailers(status) { if (this.timer) { clearTimeout(this.timer); } return status; } } exports.DeadlineFilter = DeadlineFilter; class DeadlineFilterFactory { constructor(channel) { this.channel = channel; } createFilter(callStream) { return new DeadlineFilter(this.channel, callStream); } } exports.DeadlineFilterFactory = DeadlineFilterFactory; //# sourceMappingURL=deadline-filter.js.map /***/ }), /***/ 37626: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var logging_1 = __webpack_require__(35993); Object.defineProperty(exports, "trace", ({ enumerable: true, get: function () { return logging_1.trace; } })); var resolver_1 = __webpack_require__(31594); Object.defineProperty(exports, "registerResolver", ({ enumerable: true, get: function () { return resolver_1.registerResolver; } })); var uri_parser_1 = __webpack_require__(65974); Object.defineProperty(exports, "uriToString", ({ enumerable: true, get: function () { return uri_parser_1.uriToString; } })); var backoff_timeout_1 = __webpack_require__(34186); Object.defineProperty(exports, "BackoffTimeout", ({ enumerable: true, get: function () { return backoff_timeout_1.BackoffTimeout; } })); var load_balancer_1 = __webpack_require__(52680); Object.defineProperty(exports, "createChildChannelControlHelper", ({ enumerable: true, get: function () { return load_balancer_1.createChildChannelControlHelper; } })); Object.defineProperty(exports, "registerLoadBalancerType", ({ enumerable: true, get: function () { return load_balancer_1.registerLoadBalancerType; } })); Object.defineProperty(exports, "getFirstUsableConfig", ({ enumerable: true, get: function () { return load_balancer_1.getFirstUsableConfig; } })); Object.defineProperty(exports, "validateLoadBalancingConfig", ({ enumerable: true, get: function () { return load_balancer_1.validateLoadBalancingConfig; } })); var subchannel_address_1 = __webpack_require__(99905); Object.defineProperty(exports, "subchannelAddressToString", ({ enumerable: true, get: function () { return subchannel_address_1.subchannelAddressToString; } })); var load_balancer_child_handler_1 = __webpack_require__(17559); Object.defineProperty(exports, "ChildLoadBalancerHandler", ({ enumerable: true, get: function () { return load_balancer_child_handler_1.ChildLoadBalancerHandler; } })); var picker_1 = __webpack_require__(81611); Object.defineProperty(exports, "UnavailablePicker", ({ enumerable: true, get: function () { return picker_1.UnavailablePicker; } })); Object.defineProperty(exports, "QueuePicker", ({ enumerable: true, get: function () { return picker_1.QueuePicker; } })); Object.defineProperty(exports, "PickResultType", ({ enumerable: true, get: function () { return picker_1.PickResultType; } })); var filter_1 = __webpack_require__(43392); Object.defineProperty(exports, "BaseFilter", ({ enumerable: true, get: function () { return filter_1.BaseFilter; } })); var filter_stack_1 = __webpack_require__(66450); Object.defineProperty(exports, "FilterStackFactory", ({ enumerable: true, get: function () { return filter_stack_1.FilterStackFactory; } })); var admin_1 = __webpack_require__(8258); Object.defineProperty(exports, "registerAdminService", ({ enumerable: true, get: function () { return admin_1.registerAdminService; } })); //# sourceMappingURL=experimental.js.map /***/ }), /***/ 66450: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FilterStackFactory = exports.FilterStack = void 0; class FilterStack { constructor(filters) { this.filters = filters; } sendMetadata(metadata) { let result = metadata; for (let i = 0; i < this.filters.length; i++) { result = this.filters[i].sendMetadata(result); } return result; } receiveMetadata(metadata) { let result = metadata; for (let i = this.filters.length - 1; i >= 0; i--) { result = this.filters[i].receiveMetadata(result); } return result; } sendMessage(message) { let result = message; for (let i = 0; i < this.filters.length; i++) { result = this.filters[i].sendMessage(result); } return result; } receiveMessage(message) { let result = message; for (let i = this.filters.length - 1; i >= 0; i--) { result = this.filters[i].receiveMessage(result); } return result; } receiveTrailers(status) { let result = status; for (let i = this.filters.length - 1; i >= 0; i--) { result = this.filters[i].receiveTrailers(result); } return result; } refresh() { for (const filter of this.filters) { filter.refresh(); } } push(filters) { this.filters.unshift(...filters); } getFilters() { return this.filters; } } exports.FilterStack = FilterStack; class FilterStackFactory { constructor(factories) { this.factories = factories; } push(filterFactories) { this.factories.unshift(...filterFactories); } createFilter(callStream) { return new FilterStack(this.factories.map((factory) => factory.createFilter(callStream))); } } exports.FilterStackFactory = FilterStackFactory; //# sourceMappingURL=filter-stack.js.map /***/ }), /***/ 43392: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BaseFilter = void 0; class BaseFilter { async sendMetadata(metadata) { return metadata; } receiveMetadata(metadata) { return metadata; } async sendMessage(message) { return message; } async receiveMessage(message) { return message; } receiveTrailers(status) { return status; } refresh() { } } exports.BaseFilter = BaseFilter; //# sourceMappingURL=filter.js.map /***/ }), /***/ 24000: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getProxiedConnection = exports.mapProxyName = void 0; const logging_1 = __webpack_require__(35993); const constants_1 = __webpack_require__(90634); const resolver_1 = __webpack_require__(31594); const http = __webpack_require__(98605); const tls = __webpack_require__(4016); const logging = __webpack_require__(35993); const subchannel_address_1 = __webpack_require__(99905); const uri_parser_1 = __webpack_require__(65974); const url_1 = __webpack_require__(78835); const TRACER_NAME = 'proxy'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); } function getProxyInfo() { let proxyEnv = ''; let envVar = ''; /* Prefer using 'grpc_proxy'. Fallback on 'http_proxy' if it is not set. * Also prefer using 'https_proxy' with fallback on 'http_proxy'. The * fallback behavior can be removed if there's a demand for it. */ if (process.env.grpc_proxy) { envVar = 'grpc_proxy'; proxyEnv = process.env.grpc_proxy; } else if (process.env.https_proxy) { envVar = 'https_proxy'; proxyEnv = process.env.https_proxy; } else if (process.env.http_proxy) { envVar = 'http_proxy'; proxyEnv = process.env.http_proxy; } else { return {}; } let proxyUrl; try { proxyUrl = new url_1.URL(proxyEnv); } catch (e) { logging_1.log(constants_1.LogVerbosity.ERROR, `cannot parse value of "${envVar}" env var`); return {}; } if (proxyUrl.protocol !== 'http:') { logging_1.log(constants_1.LogVerbosity.ERROR, `"${proxyUrl.protocol}" scheme not supported in proxy URI`); return {}; } let userCred = null; if (proxyUrl.username) { if (proxyUrl.password) { logging_1.log(constants_1.LogVerbosity.INFO, 'userinfo found in proxy URI'); userCred = `${proxyUrl.username}:${proxyUrl.password}`; } else { userCred = proxyUrl.username; } } const hostname = proxyUrl.hostname; let port = proxyUrl.port; /* The proxy URL uses the scheme "http:", which has a default port number of * 80. We need to set that explicitly here if it is omitted because otherwise * it will use gRPC's default port 443. */ if (port === '') { port = '80'; } const result = { address: `${hostname}:${port}`, }; if (userCred) { result.creds = userCred; } trace('Proxy server ' + result.address + ' set by environment variable ' + envVar); return result; } function getNoProxyHostList() { /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */ let noProxyStr = process.env.no_grpc_proxy; let envVar = 'no_grpc_proxy'; if (!noProxyStr) { noProxyStr = process.env.no_proxy; envVar = 'no_proxy'; } if (noProxyStr) { trace('No proxy server list set by environment variable ' + envVar); return noProxyStr.split(','); } else { return []; } } function mapProxyName(target, options) { var _a; const noProxyResult = { target: target, extraOptions: {}, }; if (((_a = options['grpc.enable_http_proxy']) !== null && _a !== void 0 ? _a : 1) === 0) { return noProxyResult; } const proxyInfo = getProxyInfo(); if (!proxyInfo.address) { return noProxyResult; } const hostPort = uri_parser_1.splitHostPort(target.path); if (!hostPort) { return noProxyResult; } const serverHost = hostPort.host; for (const host of getNoProxyHostList()) { if (host === serverHost) { trace('Not using proxy for target in no_proxy list: ' + uri_parser_1.uriToString(target)); return noProxyResult; } } const extraOptions = { 'grpc.http_connect_target': uri_parser_1.uriToString(target), }; if (proxyInfo.creds) { extraOptions['grpc.http_connect_creds'] = proxyInfo.creds; } return { target: { scheme: 'dns', path: proxyInfo.address, }, extraOptions: extraOptions, }; } exports.mapProxyName = mapProxyName; function getProxiedConnection(address, channelOptions, connectionOptions) { if (!('grpc.http_connect_target' in channelOptions)) { return Promise.resolve({}); } const realTarget = channelOptions['grpc.http_connect_target']; const parsedTarget = uri_parser_1.parseUri(realTarget); if (parsedTarget === null) { return Promise.resolve({}); } const options = { method: 'CONNECT', path: parsedTarget.path, }; const headers = { Host: parsedTarget.path, }; // Connect to the subchannel address as a proxy if (subchannel_address_1.isTcpSubchannelAddress(address)) { options.host = address.host; options.port = address.port; } else { options.socketPath = address.path; } if ('grpc.http_connect_creds' in channelOptions) { headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(channelOptions['grpc.http_connect_creds']).toString('base64'); } options.headers = headers; const proxyAddressString = subchannel_address_1.subchannelAddressToString(address); trace('Using proxy ' + proxyAddressString + ' to connect to ' + options.path); return new Promise((resolve, reject) => { const request = http.request(options); request.once('connect', (res, socket, head) => { var _a; request.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode === 200) { trace('Successfully connected to ' + options.path + ' through proxy ' + proxyAddressString); if ('secureContext' in connectionOptions) { /* The proxy is connecting to a TLS server, so upgrade this socket * connection to a TLS connection. * This is a workaround for https://github.com/nodejs/node/issues/32922 * See https://github.com/grpc/grpc-node/pull/1369 for more info. */ const targetPath = resolver_1.getDefaultAuthority(parsedTarget); const hostPort = uri_parser_1.splitHostPort(targetPath); const remoteHost = (_a = hostPort === null || hostPort === void 0 ? void 0 : hostPort.host) !== null && _a !== void 0 ? _a : targetPath; const cts = tls.connect(Object.assign({ host: remoteHost, servername: remoteHost, socket: socket }, connectionOptions), () => { trace('Successfully established a TLS connection to ' + options.path + ' through proxy ' + proxyAddressString); resolve({ socket: cts, realTarget: parsedTarget }); }); cts.on('error', (error) => { trace('Failed to establish a TLS connection to ' + options.path + ' through proxy ' + proxyAddressString + ' with error ' + error.message); reject(); }); } else { trace('Successfully established a plaintext connection to ' + options.path + ' through proxy ' + proxyAddressString); resolve({ socket, realTarget: parsedTarget, }); } } else { logging_1.log(constants_1.LogVerbosity.ERROR, 'Failed to connect to ' + options.path + ' through proxy ' + proxyAddressString + ' with status ' + res.statusCode); reject(); } }); request.once('error', (err) => { request.removeAllListeners(); logging_1.log(constants_1.LogVerbosity.ERROR, 'Failed to connect to proxy ' + proxyAddressString + ' with error ' + err.message); reject(); }); request.end(); }); } exports.getProxiedConnection = getProxiedConnection; //# sourceMappingURL=http_proxy.js.map /***/ }), /***/ 7025: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.experimental = exports.StatusBuilder = exports.getClientChannel = exports.ServerCredentials = exports.Server = exports.setLogVerbosity = exports.setLogger = exports.load = exports.loadObject = exports.CallCredentials = exports.ChannelCredentials = exports.waitForClientReady = exports.closeClient = exports.Channel = exports.makeGenericClientConstructor = exports.makeClientConstructor = exports.loadPackageDefinition = exports.Client = exports.propagate = exports.connectivityState = exports.status = exports.logVerbosity = exports.Metadata = exports.credentials = void 0; const call_credentials_1 = __webpack_require__(21426); Object.defineProperty(exports, "CallCredentials", ({ enumerable: true, get: function () { return call_credentials_1.CallCredentials; } })); const channel_1 = __webpack_require__(13860); Object.defineProperty(exports, "Channel", ({ enumerable: true, get: function () { return channel_1.ChannelImplementation; } })); const connectivity_state_1 = __webpack_require__(80878); Object.defineProperty(exports, "connectivityState", ({ enumerable: true, get: function () { return connectivity_state_1.ConnectivityState; } })); const channel_credentials_1 = __webpack_require__(44030); Object.defineProperty(exports, "ChannelCredentials", ({ enumerable: true, get: function () { return channel_credentials_1.ChannelCredentials; } })); const client_1 = __webpack_require__(87172); Object.defineProperty(exports, "Client", ({ enumerable: true, get: function () { return client_1.Client; } })); const constants_1 = __webpack_require__(90634); Object.defineProperty(exports, "logVerbosity", ({ enumerable: true, get: function () { return constants_1.LogVerbosity; } })); Object.defineProperty(exports, "status", ({ enumerable: true, get: function () { return constants_1.Status; } })); Object.defineProperty(exports, "propagate", ({ enumerable: true, get: function () { return constants_1.Propagate; } })); const logging = __webpack_require__(35993); const make_client_1 = __webpack_require__(38541); Object.defineProperty(exports, "loadPackageDefinition", ({ enumerable: true, get: function () { return make_client_1.loadPackageDefinition; } })); Object.defineProperty(exports, "makeClientConstructor", ({ enumerable: true, get: function () { return make_client_1.makeClientConstructor; } })); Object.defineProperty(exports, "makeGenericClientConstructor", ({ enumerable: true, get: function () { return make_client_1.makeClientConstructor; } })); const metadata_1 = __webpack_require__(83665); Object.defineProperty(exports, "Metadata", ({ enumerable: true, get: function () { return metadata_1.Metadata; } })); const server_1 = __webpack_require__(33389); Object.defineProperty(exports, "Server", ({ enumerable: true, get: function () { return server_1.Server; } })); const server_credentials_1 = __webpack_require__(63828); Object.defineProperty(exports, "ServerCredentials", ({ enumerable: true, get: function () { return server_credentials_1.ServerCredentials; } })); const status_builder_1 = __webpack_require__(73155); Object.defineProperty(exports, "StatusBuilder", ({ enumerable: true, get: function () { return status_builder_1.StatusBuilder; } })); /**** Client Credentials ****/ // Using assign only copies enumerable properties, which is what we want exports.credentials = { /** * Combine a ChannelCredentials with any number of CallCredentials into a * single ChannelCredentials object. * @param channelCredentials The ChannelCredentials object. * @param callCredentials Any number of CallCredentials objects. * @return The resulting ChannelCredentials object. */ combineChannelCredentials: (channelCredentials, ...callCredentials) => { return callCredentials.reduce((acc, other) => acc.compose(other), channelCredentials); }, /** * Combine any number of CallCredentials into a single CallCredentials * object. * @param first The first CallCredentials object. * @param additional Any number of additional CallCredentials objects. * @return The resulting CallCredentials object. */ combineCallCredentials: (first, ...additional) => { return additional.reduce((acc, other) => acc.compose(other), first); }, // from channel-credentials.ts createInsecure: channel_credentials_1.ChannelCredentials.createInsecure, createSsl: channel_credentials_1.ChannelCredentials.createSsl, // from call-credentials.ts createFromMetadataGenerator: call_credentials_1.CallCredentials.createFromMetadataGenerator, createFromGoogleCredential: call_credentials_1.CallCredentials.createFromGoogleCredential, createEmpty: call_credentials_1.CallCredentials.createEmpty, }; /** * Close a Client object. * @param client The client to close. */ exports.closeClient = (client) => client.close(); exports.waitForClientReady = (client, deadline, callback) => client.waitForReady(deadline, callback); /* eslint-enable @typescript-eslint/no-explicit-any */ /**** Unimplemented function stubs ****/ /* eslint-disable @typescript-eslint/no-explicit-any */ exports.loadObject = (value, options) => { throw new Error('Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead'); }; exports.load = (filename, format, options) => { throw new Error('Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead'); }; exports.setLogger = (logger) => { logging.setLogger(logger); }; exports.setLogVerbosity = (verbosity) => { logging.setLoggerVerbosity(verbosity); }; exports.getClientChannel = (client) => { return client_1.Client.prototype.getChannel.call(client); }; var client_interceptors_1 = __webpack_require__(82127); Object.defineProperty(exports, "ListenerBuilder", ({ enumerable: true, get: function () { return client_interceptors_1.ListenerBuilder; } })); Object.defineProperty(exports, "RequesterBuilder", ({ enumerable: true, get: function () { return client_interceptors_1.RequesterBuilder; } })); Object.defineProperty(exports, "InterceptingCall", ({ enumerable: true, get: function () { return client_interceptors_1.InterceptingCall; } })); Object.defineProperty(exports, "InterceptorConfigurationError", ({ enumerable: true, get: function () { return client_interceptors_1.InterceptorConfigurationError; } })); var channelz_1 = __webpack_require__(79975); Object.defineProperty(exports, "getChannelzServiceDefinition", ({ enumerable: true, get: function () { return channelz_1.getChannelzServiceDefinition; } })); Object.defineProperty(exports, "getChannelzHandlers", ({ enumerable: true, get: function () { return channelz_1.getChannelzHandlers; } })); var admin_1 = __webpack_require__(8258); Object.defineProperty(exports, "addAdminServicesToServer", ({ enumerable: true, get: function () { return admin_1.addAdminServicesToServer; } })); const experimental = __webpack_require__(37626); exports.experimental = experimental; const resolver_dns = __webpack_require__(54886); const resolver_uds = __webpack_require__(5252); const resolver_ip = __webpack_require__(97902); const load_balancer_pick_first = __webpack_require__(38977); const load_balancer_round_robin = __webpack_require__(92787); const channelz = __webpack_require__(79975); const clientVersion = __webpack_require__(68160)/* .version */ .i8; (() => { logging.trace(constants_1.LogVerbosity.DEBUG, 'index', 'Loading @grpc/grpc-js version ' + clientVersion); resolver_dns.setup(); resolver_uds.setup(); resolver_ip.setup(); load_balancer_pick_first.setup(); load_balancer_round_robin.setup(); channelz.setup(); })(); //# sourceMappingURL=index.js.map /***/ }), /***/ 17559: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ChildLoadBalancerHandler = void 0; const load_balancer_1 = __webpack_require__(52680); const connectivity_state_1 = __webpack_require__(80878); const TYPE_NAME = 'child_load_balancer_helper'; class ChildLoadBalancerHandler { constructor(channelControlHelper) { this.channelControlHelper = channelControlHelper; this.currentChild = null; this.pendingChild = null; this.ChildPolicyHelper = class { constructor(parent) { this.parent = parent; this.child = null; } createSubchannel(subchannelAddress, subchannelArgs) { return this.parent.channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs); } updateState(connectivityState, picker) { var _a; if (this.calledByPendingChild()) { if (connectivityState !== connectivity_state_1.ConnectivityState.READY) { return; } (_a = this.parent.currentChild) === null || _a === void 0 ? void 0 : _a.destroy(); this.parent.currentChild = this.parent.pendingChild; this.parent.pendingChild = null; } else if (!this.calledByCurrentChild()) { return; } this.parent.channelControlHelper.updateState(connectivityState, picker); } requestReresolution() { var _a; const latestChild = (_a = this.parent.pendingChild) !== null && _a !== void 0 ? _a : this.parent.currentChild; if (this.child === latestChild) { this.parent.channelControlHelper.requestReresolution(); } } setChild(newChild) { this.child = newChild; } addChannelzChild(child) { this.parent.channelControlHelper.addChannelzChild(child); } removeChannelzChild(child) { this.parent.channelControlHelper.removeChannelzChild(child); } calledByPendingChild() { return this.child === this.parent.pendingChild; } calledByCurrentChild() { return this.child === this.parent.currentChild; } }; } /** * Prerequisites: lbConfig !== null and lbConfig.name is registered * @param addressList * @param lbConfig * @param attributes */ updateAddressList(addressList, lbConfig, attributes) { let childToUpdate; if (this.currentChild === null || this.currentChild.getTypeName() !== lbConfig.getLoadBalancerName()) { const newHelper = new this.ChildPolicyHelper(this); const newChild = load_balancer_1.createLoadBalancer(lbConfig, newHelper); newHelper.setChild(newChild); if (this.currentChild === null) { this.currentChild = newChild; childToUpdate = this.currentChild; } else { if (this.pendingChild) { this.pendingChild.destroy(); } this.pendingChild = newChild; childToUpdate = this.pendingChild; } } else { if (this.pendingChild === null) { childToUpdate = this.currentChild; } else { childToUpdate = this.pendingChild; } } childToUpdate.updateAddressList(addressList, lbConfig, attributes); } exitIdle() { if (this.currentChild) { this.currentChild.resetBackoff(); if (this.pendingChild) { this.pendingChild.resetBackoff(); } } } resetBackoff() { if (this.currentChild) { this.currentChild.resetBackoff(); if (this.pendingChild) { this.pendingChild.resetBackoff(); } } } destroy() { if (this.currentChild) { this.currentChild.destroy(); this.currentChild = null; } if (this.pendingChild) { this.pendingChild.destroy(); this.pendingChild = null; } } getTypeName() { return TYPE_NAME; } } exports.ChildLoadBalancerHandler = ChildLoadBalancerHandler; //# sourceMappingURL=load-balancer-child-handler.js.map /***/ }), /***/ 38977: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = exports.PickFirstLoadBalancer = exports.PickFirstLoadBalancingConfig = void 0; const load_balancer_1 = __webpack_require__(52680); const connectivity_state_1 = __webpack_require__(80878); const picker_1 = __webpack_require__(81611); const subchannel_address_1 = __webpack_require__(99905); const logging = __webpack_require__(35993); const constants_1 = __webpack_require__(90634); const TRACER_NAME = 'pick_first'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); } const TYPE_NAME = 'pick_first'; /** * Delay after starting a connection on a subchannel before starting a * connection on the next subchannel in the list, for Happy Eyeballs algorithm. */ const CONNECTION_DELAY_INTERVAL_MS = 250; class PickFirstLoadBalancingConfig { getLoadBalancerName() { return TYPE_NAME; } constructor() { } toJsonObject() { return { [TYPE_NAME]: {}, }; } // eslint-disable-next-line @typescript-eslint/no-explicit-any static createFromJson(obj) { return new PickFirstLoadBalancingConfig(); } } exports.PickFirstLoadBalancingConfig = PickFirstLoadBalancingConfig; /** * Picker for a `PickFirstLoadBalancer` in the READY state. Always returns the * picked subchannel. */ class PickFirstPicker { constructor(subchannel) { this.subchannel = subchannel; } pick(pickArgs) { return { pickResultType: picker_1.PickResultType.COMPLETE, subchannel: this.subchannel, status: null, extraFilterFactories: [], onCallStarted: null, }; } } class PickFirstLoadBalancer { /** * Load balancer that attempts to connect to each backend in the address list * in order, and picks the first one that connects, using it for every * request. * @param channelControlHelper `ChannelControlHelper` instance provided by * this load balancer's owner. */ constructor(channelControlHelper) { this.channelControlHelper = channelControlHelper; /** * The list of backend addresses most recently passed to `updateAddressList`. */ this.latestAddressList = []; /** * The list of subchannels this load balancer is currently attempting to * connect to. */ this.subchannels = []; /** * The current connectivity state of the load balancer. */ this.currentState = connectivity_state_1.ConnectivityState.IDLE; /** * The index within the `subchannels` array of the subchannel with the most * recently started connection attempt. */ this.currentSubchannelIndex = 0; /** * The currently picked subchannel used for making calls. Populated if * and only if the load balancer's current state is READY. In that case, * the subchannel's current state is also READY. */ this.currentPick = null; this.triedAllSubchannels = false; this.subchannelStateCounts = { [connectivity_state_1.ConnectivityState.CONNECTING]: 0, [connectivity_state_1.ConnectivityState.IDLE]: 0, [connectivity_state_1.ConnectivityState.READY]: 0, [connectivity_state_1.ConnectivityState.SHUTDOWN]: 0, [connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE]: 0, }; this.subchannelStateListener = (subchannel, previousState, newState) => { this.subchannelStateCounts[previousState] -= 1; this.subchannelStateCounts[newState] += 1; /* If the subchannel we most recently attempted to start connecting * to goes into TRANSIENT_FAILURE, immediately try to start * connecting to the next one instead of waiting for the connection * delay timer. */ if (subchannel === this.subchannels[this.currentSubchannelIndex] && newState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { this.startNextSubchannelConnecting(); } if (newState === connectivity_state_1.ConnectivityState.READY) { this.pickSubchannel(subchannel); return; } else { if (this.triedAllSubchannels && this.subchannelStateCounts[connectivity_state_1.ConnectivityState.IDLE] === this.subchannels.length) { /* If all of the subchannels are IDLE we should go back to a * basic IDLE state where there is no subchannel list to avoid * holding unused resources */ this.resetSubchannelList(); this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this)); return; } if (this.currentPick === null) { if (this.triedAllSubchannels) { let newLBState; if (this.subchannelStateCounts[connectivity_state_1.ConnectivityState.CONNECTING] > 0) { newLBState = connectivity_state_1.ConnectivityState.CONNECTING; } else if (this.subchannelStateCounts[connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE] > 0) { newLBState = connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE; } else { newLBState = connectivity_state_1.ConnectivityState.IDLE; } if (newLBState !== this.currentState) { if (newLBState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { this.updateState(newLBState, new picker_1.UnavailablePicker()); } else { this.updateState(newLBState, new picker_1.QueuePicker(this)); } } } else { this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this)); } } } }; this.pickedSubchannelStateListener = (subchannel, previousState, newState) => { if (newState !== connectivity_state_1.ConnectivityState.READY) { this.currentPick = null; subchannel.unref(); subchannel.removeConnectivityStateListener(this.pickedSubchannelStateListener); this.channelControlHelper.removeChannelzChild(subchannel.getChannelzRef()); if (this.subchannels.length > 0) { if (this.triedAllSubchannels) { let newLBState; if (this.subchannelStateCounts[connectivity_state_1.ConnectivityState.CONNECTING] > 0) { newLBState = connectivity_state_1.ConnectivityState.CONNECTING; } else if (this.subchannelStateCounts[connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE] > 0) { newLBState = connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE; } else { newLBState = connectivity_state_1.ConnectivityState.IDLE; } if (newLBState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { this.updateState(newLBState, new picker_1.UnavailablePicker()); } else { this.updateState(newLBState, new picker_1.QueuePicker(this)); } } else { this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this)); } } else { /* We don't need to backoff here because this only happens if a * subchannel successfully connects then disconnects, so it will not * create a loop of attempting to connect to an unreachable backend */ this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this)); } } }; this.connectionDelayTimeout = setTimeout(() => { }, 0); clearTimeout(this.connectionDelayTimeout); } startNextSubchannelConnecting() { if (this.triedAllSubchannels) { return; } for (const [index, subchannel] of this.subchannels.entries()) { if (index > this.currentSubchannelIndex) { const subchannelState = subchannel.getConnectivityState(); if (subchannelState === connectivity_state_1.ConnectivityState.IDLE || subchannelState === connectivity_state_1.ConnectivityState.CONNECTING) { this.startConnecting(index); return; } } } this.triedAllSubchannels = true; } /** * Have a single subchannel in the `subchannels` list start connecting. * @param subchannelIndex The index into the `subchannels` list. */ startConnecting(subchannelIndex) { clearTimeout(this.connectionDelayTimeout); this.currentSubchannelIndex = subchannelIndex; if (this.subchannels[subchannelIndex].getConnectivityState() === connectivity_state_1.ConnectivityState.IDLE) { trace('Start connecting to subchannel with address ' + this.subchannels[subchannelIndex].getAddress()); process.nextTick(() => { this.subchannels[subchannelIndex].startConnecting(); }); } this.connectionDelayTimeout = setTimeout(() => { this.startNextSubchannelConnecting(); }, CONNECTION_DELAY_INTERVAL_MS); } pickSubchannel(subchannel) { trace('Pick subchannel with address ' + subchannel.getAddress()); if (this.currentPick !== null) { this.currentPick.unref(); this.currentPick.removeConnectivityStateListener(this.pickedSubchannelStateListener); } this.currentPick = subchannel; this.updateState(connectivity_state_1.ConnectivityState.READY, new PickFirstPicker(subchannel)); subchannel.addConnectivityStateListener(this.pickedSubchannelStateListener); subchannel.ref(); this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef()); this.resetSubchannelList(); clearTimeout(this.connectionDelayTimeout); } updateState(newState, picker) { trace(connectivity_state_1.ConnectivityState[this.currentState] + ' -> ' + connectivity_state_1.ConnectivityState[newState]); this.currentState = newState; this.channelControlHelper.updateState(newState, picker); } resetSubchannelList() { for (const subchannel of this.subchannels) { subchannel.removeConnectivityStateListener(this.subchannelStateListener); subchannel.unref(); this.channelControlHelper.removeChannelzChild(subchannel.getChannelzRef()); } this.currentSubchannelIndex = 0; this.subchannelStateCounts = { [connectivity_state_1.ConnectivityState.CONNECTING]: 0, [connectivity_state_1.ConnectivityState.IDLE]: 0, [connectivity_state_1.ConnectivityState.READY]: 0, [connectivity_state_1.ConnectivityState.SHUTDOWN]: 0, [connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE]: 0, }; this.subchannels = []; this.triedAllSubchannels = false; } /** * Start connecting to the address list most recently passed to * `updateAddressList`. */ connectToAddressList() { this.resetSubchannelList(); trace('Connect to address list ' + this.latestAddressList.map((address) => subchannel_address_1.subchannelAddressToString(address))); this.subchannels = this.latestAddressList.map((address) => this.channelControlHelper.createSubchannel(address, {})); for (const subchannel of this.subchannels) { subchannel.ref(); this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef()); } for (const subchannel of this.subchannels) { subchannel.addConnectivityStateListener(this.subchannelStateListener); this.subchannelStateCounts[subchannel.getConnectivityState()] += 1; if (subchannel.getConnectivityState() === connectivity_state_1.ConnectivityState.READY) { this.pickSubchannel(subchannel); this.resetSubchannelList(); return; } } for (const [index, subchannel] of this.subchannels.entries()) { const subchannelState = subchannel.getConnectivityState(); if (subchannelState === connectivity_state_1.ConnectivityState.IDLE || subchannelState === connectivity_state_1.ConnectivityState.CONNECTING) { this.startConnecting(index); if (this.currentPick === null) { this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this)); } return; } } // If the code reaches this point, every subchannel must be in TRANSIENT_FAILURE if (this.currentPick === null) { this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker()); } } updateAddressList(addressList, lbConfig) { // lbConfig has no useful information for pick first load balancing /* To avoid unnecessary churn, we only do something with this address list * if we're not currently trying to establish a connection, or if the new * address list is different from the existing one */ if (this.subchannels.length === 0 || !this.latestAddressList.every((value, index) => addressList[index] === value)) { this.latestAddressList = addressList; this.connectToAddressList(); } } exitIdle() { for (const subchannel of this.subchannels) { subchannel.startConnecting(); } if (this.currentState === connectivity_state_1.ConnectivityState.IDLE) { if (this.latestAddressList.length > 0) { this.connectToAddressList(); } } if (this.currentState === connectivity_state_1.ConnectivityState.IDLE || this.triedAllSubchannels) { this.channelControlHelper.requestReresolution(); } } resetBackoff() { /* The pick first load balancer does not have a connection backoff, so this * does nothing */ } destroy() { this.resetSubchannelList(); if (this.currentPick !== null) { this.currentPick.unref(); this.currentPick.removeConnectivityStateListener(this.pickedSubchannelStateListener); this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()); } } getTypeName() { return TYPE_NAME; } } exports.PickFirstLoadBalancer = PickFirstLoadBalancer; function setup() { load_balancer_1.registerLoadBalancerType(TYPE_NAME, PickFirstLoadBalancer, PickFirstLoadBalancingConfig); load_balancer_1.registerDefaultLoadBalancerType(TYPE_NAME); } exports.setup = setup; //# sourceMappingURL=load-balancer-pick-first.js.map /***/ }), /***/ 92787: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = exports.RoundRobinLoadBalancer = void 0; const load_balancer_1 = __webpack_require__(52680); const connectivity_state_1 = __webpack_require__(80878); const picker_1 = __webpack_require__(81611); const subchannel_address_1 = __webpack_require__(99905); const logging = __webpack_require__(35993); const constants_1 = __webpack_require__(90634); const TRACER_NAME = 'round_robin'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); } const TYPE_NAME = 'round_robin'; class RoundRobinLoadBalancingConfig { getLoadBalancerName() { return TYPE_NAME; } constructor() { } toJsonObject() { return { [TYPE_NAME]: {}, }; } // eslint-disable-next-line @typescript-eslint/no-explicit-any static createFromJson(obj) { return new RoundRobinLoadBalancingConfig(); } } class RoundRobinPicker { constructor(subchannelList, nextIndex = 0) { this.subchannelList = subchannelList; this.nextIndex = nextIndex; } pick(pickArgs) { const pickedSubchannel = this.subchannelList[this.nextIndex]; this.nextIndex = (this.nextIndex + 1) % this.subchannelList.length; return { pickResultType: picker_1.PickResultType.COMPLETE, subchannel: pickedSubchannel, status: null, extraFilterFactories: [], onCallStarted: null, }; } /** * Check what the next subchannel returned would be. Used by the load * balancer implementation to preserve this part of the picker state if * possible when a subchannel connects or disconnects. */ peekNextSubchannel() { return this.subchannelList[this.nextIndex]; } } class RoundRobinLoadBalancer { constructor(channelControlHelper) { this.channelControlHelper = channelControlHelper; this.subchannels = []; this.currentState = connectivity_state_1.ConnectivityState.IDLE; this.currentReadyPicker = null; this.subchannelStateCounts = { [connectivity_state_1.ConnectivityState.CONNECTING]: 0, [connectivity_state_1.ConnectivityState.IDLE]: 0, [connectivity_state_1.ConnectivityState.READY]: 0, [connectivity_state_1.ConnectivityState.SHUTDOWN]: 0, [connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE]: 0, }; this.subchannelStateListener = (subchannel, previousState, newState) => { this.subchannelStateCounts[previousState] -= 1; this.subchannelStateCounts[newState] += 1; this.calculateAndUpdateState(); if (newState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE || newState === connectivity_state_1.ConnectivityState.IDLE) { this.channelControlHelper.requestReresolution(); subchannel.startConnecting(); } }; } calculateAndUpdateState() { if (this.subchannelStateCounts[connectivity_state_1.ConnectivityState.READY] > 0) { const readySubchannels = this.subchannels.filter((subchannel) => subchannel.getConnectivityState() === connectivity_state_1.ConnectivityState.READY); let index = 0; if (this.currentReadyPicker !== null) { index = readySubchannels.indexOf(this.currentReadyPicker.peekNextSubchannel()); if (index < 0) { index = 0; } } this.updateState(connectivity_state_1.ConnectivityState.READY, new RoundRobinPicker(readySubchannels, index)); } else if (this.subchannelStateCounts[connectivity_state_1.ConnectivityState.CONNECTING] > 0) { this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this)); } else if (this.subchannelStateCounts[connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE] > 0) { this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker()); } else { this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this)); } } updateState(newState, picker) { trace(connectivity_state_1.ConnectivityState[this.currentState] + ' -> ' + connectivity_state_1.ConnectivityState[newState]); if (newState === connectivity_state_1.ConnectivityState.READY) { this.currentReadyPicker = picker; } else { this.currentReadyPicker = null; } this.currentState = newState; this.channelControlHelper.updateState(newState, picker); } resetSubchannelList() { for (const subchannel of this.subchannels) { subchannel.removeConnectivityStateListener(this.subchannelStateListener); subchannel.unref(); this.channelControlHelper.removeChannelzChild(subchannel.getChannelzRef()); } this.subchannelStateCounts = { [connectivity_state_1.ConnectivityState.CONNECTING]: 0, [connectivity_state_1.ConnectivityState.IDLE]: 0, [connectivity_state_1.ConnectivityState.READY]: 0, [connectivity_state_1.ConnectivityState.SHUTDOWN]: 0, [connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE]: 0, }; this.subchannels = []; } updateAddressList(addressList, lbConfig) { this.resetSubchannelList(); trace('Connect to address list ' + addressList.map((address) => subchannel_address_1.subchannelAddressToString(address))); this.subchannels = addressList.map((address) => this.channelControlHelper.createSubchannel(address, {})); for (const subchannel of this.subchannels) { subchannel.ref(); subchannel.addConnectivityStateListener(this.subchannelStateListener); this.channelControlHelper.addChannelzChild(subchannel.getChannelzRef()); const subchannelState = subchannel.getConnectivityState(); this.subchannelStateCounts[subchannelState] += 1; if (subchannelState === connectivity_state_1.ConnectivityState.IDLE || subchannelState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { subchannel.startConnecting(); } } this.calculateAndUpdateState(); } exitIdle() { for (const subchannel of this.subchannels) { subchannel.startConnecting(); } } resetBackoff() { /* The pick first load balancer does not have a connection backoff, so this * does nothing */ } destroy() { this.resetSubchannelList(); } getTypeName() { return TYPE_NAME; } } exports.RoundRobinLoadBalancer = RoundRobinLoadBalancer; function setup() { load_balancer_1.registerLoadBalancerType(TYPE_NAME, RoundRobinLoadBalancer, RoundRobinLoadBalancingConfig); } exports.setup = setup; //# sourceMappingURL=load-balancer-round-robin.js.map /***/ }), /***/ 52680: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateLoadBalancingConfig = exports.getFirstUsableConfig = exports.isLoadBalancerNameRegistered = exports.createLoadBalancer = exports.registerDefaultLoadBalancerType = exports.registerLoadBalancerType = exports.createChildChannelControlHelper = void 0; /** * Create a child ChannelControlHelper that overrides some methods of the * parent while letting others pass through to the parent unmodified. This * allows other code to create these children without needing to know about * all of the methods to be passed through. * @param parent * @param overrides */ function createChildChannelControlHelper(parent, overrides) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; return { createSubchannel: (_b = (_a = overrides.createSubchannel) === null || _a === void 0 ? void 0 : _a.bind(overrides)) !== null && _b !== void 0 ? _b : parent.createSubchannel.bind(parent), updateState: (_d = (_c = overrides.updateState) === null || _c === void 0 ? void 0 : _c.bind(overrides)) !== null && _d !== void 0 ? _d : parent.updateState.bind(parent), requestReresolution: (_f = (_e = overrides.requestReresolution) === null || _e === void 0 ? void 0 : _e.bind(overrides)) !== null && _f !== void 0 ? _f : parent.requestReresolution.bind(parent), addChannelzChild: (_h = (_g = overrides.addChannelzChild) === null || _g === void 0 ? void 0 : _g.bind(overrides)) !== null && _h !== void 0 ? _h : parent.addChannelzChild.bind(parent), removeChannelzChild: (_k = (_j = overrides.removeChannelzChild) === null || _j === void 0 ? void 0 : _j.bind(overrides)) !== null && _k !== void 0 ? _k : parent.removeChannelzChild.bind(parent) }; } exports.createChildChannelControlHelper = createChildChannelControlHelper; const registeredLoadBalancerTypes = {}; let defaultLoadBalancerType = null; function registerLoadBalancerType(typeName, loadBalancerType, loadBalancingConfigType) { registeredLoadBalancerTypes[typeName] = { LoadBalancer: loadBalancerType, LoadBalancingConfig: loadBalancingConfigType, }; } exports.registerLoadBalancerType = registerLoadBalancerType; function registerDefaultLoadBalancerType(typeName) { defaultLoadBalancerType = typeName; } exports.registerDefaultLoadBalancerType = registerDefaultLoadBalancerType; function createLoadBalancer(config, channelControlHelper) { const typeName = config.getLoadBalancerName(); if (typeName in registeredLoadBalancerTypes) { return new registeredLoadBalancerTypes[typeName].LoadBalancer(channelControlHelper); } else { return null; } } exports.createLoadBalancer = createLoadBalancer; function isLoadBalancerNameRegistered(typeName) { return typeName in registeredLoadBalancerTypes; } exports.isLoadBalancerNameRegistered = isLoadBalancerNameRegistered; function getFirstUsableConfig(configs, fallbackTodefault = false) { for (const config of configs) { if (config.getLoadBalancerName() in registeredLoadBalancerTypes) { return config; } } if (fallbackTodefault) { if (defaultLoadBalancerType) { return new registeredLoadBalancerTypes[defaultLoadBalancerType].LoadBalancingConfig(); } else { return null; } } else { return null; } } exports.getFirstUsableConfig = getFirstUsableConfig; // eslint-disable-next-line @typescript-eslint/no-explicit-any function validateLoadBalancingConfig(obj) { if (!(obj !== null && typeof obj === 'object')) { throw new Error('Load balancing config must be an object'); } const keys = Object.keys(obj); if (keys.length !== 1) { throw new Error('Provided load balancing config has multiple conflicting entries'); } const typeName = keys[0]; if (typeName in registeredLoadBalancerTypes) { return registeredLoadBalancerTypes[typeName].LoadBalancingConfig.createFromJson(obj[typeName]); } else { throw new Error(`Unrecognized load balancing config name ${typeName}`); } } exports.validateLoadBalancingConfig = validateLoadBalancingConfig; //# sourceMappingURL=load-balancer.js.map /***/ }), /***/ 35993: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ var _a, _b, _c, _d; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.trace = exports.log = exports.setLoggerVerbosity = exports.setLogger = exports.getLogger = void 0; const constants_1 = __webpack_require__(90634); const DEFAULT_LOGGER = { error: (message, ...optionalParams) => { console.error('E ' + message, ...optionalParams); }, info: (message, ...optionalParams) => { console.error('I ' + message, ...optionalParams); }, debug: (message, ...optionalParams) => { console.error('D ' + message, ...optionalParams); }, }; let _logger = DEFAULT_LOGGER; let _logVerbosity = constants_1.LogVerbosity.ERROR; const verbosityString = (_b = (_a = process.env.GRPC_NODE_VERBOSITY) !== null && _a !== void 0 ? _a : process.env.GRPC_VERBOSITY) !== null && _b !== void 0 ? _b : ''; switch (verbosityString.toUpperCase()) { case 'DEBUG': _logVerbosity = constants_1.LogVerbosity.DEBUG; break; case 'INFO': _logVerbosity = constants_1.LogVerbosity.INFO; break; case 'ERROR': _logVerbosity = constants_1.LogVerbosity.ERROR; break; case 'NONE': _logVerbosity = constants_1.LogVerbosity.NONE; break; default: // Ignore any other values } exports.getLogger = () => { return _logger; }; exports.setLogger = (logger) => { _logger = logger; }; exports.setLoggerVerbosity = (verbosity) => { _logVerbosity = verbosity; }; // eslint-disable-next-line @typescript-eslint/no-explicit-any exports.log = (severity, ...args) => { let logFunction; if (severity >= _logVerbosity) { switch (severity) { case constants_1.LogVerbosity.DEBUG: logFunction = _logger.debug; break; case constants_1.LogVerbosity.INFO: logFunction = _logger.info; break; case constants_1.LogVerbosity.ERROR: logFunction = _logger.error; break; } /* Fall back to _logger.error when other methods are not available for * compatiblity with older behavior that always logged to _logger.error */ if (!logFunction) { logFunction = _logger.error; } if (logFunction) { logFunction.bind(_logger)(...args); } } }; const tracersString = (_d = (_c = process.env.GRPC_NODE_TRACE) !== null && _c !== void 0 ? _c : process.env.GRPC_TRACE) !== null && _d !== void 0 ? _d : ''; const enabledTracers = new Set(); const disabledTracers = new Set(); for (const tracerName of tracersString.split(',')) { if (tracerName.startsWith('-')) { disabledTracers.add(tracerName.substring(1)); } else { enabledTracers.add(tracerName); } } const allEnabled = enabledTracers.has('all'); function trace(severity, tracer, text) { if (!disabledTracers.has(tracer) && (allEnabled || enabledTracers.has(tracer))) { exports.log(severity, new Date().toISOString() + ' | ' + tracer + ' | ' + text); } } exports.trace = trace; //# sourceMappingURL=logging.js.map /***/ }), /***/ 38541: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.loadPackageDefinition = exports.makeClientConstructor = void 0; const client_1 = __webpack_require__(87172); /** * Map with short names for each of the requester maker functions. Used in * makeClientConstructor * @private */ const requesterFuncs = { unary: client_1.Client.prototype.makeUnaryRequest, server_stream: client_1.Client.prototype.makeServerStreamRequest, client_stream: client_1.Client.prototype.makeClientStreamRequest, bidi: client_1.Client.prototype.makeBidiStreamRequest, }; /** * Returns true, if given key is included in the blacklisted * keys. * @param key key for check, string. */ function isPrototypePolluted(key) { return ['__proto__', 'prototype', 'constructor'].includes(key); } /** * Creates a constructor for a client with the given methods, as specified in * the methods argument. The resulting class will have an instance method for * each method in the service, which is a partial application of one of the * [Client]{@link grpc.Client} request methods, depending on `requestSerialize` * and `responseSerialize`, with the `method`, `serialize`, and `deserialize` * arguments predefined. * @param methods An object mapping method names to * method attributes * @param serviceName The fully qualified name of the service * @param classOptions An options object. * @return New client constructor, which is a subclass of * {@link grpc.Client}, and has the same arguments as that constructor. */ function makeClientConstructor(methods, serviceName, classOptions) { if (!classOptions) { classOptions = {}; } class ServiceClientImpl extends client_1.Client { } Object.keys(methods).forEach((name) => { if (isPrototypePolluted(name)) { return; } const attrs = methods[name]; let methodType; // TODO(murgatroid99): Verify that we don't need this anymore if (typeof name === 'string' && name.charAt(0) === '$') { throw new Error('Method names cannot start with $'); } if (attrs.requestStream) { if (attrs.responseStream) { methodType = 'bidi'; } else { methodType = 'client_stream'; } } else { if (attrs.responseStream) { methodType = 'server_stream'; } else { methodType = 'unary'; } } const serialize = attrs.requestSerialize; const deserialize = attrs.responseDeserialize; const methodFunc = partial(requesterFuncs[methodType], attrs.path, serialize, deserialize); ServiceClientImpl.prototype[name] = methodFunc; // Associate all provided attributes with the method Object.assign(ServiceClientImpl.prototype[name], attrs); if (attrs.originalName && !isPrototypePolluted(attrs.originalName)) { ServiceClientImpl.prototype[attrs.originalName] = ServiceClientImpl.prototype[name]; } }); ServiceClientImpl.service = methods; return ServiceClientImpl; } exports.makeClientConstructor = makeClientConstructor; function partial(fn, path, serialize, deserialize) { // eslint-disable-next-line @typescript-eslint/no-explicit-any return function (...args) { return fn.call(this, path, serialize, deserialize, ...args); }; } function isProtobufTypeDefinition(obj) { return 'format' in obj; } /** * Load a gRPC package definition as a gRPC object hierarchy. * @param packageDef The package definition object. * @return The resulting gRPC object. */ function loadPackageDefinition(packageDef) { const result = {}; for (const serviceFqn in packageDef) { if (Object.prototype.hasOwnProperty.call(packageDef, serviceFqn)) { const service = packageDef[serviceFqn]; const nameComponents = serviceFqn.split('.'); if (nameComponents.some((comp) => isPrototypePolluted(comp))) { continue; } const serviceName = nameComponents[nameComponents.length - 1]; let current = result; for (const packageName of nameComponents.slice(0, -1)) { if (!current[packageName]) { current[packageName] = {}; } current = current[packageName]; } if (isProtobufTypeDefinition(service)) { current[serviceName] = service; } else { current[serviceName] = makeClientConstructor(service, serviceName, {}); } } } return result; } exports.loadPackageDefinition = loadPackageDefinition; //# sourceMappingURL=make-client.js.map /***/ }), /***/ 30659: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MaxMessageSizeFilterFactory = exports.MaxMessageSizeFilter = void 0; const filter_1 = __webpack_require__(43392); const constants_1 = __webpack_require__(90634); class MaxMessageSizeFilter extends filter_1.BaseFilter { constructor(options, callStream) { super(); this.options = options; this.callStream = callStream; this.maxSendMessageSize = constants_1.DEFAULT_MAX_SEND_MESSAGE_LENGTH; this.maxReceiveMessageSize = constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH; if ('grpc.max_send_message_length' in options) { this.maxSendMessageSize = options['grpc.max_send_message_length']; } if ('grpc.max_receive_message_length' in options) { this.maxReceiveMessageSize = options['grpc.max_receive_message_length']; } } async sendMessage(message) { /* A configured size of -1 means that there is no limit, so skip the check * entirely */ if (this.maxSendMessageSize === -1) { return message; } else { const concreteMessage = await message; if (concreteMessage.message.length > this.maxSendMessageSize) { this.callStream.cancelWithStatus(constants_1.Status.RESOURCE_EXHAUSTED, `Sent message larger than max (${concreteMessage.message.length} vs. ${this.maxSendMessageSize})`); return Promise.reject('Message too large'); } else { return concreteMessage; } } } async receiveMessage(message) { /* A configured size of -1 means that there is no limit, so skip the check * entirely */ if (this.maxReceiveMessageSize === -1) { return message; } else { const concreteMessage = await message; if (concreteMessage.length > this.maxReceiveMessageSize) { this.callStream.cancelWithStatus(constants_1.Status.RESOURCE_EXHAUSTED, `Received message larger than max (${concreteMessage.length} vs. ${this.maxReceiveMessageSize})`); return Promise.reject('Message too large'); } else { return concreteMessage; } } } } exports.MaxMessageSizeFilter = MaxMessageSizeFilter; class MaxMessageSizeFilterFactory { constructor(options) { this.options = options; } createFilter(callStream) { return new MaxMessageSizeFilter(this.options, callStream); } } exports.MaxMessageSizeFilterFactory = MaxMessageSizeFilterFactory; //# sourceMappingURL=max-message-size-filter.js.map /***/ }), /***/ 83665: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Metadata = void 0; const logging_1 = __webpack_require__(35993); const constants_1 = __webpack_require__(90634); const LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/; const LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/; function isLegalKey(key) { return LEGAL_KEY_REGEX.test(key); } function isLegalNonBinaryValue(value) { return LEGAL_NON_BINARY_VALUE_REGEX.test(value); } function isBinaryKey(key) { return key.endsWith('-bin'); } function isCustomMetadata(key) { return !key.startsWith('grpc-'); } function normalizeKey(key) { return key.toLowerCase(); } function validate(key, value) { if (!isLegalKey(key)) { throw new Error('Metadata key "' + key + '" contains illegal characters'); } if (value !== null && value !== undefined) { if (isBinaryKey(key)) { if (!(value instanceof Buffer)) { throw new Error("keys that end with '-bin' must have Buffer values"); } } else { if (value instanceof Buffer) { throw new Error("keys that don't end with '-bin' must have String values"); } if (!isLegalNonBinaryValue(value)) { throw new Error('Metadata string value "' + value + '" contains illegal characters'); } } } } /** * A class for storing metadata. Keys are normalized to lowercase ASCII. */ class Metadata { constructor(options) { this.internalRepr = new Map(); if (options === undefined) { this.options = {}; } else { this.options = options; } } /** * Sets the given value for the given key by replacing any other values * associated with that key. Normalizes the key. * @param key The key to whose value should be set. * @param value The value to set. Must be a buffer if and only * if the normalized key ends with '-bin'. */ set(key, value) { key = normalizeKey(key); validate(key, value); this.internalRepr.set(key, [value]); } /** * Adds the given value for the given key by appending to a list of previous * values associated with that key. Normalizes the key. * @param key The key for which a new value should be appended. * @param value The value to add. Must be a buffer if and only * if the normalized key ends with '-bin'. */ add(key, value) { key = normalizeKey(key); validate(key, value); const existingValue = this.internalRepr.get(key); if (existingValue === undefined) { this.internalRepr.set(key, [value]); } else { existingValue.push(value); } } /** * Removes the given key and any associated values. Normalizes the key. * @param key The key whose values should be removed. */ remove(key) { key = normalizeKey(key); validate(key); this.internalRepr.delete(key); } /** * Gets a list of all values associated with the key. Normalizes the key. * @param key The key whose value should be retrieved. * @return A list of values associated with the given key. */ get(key) { key = normalizeKey(key); validate(key); return this.internalRepr.get(key) || []; } /** * Gets a plain object mapping each key to the first value associated with it. * This reflects the most common way that people will want to see metadata. * @return A key/value mapping of the metadata. */ getMap() { const result = {}; this.internalRepr.forEach((values, key) => { if (values.length > 0) { const v = values[0]; result[key] = v instanceof Buffer ? v.slice() : v; } }); return result; } /** * Clones the metadata object. * @return The newly cloned object. */ clone() { const newMetadata = new Metadata(this.options); const newInternalRepr = newMetadata.internalRepr; this.internalRepr.forEach((value, key) => { const clonedValue = value.map((v) => { if (v instanceof Buffer) { return Buffer.from(v); } else { return v; } }); newInternalRepr.set(key, clonedValue); }); return newMetadata; } /** * Merges all key-value pairs from a given Metadata object into this one. * If both this object and the given object have values in the same key, * values from the other Metadata object will be appended to this object's * values. * @param other A Metadata object. */ merge(other) { other.internalRepr.forEach((values, key) => { const mergedValue = (this.internalRepr.get(key) || []).concat(values); this.internalRepr.set(key, mergedValue); }); } setOptions(options) { this.options = options; } getOptions() { return this.options; } /** * Creates an OutgoingHttpHeaders object that can be used with the http2 API. */ toHttp2Headers() { // NOTE: Node <8.9 formats http2 headers incorrectly. const result = {}; this.internalRepr.forEach((values, key) => { // We assume that the user's interaction with this object is limited to // through its public API (i.e. keys and values are already validated). result[key] = values.map((value) => { if (value instanceof Buffer) { return value.toString('base64'); } else { return value; } }); }); return result; } // For compatibility with the other Metadata implementation _getCoreRepresentation() { return this.internalRepr; } /** * This modifies the behavior of JSON.stringify to show an object * representation of the metadata map. */ toJSON() { const result = {}; for (const [key, values] of this.internalRepr.entries()) { result[key] = values; } return result; } /** * Returns a new Metadata object based fields in a given IncomingHttpHeaders * object. * @param headers An IncomingHttpHeaders object. */ static fromHttp2Headers(headers) { const result = new Metadata(); Object.keys(headers).forEach((key) => { // Reserved headers (beginning with `:`) are not valid keys. if (key.charAt(0) === ':') { return; } const values = headers[key]; try { if (isBinaryKey(key)) { if (Array.isArray(values)) { values.forEach((value) => { result.add(key, Buffer.from(value, 'base64')); }); } else if (values !== undefined) { if (isCustomMetadata(key)) { values.split(',').forEach((v) => { result.add(key, Buffer.from(v.trim(), 'base64')); }); } else { result.add(key, Buffer.from(values, 'base64')); } } } else { if (Array.isArray(values)) { values.forEach((value) => { result.add(key, value); }); } else if (values !== undefined) { result.add(key, values); } } } catch (error) { const message = `Failed to add metadata entry ${key}: ${values}. ${error.message}. For more information see https://github.com/grpc/grpc-node/issues/1173`; logging_1.log(constants_1.LogVerbosity.ERROR, message); } }); return result; } } exports.Metadata = Metadata; //# sourceMappingURL=metadata.js.map /***/ }), /***/ 81611: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.QueuePicker = exports.UnavailablePicker = exports.PickResultType = void 0; const metadata_1 = __webpack_require__(83665); const constants_1 = __webpack_require__(90634); var PickResultType; (function (PickResultType) { PickResultType[PickResultType["COMPLETE"] = 0] = "COMPLETE"; PickResultType[PickResultType["QUEUE"] = 1] = "QUEUE"; PickResultType[PickResultType["TRANSIENT_FAILURE"] = 2] = "TRANSIENT_FAILURE"; PickResultType[PickResultType["DROP"] = 3] = "DROP"; })(PickResultType = exports.PickResultType || (exports.PickResultType = {})); /** * A standard picker representing a load balancer in the TRANSIENT_FAILURE * state. Always responds to every pick request with an UNAVAILABLE status. */ class UnavailablePicker { constructor(status) { if (status !== undefined) { this.status = status; } else { this.status = { code: constants_1.Status.UNAVAILABLE, details: 'No connection established', metadata: new metadata_1.Metadata(), }; } } pick(pickArgs) { return { pickResultType: PickResultType.TRANSIENT_FAILURE, subchannel: null, status: this.status, extraFilterFactories: [], onCallStarted: null, }; } } exports.UnavailablePicker = UnavailablePicker; /** * A standard picker representing a load balancer in the IDLE or CONNECTING * state. Always responds to every pick request with a QUEUE pick result * indicating that the pick should be tried again with the next `Picker`. Also * reports back to the load balancer that a connection should be established * once any pick is attempted. */ class QueuePicker { // Constructed with a load balancer. Calls exitIdle on it the first time pick is called constructor(loadBalancer) { this.loadBalancer = loadBalancer; this.calledExitIdle = false; } pick(pickArgs) { if (!this.calledExitIdle) { process.nextTick(() => { this.loadBalancer.exitIdle(); }); this.calledExitIdle = true; } return { pickResultType: PickResultType.QUEUE, subchannel: null, status: null, extraFilterFactories: [], onCallStarted: null, }; } } exports.QueuePicker = QueuePicker; //# sourceMappingURL=picker.js.map /***/ }), /***/ 54886: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = void 0; const resolver_1 = __webpack_require__(31594); const dns = __webpack_require__(40881); const util = __webpack_require__(31669); const service_config_1 = __webpack_require__(21761); const constants_1 = __webpack_require__(90634); const metadata_1 = __webpack_require__(83665); const logging = __webpack_require__(35993); const constants_2 = __webpack_require__(90634); const uri_parser_1 = __webpack_require__(65974); const net_1 = __webpack_require__(11631); const TRACER_NAME = 'dns_resolver'; function trace(text) { logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, text); } /** * The default TCP port to connect to if not explicitly specified in the target. */ const DEFAULT_PORT = 443; const resolveTxtPromise = util.promisify(dns.resolveTxt); const dnsLookupPromise = util.promisify(dns.lookup); /** * Merge any number of arrays into a single alternating array * @param arrays */ function mergeArrays(...arrays) { const result = []; for (let i = 0; i < Math.max.apply(null, arrays.map((array) => array.length)); i++) { for (const array of arrays) { if (i < array.length) { result.push(array[i]); } } } return result; } /** * Resolver implementation that handles DNS names and IP addresses. */ class DnsResolver { constructor(target, listener, channelOptions) { var _a, _b; this.target = target; this.listener = listener; this.pendingLookupPromise = null; this.pendingTxtPromise = null; this.latestLookupResult = null; this.latestServiceConfig = null; this.latestServiceConfigError = null; trace('Resolver constructed for target ' + uri_parser_1.uriToString(target)); const hostPort = uri_parser_1.splitHostPort(target.path); if (hostPort === null) { this.ipResult = null; this.dnsHostname = null; this.port = null; } else { if (net_1.isIPv4(hostPort.host) || net_1.isIPv6(hostPort.host)) { this.ipResult = [ { host: hostPort.host, port: (_a = hostPort.port) !== null && _a !== void 0 ? _a : DEFAULT_PORT, }, ]; this.dnsHostname = null; this.port = null; } else { this.ipResult = null; this.dnsHostname = hostPort.host; this.port = (_b = hostPort.port) !== null && _b !== void 0 ? _b : DEFAULT_PORT; } } this.percentage = Math.random() * 100; this.defaultResolutionError = { code: constants_1.Status.UNAVAILABLE, details: `Name resolution failed for target ${uri_parser_1.uriToString(this.target)}`, metadata: new metadata_1.Metadata(), }; } /** * If the target is an IP address, just provide that address as a result. * Otherwise, initiate A, AAAA, and TXT lookups */ startResolution() { if (this.ipResult !== null) { trace('Returning IP address for target ' + uri_parser_1.uriToString(this.target)); setImmediate(() => { this.listener.onSuccessfulResolution(this.ipResult, null, null, null, {}); }); return; } if (this.dnsHostname === null) { setImmediate(() => { this.listener.onError({ code: constants_1.Status.UNAVAILABLE, details: `Failed to parse DNS address ${uri_parser_1.uriToString(this.target)}`, metadata: new metadata_1.Metadata(), }); }); } else { /* We clear out latestLookupResult here to ensure that it contains the * latest result since the last time we started resolving. That way, the * TXT resolution handler can use it, but only if it finishes second. We * don't clear out any previous service config results because it's * better to use a service config that's slightly out of date than to * revert to an effectively blank one. */ this.latestLookupResult = null; const hostname = this.dnsHostname; /* We lookup both address families here and then split them up later * because when looking up a single family, dns.lookup outputs an error * if the name exists but there are no records for that family, and that * error is indistinguishable from other kinds of errors */ this.pendingLookupPromise = dnsLookupPromise(hostname, { all: true }); this.pendingLookupPromise.then((addressList) => { this.pendingLookupPromise = null; const ip4Addresses = addressList.filter((addr) => addr.family === 4); const ip6Addresses = addressList.filter((addr) => addr.family === 6); this.latestLookupResult = mergeArrays(ip6Addresses, ip4Addresses).map((addr) => ({ host: addr.address, port: +this.port })); const allAddressesString = '[' + this.latestLookupResult .map((addr) => addr.host + ':' + addr.port) .join(',') + ']'; trace('Resolved addresses for target ' + uri_parser_1.uriToString(this.target) + ': ' + allAddressesString); if (this.latestLookupResult.length === 0) { this.listener.onError(this.defaultResolutionError); return; } /* If the TXT lookup has not yet finished, both of the last two * arguments will be null, which is the equivalent of getting an * empty TXT response. When the TXT lookup does finish, its handler * can update the service config by using the same address list */ this.listener.onSuccessfulResolution(this.latestLookupResult, this.latestServiceConfig, this.latestServiceConfigError, null, {}); }, (err) => { trace('Resolution error for target ' + uri_parser_1.uriToString(this.target) + ': ' + err.message); this.pendingLookupPromise = null; this.listener.onError(this.defaultResolutionError); }); /* If there already is a still-pending TXT resolution, we can just use * that result when it comes in */ if (this.pendingTxtPromise === null) { /* We handle the TXT query promise differently than the others because * the name resolution attempt as a whole is a success even if the TXT * lookup fails */ this.pendingTxtPromise = resolveTxtPromise(hostname); this.pendingTxtPromise.then((txtRecord) => { this.pendingTxtPromise = null; try { this.latestServiceConfig = service_config_1.extractAndSelectServiceConfig(txtRecord, this.percentage); } catch (err) { this.latestServiceConfigError = { code: constants_1.Status.UNAVAILABLE, details: 'Parsing service config failed', metadata: new metadata_1.Metadata(), }; } if (this.latestLookupResult !== null) { /* We rely here on the assumption that calling this function with * identical parameters will be essentialy idempotent, and calling * it with the same address list and a different service config * should result in a fast and seamless switchover. */ this.listener.onSuccessfulResolution(this.latestLookupResult, this.latestServiceConfig, this.latestServiceConfigError, null, {}); } }, (err) => { /* If TXT lookup fails we should do nothing, which means that we * continue to use the result of the most recent successful lookup, * or the default null config object if there has never been a * successful lookup. We do not set the latestServiceConfigError * here because that is specifically used for response validation * errors. We still need to handle this error so that it does not * bubble up as an unhandled promise rejection. */ }); } } } updateResolution() { trace('Resolution update requested for target ' + uri_parser_1.uriToString(this.target)); if (this.pendingLookupPromise === null) { this.startResolution(); } } destroy() { /* Do nothing. There is not a practical way to cancel in-flight DNS * requests, and after this function is called we can expect that * updateResolution will not be called again. */ } /** * Get the default authority for the given target. For IP targets, that is * the IP address. For DNS targets, it is the hostname. * @param target */ static getDefaultAuthority(target) { return target.path; } } /** * Set up the DNS resolver class by registering it as the handler for the * "dns:" prefix and as the default resolver. */ function setup() { resolver_1.registerResolver('dns', DnsResolver); resolver_1.registerDefaultScheme('dns'); } exports.setup = setup; //# sourceMappingURL=resolver-dns.js.map /***/ }), /***/ 97902: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = void 0; const net_1 = __webpack_require__(11631); const constants_1 = __webpack_require__(90634); const metadata_1 = __webpack_require__(83665); const resolver_1 = __webpack_require__(31594); const uri_parser_1 = __webpack_require__(65974); const logging = __webpack_require__(35993); const TRACER_NAME = 'ip_resolver'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); } const IPV4_SCHEME = 'ipv4'; const IPV6_SCHEME = 'ipv6'; /** * The default TCP port to connect to if not explicitly specified in the target. */ const DEFAULT_PORT = 443; class IpResolver { constructor(target, listener, channelOptions) { var _a; this.target = target; this.listener = listener; this.addresses = []; this.error = null; trace('Resolver constructed for target ' + uri_parser_1.uriToString(target)); const addresses = []; if (!(target.scheme === IPV4_SCHEME || target.scheme === IPV6_SCHEME)) { this.error = { code: constants_1.Status.UNAVAILABLE, details: `Unrecognized scheme ${target.scheme} in IP resolver`, metadata: new metadata_1.Metadata(), }; return; } const pathList = target.path.split(','); for (const path of pathList) { const hostPort = uri_parser_1.splitHostPort(path); if (hostPort === null) { this.error = { code: constants_1.Status.UNAVAILABLE, details: `Failed to parse ${target.scheme} address ${path}`, metadata: new metadata_1.Metadata(), }; return; } if ((target.scheme === IPV4_SCHEME && !net_1.isIPv4(hostPort.host)) || (target.scheme === IPV6_SCHEME && !net_1.isIPv6(hostPort.host))) { this.error = { code: constants_1.Status.UNAVAILABLE, details: `Failed to parse ${target.scheme} address ${path}`, metadata: new metadata_1.Metadata(), }; return; } addresses.push({ host: hostPort.host, port: (_a = hostPort.port) !== null && _a !== void 0 ? _a : DEFAULT_PORT, }); } this.addresses = addresses; trace('Parsed ' + target.scheme + ' address list ' + this.addresses); } updateResolution() { process.nextTick(() => { if (this.error) { this.listener.onError(this.error); } else { this.listener.onSuccessfulResolution(this.addresses, null, null, null, {}); } }); } destroy() { // This resolver owns no resources, so we do nothing here. } static getDefaultAuthority(target) { return target.path.split(',')[0]; } } function setup() { resolver_1.registerResolver(IPV4_SCHEME, IpResolver); resolver_1.registerResolver(IPV6_SCHEME, IpResolver); } exports.setup = setup; //# sourceMappingURL=resolver-ip.js.map /***/ }), /***/ 5252: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.setup = void 0; const resolver_1 = __webpack_require__(31594); class UdsResolver { constructor(target, listener, channelOptions) { this.listener = listener; this.addresses = []; let path; if (target.authority === '') { path = '/' + target.path; } else { path = target.path; } this.addresses = [{ path }]; } updateResolution() { process.nextTick(this.listener.onSuccessfulResolution, this.addresses, null, null, null, {}); } destroy() { // This resolver owns no resources, so we do nothing here. } static getDefaultAuthority(target) { return 'localhost'; } } function setup() { resolver_1.registerResolver('unix', UdsResolver); } exports.setup = setup; //# sourceMappingURL=resolver-uds.js.map /***/ }), /***/ 31594: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.mapUriDefaultScheme = exports.getDefaultAuthority = exports.createResolver = exports.registerDefaultScheme = exports.registerResolver = void 0; const uri_parser_1 = __webpack_require__(65974); const registeredResolvers = {}; let defaultScheme = null; /** * Register a resolver class to handle target names prefixed with the `prefix` * string. This prefix should correspond to a URI scheme name listed in the * [gRPC Name Resolution document](https://github.com/grpc/grpc/blob/master/doc/naming.md) * @param prefix * @param resolverClass */ function registerResolver(scheme, resolverClass) { registeredResolvers[scheme] = resolverClass; } exports.registerResolver = registerResolver; /** * Register a default resolver to handle target names that do not start with * any registered prefix. * @param resolverClass */ function registerDefaultScheme(scheme) { defaultScheme = scheme; } exports.registerDefaultScheme = registerDefaultScheme; /** * Create a name resolver for the specified target, if possible. Throws an * error if no such name resolver can be created. * @param target * @param listener */ function createResolver(target, listener, options) { if (target.scheme !== undefined && target.scheme in registeredResolvers) { return new registeredResolvers[target.scheme](target, listener, options); } else { throw new Error(`No resolver could be created for target ${uri_parser_1.uriToString(target)}`); } } exports.createResolver = createResolver; /** * Get the default authority for the specified target, if possible. Throws an * error if no registered name resolver can parse that target string. * @param target */ function getDefaultAuthority(target) { if (target.scheme !== undefined && target.scheme in registeredResolvers) { return registeredResolvers[target.scheme].getDefaultAuthority(target); } else { throw new Error(`Invalid target ${uri_parser_1.uriToString(target)}`); } } exports.getDefaultAuthority = getDefaultAuthority; function mapUriDefaultScheme(target) { if (target.scheme === undefined || !(target.scheme in registeredResolvers)) { if (defaultScheme !== null) { return { scheme: defaultScheme, authority: undefined, path: uri_parser_1.uriToString(target), }; } else { return null; } } return target; } exports.mapUriDefaultScheme = mapUriDefaultScheme; //# sourceMappingURL=resolver.js.map /***/ }), /***/ 19192: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ResolvingLoadBalancer = void 0; const load_balancer_1 = __webpack_require__(52680); const service_config_1 = __webpack_require__(21761); const connectivity_state_1 = __webpack_require__(80878); const resolver_1 = __webpack_require__(31594); const picker_1 = __webpack_require__(81611); const backoff_timeout_1 = __webpack_require__(34186); const constants_1 = __webpack_require__(90634); const metadata_1 = __webpack_require__(83665); const logging = __webpack_require__(35993); const constants_2 = __webpack_require__(90634); const uri_parser_1 = __webpack_require__(65974); const load_balancer_child_handler_1 = __webpack_require__(17559); const TRACER_NAME = 'resolving_load_balancer'; function trace(text) { logging.trace(constants_2.LogVerbosity.DEBUG, TRACER_NAME, text); } const DEFAULT_LOAD_BALANCER_NAME = 'pick_first'; function getDefaultConfigSelector(serviceConfig) { return function defaultConfigSelector(methodName, metadata) { var _a, _b; const splitName = methodName.split('/').filter((x) => x.length > 0); const service = (_a = splitName[0]) !== null && _a !== void 0 ? _a : ''; const method = (_b = splitName[1]) !== null && _b !== void 0 ? _b : ''; if (serviceConfig && serviceConfig.methodConfig) { for (const methodConfig of serviceConfig.methodConfig) { for (const name of methodConfig.name) { if (name.service === service && (name.method === undefined || name.method === method)) { return { methodConfig: methodConfig, pickInformation: {}, status: constants_1.Status.OK, dynamicFilterFactories: [] }; } } } } return { methodConfig: { name: [] }, pickInformation: {}, status: constants_1.Status.OK, dynamicFilterFactories: [] }; }; } class ResolvingLoadBalancer { /** * Wrapper class that behaves like a `LoadBalancer` and also handles name * resolution internally. * @param target The address of the backend to connect to. * @param channelControlHelper `ChannelControlHelper` instance provided by * this load balancer's owner. * @param defaultServiceConfig The default service configuration to be used * if none is provided by the name resolver. A `null` value indicates * that the default behavior should be the default unconfigured behavior. * In practice, that means using the "pick first" load balancer * implmentation */ constructor(target, channelControlHelper, channelOptions, onSuccessfulResolution, onFailedResolution) { this.target = target; this.channelControlHelper = channelControlHelper; this.channelOptions = channelOptions; this.onSuccessfulResolution = onSuccessfulResolution; this.onFailedResolution = onFailedResolution; this.latestChildState = connectivity_state_1.ConnectivityState.IDLE; this.latestChildPicker = new picker_1.QueuePicker(this); /** * This resolving load balancer's current connectivity state. */ this.currentState = connectivity_state_1.ConnectivityState.IDLE; /** * The service config object from the last successful resolution, if * available. A value of null indicates that we have not yet received a valid * service config from the resolver. */ this.previousServiceConfig = null; /** * Indicates whether we should attempt to resolve again after the backoff * timer runs out. */ this.continueResolving = false; if (channelOptions['grpc.service_config']) { this.defaultServiceConfig = service_config_1.validateServiceConfig(JSON.parse(channelOptions['grpc.service_config'])); } else { this.defaultServiceConfig = { loadBalancingConfig: [], methodConfig: [], }; } this.updateState(connectivity_state_1.ConnectivityState.IDLE, new picker_1.QueuePicker(this)); this.childLoadBalancer = new load_balancer_child_handler_1.ChildLoadBalancerHandler({ createSubchannel: channelControlHelper.createSubchannel.bind(channelControlHelper), requestReresolution: () => { /* If the backoffTimeout is running, we're still backing off from * making resolve requests, so we shouldn't make another one here. * In that case, the backoff timer callback will call * updateResolution */ if (this.backoffTimeout.isRunning()) { this.continueResolving = true; } else { this.updateResolution(); } }, updateState: (newState, picker) => { this.latestChildState = newState; this.latestChildPicker = picker; this.updateState(newState, picker); }, addChannelzChild: channelControlHelper.addChannelzChild.bind(channelControlHelper), removeChannelzChild: channelControlHelper.removeChannelzChild.bind(channelControlHelper) }); this.innerResolver = resolver_1.createResolver(target, { onSuccessfulResolution: (addressList, serviceConfig, serviceConfigError, configSelector, attributes) => { var _a; let workingServiceConfig = null; /* This first group of conditionals implements the algorithm described * in https://github.com/grpc/proposal/blob/master/A21-service-config-error-handling.md * in the section called "Behavior on receiving a new gRPC Config". */ if (serviceConfig === null) { // Step 4 and 5 if (serviceConfigError === null) { // Step 5 this.previousServiceConfig = null; workingServiceConfig = this.defaultServiceConfig; } else { // Step 4 if (this.previousServiceConfig === null) { // Step 4.ii this.handleResolutionFailure(serviceConfigError); } else { // Step 4.i workingServiceConfig = this.previousServiceConfig; } } } else { // Step 3 workingServiceConfig = serviceConfig; this.previousServiceConfig = serviceConfig; } const workingConfigList = (_a = workingServiceConfig === null || workingServiceConfig === void 0 ? void 0 : workingServiceConfig.loadBalancingConfig) !== null && _a !== void 0 ? _a : []; const loadBalancingConfig = load_balancer_1.getFirstUsableConfig(workingConfigList, true); if (loadBalancingConfig === null) { // There were load balancing configs but none are supported. This counts as a resolution failure this.handleResolutionFailure({ code: constants_1.Status.UNAVAILABLE, details: 'All load balancer options in service config are not compatible', metadata: new metadata_1.Metadata(), }); return; } this.childLoadBalancer.updateAddressList(addressList, loadBalancingConfig, attributes); const finalServiceConfig = workingServiceConfig !== null && workingServiceConfig !== void 0 ? workingServiceConfig : this.defaultServiceConfig; this.onSuccessfulResolution(configSelector !== null && configSelector !== void 0 ? configSelector : getDefaultConfigSelector(finalServiceConfig)); }, onError: (error) => { this.handleResolutionFailure(error); }, }, channelOptions); const backoffOptions = { initialDelay: channelOptions['grpc.initial_reconnect_backoff_ms'], maxDelay: channelOptions['grpc.max_reconnect_backoff_ms'], }; this.backoffTimeout = new backoff_timeout_1.BackoffTimeout(() => { if (this.continueResolving) { this.updateResolution(); this.continueResolving = false; } else { this.updateState(this.latestChildState, this.latestChildPicker); } }, backoffOptions); this.backoffTimeout.unref(); } updateResolution() { this.innerResolver.updateResolution(); if (this.currentState === connectivity_state_1.ConnectivityState.IDLE) { this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this)); } } updateState(connectivityState, picker) { trace(uri_parser_1.uriToString(this.target) + ' ' + connectivity_state_1.ConnectivityState[this.currentState] + ' -> ' + connectivity_state_1.ConnectivityState[connectivityState]); // Ensure that this.exitIdle() is called by the picker if (connectivityState === connectivity_state_1.ConnectivityState.IDLE) { picker = new picker_1.QueuePicker(this); } this.currentState = connectivityState; this.channelControlHelper.updateState(connectivityState, picker); } handleResolutionFailure(error) { if (this.latestChildState === connectivity_state_1.ConnectivityState.IDLE) { this.updateState(connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE, new picker_1.UnavailablePicker(error)); this.onFailedResolution(error); } this.backoffTimeout.runOnce(); } exitIdle() { this.childLoadBalancer.exitIdle(); if (this.currentState === connectivity_state_1.ConnectivityState.IDLE) { if (this.backoffTimeout.isRunning()) { this.continueResolving = true; } else { this.updateResolution(); } this.updateState(connectivity_state_1.ConnectivityState.CONNECTING, new picker_1.QueuePicker(this)); } } updateAddressList(addressList, lbConfig) { throw new Error('updateAddressList not supported on ResolvingLoadBalancer'); } resetBackoff() { this.backoffTimeout.reset(); this.childLoadBalancer.resetBackoff(); } destroy() { this.childLoadBalancer.destroy(); this.innerResolver.destroy(); this.updateState(connectivity_state_1.ConnectivityState.SHUTDOWN, new picker_1.UnavailablePicker()); } getTypeName() { return 'resolving_load_balancer'; } } exports.ResolvingLoadBalancer = ResolvingLoadBalancer; //# sourceMappingURL=resolving-load-balancer.js.map /***/ }), /***/ 62533: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Http2ServerCallStream = exports.ServerDuplexStreamImpl = exports.ServerWritableStreamImpl = exports.ServerReadableStreamImpl = exports.ServerUnaryCallImpl = void 0; const events_1 = __webpack_require__(28614); const http2 = __webpack_require__(97565); const stream_1 = __webpack_require__(92413); const constants_1 = __webpack_require__(90634); const metadata_1 = __webpack_require__(83665); const stream_decoder_1 = __webpack_require__(16575); const logging = __webpack_require__(35993); const TRACER_NAME = 'server_call'; function trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text); } const GRPC_ACCEPT_ENCODING_HEADER = 'grpc-accept-encoding'; const GRPC_ENCODING_HEADER = 'grpc-encoding'; const GRPC_MESSAGE_HEADER = 'grpc-message'; const GRPC_STATUS_HEADER = 'grpc-status'; const GRPC_TIMEOUT_HEADER = 'grpc-timeout'; const DEADLINE_REGEX = /(\d{1,8})\s*([HMSmun])/; const deadlineUnitsToMs = { H: 3600000, M: 60000, S: 1000, m: 1, u: 0.001, n: 0.000001, }; const defaultResponseHeaders = { // TODO(cjihrig): Remove these encoding headers from the default response // once compression is integrated. [GRPC_ACCEPT_ENCODING_HEADER]: 'identity', [GRPC_ENCODING_HEADER]: 'identity', [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_OK, [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto', }; const defaultResponseOptions = { waitForTrailers: true, }; class ServerUnaryCallImpl extends events_1.EventEmitter { constructor(call, metadata, request) { super(); this.call = call; this.metadata = metadata; this.request = request; this.cancelled = false; this.call.setupSurfaceCall(this); } getPeer() { return this.call.getPeer(); } sendMetadata(responseMetadata) { this.call.sendMetadata(responseMetadata); } getDeadline() { return this.call.getDeadline(); } } exports.ServerUnaryCallImpl = ServerUnaryCallImpl; class ServerReadableStreamImpl extends stream_1.Readable { constructor(call, metadata, deserialize) { super({ objectMode: true }); this.call = call; this.metadata = metadata; this.deserialize = deserialize; this.cancelled = false; this.call.setupSurfaceCall(this); this.call.setupReadable(this); } _read(size) { if (!this.call.consumeUnpushedMessages(this)) { return; } this.call.resume(); } getPeer() { return this.call.getPeer(); } sendMetadata(responseMetadata) { this.call.sendMetadata(responseMetadata); } getDeadline() { return this.call.getDeadline(); } } exports.ServerReadableStreamImpl = ServerReadableStreamImpl; class ServerWritableStreamImpl extends stream_1.Writable { constructor(call, metadata, serialize, request) { super({ objectMode: true }); this.call = call; this.metadata = metadata; this.serialize = serialize; this.request = request; this.cancelled = false; this.trailingMetadata = new metadata_1.Metadata(); this.call.setupSurfaceCall(this); this.on('error', (err) => { this.call.sendError(err); this.end(); }); } getPeer() { return this.call.getPeer(); } sendMetadata(responseMetadata) { this.call.sendMetadata(responseMetadata); } getDeadline() { return this.call.getDeadline(); } _write(chunk, encoding, // eslint-disable-next-line @typescript-eslint/no-explicit-any callback) { try { const response = this.call.serializeMessage(chunk); if (!this.call.write(response)) { this.call.once('drain', callback); return; } } catch (err) { err.code = constants_1.Status.INTERNAL; this.emit('error', err); } callback(); } _final(callback) { this.call.sendStatus({ code: constants_1.Status.OK, details: 'OK', metadata: this.trailingMetadata, }); callback(null); } // eslint-disable-next-line @typescript-eslint/no-explicit-any end(metadata) { if (metadata) { this.trailingMetadata = metadata; } return super.end(); } } exports.ServerWritableStreamImpl = ServerWritableStreamImpl; class ServerDuplexStreamImpl extends stream_1.Duplex { constructor(call, metadata, serialize, deserialize) { super({ objectMode: true }); this.call = call; this.metadata = metadata; this.serialize = serialize; this.deserialize = deserialize; this.cancelled = false; this.trailingMetadata = new metadata_1.Metadata(); this.call.setupSurfaceCall(this); this.call.setupReadable(this); this.on('error', (err) => { this.call.sendError(err); this.end(); }); } getPeer() { return this.call.getPeer(); } sendMetadata(responseMetadata) { this.call.sendMetadata(responseMetadata); } getDeadline() { return this.call.getDeadline(); } // eslint-disable-next-line @typescript-eslint/no-explicit-any end(metadata) { if (metadata) { this.trailingMetadata = metadata; } return super.end(); } } exports.ServerDuplexStreamImpl = ServerDuplexStreamImpl; ServerDuplexStreamImpl.prototype._read = ServerReadableStreamImpl.prototype._read; ServerDuplexStreamImpl.prototype._write = ServerWritableStreamImpl.prototype._write; ServerDuplexStreamImpl.prototype._final = ServerWritableStreamImpl.prototype._final; // Internal class that wraps the HTTP2 request. class Http2ServerCallStream extends events_1.EventEmitter { constructor(stream, handler, options) { super(); this.stream = stream; this.handler = handler; this.options = options; this.cancelled = false; this.deadlineTimer = setTimeout(() => { }, 0); this.deadline = Infinity; this.wantTrailers = false; this.metadataSent = false; this.canPush = false; this.isPushPending = false; this.bufferedMessages = []; this.messagesToPush = []; this.maxSendMessageSize = constants_1.DEFAULT_MAX_SEND_MESSAGE_LENGTH; this.maxReceiveMessageSize = constants_1.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH; this.stream.once('error', (err) => { /* We need an error handler to avoid uncaught error event exceptions, but * there is nothing we can reasonably do here. Any error event should * have a corresponding close event, which handles emitting the cancelled * event. And the stream is now in a bad state, so we can't reasonably * expect to be able to send an error over it. */ }); this.stream.once('close', () => { var _a; trace('Request to method ' + ((_a = this.handler) === null || _a === void 0 ? void 0 : _a.path) + ' stream closed with rstCode ' + this.stream.rstCode); this.cancelled = true; this.emit('cancelled', 'cancelled'); this.emit('streamEnd', false); this.sendStatus({ code: constants_1.Status.CANCELLED, details: 'Cancelled by client', metadata: new metadata_1.Metadata() }); }); this.stream.on('drain', () => { this.emit('drain'); }); if ('grpc.max_send_message_length' in options) { this.maxSendMessageSize = options['grpc.max_send_message_length']; } if ('grpc.max_receive_message_length' in options) { this.maxReceiveMessageSize = options['grpc.max_receive_message_length']; } // Clear noop timer clearTimeout(this.deadlineTimer); } checkCancelled() { /* In some cases the stream can become destroyed before the close event * fires. That creates a race condition that this check works around */ if (this.stream.destroyed || this.stream.closed) { this.cancelled = true; } return this.cancelled; } sendMetadata(customMetadata) { if (this.checkCancelled()) { return; } if (this.metadataSent) { return; } this.metadataSent = true; const custom = customMetadata ? customMetadata.toHttp2Headers() : null; // TODO(cjihrig): Include compression headers. const headers = Object.assign({}, defaultResponseHeaders, custom); this.stream.respond(headers, defaultResponseOptions); } receiveMetadata(headers) { const metadata = metadata_1.Metadata.fromHttp2Headers(headers); // TODO(cjihrig): Receive compression metadata. const timeoutHeader = metadata.get(GRPC_TIMEOUT_HEADER); if (timeoutHeader.length > 0) { const match = timeoutHeader[0].toString().match(DEADLINE_REGEX); if (match === null) { const err = new Error('Invalid deadline'); err.code = constants_1.Status.OUT_OF_RANGE; this.sendError(err); return; } const timeout = (+match[1] * deadlineUnitsToMs[match[2]]) | 0; const now = new Date(); this.deadline = now.setMilliseconds(now.getMilliseconds() + timeout); this.deadlineTimer = setTimeout(handleExpiredDeadline, timeout, this); metadata.remove(GRPC_TIMEOUT_HEADER); } // Remove several headers that should not be propagated to the application metadata.remove(http2.constants.HTTP2_HEADER_ACCEPT_ENCODING); metadata.remove(http2.constants.HTTP2_HEADER_TE); metadata.remove(http2.constants.HTTP2_HEADER_CONTENT_TYPE); metadata.remove('grpc-encoding'); metadata.remove('grpc-accept-encoding'); return metadata; } receiveUnaryMessage() { return new Promise((resolve, reject) => { const stream = this.stream; const chunks = []; let totalLength = 0; stream.on('data', (data) => { chunks.push(data); totalLength += data.byteLength; }); stream.once('end', async () => { try { const requestBytes = Buffer.concat(chunks, totalLength); if (this.maxReceiveMessageSize !== -1 && requestBytes.length > this.maxReceiveMessageSize) { this.sendError({ code: constants_1.Status.RESOURCE_EXHAUSTED, details: `Received message larger than max (${requestBytes.length} vs. ${this.maxReceiveMessageSize})`, }); resolve(); } this.emit('receiveMessage'); resolve(this.deserializeMessage(requestBytes)); } catch (err) { err.code = constants_1.Status.INTERNAL; this.sendError(err); resolve(); } }); }); } serializeMessage(value) { const messageBuffer = this.handler.serialize(value); // TODO(cjihrig): Call compression aware serializeMessage(). const byteLength = messageBuffer.byteLength; const output = Buffer.allocUnsafe(byteLength + 5); output.writeUInt8(0, 0); output.writeUInt32BE(byteLength, 1); messageBuffer.copy(output, 5); return output; } deserializeMessage(bytes) { // TODO(cjihrig): Call compression aware deserializeMessage(). const receivedMessage = bytes.slice(5); return this.handler.deserialize(receivedMessage); } async sendUnaryMessage(err, value, metadata, flags) { if (this.checkCancelled()) { return; } if (!metadata) { metadata = new metadata_1.Metadata(); } if (err) { if (!Object.prototype.hasOwnProperty.call(err, 'metadata')) { err.metadata = metadata; } this.sendError(err); return; } try { const response = this.serializeMessage(value); this.write(response); this.sendStatus({ code: constants_1.Status.OK, details: 'OK', metadata }); } catch (err) { err.code = constants_1.Status.INTERNAL; this.sendError(err); } } sendStatus(statusObj) { var _a; this.emit('callEnd', statusObj.code); this.emit('streamEnd', statusObj.code === constants_1.Status.OK); if (this.checkCancelled()) { return; } trace('Request to method ' + ((_a = this.handler) === null || _a === void 0 ? void 0 : _a.path) + ' ended with status code: ' + constants_1.Status[statusObj.code] + ' details: ' + statusObj.details); clearTimeout(this.deadlineTimer); if (!this.wantTrailers) { this.wantTrailers = true; this.stream.once('wantTrailers', () => { const trailersToSend = Object.assign({ [GRPC_STATUS_HEADER]: statusObj.code, [GRPC_MESSAGE_HEADER]: encodeURI(statusObj.details), }, statusObj.metadata.toHttp2Headers()); this.stream.sendTrailers(trailersToSend); }); this.sendMetadata(); this.stream.end(); } } sendError(error) { const status = { code: constants_1.Status.UNKNOWN, details: 'message' in error ? error.message : 'Unknown Error', metadata: 'metadata' in error && error.metadata !== undefined ? error.metadata : new metadata_1.Metadata(), }; if ('code' in error && typeof error.code === 'number' && Number.isInteger(error.code)) { status.code = error.code; if ('details' in error && typeof error.details === 'string') { status.details = error.details; } } this.sendStatus(status); } write(chunk) { if (this.checkCancelled()) { return; } if (this.maxSendMessageSize !== -1 && chunk.length > this.maxSendMessageSize) { this.sendError({ code: constants_1.Status.RESOURCE_EXHAUSTED, details: `Sent message larger than max (${chunk.length} vs. ${this.maxSendMessageSize})`, }); return; } this.sendMetadata(); this.emit('sendMessage'); return this.stream.write(chunk); } resume() { this.stream.resume(); } setupSurfaceCall(call) { this.once('cancelled', (reason) => { call.cancelled = true; call.emit('cancelled', reason); }); } setupReadable(readable) { const decoder = new stream_decoder_1.StreamDecoder(); this.stream.on('data', async (data) => { const messages = decoder.write(data); for (const message of messages) { if (this.maxReceiveMessageSize !== -1 && message.length > this.maxReceiveMessageSize) { this.sendError({ code: constants_1.Status.RESOURCE_EXHAUSTED, details: `Received message larger than max (${message.length} vs. ${this.maxReceiveMessageSize})`, }); return; } this.emit('receiveMessage'); this.pushOrBufferMessage(readable, message); } }); this.stream.once('end', () => { this.pushOrBufferMessage(readable, null); }); } consumeUnpushedMessages(readable) { this.canPush = true; while (this.messagesToPush.length > 0) { const nextMessage = this.messagesToPush.shift(); const canPush = readable.push(nextMessage); if (nextMessage === null || canPush === false) { this.canPush = false; break; } } return this.canPush; } pushOrBufferMessage(readable, messageBytes) { if (this.isPushPending) { this.bufferedMessages.push(messageBytes); } else { this.pushMessage(readable, messageBytes); } } async pushMessage(readable, messageBytes) { if (messageBytes === null) { if (this.canPush) { readable.push(null); } else { this.messagesToPush.push(null); } return; } this.isPushPending = true; try { const deserialized = await this.deserializeMessage(messageBytes); if (this.canPush) { if (!readable.push(deserialized)) { this.canPush = false; this.stream.pause(); } } else { this.messagesToPush.push(deserialized); } } catch (error) { // Ignore any remaining messages when errors occur. this.bufferedMessages.length = 0; if (!('code' in error && typeof error.code === 'number' && Number.isInteger(error.code) && error.code >= constants_1.Status.OK && error.code <= constants_1.Status.UNAUTHENTICATED)) { // The error code is not a valid gRPC code so its being overwritten. error.code = constants_1.Status.INTERNAL; } readable.emit('error', error); } this.isPushPending = false; if (this.bufferedMessages.length > 0) { this.pushMessage(readable, this.bufferedMessages.shift()); } } getPeer() { const socket = this.stream.session.socket; if (socket.remoteAddress) { if (socket.remotePort) { return `${socket.remoteAddress}:${socket.remotePort}`; } else { return socket.remoteAddress; } } else { return 'unknown'; } } getDeadline() { return this.deadline; } } exports.Http2ServerCallStream = Http2ServerCallStream; function handleExpiredDeadline(call) { const err = new Error('Deadline exceeded'); err.code = constants_1.Status.DEADLINE_EXCEEDED; call.sendError(err); call.cancelled = true; call.emit('cancelled', 'deadline'); } //# sourceMappingURL=server-call.js.map /***/ }), /***/ 63828: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ServerCredentials = void 0; const tls_helpers_1 = __webpack_require__(86581); class ServerCredentials { static createInsecure() { return new InsecureServerCredentials(); } static createSsl(rootCerts, keyCertPairs, checkClientCertificate = false) { if (rootCerts !== null && !Buffer.isBuffer(rootCerts)) { throw new TypeError('rootCerts must be null or a Buffer'); } if (!Array.isArray(keyCertPairs)) { throw new TypeError('keyCertPairs must be an array'); } if (typeof checkClientCertificate !== 'boolean') { throw new TypeError('checkClientCertificate must be a boolean'); } const cert = []; const key = []; for (let i = 0; i < keyCertPairs.length; i++) { const pair = keyCertPairs[i]; if (pair === null || typeof pair !== 'object') { throw new TypeError(`keyCertPair[${i}] must be an object`); } if (!Buffer.isBuffer(pair.private_key)) { throw new TypeError(`keyCertPair[${i}].private_key must be a Buffer`); } if (!Buffer.isBuffer(pair.cert_chain)) { throw new TypeError(`keyCertPair[${i}].cert_chain must be a Buffer`); } cert.push(pair.cert_chain); key.push(pair.private_key); } return new SecureServerCredentials({ ca: rootCerts || tls_helpers_1.getDefaultRootsData() || undefined, cert, key, requestCert: checkClientCertificate, ciphers: tls_helpers_1.CIPHER_SUITES, }); } } exports.ServerCredentials = ServerCredentials; class InsecureServerCredentials extends ServerCredentials { _isSecure() { return false; } _getSettings() { return null; } } class SecureServerCredentials extends ServerCredentials { constructor(options) { super(); this.options = options; } _isSecure() { return true; } _getSettings() { return this.options; } } //# sourceMappingURL=server-credentials.js.map /***/ }), /***/ 33389: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Server = void 0; const http2 = __webpack_require__(97565); const constants_1 = __webpack_require__(90634); const metadata_1 = __webpack_require__(83665); const server_call_1 = __webpack_require__(62533); const server_credentials_1 = __webpack_require__(63828); const resolver_1 = __webpack_require__(31594); const logging = __webpack_require__(35993); const subchannel_address_1 = __webpack_require__(99905); const uri_parser_1 = __webpack_require__(65974); const channelz_1 = __webpack_require__(79975); const TRACER_NAME = 'server'; function noop() { } function getUnimplementedStatusResponse(methodName) { return { code: constants_1.Status.UNIMPLEMENTED, details: `The server does not implement the method ${methodName}`, metadata: new metadata_1.Metadata(), }; } function getDefaultHandler(handlerType, methodName) { const unimplementedStatusResponse = getUnimplementedStatusResponse(methodName); switch (handlerType) { case 'unary': return (call, callback) => { callback(unimplementedStatusResponse, null); }; case 'clientStream': return (call, callback) => { callback(unimplementedStatusResponse, null); }; case 'serverStream': return (call) => { call.emit('error', unimplementedStatusResponse); }; case 'bidi': return (call) => { call.emit('error', unimplementedStatusResponse); }; default: throw new Error(`Invalid handlerType ${handlerType}`); } } class Server { constructor(options) { this.http2ServerList = []; this.handlers = new Map(); this.sessions = new Map(); this.started = false; // Channelz Info this.channelzEnabled = true; this.channelzTrace = new channelz_1.ChannelzTrace(); this.callTracker = new channelz_1.ChannelzCallTracker(); this.listenerChildrenTracker = new channelz_1.ChannelzChildrenTracker(); this.sessionChildrenTracker = new channelz_1.ChannelzChildrenTracker(); this.options = options !== null && options !== void 0 ? options : {}; if (this.options['grpc.enable_channelz'] === 0) { this.channelzEnabled = false; } if (this.channelzEnabled) { this.channelzRef = channelz_1.registerChannelzServer(() => this.getChannelzInfo()); this.channelzTrace.addTrace('CT_INFO', 'Server created'); this.trace('Server constructed'); } else { // Dummy channelz ref that will never be used this.channelzRef = { kind: 'server', id: -1 }; } } getChannelzInfo() { return { trace: this.channelzTrace, callTracker: this.callTracker, listenerChildren: this.listenerChildrenTracker.getChildLists(), sessionChildren: this.sessionChildrenTracker.getChildLists() }; } getChannelzSessionInfoGetter(session) { return () => { var _a, _b, _c; const sessionInfo = this.sessions.get(session); const sessionSocket = session.socket; const remoteAddress = sessionSocket.remoteAddress ? subchannel_address_1.stringToSubchannelAddress(sessionSocket.remoteAddress, sessionSocket.remotePort) : null; const localAddress = sessionSocket.localAddress ? subchannel_address_1.stringToSubchannelAddress(sessionSocket.localAddress, sessionSocket.localPort) : null; let tlsInfo; if (session.encrypted) { const tlsSocket = sessionSocket; const cipherInfo = tlsSocket.getCipher(); const certificate = tlsSocket.getCertificate(); const peerCertificate = tlsSocket.getPeerCertificate(); tlsInfo = { cipherSuiteStandardName: (_a = cipherInfo.standardName) !== null && _a !== void 0 ? _a : null, cipherSuiteOtherName: cipherInfo.standardName ? null : cipherInfo.name, localCertificate: (certificate && 'raw' in certificate) ? certificate.raw : null, remoteCertificate: (peerCertificate && 'raw' in peerCertificate) ? peerCertificate.raw : null }; } else { tlsInfo = null; } const socketInfo = { remoteAddress: remoteAddress, localAddress: localAddress, security: tlsInfo, remoteName: null, streamsStarted: sessionInfo.streamTracker.callsStarted, streamsSucceeded: sessionInfo.streamTracker.callsSucceeded, streamsFailed: sessionInfo.streamTracker.callsFailed, messagesSent: sessionInfo.messagesSent, messagesReceived: sessionInfo.messagesReceived, keepAlivesSent: 0, lastLocalStreamCreatedTimestamp: null, lastRemoteStreamCreatedTimestamp: sessionInfo.streamTracker.lastCallStartedTimestamp, lastMessageSentTimestamp: sessionInfo.lastMessageSentTimestamp, lastMessageReceivedTimestamp: sessionInfo.lastMessageReceivedTimestamp, localFlowControlWindow: (_b = session.state.localWindowSize) !== null && _b !== void 0 ? _b : null, remoteFlowControlWindow: (_c = session.state.remoteWindowSize) !== null && _c !== void 0 ? _c : null }; return socketInfo; }; } trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '(' + this.channelzRef.id + ') ' + text); } addProtoService() { throw new Error('Not implemented. Use addService() instead'); } addService(service, implementation) { if (service === null || typeof service !== 'object' || implementation === null || typeof implementation !== 'object') { throw new Error('addService() requires two objects as arguments'); } const serviceKeys = Object.keys(service); if (serviceKeys.length === 0) { throw new Error('Cannot add an empty service to a server'); } serviceKeys.forEach((name) => { const attrs = service[name]; let methodType; if (attrs.requestStream) { if (attrs.responseStream) { methodType = 'bidi'; } else { methodType = 'clientStream'; } } else { if (attrs.responseStream) { methodType = 'serverStream'; } else { methodType = 'unary'; } } let implFn = implementation[name]; let impl; if (implFn === undefined && typeof attrs.originalName === 'string') { implFn = implementation[attrs.originalName]; } if (implFn !== undefined) { impl = implFn.bind(implementation); } else { impl = getDefaultHandler(methodType, name); } const success = this.register(attrs.path, impl, attrs.responseSerialize, attrs.requestDeserialize, methodType); if (success === false) { throw new Error(`Method handler for ${attrs.path} already provided.`); } }); } removeService(service) { if (service === null || typeof service !== 'object') { throw new Error('removeService() requires object as argument'); } const serviceKeys = Object.keys(service); serviceKeys.forEach((name) => { const attrs = service[name]; this.unregister(attrs.path); }); } bind(port, creds) { throw new Error('Not implemented. Use bindAsync() instead'); } bindAsync(port, creds, callback) { if (this.started === true) { throw new Error('server is already started'); } if (typeof port !== 'string') { throw new TypeError('port must be a string'); } if (creds === null || !(creds instanceof server_credentials_1.ServerCredentials)) { throw new TypeError('creds must be a ServerCredentials object'); } if (typeof callback !== 'function') { throw new TypeError('callback must be a function'); } const initialPortUri = uri_parser_1.parseUri(port); if (initialPortUri === null) { throw new Error(`Could not parse port "${port}"`); } const portUri = resolver_1.mapUriDefaultScheme(initialPortUri); if (portUri === null) { throw new Error(`Could not get a default scheme for port "${port}"`); } const serverOptions = { maxSendHeaderBlockLength: Number.MAX_SAFE_INTEGER, }; if ('grpc-node.max_session_memory' in this.options) { serverOptions.maxSessionMemory = this.options['grpc-node.max_session_memory']; } if ('grpc.max_concurrent_streams' in this.options) { serverOptions.settings = { maxConcurrentStreams: this.options['grpc.max_concurrent_streams'], }; } const deferredCallback = (error, port) => { process.nextTick(() => callback(error, port)); }; const setupServer = () => { let http2Server; if (creds._isSecure()) { const secureServerOptions = Object.assign(serverOptions, creds._getSettings()); http2Server = http2.createSecureServer(secureServerOptions); } else { http2Server = http2.createServer(serverOptions); } http2Server.setTimeout(0, noop); this._setupHandlers(http2Server); return http2Server; }; const bindSpecificPort = (addressList, portNum, previousCount) => { if (addressList.length === 0) { return Promise.resolve({ port: portNum, count: previousCount }); } return Promise.all(addressList.map((address) => { this.trace('Attempting to bind ' + subchannel_address_1.subchannelAddressToString(address)); let addr; if (subchannel_address_1.isTcpSubchannelAddress(address)) { addr = { host: address.host, port: portNum, }; } else { addr = address; } const http2Server = setupServer(); return new Promise((resolve, reject) => { const onError = (err) => { this.trace('Failed to bind ' + subchannel_address_1.subchannelAddressToString(address) + ' with error ' + err.message); resolve(err); }; http2Server.once('error', onError); http2Server.listen(addr, () => { const boundAddress = http2Server.address(); let boundSubchannelAddress; if (typeof boundAddress === 'string') { boundSubchannelAddress = { path: boundAddress }; } else { boundSubchannelAddress = { host: boundAddress.address, port: boundAddress.port }; } const channelzRef = channelz_1.registerChannelzSocket(subchannel_address_1.subchannelAddressToString(boundSubchannelAddress), () => { return { localAddress: boundSubchannelAddress, remoteAddress: null, security: null, remoteName: null, streamsStarted: 0, streamsSucceeded: 0, streamsFailed: 0, messagesSent: 0, messagesReceived: 0, keepAlivesSent: 0, lastLocalStreamCreatedTimestamp: null, lastRemoteStreamCreatedTimestamp: null, lastMessageSentTimestamp: null, lastMessageReceivedTimestamp: null, localFlowControlWindow: null, remoteFlowControlWindow: null }; }); this.listenerChildrenTracker.refChild(channelzRef); this.http2ServerList.push({ server: http2Server, channelzRef: channelzRef }); this.trace('Successfully bound ' + subchannel_address_1.subchannelAddressToString(boundSubchannelAddress)); resolve('port' in boundSubchannelAddress ? boundSubchannelAddress.port : portNum); http2Server.removeListener('error', onError); }); }); })).then((results) => { let count = 0; for (const result of results) { if (typeof result === 'number') { count += 1; if (result !== portNum) { throw new Error('Invalid state: multiple port numbers added from single address'); } } } return { port: portNum, count: count + previousCount, }; }); }; const bindWildcardPort = (addressList) => { if (addressList.length === 0) { return Promise.resolve({ port: 0, count: 0 }); } const address = addressList[0]; const http2Server = setupServer(); return new Promise((resolve, reject) => { const onError = (err) => { this.trace('Failed to bind ' + subchannel_address_1.subchannelAddressToString(address) + ' with error ' + err.message); resolve(bindWildcardPort(addressList.slice(1))); }; http2Server.once('error', onError); http2Server.listen(address, () => { const boundAddress = http2Server.address(); const boundSubchannelAddress = { host: boundAddress.address, port: boundAddress.port }; const channelzRef = channelz_1.registerChannelzSocket(subchannel_address_1.subchannelAddressToString(boundSubchannelAddress), () => { return { localAddress: boundSubchannelAddress, remoteAddress: null, security: null, remoteName: null, streamsStarted: 0, streamsSucceeded: 0, streamsFailed: 0, messagesSent: 0, messagesReceived: 0, keepAlivesSent: 0, lastLocalStreamCreatedTimestamp: null, lastRemoteStreamCreatedTimestamp: null, lastMessageSentTimestamp: null, lastMessageReceivedTimestamp: null, localFlowControlWindow: null, remoteFlowControlWindow: null }; }); this.listenerChildrenTracker.refChild(channelzRef); this.http2ServerList.push({ server: http2Server, channelzRef: channelzRef }); this.trace('Successfully bound ' + subchannel_address_1.subchannelAddressToString(boundSubchannelAddress)); resolve(bindSpecificPort(addressList.slice(1), boundAddress.port, 1)); http2Server.removeListener('error', onError); }); }); }; const resolverListener = { onSuccessfulResolution: (addressList, serviceConfig, serviceConfigError) => { // We only want one resolution result. Discard all future results resolverListener.onSuccessfulResolution = () => { }; if (addressList.length === 0) { deferredCallback(new Error(`No addresses resolved for port ${port}`), 0); return; } let bindResultPromise; if (subchannel_address_1.isTcpSubchannelAddress(addressList[0])) { if (addressList[0].port === 0) { bindResultPromise = bindWildcardPort(addressList); } else { bindResultPromise = bindSpecificPort(addressList, addressList[0].port, 0); } } else { // Use an arbitrary non-zero port for non-TCP addresses bindResultPromise = bindSpecificPort(addressList, 1, 0); } bindResultPromise.then((bindResult) => { if (bindResult.count === 0) { const errorString = `No address added out of total ${addressList.length} resolved`; logging.log(constants_1.LogVerbosity.ERROR, errorString); deferredCallback(new Error(errorString), 0); } else { if (bindResult.count < addressList.length) { logging.log(constants_1.LogVerbosity.INFO, `WARNING Only ${bindResult.count} addresses added out of total ${addressList.length} resolved`); } deferredCallback(null, bindResult.port); } }, (error) => { const errorString = `No address added out of total ${addressList.length} resolved`; logging.log(constants_1.LogVerbosity.ERROR, errorString); deferredCallback(new Error(errorString), 0); }); }, onError: (error) => { deferredCallback(new Error(error.details), 0); }, }; const resolver = resolver_1.createResolver(portUri, resolverListener, this.options); resolver.updateResolution(); } forceShutdown() { // Close the server if it is still running. for (const { server: http2Server, channelzRef: ref } of this.http2ServerList) { if (http2Server.listening) { http2Server.close(() => { this.listenerChildrenTracker.unrefChild(ref); channelz_1.unregisterChannelzRef(ref); }); } } this.started = false; // Always destroy any available sessions. It's possible that one or more // tryShutdown() calls are in progress. Don't wait on them to finish. this.sessions.forEach((channelzInfo, session) => { // Cast NGHTTP2_CANCEL to any because TypeScript doesn't seem to // recognize destroy(code) as a valid signature. // eslint-disable-next-line @typescript-eslint/no-explicit-any session.destroy(http2.constants.NGHTTP2_CANCEL); }); this.sessions.clear(); channelz_1.unregisterChannelzRef(this.channelzRef); } register(name, handler, serialize, deserialize, type) { if (this.handlers.has(name)) { return false; } this.handlers.set(name, { func: handler, serialize, deserialize, type, path: name, }); return true; } unregister(name) { return this.handlers.delete(name); } start() { if (this.http2ServerList.length === 0 || this.http2ServerList.every(({ server: http2Server }) => http2Server.listening !== true)) { throw new Error('server must be bound in order to start'); } if (this.started === true) { throw new Error('server is already started'); } if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_INFO', 'Starting'); } this.started = true; } tryShutdown(callback) { const wrappedCallback = (error) => { channelz_1.unregisterChannelzRef(this.channelzRef); callback(error); }; let pendingChecks = 0; function maybeCallback() { pendingChecks--; if (pendingChecks === 0) { wrappedCallback(); } } // Close the server if necessary. this.started = false; for (const { server: http2Server, channelzRef: ref } of this.http2ServerList) { if (http2Server.listening) { pendingChecks++; http2Server.close(() => { this.listenerChildrenTracker.unrefChild(ref); channelz_1.unregisterChannelzRef(ref); maybeCallback(); }); } } this.sessions.forEach((channelzInfo, session) => { if (!session.closed) { pendingChecks += 1; session.close(maybeCallback); } }); if (pendingChecks === 0) { wrappedCallback(); } } addHttp2Port() { throw new Error('Not yet implemented'); } /** * Get the channelz reference object for this server. The returned value is * garbage if channelz is disabled for this server. * @returns */ getChannelzRef() { return this.channelzRef; } _setupHandlers(http2Server) { if (http2Server === null) { return; } http2Server.on('stream', (stream, headers) => { const channelzSessionInfo = this.sessions.get(stream.session); this.callTracker.addCallStarted(); channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallStarted(); const contentType = headers[http2.constants.HTTP2_HEADER_CONTENT_TYPE]; if (typeof contentType !== 'string' || !contentType.startsWith('application/grpc')) { stream.respond({ [http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE, }, { endStream: true }); this.callTracker.addCallFailed(); channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed(); return; } let call = null; try { const path = headers[http2.constants.HTTP2_HEADER_PATH]; const serverAddress = http2Server.address(); let serverAddressString = 'null'; if (serverAddress) { if (typeof serverAddress === 'string') { serverAddressString = serverAddress; } else { serverAddressString = serverAddress.address + ':' + serverAddress.port; } } this.trace('Received call to method ' + path + ' at address ' + serverAddressString); const handler = this.handlers.get(path); if (handler === undefined) { this.trace('No handler registered for method ' + path + '. Sending UNIMPLEMENTED status.'); throw getUnimplementedStatusResponse(path); } call = new server_call_1.Http2ServerCallStream(stream, handler, this.options); call.once('callEnd', (code) => { if (code === constants_1.Status.OK) { this.callTracker.addCallSucceeded(); } else { this.callTracker.addCallFailed(); } }); if (channelzSessionInfo) { call.once('streamEnd', (success) => { if (success) { channelzSessionInfo.streamTracker.addCallSucceeded(); } else { channelzSessionInfo.streamTracker.addCallFailed(); } }); call.on('sendMessage', () => { channelzSessionInfo.messagesSent += 1; channelzSessionInfo.lastMessageSentTimestamp = new Date(); }); call.on('receiveMessage', () => { channelzSessionInfo.messagesReceived += 1; channelzSessionInfo.lastMessageReceivedTimestamp = new Date(); }); } const metadata = call.receiveMetadata(headers); switch (handler.type) { case 'unary': handleUnary(call, handler, metadata); break; case 'clientStream': handleClientStreaming(call, handler, metadata); break; case 'serverStream': handleServerStreaming(call, handler, metadata); break; case 'bidi': handleBidiStreaming(call, handler, metadata); break; default: throw new Error(`Unknown handler type: ${handler.type}`); } } catch (err) { if (!call) { call = new server_call_1.Http2ServerCallStream(stream, null, this.options); this.callTracker.addCallFailed(); channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed(); } if (err.code === undefined) { err.code = constants_1.Status.INTERNAL; } call.sendError(err); } }); http2Server.on('session', (session) => { var _a; if (!this.started) { session.destroy(); return; } const channelzRef = channelz_1.registerChannelzSocket((_a = session.socket.remoteAddress) !== null && _a !== void 0 ? _a : 'unknown', this.getChannelzSessionInfoGetter(session)); const channelzSessionInfo = { ref: channelzRef, streamTracker: new channelz_1.ChannelzCallTracker(), messagesSent: 0, messagesReceived: 0, lastMessageSentTimestamp: null, lastMessageReceivedTimestamp: null }; this.sessions.set(session, channelzSessionInfo); const clientAddress = session.socket.remoteAddress; if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_INFO', 'Connection established by client ' + clientAddress); this.sessionChildrenTracker.refChild(channelzRef); } session.on('close', () => { if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_INFO', 'Connection dropped by client ' + clientAddress); this.sessionChildrenTracker.unrefChild(channelzRef); channelz_1.unregisterChannelzRef(channelzRef); } this.sessions.delete(session); }); }); } } exports.Server = Server; async function handleUnary(call, handler, metadata) { const request = await call.receiveUnaryMessage(); if (request === undefined || call.cancelled) { return; } const emitter = new server_call_1.ServerUnaryCallImpl(call, metadata, request); handler.func(emitter, (err, value, trailer, flags) => { call.sendUnaryMessage(err, value, trailer, flags); }); } function handleClientStreaming(call, handler, metadata) { const stream = new server_call_1.ServerReadableStreamImpl(call, metadata, handler.deserialize); function respond(err, value, trailer, flags) { stream.destroy(); call.sendUnaryMessage(err, value, trailer, flags); } if (call.cancelled) { return; } stream.on('error', respond); handler.func(stream, respond); } async function handleServerStreaming(call, handler, metadata) { const request = await call.receiveUnaryMessage(); if (request === undefined || call.cancelled) { return; } const stream = new server_call_1.ServerWritableStreamImpl(call, metadata, handler.serialize, request); handler.func(stream); } function handleBidiStreaming(call, handler, metadata) { const stream = new server_call_1.ServerDuplexStreamImpl(call, metadata, handler.serialize, handler.deserialize); if (call.cancelled) { return; } handler.func(stream); } //# sourceMappingURL=server.js.map /***/ }), /***/ 21761: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.extractAndSelectServiceConfig = exports.validateServiceConfig = void 0; /* This file implements gRFC A2 and the service config spec: * https://github.com/grpc/proposal/blob/master/A2-service-configs-in-dns.md * https://github.com/grpc/grpc/blob/master/doc/service_config.md. Each * function here takes an object with unknown structure and returns its * specific object type if the input has the right structure, and throws an * error otherwise. */ /* The any type is purposely used here. All functions validate their input at * runtime */ /* eslint-disable @typescript-eslint/no-explicit-any */ const os = __webpack_require__(12087); const load_balancer_1 = __webpack_require__(52680); /** * Recognizes a number with up to 9 digits after the decimal point, followed by * an "s", representing a number of seconds. */ const TIMEOUT_REGEX = /^\d+(\.\d{1,9})?s$/; /** * Client language name used for determining whether this client matches a * `ServiceConfigCanaryConfig`'s `clientLanguage` list. */ const CLIENT_LANGUAGE_STRING = 'node'; function validateName(obj) { if (!('service' in obj) || typeof obj.service !== 'string') { throw new Error('Invalid method config name: invalid service'); } const result = { service: obj.service, }; if ('method' in obj) { if (typeof obj.method === 'string') { result.method = obj.method; } else { throw new Error('Invalid method config name: invalid method'); } } return result; } function validateMethodConfig(obj) { var _a; const result = { name: [], }; if (!('name' in obj) || !Array.isArray(obj.name)) { throw new Error('Invalid method config: invalid name array'); } for (const name of obj.name) { result.name.push(validateName(name)); } if ('waitForReady' in obj) { if (typeof obj.waitForReady !== 'boolean') { throw new Error('Invalid method config: invalid waitForReady'); } result.waitForReady = obj.waitForReady; } if ('timeout' in obj) { if (typeof obj.timeout === 'object') { if (!('seconds' in obj.timeout) || !(typeof obj.timeout.seconds === 'number')) { throw new Error('Invalid method config: invalid timeout.seconds'); } if (!('nanos' in obj.timeout) || !(typeof obj.timeout.nanos === 'number')) { throw new Error('Invalid method config: invalid timeout.nanos'); } result.timeout = obj.timeout; } else if (typeof obj.timeout === 'string' && TIMEOUT_REGEX.test(obj.timeout)) { const timeoutParts = obj.timeout .substring(0, obj.timeout.length - 1) .split('.'); result.timeout = { seconds: timeoutParts[0] | 0, nanos: ((_a = timeoutParts[1]) !== null && _a !== void 0 ? _a : 0) | 0, }; } else { throw new Error('Invalid method config: invalid timeout'); } } if ('maxRequestBytes' in obj) { if (typeof obj.maxRequestBytes !== 'number') { throw new Error('Invalid method config: invalid maxRequestBytes'); } result.maxRequestBytes = obj.maxRequestBytes; } if ('maxResponseBytes' in obj) { if (typeof obj.maxResponseBytes !== 'number') { throw new Error('Invalid method config: invalid maxRequestBytes'); } result.maxResponseBytes = obj.maxResponseBytes; } return result; } function validateServiceConfig(obj) { const result = { loadBalancingConfig: [], methodConfig: [], }; if ('loadBalancingPolicy' in obj) { if (typeof obj.loadBalancingPolicy === 'string') { result.loadBalancingPolicy = obj.loadBalancingPolicy; } else { throw new Error('Invalid service config: invalid loadBalancingPolicy'); } } if ('loadBalancingConfig' in obj) { if (Array.isArray(obj.loadBalancingConfig)) { for (const config of obj.loadBalancingConfig) { result.loadBalancingConfig.push(load_balancer_1.validateLoadBalancingConfig(config)); } } else { throw new Error('Invalid service config: invalid loadBalancingConfig'); } } if ('methodConfig' in obj) { if (Array.isArray(obj.methodConfig)) { for (const methodConfig of obj.methodConfig) { result.methodConfig.push(validateMethodConfig(methodConfig)); } } } // Validate method name uniqueness const seenMethodNames = []; for (const methodConfig of result.methodConfig) { for (const name of methodConfig.name) { for (const seenName of seenMethodNames) { if (name.service === seenName.service && name.method === seenName.method) { throw new Error(`Invalid service config: duplicate name ${name.service}/${name.method}`); } } seenMethodNames.push(name); } } return result; } exports.validateServiceConfig = validateServiceConfig; function validateCanaryConfig(obj) { if (!('serviceConfig' in obj)) { throw new Error('Invalid service config choice: missing service config'); } const result = { serviceConfig: validateServiceConfig(obj.serviceConfig), }; if ('clientLanguage' in obj) { if (Array.isArray(obj.clientLanguage)) { result.clientLanguage = []; for (const lang of obj.clientLanguage) { if (typeof lang === 'string') { result.clientLanguage.push(lang); } else { throw new Error('Invalid service config choice: invalid clientLanguage'); } } } else { throw new Error('Invalid service config choice: invalid clientLanguage'); } } if ('clientHostname' in obj) { if (Array.isArray(obj.clientHostname)) { result.clientHostname = []; for (const lang of obj.clientHostname) { if (typeof lang === 'string') { result.clientHostname.push(lang); } else { throw new Error('Invalid service config choice: invalid clientHostname'); } } } else { throw new Error('Invalid service config choice: invalid clientHostname'); } } if ('percentage' in obj) { if (typeof obj.percentage === 'number' && 0 <= obj.percentage && obj.percentage <= 100) { result.percentage = obj.percentage; } else { throw new Error('Invalid service config choice: invalid percentage'); } } // Validate that no unexpected fields are present const allowedFields = [ 'clientLanguage', 'percentage', 'clientHostname', 'serviceConfig', ]; for (const field in obj) { if (!allowedFields.includes(field)) { throw new Error(`Invalid service config choice: unexpected field ${field}`); } } return result; } function validateAndSelectCanaryConfig(obj, percentage) { if (!Array.isArray(obj)) { throw new Error('Invalid service config list'); } for (const config of obj) { const validatedConfig = validateCanaryConfig(config); /* For each field, we check if it is present, then only discard the * config if the field value does not match the current client */ if (typeof validatedConfig.percentage === 'number' && percentage > validatedConfig.percentage) { continue; } if (Array.isArray(validatedConfig.clientHostname)) { let hostnameMatched = false; for (const hostname of validatedConfig.clientHostname) { if (hostname === os.hostname()) { hostnameMatched = true; } } if (!hostnameMatched) { continue; } } if (Array.isArray(validatedConfig.clientLanguage)) { let languageMatched = false; for (const language of validatedConfig.clientLanguage) { if (language === CLIENT_LANGUAGE_STRING) { languageMatched = true; } } if (!languageMatched) { continue; } } return validatedConfig.serviceConfig; } throw new Error('No matching service config found'); } /** * Find the "grpc_config" record among the TXT records, parse its value as JSON, validate its contents, * and select a service config with selection fields that all match this client. Most of these steps * can fail with an error; the caller must handle any errors thrown this way. * @param txtRecord The TXT record array that is output from a successful call to dns.resolveTxt * @param percentage A number chosen from the range [0, 100) that is used to select which config to use * @return The service configuration to use, given the percentage value, or null if the service config * data has a valid format but none of the options match the current client. */ function extractAndSelectServiceConfig(txtRecord, percentage) { for (const record of txtRecord) { if (record.length > 0 && record[0].startsWith('grpc_config=')) { /* Treat the list of strings in this record as a single string and remove * "grpc_config=" from the beginning. The rest should be a JSON string */ const recordString = record.join('').substring('grpc_config='.length); const recordJson = JSON.parse(recordString); return validateAndSelectCanaryConfig(recordJson, percentage); } } return null; } exports.extractAndSelectServiceConfig = extractAndSelectServiceConfig; //# sourceMappingURL=service-config.js.map /***/ }), /***/ 73155: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StatusBuilder = void 0; /** * A builder for gRPC status objects. */ class StatusBuilder { constructor() { this.code = null; this.details = null; this.metadata = null; } /** * Adds a status code to the builder. */ withCode(code) { this.code = code; return this; } /** * Adds details to the builder. */ withDetails(details) { this.details = details; return this; } /** * Adds metadata to the builder. */ withMetadata(metadata) { this.metadata = metadata; return this; } /** * Builds the status object. */ build() { const status = {}; if (this.code !== null) { status.code = this.code; } if (this.details !== null) { status.details = this.details; } if (this.metadata !== null) { status.metadata = this.metadata; } return status; } } exports.StatusBuilder = StatusBuilder; //# sourceMappingURL=status-builder.js.map /***/ }), /***/ 16575: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StreamDecoder = void 0; var ReadState; (function (ReadState) { ReadState[ReadState["NO_DATA"] = 0] = "NO_DATA"; ReadState[ReadState["READING_SIZE"] = 1] = "READING_SIZE"; ReadState[ReadState["READING_MESSAGE"] = 2] = "READING_MESSAGE"; })(ReadState || (ReadState = {})); class StreamDecoder { constructor() { this.readState = ReadState.NO_DATA; this.readCompressFlag = Buffer.alloc(1); this.readPartialSize = Buffer.alloc(4); this.readSizeRemaining = 4; this.readMessageSize = 0; this.readPartialMessage = []; this.readMessageRemaining = 0; } write(data) { let readHead = 0; let toRead; const result = []; while (readHead < data.length) { switch (this.readState) { case ReadState.NO_DATA: this.readCompressFlag = data.slice(readHead, readHead + 1); readHead += 1; this.readState = ReadState.READING_SIZE; this.readPartialSize.fill(0); this.readSizeRemaining = 4; this.readMessageSize = 0; this.readMessageRemaining = 0; this.readPartialMessage = []; break; case ReadState.READING_SIZE: toRead = Math.min(data.length - readHead, this.readSizeRemaining); data.copy(this.readPartialSize, 4 - this.readSizeRemaining, readHead, readHead + toRead); this.readSizeRemaining -= toRead; readHead += toRead; // readSizeRemaining >=0 here if (this.readSizeRemaining === 0) { this.readMessageSize = this.readPartialSize.readUInt32BE(0); this.readMessageRemaining = this.readMessageSize; if (this.readMessageRemaining > 0) { this.readState = ReadState.READING_MESSAGE; } else { const message = Buffer.concat([this.readCompressFlag, this.readPartialSize], 5); this.readState = ReadState.NO_DATA; result.push(message); } } break; case ReadState.READING_MESSAGE: toRead = Math.min(data.length - readHead, this.readMessageRemaining); this.readPartialMessage.push(data.slice(readHead, readHead + toRead)); this.readMessageRemaining -= toRead; readHead += toRead; // readMessageRemaining >=0 here if (this.readMessageRemaining === 0) { // At this point, we have read a full message const framedMessageBuffers = [ this.readCompressFlag, this.readPartialSize, ].concat(this.readPartialMessage); const framedMessage = Buffer.concat(framedMessageBuffers, this.readMessageSize + 5); this.readState = ReadState.NO_DATA; result.push(framedMessage); } break; default: throw new Error('Unexpected read state'); } } return result; } } exports.StreamDecoder = StreamDecoder; //# sourceMappingURL=stream-decoder.js.map /***/ }), /***/ 99905: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2021 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.stringToSubchannelAddress = exports.subchannelAddressToString = exports.subchannelAddressEqual = exports.isTcpSubchannelAddress = void 0; const net_1 = __webpack_require__(11631); function isTcpSubchannelAddress(address) { return 'port' in address; } exports.isTcpSubchannelAddress = isTcpSubchannelAddress; function subchannelAddressEqual(address1, address2) { if (isTcpSubchannelAddress(address1)) { return (isTcpSubchannelAddress(address2) && address1.host === address2.host && address1.port === address2.port); } else { return !isTcpSubchannelAddress(address2) && address1.path === address2.path; } } exports.subchannelAddressEqual = subchannelAddressEqual; function subchannelAddressToString(address) { if (isTcpSubchannelAddress(address)) { return address.host + ':' + address.port; } else { return address.path; } } exports.subchannelAddressToString = subchannelAddressToString; const DEFAULT_PORT = 443; function stringToSubchannelAddress(addressString, port) { if (net_1.isIP(addressString)) { return { host: addressString, port: port !== null && port !== void 0 ? port : DEFAULT_PORT }; } else { return { path: addressString }; } } exports.stringToSubchannelAddress = stringToSubchannelAddress; //# sourceMappingURL=subchannel-address.js.map /***/ }), /***/ 39780: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getSubchannelPool = exports.SubchannelPool = void 0; const channel_options_1 = __webpack_require__(99810); const subchannel_1 = __webpack_require__(84764); const subchannel_address_1 = __webpack_require__(99905); const uri_parser_1 = __webpack_require__(65974); // 10 seconds in milliseconds. This value is arbitrary. /** * The amount of time in between checks for dropping subchannels that have no * other references */ const REF_CHECK_INTERVAL = 10000; class SubchannelPool { /** * A pool of subchannels use for making connections. Subchannels with the * exact same parameters will be reused. * @param global If true, this is the global subchannel pool. Otherwise, it * is the pool for a single channel. */ constructor(global) { this.global = global; this.pool = Object.create(null); /** * A timer of a task performing a periodic subchannel cleanup. */ this.cleanupTimer = null; } /** * Unrefs all unused subchannels and cancels the cleanup task if all * subchannels have been unrefed. */ unrefUnusedSubchannels() { let allSubchannelsUnrefed = true; /* These objects are created with Object.create(null), so they do not * have a prototype, which means that for (... in ...) loops over them * do not need to be filtered */ // eslint-disable-disable-next-line:forin for (const channelTarget in this.pool) { const subchannelObjArray = this.pool[channelTarget]; const refedSubchannels = subchannelObjArray.filter((value) => !value.subchannel.unrefIfOneRef()); if (refedSubchannels.length > 0) { allSubchannelsUnrefed = false; } /* For each subchannel in the pool, try to unref it if it has * exactly one ref (which is the ref from the pool itself). If that * does happen, remove the subchannel from the pool */ this.pool[channelTarget] = refedSubchannels; } /* Currently we do not delete keys with empty values. If that results * in significant memory usage we should change it. */ // Cancel the cleanup task if all subchannels have been unrefed. if (allSubchannelsUnrefed && this.cleanupTimer !== null) { clearInterval(this.cleanupTimer); this.cleanupTimer = null; } } /** * Ensures that the cleanup task is spawned. */ ensureCleanupTask() { var _a, _b; if (this.global && this.cleanupTimer === null) { this.cleanupTimer = setInterval(() => { this.unrefUnusedSubchannels(); }, REF_CHECK_INTERVAL); // Unref because this timer should not keep the event loop running. // Call unref only if it exists to address electron/electron#21162 (_b = (_a = this.cleanupTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a); } } /** * Get a subchannel if one already exists with exactly matching parameters. * Otherwise, create and save a subchannel with those parameters. * @param channelTarget * @param subchannelTarget * @param channelArguments * @param channelCredentials */ getOrCreateSubchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials) { this.ensureCleanupTask(); const channelTarget = uri_parser_1.uriToString(channelTargetUri); if (channelTarget in this.pool) { const subchannelObjArray = this.pool[channelTarget]; for (const subchannelObj of subchannelObjArray) { if (subchannel_address_1.subchannelAddressEqual(subchannelTarget, subchannelObj.subchannelAddress) && channel_options_1.channelOptionsEqual(channelArguments, subchannelObj.channelArguments) && channelCredentials._equals(subchannelObj.channelCredentials)) { return subchannelObj.subchannel; } } } // If we get here, no matching subchannel was found const subchannel = new subchannel_1.Subchannel(channelTargetUri, subchannelTarget, channelArguments, channelCredentials); if (!(channelTarget in this.pool)) { this.pool[channelTarget] = []; } this.pool[channelTarget].push({ subchannelAddress: subchannelTarget, channelArguments, channelCredentials, subchannel, }); if (this.global) { subchannel.ref(); } return subchannel; } } exports.SubchannelPool = SubchannelPool; const globalSubchannelPool = new SubchannelPool(true); /** * Get either the global subchannel pool, or a new subchannel pool. * @param global */ function getSubchannelPool(global) { if (global) { return globalSubchannelPool; } else { return new SubchannelPool(false); } } exports.getSubchannelPool = getSubchannelPool; //# sourceMappingURL=subchannel-pool.js.map /***/ }), /***/ 84764: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Subchannel = void 0; const http2 = __webpack_require__(97565); const tls_1 = __webpack_require__(4016); const connectivity_state_1 = __webpack_require__(80878); const backoff_timeout_1 = __webpack_require__(34186); const resolver_1 = __webpack_require__(31594); const logging = __webpack_require__(35993); const constants_1 = __webpack_require__(90634); const http_proxy_1 = __webpack_require__(24000); const net = __webpack_require__(11631); const uri_parser_1 = __webpack_require__(65974); const subchannel_address_1 = __webpack_require__(99905); const channelz_1 = __webpack_require__(79975); const clientVersion = __webpack_require__(68160)/* .version */ .i8; const TRACER_NAME = 'subchannel'; const MIN_CONNECT_TIMEOUT_MS = 20000; const INITIAL_BACKOFF_MS = 1000; const BACKOFF_MULTIPLIER = 1.6; const MAX_BACKOFF_MS = 120000; const BACKOFF_JITTER = 0.2; /* setInterval and setTimeout only accept signed 32 bit integers. JS doesn't * have a constant for the max signed 32 bit integer, so this is a simple way * to calculate it */ const KEEPALIVE_MAX_TIME_MS = ~(1 << 31); const KEEPALIVE_TIMEOUT_MS = 20000; const { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_TE, HTTP2_HEADER_USER_AGENT, } = http2.constants; /** * Get a number uniformly at random in the range [min, max) * @param min * @param max */ function uniformRandom(min, max) { return Math.random() * (max - min) + min; } const tooManyPingsData = Buffer.from('too_many_pings', 'ascii'); class Subchannel { /** * A class representing a connection to a single backend. * @param channelTarget The target string for the channel as a whole * @param subchannelAddress The address for the backend that this subchannel * will connect to * @param options The channel options, plus any specific subchannel options * for this subchannel * @param credentials The channel credentials used to establish this * connection */ constructor(channelTarget, subchannelAddress, options, credentials) { this.channelTarget = channelTarget; this.subchannelAddress = subchannelAddress; this.options = options; this.credentials = credentials; /** * The subchannel's current connectivity state. Invariant: `session` === `null` * if and only if `connectivityState` is IDLE or TRANSIENT_FAILURE. */ this.connectivityState = connectivity_state_1.ConnectivityState.IDLE; /** * The underlying http2 session used to make requests. */ this.session = null; /** * Indicates that the subchannel should transition from TRANSIENT_FAILURE to * CONNECTING instead of IDLE when the backoff timeout ends. */ this.continueConnecting = false; /** * A list of listener functions that will be called whenever the connectivity * state changes. Will be modified by `addConnectivityStateListener` and * `removeConnectivityStateListener` */ this.stateListeners = []; /** * A list of listener functions that will be called when the underlying * socket disconnects. Used for ending active calls with an UNAVAILABLE * status. */ this.disconnectListeners = []; /** * The amount of time in between sending pings */ this.keepaliveTimeMs = KEEPALIVE_MAX_TIME_MS; /** * The amount of time to wait for an acknowledgement after sending a ping */ this.keepaliveTimeoutMs = KEEPALIVE_TIMEOUT_MS; /** * Indicates whether keepalive pings should be sent without any active calls */ this.keepaliveWithoutCalls = false; /** * Tracks calls with references to this subchannel */ this.callRefcount = 0; /** * Tracks channels and subchannel pools with references to this subchannel */ this.refcount = 0; // Channelz info this.channelzEnabled = true; this.callTracker = new channelz_1.ChannelzCallTracker(); this.childrenTracker = new channelz_1.ChannelzChildrenTracker(); // Channelz socket info this.channelzSocketRef = null; /** * Name of the remote server, if it is not the same as the subchannel * address, i.e. if connecting through an HTTP CONNECT proxy. */ this.remoteName = null; this.streamTracker = new channelz_1.ChannelzCallTracker(); this.keepalivesSent = 0; this.messagesSent = 0; this.messagesReceived = 0; this.lastMessageSentTimestamp = null; this.lastMessageReceivedTimestamp = null; // Build user-agent string. this.userAgent = [ options['grpc.primary_user_agent'], `grpc-node-js/${clientVersion}`, options['grpc.secondary_user_agent'], ] .filter((e) => e) .join(' '); // remove falsey values first if ('grpc.keepalive_time_ms' in options) { this.keepaliveTimeMs = options['grpc.keepalive_time_ms']; } if ('grpc.keepalive_timeout_ms' in options) { this.keepaliveTimeoutMs = options['grpc.keepalive_timeout_ms']; } if ('grpc.keepalive_permit_without_calls' in options) { this.keepaliveWithoutCalls = options['grpc.keepalive_permit_without_calls'] === 1; } else { this.keepaliveWithoutCalls = false; } this.keepaliveIntervalId = setTimeout(() => { }, 0); clearTimeout(this.keepaliveIntervalId); this.keepaliveTimeoutId = setTimeout(() => { }, 0); clearTimeout(this.keepaliveTimeoutId); const backoffOptions = { initialDelay: options['grpc.initial_reconnect_backoff_ms'], maxDelay: options['grpc.max_reconnect_backoff_ms'], }; this.backoffTimeout = new backoff_timeout_1.BackoffTimeout(() => { this.handleBackoffTimer(); }, backoffOptions); this.subchannelAddressString = subchannel_address_1.subchannelAddressToString(subchannelAddress); if (options['grpc.enable_channelz'] === 0) { this.channelzEnabled = false; } this.channelzTrace = new channelz_1.ChannelzTrace(); if (this.channelzEnabled) { this.channelzRef = channelz_1.registerChannelzSubchannel(this.subchannelAddressString, () => this.getChannelzInfo()); this.channelzTrace.addTrace('CT_INFO', 'Subchannel created'); } else { // Dummy channelz ref that will never be used this.channelzRef = { kind: 'subchannel', id: -1, name: '' }; } this.trace('Subchannel constructed with options ' + JSON.stringify(options, undefined, 2)); } getChannelzInfo() { return { state: this.connectivityState, trace: this.channelzTrace, callTracker: this.callTracker, children: this.childrenTracker.getChildLists(), target: this.subchannelAddressString }; } getChannelzSocketInfo() { var _a, _b, _c; if (this.session === null) { return null; } const sessionSocket = this.session.socket; const remoteAddress = sessionSocket.remoteAddress ? subchannel_address_1.stringToSubchannelAddress(sessionSocket.remoteAddress, sessionSocket.remotePort) : null; const localAddress = sessionSocket.localAddress ? subchannel_address_1.stringToSubchannelAddress(sessionSocket.localAddress, sessionSocket.localPort) : null; let tlsInfo; if (this.session.encrypted) { const tlsSocket = sessionSocket; const cipherInfo = tlsSocket.getCipher(); const certificate = tlsSocket.getCertificate(); const peerCertificate = tlsSocket.getPeerCertificate(); tlsInfo = { cipherSuiteStandardName: (_a = cipherInfo.standardName) !== null && _a !== void 0 ? _a : null, cipherSuiteOtherName: cipherInfo.standardName ? null : cipherInfo.name, localCertificate: (certificate && 'raw' in certificate) ? certificate.raw : null, remoteCertificate: (peerCertificate && 'raw' in peerCertificate) ? peerCertificate.raw : null }; } else { tlsInfo = null; } const socketInfo = { remoteAddress: remoteAddress, localAddress: localAddress, security: tlsInfo, remoteName: this.remoteName, streamsStarted: this.streamTracker.callsStarted, streamsSucceeded: this.streamTracker.callsSucceeded, streamsFailed: this.streamTracker.callsFailed, messagesSent: this.messagesSent, messagesReceived: this.messagesReceived, keepAlivesSent: this.keepalivesSent, lastLocalStreamCreatedTimestamp: this.streamTracker.lastCallStartedTimestamp, lastRemoteStreamCreatedTimestamp: null, lastMessageSentTimestamp: this.lastMessageSentTimestamp, lastMessageReceivedTimestamp: this.lastMessageReceivedTimestamp, localFlowControlWindow: (_b = this.session.state.localWindowSize) !== null && _b !== void 0 ? _b : null, remoteFlowControlWindow: (_c = this.session.state.remoteWindowSize) !== null && _c !== void 0 ? _c : null }; return socketInfo; } resetChannelzSocketInfo() { if (!this.channelzEnabled) { return; } if (this.channelzSocketRef) { channelz_1.unregisterChannelzRef(this.channelzSocketRef); this.childrenTracker.unrefChild(this.channelzSocketRef); this.channelzSocketRef = null; } this.remoteName = null; this.streamTracker = new channelz_1.ChannelzCallTracker(); this.keepalivesSent = 0; this.messagesSent = 0; this.messagesReceived = 0; this.lastMessageSentTimestamp = null; this.lastMessageReceivedTimestamp = null; } trace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' ' + text); } refTrace(text) { logging.trace(constants_1.LogVerbosity.DEBUG, 'subchannel_refcount', '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' ' + text); } handleBackoffTimer() { if (this.continueConnecting) { this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING); } else { this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.IDLE); } } /** * Start a backoff timer with the current nextBackoff timeout */ startBackoff() { this.backoffTimeout.runOnce(); } stopBackoff() { this.backoffTimeout.stop(); this.backoffTimeout.reset(); } sendPing() { var _a, _b; if (this.channelzEnabled) { this.keepalivesSent += 1; } logging.trace(constants_1.LogVerbosity.DEBUG, 'keepalive', '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' ' + 'Sending ping'); this.keepaliveTimeoutId = setTimeout(() => { this.transitionToState([connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE); }, this.keepaliveTimeoutMs); (_b = (_a = this.keepaliveTimeoutId).unref) === null || _b === void 0 ? void 0 : _b.call(_a); this.session.ping((err, duration, payload) => { clearTimeout(this.keepaliveTimeoutId); }); } startKeepalivePings() { var _a, _b; this.keepaliveIntervalId = setInterval(() => { this.sendPing(); }, this.keepaliveTimeMs); (_b = (_a = this.keepaliveIntervalId).unref) === null || _b === void 0 ? void 0 : _b.call(_a); /* Don't send a ping immediately because whatever caused us to start * sending pings should also involve some network activity. */ } stopKeepalivePings() { clearInterval(this.keepaliveIntervalId); clearTimeout(this.keepaliveTimeoutId); } createSession(proxyConnectionResult) { var _a, _b, _c; if (proxyConnectionResult.realTarget) { this.remoteName = uri_parser_1.uriToString(proxyConnectionResult.realTarget); this.trace('creating HTTP/2 session through proxy to ' + proxyConnectionResult.realTarget); } else { this.remoteName = null; this.trace('creating HTTP/2 session'); } const targetAuthority = resolver_1.getDefaultAuthority((_a = proxyConnectionResult.realTarget) !== null && _a !== void 0 ? _a : this.channelTarget); let connectionOptions = this.credentials._getConnectionOptions() || {}; connectionOptions.maxSendHeaderBlockLength = Number.MAX_SAFE_INTEGER; if ('grpc-node.max_session_memory' in this.options) { connectionOptions.maxSessionMemory = this.options['grpc-node.max_session_memory']; } let addressScheme = 'http://'; if ('secureContext' in connectionOptions) { addressScheme = 'https://'; // If provided, the value of grpc.ssl_target_name_override should be used // to override the target hostname when checking server identity. // This option is used for testing only. if (this.options['grpc.ssl_target_name_override']) { const sslTargetNameOverride = this.options['grpc.ssl_target_name_override']; connectionOptions.checkServerIdentity = (host, cert) => { return tls_1.checkServerIdentity(sslTargetNameOverride, cert); }; connectionOptions.servername = sslTargetNameOverride; } else { const authorityHostname = (_c = (_b = uri_parser_1.splitHostPort(targetAuthority)) === null || _b === void 0 ? void 0 : _b.host) !== null && _c !== void 0 ? _c : 'localhost'; // We want to always set servername to support SNI connectionOptions.servername = authorityHostname; } if (proxyConnectionResult.socket) { /* This is part of the workaround for * https://github.com/nodejs/node/issues/32922. Without that bug, * proxyConnectionResult.socket would always be a plaintext socket and * this would say * connectionOptions.socket = proxyConnectionResult.socket; */ connectionOptions.createConnection = (authority, option) => { return proxyConnectionResult.socket; }; } } else { /* In all but the most recent versions of Node, http2.connect does not use * the options when establishing plaintext connections, so we need to * establish that connection explicitly. */ connectionOptions.createConnection = (authority, option) => { if (proxyConnectionResult.socket) { return proxyConnectionResult.socket; } else { /* net.NetConnectOpts is declared in a way that is more restrictive * than what net.connect will actually accept, so we use the type * assertion to work around that. */ return net.connect(this.subchannelAddress); } }; } connectionOptions = Object.assign(Object.assign({}, connectionOptions), this.subchannelAddress); /* http2.connect uses the options here: * https://github.com/nodejs/node/blob/70c32a6d190e2b5d7b9ff9d5b6a459d14e8b7d59/lib/internal/http2/core.js#L3028-L3036 * The spread operator overides earlier values with later ones, so any port * or host values in the options will be used rather than any values extracted * from the first argument. In addition, the path overrides the host and port, * as documented for plaintext connections here: * https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener * and for TLS connections here: * https://nodejs.org/api/tls.html#tls_tls_connect_options_callback. In * earlier versions of Node, http2.connect passes these options to * tls.connect but not net.connect, so in the insecure case we still need * to set the createConnection option above to create the connection * explicitly. We cannot do that in the TLS case because http2.connect * passes necessary additional options to tls.connect. * The first argument just needs to be parseable as a URL and the scheme * determines whether the connection will be established over TLS or not. */ const session = http2.connect(addressScheme + targetAuthority, connectionOptions); this.session = session; if (this.channelzEnabled) { this.channelzSocketRef = channelz_1.registerChannelzSocket(this.subchannelAddressString, () => this.getChannelzSocketInfo()); this.childrenTracker.refChild(this.channelzSocketRef); } session.unref(); /* For all of these events, check if the session at the time of the event * is the same one currently attached to this subchannel, to ensure that * old events from previous connection attempts cannot cause invalid state * transitions. */ session.once('connect', () => { if (this.session === session) { this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.READY); } }); session.once('close', () => { if (this.session === session) { this.trace('connection closed'); this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE); /* Transitioning directly to IDLE here should be OK because we are not * doing any backoff, because a connection was established at some * point */ this.transitionToState([connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE); } }); session.once('goaway', (errorCode, lastStreamID, opaqueData) => { if (this.session === session) { /* See the last paragraph of * https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md#basic-keepalive */ if (errorCode === http2.constants.NGHTTP2_ENHANCE_YOUR_CALM && opaqueData.equals(tooManyPingsData)) { this.keepaliveTimeMs = Math.min(2 * this.keepaliveTimeMs, KEEPALIVE_MAX_TIME_MS); logging.log(constants_1.LogVerbosity.ERROR, `Connection to ${uri_parser_1.uriToString(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTimeMs} ms`); } this.trace('connection closed by GOAWAY with code ' + errorCode); this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING, connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.IDLE); } }); session.once('error', (error) => { /* Do nothing here. Any error should also trigger a close event, which is * where we want to handle that. */ this.trace('connection closed with error ' + error.message); }); } startConnectingInternal() { var _a, _b; /* Pass connection options through to the proxy so that it's able to * upgrade it's connection to support tls if needed. * This is a workaround for https://github.com/nodejs/node/issues/32922 * See https://github.com/grpc/grpc-node/pull/1369 for more info. */ const connectionOptions = this.credentials._getConnectionOptions() || {}; if ('secureContext' in connectionOptions) { connectionOptions.ALPNProtocols = ['h2']; // If provided, the value of grpc.ssl_target_name_override should be used // to override the target hostname when checking server identity. // This option is used for testing only. if (this.options['grpc.ssl_target_name_override']) { const sslTargetNameOverride = this.options['grpc.ssl_target_name_override']; connectionOptions.checkServerIdentity = (host, cert) => { return tls_1.checkServerIdentity(sslTargetNameOverride, cert); }; connectionOptions.servername = sslTargetNameOverride; } else { if ('grpc.http_connect_target' in this.options) { /* This is more or less how servername will be set in createSession * if a connection is successfully established through the proxy. * If the proxy is not used, these connectionOptions are discarded * anyway */ const targetPath = resolver_1.getDefaultAuthority((_a = uri_parser_1.parseUri(this.options['grpc.http_connect_target'])) !== null && _a !== void 0 ? _a : { path: 'localhost', }); const hostPort = uri_parser_1.splitHostPort(targetPath); connectionOptions.servername = (_b = hostPort === null || hostPort === void 0 ? void 0 : hostPort.host) !== null && _b !== void 0 ? _b : targetPath; } } } http_proxy_1.getProxiedConnection(this.subchannelAddress, this.options, connectionOptions).then((result) => { this.createSession(result); }, (reason) => { this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE); }); } /** * Initiate a state transition from any element of oldStates to the new * state. If the current connectivityState is not in oldStates, do nothing. * @param oldStates The set of states to transition from * @param newState The state to transition to * @returns True if the state changed, false otherwise */ transitionToState(oldStates, newState) { if (oldStates.indexOf(this.connectivityState) === -1) { return false; } this.trace(connectivity_state_1.ConnectivityState[this.connectivityState] + ' -> ' + connectivity_state_1.ConnectivityState[newState]); if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_INFO', connectivity_state_1.ConnectivityState[this.connectivityState] + ' -> ' + connectivity_state_1.ConnectivityState[newState]); } const previousState = this.connectivityState; this.connectivityState = newState; switch (newState) { case connectivity_state_1.ConnectivityState.READY: this.stopBackoff(); this.session.socket.once('close', () => { for (const listener of this.disconnectListeners) { listener(); } }); if (this.keepaliveWithoutCalls) { this.startKeepalivePings(); } break; case connectivity_state_1.ConnectivityState.CONNECTING: this.startBackoff(); this.startConnectingInternal(); this.continueConnecting = false; break; case connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE: if (this.session) { this.session.close(); } this.session = null; this.resetChannelzSocketInfo(); this.stopKeepalivePings(); /* If the backoff timer has already ended by the time we get to the * TRANSIENT_FAILURE state, we want to immediately transition out of * TRANSIENT_FAILURE as though the backoff timer is ending right now */ if (!this.backoffTimeout.isRunning()) { process.nextTick(() => { this.handleBackoffTimer(); }); } break; case connectivity_state_1.ConnectivityState.IDLE: if (this.session) { this.session.close(); } this.session = null; this.resetChannelzSocketInfo(); this.stopKeepalivePings(); break; default: throw new Error(`Invalid state: unknown ConnectivityState ${newState}`); } /* We use a shallow copy of the stateListeners array in case a listener * is removed during this iteration */ for (const listener of [...this.stateListeners]) { listener(this, previousState, newState); } return true; } /** * Check if the subchannel associated with zero calls and with zero channels. * If so, shut it down. */ checkBothRefcounts() { /* If no calls, channels, or subchannel pools have any more references to * this subchannel, we can be sure it will never be used again. */ if (this.callRefcount === 0 && this.refcount === 0) { if (this.channelzEnabled) { this.channelzTrace.addTrace('CT_INFO', 'Shutting down'); } this.transitionToState([connectivity_state_1.ConnectivityState.CONNECTING, connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE); if (this.channelzEnabled) { channelz_1.unregisterChannelzRef(this.channelzRef); } } } callRef() { this.refTrace('callRefcount ' + this.callRefcount + ' -> ' + (this.callRefcount + 1)); if (this.callRefcount === 0) { if (this.session) { this.session.ref(); } this.backoffTimeout.ref(); if (!this.keepaliveWithoutCalls) { this.startKeepalivePings(); } } this.callRefcount += 1; } callUnref() { this.refTrace('callRefcount ' + this.callRefcount + ' -> ' + (this.callRefcount - 1)); this.callRefcount -= 1; if (this.callRefcount === 0) { if (this.session) { this.session.unref(); } this.backoffTimeout.unref(); if (!this.keepaliveWithoutCalls) { this.stopKeepalivePings(); } this.checkBothRefcounts(); } } ref() { this.refTrace('refcount ' + this.refcount + ' -> ' + (this.refcount + 1)); this.refcount += 1; } unref() { this.refTrace('refcount ' + this.refcount + ' -> ' + (this.refcount - 1)); this.refcount -= 1; this.checkBothRefcounts(); } unrefIfOneRef() { if (this.refcount === 1) { this.unref(); return true; } return false; } /** * Start a stream on the current session with the given `metadata` as headers * and then attach it to the `callStream`. Must only be called if the * subchannel's current connectivity state is READY. * @param metadata * @param callStream */ startCallStream(metadata, callStream, extraFilters) { const headers = metadata.toHttp2Headers(); headers[HTTP2_HEADER_AUTHORITY] = callStream.getHost(); headers[HTTP2_HEADER_USER_AGENT] = this.userAgent; headers[HTTP2_HEADER_CONTENT_TYPE] = 'application/grpc'; headers[HTTP2_HEADER_METHOD] = 'POST'; headers[HTTP2_HEADER_PATH] = callStream.getMethod(); headers[HTTP2_HEADER_TE] = 'trailers'; let http2Stream; /* In theory, if an error is thrown by session.request because session has * become unusable (e.g. because it has received a goaway), this subchannel * should soon see the corresponding close or goaway event anyway and leave * READY. But we have seen reports that this does not happen * (https://github.com/googleapis/nodejs-firestore/issues/1023#issuecomment-653204096) * so for defense in depth, we just discard the session when we see an * error here. */ try { http2Stream = this.session.request(headers); } catch (e) { this.transitionToState([connectivity_state_1.ConnectivityState.READY], connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE); throw e; } let headersString = ''; for (const header of Object.keys(headers)) { headersString += '\t\t' + header + ': ' + headers[header] + '\n'; } logging.trace(constants_1.LogVerbosity.DEBUG, 'call_stream', 'Starting stream on subchannel ' + '(' + this.channelzRef.id + ') ' + this.subchannelAddressString + ' with headers\n' + headersString); const streamSession = this.session; let statsTracker; if (this.channelzEnabled) { this.callTracker.addCallStarted(); callStream.addStatusWatcher(status => { if (status.code === constants_1.Status.OK) { this.callTracker.addCallSucceeded(); } else { this.callTracker.addCallFailed(); } }); this.streamTracker.addCallStarted(); callStream.addStreamEndWatcher(success => { if (streamSession === this.session) { if (success) { this.streamTracker.addCallSucceeded(); } else { this.streamTracker.addCallFailed(); } } }); statsTracker = { addMessageSent: () => { this.messagesSent += 1; this.lastMessageSentTimestamp = new Date(); }, addMessageReceived: () => { this.messagesReceived += 1; } }; } else { statsTracker = { addMessageSent: () => { }, addMessageReceived: () => { } }; } callStream.attachHttp2Stream(http2Stream, this, extraFilters, statsTracker); } /** * If the subchannel is currently IDLE, start connecting and switch to the * CONNECTING state. If the subchannel is current in TRANSIENT_FAILURE, * the next time it would transition to IDLE, start connecting again instead. * Otherwise, do nothing. */ startConnecting() { /* First, try to transition from IDLE to connecting. If that doesn't happen * because the state is not currently IDLE, check if it is * TRANSIENT_FAILURE, and if so indicate that it should go back to * connecting after the backoff timer ends. Otherwise do nothing */ if (!this.transitionToState([connectivity_state_1.ConnectivityState.IDLE], connectivity_state_1.ConnectivityState.CONNECTING)) { if (this.connectivityState === connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE) { this.continueConnecting = true; } } } /** * Get the subchannel's current connectivity state. */ getConnectivityState() { return this.connectivityState; } /** * Add a listener function to be called whenever the subchannel's * connectivity state changes. * @param listener */ addConnectivityStateListener(listener) { this.stateListeners.push(listener); } /** * Remove a listener previously added with `addConnectivityStateListener` * @param listener A reference to a function previously passed to * `addConnectivityStateListener` */ removeConnectivityStateListener(listener) { const listenerIndex = this.stateListeners.indexOf(listener); if (listenerIndex > -1) { this.stateListeners.splice(listenerIndex, 1); } } addDisconnectListener(listener) { this.disconnectListeners.push(listener); } removeDisconnectListener(listener) { const listenerIndex = this.disconnectListeners.indexOf(listener); if (listenerIndex > -1) { this.disconnectListeners.splice(listenerIndex, 1); } } /** * Reset the backoff timeout, and immediately start connecting if in backoff. */ resetBackoff() { this.backoffTimeout.reset(); this.transitionToState([connectivity_state_1.ConnectivityState.TRANSIENT_FAILURE], connectivity_state_1.ConnectivityState.CONNECTING); } getAddress() { return this.subchannelAddressString; } getChannelzRef() { return this.channelzRef; } } exports.Subchannel = Subchannel; //# sourceMappingURL=subchannel.js.map /***/ }), /***/ 86581: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getDefaultRootsData = exports.CIPHER_SUITES = void 0; const fs = __webpack_require__(35747); exports.CIPHER_SUITES = process.env.GRPC_SSL_CIPHER_SUITES; const DEFAULT_ROOTS_FILE_PATH = process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH; let defaultRootsData = null; function getDefaultRootsData() { if (DEFAULT_ROOTS_FILE_PATH) { if (defaultRootsData === null) { defaultRootsData = fs.readFileSync(DEFAULT_ROOTS_FILE_PATH); } return defaultRootsData; } return null; } exports.getDefaultRootsData = getDefaultRootsData; //# sourceMappingURL=tls-helpers.js.map /***/ }), /***/ 65974: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright 2020 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.uriToString = exports.splitHostPort = exports.parseUri = void 0; /* * The groups correspond to URI parts as follows: * 1. scheme * 2. authority * 3. path */ const URI_REGEX = /^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/; function parseUri(uriString) { const parsedUri = URI_REGEX.exec(uriString); if (parsedUri === null) { return null; } return { scheme: parsedUri[1], authority: parsedUri[2], path: parsedUri[3], }; } exports.parseUri = parseUri; const NUMBER_REGEX = /^\d+$/; function splitHostPort(path) { if (path.startsWith('[')) { const hostEnd = path.indexOf(']'); if (hostEnd === -1) { return null; } const host = path.substring(1, hostEnd); /* Only an IPv6 address should be in bracketed notation, and an IPv6 * address should have at least one colon */ if (host.indexOf(':') === -1) { return null; } if (path.length > hostEnd + 1) { if (path[hostEnd + 1] === ':') { const portString = path.substring(hostEnd + 2); if (NUMBER_REGEX.test(portString)) { return { host: host, port: +portString, }; } else { return null; } } else { return null; } } else { return { host, }; } } else { const splitPath = path.split(':'); /* Exactly one colon means that this is host:port. Zero colons means that * there is no port. And multiple colons means that this is a bare IPv6 * address with no port */ if (splitPath.length === 2) { if (NUMBER_REGEX.test(splitPath[1])) { return { host: splitPath[0], port: +splitPath[1], }; } else { return null; } } else { return { host: path, }; } } } exports.splitHostPort = splitHostPort; function uriToString(uri) { let result = ''; if (uri.scheme !== undefined) { result += uri.scheme + ':'; } if (uri.authority !== undefined) { result += '//' + uri.authority + '/'; } result += uri.path; return result; } exports.uriToString = uriToString; //# sourceMappingURL=uri-parser.js.map /***/ }), /***/ 98171: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); const camelCase = __webpack_require__(7994); const Protobuf = __webpack_require__(85881); const descriptor = __webpack_require__(21629); const util_1 = __webpack_require__(13245); function isAnyExtension(obj) { return ('@type' in obj) && (typeof obj['@type'] === 'string'); } exports.isAnyExtension = isAnyExtension; const descriptorOptions = { longs: String, enums: String, bytes: String, defaults: true, oneofs: true, json: true, }; function joinName(baseName, name) { if (baseName === '') { return name; } else { return baseName + '.' + name; } } function isHandledReflectionObject(obj) { return (obj instanceof Protobuf.Service || obj instanceof Protobuf.Type || obj instanceof Protobuf.Enum); } function isNamespaceBase(obj) { return obj instanceof Protobuf.Namespace || obj instanceof Protobuf.Root; } function getAllHandledReflectionObjects(obj, parentName) { const objName = joinName(parentName, obj.name); if (isHandledReflectionObject(obj)) { return [[objName, obj]]; } else { if (isNamespaceBase(obj) && typeof obj.nested !== 'undefined') { return Object.keys(obj.nested) .map(name => { return getAllHandledReflectionObjects(obj.nested[name], objName); }) .reduce((accumulator, currentValue) => accumulator.concat(currentValue), []); } } return []; } function createDeserializer(cls, options) { return function deserialize(argBuf) { return cls.toObject(cls.decode(argBuf), options); }; } function createSerializer(cls) { return function serialize(arg) { if (Array.isArray(arg)) { throw new Error(`Failed to serialize message: expected object with ${cls.name} structure, got array instead`); } const message = cls.fromObject(arg); return cls.encode(message).finish(); }; } function createMethodDefinition(method, serviceName, options, fileDescriptors) { /* This is only ever called after the corresponding root.resolveAll(), so we * can assume that the resolved request and response types are non-null */ const requestType = method.resolvedRequestType; const responseType = method.resolvedResponseType; return { path: '/' + serviceName + '/' + method.name, requestStream: !!method.requestStream, responseStream: !!method.responseStream, requestSerialize: createSerializer(requestType), requestDeserialize: createDeserializer(requestType, options), responseSerialize: createSerializer(responseType), responseDeserialize: createDeserializer(responseType, options), // TODO(murgatroid99): Find a better way to handle this originalName: camelCase(method.name), requestType: createMessageDefinition(requestType, fileDescriptors), responseType: createMessageDefinition(responseType, fileDescriptors), }; } function createServiceDefinition(service, name, options, fileDescriptors) { const def = {}; for (const method of service.methodsArray) { def[method.name] = createMethodDefinition(method, name, options, fileDescriptors); } return def; } function createMessageDefinition(message, fileDescriptors) { const messageDescriptor = message.toDescriptor('proto3'); return { format: 'Protocol Buffer 3 DescriptorProto', type: messageDescriptor.$type.toObject(messageDescriptor, descriptorOptions), fileDescriptorProtos: fileDescriptors, }; } function createEnumDefinition(enumType, fileDescriptors) { const enumDescriptor = enumType.toDescriptor('proto3'); return { format: 'Protocol Buffer 3 EnumDescriptorProto', type: enumDescriptor.$type.toObject(enumDescriptor, descriptorOptions), fileDescriptorProtos: fileDescriptors, }; } /** * function createDefinition(obj: Protobuf.Service, name: string, options: * Options): ServiceDefinition; function createDefinition(obj: Protobuf.Type, * name: string, options: Options): MessageTypeDefinition; function * createDefinition(obj: Protobuf.Enum, name: string, options: Options): * EnumTypeDefinition; */ function createDefinition(obj, name, options, fileDescriptors) { if (obj instanceof Protobuf.Service) { return createServiceDefinition(obj, name, options, fileDescriptors); } else if (obj instanceof Protobuf.Type) { return createMessageDefinition(obj, fileDescriptors); } else if (obj instanceof Protobuf.Enum) { return createEnumDefinition(obj, fileDescriptors); } else { throw new Error('Type mismatch in reflection object handling'); } } function createPackageDefinition(root, options) { const def = {}; root.resolveAll(); const descriptorList = root.toDescriptor('proto3').file; const bufferList = descriptorList.map(value => Buffer.from(descriptor.FileDescriptorProto.encode(value).finish())); for (const [name, obj] of getAllHandledReflectionObjects(root, '')) { def[name] = createDefinition(obj, name, options, bufferList); } return def; } function createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options) { options = options || {}; const root = Protobuf.Root.fromDescriptor(decodedDescriptorSet); root.resolveAll(); return createPackageDefinition(root, options); } /** * Load a .proto file with the specified options. * @param filename One or multiple file paths to load. Can be an absolute path * or relative to an include path. * @param options.keepCase Preserve field names. The default is to change them * to camel case. * @param options.longs The type that should be used to represent `long` values. * Valid options are `Number` and `String`. Defaults to a `Long` object type * from a library. * @param options.enums The type that should be used to represent `enum` values. * The only valid option is `String`. Defaults to the numeric value. * @param options.bytes The type that should be used to represent `bytes` * values. Valid options are `Array` and `String`. The default is to use * `Buffer`. * @param options.defaults Set default values on output objects. Defaults to * `false`. * @param options.arrays Set empty arrays for missing array values even if * `defaults` is `false`. Defaults to `false`. * @param options.objects Set empty objects for missing object values even if * `defaults` is `false`. Defaults to `false`. * @param options.oneofs Set virtual oneof properties to the present field's * name * @param options.json Represent Infinity and NaN as strings in float fields, * and automatically decode google.protobuf.Any values. * @param options.includeDirs Paths to search for imported `.proto` files. */ function load(filename, options) { return util_1.loadProtosWithOptions(filename, options).then(loadedRoot => { return createPackageDefinition(loadedRoot, options); }); } exports.load = load; function loadSync(filename, options) { const loadedRoot = util_1.loadProtosWithOptionsSync(filename, options); return createPackageDefinition(loadedRoot, options); } exports.loadSync = loadSync; function fromJSON(json, options) { options = options || {}; const loadedRoot = Protobuf.Root.fromJSON(json); loadedRoot.resolveAll(); return createPackageDefinition(loadedRoot, options); } exports.fromJSON = fromJSON; function loadFileDescriptorSetFromBuffer(descriptorSet, options) { const decodedDescriptorSet = descriptor.FileDescriptorSet.decode(descriptorSet); return createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options); } exports.loadFileDescriptorSetFromBuffer = loadFileDescriptorSetFromBuffer; function loadFileDescriptorSetFromObject(descriptorSet, options) { const decodedDescriptorSet = descriptor.FileDescriptorSet.fromObject(descriptorSet); return createPackageDefinitionFromDescriptorSet(decodedDescriptorSet, options); } exports.loadFileDescriptorSetFromObject = loadFileDescriptorSetFromObject; util_1.addCommonProtos(); //# sourceMappingURL=index.js.map /***/ }), /***/ 13245: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __webpack_require__(35747); const path = __webpack_require__(85622); const Protobuf = __webpack_require__(85881); function addIncludePathResolver(root, includePaths) { const originalResolvePath = root.resolvePath; root.resolvePath = (origin, target) => { if (path.isAbsolute(target)) { return target; } for (const directory of includePaths) { const fullPath = path.join(directory, target); try { fs.accessSync(fullPath, fs.constants.R_OK); return fullPath; } catch (err) { continue; } } process.emitWarning(`${target} not found in any of the include paths ${includePaths}`); return originalResolvePath(origin, target); }; } async function loadProtosWithOptions(filename, options) { const root = new Protobuf.Root(); options = options || {}; if (!!options.includeDirs) { if (!Array.isArray(options.includeDirs)) { return Promise.reject(new Error('The includeDirs option must be an array')); } addIncludePathResolver(root, options.includeDirs); } const loadedRoot = await root.load(filename, options); loadedRoot.resolveAll(); return loadedRoot; } exports.loadProtosWithOptions = loadProtosWithOptions; function loadProtosWithOptionsSync(filename, options) { const root = new Protobuf.Root(); options = options || {}; if (!!options.includeDirs) { if (!Array.isArray(options.includeDirs)) { throw new Error('The includeDirs option must be an array'); } addIncludePathResolver(root, options.includeDirs); } const loadedRoot = root.loadSync(filename, options); loadedRoot.resolveAll(); return loadedRoot; } exports.loadProtosWithOptionsSync = loadProtosWithOptionsSync; /** * Load Google's well-known proto files that aren't exposed by Protobuf.js. */ function addCommonProtos() { // Protobuf.js exposes: any, duration, empty, field_mask, struct, timestamp, // and wrappers. compiler/plugin is excluded in Protobuf.js and here. // Using constant strings for compatibility with tools like Webpack const apiDescriptor = __webpack_require__(78155); const descriptorDescriptor = __webpack_require__(40333); const sourceContextDescriptor = __webpack_require__(56663); const typeDescriptor = __webpack_require__(75715); Protobuf.common('api', apiDescriptor.nested.google.nested.protobuf.nested); Protobuf.common('descriptor', descriptorDescriptor.nested.google.nested.protobuf.nested); Protobuf.common('source_context', sourceContextDescriptor.nested.google.nested.protobuf.nested); Protobuf.common('type', typeDescriptor.nested.google.nested.protobuf.nested); } exports.addCommonProtos = addCommonProtos; //# sourceMappingURL=util.js.map /***/ }), /***/ 56664: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); tslib_1.__exportStar(__webpack_require__(37233), exports); //# sourceMappingURL=api.js.map /***/ }), /***/ 61041: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Attach = void 0; const tslib_1 = __webpack_require__(75636); const querystring = __webpack_require__(71191); const terminal_size_queue_1 = __webpack_require__(76023); const web_socket_handler_1 = __webpack_require__(47581); class Attach { constructor(config, websocketInterface) { this.handler = websocketInterface || new web_socket_handler_1.WebSocketHandler(config); } attach(namespace, podName, containerName, stdout, stderr, stdin, tty) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const query = { container: containerName, stderr: stderr != null, stdin: stdin != null, stdout: stdout != null, tty, }; const queryStr = querystring.stringify(query); const path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`; const conn = yield this.handler.connect(path, null, (streamNum, buff) => { web_socket_handler_1.WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr); return true; }); if (stdin != null) { web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, stdin, web_socket_handler_1.WebSocketHandler.StdinStream); } if (terminal_size_queue_1.isResizable(stdout)) { this.terminalSizeQueue = new terminal_size_queue_1.TerminalSizeQueue(); web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, web_socket_handler_1.WebSocketHandler.ResizeStream); this.terminalSizeQueue.handleResizes(stdout); } return conn; }); } } exports.Attach = Attach; //# sourceMappingURL=attach.js.map /***/ }), /***/ 5434: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.deleteObject = exports.addOrUpdateObject = exports.deleteItems = exports.ListWatch = void 0; const tslib_1 = __webpack_require__(75636); const informer_1 = __webpack_require__(88029); class ListWatch { constructor(path, watch, listFn, autoStart = true) { this.path = path; this.watch = watch; this.listFn = listFn; this.objects = []; this.indexCache = {}; this.callbackCache = {}; this.stopped = false; this.callbackCache[informer_1.ADD] = []; this.callbackCache[informer_1.UPDATE] = []; this.callbackCache[informer_1.DELETE] = []; this.callbackCache[informer_1.ERROR] = []; this.resourceVersion = ''; if (autoStart) { this.doneHandler(null); } } start() { return tslib_1.__awaiter(this, void 0, void 0, function* () { this.stopped = false; yield this.doneHandler(null); }); } stop() { return tslib_1.__awaiter(this, void 0, void 0, function* () { this.stopped = true; this._stop(); }); } on(verb, cb) { if (verb === informer_1.CHANGE) { this.on(informer_1.ADD, cb); this.on(informer_1.UPDATE, cb); this.on(informer_1.DELETE, cb); return; } if (this.callbackCache[verb] === undefined) { throw new Error(`Unknown verb: ${verb}`); } this.callbackCache[verb].push(cb); } off(verb, cb) { if (verb === informer_1.CHANGE) { this.off(informer_1.ADD, cb); this.off(informer_1.UPDATE, cb); this.off(informer_1.DELETE, cb); return; } if (this.callbackCache[verb] === undefined) { throw new Error(`Unknown verb: ${verb}`); } const indexToRemove = this.callbackCache[verb].findIndex((cachedCb) => cachedCb === cb); if (indexToRemove === -1) { return; } this.callbackCache[verb].splice(indexToRemove, 1); } get(name, namespace) { return this.objects.find((obj) => { return obj.metadata.name === name && (!namespace || obj.metadata.namespace === namespace); }); } list(namespace) { if (!namespace) { return this.objects; } return this.indexCache[namespace]; } latestResourceVersion() { return this.resourceVersion; } _stop() { if (this.request) { this.request.abort(); this.request = undefined; } } doneHandler(err) { return tslib_1.__awaiter(this, void 0, void 0, function* () { this._stop(); if (err) { this.callbackCache[informer_1.ERROR].forEach((elt) => elt(err)); return; } if (this.stopped) { // do not auto-restart return; } // TODO: Don't always list here for efficiency // try to restart the watch from resourceVersion, but detect 410 GONE and relist in that case. // Or if resourceVersion is empty. const promise = this.listFn(); const result = yield promise; const list = result.body; this.objects = deleteItems(this.objects, list.items, this.callbackCache[informer_1.DELETE].slice()); Object.keys(this.indexCache).forEach((key) => { const updateObjects = deleteItems(this.indexCache[key], list.items); if (updateObjects.length !== 0) { this.indexCache[key] = updateObjects; } else { delete this.indexCache[key]; } }); this.addOrUpdateItems(list.items); this.request = yield this.watch.watch(this.path, { resourceVersion: list.metadata.resourceVersion }, this.watchHandler.bind(this), this.doneHandler.bind(this)); }); } addOrUpdateItems(items) { items.forEach((obj) => { addOrUpdateObject(this.objects, obj, this.callbackCache[informer_1.ADD].slice(), this.callbackCache[informer_1.UPDATE].slice()); if (obj.metadata.namespace) { this.indexObj(obj); } }); } indexObj(obj) { let namespaceList = this.indexCache[obj.metadata.namespace]; if (!namespaceList) { namespaceList = []; this.indexCache[obj.metadata.namespace] = namespaceList; } addOrUpdateObject(namespaceList, obj); } watchHandler(phase, obj, watchObj) { switch (phase) { case 'ADDED': case 'MODIFIED': addOrUpdateObject(this.objects, obj, this.callbackCache[informer_1.ADD].slice(), this.callbackCache[informer_1.UPDATE].slice()); if (obj.metadata.namespace) { this.indexObj(obj); } break; case 'DELETED': deleteObject(this.objects, obj, this.callbackCache[informer_1.DELETE].slice()); if (obj.metadata.namespace) { const namespaceList = this.indexCache[obj.metadata.namespace]; if (namespaceList) { deleteObject(namespaceList, obj); } } break; case 'BOOKMARK': // nothing to do, here for documentation, mostly. break; } if (watchObj && watchObj.metadata) { this.resourceVersion = watchObj.metadata.resourceVersion; } } } exports.ListWatch = ListWatch; // external for testing function deleteItems(oldObjects, newObjects, deleteCallback) { return oldObjects.filter((obj) => { if (findKubernetesObject(newObjects, obj) === -1) { if (deleteCallback) { deleteCallback.forEach((fn) => fn(obj)); } return false; } return true; }); } exports.deleteItems = deleteItems; // Only public for testing. function addOrUpdateObject(objects, obj, addCallback, updateCallback) { const ix = findKubernetesObject(objects, obj); if (ix === -1) { objects.push(obj); if (addCallback) { addCallback.forEach((elt) => elt(obj)); } } else { if (!isSameVersion(objects[ix], obj)) { objects[ix] = obj; if (updateCallback) { updateCallback.forEach((elt) => elt(obj)); } } } } exports.addOrUpdateObject = addOrUpdateObject; function isSameObject(o1, o2) { return o1.metadata.name === o2.metadata.name && o1.metadata.namespace === o2.metadata.namespace; } function isSameVersion(o1, o2) { return (o1.metadata.resourceVersion !== undefined && o1.metadata.resourceVersion !== null && o1.metadata.resourceVersion === o2.metadata.resourceVersion); } function findKubernetesObject(objects, obj) { return objects.findIndex((elt) => { return isSameObject(elt, obj); }); } // Public for testing. function deleteObject(objects, obj, deleteCallback) { const ix = findKubernetesObject(objects, obj); if (ix !== -1) { objects.splice(ix, 1); if (deleteCallback) { deleteCallback.forEach((elt) => elt(obj)); } } } exports.deleteObject = deleteObject; //# sourceMappingURL=cache.js.map /***/ }), /***/ 10032: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CloudAuth = void 0; const tslib_1 = __webpack_require__(75636); const proc = __webpack_require__(63129); const jsonpath = __webpack_require__(63269); class CloudAuth { isAuthProvider(user) { if (!user || !user.authProvider) { return false; } return user.authProvider.name === 'azure' || user.authProvider.name === 'gcp'; } applyAuthentication(user, opts) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const token = this.getToken(user); if (token) { opts.headers.Authorization = `Bearer ${token}`; } }); } getToken(user) { const config = user.authProvider.config; if (this.isExpired(config)) { this.updateAccessToken(config); } return config['access-token']; } isExpired(config) { const token = config['access-token']; const expiry = config.expiry; if (!token) { return true; } if (!expiry) { return false; } const expiration = Date.parse(expiry); if (expiration < Date.now()) { return true; } return false; } updateAccessToken(config) { let cmd = config['cmd-path']; if (!cmd) { throw new Error('Token is expired!'); } // Wrap cmd in quotes to make it cope with spaces in path cmd = `"${cmd}"`; const args = config['cmd-args']; if (args) { cmd = cmd + ' ' + args; } // TODO: Cache to file? // TODO: do this asynchronously let output; try { output = proc.execSync(cmd); } catch (err) { throw new Error('Failed to refresh token: ' + err.message); } const resultObj = JSON.parse(output); const tokenPathKeyInConfig = config['token-key']; const expiryPathKeyInConfig = config['expiry-key']; // Format in file is {}, so slice it out and add '$' const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1); const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1); config['access-token'] = jsonpath.JSONPath(tokenPathKey, resultObj); config.expiry = jsonpath.JSONPath(expiryPathKey, resultObj); } } exports.CloudAuth = CloudAuth; //# sourceMappingURL=cloud_auth.js.map /***/ }), /***/ 14958: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findObject = exports.findHomeDir = exports.bufferFromFileOrString = exports.makeAbsolutePath = exports.Config = exports.KubeConfig = void 0; const tslib_1 = __webpack_require__(75636); const execa = __webpack_require__(55447); const fs = __webpack_require__(35747); const net = __webpack_require__(11631); const path = __webpack_require__(85622); const yaml = __webpack_require__(98286); const shelljs = __webpack_require__(33516); const api = __webpack_require__(56664); const cloud_auth_1 = __webpack_require__(10032); const config_types_1 = __webpack_require__(86218); const exec_auth_1 = __webpack_require__(18325); const file_auth_1 = __webpack_require__(38572); const oidc_auth_1 = __webpack_require__(41691); // fs.existsSync was removed in node 10 function fileExists(filepath) { try { fs.accessSync(filepath); return true; } catch (ignore) { return false; } } class KubeConfig { constructor() { this.contexts = []; this.clusters = []; this.users = []; } getContexts() { return this.contexts; } getClusters() { return this.clusters; } getUsers() { return this.users; } getCurrentContext() { return this.currentContext; } setCurrentContext(context) { this.currentContext = context; } getContextObject(name) { if (!this.contexts) { return null; } return findObject(this.contexts, name, 'context'); } getCurrentCluster() { const context = this.getCurrentContextObject(); if (!context) { return null; } return this.getCluster(context.cluster); } getCluster(name) { return findObject(this.clusters, name, 'cluster'); } getCurrentUser() { const ctx = this.getCurrentContextObject(); if (!ctx) { return null; } return this.getUser(ctx.user); } getUser(name) { return findObject(this.users, name, 'user'); } loadFromFile(file, opts) { const rootDirectory = path.dirname(file); this.loadFromString(fs.readFileSync(file, 'utf8'), opts); this.makePathsAbsolute(rootDirectory); } applytoHTTPSOptions(opts) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const user = this.getCurrentUser(); yield this.applyOptions(opts); if (user && user.username) { opts.auth = `${user.username}:${user.password}`; } }); } applyToRequest(opts) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const cluster = this.getCurrentCluster(); const user = this.getCurrentUser(); yield this.applyOptions(opts); if (cluster && cluster.skipTLSVerify) { opts.strictSSL = false; } if (user && user.username) { opts.auth = { password: user.password, username: user.username, }; } }); } loadFromString(config, opts) { const obj = yaml.safeLoad(config); this.clusters = config_types_1.newClusters(obj.clusters, opts); this.contexts = config_types_1.newContexts(obj.contexts, opts); this.users = config_types_1.newUsers(obj.users, opts); this.currentContext = obj['current-context']; } loadFromOptions(options) { this.clusters = options.clusters; this.contexts = options.contexts; this.users = options.users; this.currentContext = options.currentContext; } loadFromClusterAndUser(cluster, user) { this.clusters = [cluster]; this.users = [user]; this.currentContext = 'loaded-context'; this.contexts = [ { cluster: cluster.name, user: user.name, name: this.currentContext, }, ]; } loadFromCluster(pathPrefix = '') { const host = process.env.KUBERNETES_SERVICE_HOST; const port = process.env.KUBERNETES_SERVICE_PORT; const clusterName = 'inCluster'; const userName = 'inClusterUser'; const contextName = 'inClusterContext'; let scheme = 'https'; if (port === '80' || port === '8080' || port === '8001') { scheme = 'http'; } // Wrap raw IPv6 addresses in brackets. let serverHost = host; if (host && net.isIPv6(host)) { serverHost = `[${host}]`; } this.clusters = [ { name: clusterName, caFile: `${pathPrefix}${Config.SERVICEACCOUNT_CA_PATH}`, server: `${scheme}://${serverHost}:${port}`, skipTLSVerify: false, }, ]; this.users = [ { name: userName, authProvider: { name: 'tokenFile', config: { tokenFile: `${pathPrefix}${Config.SERVICEACCOUNT_TOKEN_PATH}`, }, }, }, ]; this.contexts = [ { cluster: clusterName, name: contextName, user: userName, }, ]; this.currentContext = contextName; } mergeConfig(config, preserveContext = false) { if (!preserveContext) { this.currentContext = config.currentContext; } config.clusters.forEach((cluster) => { this.addCluster(cluster); }); config.users.forEach((user) => { this.addUser(user); }); config.contexts.forEach((ctx) => { this.addContext(ctx); }); } addCluster(cluster) { if (!this.clusters) { this.clusters = []; } this.clusters.forEach((c, ix) => { if (c.name === cluster.name) { throw new Error(`Duplicate cluster: ${c.name}`); } }); this.clusters.push(cluster); } addUser(user) { if (!this.users) { this.users = []; } this.users.forEach((c, ix) => { if (c.name === user.name) { throw new Error(`Duplicate user: ${c.name}`); } }); this.users.push(user); } addContext(ctx) { if (!this.contexts) { this.contexts = []; } this.contexts.forEach((c, ix) => { if (c.name === ctx.name) { throw new Error(`Duplicate context: ${c.name}`); } }); this.contexts.push(ctx); } loadFromDefault(opts, contextFromStartingConfig = false) { if (process.env.KUBECONFIG && process.env.KUBECONFIG.length > 0) { const files = process.env.KUBECONFIG.split(path.delimiter).filter((filename) => filename); this.loadFromFile(files[0], opts); for (let i = 1; i < files.length; i++) { const kc = new KubeConfig(); kc.loadFromFile(files[i], opts); this.mergeConfig(kc, contextFromStartingConfig); } return; } const home = findHomeDir(); if (home) { const config = path.join(home, '.kube', 'config'); if (fileExists(config)) { this.loadFromFile(config, opts); return; } } if (process.platform === 'win32' && shelljs.which('wsl.exe')) { // TODO: Handle if someome set $KUBECONFIG in wsl here... try { const result = execa.sync('wsl.exe', ['cat', shelljs.homedir() + '/.kube/config']); if (result.code === 0) { this.loadFromString(result.std, opts); return; } } catch (err) { // Falling back to alternative auth } } if (fileExists(Config.SERVICEACCOUNT_TOKEN_PATH)) { this.loadFromCluster(); return; } this.loadFromClusterAndUser({ name: 'cluster', server: 'http://localhost:8080' }, { name: 'user' }); } makeApiClient(apiClientType) { const cluster = this.getCurrentCluster(); if (!cluster) { throw new Error('No active cluster!'); } const apiClient = new apiClientType(cluster.server); apiClient.setDefaultAuthentication(this); return apiClient; } makePathsAbsolute(rootDirectory) { this.clusters.forEach((cluster) => { if (cluster.caFile) { cluster.caFile = makeAbsolutePath(rootDirectory, cluster.caFile); } }); this.users.forEach((user) => { if (user.certFile) { user.certFile = makeAbsolutePath(rootDirectory, user.certFile); } if (user.keyFile) { user.keyFile = makeAbsolutePath(rootDirectory, user.keyFile); } }); } exportConfig() { const configObj = { apiVersion: 'v1', kind: 'Config', clusters: this.clusters.map(config_types_1.exportCluster), users: this.users.map(config_types_1.exportUser), contexts: this.contexts.map(config_types_1.exportContext), preferences: {}, 'current-context': this.getCurrentContext(), }; return JSON.stringify(configObj); } getCurrentContextObject() { return this.getContextObject(this.currentContext); } applyHTTPSOptions(opts) { const cluster = this.getCurrentCluster(); const user = this.getCurrentUser(); if (!user) { return; } if (cluster != null && cluster.skipTLSVerify) { opts.rejectUnauthorized = false; } const ca = cluster != null ? bufferFromFileOrString(cluster.caFile, cluster.caData) : null; if (ca) { opts.ca = ca; } const cert = bufferFromFileOrString(user.certFile, user.certData); if (cert) { opts.cert = cert; } const key = bufferFromFileOrString(user.keyFile, user.keyData); if (key) { opts.key = key; } } applyAuthorizationHeader(opts) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const user = this.getCurrentUser(); if (!user) { return; } const authenticator = KubeConfig.authenticators.find((elt) => { return elt.isAuthProvider(user); }); if (!opts.headers) { opts.headers = {}; } if (authenticator) { yield authenticator.applyAuthentication(user, opts); } if (user.token) { opts.headers.Authorization = `Bearer ${user.token}`; } }); } applyOptions(opts) { return tslib_1.__awaiter(this, void 0, void 0, function* () { this.applyHTTPSOptions(opts); yield this.applyAuthorizationHeader(opts); }); } } exports.KubeConfig = KubeConfig; KubeConfig.authenticators = [ new cloud_auth_1.CloudAuth(), new exec_auth_1.ExecAuth(), new file_auth_1.FileAuth(), new oidc_auth_1.OpenIDConnectAuth(), ]; // This class is deprecated and will eventually be removed. class Config { static fromFile(filename) { return Config.apiFromFile(filename, api.CoreV1Api); } static fromCluster() { return Config.apiFromCluster(api.CoreV1Api); } static defaultClient() { return Config.apiFromDefaultClient(api.CoreV1Api); } static apiFromFile(filename, apiClientType) { const kc = new KubeConfig(); kc.loadFromFile(filename); return kc.makeApiClient(apiClientType); } static apiFromCluster(apiClientType) { const kc = new KubeConfig(); kc.loadFromCluster(); const cluster = kc.getCurrentCluster(); if (!cluster) { throw new Error('No active cluster!'); } const k8sApi = new apiClientType(cluster.server); k8sApi.setDefaultAuthentication(kc); return k8sApi; } static apiFromDefaultClient(apiClientType) { const kc = new KubeConfig(); kc.loadFromDefault(); return kc.makeApiClient(apiClientType); } } exports.Config = Config; Config.SERVICEACCOUNT_ROOT = '/var/run/secrets/kubernetes.io/serviceaccount'; Config.SERVICEACCOUNT_CA_PATH = Config.SERVICEACCOUNT_ROOT + '/ca.crt'; Config.SERVICEACCOUNT_TOKEN_PATH = Config.SERVICEACCOUNT_ROOT + '/token'; function makeAbsolutePath(root, file) { if (!root || path.isAbsolute(file)) { return file; } return path.join(root, file); } exports.makeAbsolutePath = makeAbsolutePath; // This is public really only for testing. function bufferFromFileOrString(file, data) { if (file) { return fs.readFileSync(file); } if (data) { return Buffer.from(data, 'base64'); } return null; } exports.bufferFromFileOrString = bufferFromFileOrString; // Only public for testing. function findHomeDir() { if (process.env.HOME) { try { fs.accessSync(process.env.HOME); return process.env.HOME; // tslint:disable-next-line:no-empty } catch (ignore) { } } if (process.platform !== 'win32') { return null; } if (process.env.HOMEDRIVE && process.env.HOMEPATH) { const dir = path.join(process.env.HOMEDRIVE, process.env.HOMEPATH); try { fs.accessSync(dir); return dir; // tslint:disable-next-line:no-empty } catch (ignore) { } } if (process.env.USERPROFILE) { try { fs.accessSync(process.env.USERPROFILE); return process.env.USERPROFILE; // tslint:disable-next-line:no-empty } catch (ignore) { } } return null; } exports.findHomeDir = findHomeDir; // Only really public for testing... function findObject(list, name, key) { if (!list) { return null; } for (const obj of list) { if (obj.name === name) { if (obj[key]) { obj[key].name = name; return obj[key]; } return obj; } } return null; } exports.findObject = findObject; //# sourceMappingURL=config.js.map /***/ }), /***/ 86218: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.exportContext = exports.newContexts = exports.exportUser = exports.newUsers = exports.exportCluster = exports.newClusters = exports.ActionOnInvalid = void 0; const fs = __webpack_require__(35747); const _ = __webpack_require__(83571); var ActionOnInvalid; (function (ActionOnInvalid) { ActionOnInvalid["THROW"] = "throw"; ActionOnInvalid["FILTER"] = "filter"; })(ActionOnInvalid = exports.ActionOnInvalid || (exports.ActionOnInvalid = {})); function defaultNewConfigOptions() { return { onInvalidEntry: ActionOnInvalid.THROW, }; } function newClusters(a, opts) { const options = Object.assign(defaultNewConfigOptions(), opts || {}); return _.compact(_.map(a, clusterIterator(options.onInvalidEntry))); } exports.newClusters = newClusters; function exportCluster(cluster) { return { name: cluster.name, cluster: { server: cluster.server, 'certificate-authority-data': cluster.caData, 'certificate-authority': cluster.caFile, 'insecure-skip-tls-verify': cluster.skipTLSVerify, }, }; } exports.exportCluster = exportCluster; function clusterIterator(onInvalidEntry) { return (elt, i, list) => { try { if (!elt.name) { throw new Error(`clusters[${i}].name is missing`); } if (!elt.cluster) { throw new Error(`clusters[${i}].cluster is missing`); } if (!elt.cluster.server) { throw new Error(`clusters[${i}].cluster.server is missing`); } return { caData: elt.cluster['certificate-authority-data'], caFile: elt.cluster['certificate-authority'], name: elt.name, server: elt.cluster.server, skipTLSVerify: elt.cluster['insecure-skip-tls-verify'] === true, }; } catch (err) { switch (onInvalidEntry) { case ActionOnInvalid.FILTER: return null; default: case ActionOnInvalid.THROW: throw err; } } }; } function newUsers(a, opts) { const options = Object.assign(defaultNewConfigOptions(), opts || {}); return _.compact(_.map(a, userIterator(options.onInvalidEntry))); } exports.newUsers = newUsers; function exportUser(user) { return { name: user.name, user: { 'auth-provider': user.authProvider, 'client-certificate-data': user.certData, 'client-certificate': user.certFile, exec: user.exec, 'client-key-data': user.keyData, 'client-key': user.keyFile, token: user.token, password: user.password, username: user.username, }, }; } exports.exportUser = exportUser; function userIterator(onInvalidEntry) { return (elt, i, list) => { try { if (!elt.name) { throw new Error(`users[${i}].name is missing`); } return { authProvider: elt.user ? elt.user['auth-provider'] : null, certData: elt.user ? elt.user['client-certificate-data'] : null, certFile: elt.user ? elt.user['client-certificate'] : null, exec: elt.user ? elt.user.exec : null, keyData: elt.user ? elt.user['client-key-data'] : null, keyFile: elt.user ? elt.user['client-key'] : null, name: elt.name, token: findToken(elt.user), password: elt.user ? elt.user.password : null, username: elt.user ? elt.user.username : null, }; } catch (err) { switch (onInvalidEntry) { case ActionOnInvalid.FILTER: return null; default: case ActionOnInvalid.THROW: throw err; } } }; } function findToken(user) { if (user) { if (user.token) { return user.token; } if (user['token-file']) { return fs.readFileSync(user['token-file']).toString(); } } } function newContexts(a, opts) { const options = Object.assign(defaultNewConfigOptions(), opts || {}); return _.compact(_.map(a, contextIterator(options.onInvalidEntry))); } exports.newContexts = newContexts; function exportContext(ctx) { return { name: ctx.name, context: ctx, }; } exports.exportContext = exportContext; function contextIterator(onInvalidEntry) { return (elt, i, list) => { try { if (!elt.name) { throw new Error(`contexts[${i}].name is missing`); } if (!elt.context) { throw new Error(`contexts[${i}].context is missing`); } if (!elt.context.cluster) { throw new Error(`contexts[${i}].context.cluster is missing`); } return { cluster: elt.context.cluster, name: elt.name, user: elt.context.user || undefined, namespace: elt.context.namespace || undefined, }; } catch (err) { switch (onInvalidEntry) { case ActionOnInvalid.FILTER: return null; default: case ActionOnInvalid.THROW: throw err; } } }; } //# sourceMappingURL=config_types.js.map /***/ }), /***/ 54815: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Cp = void 0; const tslib_1 = __webpack_require__(75636); const fs = __webpack_require__(35747); const stream_buffers_1 = __webpack_require__(48168); const tar = __webpack_require__(74674); const tmp = __webpack_require__(68065); const exec_1 = __webpack_require__(62864); class Cp { constructor(config, execInstance) { this.execInstance = execInstance || new exec_1.Exec(config); } /** * @param {string} namespace - The namespace of the pod to exec the command inside. * @param {string} podName - The name of the pod to exec the command inside. * @param {string} containerName - The name of the container in the pod to exec the command inside. * @param {string} srcPath - The source path in the pod * @param {string} tgtPath - The target path in local */ cpFromPod(namespace, podName, containerName, srcPath, tgtPath) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const tmpFile = tmp.fileSync(); const tmpFileName = tmpFile.name; const command = ['tar', 'zcf', '-', srcPath]; const writerStream = fs.createWriteStream(tmpFileName); const errStream = new stream_buffers_1.WritableStreamBuffer(); this.execInstance.exec(namespace, podName, containerName, command, writerStream, errStream, null, false, () => tslib_1.__awaiter(this, void 0, void 0, function* () { if (errStream.size()) { throw new Error(`Error from cpFromPod - details: \n ${errStream.getContentsAsString()}`); } yield tar.x({ file: tmpFileName, cwd: tgtPath, }); })); }); } /** * @param {string} namespace - The namespace of the pod to exec the command inside. * @param {string} podName - The name of the pod to exec the command inside. * @param {string} containerName - The name of the container in the pod to exec the command inside. * @param {string} srcPath - The source path in local * @param {string} tgtPath - The target path in the pod */ cpToPod(namespace, podName, containerName, srcPath, tgtPath) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const tmpFile = tmp.fileSync(); const tmpFileName = tmpFile.name; const command = ['tar', 'xf', '-', '-C', tgtPath]; yield tar.c({ file: tmpFile.name, }, [srcPath]); const readStream = fs.createReadStream(tmpFileName); const errStream = new stream_buffers_1.WritableStreamBuffer(); this.execInstance.exec(namespace, podName, containerName, command, null, errStream, readStream, false, () => tslib_1.__awaiter(this, void 0, void 0, function* () { if (errStream.size()) { throw new Error(`Error from cpToPod - details: \n ${errStream.getContentsAsString()}`); } })); }); } } exports.Cp = Cp; //# sourceMappingURL=cp.js.map /***/ }), /***/ 62864: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Exec = void 0; const tslib_1 = __webpack_require__(75636); const querystring = __webpack_require__(71191); const terminal_size_queue_1 = __webpack_require__(76023); const web_socket_handler_1 = __webpack_require__(47581); class Exec { constructor(config, wsInterface) { this.handler = wsInterface || new web_socket_handler_1.WebSocketHandler(config); } /** * @param {string} namespace - The namespace of the pod to exec the command inside. * @param {string} podName - The name of the pod to exec the command inside. * @param {string} containerName - The name of the container in the pod to exec the command inside. * @param {(string|string[])} command - The command or command and arguments to execute. * @param {stream.Writable} stdout - The stream to write stdout data from the command. * @param {stream.Writable} stderr - The stream to write stderr data from the command. * @param {stream.Readable} stdin - The strream to write stdin data into the command. * @param {boolean} tty - Should the command execute in a TTY enabled session. * @param {(V1Status) => void} statusCallback - * A callback to received the status (e.g. exit code) from the command, optional. * @return {string} This is the result */ exec(namespace, podName, containerName, command, stdout, stderr, stdin, tty, statusCallback) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const query = { stdout: stdout != null, stderr: stderr != null, stdin: stdin != null, tty, command, container: containerName, }; const queryStr = querystring.stringify(query); const path = `/api/v1/namespaces/${namespace}/pods/${podName}/exec?${queryStr}`; const conn = yield this.handler.connect(path, null, (streamNum, buff) => { const status = web_socket_handler_1.WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr); if (status != null) { if (statusCallback) { statusCallback(status); } return false; } return true; }); if (stdin != null) { web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, stdin, web_socket_handler_1.WebSocketHandler.StdinStream); } if (terminal_size_queue_1.isResizable(stdout)) { this.terminalSizeQueue = new terminal_size_queue_1.TerminalSizeQueue(); web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, web_socket_handler_1.WebSocketHandler.ResizeStream); this.terminalSizeQueue.handleResizes(stdout); } return conn; }); } } exports.Exec = Exec; //# sourceMappingURL=exec.js.map /***/ }), /***/ 18325: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExecAuth = void 0; const tslib_1 = __webpack_require__(75636); const execa = __webpack_require__(55447); class ExecAuth { constructor() { this.tokenCache = {}; this.execFn = execa.sync; } isAuthProvider(user) { if (!user) { return false; } if (user.exec) { return true; } if (!user.authProvider) { return false; } return (user.authProvider.name === 'exec' || !!(user.authProvider.config && user.authProvider.config.exec)); } applyAuthentication(user, opts) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const credential = this.getCredential(user); if (!credential) { return; } if (credential.status.clientCertificateData) { opts.cert = credential.status.clientCertificateData; } if (credential.status.clientKeyData) { opts.key = credential.status.clientKeyData; } const token = this.getToken(credential); if (token) { if (!opts.headers) { opts.headers = []; } opts.headers.Authorization = `Bearer ${token}`; } }); } getToken(credential) { if (!credential) { return null; } if (credential.status.token) { return credential.status.token; } return null; } getCredential(user) { // TODO: Add a unit test for token caching. const cachedToken = this.tokenCache[user.name]; if (cachedToken) { const date = Date.parse(cachedToken.status.expirationTimestamp); if (date > Date.now()) { return cachedToken; } this.tokenCache[user.name] = null; } let exec = null; if (user.authProvider && user.authProvider.config) { exec = user.authProvider.config.exec; } if (user.exec) { exec = user.exec; } if (!exec) { return null; } if (!exec.command) { throw new Error('No command was specified for exec authProvider!'); } let opts = {}; if (exec.env) { const env = process.env; exec.env.forEach((elt) => (env[elt.name] = elt.value)); opts = Object.assign(Object.assign({}, opts), { env }); } const result = this.execFn(exec.command, exec.args, opts); if (result.code === 0) { const obj = JSON.parse(result.stdout); this.tokenCache[user.name] = obj; return obj; } throw new Error(result.stderr); } } exports.ExecAuth = ExecAuth; //# sourceMappingURL=exec_auth.js.map /***/ }), /***/ 38572: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FileAuth = void 0; const tslib_1 = __webpack_require__(75636); const fs = __webpack_require__(35747); class FileAuth { constructor() { this.token = null; this.lastRead = null; } isAuthProvider(user) { return user.authProvider && user.authProvider.config && user.authProvider.config.tokenFile; } applyAuthentication(user, opts) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (this.token == null) { this.refreshToken(user.authProvider.config.tokenFile); } if (this.isTokenExpired()) { this.refreshToken(user.authProvider.config.tokenFile); } if (this.token) { opts.headers.Authorization = `Bearer ${this.token}`; } }); } refreshToken(filePath) { // TODO make this async? this.token = fs.readFileSync(filePath).toString('UTF-8'); this.lastRead = new Date(); } isTokenExpired() { if (this.lastRead === null) { return true; } const now = new Date(); const delta = (now.getTime() - this.lastRead.getTime()) / 1000; // For now just refresh every 60 seconds. This is imperfect since the token // could be out of date for this time, but it is unlikely and it's also what // the client-go library does. // TODO: Use file notifications instead? return delta > 60; } } exports.FileAuth = FileAuth; //# sourceMappingURL=file_auth.js.map /***/ }), /***/ 37233: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); // This is the entrypoint for the package tslib_1.__exportStar(__webpack_require__(25997), exports); tslib_1.__exportStar(__webpack_require__(15158), exports); //# sourceMappingURL=api.js.map /***/ }), /***/ 79893: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AdmissionregistrationApi = exports.AdmissionregistrationApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AdmissionregistrationApiApiKeys; (function (AdmissionregistrationApiApiKeys) { AdmissionregistrationApiApiKeys[AdmissionregistrationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AdmissionregistrationApiApiKeys = exports.AdmissionregistrationApiApiKeys || (exports.AdmissionregistrationApiApiKeys = {})); class AdmissionregistrationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AdmissionregistrationApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AdmissionregistrationApi = AdmissionregistrationApi; //# sourceMappingURL=admissionregistrationApi.js.map /***/ }), /***/ 69218: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AdmissionregistrationV1Api = exports.AdmissionregistrationV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AdmissionregistrationV1ApiApiKeys; (function (AdmissionregistrationV1ApiApiKeys) { AdmissionregistrationV1ApiApiKeys[AdmissionregistrationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AdmissionregistrationV1ApiApiKeys = exports.AdmissionregistrationV1ApiApiKeys || (exports.AdmissionregistrationV1ApiApiKeys = {})); class AdmissionregistrationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AdmissionregistrationV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a MutatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createMutatingWebhookConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1MutatingWebhookConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ValidatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createValidatingWebhookConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ValidatingWebhookConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of MutatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionMutatingWebhookConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ValidatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionValidatingWebhookConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteMutatingWebhookConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteValidatingWebhookConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind MutatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listMutatingWebhookConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1MutatingWebhookConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ValidatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listValidatingWebhookConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ValidatingWebhookConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchMutatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchMutatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchValidatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchValidatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readMutatingWebhookConfiguration(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readValidatingWebhookConfiguration(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceMutatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceMutatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1MutatingWebhookConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceValidatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceValidatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ValidatingWebhookConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AdmissionregistrationV1Api = AdmissionregistrationV1Api; //# sourceMappingURL=admissionregistrationV1Api.js.map /***/ }), /***/ 62794: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AdmissionregistrationV1beta1Api = exports.AdmissionregistrationV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AdmissionregistrationV1beta1ApiApiKeys; (function (AdmissionregistrationV1beta1ApiApiKeys) { AdmissionregistrationV1beta1ApiApiKeys[AdmissionregistrationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AdmissionregistrationV1beta1ApiApiKeys = exports.AdmissionregistrationV1beta1ApiApiKeys || (exports.AdmissionregistrationV1beta1ApiApiKeys = {})); class AdmissionregistrationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AdmissionregistrationV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a MutatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createMutatingWebhookConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1MutatingWebhookConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ValidatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createValidatingWebhookConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1ValidatingWebhookConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of MutatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionMutatingWebhookConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ValidatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionValidatingWebhookConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteMutatingWebhookConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteValidatingWebhookConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind MutatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listMutatingWebhookConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ValidatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listValidatingWebhookConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchMutatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchMutatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchValidatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchValidatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readMutatingWebhookConfiguration(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readValidatingWebhookConfiguration(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified MutatingWebhookConfiguration * @param name name of the MutatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceMutatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceMutatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceMutatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1MutatingWebhookConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1MutatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ValidatingWebhookConfiguration * @param name name of the ValidatingWebhookConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceValidatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceValidatingWebhookConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceValidatingWebhookConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1ValidatingWebhookConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ValidatingWebhookConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AdmissionregistrationV1beta1Api = AdmissionregistrationV1beta1Api; //# sourceMappingURL=admissionregistrationV1beta1Api.js.map /***/ }), /***/ 67758: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiextensionsApi = exports.ApiextensionsApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ApiextensionsApiApiKeys; (function (ApiextensionsApiApiKeys) { ApiextensionsApiApiKeys[ApiextensionsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiextensionsApiApiKeys = exports.ApiextensionsApiApiKeys || (exports.ApiextensionsApiApiKeys = {})); class ApiextensionsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiextensionsApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ApiextensionsApi = ApiextensionsApi; //# sourceMappingURL=apiextensionsApi.js.map /***/ }), /***/ 91294: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiextensionsV1Api = exports.ApiextensionsV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ApiextensionsV1ApiApiKeys; (function (ApiextensionsV1ApiApiKeys) { ApiextensionsV1ApiApiKeys[ApiextensionsV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiextensionsV1ApiApiKeys = exports.ApiextensionsV1ApiApiKeys || (exports.ApiextensionsV1ApiApiKeys = {})); class ApiextensionsV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiextensionsV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createCustomResourceDefinition(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CustomResourceDefinition") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionCustomResourceDefinition(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteCustomResourceDefinition(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCustomResourceDefinition(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CustomResourceDefinitionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCustomResourceDefinition(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinition.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCustomResourceDefinitionStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinitionStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readCustomResourceDefinition(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. */ readCustomResourceDefinitionStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCustomResourceDefinition(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinition.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CustomResourceDefinition") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCustomResourceDefinitionStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinitionStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CustomResourceDefinition") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ApiextensionsV1Api = ApiextensionsV1Api; //# sourceMappingURL=apiextensionsV1Api.js.map /***/ }), /***/ 7074: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiextensionsV1beta1Api = exports.ApiextensionsV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ApiextensionsV1beta1ApiApiKeys; (function (ApiextensionsV1beta1ApiApiKeys) { ApiextensionsV1beta1ApiApiKeys[ApiextensionsV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiextensionsV1beta1ApiApiKeys = exports.ApiextensionsV1beta1ApiApiKeys || (exports.ApiextensionsV1beta1ApiApiKeys = {})); class ApiextensionsV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiextensionsV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createCustomResourceDefinition(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CustomResourceDefinition") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionCustomResourceDefinition(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteCustomResourceDefinition(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCustomResourceDefinition(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinitionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCustomResourceDefinition(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinition.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCustomResourceDefinitionStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinitionStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readCustomResourceDefinition(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param pretty If \'true\', then the output is pretty printed. */ readCustomResourceDefinitionStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCustomResourceDefinition(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinition.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinition.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CustomResourceDefinition") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified CustomResourceDefinition * @param name name of the CustomResourceDefinition * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCustomResourceDefinitionStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinitionStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinitionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CustomResourceDefinition") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CustomResourceDefinition"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ApiextensionsV1beta1Api = ApiextensionsV1beta1Api; //# sourceMappingURL=apiextensionsV1beta1Api.js.map /***/ }), /***/ 99722: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiregistrationApi = exports.ApiregistrationApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ApiregistrationApiApiKeys; (function (ApiregistrationApiApiKeys) { ApiregistrationApiApiKeys[ApiregistrationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiregistrationApiApiKeys = exports.ApiregistrationApiApiKeys || (exports.ApiregistrationApiApiKeys = {})); class ApiregistrationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiregistrationApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ApiregistrationApi = ApiregistrationApi; //# sourceMappingURL=apiregistrationApi.js.map /***/ }), /***/ 99365: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiregistrationV1Api = exports.ApiregistrationV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ApiregistrationV1ApiApiKeys; (function (ApiregistrationV1ApiApiKeys) { ApiregistrationV1ApiApiKeys[ApiregistrationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiregistrationV1ApiApiKeys = exports.ApiregistrationV1ApiApiKeys || (exports.ApiregistrationV1ApiApiKeys = {})); class ApiregistrationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiregistrationV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create an APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createAPIService(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1APIService") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an APIService * @param name name of the APIService * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteAPIService(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of APIService * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionAPIService(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind APIService * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listAPIService(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIServiceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified APIService * @param name name of the APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchAPIService(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAPIService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified APIService * @param name name of the APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchAPIServiceStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAPIServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified APIService * @param name name of the APIService * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readAPIService(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified APIService * @param name name of the APIService * @param pretty If \'true\', then the output is pretty printed. */ readAPIServiceStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified APIService * @param name name of the APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceAPIService(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAPIService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1APIService") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified APIService * @param name name of the APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceAPIServiceStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAPIServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1APIService") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ApiregistrationV1Api = ApiregistrationV1Api; //# sourceMappingURL=apiregistrationV1Api.js.map /***/ }), /***/ 48244: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiregistrationV1beta1Api = exports.ApiregistrationV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ApiregistrationV1beta1ApiApiKeys; (function (ApiregistrationV1beta1ApiApiKeys) { ApiregistrationV1beta1ApiApiKeys[ApiregistrationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApiregistrationV1beta1ApiApiKeys = exports.ApiregistrationV1beta1ApiApiKeys || (exports.ApiregistrationV1beta1ApiApiKeys = {})); class ApiregistrationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApiregistrationV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create an APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createAPIService(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1APIService") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an APIService * @param name name of the APIService * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteAPIService(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of APIService * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionAPIService(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind APIService * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listAPIService(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1APIServiceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified APIService * @param name name of the APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchAPIService(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAPIService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified APIService * @param name name of the APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchAPIServiceStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchAPIServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified APIService * @param name name of the APIService * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readAPIService(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified APIService * @param name name of the APIService * @param pretty If \'true\', then the output is pretty printed. */ readAPIServiceStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified APIService * @param name name of the APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceAPIService(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAPIService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAPIService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1APIService") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified APIService * @param name name of the APIService * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceAPIServiceStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceAPIServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceAPIServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1APIService") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1APIService"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ApiregistrationV1beta1Api = ApiregistrationV1beta1Api; //# sourceMappingURL=apiregistrationV1beta1Api.js.map /***/ }), /***/ 25997: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.APIS = exports.HttpError = void 0; const tslib_1 = __webpack_require__(75636); tslib_1.__exportStar(__webpack_require__(79893), exports); const admissionregistrationApi_1 = __webpack_require__(79893); tslib_1.__exportStar(__webpack_require__(69218), exports); const admissionregistrationV1Api_1 = __webpack_require__(69218); tslib_1.__exportStar(__webpack_require__(62794), exports); const admissionregistrationV1beta1Api_1 = __webpack_require__(62794); tslib_1.__exportStar(__webpack_require__(67758), exports); const apiextensionsApi_1 = __webpack_require__(67758); tslib_1.__exportStar(__webpack_require__(91294), exports); const apiextensionsV1Api_1 = __webpack_require__(91294); tslib_1.__exportStar(__webpack_require__(7074), exports); const apiextensionsV1beta1Api_1 = __webpack_require__(7074); tslib_1.__exportStar(__webpack_require__(99722), exports); const apiregistrationApi_1 = __webpack_require__(99722); tslib_1.__exportStar(__webpack_require__(99365), exports); const apiregistrationV1Api_1 = __webpack_require__(99365); tslib_1.__exportStar(__webpack_require__(48244), exports); const apiregistrationV1beta1Api_1 = __webpack_require__(48244); tslib_1.__exportStar(__webpack_require__(59536), exports); const apisApi_1 = __webpack_require__(59536); tslib_1.__exportStar(__webpack_require__(99869), exports); const appsApi_1 = __webpack_require__(99869); tslib_1.__exportStar(__webpack_require__(10588), exports); const appsV1Api_1 = __webpack_require__(10588); tslib_1.__exportStar(__webpack_require__(61226), exports); const authenticationApi_1 = __webpack_require__(61226); tslib_1.__exportStar(__webpack_require__(17421), exports); const authenticationV1Api_1 = __webpack_require__(17421); tslib_1.__exportStar(__webpack_require__(53150), exports); const authenticationV1beta1Api_1 = __webpack_require__(53150); tslib_1.__exportStar(__webpack_require__(75154), exports); const authorizationApi_1 = __webpack_require__(75154); tslib_1.__exportStar(__webpack_require__(97999), exports); const authorizationV1Api_1 = __webpack_require__(97999); tslib_1.__exportStar(__webpack_require__(87078), exports); const authorizationV1beta1Api_1 = __webpack_require__(87078); tslib_1.__exportStar(__webpack_require__(94692), exports); const autoscalingApi_1 = __webpack_require__(94692); tslib_1.__exportStar(__webpack_require__(47098), exports); const autoscalingV1Api_1 = __webpack_require__(47098); tslib_1.__exportStar(__webpack_require__(15872), exports); const autoscalingV2beta1Api_1 = __webpack_require__(15872); tslib_1.__exportStar(__webpack_require__(76982), exports); const autoscalingV2beta2Api_1 = __webpack_require__(76982); tslib_1.__exportStar(__webpack_require__(91445), exports); const batchApi_1 = __webpack_require__(91445); tslib_1.__exportStar(__webpack_require__(78246), exports); const batchV1Api_1 = __webpack_require__(78246); tslib_1.__exportStar(__webpack_require__(71101), exports); const batchV1beta1Api_1 = __webpack_require__(71101); tslib_1.__exportStar(__webpack_require__(23668), exports); const batchV2alpha1Api_1 = __webpack_require__(23668); tslib_1.__exportStar(__webpack_require__(92076), exports); const certificatesApi_1 = __webpack_require__(92076); tslib_1.__exportStar(__webpack_require__(32593), exports); const certificatesV1Api_1 = __webpack_require__(32593); tslib_1.__exportStar(__webpack_require__(23732), exports); const certificatesV1beta1Api_1 = __webpack_require__(23732); tslib_1.__exportStar(__webpack_require__(69209), exports); const coordinationApi_1 = __webpack_require__(69209); tslib_1.__exportStar(__webpack_require__(52653), exports); const coordinationV1Api_1 = __webpack_require__(52653); tslib_1.__exportStar(__webpack_require__(82017), exports); const coordinationV1beta1Api_1 = __webpack_require__(82017); tslib_1.__exportStar(__webpack_require__(51489), exports); const coreApi_1 = __webpack_require__(51489); tslib_1.__exportStar(__webpack_require__(4738), exports); const coreV1Api_1 = __webpack_require__(4738); tslib_1.__exportStar(__webpack_require__(36522), exports); const customObjectsApi_1 = __webpack_require__(36522); tslib_1.__exportStar(__webpack_require__(44310), exports); const discoveryApi_1 = __webpack_require__(44310); tslib_1.__exportStar(__webpack_require__(10420), exports); const discoveryV1beta1Api_1 = __webpack_require__(10420); tslib_1.__exportStar(__webpack_require__(89829), exports); const eventsApi_1 = __webpack_require__(89829); tslib_1.__exportStar(__webpack_require__(15621), exports); const eventsV1Api_1 = __webpack_require__(15621); tslib_1.__exportStar(__webpack_require__(5821), exports); const eventsV1beta1Api_1 = __webpack_require__(5821); tslib_1.__exportStar(__webpack_require__(71817), exports); const extensionsApi_1 = __webpack_require__(71817); tslib_1.__exportStar(__webpack_require__(63382), exports); const extensionsV1beta1Api_1 = __webpack_require__(63382); tslib_1.__exportStar(__webpack_require__(16001), exports); const flowcontrolApiserverApi_1 = __webpack_require__(16001); tslib_1.__exportStar(__webpack_require__(95091), exports); const flowcontrolApiserverV1alpha1Api_1 = __webpack_require__(95091); tslib_1.__exportStar(__webpack_require__(58365), exports); const flowcontrolApiserverV1beta1Api_1 = __webpack_require__(58365); tslib_1.__exportStar(__webpack_require__(31857), exports); const internalApiserverApi_1 = __webpack_require__(31857); tslib_1.__exportStar(__webpack_require__(76012), exports); const internalApiserverV1alpha1Api_1 = __webpack_require__(76012); tslib_1.__exportStar(__webpack_require__(88382), exports); const logsApi_1 = __webpack_require__(88382); tslib_1.__exportStar(__webpack_require__(48169), exports); const networkingApi_1 = __webpack_require__(48169); tslib_1.__exportStar(__webpack_require__(97534), exports); const networkingV1Api_1 = __webpack_require__(97534); tslib_1.__exportStar(__webpack_require__(71097), exports); const networkingV1beta1Api_1 = __webpack_require__(71097); tslib_1.__exportStar(__webpack_require__(31466), exports); const nodeApi_1 = __webpack_require__(31466); tslib_1.__exportStar(__webpack_require__(9090), exports); const nodeV1Api_1 = __webpack_require__(9090); tslib_1.__exportStar(__webpack_require__(17374), exports); const nodeV1alpha1Api_1 = __webpack_require__(17374); tslib_1.__exportStar(__webpack_require__(78504), exports); const nodeV1beta1Api_1 = __webpack_require__(78504); tslib_1.__exportStar(__webpack_require__(5381), exports); const openidApi_1 = __webpack_require__(5381); tslib_1.__exportStar(__webpack_require__(37284), exports); const policyApi_1 = __webpack_require__(37284); tslib_1.__exportStar(__webpack_require__(80228), exports); const policyV1beta1Api_1 = __webpack_require__(80228); tslib_1.__exportStar(__webpack_require__(73316), exports); const rbacAuthorizationApi_1 = __webpack_require__(73316); tslib_1.__exportStar(__webpack_require__(93149), exports); const rbacAuthorizationV1Api_1 = __webpack_require__(93149); tslib_1.__exportStar(__webpack_require__(44056), exports); const rbacAuthorizationV1alpha1Api_1 = __webpack_require__(44056); tslib_1.__exportStar(__webpack_require__(81543), exports); const rbacAuthorizationV1beta1Api_1 = __webpack_require__(81543); tslib_1.__exportStar(__webpack_require__(29389), exports); const schedulingApi_1 = __webpack_require__(29389); tslib_1.__exportStar(__webpack_require__(26757), exports); const schedulingV1Api_1 = __webpack_require__(26757); tslib_1.__exportStar(__webpack_require__(91655), exports); const schedulingV1alpha1Api_1 = __webpack_require__(91655); tslib_1.__exportStar(__webpack_require__(49324), exports); const schedulingV1beta1Api_1 = __webpack_require__(49324); tslib_1.__exportStar(__webpack_require__(91143), exports); const storageApi_1 = __webpack_require__(91143); tslib_1.__exportStar(__webpack_require__(922), exports); const storageV1Api_1 = __webpack_require__(922); tslib_1.__exportStar(__webpack_require__(30769), exports); const storageV1alpha1Api_1 = __webpack_require__(30769); tslib_1.__exportStar(__webpack_require__(15325), exports); const storageV1beta1Api_1 = __webpack_require__(15325); tslib_1.__exportStar(__webpack_require__(4441), exports); const versionApi_1 = __webpack_require__(4441); tslib_1.__exportStar(__webpack_require__(19868), exports); const wellKnownApi_1 = __webpack_require__(19868); class HttpError extends Error { constructor(response, body, statusCode) { super('HTTP request failed'); this.response = response; this.body = body; this.statusCode = statusCode; this.name = 'HttpError'; } } exports.HttpError = HttpError; exports.APIS = [admissionregistrationApi_1.AdmissionregistrationApi, admissionregistrationV1Api_1.AdmissionregistrationV1Api, admissionregistrationV1beta1Api_1.AdmissionregistrationV1beta1Api, apiextensionsApi_1.ApiextensionsApi, apiextensionsV1Api_1.ApiextensionsV1Api, apiextensionsV1beta1Api_1.ApiextensionsV1beta1Api, apiregistrationApi_1.ApiregistrationApi, apiregistrationV1Api_1.ApiregistrationV1Api, apiregistrationV1beta1Api_1.ApiregistrationV1beta1Api, apisApi_1.ApisApi, appsApi_1.AppsApi, appsV1Api_1.AppsV1Api, authenticationApi_1.AuthenticationApi, authenticationV1Api_1.AuthenticationV1Api, authenticationV1beta1Api_1.AuthenticationV1beta1Api, authorizationApi_1.AuthorizationApi, authorizationV1Api_1.AuthorizationV1Api, authorizationV1beta1Api_1.AuthorizationV1beta1Api, autoscalingApi_1.AutoscalingApi, autoscalingV1Api_1.AutoscalingV1Api, autoscalingV2beta1Api_1.AutoscalingV2beta1Api, autoscalingV2beta2Api_1.AutoscalingV2beta2Api, batchApi_1.BatchApi, batchV1Api_1.BatchV1Api, batchV1beta1Api_1.BatchV1beta1Api, batchV2alpha1Api_1.BatchV2alpha1Api, certificatesApi_1.CertificatesApi, certificatesV1Api_1.CertificatesV1Api, certificatesV1beta1Api_1.CertificatesV1beta1Api, coordinationApi_1.CoordinationApi, coordinationV1Api_1.CoordinationV1Api, coordinationV1beta1Api_1.CoordinationV1beta1Api, coreApi_1.CoreApi, coreV1Api_1.CoreV1Api, customObjectsApi_1.CustomObjectsApi, discoveryApi_1.DiscoveryApi, discoveryV1beta1Api_1.DiscoveryV1beta1Api, eventsApi_1.EventsApi, eventsV1Api_1.EventsV1Api, eventsV1beta1Api_1.EventsV1beta1Api, extensionsApi_1.ExtensionsApi, extensionsV1beta1Api_1.ExtensionsV1beta1Api, flowcontrolApiserverApi_1.FlowcontrolApiserverApi, flowcontrolApiserverV1alpha1Api_1.FlowcontrolApiserverV1alpha1Api, flowcontrolApiserverV1beta1Api_1.FlowcontrolApiserverV1beta1Api, internalApiserverApi_1.InternalApiserverApi, internalApiserverV1alpha1Api_1.InternalApiserverV1alpha1Api, logsApi_1.LogsApi, networkingApi_1.NetworkingApi, networkingV1Api_1.NetworkingV1Api, networkingV1beta1Api_1.NetworkingV1beta1Api, nodeApi_1.NodeApi, nodeV1Api_1.NodeV1Api, nodeV1alpha1Api_1.NodeV1alpha1Api, nodeV1beta1Api_1.NodeV1beta1Api, openidApi_1.OpenidApi, policyApi_1.PolicyApi, policyV1beta1Api_1.PolicyV1beta1Api, rbacAuthorizationApi_1.RbacAuthorizationApi, rbacAuthorizationV1Api_1.RbacAuthorizationV1Api, rbacAuthorizationV1alpha1Api_1.RbacAuthorizationV1alpha1Api, rbacAuthorizationV1beta1Api_1.RbacAuthorizationV1beta1Api, schedulingApi_1.SchedulingApi, schedulingV1Api_1.SchedulingV1Api, schedulingV1alpha1Api_1.SchedulingV1alpha1Api, schedulingV1beta1Api_1.SchedulingV1beta1Api, storageApi_1.StorageApi, storageV1Api_1.StorageV1Api, storageV1alpha1Api_1.StorageV1alpha1Api, storageV1beta1Api_1.StorageV1beta1Api, versionApi_1.VersionApi, wellKnownApi_1.WellKnownApi]; //# sourceMappingURL=apis.js.map /***/ }), /***/ 59536: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApisApi = exports.ApisApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ApisApiApiKeys; (function (ApisApiApiKeys) { ApisApiApiKeys[ApisApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ApisApiApiKeys = exports.ApisApiApiKeys || (exports.ApisApiApiKeys = {})); class ApisApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ApisApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get available API versions */ getAPIVersions(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroupList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ApisApi = ApisApi; //# sourceMappingURL=apisApi.js.map /***/ }), /***/ 99869: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AppsApi = exports.AppsApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AppsApiApiKeys; (function (AppsApiApiKeys) { AppsApiApiKeys[AppsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AppsApiApiKeys = exports.AppsApiApiKeys || (exports.AppsApiApiKeys = {})); class AppsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AppsApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AppsApi = AppsApi; //# sourceMappingURL=appsApi.js.map /***/ }), /***/ 10588: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AppsV1Api = exports.AppsV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AppsV1ApiApiKeys; (function (AppsV1ApiApiKeys) { AppsV1ApiApiKeys[AppsV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AppsV1ApiApiKeys = exports.AppsV1ApiApiKeys || (exports.AppsV1ApiApiKeys = {})); class AppsV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AppsV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedControllerRevision(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ControllerRevision") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedDaemonSet(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DaemonSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedDeployment(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Deployment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedReplicaSet(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ReplicaSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedStatefulSet(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1StatefulSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedControllerRevision(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedDaemonSet(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedDeployment(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedReplicaSet(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedStatefulSet(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedControllerRevision(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedDaemonSet(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedDeployment(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedReplicaSet(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedStatefulSet(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ControllerRevision * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listControllerRevisionForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/controllerrevisions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ControllerRevisionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind DaemonSet * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listDaemonSetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/daemonsets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Deployment * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listDeploymentForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/deployments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedControllerRevision(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ControllerRevisionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedDaemonSet(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedDeployment(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DeploymentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedReplicaSet(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedStatefulSet(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ReplicaSet * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listReplicaSetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/replicasets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind StatefulSet * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listStatefulSetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/statefulsets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedControllerRevision(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedDaemonSet(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedDeployment(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedReplicaSet(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedStatefulSet(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedControllerRevision(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedDaemonSet(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedDaemonSetStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedDeployment(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedDeploymentScale(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedDeploymentStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedReplicaSet(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedReplicaSetScale(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedReplicaSetStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedStatefulSet(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedStatefulSetScale(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedStatefulSetStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ControllerRevision * @param name name of the ControllerRevision * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedControllerRevision(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedControllerRevision.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedControllerRevision.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedControllerRevision.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ControllerRevision") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ControllerRevision"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedDaemonSet(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DaemonSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified DaemonSet * @param name name of the DaemonSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DaemonSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1DaemonSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Deployment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace scale of the specified Deployment * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Scale") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Deployment * @param name name of the Deployment * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Deployment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Deployment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedReplicaSet(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ReplicaSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace scale of the specified ReplicaSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Scale") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified ReplicaSet * @param name name of the ReplicaSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ReplicaSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicaSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedStatefulSet(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSet.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSet.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSet.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1StatefulSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace scale of the specified StatefulSet * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Scale") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified StatefulSet * @param name name of the StatefulSet * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1StatefulSet") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StatefulSet"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AppsV1Api = AppsV1Api; //# sourceMappingURL=appsV1Api.js.map /***/ }), /***/ 61226: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AuthenticationApi = exports.AuthenticationApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AuthenticationApiApiKeys; (function (AuthenticationApiApiKeys) { AuthenticationApiApiKeys[AuthenticationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthenticationApiApiKeys = exports.AuthenticationApiApiKeys || (exports.AuthenticationApiApiKeys = {})); class AuthenticationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthenticationApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authentication.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AuthenticationApi = AuthenticationApi; //# sourceMappingURL=authenticationApi.js.map /***/ }), /***/ 17421: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AuthenticationV1Api = exports.AuthenticationV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AuthenticationV1ApiApiKeys; (function (AuthenticationV1ApiApiKeys) { AuthenticationV1ApiApiKeys[AuthenticationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthenticationV1ApiApiKeys = exports.AuthenticationV1ApiApiKeys || (exports.AuthenticationV1ApiApiKeys = {})); class AuthenticationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthenticationV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a TokenReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createTokenReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1/tokenreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createTokenReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1TokenReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1TokenReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AuthenticationV1Api = AuthenticationV1Api; //# sourceMappingURL=authenticationV1Api.js.map /***/ }), /***/ 53150: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AuthenticationV1beta1Api = exports.AuthenticationV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AuthenticationV1beta1ApiApiKeys; (function (AuthenticationV1beta1ApiApiKeys) { AuthenticationV1beta1ApiApiKeys[AuthenticationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthenticationV1beta1ApiApiKeys = exports.AuthenticationV1beta1ApiApiKeys || (exports.AuthenticationV1beta1ApiApiKeys = {})); class AuthenticationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthenticationV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a TokenReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createTokenReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1beta1/tokenreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createTokenReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1TokenReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1TokenReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AuthenticationV1beta1Api = AuthenticationV1beta1Api; //# sourceMappingURL=authenticationV1beta1Api.js.map /***/ }), /***/ 75154: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AuthorizationApi = exports.AuthorizationApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AuthorizationApiApiKeys; (function (AuthorizationApiApiKeys) { AuthorizationApiApiKeys[AuthorizationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthorizationApiApiKeys = exports.AuthorizationApiApiKeys || (exports.AuthorizationApiApiKeys = {})); class AuthorizationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthorizationApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AuthorizationApi = AuthorizationApi; //# sourceMappingURL=authorizationApi.js.map /***/ }), /***/ 97999: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AuthorizationV1Api = exports.AuthorizationV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AuthorizationV1ApiApiKeys; (function (AuthorizationV1ApiApiKeys) { AuthorizationV1ApiApiKeys[AuthorizationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthorizationV1ApiApiKeys = exports.AuthorizationV1ApiApiKeys || (exports.AuthorizationV1ApiApiKeys = {})); class AuthorizationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthorizationV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a LocalSubjectAccessReview * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createNamespacedLocalSubjectAccessReview(namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLocalSubjectAccessReview.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLocalSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1LocalSubjectAccessReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LocalSubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a SelfSubjectAccessReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createSelfSubjectAccessReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/selfsubjectaccessreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSelfSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1SelfSubjectAccessReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1SelfSubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a SelfSubjectRulesReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createSelfSubjectRulesReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/selfsubjectrulesreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSelfSubjectRulesReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1SelfSubjectRulesReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1SelfSubjectRulesReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a SubjectAccessReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createSubjectAccessReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/subjectaccessreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1SubjectAccessReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1SubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AuthorizationV1Api = AuthorizationV1Api; //# sourceMappingURL=authorizationV1Api.js.map /***/ }), /***/ 87078: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AuthorizationV1beta1Api = exports.AuthorizationV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AuthorizationV1beta1ApiApiKeys; (function (AuthorizationV1beta1ApiApiKeys) { AuthorizationV1beta1ApiApiKeys[AuthorizationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AuthorizationV1beta1ApiApiKeys = exports.AuthorizationV1beta1ApiApiKeys || (exports.AuthorizationV1beta1ApiApiKeys = {})); class AuthorizationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AuthorizationV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a LocalSubjectAccessReview * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createNamespacedLocalSubjectAccessReview(namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLocalSubjectAccessReview.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLocalSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1LocalSubjectAccessReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1LocalSubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a SelfSubjectAccessReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createSelfSubjectAccessReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSelfSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1SelfSubjectAccessReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1SelfSubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a SelfSubjectRulesReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createSelfSubjectRulesReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSelfSubjectRulesReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1SelfSubjectRulesReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1SelfSubjectRulesReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a SubjectAccessReview * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createSubjectAccessReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/subjectaccessreviews'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createSubjectAccessReview.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1SubjectAccessReview") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1SubjectAccessReview"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AuthorizationV1beta1Api = AuthorizationV1beta1Api; //# sourceMappingURL=authorizationV1beta1Api.js.map /***/ }), /***/ 94692: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AutoscalingApi = exports.AutoscalingApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AutoscalingApiApiKeys; (function (AutoscalingApiApiKeys) { AutoscalingApiApiKeys[AutoscalingApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AutoscalingApiApiKeys = exports.AutoscalingApiApiKeys || (exports.AutoscalingApiApiKeys = {})); class AutoscalingApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AutoscalingApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AutoscalingApi = AutoscalingApi; //# sourceMappingURL=autoscalingApi.js.map /***/ }), /***/ 47098: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AutoscalingV1Api = exports.AutoscalingV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AutoscalingV1ApiApiKeys; (function (AutoscalingV1ApiApiKeys) { AutoscalingV1ApiApiKeys[AutoscalingV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AutoscalingV1ApiApiKeys = exports.AutoscalingV1ApiApiKeys || (exports.AutoscalingV1ApiApiKeys = {})); class AutoscalingV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AutoscalingV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedHorizontalPodAutoscaler(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listHorizontalPodAutoscalerForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/horizontalpodautoscalers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedHorizontalPodAutoscaler(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AutoscalingV1Api = AutoscalingV1Api; //# sourceMappingURL=autoscalingV1Api.js.map /***/ }), /***/ 15872: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AutoscalingV2beta1Api = exports.AutoscalingV2beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AutoscalingV2beta1ApiApiKeys; (function (AutoscalingV2beta1ApiApiKeys) { AutoscalingV2beta1ApiApiKeys[AutoscalingV2beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AutoscalingV2beta1ApiApiKeys = exports.AutoscalingV2beta1ApiApiKeys || (exports.AutoscalingV2beta1ApiApiKeys = {})); class AutoscalingV2beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AutoscalingV2beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedHorizontalPodAutoscaler(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2beta1HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listHorizontalPodAutoscalerForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/horizontalpodautoscalers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedHorizontalPodAutoscaler(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2beta1HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2beta1HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta1HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AutoscalingV2beta1Api = AutoscalingV2beta1Api; //# sourceMappingURL=autoscalingV2beta1Api.js.map /***/ }), /***/ 76982: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AutoscalingV2beta2Api = exports.AutoscalingV2beta2ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var AutoscalingV2beta2ApiApiKeys; (function (AutoscalingV2beta2ApiApiKeys) { AutoscalingV2beta2ApiApiKeys[AutoscalingV2beta2ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(AutoscalingV2beta2ApiApiKeys = exports.AutoscalingV2beta2ApiApiKeys || (exports.AutoscalingV2beta2ApiApiKeys = {})); class AutoscalingV2beta2Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[AutoscalingV2beta2ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedHorizontalPodAutoscaler(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2beta2HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listHorizontalPodAutoscalerForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/horizontalpodautoscalers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedHorizontalPodAutoscaler(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscalerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2beta2HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified HorizontalPodAutoscaler * @param name name of the HorizontalPodAutoscaler * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2beta2HorizontalPodAutoscaler") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2beta2HorizontalPodAutoscaler"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.AutoscalingV2beta2Api = AutoscalingV2beta2Api; //# sourceMappingURL=autoscalingV2beta2Api.js.map /***/ }), /***/ 91445: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BatchApi = exports.BatchApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var BatchApiApiKeys; (function (BatchApiApiKeys) { BatchApiApiKeys[BatchApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(BatchApiApiKeys = exports.BatchApiApiKeys || (exports.BatchApiApiKeys = {})); class BatchApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[BatchApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.BatchApi = BatchApi; //# sourceMappingURL=batchApi.js.map /***/ }), /***/ 78246: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BatchV1Api = exports.BatchV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var BatchV1ApiApiKeys; (function (BatchV1ApiApiKeys) { BatchV1ApiApiKeys[BatchV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(BatchV1ApiApiKeys = exports.BatchV1ApiApiKeys || (exports.BatchV1ApiApiKeys = {})); class BatchV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[BatchV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedJob(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Job") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedJob(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedJob(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Job * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listJobForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/jobs'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1JobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedJob(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1JobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedJob(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedJobStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedJob(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedJobStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedJob(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Job") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Job * @param name name of the Job * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedJobStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Job") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Job"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.BatchV1Api = BatchV1Api; //# sourceMappingURL=batchV1Api.js.map /***/ }), /***/ 71101: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BatchV1beta1Api = exports.BatchV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var BatchV1beta1ApiApiKeys; (function (BatchV1beta1ApiApiKeys) { BatchV1beta1ApiApiKeys[BatchV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(BatchV1beta1ApiApiKeys = exports.BatchV1beta1ApiApiKeys || (exports.BatchV1beta1ApiApiKeys = {})); class BatchV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[BatchV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedCronJob(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CronJob") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedCronJob(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedCronJob(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CronJob * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCronJobForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/cronjobs'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedCronJob(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedCronJob(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedCronJobStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CronJob") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CronJob") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.BatchV1beta1Api = BatchV1beta1Api; //# sourceMappingURL=batchV1beta1Api.js.map /***/ }), /***/ 23668: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BatchV2alpha1Api = exports.BatchV2alpha1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var BatchV2alpha1ApiApiKeys; (function (BatchV2alpha1ApiApiKeys) { BatchV2alpha1ApiApiKeys[BatchV2alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(BatchV2alpha1ApiApiKeys = exports.BatchV2alpha1ApiApiKeys || (exports.BatchV2alpha1ApiApiKeys = {})); class BatchV2alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[BatchV2alpha1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedCronJob(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2alpha1CronJob") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedCronJob(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedCronJob(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CronJob * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCronJobForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/cronjobs'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedCronJob(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJobList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedCronJob(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedCronJobStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJob.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJob.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJob.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2alpha1CronJob") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified CronJob * @param name name of the CronJob * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJobStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJobStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJobStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V2alpha1CronJob") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V2alpha1CronJob"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.BatchV2alpha1Api = BatchV2alpha1Api; //# sourceMappingURL=batchV2alpha1Api.js.map /***/ }), /***/ 92076: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CertificatesApi = exports.CertificatesApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CertificatesApiApiKeys; (function (CertificatesApiApiKeys) { CertificatesApiApiKeys[CertificatesApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CertificatesApiApiKeys = exports.CertificatesApiApiKeys || (exports.CertificatesApiApiKeys = {})); class CertificatesApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CertificatesApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CertificatesApi = CertificatesApi; //# sourceMappingURL=certificatesApi.js.map /***/ }), /***/ 32593: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CertificatesV1Api = exports.CertificatesV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CertificatesV1ApiApiKeys; (function (CertificatesV1ApiApiKeys) { CertificatesV1ApiApiKeys[CertificatesV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CertificatesV1ApiApiKeys = exports.CertificatesV1ApiApiKeys || (exports.CertificatesV1ApiApiKeys = {})); class CertificatesV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CertificatesV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createCertificateSigningRequest(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CertificateSigningRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteCertificateSigningRequest(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionCertificateSigningRequest(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCertificateSigningRequest(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequestList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCertificateSigningRequest(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequest.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update approval of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCertificateSigningRequestApproval(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequestApproval.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequestApproval.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCertificateSigningRequestStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequestStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readCertificateSigningRequest(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read approval of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. */ readCertificateSigningRequestApproval(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequestApproval.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. */ readCertificateSigningRequestStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCertificateSigningRequest(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequest.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CertificateSigningRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace approval of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCertificateSigningRequestApproval(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestApproval.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestApproval.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CertificateSigningRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCertificateSigningRequestStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CertificateSigningRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CertificatesV1Api = CertificatesV1Api; //# sourceMappingURL=certificatesV1Api.js.map /***/ }), /***/ 23732: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CertificatesV1beta1Api = exports.CertificatesV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CertificatesV1beta1ApiApiKeys; (function (CertificatesV1beta1ApiApiKeys) { CertificatesV1beta1ApiApiKeys[CertificatesV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CertificatesV1beta1ApiApiKeys = exports.CertificatesV1beta1ApiApiKeys || (exports.CertificatesV1beta1ApiApiKeys = {})); class CertificatesV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CertificatesV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createCertificateSigningRequest(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CertificateSigningRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteCertificateSigningRequest(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionCertificateSigningRequest(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCertificateSigningRequest(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequestList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCertificateSigningRequest(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequest.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update approval of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCertificateSigningRequestApproval(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequestApproval.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequestApproval.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCertificateSigningRequestStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequestStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readCertificateSigningRequest(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read approval of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. */ readCertificateSigningRequestApproval(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequestApproval.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param pretty If \'true\', then the output is pretty printed. */ readCertificateSigningRequestStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCertificateSigningRequest(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequest.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequest.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CertificateSigningRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace approval of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCertificateSigningRequestApproval(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestApproval.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestApproval.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CertificateSigningRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified CertificateSigningRequest * @param name name of the CertificateSigningRequest * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCertificateSigningRequestStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CertificateSigningRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CertificateSigningRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CertificatesV1beta1Api = CertificatesV1beta1Api; //# sourceMappingURL=certificatesV1beta1Api.js.map /***/ }), /***/ 69209: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CoordinationApi = exports.CoordinationApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CoordinationApiApiKeys; (function (CoordinationApiApiKeys) { CoordinationApiApiKeys[CoordinationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoordinationApiApiKeys = exports.CoordinationApiApiKeys || (exports.CoordinationApiApiKeys = {})); class CoordinationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoordinationApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CoordinationApi = CoordinationApi; //# sourceMappingURL=coordinationApi.js.map /***/ }), /***/ 52653: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CoordinationV1Api = exports.CoordinationV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CoordinationV1ApiApiKeys; (function (CoordinationV1ApiApiKeys) { CoordinationV1ApiApiKeys[CoordinationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoordinationV1ApiApiKeys = exports.CoordinationV1ApiApiKeys || (exports.CoordinationV1ApiApiKeys = {})); class CoordinationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoordinationV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedLease(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Lease") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedLease(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedLease(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Lease * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listLeaseForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/leases'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LeaseList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedLease(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LeaseList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedLease(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedLease(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedLease(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Lease") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CoordinationV1Api = CoordinationV1Api; //# sourceMappingURL=coordinationV1Api.js.map /***/ }), /***/ 82017: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CoordinationV1beta1Api = exports.CoordinationV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CoordinationV1beta1ApiApiKeys; (function (CoordinationV1beta1ApiApiKeys) { CoordinationV1beta1ApiApiKeys[CoordinationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoordinationV1beta1ApiApiKeys = exports.CoordinationV1beta1ApiApiKeys || (exports.CoordinationV1beta1ApiApiKeys = {})); class CoordinationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoordinationV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedLease(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1Lease") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedLease(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedLease(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Lease * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listLeaseForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/leases'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1LeaseList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedLease(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1LeaseList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedLease(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedLease(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Lease * @param name name of the Lease * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedLease(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLease.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLease.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLease.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1Lease") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Lease"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CoordinationV1beta1Api = CoordinationV1beta1Api; //# sourceMappingURL=coordinationV1beta1Api.js.map /***/ }), /***/ 51489: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CoreApi = exports.CoreApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CoreApiApiKeys; (function (CoreApiApiKeys) { CoreApiApiKeys[CoreApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoreApiApiKeys = exports.CoreApiApiKeys || (exports.CoreApiApiKeys = {})); class CoreApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoreApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get available API versions */ getAPIVersions(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIVersions"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CoreApi = CoreApi; //# sourceMappingURL=coreApi.js.map /***/ }), /***/ 4738: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CoreV1Api = exports.CoreV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CoreV1ApiApiKeys; (function (CoreV1ApiApiKeys) { CoreV1ApiApiKeys[CoreV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CoreV1ApiApiKeys = exports.CoreV1ApiApiKeys || (exports.CoreV1ApiApiKeys = {})); class CoreV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CoreV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * connect DELETE requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. */ connectDeleteNamespacedPodProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect DELETE requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. */ connectDeleteNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect DELETE requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectDeleteNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect DELETE requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectDeleteNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect DELETE requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. */ connectDeleteNodeProxy(name, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect DELETE requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. */ connectDeleteNodeProxyWithPath(name, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectDeleteNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectDeleteNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to attach of Pod * @param name name of the PodAttachOptions * @param namespace object name and auth scope, such as for teams and projects * @param container The container in which to execute the command. Defaults to only container if there is only one container in the pod. * @param stderr Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. * @param stdin Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. * @param stdout Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. * @param tty TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. */ connectGetNamespacedPodAttach(name, namespace, container, stderr, stdin, stdout, tty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/attach' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodAttach.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodAttach.'); } if (container !== undefined) { localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, "string"); } if (stderr !== undefined) { localVarQueryParameters['stderr'] = models_1.ObjectSerializer.serialize(stderr, "boolean"); } if (stdin !== undefined) { localVarQueryParameters['stdin'] = models_1.ObjectSerializer.serialize(stdin, "boolean"); } if (stdout !== undefined) { localVarQueryParameters['stdout'] = models_1.ObjectSerializer.serialize(stdout, "boolean"); } if (tty !== undefined) { localVarQueryParameters['tty'] = models_1.ObjectSerializer.serialize(tty, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to exec of Pod * @param name name of the PodExecOptions * @param namespace object name and auth scope, such as for teams and projects * @param command Command is the remote command to execute. argv array. Not executed within a shell. * @param container Container in which to execute the command. Defaults to only container if there is only one container in the pod. * @param stderr Redirect the standard error stream of the pod for this call. Defaults to true. * @param stdin Redirect the standard input stream of the pod for this call. Defaults to false. * @param stdout Redirect the standard output stream of the pod for this call. Defaults to true. * @param tty TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. */ connectGetNamespacedPodExec(name, namespace, command, container, stderr, stdin, stdout, tty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/exec' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodExec.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodExec.'); } if (command !== undefined) { localVarQueryParameters['command'] = models_1.ObjectSerializer.serialize(command, "string"); } if (container !== undefined) { localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, "string"); } if (stderr !== undefined) { localVarQueryParameters['stderr'] = models_1.ObjectSerializer.serialize(stderr, "boolean"); } if (stdin !== undefined) { localVarQueryParameters['stdin'] = models_1.ObjectSerializer.serialize(stdin, "boolean"); } if (stdout !== undefined) { localVarQueryParameters['stdout'] = models_1.ObjectSerializer.serialize(stdout, "boolean"); } if (tty !== undefined) { localVarQueryParameters['tty'] = models_1.ObjectSerializer.serialize(tty, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to portforward of Pod * @param name name of the PodPortForwardOptions * @param namespace object name and auth scope, such as for teams and projects * @param ports List of ports to forward Required when using WebSockets */ connectGetNamespacedPodPortforward(name, namespace, ports, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/portforward' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodPortforward.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodPortforward.'); } if (ports !== undefined) { localVarQueryParameters['ports'] = models_1.ObjectSerializer.serialize(ports, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. */ connectGetNamespacedPodProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. */ connectGetNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectGetNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectGetNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectGetNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectGetNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. */ connectGetNodeProxy(name, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect GET requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. */ connectGetNodeProxyWithPath(name, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectGetNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectGetNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect HEAD requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. */ connectHeadNamespacedPodProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect HEAD requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. */ connectHeadNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectHeadNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect HEAD requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectHeadNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect HEAD requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectHeadNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect HEAD requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. */ connectHeadNodeProxy(name, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect HEAD requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. */ connectHeadNodeProxyWithPath(name, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectHeadNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectHeadNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'HEAD', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect OPTIONS requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. */ connectOptionsNamespacedPodProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect OPTIONS requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. */ connectOptionsNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect OPTIONS requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectOptionsNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect OPTIONS requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectOptionsNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect OPTIONS requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. */ connectOptionsNodeProxy(name, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect OPTIONS requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. */ connectOptionsNodeProxyWithPath(name, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectOptionsNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectOptionsNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'OPTIONS', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PATCH requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. */ connectPatchNamespacedPodProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PATCH requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. */ connectPatchNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPatchNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PATCH requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectPatchNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PATCH requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectPatchNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PATCH requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. */ connectPatchNodeProxy(name, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PATCH requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. */ connectPatchNodeProxyWithPath(name, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPatchNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPatchNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to attach of Pod * @param name name of the PodAttachOptions * @param namespace object name and auth scope, such as for teams and projects * @param container The container in which to execute the command. Defaults to only container if there is only one container in the pod. * @param stderr Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. * @param stdin Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. * @param stdout Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. * @param tty TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. */ connectPostNamespacedPodAttach(name, namespace, container, stderr, stdin, stdout, tty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/attach' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodAttach.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodAttach.'); } if (container !== undefined) { localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, "string"); } if (stderr !== undefined) { localVarQueryParameters['stderr'] = models_1.ObjectSerializer.serialize(stderr, "boolean"); } if (stdin !== undefined) { localVarQueryParameters['stdin'] = models_1.ObjectSerializer.serialize(stdin, "boolean"); } if (stdout !== undefined) { localVarQueryParameters['stdout'] = models_1.ObjectSerializer.serialize(stdout, "boolean"); } if (tty !== undefined) { localVarQueryParameters['tty'] = models_1.ObjectSerializer.serialize(tty, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to exec of Pod * @param name name of the PodExecOptions * @param namespace object name and auth scope, such as for teams and projects * @param command Command is the remote command to execute. argv array. Not executed within a shell. * @param container Container in which to execute the command. Defaults to only container if there is only one container in the pod. * @param stderr Redirect the standard error stream of the pod for this call. Defaults to true. * @param stdin Redirect the standard input stream of the pod for this call. Defaults to false. * @param stdout Redirect the standard output stream of the pod for this call. Defaults to true. * @param tty TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. */ connectPostNamespacedPodExec(name, namespace, command, container, stderr, stdin, stdout, tty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/exec' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodExec.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodExec.'); } if (command !== undefined) { localVarQueryParameters['command'] = models_1.ObjectSerializer.serialize(command, "string"); } if (container !== undefined) { localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, "string"); } if (stderr !== undefined) { localVarQueryParameters['stderr'] = models_1.ObjectSerializer.serialize(stderr, "boolean"); } if (stdin !== undefined) { localVarQueryParameters['stdin'] = models_1.ObjectSerializer.serialize(stdin, "boolean"); } if (stdout !== undefined) { localVarQueryParameters['stdout'] = models_1.ObjectSerializer.serialize(stdout, "boolean"); } if (tty !== undefined) { localVarQueryParameters['tty'] = models_1.ObjectSerializer.serialize(tty, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to portforward of Pod * @param name name of the PodPortForwardOptions * @param namespace object name and auth scope, such as for teams and projects * @param ports List of ports to forward Required when using WebSockets */ connectPostNamespacedPodPortforward(name, namespace, ports, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/portforward' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodPortforward.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodPortforward.'); } if (ports !== undefined) { localVarQueryParameters['ports'] = models_1.ObjectSerializer.serialize(ports, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. */ connectPostNamespacedPodProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. */ connectPostNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPostNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectPostNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectPostNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPostNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. */ connectPostNodeProxy(name, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect POST requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. */ connectPostNodeProxyWithPath(name, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPostNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPostNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PUT requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the URL path to use for the current proxy request to pod. */ connectPutNamespacedPodProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedPodProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedPodProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PUT requests to proxy of Pod * @param name name of the PodProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to pod. */ connectPutNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedPodProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedPodProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPutNamespacedPodProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PUT requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectPutNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedServiceProxy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedServiceProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PUT requests to proxy of Service * @param name name of the ServiceProxyOptions * @param namespace object name and auth scope, such as for teams and projects * @param path path to the resource * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. */ connectPutNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedServiceProxyWithPath.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedServiceProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPutNamespacedServiceProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PUT requests to proxy of Node * @param name name of the NodeProxyOptions * @param path Path is the URL path to use for the current proxy request to node. */ connectPutNodeProxy(name, path, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNodeProxy.'); } if (path !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * connect PUT requests to proxy of Node * @param name name of the NodeProxyOptions * @param path path to the resource * @param path2 Path is the URL path to use for the current proxy request to node. */ connectPutNodeProxyWithPath(name, path, path2, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'path' + '}', encodeURIComponent(String(path))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['*/*']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling connectPutNodeProxyWithPath.'); } // verify required parameter 'path' is not null or undefined if (path === null || path === undefined) { throw new Error('Required parameter path was null or undefined when calling connectPutNodeProxyWithPath.'); } if (path2 !== undefined) { localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Namespace * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespace(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Namespace") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Binding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createNamespacedBinding(namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/bindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedBinding.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Binding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Binding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedConfigMap(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedConfigMap.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ConfigMap") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ConfigMap"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedEndpoints(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEndpoints.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Endpoints") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Endpoints"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create an Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedEvent(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "CoreV1Event") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "CoreV1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedLimitRange(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLimitRange.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1LimitRange") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LimitRange"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedPersistentVolumeClaim(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPersistentVolumeClaim.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PersistentVolumeClaim") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedPod(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPod.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Pod") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create binding of a Pod * @param name name of the Binding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createNamespacedPodBinding(name, namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/binding' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling createNamespacedPodBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodBinding.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Binding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Binding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create eviction of a Pod * @param name name of the Eviction * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createNamespacedPodEviction(name, namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/eviction' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling createNamespacedPodEviction.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodEviction.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodEviction.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1Eviction") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Eviction"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedPodTemplate(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodTemplate.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PodTemplate") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedReplicationController(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicationController.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ReplicationController") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedResourceQuota(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedResourceQuota.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ResourceQuota") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Secret * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedSecret(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedSecret.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Secret") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Secret"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedService(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Service") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedServiceAccount(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedServiceAccount.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ServiceAccount") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create token of a ServiceAccount * @param name name of the TokenRequest * @param namespace object name and auth scope, such as for teams and projects * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ createNamespacedServiceAccountToken(name, namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling createNamespacedServiceAccountToken.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedServiceAccountToken.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedServiceAccountToken.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "AuthenticationV1TokenRequest") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "AuthenticationV1TokenRequest"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Node * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNode(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Node") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a PersistentVolume * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createPersistentVolume(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PersistentVolume") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedConfigMap(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedEndpoints(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedEvent(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedLimitRange(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedPersistentVolumeClaim(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Pod * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedPod(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedPodTemplate(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedReplicationController(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedResourceQuota(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Secret * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedSecret(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedServiceAccount(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Node * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNode(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PersistentVolume * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionPersistentVolume(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Namespace * @param name name of the Namespace * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespace(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ConfigMap * @param name name of the ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedConfigMap(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedConfigMap.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete Endpoints * @param name name of the Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedEndpoints(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEndpoints.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedEvent(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a LimitRange * @param name name of the LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedLimitRange(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLimitRange.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedPersistentVolumeClaim(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPersistentVolumeClaim.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedPod(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPod.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PodTemplate * @param name name of the PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedPodTemplate(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodTemplate.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedReplicationController(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicationController.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedResourceQuota(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedResourceQuota.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Secret * @param name name of the Secret * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedSecret(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedSecret.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedService(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedService.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ServiceAccount * @param name name of the ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedServiceAccount(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedServiceAccount.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Node * @param name name of the Node * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNode(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PersistentVolume * @param name name of the PersistentVolume * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deletePersistentVolume(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list objects of kind ComponentStatus * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listComponentStatus(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/componentstatuses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ComponentStatusList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ConfigMap * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listConfigMapForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/configmaps'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ConfigMapList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Endpoints * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listEndpointsForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/endpoints'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1EndpointsList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Event * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listEventForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/events'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "CoreV1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind LimitRange * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listLimitRangeForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/limitranges'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LimitRangeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Namespace * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespace(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1NamespaceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedConfigMap(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ConfigMapList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedEndpoints(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1EndpointsList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedEvent(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "CoreV1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedLimitRange(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LimitRangeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedPersistentVolumeClaim(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaimList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Pod * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedPod(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedPodTemplate(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodTemplateList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedReplicationController(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationControllerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedResourceQuota(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuotaList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Secret * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedSecret(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1SecretList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Service * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedService(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedServiceAccount(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceAccountList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Node * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNode(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1NodeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PersistentVolume * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPersistentVolume(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PersistentVolumeClaim * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPersistentVolumeClaimForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumeclaims'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaimList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Pod * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPodForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/pods'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PodTemplate * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPodTemplateForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/podtemplates'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodTemplateList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ReplicationController * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listReplicationControllerForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/replicationcontrollers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationControllerList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ResourceQuota * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listResourceQuotaForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/resourcequotas'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuotaList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Secret * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listSecretForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/secrets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1SecretList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ServiceAccount * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listServiceAccountForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/serviceaccounts'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceAccountList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Service * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listServiceForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/services'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Namespace * @param name name of the Namespace * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespace(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespace.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Namespace * @param name name of the Namespace * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespaceStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespaceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespaceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ConfigMap * @param name name of the ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedConfigMap(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedConfigMap.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedConfigMap.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ConfigMap"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Endpoints * @param name name of the Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedEndpoints(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedEndpoints.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEndpoints.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Endpoints"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "CoreV1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified LimitRange * @param name name of the LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedLimitRange(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedLimitRange.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLimitRange.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LimitRange"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedPersistentVolumeClaim(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPersistentVolumeClaim.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPersistentVolumeClaim.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedPersistentVolumeClaimStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedPod(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPod.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPod.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedPodStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PodTemplate * @param name name of the PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedPodTemplate(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodTemplate.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodTemplate.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedReplicationController(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationController.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationController.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update scale of the specified ReplicationController * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedReplicationControllerScale(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedReplicationControllerStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedResourceQuota(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedResourceQuota.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedResourceQuota.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedResourceQuotaStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedResourceQuotaStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedResourceQuotaStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedResourceQuotaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Secret * @param name name of the Secret * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedSecret(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedSecret.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedSecret.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Secret"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedService(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedService.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ServiceAccount * @param name name of the ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedServiceAccount(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedServiceAccount.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedServiceAccount.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedServiceStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedServiceStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Node * @param name name of the Node * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNode(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNode.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Node * @param name name of the Node * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNodeStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNodeStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNodeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PersistentVolume * @param name name of the PersistentVolume * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPersistentVolume(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPersistentVolume.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified PersistentVolume * @param name name of the PersistentVolume * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPersistentVolumeStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPersistentVolumeStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPersistentVolumeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ComponentStatus * @param name name of the ComponentStatus * @param pretty If \'true\', then the output is pretty printed. */ readComponentStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/componentstatuses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readComponentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ComponentStatus"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Namespace * @param name name of the Namespace * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespace(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Namespace * @param name name of the Namespace * @param pretty If \'true\', then the output is pretty printed. */ readNamespaceStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespaceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ConfigMap * @param name name of the ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedConfigMap(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedConfigMap.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ConfigMap"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Endpoints * @param name name of the Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedEndpoints(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedEndpoints.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Endpoints"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedEvent(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "CoreV1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified LimitRange * @param name name of the LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedLimitRange(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedLimitRange.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LimitRange"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedPersistentVolumeClaim(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaim.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedPersistentVolumeClaimStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedPod(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPod.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read log of the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param container The container for which to stream logs. Defaults to only container if there is one container in the pod. * @param follow Follow the log stream of the pod. Defaults to false. * @param insecureSkipTLSVerifyBackend insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver\'s TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet). * @param limitBytes If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit. * @param pretty If \'true\', then the output is pretty printed. * @param previous Return previous terminated container logs. Defaults to false. * @param sinceSeconds A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified. * @param tailLines If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime * @param timestamps If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. */ readNamespacedPodLog(name, namespace, container, follow, insecureSkipTLSVerifyBackend, limitBytes, pretty, previous, sinceSeconds, tailLines, timestamps, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/log' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['text/plain', 'application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodLog.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodLog.'); } if (container !== undefined) { localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, "string"); } if (follow !== undefined) { localVarQueryParameters['follow'] = models_1.ObjectSerializer.serialize(follow, "boolean"); } if (insecureSkipTLSVerifyBackend !== undefined) { localVarQueryParameters['insecureSkipTLSVerifyBackend'] = models_1.ObjectSerializer.serialize(insecureSkipTLSVerifyBackend, "boolean"); } if (limitBytes !== undefined) { localVarQueryParameters['limitBytes'] = models_1.ObjectSerializer.serialize(limitBytes, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (previous !== undefined) { localVarQueryParameters['previous'] = models_1.ObjectSerializer.serialize(previous, "boolean"); } if (sinceSeconds !== undefined) { localVarQueryParameters['sinceSeconds'] = models_1.ObjectSerializer.serialize(sinceSeconds, "number"); } if (tailLines !== undefined) { localVarQueryParameters['tailLines'] = models_1.ObjectSerializer.serialize(tailLines, "number"); } if (timestamps !== undefined) { localVarQueryParameters['timestamps'] = models_1.ObjectSerializer.serialize(timestamps, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedPodStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PodTemplate * @param name name of the PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedPodTemplate(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodTemplate.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedReplicationController(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationController.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read scale of the specified ReplicationController * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedReplicationControllerScale(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedReplicationControllerStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedResourceQuota(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedResourceQuota.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedResourceQuotaStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedResourceQuotaStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedResourceQuotaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Secret * @param name name of the Secret * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedSecret(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedSecret.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Secret"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedService(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedService.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ServiceAccount * @param name name of the ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedServiceAccount(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedServiceAccount.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedServiceStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedServiceStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Node * @param name name of the Node * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNode(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Node * @param name name of the Node * @param pretty If \'true\', then the output is pretty printed. */ readNodeStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNodeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PersistentVolume * @param name name of the PersistentVolume * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readPersistentVolume(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified PersistentVolume * @param name name of the PersistentVolume * @param pretty If \'true\', then the output is pretty printed. */ readPersistentVolumeStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPersistentVolumeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Namespace * @param name name of the Namespace * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespace(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespace.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespace.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Namespace") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace finalize of the specified Namespace * @param name name of the Namespace * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. * @param pretty If \'true\', then the output is pretty printed. */ replaceNamespaceFinalize(name, body, dryRun, fieldManager, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{name}/finalize' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespaceFinalize.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespaceFinalize.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Namespace") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Namespace * @param name name of the Namespace * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespaceStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespaceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespaceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Namespace") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Namespace"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ConfigMap * @param name name of the ConfigMap * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedConfigMap(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedConfigMap.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedConfigMap.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedConfigMap.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ConfigMap") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ConfigMap"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Endpoints * @param name name of the Endpoints * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedEndpoints(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEndpoints.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEndpoints.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEndpoints.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Endpoints") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Endpoints"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "CoreV1Event") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "CoreV1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified LimitRange * @param name name of the LimitRange * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedLimitRange(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLimitRange.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLimitRange.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLimitRange.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1LimitRange") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1LimitRange"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedPersistentVolumeClaim(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPersistentVolumeClaim.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPersistentVolumeClaim.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPersistentVolumeClaim.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PersistentVolumeClaim") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified PersistentVolumeClaim * @param name name of the PersistentVolumeClaim * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedPersistentVolumeClaimStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PersistentVolumeClaim") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolumeClaim"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedPod(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPod.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPod.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPod.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Pod") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Pod * @param name name of the Pod * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedPodStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Pod") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Pod"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PodTemplate * @param name name of the PodTemplate * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedPodTemplate(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodTemplate.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodTemplate.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodTemplate.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PodTemplate") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PodTemplate"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedReplicationController(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationController.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationController.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationController.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ReplicationController") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace scale of the specified ReplicationController * @param name name of the Scale * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedReplicationControllerScale(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerScale.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Scale") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Scale"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified ReplicationController * @param name name of the ReplicationController * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedReplicationControllerStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ReplicationController") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ReplicationController"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedResourceQuota(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedResourceQuota.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedResourceQuota.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedResourceQuota.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ResourceQuota") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified ResourceQuota * @param name name of the ResourceQuota * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedResourceQuotaStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedResourceQuotaStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedResourceQuotaStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedResourceQuotaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ResourceQuota") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ResourceQuota"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Secret * @param name name of the Secret * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedSecret(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedSecret.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedSecret.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedSecret.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Secret") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Secret"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedService(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedService.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedService.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedService.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Service") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ServiceAccount * @param name name of the ServiceAccount * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedServiceAccount(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedServiceAccount.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedServiceAccount.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedServiceAccount.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ServiceAccount") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ServiceAccount"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Service * @param name name of the Service * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedServiceStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedServiceStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedServiceStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedServiceStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Service") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Service"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Node * @param name name of the Node * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNode(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNode.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Node") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Node * @param name name of the Node * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNodeStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/nodes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNodeStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNodeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Node") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Node"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PersistentVolume * @param name name of the PersistentVolume * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePersistentVolume(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePersistentVolume.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePersistentVolume.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PersistentVolume") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified PersistentVolume * @param name name of the PersistentVolume * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePersistentVolumeStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePersistentVolumeStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePersistentVolumeStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PersistentVolume") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PersistentVolume"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CoreV1Api = CoreV1Api; //# sourceMappingURL=coreV1Api.js.map /***/ }), /***/ 36522: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CustomObjectsApi = exports.CustomObjectsApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var CustomObjectsApiApiKeys; (function (CustomObjectsApiApiKeys) { CustomObjectsApiApiKeys[CustomObjectsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(CustomObjectsApiApiKeys = exports.CustomObjectsApiApiKeys || (exports.CustomObjectsApiApiKeys = {})); class CustomObjectsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[CustomObjectsApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * Creates a cluster scoped Custom object * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param body The JSON schema of the Resource to create. * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). */ createClusterCustomObject(group, version, plural, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling createClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling createClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling createClusterCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * Creates a namespace scoped Custom object * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param body The JSON schema of the Resource to create. * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedCustomObject(group, version, namespace, plural, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling createNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling createNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling createNamespacedCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * Deletes the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom object\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param body */ deleteClusterCustomObject(group, version, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling deleteClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling deleteClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling deleteClusterCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterCustomObject.'); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * Delete collection of cluster scoped custom objects * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param pretty If \'true\', then the output is pretty printed. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param body */ deleteCollectionClusterCustomObject(group, version, plural, pretty, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling deleteCollectionClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling deleteCollectionClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling deleteCollectionClusterCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * Delete collection of namespace scoped custom objects * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param pretty If \'true\', then the output is pretty printed. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param body */ deleteCollectionNamespacedCustomObject(group, version, namespace, plural, pretty, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling deleteCollectionNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling deleteCollectionNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling deleteCollectionNamespacedCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * Deletes the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param body */ deleteNamespacedCustomObject(group, version, namespace, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling deleteNamespacedCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCustomObject.'); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * Returns a cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom object\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ getClusterCustomObject(group, version, plural, name, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getClusterCustomObject.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read scale of the specified custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ getClusterCustomObjectScale(group, version, plural, name, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getClusterCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getClusterCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getClusterCustomObjectScale.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ getClusterCustomObjectStatus(group, version, plural, name, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getClusterCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getClusterCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getClusterCustomObjectStatus.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * Returns a namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ getNamespacedCustomObject(group, version, namespace, plural, name, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObject.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read scale of the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ getNamespacedCustomObjectScale(group, version, namespace, plural, name, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObjectScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObjectScale.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name */ getNamespacedCustomObjectStatus(group, version, namespace, plural, name, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObjectStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObjectStatus.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch cluster scoped custom objects * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it\'s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. */ listClusterCustomObject(group, version, plural, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/json;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling listClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling listClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling listClusterCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch namespace scoped custom objects * @param group The custom resource\'s group name * @param version The custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural The custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it\'s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. */ listNamespacedCustomObject(group, version, namespace, plural, pretty, _continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/json;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling listNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling listNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling listNamespacedCustomObject.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * patch the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom object\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body The JSON schema of the Resource to patch. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterCustomObject(group, version, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObject.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update scale of the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterCustomObjectScale(group, version, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObjectScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObjectScale.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterCustomObjectStatus(group, version, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObjectStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObjectStatus.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * patch the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body The JSON schema of the Resource to patch. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedCustomObject(group, version, namespace, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObject.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update scale of the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedCustomObjectScale(group, version, namespace, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObjectScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObjectScale.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObjectStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObjectStatus.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom object\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body The JSON schema of the Resource to replace. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterCustomObject(group, version, plural, name, body, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObject.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace scale of the specified cluster scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterCustomObjectScale(group, version, plural, name, body, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObjectScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObjectScale.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the cluster scoped specified custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterCustomObjectStatus(group, version, plural, name, body, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObjectStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObjectStatus.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body The JSON schema of the Resource to replace. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedCustomObject(group, version, namespace, plural, name, body, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObject.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObject.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace scale of the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedCustomObjectScale(group, version, namespace, plural, name, body, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObjectScale.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObjectScale.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified namespace scoped custom object * @param group the custom resource\'s group * @param version the custom resource\'s version * @param namespace The custom resource\'s namespace * @param plural the custom resource\'s plural name. For TPRs this would be lowercase plural kind. * @param name the custom object\'s name * @param body * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status' .replace('{' + 'group' + '}', encodeURIComponent(String(group))) .replace('{' + 'version' + '}', encodeURIComponent(String(version))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))) .replace('{' + 'plural' + '}', encodeURIComponent(String(plural))) .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'group' is not null or undefined if (group === null || group === undefined) { throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'version' is not null or undefined if (version === null || version === undefined) { throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'plural' is not null or undefined if (plural === null || plural === undefined) { throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObjectStatus.'); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "object"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.CustomObjectsApi = CustomObjectsApi; //# sourceMappingURL=customObjectsApi.js.map /***/ }), /***/ 44310: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiscoveryApi = exports.DiscoveryApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var DiscoveryApiApiKeys; (function (DiscoveryApiApiKeys) { DiscoveryApiApiKeys[DiscoveryApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(DiscoveryApiApiKeys = exports.DiscoveryApiApiKeys || (exports.DiscoveryApiApiKeys = {})); class DiscoveryApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[DiscoveryApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.DiscoveryApi = DiscoveryApi; //# sourceMappingURL=discoveryApi.js.map /***/ }), /***/ 10420: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiscoveryV1beta1Api = exports.DiscoveryV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var DiscoveryV1beta1ApiApiKeys; (function (DiscoveryV1beta1ApiApiKeys) { DiscoveryV1beta1ApiApiKeys[DiscoveryV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(DiscoveryV1beta1ApiApiKeys = exports.DiscoveryV1beta1ApiApiKeys || (exports.DiscoveryV1beta1ApiApiKeys = {})); class DiscoveryV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[DiscoveryV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create an EndpointSlice * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedEndpointSlice(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEndpointSlice.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedEndpointSlice.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1EndpointSlice") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1EndpointSlice"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of EndpointSlice * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedEndpointSlice(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEndpointSlice.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an EndpointSlice * @param name name of the EndpointSlice * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedEndpointSlice(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEndpointSlice.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEndpointSlice.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind EndpointSlice * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listEndpointSliceForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/endpointslices'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1EndpointSliceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind EndpointSlice * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedEndpointSlice(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEndpointSlice.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1EndpointSliceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified EndpointSlice * @param name name of the EndpointSlice * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedEndpointSlice(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedEndpointSlice.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEndpointSlice.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedEndpointSlice.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1EndpointSlice"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified EndpointSlice * @param name name of the EndpointSlice * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedEndpointSlice(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedEndpointSlice.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEndpointSlice.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1EndpointSlice"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified EndpointSlice * @param name name of the EndpointSlice * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedEndpointSlice(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEndpointSlice.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEndpointSlice.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEndpointSlice.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1EndpointSlice") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1EndpointSlice"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.DiscoveryV1beta1Api = DiscoveryV1beta1Api; //# sourceMappingURL=discoveryV1beta1Api.js.map /***/ }), /***/ 89829: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventsApi = exports.EventsApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var EventsApiApiKeys; (function (EventsApiApiKeys) { EventsApiApiKeys[EventsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(EventsApiApiKeys = exports.EventsApiApiKeys || (exports.EventsApiApiKeys = {})); class EventsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[EventsApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.EventsApi = EventsApi; //# sourceMappingURL=eventsApi.js.map /***/ }), /***/ 15621: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventsV1Api = exports.EventsV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var EventsV1ApiApiKeys; (function (EventsV1ApiApiKeys) { EventsV1ApiApiKeys[EventsV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(EventsV1ApiApiKeys = exports.EventsV1ApiApiKeys || (exports.EventsV1ApiApiKeys = {})); class EventsV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[EventsV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create an Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedEvent(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "EventsV1Event") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "EventsV1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedEvent(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedEvent(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Event * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listEventForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/events'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "EventsV1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedEvent(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "EventsV1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "EventsV1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedEvent(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "EventsV1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "EventsV1Event") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "EventsV1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.EventsV1Api = EventsV1Api; //# sourceMappingURL=eventsV1Api.js.map /***/ }), /***/ 5821: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventsV1beta1Api = exports.EventsV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var EventsV1beta1ApiApiKeys; (function (EventsV1beta1ApiApiKeys) { EventsV1beta1ApiApiKeys[EventsV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(EventsV1beta1ApiApiKeys = exports.EventsV1beta1ApiApiKeys || (exports.EventsV1beta1ApiApiKeys = {})); class EventsV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[EventsV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create an Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedEvent(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1Event") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedEvent(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedEvent(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Event * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listEventForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/events'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedEvent(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1EventList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedEvent(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Event * @param name name of the Event * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1Event") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Event"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.EventsV1beta1Api = EventsV1beta1Api; //# sourceMappingURL=eventsV1beta1Api.js.map /***/ }), /***/ 71817: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsApi = exports.ExtensionsApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ExtensionsApiApiKeys; (function (ExtensionsApiApiKeys) { ExtensionsApiApiKeys[ExtensionsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ExtensionsApiApiKeys = exports.ExtensionsApiApiKeys || (exports.ExtensionsApiApiKeys = {})); class ExtensionsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ExtensionsApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ExtensionsApi = ExtensionsApi; //# sourceMappingURL=extensionsApi.js.map /***/ }), /***/ 63382: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1Api = exports.ExtensionsV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var ExtensionsV1beta1ApiApiKeys; (function (ExtensionsV1beta1ApiApiKeys) { ExtensionsV1beta1ApiApiKeys[ExtensionsV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(ExtensionsV1beta1ApiApiKeys = exports.ExtensionsV1beta1ApiApiKeys || (exports.ExtensionsV1beta1ApiApiKeys = {})); class ExtensionsV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[ExtensionsV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create an Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedIngress(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "ExtensionsV1beta1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedIngress(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedIngress(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Ingress * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listIngressForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/ingresses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1IngressList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedIngress(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1IngressList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedIngress(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedIngressStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngressStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedIngress(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedIngressStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedIngress(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "ExtensionsV1beta1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedIngressStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngressStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "ExtensionsV1beta1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "ExtensionsV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.ExtensionsV1beta1Api = ExtensionsV1beta1Api; //# sourceMappingURL=extensionsV1beta1Api.js.map /***/ }), /***/ 16001: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FlowcontrolApiserverApi = exports.FlowcontrolApiserverApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var FlowcontrolApiserverApiApiKeys; (function (FlowcontrolApiserverApiApiKeys) { FlowcontrolApiserverApiApiKeys[FlowcontrolApiserverApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(FlowcontrolApiserverApiApiKeys = exports.FlowcontrolApiserverApiApiKeys || (exports.FlowcontrolApiserverApiApiKeys = {})); class FlowcontrolApiserverApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[FlowcontrolApiserverApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.FlowcontrolApiserverApi = FlowcontrolApiserverApi; //# sourceMappingURL=flowcontrolApiserverApi.js.map /***/ }), /***/ 95091: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FlowcontrolApiserverV1alpha1Api = exports.FlowcontrolApiserverV1alpha1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var FlowcontrolApiserverV1alpha1ApiApiKeys; (function (FlowcontrolApiserverV1alpha1ApiApiKeys) { FlowcontrolApiserverV1alpha1ApiApiKeys[FlowcontrolApiserverV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(FlowcontrolApiserverV1alpha1ApiApiKeys = exports.FlowcontrolApiserverV1alpha1ApiApiKeys || (exports.FlowcontrolApiserverV1alpha1ApiApiKeys = {})); class FlowcontrolApiserverV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[FlowcontrolApiserverV1alpha1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createFlowSchema(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1FlowSchema") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createPriorityLevelConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1PriorityLevelConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of FlowSchema * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionFlowSchema(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionPriorityLevelConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a FlowSchema * @param name name of the FlowSchema * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteFlowSchema(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deletePriorityLevelConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind FlowSchema * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listFlowSchema(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1FlowSchemaList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPriorityLevelConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityLevelConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified FlowSchema * @param name name of the FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchFlowSchema(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchFlowSchema.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified FlowSchema * @param name name of the FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchFlowSchemaStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchFlowSchemaStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchFlowSchemaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPriorityLevelConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityLevelConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPriorityLevelConfigurationStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityLevelConfigurationStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityLevelConfigurationStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified FlowSchema * @param name name of the FlowSchema * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readFlowSchema(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified FlowSchema * @param name name of the FlowSchema * @param pretty If \'true\', then the output is pretty printed. */ readFlowSchemaStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readFlowSchemaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readPriorityLevelConfiguration(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. */ readPriorityLevelConfigurationStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityLevelConfigurationStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified FlowSchema * @param name name of the FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceFlowSchema(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceFlowSchema.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1FlowSchema") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified FlowSchema * @param name name of the FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceFlowSchemaStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/flowschemas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceFlowSchemaStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceFlowSchemaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1FlowSchema") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePriorityLevelConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityLevelConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1PriorityLevelConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePriorityLevelConfigurationStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1alpha1/prioritylevelconfigurations/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityLevelConfigurationStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityLevelConfigurationStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1PriorityLevelConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.FlowcontrolApiserverV1alpha1Api = FlowcontrolApiserverV1alpha1Api; //# sourceMappingURL=flowcontrolApiserverV1alpha1Api.js.map /***/ }), /***/ 58365: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FlowcontrolApiserverV1beta1Api = exports.FlowcontrolApiserverV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var FlowcontrolApiserverV1beta1ApiApiKeys; (function (FlowcontrolApiserverV1beta1ApiApiKeys) { FlowcontrolApiserverV1beta1ApiApiKeys[FlowcontrolApiserverV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(FlowcontrolApiserverV1beta1ApiApiKeys = exports.FlowcontrolApiserverV1beta1ApiApiKeys || (exports.FlowcontrolApiserverV1beta1ApiApiKeys = {})); class FlowcontrolApiserverV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[FlowcontrolApiserverV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createFlowSchema(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1FlowSchema") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createPriorityLevelConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PriorityLevelConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of FlowSchema * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionFlowSchema(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionPriorityLevelConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a FlowSchema * @param name name of the FlowSchema * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteFlowSchema(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deletePriorityLevelConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind FlowSchema * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listFlowSchema(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1FlowSchemaList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPriorityLevelConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityLevelConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified FlowSchema * @param name name of the FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchFlowSchema(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchFlowSchema.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified FlowSchema * @param name name of the FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchFlowSchemaStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchFlowSchemaStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchFlowSchemaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPriorityLevelConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityLevelConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPriorityLevelConfigurationStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityLevelConfigurationStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityLevelConfigurationStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified FlowSchema * @param name name of the FlowSchema * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readFlowSchema(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified FlowSchema * @param name name of the FlowSchema * @param pretty If \'true\', then the output is pretty printed. */ readFlowSchemaStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readFlowSchemaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readPriorityLevelConfiguration(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param pretty If \'true\', then the output is pretty printed. */ readPriorityLevelConfigurationStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityLevelConfigurationStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified FlowSchema * @param name name of the FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceFlowSchema(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceFlowSchema.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceFlowSchema.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1FlowSchema") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified FlowSchema * @param name name of the FlowSchema * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceFlowSchemaStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceFlowSchemaStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceFlowSchemaStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1FlowSchema") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1FlowSchema"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePriorityLevelConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityLevelConfiguration.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityLevelConfiguration.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PriorityLevelConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified PriorityLevelConfiguration * @param name name of the PriorityLevelConfiguration * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePriorityLevelConfigurationStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityLevelConfigurationStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityLevelConfigurationStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PriorityLevelConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityLevelConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.FlowcontrolApiserverV1beta1Api = FlowcontrolApiserverV1beta1Api; //# sourceMappingURL=flowcontrolApiserverV1beta1Api.js.map /***/ }), /***/ 31857: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.InternalApiserverApi = exports.InternalApiserverApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var InternalApiserverApiApiKeys; (function (InternalApiserverApiApiKeys) { InternalApiserverApiApiKeys[InternalApiserverApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(InternalApiserverApiApiKeys = exports.InternalApiserverApiApiKeys || (exports.InternalApiserverApiApiKeys = {})); class InternalApiserverApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[InternalApiserverApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.InternalApiserverApi = InternalApiserverApi; //# sourceMappingURL=internalApiserverApi.js.map /***/ }), /***/ 76012: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.InternalApiserverV1alpha1Api = exports.InternalApiserverV1alpha1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var InternalApiserverV1alpha1ApiApiKeys; (function (InternalApiserverV1alpha1ApiApiKeys) { InternalApiserverV1alpha1ApiApiKeys[InternalApiserverV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(InternalApiserverV1alpha1ApiApiKeys = exports.InternalApiserverV1alpha1ApiApiKeys || (exports.InternalApiserverV1alpha1ApiApiKeys = {})); class InternalApiserverV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[InternalApiserverV1alpha1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a StorageVersion * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createStorageVersion(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createStorageVersion.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1StorageVersion") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1StorageVersion"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of StorageVersion * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionStorageVersion(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a StorageVersion * @param name name of the StorageVersion * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteStorageVersion(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteStorageVersion.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind StorageVersion * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listStorageVersion(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1StorageVersionList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified StorageVersion * @param name name of the StorageVersion * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchStorageVersion(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchStorageVersion.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchStorageVersion.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1StorageVersion"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified StorageVersion * @param name name of the StorageVersion * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchStorageVersionStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchStorageVersionStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchStorageVersionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1StorageVersion"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified StorageVersion * @param name name of the StorageVersion * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readStorageVersion(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readStorageVersion.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1StorageVersion"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified StorageVersion * @param name name of the StorageVersion * @param pretty If \'true\', then the output is pretty printed. */ readStorageVersionStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readStorageVersionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1StorageVersion"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified StorageVersion * @param name name of the StorageVersion * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceStorageVersion(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceStorageVersion.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceStorageVersion.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1StorageVersion") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1StorageVersion"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified StorageVersion * @param name name of the StorageVersion * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceStorageVersionStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceStorageVersionStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceStorageVersionStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1StorageVersion") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1StorageVersion"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.InternalApiserverV1alpha1Api = InternalApiserverV1alpha1Api; //# sourceMappingURL=internalApiserverV1alpha1Api.js.map /***/ }), /***/ 88382: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LogsApi = exports.LogsApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); /* tslint:disable:no-unused-locals */ const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var LogsApiApiKeys; (function (LogsApiApiKeys) { LogsApiApiKeys[LogsApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(LogsApiApiKeys = exports.LogsApiApiKeys || (exports.LogsApiApiKeys = {})); class LogsApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[LogsApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * * @param logpath path to the log */ logFileHandler(logpath, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/logs/{logpath}' .replace('{' + 'logpath' + '}', encodeURIComponent(String(logpath))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); let localVarFormParams = {}; // verify required parameter 'logpath' is not null or undefined if (logpath === null || logpath === undefined) { throw new Error('Required parameter logpath was null or undefined when calling logFileHandler.'); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * */ logFileListHandler(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/logs/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.LogsApi = LogsApi; //# sourceMappingURL=logsApi.js.map /***/ }), /***/ 48169: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingApi = exports.NetworkingApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var NetworkingApiApiKeys; (function (NetworkingApiApiKeys) { NetworkingApiApiKeys[NetworkingApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NetworkingApiApiKeys = exports.NetworkingApiApiKeys || (exports.NetworkingApiApiKeys = {})); class NetworkingApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NetworkingApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.NetworkingApi = NetworkingApi; //# sourceMappingURL=networkingApi.js.map /***/ }), /***/ 97534: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1Api = exports.NetworkingV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var NetworkingV1ApiApiKeys; (function (NetworkingV1ApiApiKeys) { NetworkingV1ApiApiKeys[NetworkingV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NetworkingV1ApiApiKeys = exports.NetworkingV1ApiApiKeys || (exports.NetworkingV1ApiApiKeys = {})); class NetworkingV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NetworkingV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create an IngressClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createIngressClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1IngressClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1IngressClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create an Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedIngress(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedNetworkPolicy(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1NetworkPolicy") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of IngressClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionIngressClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedIngress(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedNetworkPolicy(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an IngressClass * @param name name of the IngressClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteIngressClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedIngress(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedNetworkPolicy(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind IngressClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listIngressClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1IngressClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Ingress * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listIngressForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingresses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1IngressList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedIngress(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1IngressList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedNetworkPolicy(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1NetworkPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind NetworkPolicy * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNetworkPolicyForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/networkpolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1NetworkPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified IngressClass * @param name name of the IngressClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchIngressClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchIngressClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1IngressClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedIngress(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedIngressStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngressStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified IngressClass * @param name name of the IngressClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readIngressClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1IngressClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedIngress(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedIngressStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedNetworkPolicy(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified IngressClass * @param name name of the IngressClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceIngressClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceIngressClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1IngressClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1IngressClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedIngress(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedIngressStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngressStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified NetworkPolicy * @param name name of the NetworkPolicy * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedNetworkPolicy.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedNetworkPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedNetworkPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1NetworkPolicy") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1NetworkPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.NetworkingV1Api = NetworkingV1Api; //# sourceMappingURL=networkingV1Api.js.map /***/ }), /***/ 71097: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1Api = exports.NetworkingV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var NetworkingV1beta1ApiApiKeys; (function (NetworkingV1beta1ApiApiKeys) { NetworkingV1beta1ApiApiKeys[NetworkingV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NetworkingV1beta1ApiApiKeys = exports.NetworkingV1beta1ApiApiKeys || (exports.NetworkingV1beta1ApiApiKeys = {})); class NetworkingV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NetworkingV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create an IngressClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createIngressClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/ingressclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1IngressClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1IngressClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create an Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedIngress(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "NetworkingV1beta1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of IngressClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionIngressClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/ingressclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedIngress(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an IngressClass * @param name name of the IngressClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteIngressClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/ingressclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete an Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedIngress(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind IngressClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listIngressClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/ingressclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1IngressClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Ingress * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listIngressForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/ingresses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1IngressList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedIngress(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1IngressList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified IngressClass * @param name name of the IngressClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchIngressClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/ingressclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchIngressClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1IngressClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedIngress(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedIngressStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngressStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified IngressClass * @param name name of the IngressClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readIngressClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/ingressclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1IngressClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedIngress(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedIngressStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified IngressClass * @param name name of the IngressClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceIngressClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/ingressclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceIngressClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceIngressClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1IngressClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1IngressClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedIngress(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngress.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngress.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngress.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "NetworkingV1beta1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified Ingress * @param name name of the Ingress * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedIngressStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/networking.k8s.io/v1beta1/namespaces/{namespace}/ingresses/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngressStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngressStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngressStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "NetworkingV1beta1Ingress") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "NetworkingV1beta1Ingress"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.NetworkingV1beta1Api = NetworkingV1beta1Api; //# sourceMappingURL=networkingV1beta1Api.js.map /***/ }), /***/ 31466: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NodeApi = exports.NodeApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var NodeApiApiKeys; (function (NodeApiApiKeys) { NodeApiApiKeys[NodeApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NodeApiApiKeys = exports.NodeApiApiKeys || (exports.NodeApiApiKeys = {})); class NodeApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NodeApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.NodeApi = NodeApi; //# sourceMappingURL=nodeApi.js.map /***/ }), /***/ 9090: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NodeV1Api = exports.NodeV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var NodeV1ApiApiKeys; (function (NodeV1ApiApiKeys) { NodeV1ApiApiKeys[NodeV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NodeV1ApiApiKeys = exports.NodeV1ApiApiKeys || (exports.NodeV1ApiApiKeys = {})); class NodeV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NodeV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createRuntimeClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1RuntimeClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionRuntimeClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a RuntimeClass * @param name name of the RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteRuntimeClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRuntimeClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RuntimeClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified RuntimeClass * @param name name of the RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchRuntimeClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchRuntimeClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified RuntimeClass * @param name name of the RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readRuntimeClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified RuntimeClass * @param name name of the RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceRuntimeClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceRuntimeClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1RuntimeClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.NodeV1Api = NodeV1Api; //# sourceMappingURL=nodeV1Api.js.map /***/ }), /***/ 17374: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NodeV1alpha1Api = exports.NodeV1alpha1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var NodeV1alpha1ApiApiKeys; (function (NodeV1alpha1ApiApiKeys) { NodeV1alpha1ApiApiKeys[NodeV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NodeV1alpha1ApiApiKeys = exports.NodeV1alpha1ApiApiKeys || (exports.NodeV1alpha1ApiApiKeys = {})); class NodeV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NodeV1alpha1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createRuntimeClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1RuntimeClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionRuntimeClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a RuntimeClass * @param name name of the RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteRuntimeClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRuntimeClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RuntimeClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified RuntimeClass * @param name name of the RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchRuntimeClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchRuntimeClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified RuntimeClass * @param name name of the RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readRuntimeClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified RuntimeClass * @param name name of the RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceRuntimeClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceRuntimeClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1RuntimeClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.NodeV1alpha1Api = NodeV1alpha1Api; //# sourceMappingURL=nodeV1alpha1Api.js.map /***/ }), /***/ 78504: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NodeV1beta1Api = exports.NodeV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var NodeV1beta1ApiApiKeys; (function (NodeV1beta1ApiApiKeys) { NodeV1beta1ApiApiKeys[NodeV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(NodeV1beta1ApiApiKeys = exports.NodeV1beta1ApiApiKeys || (exports.NodeV1beta1ApiApiKeys = {})); class NodeV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[NodeV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createRuntimeClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1RuntimeClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionRuntimeClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a RuntimeClass * @param name name of the RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteRuntimeClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRuntimeClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RuntimeClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified RuntimeClass * @param name name of the RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchRuntimeClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchRuntimeClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified RuntimeClass * @param name name of the RuntimeClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readRuntimeClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified RuntimeClass * @param name name of the RuntimeClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceRuntimeClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceRuntimeClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceRuntimeClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1RuntimeClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RuntimeClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.NodeV1beta1Api = NodeV1beta1Api; //# sourceMappingURL=nodeV1beta1Api.js.map /***/ }), /***/ 5381: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OpenidApi = exports.OpenidApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); /* tslint:disable:no-unused-locals */ const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var OpenidApiApiKeys; (function (OpenidApiApiKeys) { OpenidApiApiKeys[OpenidApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(OpenidApiApiKeys = exports.OpenidApiApiKeys || (exports.OpenidApiApiKeys = {})); class OpenidApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[OpenidApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get service account issuer OpenID JSON Web Key Set (contains public token verification keys) */ getServiceAccountIssuerOpenIDKeyset(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/openid/v1/jwks/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/jwk-set+json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.OpenidApi = OpenidApi; //# sourceMappingURL=openidApi.js.map /***/ }), /***/ 37284: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PolicyApi = exports.PolicyApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var PolicyApiApiKeys; (function (PolicyApiApiKeys) { PolicyApiApiKeys[PolicyApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(PolicyApiApiKeys = exports.PolicyApiApiKeys || (exports.PolicyApiApiKeys = {})); class PolicyApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[PolicyApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.PolicyApi = PolicyApi; //# sourceMappingURL=policyApi.js.map /***/ }), /***/ 80228: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PolicyV1beta1Api = exports.PolicyV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var PolicyV1beta1ApiApiKeys; (function (PolicyV1beta1ApiApiKeys) { PolicyV1beta1ApiApiKeys[PolicyV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(PolicyV1beta1ApiApiKeys = exports.PolicyV1beta1ApiApiKeys || (exports.PolicyV1beta1ApiApiKeys = {})); class PolicyV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[PolicyV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedPodDisruptionBudget(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodDisruptionBudget.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PodDisruptionBudget") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a PodSecurityPolicy * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createPodSecurityPolicy(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PodSecurityPolicy") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedPodDisruptionBudget(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PodSecurityPolicy * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionPodSecurityPolicy(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedPodDisruptionBudget(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodDisruptionBudget.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deletePodSecurityPolicy(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedPodDisruptionBudget(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudgetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PodDisruptionBudget * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPodDisruptionBudgetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/poddisruptionbudgets'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudgetList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PodSecurityPolicy * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPodSecurityPolicy(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodSecurityPolicyList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudget.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudget.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPodSecurityPolicy(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPodSecurityPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readNamespacedPodDisruptionBudget(name, namespace, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudget.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedPodDisruptionBudgetStatus(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readPodSecurityPolicy(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudget.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudget.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudget.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PodDisruptionBudget") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified PodDisruptionBudget * @param name name of the PodDisruptionBudget * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PodDisruptionBudget") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodDisruptionBudget"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PodSecurityPolicy * @param name name of the PodSecurityPolicy * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePodSecurityPolicy(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePodSecurityPolicy.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePodSecurityPolicy.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PodSecurityPolicy") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PodSecurityPolicy"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.PolicyV1beta1Api = PolicyV1beta1Api; //# sourceMappingURL=policyV1beta1Api.js.map /***/ }), /***/ 73316: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RbacAuthorizationApi = exports.RbacAuthorizationApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var RbacAuthorizationApiApiKeys; (function (RbacAuthorizationApiApiKeys) { RbacAuthorizationApiApiKeys[RbacAuthorizationApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(RbacAuthorizationApiApiKeys = exports.RbacAuthorizationApiApiKeys || (exports.RbacAuthorizationApiApiKeys = {})); class RbacAuthorizationApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[RbacAuthorizationApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.RbacAuthorizationApi = RbacAuthorizationApi; //# sourceMappingURL=rbacAuthorizationApi.js.map /***/ }), /***/ 93149: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RbacAuthorizationV1Api = exports.RbacAuthorizationV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var RbacAuthorizationV1ApiApiKeys; (function (RbacAuthorizationV1ApiApiKeys) { RbacAuthorizationV1ApiApiKeys[RbacAuthorizationV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(RbacAuthorizationV1ApiApiKeys = exports.RbacAuthorizationV1ApiApiKeys || (exports.RbacAuthorizationV1ApiApiKeys = {})); class RbacAuthorizationV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[RbacAuthorizationV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createClusterRole(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ClusterRole") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createClusterRoleBinding(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ClusterRoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedRole(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Role") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedRoleBinding(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1RoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ClusterRole * @param name name of the ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteClusterRole(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteClusterRoleBinding(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionClusterRole(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionClusterRoleBinding(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedRole(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedRoleBinding(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedRole(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedRoleBinding(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listClusterRole(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listClusterRoleBinding(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedRole(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedRoleBinding(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RoleBinding * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRoleBindingForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/rolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Role * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRoleForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/roles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterRole(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterRoleBinding(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ClusterRole * @param name name of the ClusterRole * @param pretty If \'true\', then the output is pretty printed. */ readClusterRole(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. */ readClusterRoleBinding(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedRole(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedRoleBinding(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterRole(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ClusterRole") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterRoleBinding(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1ClusterRoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1Role") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1RoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.RbacAuthorizationV1Api = RbacAuthorizationV1Api; //# sourceMappingURL=rbacAuthorizationV1Api.js.map /***/ }), /***/ 44056: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RbacAuthorizationV1alpha1Api = exports.RbacAuthorizationV1alpha1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var RbacAuthorizationV1alpha1ApiApiKeys; (function (RbacAuthorizationV1alpha1ApiApiKeys) { RbacAuthorizationV1alpha1ApiApiKeys[RbacAuthorizationV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(RbacAuthorizationV1alpha1ApiApiKeys = exports.RbacAuthorizationV1alpha1ApiApiKeys || (exports.RbacAuthorizationV1alpha1ApiApiKeys = {})); class RbacAuthorizationV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[RbacAuthorizationV1alpha1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createClusterRole(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1ClusterRole") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createClusterRoleBinding(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1ClusterRoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedRole(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1Role") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedRoleBinding(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1RoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ClusterRole * @param name name of the ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteClusterRole(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteClusterRoleBinding(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionClusterRole(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionClusterRoleBinding(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedRole(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedRoleBinding(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedRole(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedRoleBinding(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listClusterRole(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listClusterRoleBinding(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedRole(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedRoleBinding(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RoleBinding * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRoleBindingForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Role * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRoleForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/roles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterRole(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterRoleBinding(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ClusterRole * @param name name of the ClusterRole * @param pretty If \'true\', then the output is pretty printed. */ readClusterRole(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. */ readClusterRoleBinding(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedRole(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedRoleBinding(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterRole(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1ClusterRole") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterRoleBinding(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1ClusterRoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1Role") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1RoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.RbacAuthorizationV1alpha1Api = RbacAuthorizationV1alpha1Api; //# sourceMappingURL=rbacAuthorizationV1alpha1Api.js.map /***/ }), /***/ 81543: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RbacAuthorizationV1beta1Api = exports.RbacAuthorizationV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var RbacAuthorizationV1beta1ApiApiKeys; (function (RbacAuthorizationV1beta1ApiApiKeys) { RbacAuthorizationV1beta1ApiApiKeys[RbacAuthorizationV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(RbacAuthorizationV1beta1ApiApiKeys = exports.RbacAuthorizationV1beta1ApiApiKeys || (exports.RbacAuthorizationV1beta1ApiApiKeys = {})); class RbacAuthorizationV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[RbacAuthorizationV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createClusterRole(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1ClusterRole") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createClusterRoleBinding(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1ClusterRoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedRole(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1Role") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createNamespacedRoleBinding(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1RoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ClusterRole * @param name name of the ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteClusterRole(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteClusterRoleBinding(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionClusterRole(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionClusterRoleBinding(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedRole(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionNamespacedRoleBinding(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedRole(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteNamespacedRoleBinding(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ClusterRole * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listClusterRole(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listClusterRoleBinding(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedRole(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listNamespacedRoleBinding(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings' .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind RoleBinding * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRoleBindingForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/rolebindings'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RoleBindingList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind Role * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param pretty If \'true\', then the output is pretty printed. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listRoleForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/roles'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RoleList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterRole(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchClusterRoleBinding(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ClusterRole * @param name name of the ClusterRole * @param pretty If \'true\', then the output is pretty printed. */ readClusterRole(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param pretty If \'true\', then the output is pretty printed. */ readClusterRoleBinding(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedRole(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param pretty If \'true\', then the output is pretty printed. */ readNamespacedRoleBinding(name, namespace, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ClusterRole * @param name name of the ClusterRole * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterRole(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1ClusterRole") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRole"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified ClusterRoleBinding * @param name name of the ClusterRoleBinding * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceClusterRoleBinding(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1ClusterRoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1ClusterRoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified Role * @param name name of the Role * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1Role") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1Role"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified RoleBinding * @param name name of the RoleBinding * @param namespace object name and auth scope, such as for teams and projects * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))) .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'namespace' is not null or undefined if (namespace === null || namespace === undefined) { throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1RoleBinding") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1RoleBinding"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.RbacAuthorizationV1beta1Api = RbacAuthorizationV1beta1Api; //# sourceMappingURL=rbacAuthorizationV1beta1Api.js.map /***/ }), /***/ 29389: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SchedulingApi = exports.SchedulingApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var SchedulingApiApiKeys; (function (SchedulingApiApiKeys) { SchedulingApiApiKeys[SchedulingApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SchedulingApiApiKeys = exports.SchedulingApiApiKeys || (exports.SchedulingApiApiKeys = {})); class SchedulingApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SchedulingApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.SchedulingApi = SchedulingApi; //# sourceMappingURL=schedulingApi.js.map /***/ }), /***/ 26757: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SchedulingV1Api = exports.SchedulingV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var SchedulingV1ApiApiKeys; (function (SchedulingV1ApiApiKeys) { SchedulingV1ApiApiKeys[SchedulingV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SchedulingV1ApiApiKeys = exports.SchedulingV1ApiApiKeys || (exports.SchedulingV1ApiApiKeys = {})); class SchedulingV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SchedulingV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createPriorityClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PriorityClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionPriorityClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PriorityClass * @param name name of the PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deletePriorityClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPriorityClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PriorityClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPriorityClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PriorityClass * @param name name of the PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readPriorityClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePriorityClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1PriorityClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.SchedulingV1Api = SchedulingV1Api; //# sourceMappingURL=schedulingV1Api.js.map /***/ }), /***/ 91655: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SchedulingV1alpha1Api = exports.SchedulingV1alpha1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var SchedulingV1alpha1ApiApiKeys; (function (SchedulingV1alpha1ApiApiKeys) { SchedulingV1alpha1ApiApiKeys[SchedulingV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SchedulingV1alpha1ApiApiKeys = exports.SchedulingV1alpha1ApiApiKeys || (exports.SchedulingV1alpha1ApiApiKeys = {})); class SchedulingV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SchedulingV1alpha1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createPriorityClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1PriorityClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionPriorityClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PriorityClass * @param name name of the PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deletePriorityClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPriorityClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPriorityClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PriorityClass * @param name name of the PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readPriorityClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePriorityClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1PriorityClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.SchedulingV1alpha1Api = SchedulingV1alpha1Api; //# sourceMappingURL=schedulingV1alpha1Api.js.map /***/ }), /***/ 49324: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SchedulingV1beta1Api = exports.SchedulingV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var SchedulingV1beta1ApiApiKeys; (function (SchedulingV1beta1ApiApiKeys) { SchedulingV1beta1ApiApiKeys[SchedulingV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(SchedulingV1beta1ApiApiKeys = exports.SchedulingV1beta1ApiApiKeys || (exports.SchedulingV1beta1ApiApiKeys = {})); class SchedulingV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[SchedulingV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createPriorityClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PriorityClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionPriorityClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a PriorityClass * @param name name of the PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deletePriorityClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listPriorityClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchPriorityClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified PriorityClass * @param name name of the PriorityClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readPriorityClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readPriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified PriorityClass * @param name name of the PriorityClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replacePriorityClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1PriorityClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1PriorityClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.SchedulingV1beta1Api = SchedulingV1beta1Api; //# sourceMappingURL=schedulingV1beta1Api.js.map /***/ }), /***/ 91143: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StorageApi = exports.StorageApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var StorageApiApiKeys; (function (StorageApiApiKeys) { StorageApiApiKeys[StorageApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(StorageApiApiKeys = exports.StorageApiApiKeys || (exports.StorageApiApiKeys = {})); class StorageApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[StorageApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get information of a group */ getAPIGroup(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIGroup"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.StorageApi = StorageApi; //# sourceMappingURL=storageApi.js.map /***/ }), /***/ 922: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StorageV1Api = exports.StorageV1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var StorageV1ApiApiKeys; (function (StorageV1ApiApiKeys) { StorageV1ApiApiKeys[StorageV1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(StorageV1ApiApiKeys = exports.StorageV1ApiApiKeys || (exports.StorageV1ApiApiKeys = {})); class StorageV1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[StorageV1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a CSIDriver * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createCSIDriver(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CSIDriver") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a CSINode * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createCSINode(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CSINode") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a StorageClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createStorageClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1StorageClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createVolumeAttachment(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1VolumeAttachment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CSIDriver * @param name name of the CSIDriver * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteCSIDriver(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CSINode * @param name name of the CSINode * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteCSINode(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CSIDriver * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionCSIDriver(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CSINode * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionCSINode(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of StorageClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionStorageClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionVolumeAttachment(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a StorageClass * @param name name of the StorageClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteStorageClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteVolumeAttachment(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CSIDriver * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCSIDriver(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSIDriverList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CSINode * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCSINode(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSINodeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind StorageClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listStorageClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StorageClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listVolumeAttachment(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachmentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CSIDriver * @param name name of the CSIDriver * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCSIDriver(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCSIDriver.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CSINode * @param name name of the CSINode * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCSINode(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCSINode.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified StorageClass * @param name name of the StorageClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchStorageClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchStorageClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchVolumeAttachment(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update status of the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchVolumeAttachmentStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachmentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachmentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CSIDriver * @param name name of the CSIDriver * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readCSIDriver(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CSINode * @param name name of the CSINode * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readCSINode(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified StorageClass * @param name name of the StorageClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readStorageClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readVolumeAttachment(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read status of the specified VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. */ readVolumeAttachmentStatus(name, pretty, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readVolumeAttachmentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CSIDriver * @param name name of the CSIDriver * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCSIDriver(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCSIDriver.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CSIDriver") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CSINode * @param name name of the CSINode * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCSINode(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCSINode.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1CSINode") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified StorageClass * @param name name of the StorageClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceStorageClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceStorageClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1StorageClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceVolumeAttachment(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1VolumeAttachment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace status of the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceVolumeAttachmentStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachmentStatus.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachmentStatus.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1VolumeAttachment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.StorageV1Api = StorageV1Api; //# sourceMappingURL=storageV1Api.js.map /***/ }), /***/ 30769: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StorageV1alpha1Api = exports.StorageV1alpha1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var StorageV1alpha1ApiApiKeys; (function (StorageV1alpha1ApiApiKeys) { StorageV1alpha1ApiApiKeys[StorageV1alpha1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(StorageV1alpha1ApiApiKeys = exports.StorageV1alpha1ApiApiKeys || (exports.StorageV1alpha1ApiApiKeys = {})); class StorageV1alpha1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[StorageV1alpha1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createVolumeAttachment(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1VolumeAttachment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionVolumeAttachment(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteVolumeAttachment(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listVolumeAttachment(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachmentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchVolumeAttachment(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readVolumeAttachment(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceVolumeAttachment(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1alpha1VolumeAttachment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1alpha1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.StorageV1alpha1Api = StorageV1alpha1Api; //# sourceMappingURL=storageV1alpha1Api.js.map /***/ }), /***/ 15325: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StorageV1beta1Api = exports.StorageV1beta1ApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var StorageV1beta1ApiApiKeys; (function (StorageV1beta1ApiApiKeys) { StorageV1beta1ApiApiKeys[StorageV1beta1ApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(StorageV1beta1ApiApiKeys = exports.StorageV1beta1ApiApiKeys || (exports.StorageV1beta1ApiApiKeys = {})); class StorageV1beta1Api { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[StorageV1beta1ApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * create a CSIDriver * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createCSIDriver(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csidrivers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CSIDriver") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a CSINode * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createCSINode(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csinodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CSINode") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a StorageClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createStorageClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1StorageClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * create a VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ createVolumeAttachment(body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1VolumeAttachment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CSIDriver * @param name name of the CSIDriver * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteCSIDriver(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csidrivers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a CSINode * @param name name of the CSINode * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteCSINode(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csinodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CSIDriver * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionCSIDriver(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csidrivers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of CSINode * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionCSINode(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csinodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of StorageClass * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionStorageClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete collection of VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param body */ deleteCollectionVolumeAttachment(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1Status"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a StorageClass * @param name name of the StorageClass * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteStorageClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * delete a VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents in the foreground. * @param body */ deleteVolumeAttachment(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, "number"); } if (orphanDependents !== undefined) { localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, "boolean"); } if (propagationPolicy !== undefined) { localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1DeleteOptions") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * get available resources */ getAPIResources(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1APIResourceList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CSIDriver * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCSIDriver(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csidrivers'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSIDriverList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind CSINode * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listCSINode(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csinodes'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSINodeList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind StorageClass * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listStorageClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1StorageClassList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * list or watch objects of kind VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything. * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything. * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. */ listVolumeAttachment(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (allowWatchBookmarks !== undefined) { localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, "boolean"); } if (_continue !== undefined) { localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, "string"); } if (fieldSelector !== undefined) { localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, "string"); } if (labelSelector !== undefined) { localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, "string"); } if (limit !== undefined) { localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, "number"); } if (resourceVersion !== undefined) { localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, "string"); } if (resourceVersionMatch !== undefined) { localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, "string"); } if (timeoutSeconds !== undefined) { localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, "number"); } if (watch !== undefined) { localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1VolumeAttachmentList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CSIDriver * @param name name of the CSIDriver * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCSIDriver(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csidrivers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCSIDriver.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified CSINode * @param name name of the CSINode * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchCSINode(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csinodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchCSINode.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified StorageClass * @param name name of the StorageClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchStorageClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchStorageClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * partially update the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ patchVolumeAttachment(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } if (force !== undefined) { localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "object") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CSIDriver * @param name name of the CSIDriver * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readCSIDriver(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csidrivers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified CSINode * @param name name of the CSINode * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readCSINode(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csinodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified StorageClass * @param name name of the StorageClass * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readStorageClass(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * read the specified VolumeAttachment * @param name name of the VolumeAttachment * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param _export Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18. */ readVolumeAttachment(name, pretty, exact, _export, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (exact !== undefined) { localVarQueryParameters['exact'] = models_1.ObjectSerializer.serialize(exact, "boolean"); } if (_export !== undefined) { localVarQueryParameters['export'] = models_1.ObjectSerializer.serialize(_export, "boolean"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CSIDriver * @param name name of the CSIDriver * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCSIDriver(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csidrivers/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCSIDriver.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCSIDriver.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CSIDriver") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSIDriver"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified CSINode * @param name name of the CSINode * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceCSINode(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csinodes/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceCSINode.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceCSINode.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1CSINode") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1CSINode"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified StorageClass * @param name name of the StorageClass * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceStorageClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/storageclasses/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceStorageClass.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceStorageClass.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1StorageClass") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1StorageClass"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } /** * replace the specified VolumeAttachment * @param name name of the VolumeAttachment * @param body * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. */ replaceVolumeAttachment(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/volumeattachments/{name}' .replace('{' + 'name' + '}', encodeURIComponent(String(name))); let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; // verify required parameter 'name' is not null or undefined if (name === null || name === undefined) { throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.'); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.'); } if (pretty !== undefined) { localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, "string"); } if (dryRun !== undefined) { localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, "string"); } if (fieldManager !== undefined) { localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, "string"); } Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: models_1.ObjectSerializer.serialize(body, "V1beta1VolumeAttachment") }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "V1beta1VolumeAttachment"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.StorageV1beta1Api = StorageV1beta1Api; //# sourceMappingURL=storageV1beta1Api.js.map /***/ }), /***/ 4441: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VersionApi = exports.VersionApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var VersionApiApiKeys; (function (VersionApiApiKeys) { VersionApiApiKeys[VersionApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(VersionApiApiKeys = exports.VersionApiApiKeys || (exports.VersionApiApiKeys = {})); class VersionApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[VersionApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get the code version */ getCode(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/version/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "VersionInfo"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.VersionApi = VersionApi; //# sourceMappingURL=versionApi.js.map /***/ }), /***/ 19868: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.WellKnownApi = exports.WellKnownApiApiKeys = void 0; const tslib_1 = __webpack_require__(75636); const localVarRequest = __webpack_require__(48699); /* tslint:disable:no-unused-locals */ const models_1 = __webpack_require__(15158); const models_2 = __webpack_require__(15158); const apis_1 = __webpack_require__(25997); let defaultBasePath = 'http://localhost'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== var WellKnownApiApiKeys; (function (WellKnownApiApiKeys) { WellKnownApiApiKeys[WellKnownApiApiKeys["BearerToken"] = 0] = "BearerToken"; })(WellKnownApiApiKeys = exports.WellKnownApiApiKeys || (exports.WellKnownApiApiKeys = {})); class WellKnownApi { constructor(basePathOrUsername, password, basePath) { this._basePath = defaultBasePath; this._defaultHeaders = {}; this._useQuerystring = false; this.authentications = { 'default': new models_1.VoidAuth(), 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'), }; this.interceptors = []; if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername; } } } set useQuerystring(value) { this._useQuerystring = value; } set basePath(basePath) { this._basePath = basePath; } set defaultHeaders(defaultHeaders) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } setDefaultAuthentication(auth) { this.authentications.default = auth; } setApiKey(key, value) { this.authentications[WellKnownApiApiKeys[key]].apiKey = value; } addInterceptor(interceptor) { this.interceptors.push(interceptor); } /** * get service account issuer OpenID configuration, also known as the \'OIDC discovery doc\' */ getServiceAccountIssuerOpenIDConfiguration(options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const localVarPath = this.basePath + '/.well-known/openid-configuration/'; let localVarQueryParameters = {}; let localVarHeaderParams = Object.assign({}, this._defaultHeaders); const produces = ['application/json']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams = {}; Object.assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { localVarRequestOptions.formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = models_1.ObjectSerializer.deserialize(body, "string"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new apis_1.HttpError(response, body, response.statusCode)); } } }); }); }); }); } } exports.WellKnownApi = WellKnownApi; //# sourceMappingURL=wellKnownApi.js.map /***/ }), /***/ 21616: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AdmissionregistrationV1ServiceReference = void 0; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class AdmissionregistrationV1ServiceReference { static getAttributeTypeMap() { return AdmissionregistrationV1ServiceReference.attributeTypeMap; } } exports.AdmissionregistrationV1ServiceReference = AdmissionregistrationV1ServiceReference; AdmissionregistrationV1ServiceReference.discriminator = undefined; AdmissionregistrationV1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" } ]; //# sourceMappingURL=admissionregistrationV1ServiceReference.js.map /***/ }), /***/ 7818: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AdmissionregistrationV1WebhookClientConfig = void 0; /** * WebhookClientConfig contains the information to make a TLS connection with the webhook */ class AdmissionregistrationV1WebhookClientConfig { static getAttributeTypeMap() { return AdmissionregistrationV1WebhookClientConfig.attributeTypeMap; } } exports.AdmissionregistrationV1WebhookClientConfig = AdmissionregistrationV1WebhookClientConfig; AdmissionregistrationV1WebhookClientConfig.discriminator = undefined; AdmissionregistrationV1WebhookClientConfig.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "service", "baseName": "service", "type": "AdmissionregistrationV1ServiceReference" }, { "name": "url", "baseName": "url", "type": "string" } ]; //# sourceMappingURL=admissionregistrationV1WebhookClientConfig.js.map /***/ }), /***/ 96408: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AdmissionregistrationV1beta1ServiceReference = void 0; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class AdmissionregistrationV1beta1ServiceReference { static getAttributeTypeMap() { return AdmissionregistrationV1beta1ServiceReference.attributeTypeMap; } } exports.AdmissionregistrationV1beta1ServiceReference = AdmissionregistrationV1beta1ServiceReference; AdmissionregistrationV1beta1ServiceReference.discriminator = undefined; AdmissionregistrationV1beta1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" } ]; //# sourceMappingURL=admissionregistrationV1beta1ServiceReference.js.map /***/ }), /***/ 90959: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AdmissionregistrationV1beta1WebhookClientConfig = void 0; /** * WebhookClientConfig contains the information to make a TLS connection with the webhook */ class AdmissionregistrationV1beta1WebhookClientConfig { static getAttributeTypeMap() { return AdmissionregistrationV1beta1WebhookClientConfig.attributeTypeMap; } } exports.AdmissionregistrationV1beta1WebhookClientConfig = AdmissionregistrationV1beta1WebhookClientConfig; AdmissionregistrationV1beta1WebhookClientConfig.discriminator = undefined; AdmissionregistrationV1beta1WebhookClientConfig.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "service", "baseName": "service", "type": "AdmissionregistrationV1beta1ServiceReference" }, { "name": "url", "baseName": "url", "type": "string" } ]; //# sourceMappingURL=admissionregistrationV1beta1WebhookClientConfig.js.map /***/ }), /***/ 63536: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiextensionsV1ServiceReference = void 0; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class ApiextensionsV1ServiceReference { static getAttributeTypeMap() { return ApiextensionsV1ServiceReference.attributeTypeMap; } } exports.ApiextensionsV1ServiceReference = ApiextensionsV1ServiceReference; ApiextensionsV1ServiceReference.discriminator = undefined; ApiextensionsV1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" } ]; //# sourceMappingURL=apiextensionsV1ServiceReference.js.map /***/ }), /***/ 22775: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiextensionsV1WebhookClientConfig = void 0; /** * WebhookClientConfig contains the information to make a TLS connection with the webhook. */ class ApiextensionsV1WebhookClientConfig { static getAttributeTypeMap() { return ApiextensionsV1WebhookClientConfig.attributeTypeMap; } } exports.ApiextensionsV1WebhookClientConfig = ApiextensionsV1WebhookClientConfig; ApiextensionsV1WebhookClientConfig.discriminator = undefined; ApiextensionsV1WebhookClientConfig.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "service", "baseName": "service", "type": "ApiextensionsV1ServiceReference" }, { "name": "url", "baseName": "url", "type": "string" } ]; //# sourceMappingURL=apiextensionsV1WebhookClientConfig.js.map /***/ }), /***/ 7588: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiextensionsV1beta1ServiceReference = void 0; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class ApiextensionsV1beta1ServiceReference { static getAttributeTypeMap() { return ApiextensionsV1beta1ServiceReference.attributeTypeMap; } } exports.ApiextensionsV1beta1ServiceReference = ApiextensionsV1beta1ServiceReference; ApiextensionsV1beta1ServiceReference.discriminator = undefined; ApiextensionsV1beta1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" } ]; //# sourceMappingURL=apiextensionsV1beta1ServiceReference.js.map /***/ }), /***/ 96116: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiextensionsV1beta1WebhookClientConfig = void 0; /** * WebhookClientConfig contains the information to make a TLS connection with the webhook. */ class ApiextensionsV1beta1WebhookClientConfig { static getAttributeTypeMap() { return ApiextensionsV1beta1WebhookClientConfig.attributeTypeMap; } } exports.ApiextensionsV1beta1WebhookClientConfig = ApiextensionsV1beta1WebhookClientConfig; ApiextensionsV1beta1WebhookClientConfig.discriminator = undefined; ApiextensionsV1beta1WebhookClientConfig.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "service", "baseName": "service", "type": "ApiextensionsV1beta1ServiceReference" }, { "name": "url", "baseName": "url", "type": "string" } ]; //# sourceMappingURL=apiextensionsV1beta1WebhookClientConfig.js.map /***/ }), /***/ 37492: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiregistrationV1ServiceReference = void 0; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class ApiregistrationV1ServiceReference { static getAttributeTypeMap() { return ApiregistrationV1ServiceReference.attributeTypeMap; } } exports.ApiregistrationV1ServiceReference = ApiregistrationV1ServiceReference; ApiregistrationV1ServiceReference.discriminator = undefined; ApiregistrationV1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" } ]; //# sourceMappingURL=apiregistrationV1ServiceReference.js.map /***/ }), /***/ 67098: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApiregistrationV1beta1ServiceReference = void 0; /** * ServiceReference holds a reference to Service.legacy.k8s.io */ class ApiregistrationV1beta1ServiceReference { static getAttributeTypeMap() { return ApiregistrationV1beta1ServiceReference.attributeTypeMap; } } exports.ApiregistrationV1beta1ServiceReference = ApiregistrationV1beta1ServiceReference; ApiregistrationV1beta1ServiceReference.discriminator = undefined; ApiregistrationV1beta1ServiceReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" } ]; //# sourceMappingURL=apiregistrationV1beta1ServiceReference.js.map /***/ }), /***/ 25429: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AuthenticationV1TokenRequest = void 0; /** * TokenRequest requests a token for a given service account. */ class AuthenticationV1TokenRequest { static getAttributeTypeMap() { return AuthenticationV1TokenRequest.attributeTypeMap; } } exports.AuthenticationV1TokenRequest = AuthenticationV1TokenRequest; AuthenticationV1TokenRequest.discriminator = undefined; AuthenticationV1TokenRequest.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1TokenRequestSpec" }, { "name": "status", "baseName": "status", "type": "V1TokenRequestStatus" } ]; //# sourceMappingURL=authenticationV1TokenRequest.js.map /***/ }), /***/ 42735: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CoreV1Event = void 0; /** * Event is a report of an event somewhere in the cluster. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data. */ class CoreV1Event { static getAttributeTypeMap() { return CoreV1Event.attributeTypeMap; } } exports.CoreV1Event = CoreV1Event; CoreV1Event.discriminator = undefined; CoreV1Event.attributeTypeMap = [ { "name": "action", "baseName": "action", "type": "string" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "count", "baseName": "count", "type": "number" }, { "name": "eventTime", "baseName": "eventTime", "type": "Date" }, { "name": "firstTimestamp", "baseName": "firstTimestamp", "type": "Date" }, { "name": "involvedObject", "baseName": "involvedObject", "type": "V1ObjectReference" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "lastTimestamp", "baseName": "lastTimestamp", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "related", "baseName": "related", "type": "V1ObjectReference" }, { "name": "reportingComponent", "baseName": "reportingComponent", "type": "string" }, { "name": "reportingInstance", "baseName": "reportingInstance", "type": "string" }, { "name": "series", "baseName": "series", "type": "CoreV1EventSeries" }, { "name": "source", "baseName": "source", "type": "V1EventSource" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=coreV1Event.js.map /***/ }), /***/ 12368: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CoreV1EventList = void 0; /** * EventList is a list of events. */ class CoreV1EventList { static getAttributeTypeMap() { return CoreV1EventList.attributeTypeMap; } } exports.CoreV1EventList = CoreV1EventList; CoreV1EventList.discriminator = undefined; CoreV1EventList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=coreV1EventList.js.map /***/ }), /***/ 70438: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CoreV1EventSeries = void 0; /** * EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time. */ class CoreV1EventSeries { static getAttributeTypeMap() { return CoreV1EventSeries.attributeTypeMap; } } exports.CoreV1EventSeries = CoreV1EventSeries; CoreV1EventSeries.discriminator = undefined; CoreV1EventSeries.attributeTypeMap = [ { "name": "count", "baseName": "count", "type": "number" }, { "name": "lastObservedTime", "baseName": "lastObservedTime", "type": "Date" } ]; //# sourceMappingURL=coreV1EventSeries.js.map /***/ }), /***/ 52191: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventsV1Event = void 0; /** * Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data. */ class EventsV1Event { static getAttributeTypeMap() { return EventsV1Event.attributeTypeMap; } } exports.EventsV1Event = EventsV1Event; EventsV1Event.discriminator = undefined; EventsV1Event.attributeTypeMap = [ { "name": "action", "baseName": "action", "type": "string" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "deprecatedCount", "baseName": "deprecatedCount", "type": "number" }, { "name": "deprecatedFirstTimestamp", "baseName": "deprecatedFirstTimestamp", "type": "Date" }, { "name": "deprecatedLastTimestamp", "baseName": "deprecatedLastTimestamp", "type": "Date" }, { "name": "deprecatedSource", "baseName": "deprecatedSource", "type": "V1EventSource" }, { "name": "eventTime", "baseName": "eventTime", "type": "Date" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "note", "baseName": "note", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "regarding", "baseName": "regarding", "type": "V1ObjectReference" }, { "name": "related", "baseName": "related", "type": "V1ObjectReference" }, { "name": "reportingController", "baseName": "reportingController", "type": "string" }, { "name": "reportingInstance", "baseName": "reportingInstance", "type": "string" }, { "name": "series", "baseName": "series", "type": "EventsV1EventSeries" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=eventsV1Event.js.map /***/ }), /***/ 1051: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventsV1EventList = void 0; /** * EventList is a list of Event objects. */ class EventsV1EventList { static getAttributeTypeMap() { return EventsV1EventList.attributeTypeMap; } } exports.EventsV1EventList = EventsV1EventList; EventsV1EventList.discriminator = undefined; EventsV1EventList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=eventsV1EventList.js.map /***/ }), /***/ 6933: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventsV1EventSeries = void 0; /** * EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time. How often to update the EventSeries is up to the event reporters. The default event reporter in \"k8s.io/client-go/tools/events/event_broadcaster.go\" shows how this struct is updated on heartbeats and can guide customized reporter implementations. */ class EventsV1EventSeries { static getAttributeTypeMap() { return EventsV1EventSeries.attributeTypeMap; } } exports.EventsV1EventSeries = EventsV1EventSeries; EventsV1EventSeries.discriminator = undefined; EventsV1EventSeries.attributeTypeMap = [ { "name": "count", "baseName": "count", "type": "number" }, { "name": "lastObservedTime", "baseName": "lastObservedTime", "type": "Date" } ]; //# sourceMappingURL=eventsV1EventSeries.js.map /***/ }), /***/ 73491: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1HTTPIngressPath = void 0; /** * HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend. */ class ExtensionsV1beta1HTTPIngressPath { static getAttributeTypeMap() { return ExtensionsV1beta1HTTPIngressPath.attributeTypeMap; } } exports.ExtensionsV1beta1HTTPIngressPath = ExtensionsV1beta1HTTPIngressPath; ExtensionsV1beta1HTTPIngressPath.discriminator = undefined; ExtensionsV1beta1HTTPIngressPath.attributeTypeMap = [ { "name": "backend", "baseName": "backend", "type": "ExtensionsV1beta1IngressBackend" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "pathType", "baseName": "pathType", "type": "string" } ]; //# sourceMappingURL=extensionsV1beta1HTTPIngressPath.js.map /***/ }), /***/ 77652: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1HTTPIngressRuleValue = void 0; /** * HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last \'/\' and before the first \'?\' or \'#\'. */ class ExtensionsV1beta1HTTPIngressRuleValue { static getAttributeTypeMap() { return ExtensionsV1beta1HTTPIngressRuleValue.attributeTypeMap; } } exports.ExtensionsV1beta1HTTPIngressRuleValue = ExtensionsV1beta1HTTPIngressRuleValue; ExtensionsV1beta1HTTPIngressRuleValue.discriminator = undefined; ExtensionsV1beta1HTTPIngressRuleValue.attributeTypeMap = [ { "name": "paths", "baseName": "paths", "type": "Array" } ]; //# sourceMappingURL=extensionsV1beta1HTTPIngressRuleValue.js.map /***/ }), /***/ 30621: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1Ingress = void 0; /** * 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. DEPRECATED - This group version of Ingress is deprecated by networking.k8s.io/v1beta1 Ingress. See the release notes for more information. */ class ExtensionsV1beta1Ingress { static getAttributeTypeMap() { return ExtensionsV1beta1Ingress.attributeTypeMap; } } exports.ExtensionsV1beta1Ingress = ExtensionsV1beta1Ingress; ExtensionsV1beta1Ingress.discriminator = undefined; ExtensionsV1beta1Ingress.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "ExtensionsV1beta1IngressSpec" }, { "name": "status", "baseName": "status", "type": "ExtensionsV1beta1IngressStatus" } ]; //# sourceMappingURL=extensionsV1beta1Ingress.js.map /***/ }), /***/ 29393: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1IngressBackend = void 0; /** * IngressBackend describes all endpoints for a given service and port. */ class ExtensionsV1beta1IngressBackend { static getAttributeTypeMap() { return ExtensionsV1beta1IngressBackend.attributeTypeMap; } } exports.ExtensionsV1beta1IngressBackend = ExtensionsV1beta1IngressBackend; ExtensionsV1beta1IngressBackend.discriminator = undefined; ExtensionsV1beta1IngressBackend.attributeTypeMap = [ { "name": "resource", "baseName": "resource", "type": "V1TypedLocalObjectReference" }, { "name": "serviceName", "baseName": "serviceName", "type": "string" }, { "name": "servicePort", "baseName": "servicePort", "type": "object" } ]; //# sourceMappingURL=extensionsV1beta1IngressBackend.js.map /***/ }), /***/ 67169: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1IngressList = void 0; /** * IngressList is a collection of Ingress. */ class ExtensionsV1beta1IngressList { static getAttributeTypeMap() { return ExtensionsV1beta1IngressList.attributeTypeMap; } } exports.ExtensionsV1beta1IngressList = ExtensionsV1beta1IngressList; ExtensionsV1beta1IngressList.discriminator = undefined; ExtensionsV1beta1IngressList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=extensionsV1beta1IngressList.js.map /***/ }), /***/ 98849: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1IngressRule = void 0; /** * IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue. */ class ExtensionsV1beta1IngressRule { static getAttributeTypeMap() { return ExtensionsV1beta1IngressRule.attributeTypeMap; } } exports.ExtensionsV1beta1IngressRule = ExtensionsV1beta1IngressRule; ExtensionsV1beta1IngressRule.discriminator = undefined; ExtensionsV1beta1IngressRule.attributeTypeMap = [ { "name": "host", "baseName": "host", "type": "string" }, { "name": "http", "baseName": "http", "type": "ExtensionsV1beta1HTTPIngressRuleValue" } ]; //# sourceMappingURL=extensionsV1beta1IngressRule.js.map /***/ }), /***/ 89144: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1IngressSpec = void 0; /** * IngressSpec describes the Ingress the user wishes to exist. */ class ExtensionsV1beta1IngressSpec { static getAttributeTypeMap() { return ExtensionsV1beta1IngressSpec.attributeTypeMap; } } exports.ExtensionsV1beta1IngressSpec = ExtensionsV1beta1IngressSpec; ExtensionsV1beta1IngressSpec.discriminator = undefined; ExtensionsV1beta1IngressSpec.attributeTypeMap = [ { "name": "backend", "baseName": "backend", "type": "ExtensionsV1beta1IngressBackend" }, { "name": "ingressClassName", "baseName": "ingressClassName", "type": "string" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "tls", "baseName": "tls", "type": "Array" } ]; //# sourceMappingURL=extensionsV1beta1IngressSpec.js.map /***/ }), /***/ 11652: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1IngressStatus = void 0; /** * IngressStatus describe the current state of the Ingress. */ class ExtensionsV1beta1IngressStatus { static getAttributeTypeMap() { return ExtensionsV1beta1IngressStatus.attributeTypeMap; } } exports.ExtensionsV1beta1IngressStatus = ExtensionsV1beta1IngressStatus; ExtensionsV1beta1IngressStatus.discriminator = undefined; ExtensionsV1beta1IngressStatus.attributeTypeMap = [ { "name": "loadBalancer", "baseName": "loadBalancer", "type": "V1LoadBalancerStatus" } ]; //# sourceMappingURL=extensionsV1beta1IngressStatus.js.map /***/ }), /***/ 30613: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExtensionsV1beta1IngressTLS = void 0; /** * IngressTLS describes the transport layer security associated with an Ingress. */ class ExtensionsV1beta1IngressTLS { static getAttributeTypeMap() { return ExtensionsV1beta1IngressTLS.attributeTypeMap; } } exports.ExtensionsV1beta1IngressTLS = ExtensionsV1beta1IngressTLS; ExtensionsV1beta1IngressTLS.discriminator = undefined; ExtensionsV1beta1IngressTLS.attributeTypeMap = [ { "name": "hosts", "baseName": "hosts", "type": "Array" }, { "name": "secretName", "baseName": "secretName", "type": "string" } ]; //# sourceMappingURL=extensionsV1beta1IngressTLS.js.map /***/ }), /***/ 43525: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FlowcontrolV1alpha1Subject = void 0; /** * Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account. */ class FlowcontrolV1alpha1Subject { static getAttributeTypeMap() { return FlowcontrolV1alpha1Subject.attributeTypeMap; } } exports.FlowcontrolV1alpha1Subject = FlowcontrolV1alpha1Subject; FlowcontrolV1alpha1Subject.discriminator = undefined; FlowcontrolV1alpha1Subject.attributeTypeMap = [ { "name": "group", "baseName": "group", "type": "V1alpha1GroupSubject" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "serviceAccount", "baseName": "serviceAccount", "type": "V1alpha1ServiceAccountSubject" }, { "name": "user", "baseName": "user", "type": "V1alpha1UserSubject" } ]; //# sourceMappingURL=flowcontrolV1alpha1Subject.js.map /***/ }), /***/ 88186: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FlowcontrolV1beta1Subject = void 0; /** * Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account. */ class FlowcontrolV1beta1Subject { static getAttributeTypeMap() { return FlowcontrolV1beta1Subject.attributeTypeMap; } } exports.FlowcontrolV1beta1Subject = FlowcontrolV1beta1Subject; FlowcontrolV1beta1Subject.discriminator = undefined; FlowcontrolV1beta1Subject.attributeTypeMap = [ { "name": "group", "baseName": "group", "type": "V1beta1GroupSubject" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "serviceAccount", "baseName": "serviceAccount", "type": "V1beta1ServiceAccountSubject" }, { "name": "user", "baseName": "user", "type": "V1beta1UserSubject" } ]; //# sourceMappingURL=flowcontrolV1beta1Subject.js.map /***/ }), /***/ 15158: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VoidAuth = exports.OAuth = exports.ApiKeyAuth = exports.HttpBearerAuth = exports.HttpBasicAuth = exports.ObjectSerializer = void 0; const tslib_1 = __webpack_require__(75636); tslib_1.__exportStar(__webpack_require__(21616), exports); tslib_1.__exportStar(__webpack_require__(7818), exports); tslib_1.__exportStar(__webpack_require__(96408), exports); tslib_1.__exportStar(__webpack_require__(90959), exports); tslib_1.__exportStar(__webpack_require__(63536), exports); tslib_1.__exportStar(__webpack_require__(22775), exports); tslib_1.__exportStar(__webpack_require__(7588), exports); tslib_1.__exportStar(__webpack_require__(96116), exports); tslib_1.__exportStar(__webpack_require__(37492), exports); tslib_1.__exportStar(__webpack_require__(67098), exports); tslib_1.__exportStar(__webpack_require__(25429), exports); tslib_1.__exportStar(__webpack_require__(42735), exports); tslib_1.__exportStar(__webpack_require__(12368), exports); tslib_1.__exportStar(__webpack_require__(70438), exports); tslib_1.__exportStar(__webpack_require__(52191), exports); tslib_1.__exportStar(__webpack_require__(1051), exports); tslib_1.__exportStar(__webpack_require__(6933), exports); tslib_1.__exportStar(__webpack_require__(73491), exports); tslib_1.__exportStar(__webpack_require__(77652), exports); tslib_1.__exportStar(__webpack_require__(30621), exports); tslib_1.__exportStar(__webpack_require__(29393), exports); tslib_1.__exportStar(__webpack_require__(67169), exports); tslib_1.__exportStar(__webpack_require__(98849), exports); tslib_1.__exportStar(__webpack_require__(89144), exports); tslib_1.__exportStar(__webpack_require__(11652), exports); tslib_1.__exportStar(__webpack_require__(30613), exports); tslib_1.__exportStar(__webpack_require__(43525), exports); tslib_1.__exportStar(__webpack_require__(88186), exports); tslib_1.__exportStar(__webpack_require__(27197), exports); tslib_1.__exportStar(__webpack_require__(41668), exports); tslib_1.__exportStar(__webpack_require__(64660), exports); tslib_1.__exportStar(__webpack_require__(36453), exports); tslib_1.__exportStar(__webpack_require__(95951), exports); tslib_1.__exportStar(__webpack_require__(4157), exports); tslib_1.__exportStar(__webpack_require__(61752), exports); tslib_1.__exportStar(__webpack_require__(50369), exports); tslib_1.__exportStar(__webpack_require__(13517), exports); tslib_1.__exportStar(__webpack_require__(19573), exports); tslib_1.__exportStar(__webpack_require__(99229), exports); tslib_1.__exportStar(__webpack_require__(25958), exports); tslib_1.__exportStar(__webpack_require__(44481), exports); tslib_1.__exportStar(__webpack_require__(52906), exports); tslib_1.__exportStar(__webpack_require__(89033), exports); tslib_1.__exportStar(__webpack_require__(5454), exports); tslib_1.__exportStar(__webpack_require__(99042), exports); tslib_1.__exportStar(__webpack_require__(58352), exports); tslib_1.__exportStar(__webpack_require__(87198), exports); tslib_1.__exportStar(__webpack_require__(61496), exports); tslib_1.__exportStar(__webpack_require__(17883), exports); tslib_1.__exportStar(__webpack_require__(93135), exports); tslib_1.__exportStar(__webpack_require__(39808), exports); tslib_1.__exportStar(__webpack_require__(61957), exports); tslib_1.__exportStar(__webpack_require__(90312), exports); tslib_1.__exportStar(__webpack_require__(97069), exports); tslib_1.__exportStar(__webpack_require__(91312), exports); tslib_1.__exportStar(__webpack_require__(23694), exports); tslib_1.__exportStar(__webpack_require__(95073), exports); tslib_1.__exportStar(__webpack_require__(48551), exports); tslib_1.__exportStar(__webpack_require__(68849), exports); tslib_1.__exportStar(__webpack_require__(34144), exports); tslib_1.__exportStar(__webpack_require__(84881), exports); tslib_1.__exportStar(__webpack_require__(11582), exports); tslib_1.__exportStar(__webpack_require__(74315), exports); tslib_1.__exportStar(__webpack_require__(90288), exports); tslib_1.__exportStar(__webpack_require__(31918), exports); tslib_1.__exportStar(__webpack_require__(93142), exports); tslib_1.__exportStar(__webpack_require__(98367), exports); tslib_1.__exportStar(__webpack_require__(87598), exports); tslib_1.__exportStar(__webpack_require__(82975), exports); tslib_1.__exportStar(__webpack_require__(14268), exports); tslib_1.__exportStar(__webpack_require__(84957), exports); tslib_1.__exportStar(__webpack_require__(99084), exports); tslib_1.__exportStar(__webpack_require__(92932), exports); tslib_1.__exportStar(__webpack_require__(31530), exports); tslib_1.__exportStar(__webpack_require__(37759), exports); tslib_1.__exportStar(__webpack_require__(38285), exports); tslib_1.__exportStar(__webpack_require__(41888), exports); tslib_1.__exportStar(__webpack_require__(19111), exports); tslib_1.__exportStar(__webpack_require__(33913), exports); tslib_1.__exportStar(__webpack_require__(61458), exports); tslib_1.__exportStar(__webpack_require__(32315), exports); tslib_1.__exportStar(__webpack_require__(21181), exports); tslib_1.__exportStar(__webpack_require__(95532), exports); tslib_1.__exportStar(__webpack_require__(30578), exports); tslib_1.__exportStar(__webpack_require__(2047), exports); tslib_1.__exportStar(__webpack_require__(38596), exports); tslib_1.__exportStar(__webpack_require__(34990), exports); tslib_1.__exportStar(__webpack_require__(42874), exports); tslib_1.__exportStar(__webpack_require__(99685), exports); tslib_1.__exportStar(__webpack_require__(62892), exports); tslib_1.__exportStar(__webpack_require__(80512), exports); tslib_1.__exportStar(__webpack_require__(56709), exports); tslib_1.__exportStar(__webpack_require__(50888), exports); tslib_1.__exportStar(__webpack_require__(59708), exports); tslib_1.__exportStar(__webpack_require__(52865), exports); tslib_1.__exportStar(__webpack_require__(13501), exports); tslib_1.__exportStar(__webpack_require__(50217), exports); tslib_1.__exportStar(__webpack_require__(83765), exports); tslib_1.__exportStar(__webpack_require__(89767), exports); tslib_1.__exportStar(__webpack_require__(27892), exports); tslib_1.__exportStar(__webpack_require__(19716), exports); tslib_1.__exportStar(__webpack_require__(35980), exports); tslib_1.__exportStar(__webpack_require__(78405), exports); tslib_1.__exportStar(__webpack_require__(66304), exports); tslib_1.__exportStar(__webpack_require__(34233), exports); tslib_1.__exportStar(__webpack_require__(94346), exports); tslib_1.__exportStar(__webpack_require__(9731), exports); tslib_1.__exportStar(__webpack_require__(40325), exports); tslib_1.__exportStar(__webpack_require__(32791), exports); tslib_1.__exportStar(__webpack_require__(10486), exports); tslib_1.__exportStar(__webpack_require__(69798), exports); tslib_1.__exportStar(__webpack_require__(20486), exports); tslib_1.__exportStar(__webpack_require__(25713), exports); tslib_1.__exportStar(__webpack_require__(82283), exports); tslib_1.__exportStar(__webpack_require__(98087), exports); tslib_1.__exportStar(__webpack_require__(94579), exports); tslib_1.__exportStar(__webpack_require__(25408), exports); tslib_1.__exportStar(__webpack_require__(37060), exports); tslib_1.__exportStar(__webpack_require__(32699), exports); tslib_1.__exportStar(__webpack_require__(77063), exports); tslib_1.__exportStar(__webpack_require__(173), exports); tslib_1.__exportStar(__webpack_require__(44560), exports); tslib_1.__exportStar(__webpack_require__(87510), exports); tslib_1.__exportStar(__webpack_require__(48451), exports); tslib_1.__exportStar(__webpack_require__(18029), exports); tslib_1.__exportStar(__webpack_require__(65310), exports); tslib_1.__exportStar(__webpack_require__(95602), exports); tslib_1.__exportStar(__webpack_require__(81364), exports); tslib_1.__exportStar(__webpack_require__(41298), exports); tslib_1.__exportStar(__webpack_require__(92684), exports); tslib_1.__exportStar(__webpack_require__(34981), exports); tslib_1.__exportStar(__webpack_require__(38099), exports); tslib_1.__exportStar(__webpack_require__(78901), exports); tslib_1.__exportStar(__webpack_require__(19493), exports); tslib_1.__exportStar(__webpack_require__(11672), exports); tslib_1.__exportStar(__webpack_require__(57151), exports); tslib_1.__exportStar(__webpack_require__(37917), exports); tslib_1.__exportStar(__webpack_require__(31925), exports); tslib_1.__exportStar(__webpack_require__(13449), exports); tslib_1.__exportStar(__webpack_require__(95223), exports); tslib_1.__exportStar(__webpack_require__(23074), exports); tslib_1.__exportStar(__webpack_require__(36874), exports); tslib_1.__exportStar(__webpack_require__(17205), exports); tslib_1.__exportStar(__webpack_require__(32671), exports); tslib_1.__exportStar(__webpack_require__(90017), exports); tslib_1.__exportStar(__webpack_require__(97764), exports); tslib_1.__exportStar(__webpack_require__(13313), exports); tslib_1.__exportStar(__webpack_require__(77213), exports); tslib_1.__exportStar(__webpack_require__(35093), exports); tslib_1.__exportStar(__webpack_require__(91874), exports); tslib_1.__exportStar(__webpack_require__(16690), exports); tslib_1.__exportStar(__webpack_require__(10414), exports); tslib_1.__exportStar(__webpack_require__(1016), exports); tslib_1.__exportStar(__webpack_require__(27584), exports); tslib_1.__exportStar(__webpack_require__(97617), exports); tslib_1.__exportStar(__webpack_require__(37426), exports); tslib_1.__exportStar(__webpack_require__(87855), exports); tslib_1.__exportStar(__webpack_require__(16636), exports); tslib_1.__exportStar(__webpack_require__(3437), exports); tslib_1.__exportStar(__webpack_require__(86769), exports); tslib_1.__exportStar(__webpack_require__(56219), exports); tslib_1.__exportStar(__webpack_require__(95179), exports); tslib_1.__exportStar(__webpack_require__(93652), exports); tslib_1.__exportStar(__webpack_require__(17024), exports); tslib_1.__exportStar(__webpack_require__(49823), exports); tslib_1.__exportStar(__webpack_require__(50910), exports); tslib_1.__exportStar(__webpack_require__(72796), exports); tslib_1.__exportStar(__webpack_require__(69225), exports); tslib_1.__exportStar(__webpack_require__(49202), exports); tslib_1.__exportStar(__webpack_require__(83570), exports); tslib_1.__exportStar(__webpack_require__(68021), exports); tslib_1.__exportStar(__webpack_require__(32492), exports); tslib_1.__exportStar(__webpack_require__(44340), exports); tslib_1.__exportStar(__webpack_require__(93865), exports); tslib_1.__exportStar(__webpack_require__(76125), exports); tslib_1.__exportStar(__webpack_require__(92069), exports); tslib_1.__exportStar(__webpack_require__(43693), exports); tslib_1.__exportStar(__webpack_require__(89541), exports); tslib_1.__exportStar(__webpack_require__(62476), exports); tslib_1.__exportStar(__webpack_require__(59689), exports); tslib_1.__exportStar(__webpack_require__(45830), exports); tslib_1.__exportStar(__webpack_require__(23037), exports); tslib_1.__exportStar(__webpack_require__(63580), exports); tslib_1.__exportStar(__webpack_require__(91260), exports); tslib_1.__exportStar(__webpack_require__(94069), exports); tslib_1.__exportStar(__webpack_require__(13366), exports); tslib_1.__exportStar(__webpack_require__(93114), exports); tslib_1.__exportStar(__webpack_require__(57345), exports); tslib_1.__exportStar(__webpack_require__(23549), exports); tslib_1.__exportStar(__webpack_require__(22567), exports); tslib_1.__exportStar(__webpack_require__(50993), exports); tslib_1.__exportStar(__webpack_require__(98844), exports); tslib_1.__exportStar(__webpack_require__(76838), exports); tslib_1.__exportStar(__webpack_require__(44603), exports); tslib_1.__exportStar(__webpack_require__(41500), exports); tslib_1.__exportStar(__webpack_require__(86280), exports); tslib_1.__exportStar(__webpack_require__(91128), exports); tslib_1.__exportStar(__webpack_require__(82578), exports); tslib_1.__exportStar(__webpack_require__(83039), exports); tslib_1.__exportStar(__webpack_require__(88593), exports); tslib_1.__exportStar(__webpack_require__(25667), exports); tslib_1.__exportStar(__webpack_require__(46630), exports); tslib_1.__exportStar(__webpack_require__(12229), exports); tslib_1.__exportStar(__webpack_require__(31674), exports); tslib_1.__exportStar(__webpack_require__(72729), exports); tslib_1.__exportStar(__webpack_require__(82187), exports); tslib_1.__exportStar(__webpack_require__(95354), exports); tslib_1.__exportStar(__webpack_require__(2006), exports); tslib_1.__exportStar(__webpack_require__(22665), exports); tslib_1.__exportStar(__webpack_require__(35432), exports); tslib_1.__exportStar(__webpack_require__(95469), exports); tslib_1.__exportStar(__webpack_require__(314), exports); tslib_1.__exportStar(__webpack_require__(22366), exports); tslib_1.__exportStar(__webpack_require__(49076), exports); tslib_1.__exportStar(__webpack_require__(8833), exports); tslib_1.__exportStar(__webpack_require__(47995), exports); tslib_1.__exportStar(__webpack_require__(60886), exports); tslib_1.__exportStar(__webpack_require__(89952), exports); tslib_1.__exportStar(__webpack_require__(74436), exports); tslib_1.__exportStar(__webpack_require__(22173), exports); tslib_1.__exportStar(__webpack_require__(71056), exports); tslib_1.__exportStar(__webpack_require__(63061), exports); tslib_1.__exportStar(__webpack_require__(3667), exports); tslib_1.__exportStar(__webpack_require__(84893), exports); tslib_1.__exportStar(__webpack_require__(10627), exports); tslib_1.__exportStar(__webpack_require__(11740), exports); tslib_1.__exportStar(__webpack_require__(4272), exports); tslib_1.__exportStar(__webpack_require__(10912), exports); tslib_1.__exportStar(__webpack_require__(24894), exports); tslib_1.__exportStar(__webpack_require__(42762), exports); tslib_1.__exportStar(__webpack_require__(32293), exports); tslib_1.__exportStar(__webpack_require__(85161), exports); tslib_1.__exportStar(__webpack_require__(51128), exports); tslib_1.__exportStar(__webpack_require__(41752), exports); tslib_1.__exportStar(__webpack_require__(21656), exports); tslib_1.__exportStar(__webpack_require__(33645), exports); tslib_1.__exportStar(__webpack_require__(70019), exports); tslib_1.__exportStar(__webpack_require__(99191), exports); tslib_1.__exportStar(__webpack_require__(86171), exports); tslib_1.__exportStar(__webpack_require__(44696), exports); tslib_1.__exportStar(__webpack_require__(19051), exports); tslib_1.__exportStar(__webpack_require__(90114), exports); tslib_1.__exportStar(__webpack_require__(7924), exports); tslib_1.__exportStar(__webpack_require__(25570), exports); tslib_1.__exportStar(__webpack_require__(89974), exports); tslib_1.__exportStar(__webpack_require__(32966), exports); tslib_1.__exportStar(__webpack_require__(78594), exports); tslib_1.__exportStar(__webpack_require__(99911), exports); tslib_1.__exportStar(__webpack_require__(42951), exports); tslib_1.__exportStar(__webpack_require__(92114), exports); tslib_1.__exportStar(__webpack_require__(69811), exports); tslib_1.__exportStar(__webpack_require__(86312), exports); tslib_1.__exportStar(__webpack_require__(86628), exports); tslib_1.__exportStar(__webpack_require__(19839), exports); tslib_1.__exportStar(__webpack_require__(51817), exports); tslib_1.__exportStar(__webpack_require__(99975), exports); tslib_1.__exportStar(__webpack_require__(509), exports); tslib_1.__exportStar(__webpack_require__(65970), exports); tslib_1.__exportStar(__webpack_require__(19574), exports); tslib_1.__exportStar(__webpack_require__(78045), exports); tslib_1.__exportStar(__webpack_require__(67831), exports); tslib_1.__exportStar(__webpack_require__(74548), exports); tslib_1.__exportStar(__webpack_require__(76774), exports); tslib_1.__exportStar(__webpack_require__(71948), exports); tslib_1.__exportStar(__webpack_require__(84135), exports); tslib_1.__exportStar(__webpack_require__(79850), exports); tslib_1.__exportStar(__webpack_require__(58881), exports); tslib_1.__exportStar(__webpack_require__(42892), exports); tslib_1.__exportStar(__webpack_require__(39894), exports); tslib_1.__exportStar(__webpack_require__(88279), exports); tslib_1.__exportStar(__webpack_require__(97621), exports); tslib_1.__exportStar(__webpack_require__(74625), exports); tslib_1.__exportStar(__webpack_require__(85571), exports); tslib_1.__exportStar(__webpack_require__(3317), exports); tslib_1.__exportStar(__webpack_require__(85751), exports); tslib_1.__exportStar(__webpack_require__(50837), exports); tslib_1.__exportStar(__webpack_require__(35698), exports); tslib_1.__exportStar(__webpack_require__(80966), exports); tslib_1.__exportStar(__webpack_require__(43933), exports); tslib_1.__exportStar(__webpack_require__(54662), exports); tslib_1.__exportStar(__webpack_require__(16954), exports); tslib_1.__exportStar(__webpack_require__(70634), exports); tslib_1.__exportStar(__webpack_require__(26573), exports); tslib_1.__exportStar(__webpack_require__(69009), exports); tslib_1.__exportStar(__webpack_require__(14870), exports); tslib_1.__exportStar(__webpack_require__(40475), exports); tslib_1.__exportStar(__webpack_require__(90975), exports); tslib_1.__exportStar(__webpack_require__(66859), exports); tslib_1.__exportStar(__webpack_require__(64888), exports); tslib_1.__exportStar(__webpack_require__(36376), exports); tslib_1.__exportStar(__webpack_require__(8350), exports); tslib_1.__exportStar(__webpack_require__(21782), exports); tslib_1.__exportStar(__webpack_require__(19870), exports); tslib_1.__exportStar(__webpack_require__(94221), exports); tslib_1.__exportStar(__webpack_require__(10936), exports); tslib_1.__exportStar(__webpack_require__(5827), exports); tslib_1.__exportStar(__webpack_require__(48994), exports); tslib_1.__exportStar(__webpack_require__(55397), exports); tslib_1.__exportStar(__webpack_require__(91686), exports); tslib_1.__exportStar(__webpack_require__(22421), exports); tslib_1.__exportStar(__webpack_require__(1581), exports); tslib_1.__exportStar(__webpack_require__(61114), exports); tslib_1.__exportStar(__webpack_require__(77568), exports); tslib_1.__exportStar(__webpack_require__(55014), exports); tslib_1.__exportStar(__webpack_require__(63909), exports); tslib_1.__exportStar(__webpack_require__(56149), exports); tslib_1.__exportStar(__webpack_require__(46136), exports); tslib_1.__exportStar(__webpack_require__(70215), exports); tslib_1.__exportStar(__webpack_require__(37088), exports); tslib_1.__exportStar(__webpack_require__(1824), exports); tslib_1.__exportStar(__webpack_require__(31828), exports); tslib_1.__exportStar(__webpack_require__(96736), exports); tslib_1.__exportStar(__webpack_require__(99411), exports); tslib_1.__exportStar(__webpack_require__(9764), exports); tslib_1.__exportStar(__webpack_require__(21058), exports); tslib_1.__exportStar(__webpack_require__(31382), exports); tslib_1.__exportStar(__webpack_require__(15895), exports); tslib_1.__exportStar(__webpack_require__(56891), exports); tslib_1.__exportStar(__webpack_require__(79991), exports); tslib_1.__exportStar(__webpack_require__(60711), exports); tslib_1.__exportStar(__webpack_require__(25888), exports); tslib_1.__exportStar(__webpack_require__(845), exports); tslib_1.__exportStar(__webpack_require__(49696), exports); tslib_1.__exportStar(__webpack_require__(7056), exports); tslib_1.__exportStar(__webpack_require__(3884), exports); tslib_1.__exportStar(__webpack_require__(4248), exports); tslib_1.__exportStar(__webpack_require__(39203), exports); tslib_1.__exportStar(__webpack_require__(33725), exports); tslib_1.__exportStar(__webpack_require__(19078), exports); tslib_1.__exportStar(__webpack_require__(98113), exports); tslib_1.__exportStar(__webpack_require__(15598), exports); tslib_1.__exportStar(__webpack_require__(39191), exports); tslib_1.__exportStar(__webpack_require__(84279), exports); tslib_1.__exportStar(__webpack_require__(56581), exports); tslib_1.__exportStar(__webpack_require__(30254), exports); tslib_1.__exportStar(__webpack_require__(87928), exports); tslib_1.__exportStar(__webpack_require__(9350), exports); tslib_1.__exportStar(__webpack_require__(38169), exports); tslib_1.__exportStar(__webpack_require__(18640), exports); tslib_1.__exportStar(__webpack_require__(25927), exports); tslib_1.__exportStar(__webpack_require__(26839), exports); tslib_1.__exportStar(__webpack_require__(46881), exports); tslib_1.__exportStar(__webpack_require__(96339), exports); tslib_1.__exportStar(__webpack_require__(62890), exports); tslib_1.__exportStar(__webpack_require__(69127), exports); tslib_1.__exportStar(__webpack_require__(76275), exports); tslib_1.__exportStar(__webpack_require__(49545), exports); tslib_1.__exportStar(__webpack_require__(9927), exports); tslib_1.__exportStar(__webpack_require__(18622), exports); tslib_1.__exportStar(__webpack_require__(95926), exports); tslib_1.__exportStar(__webpack_require__(48971), exports); tslib_1.__exportStar(__webpack_require__(31592), exports); tslib_1.__exportStar(__webpack_require__(83459), exports); tslib_1.__exportStar(__webpack_require__(9077), exports); tslib_1.__exportStar(__webpack_require__(70127), exports); tslib_1.__exportStar(__webpack_require__(53615), exports); tslib_1.__exportStar(__webpack_require__(14610), exports); tslib_1.__exportStar(__webpack_require__(60878), exports); tslib_1.__exportStar(__webpack_require__(1655), exports); tslib_1.__exportStar(__webpack_require__(87717), exports); tslib_1.__exportStar(__webpack_require__(34417), exports); tslib_1.__exportStar(__webpack_require__(62967), exports); tslib_1.__exportStar(__webpack_require__(41434), exports); tslib_1.__exportStar(__webpack_require__(55885), exports); tslib_1.__exportStar(__webpack_require__(20317), exports); tslib_1.__exportStar(__webpack_require__(65055), exports); tslib_1.__exportStar(__webpack_require__(46022), exports); tslib_1.__exportStar(__webpack_require__(38664), exports); tslib_1.__exportStar(__webpack_require__(93238), exports); tslib_1.__exportStar(__webpack_require__(6538), exports); tslib_1.__exportStar(__webpack_require__(94719), exports); tslib_1.__exportStar(__webpack_require__(26379), exports); tslib_1.__exportStar(__webpack_require__(14361), exports); tslib_1.__exportStar(__webpack_require__(86872), exports); tslib_1.__exportStar(__webpack_require__(89521), exports); tslib_1.__exportStar(__webpack_require__(6602), exports); tslib_1.__exportStar(__webpack_require__(75476), exports); tslib_1.__exportStar(__webpack_require__(67027), exports); tslib_1.__exportStar(__webpack_require__(98205), exports); tslib_1.__exportStar(__webpack_require__(3099), exports); tslib_1.__exportStar(__webpack_require__(61999), exports); tslib_1.__exportStar(__webpack_require__(96086), exports); tslib_1.__exportStar(__webpack_require__(50793), exports); tslib_1.__exportStar(__webpack_require__(81906), exports); tslib_1.__exportStar(__webpack_require__(92848), exports); tslib_1.__exportStar(__webpack_require__(69489), exports); tslib_1.__exportStar(__webpack_require__(12040), exports); tslib_1.__exportStar(__webpack_require__(67225), exports); tslib_1.__exportStar(__webpack_require__(6290), exports); tslib_1.__exportStar(__webpack_require__(33698), exports); tslib_1.__exportStar(__webpack_require__(3991), exports); tslib_1.__exportStar(__webpack_require__(59985), exports); tslib_1.__exportStar(__webpack_require__(52589), exports); tslib_1.__exportStar(__webpack_require__(67377), exports); tslib_1.__exportStar(__webpack_require__(5757), exports); tslib_1.__exportStar(__webpack_require__(49592), exports); tslib_1.__exportStar(__webpack_require__(35568), exports); tslib_1.__exportStar(__webpack_require__(5287), exports); tslib_1.__exportStar(__webpack_require__(33927), exports); tslib_1.__exportStar(__webpack_require__(65276), exports); tslib_1.__exportStar(__webpack_require__(83787), exports); tslib_1.__exportStar(__webpack_require__(90989), exports); tslib_1.__exportStar(__webpack_require__(80263), exports); tslib_1.__exportStar(__webpack_require__(70914), exports); tslib_1.__exportStar(__webpack_require__(85050), exports); tslib_1.__exportStar(__webpack_require__(43969), exports); tslib_1.__exportStar(__webpack_require__(31462), exports); tslib_1.__exportStar(__webpack_require__(65), exports); tslib_1.__exportStar(__webpack_require__(50767), exports); tslib_1.__exportStar(__webpack_require__(77238), exports); tslib_1.__exportStar(__webpack_require__(52888), exports); tslib_1.__exportStar(__webpack_require__(44901), exports); tslib_1.__exportStar(__webpack_require__(8070), exports); tslib_1.__exportStar(__webpack_require__(61014), exports); tslib_1.__exportStar(__webpack_require__(15062), exports); tslib_1.__exportStar(__webpack_require__(89642), exports); tslib_1.__exportStar(__webpack_require__(15220), exports); tslib_1.__exportStar(__webpack_require__(10932), exports); tslib_1.__exportStar(__webpack_require__(73101), exports); tslib_1.__exportStar(__webpack_require__(78760), exports); tslib_1.__exportStar(__webpack_require__(3464), exports); tslib_1.__exportStar(__webpack_require__(47008), exports); tslib_1.__exportStar(__webpack_require__(1850), exports); tslib_1.__exportStar(__webpack_require__(62558), exports); tslib_1.__exportStar(__webpack_require__(49471), exports); tslib_1.__exportStar(__webpack_require__(45910), exports); tslib_1.__exportStar(__webpack_require__(32036), exports); tslib_1.__exportStar(__webpack_require__(53079), exports); tslib_1.__exportStar(__webpack_require__(39479), exports); tslib_1.__exportStar(__webpack_require__(56871), exports); tslib_1.__exportStar(__webpack_require__(66602), exports); tslib_1.__exportStar(__webpack_require__(41934), exports); tslib_1.__exportStar(__webpack_require__(3593), exports); tslib_1.__exportStar(__webpack_require__(12511), exports); tslib_1.__exportStar(__webpack_require__(47647), exports); tslib_1.__exportStar(__webpack_require__(23984), exports); tslib_1.__exportStar(__webpack_require__(54349), exports); tslib_1.__exportStar(__webpack_require__(20058), exports); tslib_1.__exportStar(__webpack_require__(53792), exports); tslib_1.__exportStar(__webpack_require__(20970), exports); tslib_1.__exportStar(__webpack_require__(88064), exports); tslib_1.__exportStar(__webpack_require__(88392), exports); tslib_1.__exportStar(__webpack_require__(49929), exports); tslib_1.__exportStar(__webpack_require__(23402), exports); tslib_1.__exportStar(__webpack_require__(49584), exports); tslib_1.__exportStar(__webpack_require__(94030), exports); tslib_1.__exportStar(__webpack_require__(39991), exports); tslib_1.__exportStar(__webpack_require__(48676), exports); tslib_1.__exportStar(__webpack_require__(53943), exports); tslib_1.__exportStar(__webpack_require__(44271), exports); tslib_1.__exportStar(__webpack_require__(99792), exports); tslib_1.__exportStar(__webpack_require__(43425), exports); tslib_1.__exportStar(__webpack_require__(7806), exports); tslib_1.__exportStar(__webpack_require__(7724), exports); tslib_1.__exportStar(__webpack_require__(66666), exports); tslib_1.__exportStar(__webpack_require__(29863), exports); tslib_1.__exportStar(__webpack_require__(23519), exports); tslib_1.__exportStar(__webpack_require__(68738), exports); tslib_1.__exportStar(__webpack_require__(24519), exports); tslib_1.__exportStar(__webpack_require__(92663), exports); tslib_1.__exportStar(__webpack_require__(37328), exports); tslib_1.__exportStar(__webpack_require__(16242), exports); tslib_1.__exportStar(__webpack_require__(25978), exports); tslib_1.__exportStar(__webpack_require__(16589), exports); tslib_1.__exportStar(__webpack_require__(91864), exports); tslib_1.__exportStar(__webpack_require__(97720), exports); tslib_1.__exportStar(__webpack_require__(52843), exports); tslib_1.__exportStar(__webpack_require__(63675), exports); tslib_1.__exportStar(__webpack_require__(34506), exports); tslib_1.__exportStar(__webpack_require__(72413), exports); tslib_1.__exportStar(__webpack_require__(58847), exports); tslib_1.__exportStar(__webpack_require__(38268), exports); tslib_1.__exportStar(__webpack_require__(21270), exports); tslib_1.__exportStar(__webpack_require__(9165), exports); tslib_1.__exportStar(__webpack_require__(64672), exports); tslib_1.__exportStar(__webpack_require__(60049), exports); tslib_1.__exportStar(__webpack_require__(15358), exports); tslib_1.__exportStar(__webpack_require__(9944), exports); tslib_1.__exportStar(__webpack_require__(18555), exports); tslib_1.__exportStar(__webpack_require__(49145), exports); tslib_1.__exportStar(__webpack_require__(87178), exports); tslib_1.__exportStar(__webpack_require__(86145), exports); tslib_1.__exportStar(__webpack_require__(52618), exports); tslib_1.__exportStar(__webpack_require__(18241), exports); tslib_1.__exportStar(__webpack_require__(67694), exports); tslib_1.__exportStar(__webpack_require__(41365), exports); tslib_1.__exportStar(__webpack_require__(13153), exports); tslib_1.__exportStar(__webpack_require__(27347), exports); tslib_1.__exportStar(__webpack_require__(61730), exports); tslib_1.__exportStar(__webpack_require__(37085), exports); tslib_1.__exportStar(__webpack_require__(7423), exports); tslib_1.__exportStar(__webpack_require__(34706), exports); tslib_1.__exportStar(__webpack_require__(98830), exports); tslib_1.__exportStar(__webpack_require__(93967), exports); tslib_1.__exportStar(__webpack_require__(64484), exports); tslib_1.__exportStar(__webpack_require__(63533), exports); tslib_1.__exportStar(__webpack_require__(96254), exports); tslib_1.__exportStar(__webpack_require__(1040), exports); tslib_1.__exportStar(__webpack_require__(57091), exports); tslib_1.__exportStar(__webpack_require__(98441), exports); tslib_1.__exportStar(__webpack_require__(30089), exports); tslib_1.__exportStar(__webpack_require__(43801), exports); tslib_1.__exportStar(__webpack_require__(58382), exports); tslib_1.__exportStar(__webpack_require__(84478), exports); tslib_1.__exportStar(__webpack_require__(8076), exports); tslib_1.__exportStar(__webpack_require__(51807), exports); tslib_1.__exportStar(__webpack_require__(59514), exports); tslib_1.__exportStar(__webpack_require__(96831), exports); tslib_1.__exportStar(__webpack_require__(41330), exports); tslib_1.__exportStar(__webpack_require__(98895), exports); tslib_1.__exportStar(__webpack_require__(95359), exports); tslib_1.__exportStar(__webpack_require__(24695), exports); tslib_1.__exportStar(__webpack_require__(75855), exports); tslib_1.__exportStar(__webpack_require__(56981), exports); tslib_1.__exportStar(__webpack_require__(55914), exports); tslib_1.__exportStar(__webpack_require__(14010), exports); tslib_1.__exportStar(__webpack_require__(8326), exports); tslib_1.__exportStar(__webpack_require__(40541), exports); tslib_1.__exportStar(__webpack_require__(59918), exports); tslib_1.__exportStar(__webpack_require__(74749), exports); tslib_1.__exportStar(__webpack_require__(66991), exports); tslib_1.__exportStar(__webpack_require__(4046), exports); tslib_1.__exportStar(__webpack_require__(14255), exports); tslib_1.__exportStar(__webpack_require__(81655), exports); tslib_1.__exportStar(__webpack_require__(83111), exports); tslib_1.__exportStar(__webpack_require__(34396), exports); tslib_1.__exportStar(__webpack_require__(43485), exports); tslib_1.__exportStar(__webpack_require__(63931), exports); tslib_1.__exportStar(__webpack_require__(23257), exports); tslib_1.__exportStar(__webpack_require__(84404), exports); tslib_1.__exportStar(__webpack_require__(44289), exports); tslib_1.__exportStar(__webpack_require__(90147), exports); tslib_1.__exportStar(__webpack_require__(72683), exports); tslib_1.__exportStar(__webpack_require__(2177), exports); tslib_1.__exportStar(__webpack_require__(75714), exports); tslib_1.__exportStar(__webpack_require__(59684), exports); tslib_1.__exportStar(__webpack_require__(26149), exports); tslib_1.__exportStar(__webpack_require__(67813), exports); tslib_1.__exportStar(__webpack_require__(60270), exports); tslib_1.__exportStar(__webpack_require__(90435), exports); tslib_1.__exportStar(__webpack_require__(42319), exports); tslib_1.__exportStar(__webpack_require__(10530), exports); tslib_1.__exportStar(__webpack_require__(22546), exports); tslib_1.__exportStar(__webpack_require__(62252), exports); tslib_1.__exportStar(__webpack_require__(76021), exports); tslib_1.__exportStar(__webpack_require__(5461), exports); tslib_1.__exportStar(__webpack_require__(28787), exports); tslib_1.__exportStar(__webpack_require__(51959), exports); tslib_1.__exportStar(__webpack_require__(71667), exports); tslib_1.__exportStar(__webpack_require__(24775), exports); tslib_1.__exportStar(__webpack_require__(2230), exports); tslib_1.__exportStar(__webpack_require__(74299), exports); tslib_1.__exportStar(__webpack_require__(87497), exports); tslib_1.__exportStar(__webpack_require__(65831), exports); tslib_1.__exportStar(__webpack_require__(31079), exports); tslib_1.__exportStar(__webpack_require__(75281), exports); tslib_1.__exportStar(__webpack_require__(8109), exports); tslib_1.__exportStar(__webpack_require__(50769), exports); tslib_1.__exportStar(__webpack_require__(49098), exports); tslib_1.__exportStar(__webpack_require__(34651), exports); tslib_1.__exportStar(__webpack_require__(35033), exports); tslib_1.__exportStar(__webpack_require__(90080), exports); tslib_1.__exportStar(__webpack_require__(13129), exports); tslib_1.__exportStar(__webpack_require__(14474), exports); tslib_1.__exportStar(__webpack_require__(473), exports); tslib_1.__exportStar(__webpack_require__(88465), exports); tslib_1.__exportStar(__webpack_require__(2146), exports); tslib_1.__exportStar(__webpack_require__(88931), exports); tslib_1.__exportStar(__webpack_require__(46198), exports); tslib_1.__exportStar(__webpack_require__(95797), exports); tslib_1.__exportStar(__webpack_require__(31397), exports); tslib_1.__exportStar(__webpack_require__(12802), exports); tslib_1.__exportStar(__webpack_require__(61521), exports); tslib_1.__exportStar(__webpack_require__(15956), exports); tslib_1.__exportStar(__webpack_require__(54910), exports); tslib_1.__exportStar(__webpack_require__(10285), exports); tslib_1.__exportStar(__webpack_require__(53523), exports); tslib_1.__exportStar(__webpack_require__(11202), exports); tslib_1.__exportStar(__webpack_require__(39491), exports); tslib_1.__exportStar(__webpack_require__(20812), exports); tslib_1.__exportStar(__webpack_require__(18685), exports); tslib_1.__exportStar(__webpack_require__(72711), exports); tslib_1.__exportStar(__webpack_require__(72167), exports); tslib_1.__exportStar(__webpack_require__(55473), exports); tslib_1.__exportStar(__webpack_require__(53805), exports); tslib_1.__exportStar(__webpack_require__(94350), exports); tslib_1.__exportStar(__webpack_require__(53849), exports); tslib_1.__exportStar(__webpack_require__(71688), exports); tslib_1.__exportStar(__webpack_require__(5710), exports); tslib_1.__exportStar(__webpack_require__(98026), exports); tslib_1.__exportStar(__webpack_require__(41784), exports); tslib_1.__exportStar(__webpack_require__(2411), exports); tslib_1.__exportStar(__webpack_require__(3849), exports); tslib_1.__exportStar(__webpack_require__(37196), exports); tslib_1.__exportStar(__webpack_require__(27287), exports); tslib_1.__exportStar(__webpack_require__(79262), exports); tslib_1.__exportStar(__webpack_require__(43128), exports); tslib_1.__exportStar(__webpack_require__(96606), exports); tslib_1.__exportStar(__webpack_require__(74687), exports); tslib_1.__exportStar(__webpack_require__(89728), exports); tslib_1.__exportStar(__webpack_require__(89151), exports); tslib_1.__exportStar(__webpack_require__(8786), exports); tslib_1.__exportStar(__webpack_require__(66258), exports); tslib_1.__exportStar(__webpack_require__(98064), exports); tslib_1.__exportStar(__webpack_require__(25083), exports); tslib_1.__exportStar(__webpack_require__(30639), exports); tslib_1.__exportStar(__webpack_require__(5950), exports); tslib_1.__exportStar(__webpack_require__(18291), exports); tslib_1.__exportStar(__webpack_require__(83162), exports); tslib_1.__exportStar(__webpack_require__(10150), exports); tslib_1.__exportStar(__webpack_require__(29521), exports); tslib_1.__exportStar(__webpack_require__(53209), exports); tslib_1.__exportStar(__webpack_require__(69602), exports); tslib_1.__exportStar(__webpack_require__(85029), exports); tslib_1.__exportStar(__webpack_require__(75145), exports); tslib_1.__exportStar(__webpack_require__(12390), exports); tslib_1.__exportStar(__webpack_require__(34096), exports); tslib_1.__exportStar(__webpack_require__(33665), exports); tslib_1.__exportStar(__webpack_require__(96952), exports); tslib_1.__exportStar(__webpack_require__(41473), exports); tslib_1.__exportStar(__webpack_require__(67231), exports); tslib_1.__exportStar(__webpack_require__(29409), exports); tslib_1.__exportStar(__webpack_require__(17298), exports); tslib_1.__exportStar(__webpack_require__(60715), exports); tslib_1.__exportStar(__webpack_require__(73280), exports); tslib_1.__exportStar(__webpack_require__(54941), exports); tslib_1.__exportStar(__webpack_require__(5415), exports); tslib_1.__exportStar(__webpack_require__(17383), exports); tslib_1.__exportStar(__webpack_require__(61416), exports); tslib_1.__exportStar(__webpack_require__(56126), exports); tslib_1.__exportStar(__webpack_require__(60958), exports); tslib_1.__exportStar(__webpack_require__(46865), exports); tslib_1.__exportStar(__webpack_require__(78411), exports); tslib_1.__exportStar(__webpack_require__(23137), exports); tslib_1.__exportStar(__webpack_require__(849), exports); tslib_1.__exportStar(__webpack_require__(17451), exports); const admissionregistrationV1ServiceReference_1 = __webpack_require__(21616); const admissionregistrationV1WebhookClientConfig_1 = __webpack_require__(7818); const admissionregistrationV1beta1ServiceReference_1 = __webpack_require__(96408); const admissionregistrationV1beta1WebhookClientConfig_1 = __webpack_require__(90959); const apiextensionsV1ServiceReference_1 = __webpack_require__(63536); const apiextensionsV1WebhookClientConfig_1 = __webpack_require__(22775); const apiextensionsV1beta1ServiceReference_1 = __webpack_require__(7588); const apiextensionsV1beta1WebhookClientConfig_1 = __webpack_require__(96116); const apiregistrationV1ServiceReference_1 = __webpack_require__(37492); const apiregistrationV1beta1ServiceReference_1 = __webpack_require__(67098); const authenticationV1TokenRequest_1 = __webpack_require__(25429); const coreV1Event_1 = __webpack_require__(42735); const coreV1EventList_1 = __webpack_require__(12368); const coreV1EventSeries_1 = __webpack_require__(70438); const eventsV1Event_1 = __webpack_require__(52191); const eventsV1EventList_1 = __webpack_require__(1051); const eventsV1EventSeries_1 = __webpack_require__(6933); const extensionsV1beta1HTTPIngressPath_1 = __webpack_require__(73491); const extensionsV1beta1HTTPIngressRuleValue_1 = __webpack_require__(77652); const extensionsV1beta1Ingress_1 = __webpack_require__(30621); const extensionsV1beta1IngressBackend_1 = __webpack_require__(29393); const extensionsV1beta1IngressList_1 = __webpack_require__(67169); const extensionsV1beta1IngressRule_1 = __webpack_require__(98849); const extensionsV1beta1IngressSpec_1 = __webpack_require__(89144); const extensionsV1beta1IngressStatus_1 = __webpack_require__(11652); const extensionsV1beta1IngressTLS_1 = __webpack_require__(30613); const flowcontrolV1alpha1Subject_1 = __webpack_require__(43525); const flowcontrolV1beta1Subject_1 = __webpack_require__(88186); const networkingV1beta1HTTPIngressPath_1 = __webpack_require__(27197); const networkingV1beta1HTTPIngressRuleValue_1 = __webpack_require__(41668); const networkingV1beta1Ingress_1 = __webpack_require__(64660); const networkingV1beta1IngressBackend_1 = __webpack_require__(36453); const networkingV1beta1IngressList_1 = __webpack_require__(95951); const networkingV1beta1IngressRule_1 = __webpack_require__(4157); const networkingV1beta1IngressSpec_1 = __webpack_require__(61752); const networkingV1beta1IngressStatus_1 = __webpack_require__(50369); const networkingV1beta1IngressTLS_1 = __webpack_require__(13517); const rbacV1alpha1Subject_1 = __webpack_require__(19573); const rbacV1beta1Subject_1 = __webpack_require__(99229); const storageV1TokenRequest_1 = __webpack_require__(25958); const v1APIGroup_1 = __webpack_require__(44481); const v1APIGroupList_1 = __webpack_require__(52906); const v1APIResource_1 = __webpack_require__(89033); const v1APIResourceList_1 = __webpack_require__(5454); const v1APIService_1 = __webpack_require__(99042); const v1APIServiceCondition_1 = __webpack_require__(58352); const v1APIServiceList_1 = __webpack_require__(87198); const v1APIServiceSpec_1 = __webpack_require__(61496); const v1APIServiceStatus_1 = __webpack_require__(17883); const v1APIVersions_1 = __webpack_require__(93135); const v1AWSElasticBlockStoreVolumeSource_1 = __webpack_require__(39808); const v1Affinity_1 = __webpack_require__(61957); const v1AggregationRule_1 = __webpack_require__(90312); const v1AttachedVolume_1 = __webpack_require__(97069); const v1AzureDiskVolumeSource_1 = __webpack_require__(91312); const v1AzureFilePersistentVolumeSource_1 = __webpack_require__(23694); const v1AzureFileVolumeSource_1 = __webpack_require__(95073); const v1Binding_1 = __webpack_require__(48551); const v1BoundObjectReference_1 = __webpack_require__(68849); const v1CSIDriver_1 = __webpack_require__(34144); const v1CSIDriverList_1 = __webpack_require__(84881); const v1CSIDriverSpec_1 = __webpack_require__(11582); const v1CSINode_1 = __webpack_require__(74315); const v1CSINodeDriver_1 = __webpack_require__(90288); const v1CSINodeList_1 = __webpack_require__(31918); const v1CSINodeSpec_1 = __webpack_require__(93142); const v1CSIPersistentVolumeSource_1 = __webpack_require__(98367); const v1CSIVolumeSource_1 = __webpack_require__(87598); const v1Capabilities_1 = __webpack_require__(82975); const v1CephFSPersistentVolumeSource_1 = __webpack_require__(14268); const v1CephFSVolumeSource_1 = __webpack_require__(84957); const v1CertificateSigningRequest_1 = __webpack_require__(99084); const v1CertificateSigningRequestCondition_1 = __webpack_require__(92932); const v1CertificateSigningRequestList_1 = __webpack_require__(31530); const v1CertificateSigningRequestSpec_1 = __webpack_require__(37759); const v1CertificateSigningRequestStatus_1 = __webpack_require__(38285); const v1CinderPersistentVolumeSource_1 = __webpack_require__(41888); const v1CinderVolumeSource_1 = __webpack_require__(19111); const v1ClientIPConfig_1 = __webpack_require__(33913); const v1ClusterRole_1 = __webpack_require__(61458); const v1ClusterRoleBinding_1 = __webpack_require__(32315); const v1ClusterRoleBindingList_1 = __webpack_require__(21181); const v1ClusterRoleList_1 = __webpack_require__(95532); const v1ComponentCondition_1 = __webpack_require__(30578); const v1ComponentStatus_1 = __webpack_require__(2047); const v1ComponentStatusList_1 = __webpack_require__(38596); const v1Condition_1 = __webpack_require__(34990); const v1ConfigMap_1 = __webpack_require__(42874); const v1ConfigMapEnvSource_1 = __webpack_require__(99685); const v1ConfigMapKeySelector_1 = __webpack_require__(62892); const v1ConfigMapList_1 = __webpack_require__(80512); const v1ConfigMapNodeConfigSource_1 = __webpack_require__(56709); const v1ConfigMapProjection_1 = __webpack_require__(50888); const v1ConfigMapVolumeSource_1 = __webpack_require__(59708); const v1Container_1 = __webpack_require__(52865); const v1ContainerImage_1 = __webpack_require__(13501); const v1ContainerPort_1 = __webpack_require__(50217); const v1ContainerState_1 = __webpack_require__(83765); const v1ContainerStateRunning_1 = __webpack_require__(89767); const v1ContainerStateTerminated_1 = __webpack_require__(27892); const v1ContainerStateWaiting_1 = __webpack_require__(19716); const v1ContainerStatus_1 = __webpack_require__(35980); const v1ControllerRevision_1 = __webpack_require__(78405); const v1ControllerRevisionList_1 = __webpack_require__(66304); const v1CrossVersionObjectReference_1 = __webpack_require__(34233); const v1CustomResourceColumnDefinition_1 = __webpack_require__(94346); const v1CustomResourceConversion_1 = __webpack_require__(9731); const v1CustomResourceDefinition_1 = __webpack_require__(40325); const v1CustomResourceDefinitionCondition_1 = __webpack_require__(32791); const v1CustomResourceDefinitionList_1 = __webpack_require__(10486); const v1CustomResourceDefinitionNames_1 = __webpack_require__(69798); const v1CustomResourceDefinitionSpec_1 = __webpack_require__(20486); const v1CustomResourceDefinitionStatus_1 = __webpack_require__(25713); const v1CustomResourceDefinitionVersion_1 = __webpack_require__(82283); const v1CustomResourceSubresourceScale_1 = __webpack_require__(98087); const v1CustomResourceSubresources_1 = __webpack_require__(94579); const v1CustomResourceValidation_1 = __webpack_require__(25408); const v1DaemonEndpoint_1 = __webpack_require__(37060); const v1DaemonSet_1 = __webpack_require__(32699); const v1DaemonSetCondition_1 = __webpack_require__(77063); const v1DaemonSetList_1 = __webpack_require__(173); const v1DaemonSetSpec_1 = __webpack_require__(44560); const v1DaemonSetStatus_1 = __webpack_require__(87510); const v1DaemonSetUpdateStrategy_1 = __webpack_require__(48451); const v1DeleteOptions_1 = __webpack_require__(18029); const v1Deployment_1 = __webpack_require__(65310); const v1DeploymentCondition_1 = __webpack_require__(95602); const v1DeploymentList_1 = __webpack_require__(81364); const v1DeploymentSpec_1 = __webpack_require__(41298); const v1DeploymentStatus_1 = __webpack_require__(92684); const v1DeploymentStrategy_1 = __webpack_require__(34981); const v1DownwardAPIProjection_1 = __webpack_require__(38099); const v1DownwardAPIVolumeFile_1 = __webpack_require__(78901); const v1DownwardAPIVolumeSource_1 = __webpack_require__(19493); const v1EmptyDirVolumeSource_1 = __webpack_require__(11672); const v1EndpointAddress_1 = __webpack_require__(57151); const v1EndpointPort_1 = __webpack_require__(37917); const v1EndpointSubset_1 = __webpack_require__(31925); const v1Endpoints_1 = __webpack_require__(13449); const v1EndpointsList_1 = __webpack_require__(95223); const v1EnvFromSource_1 = __webpack_require__(23074); const v1EnvVar_1 = __webpack_require__(36874); const v1EnvVarSource_1 = __webpack_require__(17205); const v1EphemeralContainer_1 = __webpack_require__(32671); const v1EphemeralVolumeSource_1 = __webpack_require__(90017); const v1EventSource_1 = __webpack_require__(97764); const v1ExecAction_1 = __webpack_require__(13313); const v1ExternalDocumentation_1 = __webpack_require__(77213); const v1FCVolumeSource_1 = __webpack_require__(35093); const v1FlexPersistentVolumeSource_1 = __webpack_require__(91874); const v1FlexVolumeSource_1 = __webpack_require__(16690); const v1FlockerVolumeSource_1 = __webpack_require__(10414); const v1GCEPersistentDiskVolumeSource_1 = __webpack_require__(1016); const v1GitRepoVolumeSource_1 = __webpack_require__(27584); const v1GlusterfsPersistentVolumeSource_1 = __webpack_require__(97617); const v1GlusterfsVolumeSource_1 = __webpack_require__(37426); const v1GroupVersionForDiscovery_1 = __webpack_require__(87855); const v1HTTPGetAction_1 = __webpack_require__(16636); const v1HTTPHeader_1 = __webpack_require__(3437); const v1HTTPIngressPath_1 = __webpack_require__(86769); const v1HTTPIngressRuleValue_1 = __webpack_require__(56219); const v1Handler_1 = __webpack_require__(95179); const v1HorizontalPodAutoscaler_1 = __webpack_require__(93652); const v1HorizontalPodAutoscalerList_1 = __webpack_require__(17024); const v1HorizontalPodAutoscalerSpec_1 = __webpack_require__(49823); const v1HorizontalPodAutoscalerStatus_1 = __webpack_require__(50910); const v1HostAlias_1 = __webpack_require__(72796); const v1HostPathVolumeSource_1 = __webpack_require__(69225); const v1IPBlock_1 = __webpack_require__(49202); const v1ISCSIPersistentVolumeSource_1 = __webpack_require__(83570); const v1ISCSIVolumeSource_1 = __webpack_require__(68021); const v1Ingress_1 = __webpack_require__(32492); const v1IngressBackend_1 = __webpack_require__(44340); const v1IngressClass_1 = __webpack_require__(93865); const v1IngressClassList_1 = __webpack_require__(76125); const v1IngressClassSpec_1 = __webpack_require__(92069); const v1IngressList_1 = __webpack_require__(43693); const v1IngressRule_1 = __webpack_require__(89541); const v1IngressServiceBackend_1 = __webpack_require__(62476); const v1IngressSpec_1 = __webpack_require__(59689); const v1IngressStatus_1 = __webpack_require__(45830); const v1IngressTLS_1 = __webpack_require__(23037); const v1JSONSchemaProps_1 = __webpack_require__(63580); const v1Job_1 = __webpack_require__(91260); const v1JobCondition_1 = __webpack_require__(94069); const v1JobList_1 = __webpack_require__(13366); const v1JobSpec_1 = __webpack_require__(93114); const v1JobStatus_1 = __webpack_require__(57345); const v1KeyToPath_1 = __webpack_require__(23549); const v1LabelSelector_1 = __webpack_require__(22567); const v1LabelSelectorRequirement_1 = __webpack_require__(50993); const v1Lease_1 = __webpack_require__(98844); const v1LeaseList_1 = __webpack_require__(76838); const v1LeaseSpec_1 = __webpack_require__(44603); const v1Lifecycle_1 = __webpack_require__(41500); const v1LimitRange_1 = __webpack_require__(86280); const v1LimitRangeItem_1 = __webpack_require__(91128); const v1LimitRangeList_1 = __webpack_require__(82578); const v1LimitRangeSpec_1 = __webpack_require__(83039); const v1ListMeta_1 = __webpack_require__(88593); const v1LoadBalancerIngress_1 = __webpack_require__(25667); const v1LoadBalancerStatus_1 = __webpack_require__(46630); const v1LocalObjectReference_1 = __webpack_require__(12229); const v1LocalSubjectAccessReview_1 = __webpack_require__(31674); const v1LocalVolumeSource_1 = __webpack_require__(72729); const v1ManagedFieldsEntry_1 = __webpack_require__(82187); const v1MutatingWebhook_1 = __webpack_require__(95354); const v1MutatingWebhookConfiguration_1 = __webpack_require__(2006); const v1MutatingWebhookConfigurationList_1 = __webpack_require__(22665); const v1NFSVolumeSource_1 = __webpack_require__(35432); const v1Namespace_1 = __webpack_require__(95469); const v1NamespaceCondition_1 = __webpack_require__(314); const v1NamespaceList_1 = __webpack_require__(22366); const v1NamespaceSpec_1 = __webpack_require__(49076); const v1NamespaceStatus_1 = __webpack_require__(8833); const v1NetworkPolicy_1 = __webpack_require__(47995); const v1NetworkPolicyEgressRule_1 = __webpack_require__(60886); const v1NetworkPolicyIngressRule_1 = __webpack_require__(89952); const v1NetworkPolicyList_1 = __webpack_require__(74436); const v1NetworkPolicyPeer_1 = __webpack_require__(22173); const v1NetworkPolicyPort_1 = __webpack_require__(71056); const v1NetworkPolicySpec_1 = __webpack_require__(63061); const v1Node_1 = __webpack_require__(3667); const v1NodeAddress_1 = __webpack_require__(84893); const v1NodeAffinity_1 = __webpack_require__(10627); const v1NodeCondition_1 = __webpack_require__(11740); const v1NodeConfigSource_1 = __webpack_require__(4272); const v1NodeConfigStatus_1 = __webpack_require__(10912); const v1NodeDaemonEndpoints_1 = __webpack_require__(24894); const v1NodeList_1 = __webpack_require__(42762); const v1NodeSelector_1 = __webpack_require__(32293); const v1NodeSelectorRequirement_1 = __webpack_require__(85161); const v1NodeSelectorTerm_1 = __webpack_require__(51128); const v1NodeSpec_1 = __webpack_require__(41752); const v1NodeStatus_1 = __webpack_require__(21656); const v1NodeSystemInfo_1 = __webpack_require__(33645); const v1NonResourceAttributes_1 = __webpack_require__(70019); const v1NonResourceRule_1 = __webpack_require__(99191); const v1ObjectFieldSelector_1 = __webpack_require__(86171); const v1ObjectMeta_1 = __webpack_require__(44696); const v1ObjectReference_1 = __webpack_require__(19051); const v1Overhead_1 = __webpack_require__(90114); const v1OwnerReference_1 = __webpack_require__(7924); const v1PersistentVolume_1 = __webpack_require__(25570); const v1PersistentVolumeClaim_1 = __webpack_require__(89974); const v1PersistentVolumeClaimCondition_1 = __webpack_require__(32966); const v1PersistentVolumeClaimList_1 = __webpack_require__(78594); const v1PersistentVolumeClaimSpec_1 = __webpack_require__(99911); const v1PersistentVolumeClaimStatus_1 = __webpack_require__(42951); const v1PersistentVolumeClaimTemplate_1 = __webpack_require__(92114); const v1PersistentVolumeClaimVolumeSource_1 = __webpack_require__(69811); const v1PersistentVolumeList_1 = __webpack_require__(86312); const v1PersistentVolumeSpec_1 = __webpack_require__(86628); const v1PersistentVolumeStatus_1 = __webpack_require__(19839); const v1PhotonPersistentDiskVolumeSource_1 = __webpack_require__(51817); const v1Pod_1 = __webpack_require__(99975); const v1PodAffinity_1 = __webpack_require__(509); const v1PodAffinityTerm_1 = __webpack_require__(65970); const v1PodAntiAffinity_1 = __webpack_require__(19574); const v1PodCondition_1 = __webpack_require__(78045); const v1PodDNSConfig_1 = __webpack_require__(67831); const v1PodDNSConfigOption_1 = __webpack_require__(74548); const v1PodIP_1 = __webpack_require__(76774); const v1PodList_1 = __webpack_require__(71948); const v1PodReadinessGate_1 = __webpack_require__(84135); const v1PodSecurityContext_1 = __webpack_require__(79850); const v1PodSpec_1 = __webpack_require__(58881); const v1PodStatus_1 = __webpack_require__(42892); const v1PodTemplate_1 = __webpack_require__(39894); const v1PodTemplateList_1 = __webpack_require__(88279); const v1PodTemplateSpec_1 = __webpack_require__(97621); const v1PolicyRule_1 = __webpack_require__(74625); const v1PortStatus_1 = __webpack_require__(85571); const v1PortworxVolumeSource_1 = __webpack_require__(3317); const v1Preconditions_1 = __webpack_require__(85751); const v1PreferredSchedulingTerm_1 = __webpack_require__(50837); const v1PriorityClass_1 = __webpack_require__(35698); const v1PriorityClassList_1 = __webpack_require__(80966); const v1Probe_1 = __webpack_require__(43933); const v1ProjectedVolumeSource_1 = __webpack_require__(54662); const v1QuobyteVolumeSource_1 = __webpack_require__(16954); const v1RBDPersistentVolumeSource_1 = __webpack_require__(70634); const v1RBDVolumeSource_1 = __webpack_require__(26573); const v1ReplicaSet_1 = __webpack_require__(69009); const v1ReplicaSetCondition_1 = __webpack_require__(14870); const v1ReplicaSetList_1 = __webpack_require__(40475); const v1ReplicaSetSpec_1 = __webpack_require__(90975); const v1ReplicaSetStatus_1 = __webpack_require__(66859); const v1ReplicationController_1 = __webpack_require__(64888); const v1ReplicationControllerCondition_1 = __webpack_require__(36376); const v1ReplicationControllerList_1 = __webpack_require__(8350); const v1ReplicationControllerSpec_1 = __webpack_require__(21782); const v1ReplicationControllerStatus_1 = __webpack_require__(19870); const v1ResourceAttributes_1 = __webpack_require__(94221); const v1ResourceFieldSelector_1 = __webpack_require__(10936); const v1ResourceQuota_1 = __webpack_require__(5827); const v1ResourceQuotaList_1 = __webpack_require__(48994); const v1ResourceQuotaSpec_1 = __webpack_require__(55397); const v1ResourceQuotaStatus_1 = __webpack_require__(91686); const v1ResourceRequirements_1 = __webpack_require__(22421); const v1ResourceRule_1 = __webpack_require__(1581); const v1Role_1 = __webpack_require__(61114); const v1RoleBinding_1 = __webpack_require__(77568); const v1RoleBindingList_1 = __webpack_require__(55014); const v1RoleList_1 = __webpack_require__(63909); const v1RoleRef_1 = __webpack_require__(56149); const v1RollingUpdateDaemonSet_1 = __webpack_require__(46136); const v1RollingUpdateDeployment_1 = __webpack_require__(70215); const v1RollingUpdateStatefulSetStrategy_1 = __webpack_require__(37088); const v1RuleWithOperations_1 = __webpack_require__(1824); const v1RuntimeClass_1 = __webpack_require__(31828); const v1RuntimeClassList_1 = __webpack_require__(96736); const v1SELinuxOptions_1 = __webpack_require__(99411); const v1Scale_1 = __webpack_require__(9764); const v1ScaleIOPersistentVolumeSource_1 = __webpack_require__(21058); const v1ScaleIOVolumeSource_1 = __webpack_require__(31382); const v1ScaleSpec_1 = __webpack_require__(15895); const v1ScaleStatus_1 = __webpack_require__(56891); const v1Scheduling_1 = __webpack_require__(79991); const v1ScopeSelector_1 = __webpack_require__(60711); const v1ScopedResourceSelectorRequirement_1 = __webpack_require__(25888); const v1SeccompProfile_1 = __webpack_require__(845); const v1Secret_1 = __webpack_require__(49696); const v1SecretEnvSource_1 = __webpack_require__(7056); const v1SecretKeySelector_1 = __webpack_require__(3884); const v1SecretList_1 = __webpack_require__(4248); const v1SecretProjection_1 = __webpack_require__(39203); const v1SecretReference_1 = __webpack_require__(33725); const v1SecretVolumeSource_1 = __webpack_require__(19078); const v1SecurityContext_1 = __webpack_require__(98113); const v1SelfSubjectAccessReview_1 = __webpack_require__(15598); const v1SelfSubjectAccessReviewSpec_1 = __webpack_require__(39191); const v1SelfSubjectRulesReview_1 = __webpack_require__(84279); const v1SelfSubjectRulesReviewSpec_1 = __webpack_require__(56581); const v1ServerAddressByClientCIDR_1 = __webpack_require__(30254); const v1Service_1 = __webpack_require__(87928); const v1ServiceAccount_1 = __webpack_require__(9350); const v1ServiceAccountList_1 = __webpack_require__(38169); const v1ServiceAccountTokenProjection_1 = __webpack_require__(18640); const v1ServiceBackendPort_1 = __webpack_require__(25927); const v1ServiceList_1 = __webpack_require__(26839); const v1ServicePort_1 = __webpack_require__(46881); const v1ServiceSpec_1 = __webpack_require__(96339); const v1ServiceStatus_1 = __webpack_require__(62890); const v1SessionAffinityConfig_1 = __webpack_require__(69127); const v1StatefulSet_1 = __webpack_require__(76275); const v1StatefulSetCondition_1 = __webpack_require__(49545); const v1StatefulSetList_1 = __webpack_require__(9927); const v1StatefulSetSpec_1 = __webpack_require__(18622); const v1StatefulSetStatus_1 = __webpack_require__(95926); const v1StatefulSetUpdateStrategy_1 = __webpack_require__(48971); const v1Status_1 = __webpack_require__(31592); const v1StatusCause_1 = __webpack_require__(83459); const v1StatusDetails_1 = __webpack_require__(9077); const v1StorageClass_1 = __webpack_require__(70127); const v1StorageClassList_1 = __webpack_require__(53615); const v1StorageOSPersistentVolumeSource_1 = __webpack_require__(14610); const v1StorageOSVolumeSource_1 = __webpack_require__(60878); const v1Subject_1 = __webpack_require__(1655); const v1SubjectAccessReview_1 = __webpack_require__(87717); const v1SubjectAccessReviewSpec_1 = __webpack_require__(34417); const v1SubjectAccessReviewStatus_1 = __webpack_require__(62967); const v1SubjectRulesReviewStatus_1 = __webpack_require__(41434); const v1Sysctl_1 = __webpack_require__(55885); const v1TCPSocketAction_1 = __webpack_require__(20317); const v1Taint_1 = __webpack_require__(65055); const v1TokenRequestSpec_1 = __webpack_require__(46022); const v1TokenRequestStatus_1 = __webpack_require__(38664); const v1TokenReview_1 = __webpack_require__(93238); const v1TokenReviewSpec_1 = __webpack_require__(6538); const v1TokenReviewStatus_1 = __webpack_require__(94719); const v1Toleration_1 = __webpack_require__(26379); const v1TopologySelectorLabelRequirement_1 = __webpack_require__(14361); const v1TopologySelectorTerm_1 = __webpack_require__(86872); const v1TopologySpreadConstraint_1 = __webpack_require__(89521); const v1TypedLocalObjectReference_1 = __webpack_require__(6602); const v1UserInfo_1 = __webpack_require__(75476); const v1ValidatingWebhook_1 = __webpack_require__(67027); const v1ValidatingWebhookConfiguration_1 = __webpack_require__(98205); const v1ValidatingWebhookConfigurationList_1 = __webpack_require__(3099); const v1Volume_1 = __webpack_require__(61999); const v1VolumeAttachment_1 = __webpack_require__(96086); const v1VolumeAttachmentList_1 = __webpack_require__(50793); const v1VolumeAttachmentSource_1 = __webpack_require__(81906); const v1VolumeAttachmentSpec_1 = __webpack_require__(92848); const v1VolumeAttachmentStatus_1 = __webpack_require__(69489); const v1VolumeDevice_1 = __webpack_require__(12040); const v1VolumeError_1 = __webpack_require__(67225); const v1VolumeMount_1 = __webpack_require__(6290); const v1VolumeNodeAffinity_1 = __webpack_require__(33698); const v1VolumeNodeResources_1 = __webpack_require__(3991); const v1VolumeProjection_1 = __webpack_require__(59985); const v1VsphereVirtualDiskVolumeSource_1 = __webpack_require__(52589); const v1WatchEvent_1 = __webpack_require__(67377); const v1WebhookConversion_1 = __webpack_require__(5757); const v1WeightedPodAffinityTerm_1 = __webpack_require__(49592); const v1WindowsSecurityContextOptions_1 = __webpack_require__(35568); const v1alpha1AggregationRule_1 = __webpack_require__(5287); const v1alpha1ClusterRole_1 = __webpack_require__(33927); const v1alpha1ClusterRoleBinding_1 = __webpack_require__(65276); const v1alpha1ClusterRoleBindingList_1 = __webpack_require__(83787); const v1alpha1ClusterRoleList_1 = __webpack_require__(90989); const v1alpha1FlowDistinguisherMethod_1 = __webpack_require__(80263); const v1alpha1FlowSchema_1 = __webpack_require__(70914); const v1alpha1FlowSchemaCondition_1 = __webpack_require__(85050); const v1alpha1FlowSchemaList_1 = __webpack_require__(43969); const v1alpha1FlowSchemaSpec_1 = __webpack_require__(31462); const v1alpha1FlowSchemaStatus_1 = __webpack_require__(65); const v1alpha1GroupSubject_1 = __webpack_require__(50767); const v1alpha1LimitResponse_1 = __webpack_require__(77238); const v1alpha1LimitedPriorityLevelConfiguration_1 = __webpack_require__(52888); const v1alpha1NonResourcePolicyRule_1 = __webpack_require__(44901); const v1alpha1Overhead_1 = __webpack_require__(8070); const v1alpha1PolicyRule_1 = __webpack_require__(61014); const v1alpha1PolicyRulesWithSubjects_1 = __webpack_require__(15062); const v1alpha1PriorityClass_1 = __webpack_require__(89642); const v1alpha1PriorityClassList_1 = __webpack_require__(15220); const v1alpha1PriorityLevelConfiguration_1 = __webpack_require__(10932); const v1alpha1PriorityLevelConfigurationCondition_1 = __webpack_require__(73101); const v1alpha1PriorityLevelConfigurationList_1 = __webpack_require__(78760); const v1alpha1PriorityLevelConfigurationReference_1 = __webpack_require__(3464); const v1alpha1PriorityLevelConfigurationSpec_1 = __webpack_require__(47008); const v1alpha1PriorityLevelConfigurationStatus_1 = __webpack_require__(1850); const v1alpha1QueuingConfiguration_1 = __webpack_require__(62558); const v1alpha1ResourcePolicyRule_1 = __webpack_require__(49471); const v1alpha1Role_1 = __webpack_require__(45910); const v1alpha1RoleBinding_1 = __webpack_require__(32036); const v1alpha1RoleBindingList_1 = __webpack_require__(53079); const v1alpha1RoleList_1 = __webpack_require__(39479); const v1alpha1RoleRef_1 = __webpack_require__(56871); const v1alpha1RuntimeClass_1 = __webpack_require__(66602); const v1alpha1RuntimeClassList_1 = __webpack_require__(41934); const v1alpha1RuntimeClassSpec_1 = __webpack_require__(3593); const v1alpha1Scheduling_1 = __webpack_require__(12511); const v1alpha1ServerStorageVersion_1 = __webpack_require__(47647); const v1alpha1ServiceAccountSubject_1 = __webpack_require__(23984); const v1alpha1StorageVersion_1 = __webpack_require__(54349); const v1alpha1StorageVersionCondition_1 = __webpack_require__(20058); const v1alpha1StorageVersionList_1 = __webpack_require__(53792); const v1alpha1StorageVersionStatus_1 = __webpack_require__(20970); const v1alpha1UserSubject_1 = __webpack_require__(88064); const v1alpha1VolumeAttachment_1 = __webpack_require__(88392); const v1alpha1VolumeAttachmentList_1 = __webpack_require__(49929); const v1alpha1VolumeAttachmentSource_1 = __webpack_require__(23402); const v1alpha1VolumeAttachmentSpec_1 = __webpack_require__(49584); const v1alpha1VolumeAttachmentStatus_1 = __webpack_require__(94030); const v1alpha1VolumeError_1 = __webpack_require__(39991); const v1beta1APIService_1 = __webpack_require__(48676); const v1beta1APIServiceCondition_1 = __webpack_require__(53943); const v1beta1APIServiceList_1 = __webpack_require__(44271); const v1beta1APIServiceSpec_1 = __webpack_require__(99792); const v1beta1APIServiceStatus_1 = __webpack_require__(43425); const v1beta1AggregationRule_1 = __webpack_require__(7806); const v1beta1AllowedCSIDriver_1 = __webpack_require__(7724); const v1beta1AllowedFlexVolume_1 = __webpack_require__(66666); const v1beta1AllowedHostPath_1 = __webpack_require__(29863); const v1beta1CSIDriver_1 = __webpack_require__(23519); const v1beta1CSIDriverList_1 = __webpack_require__(68738); const v1beta1CSIDriverSpec_1 = __webpack_require__(24519); const v1beta1CSINode_1 = __webpack_require__(92663); const v1beta1CSINodeDriver_1 = __webpack_require__(37328); const v1beta1CSINodeList_1 = __webpack_require__(16242); const v1beta1CSINodeSpec_1 = __webpack_require__(25978); const v1beta1CertificateSigningRequest_1 = __webpack_require__(16589); const v1beta1CertificateSigningRequestCondition_1 = __webpack_require__(91864); const v1beta1CertificateSigningRequestList_1 = __webpack_require__(97720); const v1beta1CertificateSigningRequestSpec_1 = __webpack_require__(52843); const v1beta1CertificateSigningRequestStatus_1 = __webpack_require__(63675); const v1beta1ClusterRole_1 = __webpack_require__(34506); const v1beta1ClusterRoleBinding_1 = __webpack_require__(72413); const v1beta1ClusterRoleBindingList_1 = __webpack_require__(58847); const v1beta1ClusterRoleList_1 = __webpack_require__(38268); const v1beta1CronJob_1 = __webpack_require__(21270); const v1beta1CronJobList_1 = __webpack_require__(9165); const v1beta1CronJobSpec_1 = __webpack_require__(64672); const v1beta1CronJobStatus_1 = __webpack_require__(60049); const v1beta1CustomResourceColumnDefinition_1 = __webpack_require__(15358); const v1beta1CustomResourceConversion_1 = __webpack_require__(9944); const v1beta1CustomResourceDefinition_1 = __webpack_require__(18555); const v1beta1CustomResourceDefinitionCondition_1 = __webpack_require__(49145); const v1beta1CustomResourceDefinitionList_1 = __webpack_require__(87178); const v1beta1CustomResourceDefinitionNames_1 = __webpack_require__(86145); const v1beta1CustomResourceDefinitionSpec_1 = __webpack_require__(52618); const v1beta1CustomResourceDefinitionStatus_1 = __webpack_require__(18241); const v1beta1CustomResourceDefinitionVersion_1 = __webpack_require__(67694); const v1beta1CustomResourceSubresourceScale_1 = __webpack_require__(41365); const v1beta1CustomResourceSubresources_1 = __webpack_require__(13153); const v1beta1CustomResourceValidation_1 = __webpack_require__(27347); const v1beta1Endpoint_1 = __webpack_require__(61730); const v1beta1EndpointConditions_1 = __webpack_require__(37085); const v1beta1EndpointPort_1 = __webpack_require__(7423); const v1beta1EndpointSlice_1 = __webpack_require__(34706); const v1beta1EndpointSliceList_1 = __webpack_require__(98830); const v1beta1Event_1 = __webpack_require__(93967); const v1beta1EventList_1 = __webpack_require__(64484); const v1beta1EventSeries_1 = __webpack_require__(63533); const v1beta1Eviction_1 = __webpack_require__(96254); const v1beta1ExternalDocumentation_1 = __webpack_require__(1040); const v1beta1FSGroupStrategyOptions_1 = __webpack_require__(57091); const v1beta1FlowDistinguisherMethod_1 = __webpack_require__(98441); const v1beta1FlowSchema_1 = __webpack_require__(30089); const v1beta1FlowSchemaCondition_1 = __webpack_require__(43801); const v1beta1FlowSchemaList_1 = __webpack_require__(58382); const v1beta1FlowSchemaSpec_1 = __webpack_require__(84478); const v1beta1FlowSchemaStatus_1 = __webpack_require__(8076); const v1beta1GroupSubject_1 = __webpack_require__(51807); const v1beta1HostPortRange_1 = __webpack_require__(59514); const v1beta1IDRange_1 = __webpack_require__(96831); const v1beta1IngressClass_1 = __webpack_require__(41330); const v1beta1IngressClassList_1 = __webpack_require__(98895); const v1beta1IngressClassSpec_1 = __webpack_require__(95359); const v1beta1JSONSchemaProps_1 = __webpack_require__(24695); const v1beta1JobTemplateSpec_1 = __webpack_require__(75855); const v1beta1Lease_1 = __webpack_require__(56981); const v1beta1LeaseList_1 = __webpack_require__(55914); const v1beta1LeaseSpec_1 = __webpack_require__(14010); const v1beta1LimitResponse_1 = __webpack_require__(8326); const v1beta1LimitedPriorityLevelConfiguration_1 = __webpack_require__(40541); const v1beta1LocalSubjectAccessReview_1 = __webpack_require__(59918); const v1beta1MutatingWebhook_1 = __webpack_require__(74749); const v1beta1MutatingWebhookConfiguration_1 = __webpack_require__(66991); const v1beta1MutatingWebhookConfigurationList_1 = __webpack_require__(4046); const v1beta1NonResourceAttributes_1 = __webpack_require__(14255); const v1beta1NonResourcePolicyRule_1 = __webpack_require__(81655); const v1beta1NonResourceRule_1 = __webpack_require__(83111); const v1beta1Overhead_1 = __webpack_require__(34396); const v1beta1PodDisruptionBudget_1 = __webpack_require__(43485); const v1beta1PodDisruptionBudgetList_1 = __webpack_require__(63931); const v1beta1PodDisruptionBudgetSpec_1 = __webpack_require__(23257); const v1beta1PodDisruptionBudgetStatus_1 = __webpack_require__(84404); const v1beta1PodSecurityPolicy_1 = __webpack_require__(44289); const v1beta1PodSecurityPolicyList_1 = __webpack_require__(90147); const v1beta1PodSecurityPolicySpec_1 = __webpack_require__(72683); const v1beta1PolicyRule_1 = __webpack_require__(2177); const v1beta1PolicyRulesWithSubjects_1 = __webpack_require__(75714); const v1beta1PriorityClass_1 = __webpack_require__(59684); const v1beta1PriorityClassList_1 = __webpack_require__(26149); const v1beta1PriorityLevelConfiguration_1 = __webpack_require__(67813); const v1beta1PriorityLevelConfigurationCondition_1 = __webpack_require__(60270); const v1beta1PriorityLevelConfigurationList_1 = __webpack_require__(90435); const v1beta1PriorityLevelConfigurationReference_1 = __webpack_require__(42319); const v1beta1PriorityLevelConfigurationSpec_1 = __webpack_require__(10530); const v1beta1PriorityLevelConfigurationStatus_1 = __webpack_require__(22546); const v1beta1QueuingConfiguration_1 = __webpack_require__(62252); const v1beta1ResourceAttributes_1 = __webpack_require__(76021); const v1beta1ResourcePolicyRule_1 = __webpack_require__(5461); const v1beta1ResourceRule_1 = __webpack_require__(28787); const v1beta1Role_1 = __webpack_require__(51959); const v1beta1RoleBinding_1 = __webpack_require__(71667); const v1beta1RoleBindingList_1 = __webpack_require__(24775); const v1beta1RoleList_1 = __webpack_require__(2230); const v1beta1RoleRef_1 = __webpack_require__(74299); const v1beta1RuleWithOperations_1 = __webpack_require__(87497); const v1beta1RunAsGroupStrategyOptions_1 = __webpack_require__(65831); const v1beta1RunAsUserStrategyOptions_1 = __webpack_require__(31079); const v1beta1RuntimeClass_1 = __webpack_require__(75281); const v1beta1RuntimeClassList_1 = __webpack_require__(8109); const v1beta1RuntimeClassStrategyOptions_1 = __webpack_require__(50769); const v1beta1SELinuxStrategyOptions_1 = __webpack_require__(49098); const v1beta1Scheduling_1 = __webpack_require__(34651); const v1beta1SelfSubjectAccessReview_1 = __webpack_require__(35033); const v1beta1SelfSubjectAccessReviewSpec_1 = __webpack_require__(90080); const v1beta1SelfSubjectRulesReview_1 = __webpack_require__(13129); const v1beta1SelfSubjectRulesReviewSpec_1 = __webpack_require__(14474); const v1beta1ServiceAccountSubject_1 = __webpack_require__(473); const v1beta1StorageClass_1 = __webpack_require__(88465); const v1beta1StorageClassList_1 = __webpack_require__(2146); const v1beta1SubjectAccessReview_1 = __webpack_require__(88931); const v1beta1SubjectAccessReviewSpec_1 = __webpack_require__(46198); const v1beta1SubjectAccessReviewStatus_1 = __webpack_require__(95797); const v1beta1SubjectRulesReviewStatus_1 = __webpack_require__(31397); const v1beta1SupplementalGroupsStrategyOptions_1 = __webpack_require__(12802); const v1beta1TokenRequest_1 = __webpack_require__(61521); const v1beta1TokenReview_1 = __webpack_require__(15956); const v1beta1TokenReviewSpec_1 = __webpack_require__(54910); const v1beta1TokenReviewStatus_1 = __webpack_require__(10285); const v1beta1UserInfo_1 = __webpack_require__(53523); const v1beta1UserSubject_1 = __webpack_require__(11202); const v1beta1ValidatingWebhook_1 = __webpack_require__(39491); const v1beta1ValidatingWebhookConfiguration_1 = __webpack_require__(20812); const v1beta1ValidatingWebhookConfigurationList_1 = __webpack_require__(18685); const v1beta1VolumeAttachment_1 = __webpack_require__(72711); const v1beta1VolumeAttachmentList_1 = __webpack_require__(72167); const v1beta1VolumeAttachmentSource_1 = __webpack_require__(55473); const v1beta1VolumeAttachmentSpec_1 = __webpack_require__(53805); const v1beta1VolumeAttachmentStatus_1 = __webpack_require__(94350); const v1beta1VolumeError_1 = __webpack_require__(53849); const v1beta1VolumeNodeResources_1 = __webpack_require__(71688); const v2alpha1CronJob_1 = __webpack_require__(5710); const v2alpha1CronJobList_1 = __webpack_require__(98026); const v2alpha1CronJobSpec_1 = __webpack_require__(41784); const v2alpha1CronJobStatus_1 = __webpack_require__(2411); const v2alpha1JobTemplateSpec_1 = __webpack_require__(3849); const v2beta1ContainerResourceMetricSource_1 = __webpack_require__(37196); const v2beta1ContainerResourceMetricStatus_1 = __webpack_require__(27287); const v2beta1CrossVersionObjectReference_1 = __webpack_require__(79262); const v2beta1ExternalMetricSource_1 = __webpack_require__(43128); const v2beta1ExternalMetricStatus_1 = __webpack_require__(96606); const v2beta1HorizontalPodAutoscaler_1 = __webpack_require__(74687); const v2beta1HorizontalPodAutoscalerCondition_1 = __webpack_require__(89728); const v2beta1HorizontalPodAutoscalerList_1 = __webpack_require__(89151); const v2beta1HorizontalPodAutoscalerSpec_1 = __webpack_require__(8786); const v2beta1HorizontalPodAutoscalerStatus_1 = __webpack_require__(66258); const v2beta1MetricSpec_1 = __webpack_require__(98064); const v2beta1MetricStatus_1 = __webpack_require__(25083); const v2beta1ObjectMetricSource_1 = __webpack_require__(30639); const v2beta1ObjectMetricStatus_1 = __webpack_require__(5950); const v2beta1PodsMetricSource_1 = __webpack_require__(18291); const v2beta1PodsMetricStatus_1 = __webpack_require__(83162); const v2beta1ResourceMetricSource_1 = __webpack_require__(10150); const v2beta1ResourceMetricStatus_1 = __webpack_require__(29521); const v2beta2ContainerResourceMetricSource_1 = __webpack_require__(53209); const v2beta2ContainerResourceMetricStatus_1 = __webpack_require__(69602); const v2beta2CrossVersionObjectReference_1 = __webpack_require__(85029); const v2beta2ExternalMetricSource_1 = __webpack_require__(75145); const v2beta2ExternalMetricStatus_1 = __webpack_require__(12390); const v2beta2HPAScalingPolicy_1 = __webpack_require__(34096); const v2beta2HPAScalingRules_1 = __webpack_require__(33665); const v2beta2HorizontalPodAutoscaler_1 = __webpack_require__(96952); const v2beta2HorizontalPodAutoscalerBehavior_1 = __webpack_require__(41473); const v2beta2HorizontalPodAutoscalerCondition_1 = __webpack_require__(67231); const v2beta2HorizontalPodAutoscalerList_1 = __webpack_require__(29409); const v2beta2HorizontalPodAutoscalerSpec_1 = __webpack_require__(17298); const v2beta2HorizontalPodAutoscalerStatus_1 = __webpack_require__(60715); const v2beta2MetricIdentifier_1 = __webpack_require__(73280); const v2beta2MetricSpec_1 = __webpack_require__(54941); const v2beta2MetricStatus_1 = __webpack_require__(5415); const v2beta2MetricTarget_1 = __webpack_require__(17383); const v2beta2MetricValueStatus_1 = __webpack_require__(61416); const v2beta2ObjectMetricSource_1 = __webpack_require__(56126); const v2beta2ObjectMetricStatus_1 = __webpack_require__(60958); const v2beta2PodsMetricSource_1 = __webpack_require__(46865); const v2beta2PodsMetricStatus_1 = __webpack_require__(78411); const v2beta2ResourceMetricSource_1 = __webpack_require__(23137); const v2beta2ResourceMetricStatus_1 = __webpack_require__(849); const versionInfo_1 = __webpack_require__(17451); /* tslint:disable:no-unused-variable */ let primitives = [ "string", "boolean", "double", "integer", "long", "float", "number", "any" ]; let enumsMap = {}; let typeMap = { "AdmissionregistrationV1ServiceReference": admissionregistrationV1ServiceReference_1.AdmissionregistrationV1ServiceReference, "AdmissionregistrationV1WebhookClientConfig": admissionregistrationV1WebhookClientConfig_1.AdmissionregistrationV1WebhookClientConfig, "AdmissionregistrationV1beta1ServiceReference": admissionregistrationV1beta1ServiceReference_1.AdmissionregistrationV1beta1ServiceReference, "AdmissionregistrationV1beta1WebhookClientConfig": admissionregistrationV1beta1WebhookClientConfig_1.AdmissionregistrationV1beta1WebhookClientConfig, "ApiextensionsV1ServiceReference": apiextensionsV1ServiceReference_1.ApiextensionsV1ServiceReference, "ApiextensionsV1WebhookClientConfig": apiextensionsV1WebhookClientConfig_1.ApiextensionsV1WebhookClientConfig, "ApiextensionsV1beta1ServiceReference": apiextensionsV1beta1ServiceReference_1.ApiextensionsV1beta1ServiceReference, "ApiextensionsV1beta1WebhookClientConfig": apiextensionsV1beta1WebhookClientConfig_1.ApiextensionsV1beta1WebhookClientConfig, "ApiregistrationV1ServiceReference": apiregistrationV1ServiceReference_1.ApiregistrationV1ServiceReference, "ApiregistrationV1beta1ServiceReference": apiregistrationV1beta1ServiceReference_1.ApiregistrationV1beta1ServiceReference, "AuthenticationV1TokenRequest": authenticationV1TokenRequest_1.AuthenticationV1TokenRequest, "CoreV1Event": coreV1Event_1.CoreV1Event, "CoreV1EventList": coreV1EventList_1.CoreV1EventList, "CoreV1EventSeries": coreV1EventSeries_1.CoreV1EventSeries, "EventsV1Event": eventsV1Event_1.EventsV1Event, "EventsV1EventList": eventsV1EventList_1.EventsV1EventList, "EventsV1EventSeries": eventsV1EventSeries_1.EventsV1EventSeries, "ExtensionsV1beta1HTTPIngressPath": extensionsV1beta1HTTPIngressPath_1.ExtensionsV1beta1HTTPIngressPath, "ExtensionsV1beta1HTTPIngressRuleValue": extensionsV1beta1HTTPIngressRuleValue_1.ExtensionsV1beta1HTTPIngressRuleValue, "ExtensionsV1beta1Ingress": extensionsV1beta1Ingress_1.ExtensionsV1beta1Ingress, "ExtensionsV1beta1IngressBackend": extensionsV1beta1IngressBackend_1.ExtensionsV1beta1IngressBackend, "ExtensionsV1beta1IngressList": extensionsV1beta1IngressList_1.ExtensionsV1beta1IngressList, "ExtensionsV1beta1IngressRule": extensionsV1beta1IngressRule_1.ExtensionsV1beta1IngressRule, "ExtensionsV1beta1IngressSpec": extensionsV1beta1IngressSpec_1.ExtensionsV1beta1IngressSpec, "ExtensionsV1beta1IngressStatus": extensionsV1beta1IngressStatus_1.ExtensionsV1beta1IngressStatus, "ExtensionsV1beta1IngressTLS": extensionsV1beta1IngressTLS_1.ExtensionsV1beta1IngressTLS, "FlowcontrolV1alpha1Subject": flowcontrolV1alpha1Subject_1.FlowcontrolV1alpha1Subject, "FlowcontrolV1beta1Subject": flowcontrolV1beta1Subject_1.FlowcontrolV1beta1Subject, "NetworkingV1beta1HTTPIngressPath": networkingV1beta1HTTPIngressPath_1.NetworkingV1beta1HTTPIngressPath, "NetworkingV1beta1HTTPIngressRuleValue": networkingV1beta1HTTPIngressRuleValue_1.NetworkingV1beta1HTTPIngressRuleValue, "NetworkingV1beta1Ingress": networkingV1beta1Ingress_1.NetworkingV1beta1Ingress, "NetworkingV1beta1IngressBackend": networkingV1beta1IngressBackend_1.NetworkingV1beta1IngressBackend, "NetworkingV1beta1IngressList": networkingV1beta1IngressList_1.NetworkingV1beta1IngressList, "NetworkingV1beta1IngressRule": networkingV1beta1IngressRule_1.NetworkingV1beta1IngressRule, "NetworkingV1beta1IngressSpec": networkingV1beta1IngressSpec_1.NetworkingV1beta1IngressSpec, "NetworkingV1beta1IngressStatus": networkingV1beta1IngressStatus_1.NetworkingV1beta1IngressStatus, "NetworkingV1beta1IngressTLS": networkingV1beta1IngressTLS_1.NetworkingV1beta1IngressTLS, "RbacV1alpha1Subject": rbacV1alpha1Subject_1.RbacV1alpha1Subject, "RbacV1beta1Subject": rbacV1beta1Subject_1.RbacV1beta1Subject, "StorageV1TokenRequest": storageV1TokenRequest_1.StorageV1TokenRequest, "V1APIGroup": v1APIGroup_1.V1APIGroup, "V1APIGroupList": v1APIGroupList_1.V1APIGroupList, "V1APIResource": v1APIResource_1.V1APIResource, "V1APIResourceList": v1APIResourceList_1.V1APIResourceList, "V1APIService": v1APIService_1.V1APIService, "V1APIServiceCondition": v1APIServiceCondition_1.V1APIServiceCondition, "V1APIServiceList": v1APIServiceList_1.V1APIServiceList, "V1APIServiceSpec": v1APIServiceSpec_1.V1APIServiceSpec, "V1APIServiceStatus": v1APIServiceStatus_1.V1APIServiceStatus, "V1APIVersions": v1APIVersions_1.V1APIVersions, "V1AWSElasticBlockStoreVolumeSource": v1AWSElasticBlockStoreVolumeSource_1.V1AWSElasticBlockStoreVolumeSource, "V1Affinity": v1Affinity_1.V1Affinity, "V1AggregationRule": v1AggregationRule_1.V1AggregationRule, "V1AttachedVolume": v1AttachedVolume_1.V1AttachedVolume, "V1AzureDiskVolumeSource": v1AzureDiskVolumeSource_1.V1AzureDiskVolumeSource, "V1AzureFilePersistentVolumeSource": v1AzureFilePersistentVolumeSource_1.V1AzureFilePersistentVolumeSource, "V1AzureFileVolumeSource": v1AzureFileVolumeSource_1.V1AzureFileVolumeSource, "V1Binding": v1Binding_1.V1Binding, "V1BoundObjectReference": v1BoundObjectReference_1.V1BoundObjectReference, "V1CSIDriver": v1CSIDriver_1.V1CSIDriver, "V1CSIDriverList": v1CSIDriverList_1.V1CSIDriverList, "V1CSIDriverSpec": v1CSIDriverSpec_1.V1CSIDriverSpec, "V1CSINode": v1CSINode_1.V1CSINode, "V1CSINodeDriver": v1CSINodeDriver_1.V1CSINodeDriver, "V1CSINodeList": v1CSINodeList_1.V1CSINodeList, "V1CSINodeSpec": v1CSINodeSpec_1.V1CSINodeSpec, "V1CSIPersistentVolumeSource": v1CSIPersistentVolumeSource_1.V1CSIPersistentVolumeSource, "V1CSIVolumeSource": v1CSIVolumeSource_1.V1CSIVolumeSource, "V1Capabilities": v1Capabilities_1.V1Capabilities, "V1CephFSPersistentVolumeSource": v1CephFSPersistentVolumeSource_1.V1CephFSPersistentVolumeSource, "V1CephFSVolumeSource": v1CephFSVolumeSource_1.V1CephFSVolumeSource, "V1CertificateSigningRequest": v1CertificateSigningRequest_1.V1CertificateSigningRequest, "V1CertificateSigningRequestCondition": v1CertificateSigningRequestCondition_1.V1CertificateSigningRequestCondition, "V1CertificateSigningRequestList": v1CertificateSigningRequestList_1.V1CertificateSigningRequestList, "V1CertificateSigningRequestSpec": v1CertificateSigningRequestSpec_1.V1CertificateSigningRequestSpec, "V1CertificateSigningRequestStatus": v1CertificateSigningRequestStatus_1.V1CertificateSigningRequestStatus, "V1CinderPersistentVolumeSource": v1CinderPersistentVolumeSource_1.V1CinderPersistentVolumeSource, "V1CinderVolumeSource": v1CinderVolumeSource_1.V1CinderVolumeSource, "V1ClientIPConfig": v1ClientIPConfig_1.V1ClientIPConfig, "V1ClusterRole": v1ClusterRole_1.V1ClusterRole, "V1ClusterRoleBinding": v1ClusterRoleBinding_1.V1ClusterRoleBinding, "V1ClusterRoleBindingList": v1ClusterRoleBindingList_1.V1ClusterRoleBindingList, "V1ClusterRoleList": v1ClusterRoleList_1.V1ClusterRoleList, "V1ComponentCondition": v1ComponentCondition_1.V1ComponentCondition, "V1ComponentStatus": v1ComponentStatus_1.V1ComponentStatus, "V1ComponentStatusList": v1ComponentStatusList_1.V1ComponentStatusList, "V1Condition": v1Condition_1.V1Condition, "V1ConfigMap": v1ConfigMap_1.V1ConfigMap, "V1ConfigMapEnvSource": v1ConfigMapEnvSource_1.V1ConfigMapEnvSource, "V1ConfigMapKeySelector": v1ConfigMapKeySelector_1.V1ConfigMapKeySelector, "V1ConfigMapList": v1ConfigMapList_1.V1ConfigMapList, "V1ConfigMapNodeConfigSource": v1ConfigMapNodeConfigSource_1.V1ConfigMapNodeConfigSource, "V1ConfigMapProjection": v1ConfigMapProjection_1.V1ConfigMapProjection, "V1ConfigMapVolumeSource": v1ConfigMapVolumeSource_1.V1ConfigMapVolumeSource, "V1Container": v1Container_1.V1Container, "V1ContainerImage": v1ContainerImage_1.V1ContainerImage, "V1ContainerPort": v1ContainerPort_1.V1ContainerPort, "V1ContainerState": v1ContainerState_1.V1ContainerState, "V1ContainerStateRunning": v1ContainerStateRunning_1.V1ContainerStateRunning, "V1ContainerStateTerminated": v1ContainerStateTerminated_1.V1ContainerStateTerminated, "V1ContainerStateWaiting": v1ContainerStateWaiting_1.V1ContainerStateWaiting, "V1ContainerStatus": v1ContainerStatus_1.V1ContainerStatus, "V1ControllerRevision": v1ControllerRevision_1.V1ControllerRevision, "V1ControllerRevisionList": v1ControllerRevisionList_1.V1ControllerRevisionList, "V1CrossVersionObjectReference": v1CrossVersionObjectReference_1.V1CrossVersionObjectReference, "V1CustomResourceColumnDefinition": v1CustomResourceColumnDefinition_1.V1CustomResourceColumnDefinition, "V1CustomResourceConversion": v1CustomResourceConversion_1.V1CustomResourceConversion, "V1CustomResourceDefinition": v1CustomResourceDefinition_1.V1CustomResourceDefinition, "V1CustomResourceDefinitionCondition": v1CustomResourceDefinitionCondition_1.V1CustomResourceDefinitionCondition, "V1CustomResourceDefinitionList": v1CustomResourceDefinitionList_1.V1CustomResourceDefinitionList, "V1CustomResourceDefinitionNames": v1CustomResourceDefinitionNames_1.V1CustomResourceDefinitionNames, "V1CustomResourceDefinitionSpec": v1CustomResourceDefinitionSpec_1.V1CustomResourceDefinitionSpec, "V1CustomResourceDefinitionStatus": v1CustomResourceDefinitionStatus_1.V1CustomResourceDefinitionStatus, "V1CustomResourceDefinitionVersion": v1CustomResourceDefinitionVersion_1.V1CustomResourceDefinitionVersion, "V1CustomResourceSubresourceScale": v1CustomResourceSubresourceScale_1.V1CustomResourceSubresourceScale, "V1CustomResourceSubresources": v1CustomResourceSubresources_1.V1CustomResourceSubresources, "V1CustomResourceValidation": v1CustomResourceValidation_1.V1CustomResourceValidation, "V1DaemonEndpoint": v1DaemonEndpoint_1.V1DaemonEndpoint, "V1DaemonSet": v1DaemonSet_1.V1DaemonSet, "V1DaemonSetCondition": v1DaemonSetCondition_1.V1DaemonSetCondition, "V1DaemonSetList": v1DaemonSetList_1.V1DaemonSetList, "V1DaemonSetSpec": v1DaemonSetSpec_1.V1DaemonSetSpec, "V1DaemonSetStatus": v1DaemonSetStatus_1.V1DaemonSetStatus, "V1DaemonSetUpdateStrategy": v1DaemonSetUpdateStrategy_1.V1DaemonSetUpdateStrategy, "V1DeleteOptions": v1DeleteOptions_1.V1DeleteOptions, "V1Deployment": v1Deployment_1.V1Deployment, "V1DeploymentCondition": v1DeploymentCondition_1.V1DeploymentCondition, "V1DeploymentList": v1DeploymentList_1.V1DeploymentList, "V1DeploymentSpec": v1DeploymentSpec_1.V1DeploymentSpec, "V1DeploymentStatus": v1DeploymentStatus_1.V1DeploymentStatus, "V1DeploymentStrategy": v1DeploymentStrategy_1.V1DeploymentStrategy, "V1DownwardAPIProjection": v1DownwardAPIProjection_1.V1DownwardAPIProjection, "V1DownwardAPIVolumeFile": v1DownwardAPIVolumeFile_1.V1DownwardAPIVolumeFile, "V1DownwardAPIVolumeSource": v1DownwardAPIVolumeSource_1.V1DownwardAPIVolumeSource, "V1EmptyDirVolumeSource": v1EmptyDirVolumeSource_1.V1EmptyDirVolumeSource, "V1EndpointAddress": v1EndpointAddress_1.V1EndpointAddress, "V1EndpointPort": v1EndpointPort_1.V1EndpointPort, "V1EndpointSubset": v1EndpointSubset_1.V1EndpointSubset, "V1Endpoints": v1Endpoints_1.V1Endpoints, "V1EndpointsList": v1EndpointsList_1.V1EndpointsList, "V1EnvFromSource": v1EnvFromSource_1.V1EnvFromSource, "V1EnvVar": v1EnvVar_1.V1EnvVar, "V1EnvVarSource": v1EnvVarSource_1.V1EnvVarSource, "V1EphemeralContainer": v1EphemeralContainer_1.V1EphemeralContainer, "V1EphemeralVolumeSource": v1EphemeralVolumeSource_1.V1EphemeralVolumeSource, "V1EventSource": v1EventSource_1.V1EventSource, "V1ExecAction": v1ExecAction_1.V1ExecAction, "V1ExternalDocumentation": v1ExternalDocumentation_1.V1ExternalDocumentation, "V1FCVolumeSource": v1FCVolumeSource_1.V1FCVolumeSource, "V1FlexPersistentVolumeSource": v1FlexPersistentVolumeSource_1.V1FlexPersistentVolumeSource, "V1FlexVolumeSource": v1FlexVolumeSource_1.V1FlexVolumeSource, "V1FlockerVolumeSource": v1FlockerVolumeSource_1.V1FlockerVolumeSource, "V1GCEPersistentDiskVolumeSource": v1GCEPersistentDiskVolumeSource_1.V1GCEPersistentDiskVolumeSource, "V1GitRepoVolumeSource": v1GitRepoVolumeSource_1.V1GitRepoVolumeSource, "V1GlusterfsPersistentVolumeSource": v1GlusterfsPersistentVolumeSource_1.V1GlusterfsPersistentVolumeSource, "V1GlusterfsVolumeSource": v1GlusterfsVolumeSource_1.V1GlusterfsVolumeSource, "V1GroupVersionForDiscovery": v1GroupVersionForDiscovery_1.V1GroupVersionForDiscovery, "V1HTTPGetAction": v1HTTPGetAction_1.V1HTTPGetAction, "V1HTTPHeader": v1HTTPHeader_1.V1HTTPHeader, "V1HTTPIngressPath": v1HTTPIngressPath_1.V1HTTPIngressPath, "V1HTTPIngressRuleValue": v1HTTPIngressRuleValue_1.V1HTTPIngressRuleValue, "V1Handler": v1Handler_1.V1Handler, "V1HorizontalPodAutoscaler": v1HorizontalPodAutoscaler_1.V1HorizontalPodAutoscaler, "V1HorizontalPodAutoscalerList": v1HorizontalPodAutoscalerList_1.V1HorizontalPodAutoscalerList, "V1HorizontalPodAutoscalerSpec": v1HorizontalPodAutoscalerSpec_1.V1HorizontalPodAutoscalerSpec, "V1HorizontalPodAutoscalerStatus": v1HorizontalPodAutoscalerStatus_1.V1HorizontalPodAutoscalerStatus, "V1HostAlias": v1HostAlias_1.V1HostAlias, "V1HostPathVolumeSource": v1HostPathVolumeSource_1.V1HostPathVolumeSource, "V1IPBlock": v1IPBlock_1.V1IPBlock, "V1ISCSIPersistentVolumeSource": v1ISCSIPersistentVolumeSource_1.V1ISCSIPersistentVolumeSource, "V1ISCSIVolumeSource": v1ISCSIVolumeSource_1.V1ISCSIVolumeSource, "V1Ingress": v1Ingress_1.V1Ingress, "V1IngressBackend": v1IngressBackend_1.V1IngressBackend, "V1IngressClass": v1IngressClass_1.V1IngressClass, "V1IngressClassList": v1IngressClassList_1.V1IngressClassList, "V1IngressClassSpec": v1IngressClassSpec_1.V1IngressClassSpec, "V1IngressList": v1IngressList_1.V1IngressList, "V1IngressRule": v1IngressRule_1.V1IngressRule, "V1IngressServiceBackend": v1IngressServiceBackend_1.V1IngressServiceBackend, "V1IngressSpec": v1IngressSpec_1.V1IngressSpec, "V1IngressStatus": v1IngressStatus_1.V1IngressStatus, "V1IngressTLS": v1IngressTLS_1.V1IngressTLS, "V1JSONSchemaProps": v1JSONSchemaProps_1.V1JSONSchemaProps, "V1Job": v1Job_1.V1Job, "V1JobCondition": v1JobCondition_1.V1JobCondition, "V1JobList": v1JobList_1.V1JobList, "V1JobSpec": v1JobSpec_1.V1JobSpec, "V1JobStatus": v1JobStatus_1.V1JobStatus, "V1KeyToPath": v1KeyToPath_1.V1KeyToPath, "V1LabelSelector": v1LabelSelector_1.V1LabelSelector, "V1LabelSelectorRequirement": v1LabelSelectorRequirement_1.V1LabelSelectorRequirement, "V1Lease": v1Lease_1.V1Lease, "V1LeaseList": v1LeaseList_1.V1LeaseList, "V1LeaseSpec": v1LeaseSpec_1.V1LeaseSpec, "V1Lifecycle": v1Lifecycle_1.V1Lifecycle, "V1LimitRange": v1LimitRange_1.V1LimitRange, "V1LimitRangeItem": v1LimitRangeItem_1.V1LimitRangeItem, "V1LimitRangeList": v1LimitRangeList_1.V1LimitRangeList, "V1LimitRangeSpec": v1LimitRangeSpec_1.V1LimitRangeSpec, "V1ListMeta": v1ListMeta_1.V1ListMeta, "V1LoadBalancerIngress": v1LoadBalancerIngress_1.V1LoadBalancerIngress, "V1LoadBalancerStatus": v1LoadBalancerStatus_1.V1LoadBalancerStatus, "V1LocalObjectReference": v1LocalObjectReference_1.V1LocalObjectReference, "V1LocalSubjectAccessReview": v1LocalSubjectAccessReview_1.V1LocalSubjectAccessReview, "V1LocalVolumeSource": v1LocalVolumeSource_1.V1LocalVolumeSource, "V1ManagedFieldsEntry": v1ManagedFieldsEntry_1.V1ManagedFieldsEntry, "V1MutatingWebhook": v1MutatingWebhook_1.V1MutatingWebhook, "V1MutatingWebhookConfiguration": v1MutatingWebhookConfiguration_1.V1MutatingWebhookConfiguration, "V1MutatingWebhookConfigurationList": v1MutatingWebhookConfigurationList_1.V1MutatingWebhookConfigurationList, "V1NFSVolumeSource": v1NFSVolumeSource_1.V1NFSVolumeSource, "V1Namespace": v1Namespace_1.V1Namespace, "V1NamespaceCondition": v1NamespaceCondition_1.V1NamespaceCondition, "V1NamespaceList": v1NamespaceList_1.V1NamespaceList, "V1NamespaceSpec": v1NamespaceSpec_1.V1NamespaceSpec, "V1NamespaceStatus": v1NamespaceStatus_1.V1NamespaceStatus, "V1NetworkPolicy": v1NetworkPolicy_1.V1NetworkPolicy, "V1NetworkPolicyEgressRule": v1NetworkPolicyEgressRule_1.V1NetworkPolicyEgressRule, "V1NetworkPolicyIngressRule": v1NetworkPolicyIngressRule_1.V1NetworkPolicyIngressRule, "V1NetworkPolicyList": v1NetworkPolicyList_1.V1NetworkPolicyList, "V1NetworkPolicyPeer": v1NetworkPolicyPeer_1.V1NetworkPolicyPeer, "V1NetworkPolicyPort": v1NetworkPolicyPort_1.V1NetworkPolicyPort, "V1NetworkPolicySpec": v1NetworkPolicySpec_1.V1NetworkPolicySpec, "V1Node": v1Node_1.V1Node, "V1NodeAddress": v1NodeAddress_1.V1NodeAddress, "V1NodeAffinity": v1NodeAffinity_1.V1NodeAffinity, "V1NodeCondition": v1NodeCondition_1.V1NodeCondition, "V1NodeConfigSource": v1NodeConfigSource_1.V1NodeConfigSource, "V1NodeConfigStatus": v1NodeConfigStatus_1.V1NodeConfigStatus, "V1NodeDaemonEndpoints": v1NodeDaemonEndpoints_1.V1NodeDaemonEndpoints, "V1NodeList": v1NodeList_1.V1NodeList, "V1NodeSelector": v1NodeSelector_1.V1NodeSelector, "V1NodeSelectorRequirement": v1NodeSelectorRequirement_1.V1NodeSelectorRequirement, "V1NodeSelectorTerm": v1NodeSelectorTerm_1.V1NodeSelectorTerm, "V1NodeSpec": v1NodeSpec_1.V1NodeSpec, "V1NodeStatus": v1NodeStatus_1.V1NodeStatus, "V1NodeSystemInfo": v1NodeSystemInfo_1.V1NodeSystemInfo, "V1NonResourceAttributes": v1NonResourceAttributes_1.V1NonResourceAttributes, "V1NonResourceRule": v1NonResourceRule_1.V1NonResourceRule, "V1ObjectFieldSelector": v1ObjectFieldSelector_1.V1ObjectFieldSelector, "V1ObjectMeta": v1ObjectMeta_1.V1ObjectMeta, "V1ObjectReference": v1ObjectReference_1.V1ObjectReference, "V1Overhead": v1Overhead_1.V1Overhead, "V1OwnerReference": v1OwnerReference_1.V1OwnerReference, "V1PersistentVolume": v1PersistentVolume_1.V1PersistentVolume, "V1PersistentVolumeClaim": v1PersistentVolumeClaim_1.V1PersistentVolumeClaim, "V1PersistentVolumeClaimCondition": v1PersistentVolumeClaimCondition_1.V1PersistentVolumeClaimCondition, "V1PersistentVolumeClaimList": v1PersistentVolumeClaimList_1.V1PersistentVolumeClaimList, "V1PersistentVolumeClaimSpec": v1PersistentVolumeClaimSpec_1.V1PersistentVolumeClaimSpec, "V1PersistentVolumeClaimStatus": v1PersistentVolumeClaimStatus_1.V1PersistentVolumeClaimStatus, "V1PersistentVolumeClaimTemplate": v1PersistentVolumeClaimTemplate_1.V1PersistentVolumeClaimTemplate, "V1PersistentVolumeClaimVolumeSource": v1PersistentVolumeClaimVolumeSource_1.V1PersistentVolumeClaimVolumeSource, "V1PersistentVolumeList": v1PersistentVolumeList_1.V1PersistentVolumeList, "V1PersistentVolumeSpec": v1PersistentVolumeSpec_1.V1PersistentVolumeSpec, "V1PersistentVolumeStatus": v1PersistentVolumeStatus_1.V1PersistentVolumeStatus, "V1PhotonPersistentDiskVolumeSource": v1PhotonPersistentDiskVolumeSource_1.V1PhotonPersistentDiskVolumeSource, "V1Pod": v1Pod_1.V1Pod, "V1PodAffinity": v1PodAffinity_1.V1PodAffinity, "V1PodAffinityTerm": v1PodAffinityTerm_1.V1PodAffinityTerm, "V1PodAntiAffinity": v1PodAntiAffinity_1.V1PodAntiAffinity, "V1PodCondition": v1PodCondition_1.V1PodCondition, "V1PodDNSConfig": v1PodDNSConfig_1.V1PodDNSConfig, "V1PodDNSConfigOption": v1PodDNSConfigOption_1.V1PodDNSConfigOption, "V1PodIP": v1PodIP_1.V1PodIP, "V1PodList": v1PodList_1.V1PodList, "V1PodReadinessGate": v1PodReadinessGate_1.V1PodReadinessGate, "V1PodSecurityContext": v1PodSecurityContext_1.V1PodSecurityContext, "V1PodSpec": v1PodSpec_1.V1PodSpec, "V1PodStatus": v1PodStatus_1.V1PodStatus, "V1PodTemplate": v1PodTemplate_1.V1PodTemplate, "V1PodTemplateList": v1PodTemplateList_1.V1PodTemplateList, "V1PodTemplateSpec": v1PodTemplateSpec_1.V1PodTemplateSpec, "V1PolicyRule": v1PolicyRule_1.V1PolicyRule, "V1PortStatus": v1PortStatus_1.V1PortStatus, "V1PortworxVolumeSource": v1PortworxVolumeSource_1.V1PortworxVolumeSource, "V1Preconditions": v1Preconditions_1.V1Preconditions, "V1PreferredSchedulingTerm": v1PreferredSchedulingTerm_1.V1PreferredSchedulingTerm, "V1PriorityClass": v1PriorityClass_1.V1PriorityClass, "V1PriorityClassList": v1PriorityClassList_1.V1PriorityClassList, "V1Probe": v1Probe_1.V1Probe, "V1ProjectedVolumeSource": v1ProjectedVolumeSource_1.V1ProjectedVolumeSource, "V1QuobyteVolumeSource": v1QuobyteVolumeSource_1.V1QuobyteVolumeSource, "V1RBDPersistentVolumeSource": v1RBDPersistentVolumeSource_1.V1RBDPersistentVolumeSource, "V1RBDVolumeSource": v1RBDVolumeSource_1.V1RBDVolumeSource, "V1ReplicaSet": v1ReplicaSet_1.V1ReplicaSet, "V1ReplicaSetCondition": v1ReplicaSetCondition_1.V1ReplicaSetCondition, "V1ReplicaSetList": v1ReplicaSetList_1.V1ReplicaSetList, "V1ReplicaSetSpec": v1ReplicaSetSpec_1.V1ReplicaSetSpec, "V1ReplicaSetStatus": v1ReplicaSetStatus_1.V1ReplicaSetStatus, "V1ReplicationController": v1ReplicationController_1.V1ReplicationController, "V1ReplicationControllerCondition": v1ReplicationControllerCondition_1.V1ReplicationControllerCondition, "V1ReplicationControllerList": v1ReplicationControllerList_1.V1ReplicationControllerList, "V1ReplicationControllerSpec": v1ReplicationControllerSpec_1.V1ReplicationControllerSpec, "V1ReplicationControllerStatus": v1ReplicationControllerStatus_1.V1ReplicationControllerStatus, "V1ResourceAttributes": v1ResourceAttributes_1.V1ResourceAttributes, "V1ResourceFieldSelector": v1ResourceFieldSelector_1.V1ResourceFieldSelector, "V1ResourceQuota": v1ResourceQuota_1.V1ResourceQuota, "V1ResourceQuotaList": v1ResourceQuotaList_1.V1ResourceQuotaList, "V1ResourceQuotaSpec": v1ResourceQuotaSpec_1.V1ResourceQuotaSpec, "V1ResourceQuotaStatus": v1ResourceQuotaStatus_1.V1ResourceQuotaStatus, "V1ResourceRequirements": v1ResourceRequirements_1.V1ResourceRequirements, "V1ResourceRule": v1ResourceRule_1.V1ResourceRule, "V1Role": v1Role_1.V1Role, "V1RoleBinding": v1RoleBinding_1.V1RoleBinding, "V1RoleBindingList": v1RoleBindingList_1.V1RoleBindingList, "V1RoleList": v1RoleList_1.V1RoleList, "V1RoleRef": v1RoleRef_1.V1RoleRef, "V1RollingUpdateDaemonSet": v1RollingUpdateDaemonSet_1.V1RollingUpdateDaemonSet, "V1RollingUpdateDeployment": v1RollingUpdateDeployment_1.V1RollingUpdateDeployment, "V1RollingUpdateStatefulSetStrategy": v1RollingUpdateStatefulSetStrategy_1.V1RollingUpdateStatefulSetStrategy, "V1RuleWithOperations": v1RuleWithOperations_1.V1RuleWithOperations, "V1RuntimeClass": v1RuntimeClass_1.V1RuntimeClass, "V1RuntimeClassList": v1RuntimeClassList_1.V1RuntimeClassList, "V1SELinuxOptions": v1SELinuxOptions_1.V1SELinuxOptions, "V1Scale": v1Scale_1.V1Scale, "V1ScaleIOPersistentVolumeSource": v1ScaleIOPersistentVolumeSource_1.V1ScaleIOPersistentVolumeSource, "V1ScaleIOVolumeSource": v1ScaleIOVolumeSource_1.V1ScaleIOVolumeSource, "V1ScaleSpec": v1ScaleSpec_1.V1ScaleSpec, "V1ScaleStatus": v1ScaleStatus_1.V1ScaleStatus, "V1Scheduling": v1Scheduling_1.V1Scheduling, "V1ScopeSelector": v1ScopeSelector_1.V1ScopeSelector, "V1ScopedResourceSelectorRequirement": v1ScopedResourceSelectorRequirement_1.V1ScopedResourceSelectorRequirement, "V1SeccompProfile": v1SeccompProfile_1.V1SeccompProfile, "V1Secret": v1Secret_1.V1Secret, "V1SecretEnvSource": v1SecretEnvSource_1.V1SecretEnvSource, "V1SecretKeySelector": v1SecretKeySelector_1.V1SecretKeySelector, "V1SecretList": v1SecretList_1.V1SecretList, "V1SecretProjection": v1SecretProjection_1.V1SecretProjection, "V1SecretReference": v1SecretReference_1.V1SecretReference, "V1SecretVolumeSource": v1SecretVolumeSource_1.V1SecretVolumeSource, "V1SecurityContext": v1SecurityContext_1.V1SecurityContext, "V1SelfSubjectAccessReview": v1SelfSubjectAccessReview_1.V1SelfSubjectAccessReview, "V1SelfSubjectAccessReviewSpec": v1SelfSubjectAccessReviewSpec_1.V1SelfSubjectAccessReviewSpec, "V1SelfSubjectRulesReview": v1SelfSubjectRulesReview_1.V1SelfSubjectRulesReview, "V1SelfSubjectRulesReviewSpec": v1SelfSubjectRulesReviewSpec_1.V1SelfSubjectRulesReviewSpec, "V1ServerAddressByClientCIDR": v1ServerAddressByClientCIDR_1.V1ServerAddressByClientCIDR, "V1Service": v1Service_1.V1Service, "V1ServiceAccount": v1ServiceAccount_1.V1ServiceAccount, "V1ServiceAccountList": v1ServiceAccountList_1.V1ServiceAccountList, "V1ServiceAccountTokenProjection": v1ServiceAccountTokenProjection_1.V1ServiceAccountTokenProjection, "V1ServiceBackendPort": v1ServiceBackendPort_1.V1ServiceBackendPort, "V1ServiceList": v1ServiceList_1.V1ServiceList, "V1ServicePort": v1ServicePort_1.V1ServicePort, "V1ServiceSpec": v1ServiceSpec_1.V1ServiceSpec, "V1ServiceStatus": v1ServiceStatus_1.V1ServiceStatus, "V1SessionAffinityConfig": v1SessionAffinityConfig_1.V1SessionAffinityConfig, "V1StatefulSet": v1StatefulSet_1.V1StatefulSet, "V1StatefulSetCondition": v1StatefulSetCondition_1.V1StatefulSetCondition, "V1StatefulSetList": v1StatefulSetList_1.V1StatefulSetList, "V1StatefulSetSpec": v1StatefulSetSpec_1.V1StatefulSetSpec, "V1StatefulSetStatus": v1StatefulSetStatus_1.V1StatefulSetStatus, "V1StatefulSetUpdateStrategy": v1StatefulSetUpdateStrategy_1.V1StatefulSetUpdateStrategy, "V1Status": v1Status_1.V1Status, "V1StatusCause": v1StatusCause_1.V1StatusCause, "V1StatusDetails": v1StatusDetails_1.V1StatusDetails, "V1StorageClass": v1StorageClass_1.V1StorageClass, "V1StorageClassList": v1StorageClassList_1.V1StorageClassList, "V1StorageOSPersistentVolumeSource": v1StorageOSPersistentVolumeSource_1.V1StorageOSPersistentVolumeSource, "V1StorageOSVolumeSource": v1StorageOSVolumeSource_1.V1StorageOSVolumeSource, "V1Subject": v1Subject_1.V1Subject, "V1SubjectAccessReview": v1SubjectAccessReview_1.V1SubjectAccessReview, "V1SubjectAccessReviewSpec": v1SubjectAccessReviewSpec_1.V1SubjectAccessReviewSpec, "V1SubjectAccessReviewStatus": v1SubjectAccessReviewStatus_1.V1SubjectAccessReviewStatus, "V1SubjectRulesReviewStatus": v1SubjectRulesReviewStatus_1.V1SubjectRulesReviewStatus, "V1Sysctl": v1Sysctl_1.V1Sysctl, "V1TCPSocketAction": v1TCPSocketAction_1.V1TCPSocketAction, "V1Taint": v1Taint_1.V1Taint, "V1TokenRequestSpec": v1TokenRequestSpec_1.V1TokenRequestSpec, "V1TokenRequestStatus": v1TokenRequestStatus_1.V1TokenRequestStatus, "V1TokenReview": v1TokenReview_1.V1TokenReview, "V1TokenReviewSpec": v1TokenReviewSpec_1.V1TokenReviewSpec, "V1TokenReviewStatus": v1TokenReviewStatus_1.V1TokenReviewStatus, "V1Toleration": v1Toleration_1.V1Toleration, "V1TopologySelectorLabelRequirement": v1TopologySelectorLabelRequirement_1.V1TopologySelectorLabelRequirement, "V1TopologySelectorTerm": v1TopologySelectorTerm_1.V1TopologySelectorTerm, "V1TopologySpreadConstraint": v1TopologySpreadConstraint_1.V1TopologySpreadConstraint, "V1TypedLocalObjectReference": v1TypedLocalObjectReference_1.V1TypedLocalObjectReference, "V1UserInfo": v1UserInfo_1.V1UserInfo, "V1ValidatingWebhook": v1ValidatingWebhook_1.V1ValidatingWebhook, "V1ValidatingWebhookConfiguration": v1ValidatingWebhookConfiguration_1.V1ValidatingWebhookConfiguration, "V1ValidatingWebhookConfigurationList": v1ValidatingWebhookConfigurationList_1.V1ValidatingWebhookConfigurationList, "V1Volume": v1Volume_1.V1Volume, "V1VolumeAttachment": v1VolumeAttachment_1.V1VolumeAttachment, "V1VolumeAttachmentList": v1VolumeAttachmentList_1.V1VolumeAttachmentList, "V1VolumeAttachmentSource": v1VolumeAttachmentSource_1.V1VolumeAttachmentSource, "V1VolumeAttachmentSpec": v1VolumeAttachmentSpec_1.V1VolumeAttachmentSpec, "V1VolumeAttachmentStatus": v1VolumeAttachmentStatus_1.V1VolumeAttachmentStatus, "V1VolumeDevice": v1VolumeDevice_1.V1VolumeDevice, "V1VolumeError": v1VolumeError_1.V1VolumeError, "V1VolumeMount": v1VolumeMount_1.V1VolumeMount, "V1VolumeNodeAffinity": v1VolumeNodeAffinity_1.V1VolumeNodeAffinity, "V1VolumeNodeResources": v1VolumeNodeResources_1.V1VolumeNodeResources, "V1VolumeProjection": v1VolumeProjection_1.V1VolumeProjection, "V1VsphereVirtualDiskVolumeSource": v1VsphereVirtualDiskVolumeSource_1.V1VsphereVirtualDiskVolumeSource, "V1WatchEvent": v1WatchEvent_1.V1WatchEvent, "V1WebhookConversion": v1WebhookConversion_1.V1WebhookConversion, "V1WeightedPodAffinityTerm": v1WeightedPodAffinityTerm_1.V1WeightedPodAffinityTerm, "V1WindowsSecurityContextOptions": v1WindowsSecurityContextOptions_1.V1WindowsSecurityContextOptions, "V1alpha1AggregationRule": v1alpha1AggregationRule_1.V1alpha1AggregationRule, "V1alpha1ClusterRole": v1alpha1ClusterRole_1.V1alpha1ClusterRole, "V1alpha1ClusterRoleBinding": v1alpha1ClusterRoleBinding_1.V1alpha1ClusterRoleBinding, "V1alpha1ClusterRoleBindingList": v1alpha1ClusterRoleBindingList_1.V1alpha1ClusterRoleBindingList, "V1alpha1ClusterRoleList": v1alpha1ClusterRoleList_1.V1alpha1ClusterRoleList, "V1alpha1FlowDistinguisherMethod": v1alpha1FlowDistinguisherMethod_1.V1alpha1FlowDistinguisherMethod, "V1alpha1FlowSchema": v1alpha1FlowSchema_1.V1alpha1FlowSchema, "V1alpha1FlowSchemaCondition": v1alpha1FlowSchemaCondition_1.V1alpha1FlowSchemaCondition, "V1alpha1FlowSchemaList": v1alpha1FlowSchemaList_1.V1alpha1FlowSchemaList, "V1alpha1FlowSchemaSpec": v1alpha1FlowSchemaSpec_1.V1alpha1FlowSchemaSpec, "V1alpha1FlowSchemaStatus": v1alpha1FlowSchemaStatus_1.V1alpha1FlowSchemaStatus, "V1alpha1GroupSubject": v1alpha1GroupSubject_1.V1alpha1GroupSubject, "V1alpha1LimitResponse": v1alpha1LimitResponse_1.V1alpha1LimitResponse, "V1alpha1LimitedPriorityLevelConfiguration": v1alpha1LimitedPriorityLevelConfiguration_1.V1alpha1LimitedPriorityLevelConfiguration, "V1alpha1NonResourcePolicyRule": v1alpha1NonResourcePolicyRule_1.V1alpha1NonResourcePolicyRule, "V1alpha1Overhead": v1alpha1Overhead_1.V1alpha1Overhead, "V1alpha1PolicyRule": v1alpha1PolicyRule_1.V1alpha1PolicyRule, "V1alpha1PolicyRulesWithSubjects": v1alpha1PolicyRulesWithSubjects_1.V1alpha1PolicyRulesWithSubjects, "V1alpha1PriorityClass": v1alpha1PriorityClass_1.V1alpha1PriorityClass, "V1alpha1PriorityClassList": v1alpha1PriorityClassList_1.V1alpha1PriorityClassList, "V1alpha1PriorityLevelConfiguration": v1alpha1PriorityLevelConfiguration_1.V1alpha1PriorityLevelConfiguration, "V1alpha1PriorityLevelConfigurationCondition": v1alpha1PriorityLevelConfigurationCondition_1.V1alpha1PriorityLevelConfigurationCondition, "V1alpha1PriorityLevelConfigurationList": v1alpha1PriorityLevelConfigurationList_1.V1alpha1PriorityLevelConfigurationList, "V1alpha1PriorityLevelConfigurationReference": v1alpha1PriorityLevelConfigurationReference_1.V1alpha1PriorityLevelConfigurationReference, "V1alpha1PriorityLevelConfigurationSpec": v1alpha1PriorityLevelConfigurationSpec_1.V1alpha1PriorityLevelConfigurationSpec, "V1alpha1PriorityLevelConfigurationStatus": v1alpha1PriorityLevelConfigurationStatus_1.V1alpha1PriorityLevelConfigurationStatus, "V1alpha1QueuingConfiguration": v1alpha1QueuingConfiguration_1.V1alpha1QueuingConfiguration, "V1alpha1ResourcePolicyRule": v1alpha1ResourcePolicyRule_1.V1alpha1ResourcePolicyRule, "V1alpha1Role": v1alpha1Role_1.V1alpha1Role, "V1alpha1RoleBinding": v1alpha1RoleBinding_1.V1alpha1RoleBinding, "V1alpha1RoleBindingList": v1alpha1RoleBindingList_1.V1alpha1RoleBindingList, "V1alpha1RoleList": v1alpha1RoleList_1.V1alpha1RoleList, "V1alpha1RoleRef": v1alpha1RoleRef_1.V1alpha1RoleRef, "V1alpha1RuntimeClass": v1alpha1RuntimeClass_1.V1alpha1RuntimeClass, "V1alpha1RuntimeClassList": v1alpha1RuntimeClassList_1.V1alpha1RuntimeClassList, "V1alpha1RuntimeClassSpec": v1alpha1RuntimeClassSpec_1.V1alpha1RuntimeClassSpec, "V1alpha1Scheduling": v1alpha1Scheduling_1.V1alpha1Scheduling, "V1alpha1ServerStorageVersion": v1alpha1ServerStorageVersion_1.V1alpha1ServerStorageVersion, "V1alpha1ServiceAccountSubject": v1alpha1ServiceAccountSubject_1.V1alpha1ServiceAccountSubject, "V1alpha1StorageVersion": v1alpha1StorageVersion_1.V1alpha1StorageVersion, "V1alpha1StorageVersionCondition": v1alpha1StorageVersionCondition_1.V1alpha1StorageVersionCondition, "V1alpha1StorageVersionList": v1alpha1StorageVersionList_1.V1alpha1StorageVersionList, "V1alpha1StorageVersionStatus": v1alpha1StorageVersionStatus_1.V1alpha1StorageVersionStatus, "V1alpha1UserSubject": v1alpha1UserSubject_1.V1alpha1UserSubject, "V1alpha1VolumeAttachment": v1alpha1VolumeAttachment_1.V1alpha1VolumeAttachment, "V1alpha1VolumeAttachmentList": v1alpha1VolumeAttachmentList_1.V1alpha1VolumeAttachmentList, "V1alpha1VolumeAttachmentSource": v1alpha1VolumeAttachmentSource_1.V1alpha1VolumeAttachmentSource, "V1alpha1VolumeAttachmentSpec": v1alpha1VolumeAttachmentSpec_1.V1alpha1VolumeAttachmentSpec, "V1alpha1VolumeAttachmentStatus": v1alpha1VolumeAttachmentStatus_1.V1alpha1VolumeAttachmentStatus, "V1alpha1VolumeError": v1alpha1VolumeError_1.V1alpha1VolumeError, "V1beta1APIService": v1beta1APIService_1.V1beta1APIService, "V1beta1APIServiceCondition": v1beta1APIServiceCondition_1.V1beta1APIServiceCondition, "V1beta1APIServiceList": v1beta1APIServiceList_1.V1beta1APIServiceList, "V1beta1APIServiceSpec": v1beta1APIServiceSpec_1.V1beta1APIServiceSpec, "V1beta1APIServiceStatus": v1beta1APIServiceStatus_1.V1beta1APIServiceStatus, "V1beta1AggregationRule": v1beta1AggregationRule_1.V1beta1AggregationRule, "V1beta1AllowedCSIDriver": v1beta1AllowedCSIDriver_1.V1beta1AllowedCSIDriver, "V1beta1AllowedFlexVolume": v1beta1AllowedFlexVolume_1.V1beta1AllowedFlexVolume, "V1beta1AllowedHostPath": v1beta1AllowedHostPath_1.V1beta1AllowedHostPath, "V1beta1CSIDriver": v1beta1CSIDriver_1.V1beta1CSIDriver, "V1beta1CSIDriverList": v1beta1CSIDriverList_1.V1beta1CSIDriverList, "V1beta1CSIDriverSpec": v1beta1CSIDriverSpec_1.V1beta1CSIDriverSpec, "V1beta1CSINode": v1beta1CSINode_1.V1beta1CSINode, "V1beta1CSINodeDriver": v1beta1CSINodeDriver_1.V1beta1CSINodeDriver, "V1beta1CSINodeList": v1beta1CSINodeList_1.V1beta1CSINodeList, "V1beta1CSINodeSpec": v1beta1CSINodeSpec_1.V1beta1CSINodeSpec, "V1beta1CertificateSigningRequest": v1beta1CertificateSigningRequest_1.V1beta1CertificateSigningRequest, "V1beta1CertificateSigningRequestCondition": v1beta1CertificateSigningRequestCondition_1.V1beta1CertificateSigningRequestCondition, "V1beta1CertificateSigningRequestList": v1beta1CertificateSigningRequestList_1.V1beta1CertificateSigningRequestList, "V1beta1CertificateSigningRequestSpec": v1beta1CertificateSigningRequestSpec_1.V1beta1CertificateSigningRequestSpec, "V1beta1CertificateSigningRequestStatus": v1beta1CertificateSigningRequestStatus_1.V1beta1CertificateSigningRequestStatus, "V1beta1ClusterRole": v1beta1ClusterRole_1.V1beta1ClusterRole, "V1beta1ClusterRoleBinding": v1beta1ClusterRoleBinding_1.V1beta1ClusterRoleBinding, "V1beta1ClusterRoleBindingList": v1beta1ClusterRoleBindingList_1.V1beta1ClusterRoleBindingList, "V1beta1ClusterRoleList": v1beta1ClusterRoleList_1.V1beta1ClusterRoleList, "V1beta1CronJob": v1beta1CronJob_1.V1beta1CronJob, "V1beta1CronJobList": v1beta1CronJobList_1.V1beta1CronJobList, "V1beta1CronJobSpec": v1beta1CronJobSpec_1.V1beta1CronJobSpec, "V1beta1CronJobStatus": v1beta1CronJobStatus_1.V1beta1CronJobStatus, "V1beta1CustomResourceColumnDefinition": v1beta1CustomResourceColumnDefinition_1.V1beta1CustomResourceColumnDefinition, "V1beta1CustomResourceConversion": v1beta1CustomResourceConversion_1.V1beta1CustomResourceConversion, "V1beta1CustomResourceDefinition": v1beta1CustomResourceDefinition_1.V1beta1CustomResourceDefinition, "V1beta1CustomResourceDefinitionCondition": v1beta1CustomResourceDefinitionCondition_1.V1beta1CustomResourceDefinitionCondition, "V1beta1CustomResourceDefinitionList": v1beta1CustomResourceDefinitionList_1.V1beta1CustomResourceDefinitionList, "V1beta1CustomResourceDefinitionNames": v1beta1CustomResourceDefinitionNames_1.V1beta1CustomResourceDefinitionNames, "V1beta1CustomResourceDefinitionSpec": v1beta1CustomResourceDefinitionSpec_1.V1beta1CustomResourceDefinitionSpec, "V1beta1CustomResourceDefinitionStatus": v1beta1CustomResourceDefinitionStatus_1.V1beta1CustomResourceDefinitionStatus, "V1beta1CustomResourceDefinitionVersion": v1beta1CustomResourceDefinitionVersion_1.V1beta1CustomResourceDefinitionVersion, "V1beta1CustomResourceSubresourceScale": v1beta1CustomResourceSubresourceScale_1.V1beta1CustomResourceSubresourceScale, "V1beta1CustomResourceSubresources": v1beta1CustomResourceSubresources_1.V1beta1CustomResourceSubresources, "V1beta1CustomResourceValidation": v1beta1CustomResourceValidation_1.V1beta1CustomResourceValidation, "V1beta1Endpoint": v1beta1Endpoint_1.V1beta1Endpoint, "V1beta1EndpointConditions": v1beta1EndpointConditions_1.V1beta1EndpointConditions, "V1beta1EndpointPort": v1beta1EndpointPort_1.V1beta1EndpointPort, "V1beta1EndpointSlice": v1beta1EndpointSlice_1.V1beta1EndpointSlice, "V1beta1EndpointSliceList": v1beta1EndpointSliceList_1.V1beta1EndpointSliceList, "V1beta1Event": v1beta1Event_1.V1beta1Event, "V1beta1EventList": v1beta1EventList_1.V1beta1EventList, "V1beta1EventSeries": v1beta1EventSeries_1.V1beta1EventSeries, "V1beta1Eviction": v1beta1Eviction_1.V1beta1Eviction, "V1beta1ExternalDocumentation": v1beta1ExternalDocumentation_1.V1beta1ExternalDocumentation, "V1beta1FSGroupStrategyOptions": v1beta1FSGroupStrategyOptions_1.V1beta1FSGroupStrategyOptions, "V1beta1FlowDistinguisherMethod": v1beta1FlowDistinguisherMethod_1.V1beta1FlowDistinguisherMethod, "V1beta1FlowSchema": v1beta1FlowSchema_1.V1beta1FlowSchema, "V1beta1FlowSchemaCondition": v1beta1FlowSchemaCondition_1.V1beta1FlowSchemaCondition, "V1beta1FlowSchemaList": v1beta1FlowSchemaList_1.V1beta1FlowSchemaList, "V1beta1FlowSchemaSpec": v1beta1FlowSchemaSpec_1.V1beta1FlowSchemaSpec, "V1beta1FlowSchemaStatus": v1beta1FlowSchemaStatus_1.V1beta1FlowSchemaStatus, "V1beta1GroupSubject": v1beta1GroupSubject_1.V1beta1GroupSubject, "V1beta1HostPortRange": v1beta1HostPortRange_1.V1beta1HostPortRange, "V1beta1IDRange": v1beta1IDRange_1.V1beta1IDRange, "V1beta1IngressClass": v1beta1IngressClass_1.V1beta1IngressClass, "V1beta1IngressClassList": v1beta1IngressClassList_1.V1beta1IngressClassList, "V1beta1IngressClassSpec": v1beta1IngressClassSpec_1.V1beta1IngressClassSpec, "V1beta1JSONSchemaProps": v1beta1JSONSchemaProps_1.V1beta1JSONSchemaProps, "V1beta1JobTemplateSpec": v1beta1JobTemplateSpec_1.V1beta1JobTemplateSpec, "V1beta1Lease": v1beta1Lease_1.V1beta1Lease, "V1beta1LeaseList": v1beta1LeaseList_1.V1beta1LeaseList, "V1beta1LeaseSpec": v1beta1LeaseSpec_1.V1beta1LeaseSpec, "V1beta1LimitResponse": v1beta1LimitResponse_1.V1beta1LimitResponse, "V1beta1LimitedPriorityLevelConfiguration": v1beta1LimitedPriorityLevelConfiguration_1.V1beta1LimitedPriorityLevelConfiguration, "V1beta1LocalSubjectAccessReview": v1beta1LocalSubjectAccessReview_1.V1beta1LocalSubjectAccessReview, "V1beta1MutatingWebhook": v1beta1MutatingWebhook_1.V1beta1MutatingWebhook, "V1beta1MutatingWebhookConfiguration": v1beta1MutatingWebhookConfiguration_1.V1beta1MutatingWebhookConfiguration, "V1beta1MutatingWebhookConfigurationList": v1beta1MutatingWebhookConfigurationList_1.V1beta1MutatingWebhookConfigurationList, "V1beta1NonResourceAttributes": v1beta1NonResourceAttributes_1.V1beta1NonResourceAttributes, "V1beta1NonResourcePolicyRule": v1beta1NonResourcePolicyRule_1.V1beta1NonResourcePolicyRule, "V1beta1NonResourceRule": v1beta1NonResourceRule_1.V1beta1NonResourceRule, "V1beta1Overhead": v1beta1Overhead_1.V1beta1Overhead, "V1beta1PodDisruptionBudget": v1beta1PodDisruptionBudget_1.V1beta1PodDisruptionBudget, "V1beta1PodDisruptionBudgetList": v1beta1PodDisruptionBudgetList_1.V1beta1PodDisruptionBudgetList, "V1beta1PodDisruptionBudgetSpec": v1beta1PodDisruptionBudgetSpec_1.V1beta1PodDisruptionBudgetSpec, "V1beta1PodDisruptionBudgetStatus": v1beta1PodDisruptionBudgetStatus_1.V1beta1PodDisruptionBudgetStatus, "V1beta1PodSecurityPolicy": v1beta1PodSecurityPolicy_1.V1beta1PodSecurityPolicy, "V1beta1PodSecurityPolicyList": v1beta1PodSecurityPolicyList_1.V1beta1PodSecurityPolicyList, "V1beta1PodSecurityPolicySpec": v1beta1PodSecurityPolicySpec_1.V1beta1PodSecurityPolicySpec, "V1beta1PolicyRule": v1beta1PolicyRule_1.V1beta1PolicyRule, "V1beta1PolicyRulesWithSubjects": v1beta1PolicyRulesWithSubjects_1.V1beta1PolicyRulesWithSubjects, "V1beta1PriorityClass": v1beta1PriorityClass_1.V1beta1PriorityClass, "V1beta1PriorityClassList": v1beta1PriorityClassList_1.V1beta1PriorityClassList, "V1beta1PriorityLevelConfiguration": v1beta1PriorityLevelConfiguration_1.V1beta1PriorityLevelConfiguration, "V1beta1PriorityLevelConfigurationCondition": v1beta1PriorityLevelConfigurationCondition_1.V1beta1PriorityLevelConfigurationCondition, "V1beta1PriorityLevelConfigurationList": v1beta1PriorityLevelConfigurationList_1.V1beta1PriorityLevelConfigurationList, "V1beta1PriorityLevelConfigurationReference": v1beta1PriorityLevelConfigurationReference_1.V1beta1PriorityLevelConfigurationReference, "V1beta1PriorityLevelConfigurationSpec": v1beta1PriorityLevelConfigurationSpec_1.V1beta1PriorityLevelConfigurationSpec, "V1beta1PriorityLevelConfigurationStatus": v1beta1PriorityLevelConfigurationStatus_1.V1beta1PriorityLevelConfigurationStatus, "V1beta1QueuingConfiguration": v1beta1QueuingConfiguration_1.V1beta1QueuingConfiguration, "V1beta1ResourceAttributes": v1beta1ResourceAttributes_1.V1beta1ResourceAttributes, "V1beta1ResourcePolicyRule": v1beta1ResourcePolicyRule_1.V1beta1ResourcePolicyRule, "V1beta1ResourceRule": v1beta1ResourceRule_1.V1beta1ResourceRule, "V1beta1Role": v1beta1Role_1.V1beta1Role, "V1beta1RoleBinding": v1beta1RoleBinding_1.V1beta1RoleBinding, "V1beta1RoleBindingList": v1beta1RoleBindingList_1.V1beta1RoleBindingList, "V1beta1RoleList": v1beta1RoleList_1.V1beta1RoleList, "V1beta1RoleRef": v1beta1RoleRef_1.V1beta1RoleRef, "V1beta1RuleWithOperations": v1beta1RuleWithOperations_1.V1beta1RuleWithOperations, "V1beta1RunAsGroupStrategyOptions": v1beta1RunAsGroupStrategyOptions_1.V1beta1RunAsGroupStrategyOptions, "V1beta1RunAsUserStrategyOptions": v1beta1RunAsUserStrategyOptions_1.V1beta1RunAsUserStrategyOptions, "V1beta1RuntimeClass": v1beta1RuntimeClass_1.V1beta1RuntimeClass, "V1beta1RuntimeClassList": v1beta1RuntimeClassList_1.V1beta1RuntimeClassList, "V1beta1RuntimeClassStrategyOptions": v1beta1RuntimeClassStrategyOptions_1.V1beta1RuntimeClassStrategyOptions, "V1beta1SELinuxStrategyOptions": v1beta1SELinuxStrategyOptions_1.V1beta1SELinuxStrategyOptions, "V1beta1Scheduling": v1beta1Scheduling_1.V1beta1Scheduling, "V1beta1SelfSubjectAccessReview": v1beta1SelfSubjectAccessReview_1.V1beta1SelfSubjectAccessReview, "V1beta1SelfSubjectAccessReviewSpec": v1beta1SelfSubjectAccessReviewSpec_1.V1beta1SelfSubjectAccessReviewSpec, "V1beta1SelfSubjectRulesReview": v1beta1SelfSubjectRulesReview_1.V1beta1SelfSubjectRulesReview, "V1beta1SelfSubjectRulesReviewSpec": v1beta1SelfSubjectRulesReviewSpec_1.V1beta1SelfSubjectRulesReviewSpec, "V1beta1ServiceAccountSubject": v1beta1ServiceAccountSubject_1.V1beta1ServiceAccountSubject, "V1beta1StorageClass": v1beta1StorageClass_1.V1beta1StorageClass, "V1beta1StorageClassList": v1beta1StorageClassList_1.V1beta1StorageClassList, "V1beta1SubjectAccessReview": v1beta1SubjectAccessReview_1.V1beta1SubjectAccessReview, "V1beta1SubjectAccessReviewSpec": v1beta1SubjectAccessReviewSpec_1.V1beta1SubjectAccessReviewSpec, "V1beta1SubjectAccessReviewStatus": v1beta1SubjectAccessReviewStatus_1.V1beta1SubjectAccessReviewStatus, "V1beta1SubjectRulesReviewStatus": v1beta1SubjectRulesReviewStatus_1.V1beta1SubjectRulesReviewStatus, "V1beta1SupplementalGroupsStrategyOptions": v1beta1SupplementalGroupsStrategyOptions_1.V1beta1SupplementalGroupsStrategyOptions, "V1beta1TokenRequest": v1beta1TokenRequest_1.V1beta1TokenRequest, "V1beta1TokenReview": v1beta1TokenReview_1.V1beta1TokenReview, "V1beta1TokenReviewSpec": v1beta1TokenReviewSpec_1.V1beta1TokenReviewSpec, "V1beta1TokenReviewStatus": v1beta1TokenReviewStatus_1.V1beta1TokenReviewStatus, "V1beta1UserInfo": v1beta1UserInfo_1.V1beta1UserInfo, "V1beta1UserSubject": v1beta1UserSubject_1.V1beta1UserSubject, "V1beta1ValidatingWebhook": v1beta1ValidatingWebhook_1.V1beta1ValidatingWebhook, "V1beta1ValidatingWebhookConfiguration": v1beta1ValidatingWebhookConfiguration_1.V1beta1ValidatingWebhookConfiguration, "V1beta1ValidatingWebhookConfigurationList": v1beta1ValidatingWebhookConfigurationList_1.V1beta1ValidatingWebhookConfigurationList, "V1beta1VolumeAttachment": v1beta1VolumeAttachment_1.V1beta1VolumeAttachment, "V1beta1VolumeAttachmentList": v1beta1VolumeAttachmentList_1.V1beta1VolumeAttachmentList, "V1beta1VolumeAttachmentSource": v1beta1VolumeAttachmentSource_1.V1beta1VolumeAttachmentSource, "V1beta1VolumeAttachmentSpec": v1beta1VolumeAttachmentSpec_1.V1beta1VolumeAttachmentSpec, "V1beta1VolumeAttachmentStatus": v1beta1VolumeAttachmentStatus_1.V1beta1VolumeAttachmentStatus, "V1beta1VolumeError": v1beta1VolumeError_1.V1beta1VolumeError, "V1beta1VolumeNodeResources": v1beta1VolumeNodeResources_1.V1beta1VolumeNodeResources, "V2alpha1CronJob": v2alpha1CronJob_1.V2alpha1CronJob, "V2alpha1CronJobList": v2alpha1CronJobList_1.V2alpha1CronJobList, "V2alpha1CronJobSpec": v2alpha1CronJobSpec_1.V2alpha1CronJobSpec, "V2alpha1CronJobStatus": v2alpha1CronJobStatus_1.V2alpha1CronJobStatus, "V2alpha1JobTemplateSpec": v2alpha1JobTemplateSpec_1.V2alpha1JobTemplateSpec, "V2beta1ContainerResourceMetricSource": v2beta1ContainerResourceMetricSource_1.V2beta1ContainerResourceMetricSource, "V2beta1ContainerResourceMetricStatus": v2beta1ContainerResourceMetricStatus_1.V2beta1ContainerResourceMetricStatus, "V2beta1CrossVersionObjectReference": v2beta1CrossVersionObjectReference_1.V2beta1CrossVersionObjectReference, "V2beta1ExternalMetricSource": v2beta1ExternalMetricSource_1.V2beta1ExternalMetricSource, "V2beta1ExternalMetricStatus": v2beta1ExternalMetricStatus_1.V2beta1ExternalMetricStatus, "V2beta1HorizontalPodAutoscaler": v2beta1HorizontalPodAutoscaler_1.V2beta1HorizontalPodAutoscaler, "V2beta1HorizontalPodAutoscalerCondition": v2beta1HorizontalPodAutoscalerCondition_1.V2beta1HorizontalPodAutoscalerCondition, "V2beta1HorizontalPodAutoscalerList": v2beta1HorizontalPodAutoscalerList_1.V2beta1HorizontalPodAutoscalerList, "V2beta1HorizontalPodAutoscalerSpec": v2beta1HorizontalPodAutoscalerSpec_1.V2beta1HorizontalPodAutoscalerSpec, "V2beta1HorizontalPodAutoscalerStatus": v2beta1HorizontalPodAutoscalerStatus_1.V2beta1HorizontalPodAutoscalerStatus, "V2beta1MetricSpec": v2beta1MetricSpec_1.V2beta1MetricSpec, "V2beta1MetricStatus": v2beta1MetricStatus_1.V2beta1MetricStatus, "V2beta1ObjectMetricSource": v2beta1ObjectMetricSource_1.V2beta1ObjectMetricSource, "V2beta1ObjectMetricStatus": v2beta1ObjectMetricStatus_1.V2beta1ObjectMetricStatus, "V2beta1PodsMetricSource": v2beta1PodsMetricSource_1.V2beta1PodsMetricSource, "V2beta1PodsMetricStatus": v2beta1PodsMetricStatus_1.V2beta1PodsMetricStatus, "V2beta1ResourceMetricSource": v2beta1ResourceMetricSource_1.V2beta1ResourceMetricSource, "V2beta1ResourceMetricStatus": v2beta1ResourceMetricStatus_1.V2beta1ResourceMetricStatus, "V2beta2ContainerResourceMetricSource": v2beta2ContainerResourceMetricSource_1.V2beta2ContainerResourceMetricSource, "V2beta2ContainerResourceMetricStatus": v2beta2ContainerResourceMetricStatus_1.V2beta2ContainerResourceMetricStatus, "V2beta2CrossVersionObjectReference": v2beta2CrossVersionObjectReference_1.V2beta2CrossVersionObjectReference, "V2beta2ExternalMetricSource": v2beta2ExternalMetricSource_1.V2beta2ExternalMetricSource, "V2beta2ExternalMetricStatus": v2beta2ExternalMetricStatus_1.V2beta2ExternalMetricStatus, "V2beta2HPAScalingPolicy": v2beta2HPAScalingPolicy_1.V2beta2HPAScalingPolicy, "V2beta2HPAScalingRules": v2beta2HPAScalingRules_1.V2beta2HPAScalingRules, "V2beta2HorizontalPodAutoscaler": v2beta2HorizontalPodAutoscaler_1.V2beta2HorizontalPodAutoscaler, "V2beta2HorizontalPodAutoscalerBehavior": v2beta2HorizontalPodAutoscalerBehavior_1.V2beta2HorizontalPodAutoscalerBehavior, "V2beta2HorizontalPodAutoscalerCondition": v2beta2HorizontalPodAutoscalerCondition_1.V2beta2HorizontalPodAutoscalerCondition, "V2beta2HorizontalPodAutoscalerList": v2beta2HorizontalPodAutoscalerList_1.V2beta2HorizontalPodAutoscalerList, "V2beta2HorizontalPodAutoscalerSpec": v2beta2HorizontalPodAutoscalerSpec_1.V2beta2HorizontalPodAutoscalerSpec, "V2beta2HorizontalPodAutoscalerStatus": v2beta2HorizontalPodAutoscalerStatus_1.V2beta2HorizontalPodAutoscalerStatus, "V2beta2MetricIdentifier": v2beta2MetricIdentifier_1.V2beta2MetricIdentifier, "V2beta2MetricSpec": v2beta2MetricSpec_1.V2beta2MetricSpec, "V2beta2MetricStatus": v2beta2MetricStatus_1.V2beta2MetricStatus, "V2beta2MetricTarget": v2beta2MetricTarget_1.V2beta2MetricTarget, "V2beta2MetricValueStatus": v2beta2MetricValueStatus_1.V2beta2MetricValueStatus, "V2beta2ObjectMetricSource": v2beta2ObjectMetricSource_1.V2beta2ObjectMetricSource, "V2beta2ObjectMetricStatus": v2beta2ObjectMetricStatus_1.V2beta2ObjectMetricStatus, "V2beta2PodsMetricSource": v2beta2PodsMetricSource_1.V2beta2PodsMetricSource, "V2beta2PodsMetricStatus": v2beta2PodsMetricStatus_1.V2beta2PodsMetricStatus, "V2beta2ResourceMetricSource": v2beta2ResourceMetricSource_1.V2beta2ResourceMetricSource, "V2beta2ResourceMetricStatus": v2beta2ResourceMetricStatus_1.V2beta2ResourceMetricStatus, "VersionInfo": versionInfo_1.VersionInfo, }; class ObjectSerializer { static findCorrectType(data, expectedType) { if (data == undefined) { return expectedType; } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { return expectedType; } else if (expectedType === "Date") { return expectedType; } else { if (enumsMap[expectedType]) { return expectedType; } if (!typeMap[expectedType]) { return expectedType; // w/e we don't know the type } // Check the discriminator let discriminatorProperty = typeMap[expectedType].discriminator; if (discriminatorProperty == null) { return expectedType; // the type does not have a discriminator. use it. } else { if (data[discriminatorProperty]) { var discriminatorType = data[discriminatorProperty]; if (typeMap[discriminatorType]) { return discriminatorType; // use the type given in the discriminator } else { return expectedType; // discriminator did not map to a type } } else { return expectedType; // discriminator was not present (or an empty string) } } } } static serialize(data, type) { if (data == undefined) { return data; } else if (primitives.indexOf(type.toLowerCase()) !== -1) { return data; } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 let subType = type.replace("Array<", ""); // Array => Type> subType = subType.substring(0, subType.length - 1); // Type> => Type let transformedData = []; for (let index in data) { let date = data[index]; transformedData.push(ObjectSerializer.serialize(date, subType)); } return transformedData; } else if (type === "Date") { return data.toISOString(); } else { if (enumsMap[type]) { return data; } if (!typeMap[type]) { // in case we dont know the type return data; } // Get the actual type of this object type = this.findCorrectType(data, type); // get the map for the correct type. let attributeTypes = typeMap[type].getAttributeTypeMap(); let instance = {}; for (let index in attributeTypes) { let attributeType = attributeTypes[index]; instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type); } return instance; } } static deserialize(data, type) { // polymorphism may change the actual type. type = ObjectSerializer.findCorrectType(data, type); if (data == undefined) { return data; } else if (primitives.indexOf(type.toLowerCase()) !== -1) { return data; } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 let subType = type.replace("Array<", ""); // Array => Type> subType = subType.substring(0, subType.length - 1); // Type> => Type let transformedData = []; for (let index in data) { let date = data[index]; transformedData.push(ObjectSerializer.deserialize(date, subType)); } return transformedData; } else if (type === "Date") { return new Date(data); } else { if (enumsMap[type]) { // is Enum return data; } if (!typeMap[type]) { // dont know the type return data; } let instance = new typeMap[type](); let attributeTypes = typeMap[type].getAttributeTypeMap(); for (let index in attributeTypes) { let attributeType = attributeTypes[index]; instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type); } return instance; } } } exports.ObjectSerializer = ObjectSerializer; class HttpBasicAuth { constructor() { this.username = ''; this.password = ''; } applyToRequest(requestOptions) { requestOptions.auth = { username: this.username, password: this.password }; } } exports.HttpBasicAuth = HttpBasicAuth; class HttpBearerAuth { constructor() { this.accessToken = ''; } applyToRequest(requestOptions) { if (requestOptions && requestOptions.headers) { const accessToken = typeof this.accessToken === 'function' ? this.accessToken() : this.accessToken; requestOptions.headers["Authorization"] = "Bearer " + accessToken; } } } exports.HttpBearerAuth = HttpBearerAuth; class ApiKeyAuth { constructor(location, paramName) { this.location = location; this.paramName = paramName; this.apiKey = ''; } applyToRequest(requestOptions) { if (this.location == "query") { requestOptions.qs[this.paramName] = this.apiKey; } else if (this.location == "header" && requestOptions && requestOptions.headers) { requestOptions.headers[this.paramName] = this.apiKey; } else if (this.location == 'cookie' && requestOptions && requestOptions.headers) { if (requestOptions.headers['Cookie']) { requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey); } else { requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey); } } } } exports.ApiKeyAuth = ApiKeyAuth; class OAuth { constructor() { this.accessToken = ''; } applyToRequest(requestOptions) { if (requestOptions && requestOptions.headers) { requestOptions.headers["Authorization"] = "Bearer " + this.accessToken; } } } exports.OAuth = OAuth; class VoidAuth { constructor() { this.username = ''; this.password = ''; } applyToRequest(_) { // Do nothing } } exports.VoidAuth = VoidAuth; //# sourceMappingURL=models.js.map /***/ }), /***/ 27197: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1HTTPIngressPath = void 0; /** * HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend. */ class NetworkingV1beta1HTTPIngressPath { static getAttributeTypeMap() { return NetworkingV1beta1HTTPIngressPath.attributeTypeMap; } } exports.NetworkingV1beta1HTTPIngressPath = NetworkingV1beta1HTTPIngressPath; NetworkingV1beta1HTTPIngressPath.discriminator = undefined; NetworkingV1beta1HTTPIngressPath.attributeTypeMap = [ { "name": "backend", "baseName": "backend", "type": "NetworkingV1beta1IngressBackend" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "pathType", "baseName": "pathType", "type": "string" } ]; //# sourceMappingURL=networkingV1beta1HTTPIngressPath.js.map /***/ }), /***/ 41668: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1HTTPIngressRuleValue = void 0; /** * HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last \'/\' and before the first \'?\' or \'#\'. */ class NetworkingV1beta1HTTPIngressRuleValue { static getAttributeTypeMap() { return NetworkingV1beta1HTTPIngressRuleValue.attributeTypeMap; } } exports.NetworkingV1beta1HTTPIngressRuleValue = NetworkingV1beta1HTTPIngressRuleValue; NetworkingV1beta1HTTPIngressRuleValue.discriminator = undefined; NetworkingV1beta1HTTPIngressRuleValue.attributeTypeMap = [ { "name": "paths", "baseName": "paths", "type": "Array" } ]; //# sourceMappingURL=networkingV1beta1HTTPIngressRuleValue.js.map /***/ }), /***/ 64660: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1Ingress = void 0; /** * Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. */ class NetworkingV1beta1Ingress { static getAttributeTypeMap() { return NetworkingV1beta1Ingress.attributeTypeMap; } } exports.NetworkingV1beta1Ingress = NetworkingV1beta1Ingress; NetworkingV1beta1Ingress.discriminator = undefined; NetworkingV1beta1Ingress.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "NetworkingV1beta1IngressSpec" }, { "name": "status", "baseName": "status", "type": "NetworkingV1beta1IngressStatus" } ]; //# sourceMappingURL=networkingV1beta1Ingress.js.map /***/ }), /***/ 36453: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1IngressBackend = void 0; /** * IngressBackend describes all endpoints for a given service and port. */ class NetworkingV1beta1IngressBackend { static getAttributeTypeMap() { return NetworkingV1beta1IngressBackend.attributeTypeMap; } } exports.NetworkingV1beta1IngressBackend = NetworkingV1beta1IngressBackend; NetworkingV1beta1IngressBackend.discriminator = undefined; NetworkingV1beta1IngressBackend.attributeTypeMap = [ { "name": "resource", "baseName": "resource", "type": "V1TypedLocalObjectReference" }, { "name": "serviceName", "baseName": "serviceName", "type": "string" }, { "name": "servicePort", "baseName": "servicePort", "type": "object" } ]; //# sourceMappingURL=networkingV1beta1IngressBackend.js.map /***/ }), /***/ 95951: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1IngressList = void 0; /** * IngressList is a collection of Ingress. */ class NetworkingV1beta1IngressList { static getAttributeTypeMap() { return NetworkingV1beta1IngressList.attributeTypeMap; } } exports.NetworkingV1beta1IngressList = NetworkingV1beta1IngressList; NetworkingV1beta1IngressList.discriminator = undefined; NetworkingV1beta1IngressList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=networkingV1beta1IngressList.js.map /***/ }), /***/ 4157: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1IngressRule = void 0; /** * IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue. */ class NetworkingV1beta1IngressRule { static getAttributeTypeMap() { return NetworkingV1beta1IngressRule.attributeTypeMap; } } exports.NetworkingV1beta1IngressRule = NetworkingV1beta1IngressRule; NetworkingV1beta1IngressRule.discriminator = undefined; NetworkingV1beta1IngressRule.attributeTypeMap = [ { "name": "host", "baseName": "host", "type": "string" }, { "name": "http", "baseName": "http", "type": "NetworkingV1beta1HTTPIngressRuleValue" } ]; //# sourceMappingURL=networkingV1beta1IngressRule.js.map /***/ }), /***/ 61752: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1IngressSpec = void 0; /** * IngressSpec describes the Ingress the user wishes to exist. */ class NetworkingV1beta1IngressSpec { static getAttributeTypeMap() { return NetworkingV1beta1IngressSpec.attributeTypeMap; } } exports.NetworkingV1beta1IngressSpec = NetworkingV1beta1IngressSpec; NetworkingV1beta1IngressSpec.discriminator = undefined; NetworkingV1beta1IngressSpec.attributeTypeMap = [ { "name": "backend", "baseName": "backend", "type": "NetworkingV1beta1IngressBackend" }, { "name": "ingressClassName", "baseName": "ingressClassName", "type": "string" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "tls", "baseName": "tls", "type": "Array" } ]; //# sourceMappingURL=networkingV1beta1IngressSpec.js.map /***/ }), /***/ 50369: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1IngressStatus = void 0; /** * IngressStatus describe the current state of the Ingress. */ class NetworkingV1beta1IngressStatus { static getAttributeTypeMap() { return NetworkingV1beta1IngressStatus.attributeTypeMap; } } exports.NetworkingV1beta1IngressStatus = NetworkingV1beta1IngressStatus; NetworkingV1beta1IngressStatus.discriminator = undefined; NetworkingV1beta1IngressStatus.attributeTypeMap = [ { "name": "loadBalancer", "baseName": "loadBalancer", "type": "V1LoadBalancerStatus" } ]; //# sourceMappingURL=networkingV1beta1IngressStatus.js.map /***/ }), /***/ 13517: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NetworkingV1beta1IngressTLS = void 0; /** * IngressTLS describes the transport layer security associated with an Ingress. */ class NetworkingV1beta1IngressTLS { static getAttributeTypeMap() { return NetworkingV1beta1IngressTLS.attributeTypeMap; } } exports.NetworkingV1beta1IngressTLS = NetworkingV1beta1IngressTLS; NetworkingV1beta1IngressTLS.discriminator = undefined; NetworkingV1beta1IngressTLS.attributeTypeMap = [ { "name": "hosts", "baseName": "hosts", "type": "Array" }, { "name": "secretName", "baseName": "secretName", "type": "string" } ]; //# sourceMappingURL=networkingV1beta1IngressTLS.js.map /***/ }), /***/ 19573: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RbacV1alpha1Subject = void 0; /** * Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names. */ class RbacV1alpha1Subject { static getAttributeTypeMap() { return RbacV1alpha1Subject.attributeTypeMap; } } exports.RbacV1alpha1Subject = RbacV1alpha1Subject; RbacV1alpha1Subject.discriminator = undefined; RbacV1alpha1Subject.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; //# sourceMappingURL=rbacV1alpha1Subject.js.map /***/ }), /***/ 99229: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RbacV1beta1Subject = void 0; /** * Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names. */ class RbacV1beta1Subject { static getAttributeTypeMap() { return RbacV1beta1Subject.attributeTypeMap; } } exports.RbacV1beta1Subject = RbacV1beta1Subject; RbacV1beta1Subject.discriminator = undefined; RbacV1beta1Subject.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; //# sourceMappingURL=rbacV1beta1Subject.js.map /***/ }), /***/ 25958: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StorageV1TokenRequest = void 0; /** * TokenRequest contains parameters of a service account token. */ class StorageV1TokenRequest { static getAttributeTypeMap() { return StorageV1TokenRequest.attributeTypeMap; } } exports.StorageV1TokenRequest = StorageV1TokenRequest; StorageV1TokenRequest.discriminator = undefined; StorageV1TokenRequest.attributeTypeMap = [ { "name": "audience", "baseName": "audience", "type": "string" }, { "name": "expirationSeconds", "baseName": "expirationSeconds", "type": "number" } ]; //# sourceMappingURL=storageV1TokenRequest.js.map /***/ }), /***/ 44481: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIGroup = void 0; /** * APIGroup contains the name, the supported versions, and the preferred version of a group. */ class V1APIGroup { static getAttributeTypeMap() { return V1APIGroup.attributeTypeMap; } } exports.V1APIGroup = V1APIGroup; V1APIGroup.discriminator = undefined; V1APIGroup.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "preferredVersion", "baseName": "preferredVersion", "type": "V1GroupVersionForDiscovery" }, { "name": "serverAddressByClientCIDRs", "baseName": "serverAddressByClientCIDRs", "type": "Array" }, { "name": "versions", "baseName": "versions", "type": "Array" } ]; //# sourceMappingURL=v1APIGroup.js.map /***/ }), /***/ 52906: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIGroupList = void 0; /** * APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis. */ class V1APIGroupList { static getAttributeTypeMap() { return V1APIGroupList.attributeTypeMap; } } exports.V1APIGroupList = V1APIGroupList; V1APIGroupList.discriminator = undefined; V1APIGroupList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" } ]; //# sourceMappingURL=v1APIGroupList.js.map /***/ }), /***/ 89033: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIResource = void 0; /** * APIResource specifies the name of a resource and whether it is namespaced. */ class V1APIResource { static getAttributeTypeMap() { return V1APIResource.attributeTypeMap; } } exports.V1APIResource = V1APIResource; V1APIResource.discriminator = undefined; V1APIResource.attributeTypeMap = [ { "name": "categories", "baseName": "categories", "type": "Array" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespaced", "baseName": "namespaced", "type": "boolean" }, { "name": "shortNames", "baseName": "shortNames", "type": "Array" }, { "name": "singularName", "baseName": "singularName", "type": "string" }, { "name": "storageVersionHash", "baseName": "storageVersionHash", "type": "string" }, { "name": "verbs", "baseName": "verbs", "type": "Array" }, { "name": "version", "baseName": "version", "type": "string" } ]; //# sourceMappingURL=v1APIResource.js.map /***/ }), /***/ 5454: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIResourceList = void 0; /** * APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced. */ class V1APIResourceList { static getAttributeTypeMap() { return V1APIResourceList.attributeTypeMap; } } exports.V1APIResourceList = V1APIResourceList; V1APIResourceList.discriminator = undefined; V1APIResourceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "groupVersion", "baseName": "groupVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "resources", "baseName": "resources", "type": "Array" } ]; //# sourceMappingURL=v1APIResourceList.js.map /***/ }), /***/ 99042: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIService = void 0; /** * APIService represents a server for a particular GroupVersion. Name must be \"version.group\". */ class V1APIService { static getAttributeTypeMap() { return V1APIService.attributeTypeMap; } } exports.V1APIService = V1APIService; V1APIService.discriminator = undefined; V1APIService.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1APIServiceSpec" }, { "name": "status", "baseName": "status", "type": "V1APIServiceStatus" } ]; //# sourceMappingURL=v1APIService.js.map /***/ }), /***/ 58352: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIServiceCondition = void 0; /** * APIServiceCondition describes the state of an APIService at a particular point */ class V1APIServiceCondition { static getAttributeTypeMap() { return V1APIServiceCondition.attributeTypeMap; } } exports.V1APIServiceCondition = V1APIServiceCondition; V1APIServiceCondition.discriminator = undefined; V1APIServiceCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1APIServiceCondition.js.map /***/ }), /***/ 87198: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIServiceList = void 0; /** * APIServiceList is a list of APIService objects. */ class V1APIServiceList { static getAttributeTypeMap() { return V1APIServiceList.attributeTypeMap; } } exports.V1APIServiceList = V1APIServiceList; V1APIServiceList.discriminator = undefined; V1APIServiceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1APIServiceList.js.map /***/ }), /***/ 61496: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIServiceSpec = void 0; /** * APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification. */ class V1APIServiceSpec { static getAttributeTypeMap() { return V1APIServiceSpec.attributeTypeMap; } } exports.V1APIServiceSpec = V1APIServiceSpec; V1APIServiceSpec.discriminator = undefined; V1APIServiceSpec.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "groupPriorityMinimum", "baseName": "groupPriorityMinimum", "type": "number" }, { "name": "insecureSkipTLSVerify", "baseName": "insecureSkipTLSVerify", "type": "boolean" }, { "name": "service", "baseName": "service", "type": "ApiregistrationV1ServiceReference" }, { "name": "version", "baseName": "version", "type": "string" }, { "name": "versionPriority", "baseName": "versionPriority", "type": "number" } ]; //# sourceMappingURL=v1APIServiceSpec.js.map /***/ }), /***/ 17883: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIServiceStatus = void 0; /** * APIServiceStatus contains derived information about an API server */ class V1APIServiceStatus { static getAttributeTypeMap() { return V1APIServiceStatus.attributeTypeMap; } } exports.V1APIServiceStatus = V1APIServiceStatus; V1APIServiceStatus.discriminator = undefined; V1APIServiceStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; //# sourceMappingURL=v1APIServiceStatus.js.map /***/ }), /***/ 93135: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1APIVersions = void 0; /** * APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API. */ class V1APIVersions { static getAttributeTypeMap() { return V1APIVersions.attributeTypeMap; } } exports.V1APIVersions = V1APIVersions; V1APIVersions.discriminator = undefined; V1APIVersions.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "serverAddressByClientCIDRs", "baseName": "serverAddressByClientCIDRs", "type": "Array" }, { "name": "versions", "baseName": "versions", "type": "Array" } ]; //# sourceMappingURL=v1APIVersions.js.map /***/ }), /***/ 39808: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1AWSElasticBlockStoreVolumeSource = void 0; /** * Represents a Persistent Disk resource in AWS. An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling. */ class V1AWSElasticBlockStoreVolumeSource { static getAttributeTypeMap() { return V1AWSElasticBlockStoreVolumeSource.attributeTypeMap; } } exports.V1AWSElasticBlockStoreVolumeSource = V1AWSElasticBlockStoreVolumeSource; V1AWSElasticBlockStoreVolumeSource.discriminator = undefined; V1AWSElasticBlockStoreVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "partition", "baseName": "partition", "type": "number" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "volumeID", "baseName": "volumeID", "type": "string" } ]; //# sourceMappingURL=v1AWSElasticBlockStoreVolumeSource.js.map /***/ }), /***/ 61957: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Affinity = void 0; /** * Affinity is a group of affinity scheduling rules. */ class V1Affinity { static getAttributeTypeMap() { return V1Affinity.attributeTypeMap; } } exports.V1Affinity = V1Affinity; V1Affinity.discriminator = undefined; V1Affinity.attributeTypeMap = [ { "name": "nodeAffinity", "baseName": "nodeAffinity", "type": "V1NodeAffinity" }, { "name": "podAffinity", "baseName": "podAffinity", "type": "V1PodAffinity" }, { "name": "podAntiAffinity", "baseName": "podAntiAffinity", "type": "V1PodAntiAffinity" } ]; //# sourceMappingURL=v1Affinity.js.map /***/ }), /***/ 90312: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1AggregationRule = void 0; /** * AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole */ class V1AggregationRule { static getAttributeTypeMap() { return V1AggregationRule.attributeTypeMap; } } exports.V1AggregationRule = V1AggregationRule; V1AggregationRule.discriminator = undefined; V1AggregationRule.attributeTypeMap = [ { "name": "clusterRoleSelectors", "baseName": "clusterRoleSelectors", "type": "Array" } ]; //# sourceMappingURL=v1AggregationRule.js.map /***/ }), /***/ 97069: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1AttachedVolume = void 0; /** * AttachedVolume describes a volume attached to a node */ class V1AttachedVolume { static getAttributeTypeMap() { return V1AttachedVolume.attributeTypeMap; } } exports.V1AttachedVolume = V1AttachedVolume; V1AttachedVolume.discriminator = undefined; V1AttachedVolume.attributeTypeMap = [ { "name": "devicePath", "baseName": "devicePath", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1AttachedVolume.js.map /***/ }), /***/ 91312: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1AzureDiskVolumeSource = void 0; /** * AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. */ class V1AzureDiskVolumeSource { static getAttributeTypeMap() { return V1AzureDiskVolumeSource.attributeTypeMap; } } exports.V1AzureDiskVolumeSource = V1AzureDiskVolumeSource; V1AzureDiskVolumeSource.discriminator = undefined; V1AzureDiskVolumeSource.attributeTypeMap = [ { "name": "cachingMode", "baseName": "cachingMode", "type": "string" }, { "name": "diskName", "baseName": "diskName", "type": "string" }, { "name": "diskURI", "baseName": "diskURI", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; //# sourceMappingURL=v1AzureDiskVolumeSource.js.map /***/ }), /***/ 23694: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1AzureFilePersistentVolumeSource = void 0; /** * AzureFile represents an Azure File Service mount on the host and bind mount to the pod. */ class V1AzureFilePersistentVolumeSource { static getAttributeTypeMap() { return V1AzureFilePersistentVolumeSource.attributeTypeMap; } } exports.V1AzureFilePersistentVolumeSource = V1AzureFilePersistentVolumeSource; V1AzureFilePersistentVolumeSource.discriminator = undefined; V1AzureFilePersistentVolumeSource.attributeTypeMap = [ { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretName", "baseName": "secretName", "type": "string" }, { "name": "secretNamespace", "baseName": "secretNamespace", "type": "string" }, { "name": "shareName", "baseName": "shareName", "type": "string" } ]; //# sourceMappingURL=v1AzureFilePersistentVolumeSource.js.map /***/ }), /***/ 95073: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1AzureFileVolumeSource = void 0; /** * AzureFile represents an Azure File Service mount on the host and bind mount to the pod. */ class V1AzureFileVolumeSource { static getAttributeTypeMap() { return V1AzureFileVolumeSource.attributeTypeMap; } } exports.V1AzureFileVolumeSource = V1AzureFileVolumeSource; V1AzureFileVolumeSource.discriminator = undefined; V1AzureFileVolumeSource.attributeTypeMap = [ { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretName", "baseName": "secretName", "type": "string" }, { "name": "shareName", "baseName": "shareName", "type": "string" } ]; //# sourceMappingURL=v1AzureFileVolumeSource.js.map /***/ }), /***/ 48551: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Binding = void 0; /** * Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. */ class V1Binding { static getAttributeTypeMap() { return V1Binding.attributeTypeMap; } } exports.V1Binding = V1Binding; V1Binding.discriminator = undefined; V1Binding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "target", "baseName": "target", "type": "V1ObjectReference" } ]; //# sourceMappingURL=v1Binding.js.map /***/ }), /***/ 68849: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1BoundObjectReference = void 0; /** * BoundObjectReference is a reference to an object that a token is bound to. */ class V1BoundObjectReference { static getAttributeTypeMap() { return V1BoundObjectReference.attributeTypeMap; } } exports.V1BoundObjectReference = V1BoundObjectReference; V1BoundObjectReference.discriminator = undefined; V1BoundObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; //# sourceMappingURL=v1BoundObjectReference.js.map /***/ }), /***/ 34144: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSIDriver = void 0; /** * CSIDriver captures information about a Container Storage Interface (CSI) volume driver deployed on the cluster. Kubernetes attach detach controller uses this object to determine whether attach is required. Kubelet uses this object to determine whether pod information needs to be passed on mount. CSIDriver objects are non-namespaced. */ class V1CSIDriver { static getAttributeTypeMap() { return V1CSIDriver.attributeTypeMap; } } exports.V1CSIDriver = V1CSIDriver; V1CSIDriver.discriminator = undefined; V1CSIDriver.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1CSIDriverSpec" } ]; //# sourceMappingURL=v1CSIDriver.js.map /***/ }), /***/ 84881: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSIDriverList = void 0; /** * CSIDriverList is a collection of CSIDriver objects. */ class V1CSIDriverList { static getAttributeTypeMap() { return V1CSIDriverList.attributeTypeMap; } } exports.V1CSIDriverList = V1CSIDriverList; V1CSIDriverList.discriminator = undefined; V1CSIDriverList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1CSIDriverList.js.map /***/ }), /***/ 11582: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSIDriverSpec = void 0; /** * CSIDriverSpec is the specification of a CSIDriver. */ class V1CSIDriverSpec { static getAttributeTypeMap() { return V1CSIDriverSpec.attributeTypeMap; } } exports.V1CSIDriverSpec = V1CSIDriverSpec; V1CSIDriverSpec.discriminator = undefined; V1CSIDriverSpec.attributeTypeMap = [ { "name": "attachRequired", "baseName": "attachRequired", "type": "boolean" }, { "name": "fsGroupPolicy", "baseName": "fsGroupPolicy", "type": "string" }, { "name": "podInfoOnMount", "baseName": "podInfoOnMount", "type": "boolean" }, { "name": "requiresRepublish", "baseName": "requiresRepublish", "type": "boolean" }, { "name": "storageCapacity", "baseName": "storageCapacity", "type": "boolean" }, { "name": "tokenRequests", "baseName": "tokenRequests", "type": "Array" }, { "name": "volumeLifecycleModes", "baseName": "volumeLifecycleModes", "type": "Array" } ]; //# sourceMappingURL=v1CSIDriverSpec.js.map /***/ }), /***/ 74315: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSINode = void 0; /** * CSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn\'t create this object. CSINode has an OwnerReference that points to the corresponding node object. */ class V1CSINode { static getAttributeTypeMap() { return V1CSINode.attributeTypeMap; } } exports.V1CSINode = V1CSINode; V1CSINode.discriminator = undefined; V1CSINode.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1CSINodeSpec" } ]; //# sourceMappingURL=v1CSINode.js.map /***/ }), /***/ 90288: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSINodeDriver = void 0; /** * CSINodeDriver holds information about the specification of one CSI driver installed on a node */ class V1CSINodeDriver { static getAttributeTypeMap() { return V1CSINodeDriver.attributeTypeMap; } } exports.V1CSINodeDriver = V1CSINodeDriver; V1CSINodeDriver.discriminator = undefined; V1CSINodeDriver.attributeTypeMap = [ { "name": "allocatable", "baseName": "allocatable", "type": "V1VolumeNodeResources" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "nodeID", "baseName": "nodeID", "type": "string" }, { "name": "topologyKeys", "baseName": "topologyKeys", "type": "Array" } ]; //# sourceMappingURL=v1CSINodeDriver.js.map /***/ }), /***/ 31918: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSINodeList = void 0; /** * CSINodeList is a collection of CSINode objects. */ class V1CSINodeList { static getAttributeTypeMap() { return V1CSINodeList.attributeTypeMap; } } exports.V1CSINodeList = V1CSINodeList; V1CSINodeList.discriminator = undefined; V1CSINodeList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1CSINodeList.js.map /***/ }), /***/ 93142: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSINodeSpec = void 0; /** * CSINodeSpec holds information about the specification of all CSI drivers installed on a node */ class V1CSINodeSpec { static getAttributeTypeMap() { return V1CSINodeSpec.attributeTypeMap; } } exports.V1CSINodeSpec = V1CSINodeSpec; V1CSINodeSpec.discriminator = undefined; V1CSINodeSpec.attributeTypeMap = [ { "name": "drivers", "baseName": "drivers", "type": "Array" } ]; //# sourceMappingURL=v1CSINodeSpec.js.map /***/ }), /***/ 98367: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSIPersistentVolumeSource = void 0; /** * Represents storage that is managed by an external CSI volume driver (Beta feature) */ class V1CSIPersistentVolumeSource { static getAttributeTypeMap() { return V1CSIPersistentVolumeSource.attributeTypeMap; } } exports.V1CSIPersistentVolumeSource = V1CSIPersistentVolumeSource; V1CSIPersistentVolumeSource.discriminator = undefined; V1CSIPersistentVolumeSource.attributeTypeMap = [ { "name": "controllerExpandSecretRef", "baseName": "controllerExpandSecretRef", "type": "V1SecretReference" }, { "name": "controllerPublishSecretRef", "baseName": "controllerPublishSecretRef", "type": "V1SecretReference" }, { "name": "driver", "baseName": "driver", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "nodePublishSecretRef", "baseName": "nodePublishSecretRef", "type": "V1SecretReference" }, { "name": "nodeStageSecretRef", "baseName": "nodeStageSecretRef", "type": "V1SecretReference" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "volumeAttributes", "baseName": "volumeAttributes", "type": "{ [key: string]: string; }" }, { "name": "volumeHandle", "baseName": "volumeHandle", "type": "string" } ]; //# sourceMappingURL=v1CSIPersistentVolumeSource.js.map /***/ }), /***/ 87598: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CSIVolumeSource = void 0; /** * Represents a source location of a volume to mount, managed by an external CSI driver */ class V1CSIVolumeSource { static getAttributeTypeMap() { return V1CSIVolumeSource.attributeTypeMap; } } exports.V1CSIVolumeSource = V1CSIVolumeSource; V1CSIVolumeSource.discriminator = undefined; V1CSIVolumeSource.attributeTypeMap = [ { "name": "driver", "baseName": "driver", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "nodePublishSecretRef", "baseName": "nodePublishSecretRef", "type": "V1LocalObjectReference" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "volumeAttributes", "baseName": "volumeAttributes", "type": "{ [key: string]: string; }" } ]; //# sourceMappingURL=v1CSIVolumeSource.js.map /***/ }), /***/ 82975: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Capabilities = void 0; /** * Adds and removes POSIX capabilities from running containers. */ class V1Capabilities { static getAttributeTypeMap() { return V1Capabilities.attributeTypeMap; } } exports.V1Capabilities = V1Capabilities; V1Capabilities.discriminator = undefined; V1Capabilities.attributeTypeMap = [ { "name": "add", "baseName": "add", "type": "Array" }, { "name": "drop", "baseName": "drop", "type": "Array" } ]; //# sourceMappingURL=v1Capabilities.js.map /***/ }), /***/ 14268: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CephFSPersistentVolumeSource = void 0; /** * Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling. */ class V1CephFSPersistentVolumeSource { static getAttributeTypeMap() { return V1CephFSPersistentVolumeSource.attributeTypeMap; } } exports.V1CephFSPersistentVolumeSource = V1CephFSPersistentVolumeSource; V1CephFSPersistentVolumeSource.discriminator = undefined; V1CephFSPersistentVolumeSource.attributeTypeMap = [ { "name": "monitors", "baseName": "monitors", "type": "Array" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretFile", "baseName": "secretFile", "type": "string" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "user", "baseName": "user", "type": "string" } ]; //# sourceMappingURL=v1CephFSPersistentVolumeSource.js.map /***/ }), /***/ 84957: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CephFSVolumeSource = void 0; /** * Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling. */ class V1CephFSVolumeSource { static getAttributeTypeMap() { return V1CephFSVolumeSource.attributeTypeMap; } } exports.V1CephFSVolumeSource = V1CephFSVolumeSource; V1CephFSVolumeSource.discriminator = undefined; V1CephFSVolumeSource.attributeTypeMap = [ { "name": "monitors", "baseName": "monitors", "type": "Array" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretFile", "baseName": "secretFile", "type": "string" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "user", "baseName": "user", "type": "string" } ]; //# sourceMappingURL=v1CephFSVolumeSource.js.map /***/ }), /***/ 99084: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CertificateSigningRequest = void 0; /** * CertificateSigningRequest objects provide a mechanism to obtain x509 certificates by submitting a certificate signing request, and having it asynchronously approved and issued. Kubelets use this API to obtain: 1. client certificates to authenticate to kube-apiserver (with the \"kubernetes.io/kube-apiserver-client-kubelet\" signerName). 2. serving certificates for TLS endpoints kube-apiserver can connect to securely (with the \"kubernetes.io/kubelet-serving\" signerName). This API can be used to request client certificates to authenticate to kube-apiserver (with the \"kubernetes.io/kube-apiserver-client\" signerName), or to obtain certificates from custom non-Kubernetes signers. */ class V1CertificateSigningRequest { static getAttributeTypeMap() { return V1CertificateSigningRequest.attributeTypeMap; } } exports.V1CertificateSigningRequest = V1CertificateSigningRequest; V1CertificateSigningRequest.discriminator = undefined; V1CertificateSigningRequest.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1CertificateSigningRequestSpec" }, { "name": "status", "baseName": "status", "type": "V1CertificateSigningRequestStatus" } ]; //# sourceMappingURL=v1CertificateSigningRequest.js.map /***/ }), /***/ 92932: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CertificateSigningRequestCondition = void 0; /** * CertificateSigningRequestCondition describes a condition of a CertificateSigningRequest object */ class V1CertificateSigningRequestCondition { static getAttributeTypeMap() { return V1CertificateSigningRequestCondition.attributeTypeMap; } } exports.V1CertificateSigningRequestCondition = V1CertificateSigningRequestCondition; V1CertificateSigningRequestCondition.discriminator = undefined; V1CertificateSigningRequestCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "lastUpdateTime", "baseName": "lastUpdateTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1CertificateSigningRequestCondition.js.map /***/ }), /***/ 31530: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CertificateSigningRequestList = void 0; /** * CertificateSigningRequestList is a collection of CertificateSigningRequest objects */ class V1CertificateSigningRequestList { static getAttributeTypeMap() { return V1CertificateSigningRequestList.attributeTypeMap; } } exports.V1CertificateSigningRequestList = V1CertificateSigningRequestList; V1CertificateSigningRequestList.discriminator = undefined; V1CertificateSigningRequestList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1CertificateSigningRequestList.js.map /***/ }), /***/ 37759: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CertificateSigningRequestSpec = void 0; /** * CertificateSigningRequestSpec contains the certificate request. */ class V1CertificateSigningRequestSpec { static getAttributeTypeMap() { return V1CertificateSigningRequestSpec.attributeTypeMap; } } exports.V1CertificateSigningRequestSpec = V1CertificateSigningRequestSpec; V1CertificateSigningRequestSpec.discriminator = undefined; V1CertificateSigningRequestSpec.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "request", "baseName": "request", "type": "string" }, { "name": "signerName", "baseName": "signerName", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "usages", "baseName": "usages", "type": "Array" }, { "name": "username", "baseName": "username", "type": "string" } ]; //# sourceMappingURL=v1CertificateSigningRequestSpec.js.map /***/ }), /***/ 38285: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CertificateSigningRequestStatus = void 0; /** * CertificateSigningRequestStatus contains conditions used to indicate approved/denied/failed status of the request, and the issued certificate. */ class V1CertificateSigningRequestStatus { static getAttributeTypeMap() { return V1CertificateSigningRequestStatus.attributeTypeMap; } } exports.V1CertificateSigningRequestStatus = V1CertificateSigningRequestStatus; V1CertificateSigningRequestStatus.discriminator = undefined; V1CertificateSigningRequestStatus.attributeTypeMap = [ { "name": "certificate", "baseName": "certificate", "type": "string" }, { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; //# sourceMappingURL=v1CertificateSigningRequestStatus.js.map /***/ }), /***/ 41888: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CinderPersistentVolumeSource = void 0; /** * Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling. */ class V1CinderPersistentVolumeSource { static getAttributeTypeMap() { return V1CinderPersistentVolumeSource.attributeTypeMap; } } exports.V1CinderPersistentVolumeSource = V1CinderPersistentVolumeSource; V1CinderPersistentVolumeSource.discriminator = undefined; V1CinderPersistentVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "volumeID", "baseName": "volumeID", "type": "string" } ]; //# sourceMappingURL=v1CinderPersistentVolumeSource.js.map /***/ }), /***/ 19111: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CinderVolumeSource = void 0; /** * Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling. */ class V1CinderVolumeSource { static getAttributeTypeMap() { return V1CinderVolumeSource.attributeTypeMap; } } exports.V1CinderVolumeSource = V1CinderVolumeSource; V1CinderVolumeSource.discriminator = undefined; V1CinderVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "volumeID", "baseName": "volumeID", "type": "string" } ]; //# sourceMappingURL=v1CinderVolumeSource.js.map /***/ }), /***/ 33913: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ClientIPConfig = void 0; /** * ClientIPConfig represents the configurations of Client IP based session affinity. */ class V1ClientIPConfig { static getAttributeTypeMap() { return V1ClientIPConfig.attributeTypeMap; } } exports.V1ClientIPConfig = V1ClientIPConfig; V1ClientIPConfig.discriminator = undefined; V1ClientIPConfig.attributeTypeMap = [ { "name": "timeoutSeconds", "baseName": "timeoutSeconds", "type": "number" } ]; //# sourceMappingURL=v1ClientIPConfig.js.map /***/ }), /***/ 61458: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ClusterRole = void 0; /** * ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. */ class V1ClusterRole { static getAttributeTypeMap() { return V1ClusterRole.attributeTypeMap; } } exports.V1ClusterRole = V1ClusterRole; V1ClusterRole.discriminator = undefined; V1ClusterRole.attributeTypeMap = [ { "name": "aggregationRule", "baseName": "aggregationRule", "type": "V1AggregationRule" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; //# sourceMappingURL=v1ClusterRole.js.map /***/ }), /***/ 32315: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ClusterRoleBinding = void 0; /** * ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. */ class V1ClusterRoleBinding { static getAttributeTypeMap() { return V1ClusterRoleBinding.attributeTypeMap; } } exports.V1ClusterRoleBinding = V1ClusterRoleBinding; V1ClusterRoleBinding.discriminator = undefined; V1ClusterRoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; //# sourceMappingURL=v1ClusterRoleBinding.js.map /***/ }), /***/ 21181: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ClusterRoleBindingList = void 0; /** * ClusterRoleBindingList is a collection of ClusterRoleBindings */ class V1ClusterRoleBindingList { static getAttributeTypeMap() { return V1ClusterRoleBindingList.attributeTypeMap; } } exports.V1ClusterRoleBindingList = V1ClusterRoleBindingList; V1ClusterRoleBindingList.discriminator = undefined; V1ClusterRoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ClusterRoleBindingList.js.map /***/ }), /***/ 95532: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ClusterRoleList = void 0; /** * ClusterRoleList is a collection of ClusterRoles */ class V1ClusterRoleList { static getAttributeTypeMap() { return V1ClusterRoleList.attributeTypeMap; } } exports.V1ClusterRoleList = V1ClusterRoleList; V1ClusterRoleList.discriminator = undefined; V1ClusterRoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ClusterRoleList.js.map /***/ }), /***/ 30578: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ComponentCondition = void 0; /** * Information about the condition of a component. */ class V1ComponentCondition { static getAttributeTypeMap() { return V1ComponentCondition.attributeTypeMap; } } exports.V1ComponentCondition = V1ComponentCondition; V1ComponentCondition.discriminator = undefined; V1ComponentCondition.attributeTypeMap = [ { "name": "error", "baseName": "error", "type": "string" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1ComponentCondition.js.map /***/ }), /***/ 2047: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ComponentStatus = void 0; /** * ComponentStatus (and ComponentStatusList) holds the cluster validation info. Deprecated: This API is deprecated in v1.19+ */ class V1ComponentStatus { static getAttributeTypeMap() { return V1ComponentStatus.attributeTypeMap; } } exports.V1ComponentStatus = V1ComponentStatus; V1ComponentStatus.discriminator = undefined; V1ComponentStatus.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" } ]; //# sourceMappingURL=v1ComponentStatus.js.map /***/ }), /***/ 38596: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ComponentStatusList = void 0; /** * Status of all the conditions for the component as a list of ComponentStatus objects. Deprecated: This API is deprecated in v1.19+ */ class V1ComponentStatusList { static getAttributeTypeMap() { return V1ComponentStatusList.attributeTypeMap; } } exports.V1ComponentStatusList = V1ComponentStatusList; V1ComponentStatusList.discriminator = undefined; V1ComponentStatusList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ComponentStatusList.js.map /***/ }), /***/ 34990: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Condition = void 0; /** * Condition contains details for one aspect of the current state of this API Resource. */ class V1Condition { static getAttributeTypeMap() { return V1Condition.attributeTypeMap; } } exports.V1Condition = V1Condition; V1Condition.discriminator = undefined; V1Condition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1Condition.js.map /***/ }), /***/ 42874: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ConfigMap = void 0; /** * ConfigMap holds configuration data for pods to consume. */ class V1ConfigMap { static getAttributeTypeMap() { return V1ConfigMap.attributeTypeMap; } } exports.V1ConfigMap = V1ConfigMap; V1ConfigMap.discriminator = undefined; V1ConfigMap.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "binaryData", "baseName": "binaryData", "type": "{ [key: string]: string; }" }, { "name": "data", "baseName": "data", "type": "{ [key: string]: string; }" }, { "name": "immutable", "baseName": "immutable", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" } ]; //# sourceMappingURL=v1ConfigMap.js.map /***/ }), /***/ 99685: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ConfigMapEnvSource = void 0; /** * ConfigMapEnvSource selects a ConfigMap to populate the environment variables with. The contents of the target ConfigMap\'s Data field will represent the key-value pairs as environment variables. */ class V1ConfigMapEnvSource { static getAttributeTypeMap() { return V1ConfigMapEnvSource.attributeTypeMap; } } exports.V1ConfigMapEnvSource = V1ConfigMapEnvSource; V1ConfigMapEnvSource.discriminator = undefined; V1ConfigMapEnvSource.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; //# sourceMappingURL=v1ConfigMapEnvSource.js.map /***/ }), /***/ 62892: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ConfigMapKeySelector = void 0; /** * Selects a key from a ConfigMap. */ class V1ConfigMapKeySelector { static getAttributeTypeMap() { return V1ConfigMapKeySelector.attributeTypeMap; } } exports.V1ConfigMapKeySelector = V1ConfigMapKeySelector; V1ConfigMapKeySelector.discriminator = undefined; V1ConfigMapKeySelector.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; //# sourceMappingURL=v1ConfigMapKeySelector.js.map /***/ }), /***/ 80512: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ConfigMapList = void 0; /** * ConfigMapList is a resource containing a list of ConfigMap objects. */ class V1ConfigMapList { static getAttributeTypeMap() { return V1ConfigMapList.attributeTypeMap; } } exports.V1ConfigMapList = V1ConfigMapList; V1ConfigMapList.discriminator = undefined; V1ConfigMapList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ConfigMapList.js.map /***/ }), /***/ 56709: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ConfigMapNodeConfigSource = void 0; /** * ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. */ class V1ConfigMapNodeConfigSource { static getAttributeTypeMap() { return V1ConfigMapNodeConfigSource.attributeTypeMap; } } exports.V1ConfigMapNodeConfigSource = V1ConfigMapNodeConfigSource; V1ConfigMapNodeConfigSource.discriminator = undefined; V1ConfigMapNodeConfigSource.attributeTypeMap = [ { "name": "kubeletConfigKey", "baseName": "kubeletConfigKey", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; //# sourceMappingURL=v1ConfigMapNodeConfigSource.js.map /***/ }), /***/ 50888: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ConfigMapProjection = void 0; /** * Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap\'s Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode. */ class V1ConfigMapProjection { static getAttributeTypeMap() { return V1ConfigMapProjection.attributeTypeMap; } } exports.V1ConfigMapProjection = V1ConfigMapProjection; V1ConfigMapProjection.discriminator = undefined; V1ConfigMapProjection.attributeTypeMap = [ { "name": "items", "baseName": "items", "type": "Array" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; //# sourceMappingURL=v1ConfigMapProjection.js.map /***/ }), /***/ 59708: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ConfigMapVolumeSource = void 0; /** * Adapts a ConfigMap into a volume. The contents of the target ConfigMap\'s Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling. */ class V1ConfigMapVolumeSource { static getAttributeTypeMap() { return V1ConfigMapVolumeSource.attributeTypeMap; } } exports.V1ConfigMapVolumeSource = V1ConfigMapVolumeSource; V1ConfigMapVolumeSource.discriminator = undefined; V1ConfigMapVolumeSource.attributeTypeMap = [ { "name": "defaultMode", "baseName": "defaultMode", "type": "number" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; //# sourceMappingURL=v1ConfigMapVolumeSource.js.map /***/ }), /***/ 52865: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Container = void 0; /** * A single application container that you want to run within a pod. */ class V1Container { static getAttributeTypeMap() { return V1Container.attributeTypeMap; } } exports.V1Container = V1Container; V1Container.discriminator = undefined; V1Container.attributeTypeMap = [ { "name": "args", "baseName": "args", "type": "Array" }, { "name": "command", "baseName": "command", "type": "Array" }, { "name": "env", "baseName": "env", "type": "Array" }, { "name": "envFrom", "baseName": "envFrom", "type": "Array" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "imagePullPolicy", "baseName": "imagePullPolicy", "type": "string" }, { "name": "lifecycle", "baseName": "lifecycle", "type": "V1Lifecycle" }, { "name": "livenessProbe", "baseName": "livenessProbe", "type": "V1Probe" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "ports", "baseName": "ports", "type": "Array" }, { "name": "readinessProbe", "baseName": "readinessProbe", "type": "V1Probe" }, { "name": "resources", "baseName": "resources", "type": "V1ResourceRequirements" }, { "name": "securityContext", "baseName": "securityContext", "type": "V1SecurityContext" }, { "name": "startupProbe", "baseName": "startupProbe", "type": "V1Probe" }, { "name": "stdin", "baseName": "stdin", "type": "boolean" }, { "name": "stdinOnce", "baseName": "stdinOnce", "type": "boolean" }, { "name": "terminationMessagePath", "baseName": "terminationMessagePath", "type": "string" }, { "name": "terminationMessagePolicy", "baseName": "terminationMessagePolicy", "type": "string" }, { "name": "tty", "baseName": "tty", "type": "boolean" }, { "name": "volumeDevices", "baseName": "volumeDevices", "type": "Array" }, { "name": "volumeMounts", "baseName": "volumeMounts", "type": "Array" }, { "name": "workingDir", "baseName": "workingDir", "type": "string" } ]; //# sourceMappingURL=v1Container.js.map /***/ }), /***/ 13501: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ContainerImage = void 0; /** * Describe a container image */ class V1ContainerImage { static getAttributeTypeMap() { return V1ContainerImage.attributeTypeMap; } } exports.V1ContainerImage = V1ContainerImage; V1ContainerImage.discriminator = undefined; V1ContainerImage.attributeTypeMap = [ { "name": "names", "baseName": "names", "type": "Array" }, { "name": "sizeBytes", "baseName": "sizeBytes", "type": "number" } ]; //# sourceMappingURL=v1ContainerImage.js.map /***/ }), /***/ 50217: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ContainerPort = void 0; /** * ContainerPort represents a network port in a single container. */ class V1ContainerPort { static getAttributeTypeMap() { return V1ContainerPort.attributeTypeMap; } } exports.V1ContainerPort = V1ContainerPort; V1ContainerPort.discriminator = undefined; V1ContainerPort.attributeTypeMap = [ { "name": "containerPort", "baseName": "containerPort", "type": "number" }, { "name": "hostIP", "baseName": "hostIP", "type": "string" }, { "name": "hostPort", "baseName": "hostPort", "type": "number" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; //# sourceMappingURL=v1ContainerPort.js.map /***/ }), /***/ 83765: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ContainerState = void 0; /** * ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting. */ class V1ContainerState { static getAttributeTypeMap() { return V1ContainerState.attributeTypeMap; } } exports.V1ContainerState = V1ContainerState; V1ContainerState.discriminator = undefined; V1ContainerState.attributeTypeMap = [ { "name": "running", "baseName": "running", "type": "V1ContainerStateRunning" }, { "name": "terminated", "baseName": "terminated", "type": "V1ContainerStateTerminated" }, { "name": "waiting", "baseName": "waiting", "type": "V1ContainerStateWaiting" } ]; //# sourceMappingURL=v1ContainerState.js.map /***/ }), /***/ 89767: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ContainerStateRunning = void 0; /** * ContainerStateRunning is a running state of a container. */ class V1ContainerStateRunning { static getAttributeTypeMap() { return V1ContainerStateRunning.attributeTypeMap; } } exports.V1ContainerStateRunning = V1ContainerStateRunning; V1ContainerStateRunning.discriminator = undefined; V1ContainerStateRunning.attributeTypeMap = [ { "name": "startedAt", "baseName": "startedAt", "type": "Date" } ]; //# sourceMappingURL=v1ContainerStateRunning.js.map /***/ }), /***/ 27892: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ContainerStateTerminated = void 0; /** * ContainerStateTerminated is a terminated state of a container. */ class V1ContainerStateTerminated { static getAttributeTypeMap() { return V1ContainerStateTerminated.attributeTypeMap; } } exports.V1ContainerStateTerminated = V1ContainerStateTerminated; V1ContainerStateTerminated.discriminator = undefined; V1ContainerStateTerminated.attributeTypeMap = [ { "name": "containerID", "baseName": "containerID", "type": "string" }, { "name": "exitCode", "baseName": "exitCode", "type": "number" }, { "name": "finishedAt", "baseName": "finishedAt", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "signal", "baseName": "signal", "type": "number" }, { "name": "startedAt", "baseName": "startedAt", "type": "Date" } ]; //# sourceMappingURL=v1ContainerStateTerminated.js.map /***/ }), /***/ 19716: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ContainerStateWaiting = void 0; /** * ContainerStateWaiting is a waiting state of a container. */ class V1ContainerStateWaiting { static getAttributeTypeMap() { return V1ContainerStateWaiting.attributeTypeMap; } } exports.V1ContainerStateWaiting = V1ContainerStateWaiting; V1ContainerStateWaiting.discriminator = undefined; V1ContainerStateWaiting.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; //# sourceMappingURL=v1ContainerStateWaiting.js.map /***/ }), /***/ 35980: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ContainerStatus = void 0; /** * ContainerStatus contains details for the current status of this container. */ class V1ContainerStatus { static getAttributeTypeMap() { return V1ContainerStatus.attributeTypeMap; } } exports.V1ContainerStatus = V1ContainerStatus; V1ContainerStatus.discriminator = undefined; V1ContainerStatus.attributeTypeMap = [ { "name": "containerID", "baseName": "containerID", "type": "string" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "imageID", "baseName": "imageID", "type": "string" }, { "name": "lastState", "baseName": "lastState", "type": "V1ContainerState" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "ready", "baseName": "ready", "type": "boolean" }, { "name": "restartCount", "baseName": "restartCount", "type": "number" }, { "name": "started", "baseName": "started", "type": "boolean" }, { "name": "state", "baseName": "state", "type": "V1ContainerState" } ]; //# sourceMappingURL=v1ContainerStatus.js.map /***/ }), /***/ 78405: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ControllerRevision = void 0; /** * ControllerRevision implements an immutable snapshot of state data. Clients are responsible for serializing and deserializing the objects that contain their internal state. Once a ControllerRevision has been successfully created, it can not be updated. The API Server will fail validation of all requests that attempt to mutate the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However, it may be subject to name and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. */ class V1ControllerRevision { static getAttributeTypeMap() { return V1ControllerRevision.attributeTypeMap; } } exports.V1ControllerRevision = V1ControllerRevision; V1ControllerRevision.discriminator = undefined; V1ControllerRevision.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "data", "baseName": "data", "type": "object" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "revision", "baseName": "revision", "type": "number" } ]; //# sourceMappingURL=v1ControllerRevision.js.map /***/ }), /***/ 66304: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ControllerRevisionList = void 0; /** * ControllerRevisionList is a resource containing a list of ControllerRevision objects. */ class V1ControllerRevisionList { static getAttributeTypeMap() { return V1ControllerRevisionList.attributeTypeMap; } } exports.V1ControllerRevisionList = V1ControllerRevisionList; V1ControllerRevisionList.discriminator = undefined; V1ControllerRevisionList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ControllerRevisionList.js.map /***/ }), /***/ 34233: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CrossVersionObjectReference = void 0; /** * CrossVersionObjectReference contains enough information to let you identify the referred resource. */ class V1CrossVersionObjectReference { static getAttributeTypeMap() { return V1CrossVersionObjectReference.attributeTypeMap; } } exports.V1CrossVersionObjectReference = V1CrossVersionObjectReference; V1CrossVersionObjectReference.discriminator = undefined; V1CrossVersionObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1CrossVersionObjectReference.js.map /***/ }), /***/ 94346: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceColumnDefinition = void 0; /** * CustomResourceColumnDefinition specifies a column for server side printing. */ class V1CustomResourceColumnDefinition { static getAttributeTypeMap() { return V1CustomResourceColumnDefinition.attributeTypeMap; } } exports.V1CustomResourceColumnDefinition = V1CustomResourceColumnDefinition; V1CustomResourceColumnDefinition.discriminator = undefined; V1CustomResourceColumnDefinition.attributeTypeMap = [ { "name": "description", "baseName": "description", "type": "string" }, { "name": "format", "baseName": "format", "type": "string" }, { "name": "jsonPath", "baseName": "jsonPath", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "priority", "baseName": "priority", "type": "number" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1CustomResourceColumnDefinition.js.map /***/ }), /***/ 9731: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceConversion = void 0; /** * CustomResourceConversion describes how to convert different versions of a CR. */ class V1CustomResourceConversion { static getAttributeTypeMap() { return V1CustomResourceConversion.attributeTypeMap; } } exports.V1CustomResourceConversion = V1CustomResourceConversion; V1CustomResourceConversion.discriminator = undefined; V1CustomResourceConversion.attributeTypeMap = [ { "name": "strategy", "baseName": "strategy", "type": "string" }, { "name": "webhook", "baseName": "webhook", "type": "V1WebhookConversion" } ]; //# sourceMappingURL=v1CustomResourceConversion.js.map /***/ }), /***/ 40325: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceDefinition = void 0; /** * CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. */ class V1CustomResourceDefinition { static getAttributeTypeMap() { return V1CustomResourceDefinition.attributeTypeMap; } } exports.V1CustomResourceDefinition = V1CustomResourceDefinition; V1CustomResourceDefinition.discriminator = undefined; V1CustomResourceDefinition.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1CustomResourceDefinitionSpec" }, { "name": "status", "baseName": "status", "type": "V1CustomResourceDefinitionStatus" } ]; //# sourceMappingURL=v1CustomResourceDefinition.js.map /***/ }), /***/ 32791: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceDefinitionCondition = void 0; /** * CustomResourceDefinitionCondition contains details for the current condition of this pod. */ class V1CustomResourceDefinitionCondition { static getAttributeTypeMap() { return V1CustomResourceDefinitionCondition.attributeTypeMap; } } exports.V1CustomResourceDefinitionCondition = V1CustomResourceDefinitionCondition; V1CustomResourceDefinitionCondition.discriminator = undefined; V1CustomResourceDefinitionCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1CustomResourceDefinitionCondition.js.map /***/ }), /***/ 10486: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceDefinitionList = void 0; /** * CustomResourceDefinitionList is a list of CustomResourceDefinition objects. */ class V1CustomResourceDefinitionList { static getAttributeTypeMap() { return V1CustomResourceDefinitionList.attributeTypeMap; } } exports.V1CustomResourceDefinitionList = V1CustomResourceDefinitionList; V1CustomResourceDefinitionList.discriminator = undefined; V1CustomResourceDefinitionList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1CustomResourceDefinitionList.js.map /***/ }), /***/ 69798: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceDefinitionNames = void 0; /** * CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition */ class V1CustomResourceDefinitionNames { static getAttributeTypeMap() { return V1CustomResourceDefinitionNames.attributeTypeMap; } } exports.V1CustomResourceDefinitionNames = V1CustomResourceDefinitionNames; V1CustomResourceDefinitionNames.discriminator = undefined; V1CustomResourceDefinitionNames.attributeTypeMap = [ { "name": "categories", "baseName": "categories", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "listKind", "baseName": "listKind", "type": "string" }, { "name": "plural", "baseName": "plural", "type": "string" }, { "name": "shortNames", "baseName": "shortNames", "type": "Array" }, { "name": "singular", "baseName": "singular", "type": "string" } ]; //# sourceMappingURL=v1CustomResourceDefinitionNames.js.map /***/ }), /***/ 20486: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceDefinitionSpec = void 0; /** * CustomResourceDefinitionSpec describes how a user wants their resource to appear */ class V1CustomResourceDefinitionSpec { static getAttributeTypeMap() { return V1CustomResourceDefinitionSpec.attributeTypeMap; } } exports.V1CustomResourceDefinitionSpec = V1CustomResourceDefinitionSpec; V1CustomResourceDefinitionSpec.discriminator = undefined; V1CustomResourceDefinitionSpec.attributeTypeMap = [ { "name": "conversion", "baseName": "conversion", "type": "V1CustomResourceConversion" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "names", "baseName": "names", "type": "V1CustomResourceDefinitionNames" }, { "name": "preserveUnknownFields", "baseName": "preserveUnknownFields", "type": "boolean" }, { "name": "scope", "baseName": "scope", "type": "string" }, { "name": "versions", "baseName": "versions", "type": "Array" } ]; //# sourceMappingURL=v1CustomResourceDefinitionSpec.js.map /***/ }), /***/ 25713: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceDefinitionStatus = void 0; /** * CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition */ class V1CustomResourceDefinitionStatus { static getAttributeTypeMap() { return V1CustomResourceDefinitionStatus.attributeTypeMap; } } exports.V1CustomResourceDefinitionStatus = V1CustomResourceDefinitionStatus; V1CustomResourceDefinitionStatus.discriminator = undefined; V1CustomResourceDefinitionStatus.attributeTypeMap = [ { "name": "acceptedNames", "baseName": "acceptedNames", "type": "V1CustomResourceDefinitionNames" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "storedVersions", "baseName": "storedVersions", "type": "Array" } ]; //# sourceMappingURL=v1CustomResourceDefinitionStatus.js.map /***/ }), /***/ 82283: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceDefinitionVersion = void 0; /** * CustomResourceDefinitionVersion describes a version for CRD. */ class V1CustomResourceDefinitionVersion { static getAttributeTypeMap() { return V1CustomResourceDefinitionVersion.attributeTypeMap; } } exports.V1CustomResourceDefinitionVersion = V1CustomResourceDefinitionVersion; V1CustomResourceDefinitionVersion.discriminator = undefined; V1CustomResourceDefinitionVersion.attributeTypeMap = [ { "name": "additionalPrinterColumns", "baseName": "additionalPrinterColumns", "type": "Array" }, { "name": "deprecated", "baseName": "deprecated", "type": "boolean" }, { "name": "deprecationWarning", "baseName": "deprecationWarning", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "schema", "baseName": "schema", "type": "V1CustomResourceValidation" }, { "name": "served", "baseName": "served", "type": "boolean" }, { "name": "storage", "baseName": "storage", "type": "boolean" }, { "name": "subresources", "baseName": "subresources", "type": "V1CustomResourceSubresources" } ]; //# sourceMappingURL=v1CustomResourceDefinitionVersion.js.map /***/ }), /***/ 98087: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceSubresourceScale = void 0; /** * CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. */ class V1CustomResourceSubresourceScale { static getAttributeTypeMap() { return V1CustomResourceSubresourceScale.attributeTypeMap; } } exports.V1CustomResourceSubresourceScale = V1CustomResourceSubresourceScale; V1CustomResourceSubresourceScale.discriminator = undefined; V1CustomResourceSubresourceScale.attributeTypeMap = [ { "name": "labelSelectorPath", "baseName": "labelSelectorPath", "type": "string" }, { "name": "specReplicasPath", "baseName": "specReplicasPath", "type": "string" }, { "name": "statusReplicasPath", "baseName": "statusReplicasPath", "type": "string" } ]; //# sourceMappingURL=v1CustomResourceSubresourceScale.js.map /***/ }), /***/ 94579: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceSubresources = void 0; /** * CustomResourceSubresources defines the status and scale subresources for CustomResources. */ class V1CustomResourceSubresources { static getAttributeTypeMap() { return V1CustomResourceSubresources.attributeTypeMap; } } exports.V1CustomResourceSubresources = V1CustomResourceSubresources; V1CustomResourceSubresources.discriminator = undefined; V1CustomResourceSubresources.attributeTypeMap = [ { "name": "scale", "baseName": "scale", "type": "V1CustomResourceSubresourceScale" }, { "name": "status", "baseName": "status", "type": "object" } ]; //# sourceMappingURL=v1CustomResourceSubresources.js.map /***/ }), /***/ 25408: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1CustomResourceValidation = void 0; /** * CustomResourceValidation is a list of validation methods for CustomResources. */ class V1CustomResourceValidation { static getAttributeTypeMap() { return V1CustomResourceValidation.attributeTypeMap; } } exports.V1CustomResourceValidation = V1CustomResourceValidation; V1CustomResourceValidation.discriminator = undefined; V1CustomResourceValidation.attributeTypeMap = [ { "name": "openAPIV3Schema", "baseName": "openAPIV3Schema", "type": "V1JSONSchemaProps" } ]; //# sourceMappingURL=v1CustomResourceValidation.js.map /***/ }), /***/ 37060: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DaemonEndpoint = void 0; /** * DaemonEndpoint contains information about a single Daemon endpoint. */ class V1DaemonEndpoint { static getAttributeTypeMap() { return V1DaemonEndpoint.attributeTypeMap; } } exports.V1DaemonEndpoint = V1DaemonEndpoint; V1DaemonEndpoint.discriminator = undefined; V1DaemonEndpoint.attributeTypeMap = [ { "name": "Port", "baseName": "Port", "type": "number" } ]; //# sourceMappingURL=v1DaemonEndpoint.js.map /***/ }), /***/ 32699: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DaemonSet = void 0; /** * DaemonSet represents the configuration of a daemon set. */ class V1DaemonSet { static getAttributeTypeMap() { return V1DaemonSet.attributeTypeMap; } } exports.V1DaemonSet = V1DaemonSet; V1DaemonSet.discriminator = undefined; V1DaemonSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1DaemonSetSpec" }, { "name": "status", "baseName": "status", "type": "V1DaemonSetStatus" } ]; //# sourceMappingURL=v1DaemonSet.js.map /***/ }), /***/ 77063: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DaemonSetCondition = void 0; /** * DaemonSetCondition describes the state of a DaemonSet at a certain point. */ class V1DaemonSetCondition { static getAttributeTypeMap() { return V1DaemonSetCondition.attributeTypeMap; } } exports.V1DaemonSetCondition = V1DaemonSetCondition; V1DaemonSetCondition.discriminator = undefined; V1DaemonSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1DaemonSetCondition.js.map /***/ }), /***/ 173: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DaemonSetList = void 0; /** * DaemonSetList is a collection of daemon sets. */ class V1DaemonSetList { static getAttributeTypeMap() { return V1DaemonSetList.attributeTypeMap; } } exports.V1DaemonSetList = V1DaemonSetList; V1DaemonSetList.discriminator = undefined; V1DaemonSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1DaemonSetList.js.map /***/ }), /***/ 44560: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DaemonSetSpec = void 0; /** * DaemonSetSpec is the specification of a daemon set. */ class V1DaemonSetSpec { static getAttributeTypeMap() { return V1DaemonSetSpec.attributeTypeMap; } } exports.V1DaemonSetSpec = V1DaemonSetSpec; V1DaemonSetSpec.discriminator = undefined; V1DaemonSetSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "updateStrategy", "baseName": "updateStrategy", "type": "V1DaemonSetUpdateStrategy" } ]; //# sourceMappingURL=v1DaemonSetSpec.js.map /***/ }), /***/ 87510: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DaemonSetStatus = void 0; /** * DaemonSetStatus represents the current status of a daemon set. */ class V1DaemonSetStatus { static getAttributeTypeMap() { return V1DaemonSetStatus.attributeTypeMap; } } exports.V1DaemonSetStatus = V1DaemonSetStatus; V1DaemonSetStatus.discriminator = undefined; V1DaemonSetStatus.attributeTypeMap = [ { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentNumberScheduled", "baseName": "currentNumberScheduled", "type": "number" }, { "name": "desiredNumberScheduled", "baseName": "desiredNumberScheduled", "type": "number" }, { "name": "numberAvailable", "baseName": "numberAvailable", "type": "number" }, { "name": "numberMisscheduled", "baseName": "numberMisscheduled", "type": "number" }, { "name": "numberReady", "baseName": "numberReady", "type": "number" }, { "name": "numberUnavailable", "baseName": "numberUnavailable", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "updatedNumberScheduled", "baseName": "updatedNumberScheduled", "type": "number" } ]; //# sourceMappingURL=v1DaemonSetStatus.js.map /***/ }), /***/ 48451: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DaemonSetUpdateStrategy = void 0; /** * DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet. */ class V1DaemonSetUpdateStrategy { static getAttributeTypeMap() { return V1DaemonSetUpdateStrategy.attributeTypeMap; } } exports.V1DaemonSetUpdateStrategy = V1DaemonSetUpdateStrategy; V1DaemonSetUpdateStrategy.discriminator = undefined; V1DaemonSetUpdateStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1RollingUpdateDaemonSet" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1DaemonSetUpdateStrategy.js.map /***/ }), /***/ 18029: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DeleteOptions = void 0; /** * DeleteOptions may be provided when deleting an API object. */ class V1DeleteOptions { static getAttributeTypeMap() { return V1DeleteOptions.attributeTypeMap; } } exports.V1DeleteOptions = V1DeleteOptions; V1DeleteOptions.discriminator = undefined; V1DeleteOptions.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "dryRun", "baseName": "dryRun", "type": "Array" }, { "name": "gracePeriodSeconds", "baseName": "gracePeriodSeconds", "type": "number" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "orphanDependents", "baseName": "orphanDependents", "type": "boolean" }, { "name": "preconditions", "baseName": "preconditions", "type": "V1Preconditions" }, { "name": "propagationPolicy", "baseName": "propagationPolicy", "type": "string" } ]; //# sourceMappingURL=v1DeleteOptions.js.map /***/ }), /***/ 65310: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Deployment = void 0; /** * Deployment enables declarative updates for Pods and ReplicaSets. */ class V1Deployment { static getAttributeTypeMap() { return V1Deployment.attributeTypeMap; } } exports.V1Deployment = V1Deployment; V1Deployment.discriminator = undefined; V1Deployment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1DeploymentSpec" }, { "name": "status", "baseName": "status", "type": "V1DeploymentStatus" } ]; //# sourceMappingURL=v1Deployment.js.map /***/ }), /***/ 95602: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DeploymentCondition = void 0; /** * DeploymentCondition describes the state of a deployment at a certain point. */ class V1DeploymentCondition { static getAttributeTypeMap() { return V1DeploymentCondition.attributeTypeMap; } } exports.V1DeploymentCondition = V1DeploymentCondition; V1DeploymentCondition.discriminator = undefined; V1DeploymentCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "lastUpdateTime", "baseName": "lastUpdateTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1DeploymentCondition.js.map /***/ }), /***/ 81364: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DeploymentList = void 0; /** * DeploymentList is a list of Deployments. */ class V1DeploymentList { static getAttributeTypeMap() { return V1DeploymentList.attributeTypeMap; } } exports.V1DeploymentList = V1DeploymentList; V1DeploymentList.discriminator = undefined; V1DeploymentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1DeploymentList.js.map /***/ }), /***/ 41298: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DeploymentSpec = void 0; /** * DeploymentSpec is the specification of the desired behavior of the Deployment. */ class V1DeploymentSpec { static getAttributeTypeMap() { return V1DeploymentSpec.attributeTypeMap; } } exports.V1DeploymentSpec = V1DeploymentSpec; V1DeploymentSpec.discriminator = undefined; V1DeploymentSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "paused", "baseName": "paused", "type": "boolean" }, { "name": "progressDeadlineSeconds", "baseName": "progressDeadlineSeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "strategy", "baseName": "strategy", "type": "V1DeploymentStrategy" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; //# sourceMappingURL=v1DeploymentSpec.js.map /***/ }), /***/ 92684: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DeploymentStatus = void 0; /** * DeploymentStatus is the most recently observed status of the Deployment. */ class V1DeploymentStatus { static getAttributeTypeMap() { return V1DeploymentStatus.attributeTypeMap; } } exports.V1DeploymentStatus = V1DeploymentStatus; V1DeploymentStatus.discriminator = undefined; V1DeploymentStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "unavailableReplicas", "baseName": "unavailableReplicas", "type": "number" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; //# sourceMappingURL=v1DeploymentStatus.js.map /***/ }), /***/ 34981: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DeploymentStrategy = void 0; /** * DeploymentStrategy describes how to replace existing pods with new ones. */ class V1DeploymentStrategy { static getAttributeTypeMap() { return V1DeploymentStrategy.attributeTypeMap; } } exports.V1DeploymentStrategy = V1DeploymentStrategy; V1DeploymentStrategy.discriminator = undefined; V1DeploymentStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1RollingUpdateDeployment" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1DeploymentStrategy.js.map /***/ }), /***/ 38099: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DownwardAPIProjection = void 0; /** * Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode. */ class V1DownwardAPIProjection { static getAttributeTypeMap() { return V1DownwardAPIProjection.attributeTypeMap; } } exports.V1DownwardAPIProjection = V1DownwardAPIProjection; V1DownwardAPIProjection.discriminator = undefined; V1DownwardAPIProjection.attributeTypeMap = [ { "name": "items", "baseName": "items", "type": "Array" } ]; //# sourceMappingURL=v1DownwardAPIProjection.js.map /***/ }), /***/ 78901: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DownwardAPIVolumeFile = void 0; /** * DownwardAPIVolumeFile represents information to create the file containing the pod field */ class V1DownwardAPIVolumeFile { static getAttributeTypeMap() { return V1DownwardAPIVolumeFile.attributeTypeMap; } } exports.V1DownwardAPIVolumeFile = V1DownwardAPIVolumeFile; V1DownwardAPIVolumeFile.discriminator = undefined; V1DownwardAPIVolumeFile.attributeTypeMap = [ { "name": "fieldRef", "baseName": "fieldRef", "type": "V1ObjectFieldSelector" }, { "name": "mode", "baseName": "mode", "type": "number" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "resourceFieldRef", "baseName": "resourceFieldRef", "type": "V1ResourceFieldSelector" } ]; //# sourceMappingURL=v1DownwardAPIVolumeFile.js.map /***/ }), /***/ 19493: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1DownwardAPIVolumeSource = void 0; /** * DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling. */ class V1DownwardAPIVolumeSource { static getAttributeTypeMap() { return V1DownwardAPIVolumeSource.attributeTypeMap; } } exports.V1DownwardAPIVolumeSource = V1DownwardAPIVolumeSource; V1DownwardAPIVolumeSource.discriminator = undefined; V1DownwardAPIVolumeSource.attributeTypeMap = [ { "name": "defaultMode", "baseName": "defaultMode", "type": "number" }, { "name": "items", "baseName": "items", "type": "Array" } ]; //# sourceMappingURL=v1DownwardAPIVolumeSource.js.map /***/ }), /***/ 11672: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EmptyDirVolumeSource = void 0; /** * Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling. */ class V1EmptyDirVolumeSource { static getAttributeTypeMap() { return V1EmptyDirVolumeSource.attributeTypeMap; } } exports.V1EmptyDirVolumeSource = V1EmptyDirVolumeSource; V1EmptyDirVolumeSource.discriminator = undefined; V1EmptyDirVolumeSource.attributeTypeMap = [ { "name": "medium", "baseName": "medium", "type": "string" }, { "name": "sizeLimit", "baseName": "sizeLimit", "type": "string" } ]; //# sourceMappingURL=v1EmptyDirVolumeSource.js.map /***/ }), /***/ 57151: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EndpointAddress = void 0; /** * EndpointAddress is a tuple that describes single IP address. */ class V1EndpointAddress { static getAttributeTypeMap() { return V1EndpointAddress.attributeTypeMap; } } exports.V1EndpointAddress = V1EndpointAddress; V1EndpointAddress.discriminator = undefined; V1EndpointAddress.attributeTypeMap = [ { "name": "hostname", "baseName": "hostname", "type": "string" }, { "name": "ip", "baseName": "ip", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "targetRef", "baseName": "targetRef", "type": "V1ObjectReference" } ]; //# sourceMappingURL=v1EndpointAddress.js.map /***/ }), /***/ 37917: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EndpointPort = void 0; /** * EndpointPort is a tuple that describes a single port. */ class V1EndpointPort { static getAttributeTypeMap() { return V1EndpointPort.attributeTypeMap; } } exports.V1EndpointPort = V1EndpointPort; V1EndpointPort.discriminator = undefined; V1EndpointPort.attributeTypeMap = [ { "name": "appProtocol", "baseName": "appProtocol", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; //# sourceMappingURL=v1EndpointPort.js.map /***/ }), /***/ 31925: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EndpointSubset = void 0; /** * EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given: { Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}], Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}] } The resulting set of endpoints can be viewed as: a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], b: [ 10.10.1.1:309, 10.10.2.2:309 ] */ class V1EndpointSubset { static getAttributeTypeMap() { return V1EndpointSubset.attributeTypeMap; } } exports.V1EndpointSubset = V1EndpointSubset; V1EndpointSubset.discriminator = undefined; V1EndpointSubset.attributeTypeMap = [ { "name": "addresses", "baseName": "addresses", "type": "Array" }, { "name": "notReadyAddresses", "baseName": "notReadyAddresses", "type": "Array" }, { "name": "ports", "baseName": "ports", "type": "Array" } ]; //# sourceMappingURL=v1EndpointSubset.js.map /***/ }), /***/ 13449: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Endpoints = void 0; /** * Endpoints is a collection of endpoints that implement the actual service. Example: Name: \"mysvc\", Subsets: [ { Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}], Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}] }, { Addresses: [{\"ip\": \"10.10.3.3\"}], Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}] }, ] */ class V1Endpoints { static getAttributeTypeMap() { return V1Endpoints.attributeTypeMap; } } exports.V1Endpoints = V1Endpoints; V1Endpoints.discriminator = undefined; V1Endpoints.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "subsets", "baseName": "subsets", "type": "Array" } ]; //# sourceMappingURL=v1Endpoints.js.map /***/ }), /***/ 95223: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EndpointsList = void 0; /** * EndpointsList is a list of endpoints. */ class V1EndpointsList { static getAttributeTypeMap() { return V1EndpointsList.attributeTypeMap; } } exports.V1EndpointsList = V1EndpointsList; V1EndpointsList.discriminator = undefined; V1EndpointsList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1EndpointsList.js.map /***/ }), /***/ 23074: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EnvFromSource = void 0; /** * EnvFromSource represents the source of a set of ConfigMaps */ class V1EnvFromSource { static getAttributeTypeMap() { return V1EnvFromSource.attributeTypeMap; } } exports.V1EnvFromSource = V1EnvFromSource; V1EnvFromSource.discriminator = undefined; V1EnvFromSource.attributeTypeMap = [ { "name": "configMapRef", "baseName": "configMapRef", "type": "V1ConfigMapEnvSource" }, { "name": "prefix", "baseName": "prefix", "type": "string" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretEnvSource" } ]; //# sourceMappingURL=v1EnvFromSource.js.map /***/ }), /***/ 36874: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EnvVar = void 0; /** * EnvVar represents an environment variable present in a Container. */ class V1EnvVar { static getAttributeTypeMap() { return V1EnvVar.attributeTypeMap; } } exports.V1EnvVar = V1EnvVar; V1EnvVar.discriminator = undefined; V1EnvVar.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" }, { "name": "valueFrom", "baseName": "valueFrom", "type": "V1EnvVarSource" } ]; //# sourceMappingURL=v1EnvVar.js.map /***/ }), /***/ 17205: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EnvVarSource = void 0; /** * EnvVarSource represents a source for the value of an EnvVar. */ class V1EnvVarSource { static getAttributeTypeMap() { return V1EnvVarSource.attributeTypeMap; } } exports.V1EnvVarSource = V1EnvVarSource; V1EnvVarSource.discriminator = undefined; V1EnvVarSource.attributeTypeMap = [ { "name": "configMapKeyRef", "baseName": "configMapKeyRef", "type": "V1ConfigMapKeySelector" }, { "name": "fieldRef", "baseName": "fieldRef", "type": "V1ObjectFieldSelector" }, { "name": "resourceFieldRef", "baseName": "resourceFieldRef", "type": "V1ResourceFieldSelector" }, { "name": "secretKeyRef", "baseName": "secretKeyRef", "type": "V1SecretKeySelector" } ]; //# sourceMappingURL=v1EnvVarSource.js.map /***/ }), /***/ 32671: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EphemeralContainer = void 0; /** * An EphemeralContainer is a container that may be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a pod is removed or restarted. If an ephemeral container causes a pod to exceed its resource allocation, the pod may be evicted. Ephemeral containers may not be added by directly updating the pod spec. They must be added via the pod\'s ephemeralcontainers subresource, and they will appear in the pod spec once added. This is an alpha feature enabled by the EphemeralContainers feature flag. */ class V1EphemeralContainer { static getAttributeTypeMap() { return V1EphemeralContainer.attributeTypeMap; } } exports.V1EphemeralContainer = V1EphemeralContainer; V1EphemeralContainer.discriminator = undefined; V1EphemeralContainer.attributeTypeMap = [ { "name": "args", "baseName": "args", "type": "Array" }, { "name": "command", "baseName": "command", "type": "Array" }, { "name": "env", "baseName": "env", "type": "Array" }, { "name": "envFrom", "baseName": "envFrom", "type": "Array" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "imagePullPolicy", "baseName": "imagePullPolicy", "type": "string" }, { "name": "lifecycle", "baseName": "lifecycle", "type": "V1Lifecycle" }, { "name": "livenessProbe", "baseName": "livenessProbe", "type": "V1Probe" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "ports", "baseName": "ports", "type": "Array" }, { "name": "readinessProbe", "baseName": "readinessProbe", "type": "V1Probe" }, { "name": "resources", "baseName": "resources", "type": "V1ResourceRequirements" }, { "name": "securityContext", "baseName": "securityContext", "type": "V1SecurityContext" }, { "name": "startupProbe", "baseName": "startupProbe", "type": "V1Probe" }, { "name": "stdin", "baseName": "stdin", "type": "boolean" }, { "name": "stdinOnce", "baseName": "stdinOnce", "type": "boolean" }, { "name": "targetContainerName", "baseName": "targetContainerName", "type": "string" }, { "name": "terminationMessagePath", "baseName": "terminationMessagePath", "type": "string" }, { "name": "terminationMessagePolicy", "baseName": "terminationMessagePolicy", "type": "string" }, { "name": "tty", "baseName": "tty", "type": "boolean" }, { "name": "volumeDevices", "baseName": "volumeDevices", "type": "Array" }, { "name": "volumeMounts", "baseName": "volumeMounts", "type": "Array" }, { "name": "workingDir", "baseName": "workingDir", "type": "string" } ]; //# sourceMappingURL=v1EphemeralContainer.js.map /***/ }), /***/ 90017: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EphemeralVolumeSource = void 0; /** * Represents an ephemeral volume that is handled by a normal storage driver. */ class V1EphemeralVolumeSource { static getAttributeTypeMap() { return V1EphemeralVolumeSource.attributeTypeMap; } } exports.V1EphemeralVolumeSource = V1EphemeralVolumeSource; V1EphemeralVolumeSource.discriminator = undefined; V1EphemeralVolumeSource.attributeTypeMap = [ { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "volumeClaimTemplate", "baseName": "volumeClaimTemplate", "type": "V1PersistentVolumeClaimTemplate" } ]; //# sourceMappingURL=v1EphemeralVolumeSource.js.map /***/ }), /***/ 97764: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1EventSource = void 0; /** * EventSource contains information for an event. */ class V1EventSource { static getAttributeTypeMap() { return V1EventSource.attributeTypeMap; } } exports.V1EventSource = V1EventSource; V1EventSource.discriminator = undefined; V1EventSource.attributeTypeMap = [ { "name": "component", "baseName": "component", "type": "string" }, { "name": "host", "baseName": "host", "type": "string" } ]; //# sourceMappingURL=v1EventSource.js.map /***/ }), /***/ 13313: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ExecAction = void 0; /** * ExecAction describes a \"run in container\" action. */ class V1ExecAction { static getAttributeTypeMap() { return V1ExecAction.attributeTypeMap; } } exports.V1ExecAction = V1ExecAction; V1ExecAction.discriminator = undefined; V1ExecAction.attributeTypeMap = [ { "name": "command", "baseName": "command", "type": "Array" } ]; //# sourceMappingURL=v1ExecAction.js.map /***/ }), /***/ 77213: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ExternalDocumentation = void 0; /** * ExternalDocumentation allows referencing an external resource for extended documentation. */ class V1ExternalDocumentation { static getAttributeTypeMap() { return V1ExternalDocumentation.attributeTypeMap; } } exports.V1ExternalDocumentation = V1ExternalDocumentation; V1ExternalDocumentation.discriminator = undefined; V1ExternalDocumentation.attributeTypeMap = [ { "name": "description", "baseName": "description", "type": "string" }, { "name": "url", "baseName": "url", "type": "string" } ]; //# sourceMappingURL=v1ExternalDocumentation.js.map /***/ }), /***/ 35093: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1FCVolumeSource = void 0; /** * Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling. */ class V1FCVolumeSource { static getAttributeTypeMap() { return V1FCVolumeSource.attributeTypeMap; } } exports.V1FCVolumeSource = V1FCVolumeSource; V1FCVolumeSource.discriminator = undefined; V1FCVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "lun", "baseName": "lun", "type": "number" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "targetWWNs", "baseName": "targetWWNs", "type": "Array" }, { "name": "wwids", "baseName": "wwids", "type": "Array" } ]; //# sourceMappingURL=v1FCVolumeSource.js.map /***/ }), /***/ 91874: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1FlexPersistentVolumeSource = void 0; /** * FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin. */ class V1FlexPersistentVolumeSource { static getAttributeTypeMap() { return V1FlexPersistentVolumeSource.attributeTypeMap; } } exports.V1FlexPersistentVolumeSource = V1FlexPersistentVolumeSource; V1FlexPersistentVolumeSource.discriminator = undefined; V1FlexPersistentVolumeSource.attributeTypeMap = [ { "name": "driver", "baseName": "driver", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "options", "baseName": "options", "type": "{ [key: string]: string; }" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" } ]; //# sourceMappingURL=v1FlexPersistentVolumeSource.js.map /***/ }), /***/ 16690: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1FlexVolumeSource = void 0; /** * FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. */ class V1FlexVolumeSource { static getAttributeTypeMap() { return V1FlexVolumeSource.attributeTypeMap; } } exports.V1FlexVolumeSource = V1FlexVolumeSource; V1FlexVolumeSource.discriminator = undefined; V1FlexVolumeSource.attributeTypeMap = [ { "name": "driver", "baseName": "driver", "type": "string" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "options", "baseName": "options", "type": "{ [key: string]: string; }" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" } ]; //# sourceMappingURL=v1FlexVolumeSource.js.map /***/ }), /***/ 10414: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1FlockerVolumeSource = void 0; /** * Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling. */ class V1FlockerVolumeSource { static getAttributeTypeMap() { return V1FlockerVolumeSource.attributeTypeMap; } } exports.V1FlockerVolumeSource = V1FlockerVolumeSource; V1FlockerVolumeSource.discriminator = undefined; V1FlockerVolumeSource.attributeTypeMap = [ { "name": "datasetName", "baseName": "datasetName", "type": "string" }, { "name": "datasetUUID", "baseName": "datasetUUID", "type": "string" } ]; //# sourceMappingURL=v1FlockerVolumeSource.js.map /***/ }), /***/ 1016: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1GCEPersistentDiskVolumeSource = void 0; /** * Represents a Persistent Disk resource in Google Compute Engine. A GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling. */ class V1GCEPersistentDiskVolumeSource { static getAttributeTypeMap() { return V1GCEPersistentDiskVolumeSource.attributeTypeMap; } } exports.V1GCEPersistentDiskVolumeSource = V1GCEPersistentDiskVolumeSource; V1GCEPersistentDiskVolumeSource.discriminator = undefined; V1GCEPersistentDiskVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "partition", "baseName": "partition", "type": "number" }, { "name": "pdName", "baseName": "pdName", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; //# sourceMappingURL=v1GCEPersistentDiskVolumeSource.js.map /***/ }), /***/ 27584: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1GitRepoVolumeSource = void 0; /** * Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod\'s container. */ class V1GitRepoVolumeSource { static getAttributeTypeMap() { return V1GitRepoVolumeSource.attributeTypeMap; } } exports.V1GitRepoVolumeSource = V1GitRepoVolumeSource; V1GitRepoVolumeSource.discriminator = undefined; V1GitRepoVolumeSource.attributeTypeMap = [ { "name": "directory", "baseName": "directory", "type": "string" }, { "name": "repository", "baseName": "repository", "type": "string" }, { "name": "revision", "baseName": "revision", "type": "string" } ]; //# sourceMappingURL=v1GitRepoVolumeSource.js.map /***/ }), /***/ 97617: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1GlusterfsPersistentVolumeSource = void 0; /** * Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling. */ class V1GlusterfsPersistentVolumeSource { static getAttributeTypeMap() { return V1GlusterfsPersistentVolumeSource.attributeTypeMap; } } exports.V1GlusterfsPersistentVolumeSource = V1GlusterfsPersistentVolumeSource; V1GlusterfsPersistentVolumeSource.discriminator = undefined; V1GlusterfsPersistentVolumeSource.attributeTypeMap = [ { "name": "endpoints", "baseName": "endpoints", "type": "string" }, { "name": "endpointsNamespace", "baseName": "endpointsNamespace", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; //# sourceMappingURL=v1GlusterfsPersistentVolumeSource.js.map /***/ }), /***/ 37426: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1GlusterfsVolumeSource = void 0; /** * Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling. */ class V1GlusterfsVolumeSource { static getAttributeTypeMap() { return V1GlusterfsVolumeSource.attributeTypeMap; } } exports.V1GlusterfsVolumeSource = V1GlusterfsVolumeSource; V1GlusterfsVolumeSource.discriminator = undefined; V1GlusterfsVolumeSource.attributeTypeMap = [ { "name": "endpoints", "baseName": "endpoints", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; //# sourceMappingURL=v1GlusterfsVolumeSource.js.map /***/ }), /***/ 87855: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1GroupVersionForDiscovery = void 0; /** * GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility. */ class V1GroupVersionForDiscovery { static getAttributeTypeMap() { return V1GroupVersionForDiscovery.attributeTypeMap; } } exports.V1GroupVersionForDiscovery = V1GroupVersionForDiscovery; V1GroupVersionForDiscovery.discriminator = undefined; V1GroupVersionForDiscovery.attributeTypeMap = [ { "name": "groupVersion", "baseName": "groupVersion", "type": "string" }, { "name": "version", "baseName": "version", "type": "string" } ]; //# sourceMappingURL=v1GroupVersionForDiscovery.js.map /***/ }), /***/ 16636: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HTTPGetAction = void 0; /** * HTTPGetAction describes an action based on HTTP Get requests. */ class V1HTTPGetAction { static getAttributeTypeMap() { return V1HTTPGetAction.attributeTypeMap; } } exports.V1HTTPGetAction = V1HTTPGetAction; V1HTTPGetAction.discriminator = undefined; V1HTTPGetAction.attributeTypeMap = [ { "name": "host", "baseName": "host", "type": "string" }, { "name": "httpHeaders", "baseName": "httpHeaders", "type": "Array" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "port", "baseName": "port", "type": "object" }, { "name": "scheme", "baseName": "scheme", "type": "string" } ]; //# sourceMappingURL=v1HTTPGetAction.js.map /***/ }), /***/ 3437: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HTTPHeader = void 0; /** * HTTPHeader describes a custom header to be used in HTTP probes */ class V1HTTPHeader { static getAttributeTypeMap() { return V1HTTPHeader.attributeTypeMap; } } exports.V1HTTPHeader = V1HTTPHeader; V1HTTPHeader.discriminator = undefined; V1HTTPHeader.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; //# sourceMappingURL=v1HTTPHeader.js.map /***/ }), /***/ 86769: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HTTPIngressPath = void 0; /** * HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend. */ class V1HTTPIngressPath { static getAttributeTypeMap() { return V1HTTPIngressPath.attributeTypeMap; } } exports.V1HTTPIngressPath = V1HTTPIngressPath; V1HTTPIngressPath.discriminator = undefined; V1HTTPIngressPath.attributeTypeMap = [ { "name": "backend", "baseName": "backend", "type": "V1IngressBackend" }, { "name": "path", "baseName": "path", "type": "string" }, { "name": "pathType", "baseName": "pathType", "type": "string" } ]; //# sourceMappingURL=v1HTTPIngressPath.js.map /***/ }), /***/ 56219: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HTTPIngressRuleValue = void 0; /** * HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last \'/\' and before the first \'?\' or \'#\'. */ class V1HTTPIngressRuleValue { static getAttributeTypeMap() { return V1HTTPIngressRuleValue.attributeTypeMap; } } exports.V1HTTPIngressRuleValue = V1HTTPIngressRuleValue; V1HTTPIngressRuleValue.discriminator = undefined; V1HTTPIngressRuleValue.attributeTypeMap = [ { "name": "paths", "baseName": "paths", "type": "Array" } ]; //# sourceMappingURL=v1HTTPIngressRuleValue.js.map /***/ }), /***/ 95179: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Handler = void 0; /** * Handler defines a specific action that should be taken */ class V1Handler { static getAttributeTypeMap() { return V1Handler.attributeTypeMap; } } exports.V1Handler = V1Handler; V1Handler.discriminator = undefined; V1Handler.attributeTypeMap = [ { "name": "exec", "baseName": "exec", "type": "V1ExecAction" }, { "name": "httpGet", "baseName": "httpGet", "type": "V1HTTPGetAction" }, { "name": "tcpSocket", "baseName": "tcpSocket", "type": "V1TCPSocketAction" } ]; //# sourceMappingURL=v1Handler.js.map /***/ }), /***/ 93652: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HorizontalPodAutoscaler = void 0; /** * configuration of a horizontal pod autoscaler. */ class V1HorizontalPodAutoscaler { static getAttributeTypeMap() { return V1HorizontalPodAutoscaler.attributeTypeMap; } } exports.V1HorizontalPodAutoscaler = V1HorizontalPodAutoscaler; V1HorizontalPodAutoscaler.discriminator = undefined; V1HorizontalPodAutoscaler.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1HorizontalPodAutoscalerSpec" }, { "name": "status", "baseName": "status", "type": "V1HorizontalPodAutoscalerStatus" } ]; //# sourceMappingURL=v1HorizontalPodAutoscaler.js.map /***/ }), /***/ 17024: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HorizontalPodAutoscalerList = void 0; /** * list of horizontal pod autoscaler objects. */ class V1HorizontalPodAutoscalerList { static getAttributeTypeMap() { return V1HorizontalPodAutoscalerList.attributeTypeMap; } } exports.V1HorizontalPodAutoscalerList = V1HorizontalPodAutoscalerList; V1HorizontalPodAutoscalerList.discriminator = undefined; V1HorizontalPodAutoscalerList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1HorizontalPodAutoscalerList.js.map /***/ }), /***/ 49823: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HorizontalPodAutoscalerSpec = void 0; /** * specification of a horizontal pod autoscaler. */ class V1HorizontalPodAutoscalerSpec { static getAttributeTypeMap() { return V1HorizontalPodAutoscalerSpec.attributeTypeMap; } } exports.V1HorizontalPodAutoscalerSpec = V1HorizontalPodAutoscalerSpec; V1HorizontalPodAutoscalerSpec.discriminator = undefined; V1HorizontalPodAutoscalerSpec.attributeTypeMap = [ { "name": "maxReplicas", "baseName": "maxReplicas", "type": "number" }, { "name": "minReplicas", "baseName": "minReplicas", "type": "number" }, { "name": "scaleTargetRef", "baseName": "scaleTargetRef", "type": "V1CrossVersionObjectReference" }, { "name": "targetCPUUtilizationPercentage", "baseName": "targetCPUUtilizationPercentage", "type": "number" } ]; //# sourceMappingURL=v1HorizontalPodAutoscalerSpec.js.map /***/ }), /***/ 50910: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HorizontalPodAutoscalerStatus = void 0; /** * current status of a horizontal pod autoscaler */ class V1HorizontalPodAutoscalerStatus { static getAttributeTypeMap() { return V1HorizontalPodAutoscalerStatus.attributeTypeMap; } } exports.V1HorizontalPodAutoscalerStatus = V1HorizontalPodAutoscalerStatus; V1HorizontalPodAutoscalerStatus.discriminator = undefined; V1HorizontalPodAutoscalerStatus.attributeTypeMap = [ { "name": "currentCPUUtilizationPercentage", "baseName": "currentCPUUtilizationPercentage", "type": "number" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "desiredReplicas", "baseName": "desiredReplicas", "type": "number" }, { "name": "lastScaleTime", "baseName": "lastScaleTime", "type": "Date" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" } ]; //# sourceMappingURL=v1HorizontalPodAutoscalerStatus.js.map /***/ }), /***/ 72796: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HostAlias = void 0; /** * HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod\'s hosts file. */ class V1HostAlias { static getAttributeTypeMap() { return V1HostAlias.attributeTypeMap; } } exports.V1HostAlias = V1HostAlias; V1HostAlias.discriminator = undefined; V1HostAlias.attributeTypeMap = [ { "name": "hostnames", "baseName": "hostnames", "type": "Array" }, { "name": "ip", "baseName": "ip", "type": "string" } ]; //# sourceMappingURL=v1HostAlias.js.map /***/ }), /***/ 69225: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1HostPathVolumeSource = void 0; /** * Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling. */ class V1HostPathVolumeSource { static getAttributeTypeMap() { return V1HostPathVolumeSource.attributeTypeMap; } } exports.V1HostPathVolumeSource = V1HostPathVolumeSource; V1HostPathVolumeSource.discriminator = undefined; V1HostPathVolumeSource.attributeTypeMap = [ { "name": "path", "baseName": "path", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1HostPathVolumeSource.js.map /***/ }), /***/ 49202: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IPBlock = void 0; /** * IPBlock describes a particular CIDR (Ex. \"192.168.1.1/24\",\"2001:db9::/64\") that is allowed to the pods matched by a NetworkPolicySpec\'s podSelector. The except entry describes CIDRs that should not be included within this rule. */ class V1IPBlock { static getAttributeTypeMap() { return V1IPBlock.attributeTypeMap; } } exports.V1IPBlock = V1IPBlock; V1IPBlock.discriminator = undefined; V1IPBlock.attributeTypeMap = [ { "name": "cidr", "baseName": "cidr", "type": "string" }, { "name": "except", "baseName": "except", "type": "Array" } ]; //# sourceMappingURL=v1IPBlock.js.map /***/ }), /***/ 83570: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ISCSIPersistentVolumeSource = void 0; /** * ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling. */ class V1ISCSIPersistentVolumeSource { static getAttributeTypeMap() { return V1ISCSIPersistentVolumeSource.attributeTypeMap; } } exports.V1ISCSIPersistentVolumeSource = V1ISCSIPersistentVolumeSource; V1ISCSIPersistentVolumeSource.discriminator = undefined; V1ISCSIPersistentVolumeSource.attributeTypeMap = [ { "name": "chapAuthDiscovery", "baseName": "chapAuthDiscovery", "type": "boolean" }, { "name": "chapAuthSession", "baseName": "chapAuthSession", "type": "boolean" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "initiatorName", "baseName": "initiatorName", "type": "string" }, { "name": "iqn", "baseName": "iqn", "type": "string" }, { "name": "iscsiInterface", "baseName": "iscsiInterface", "type": "string" }, { "name": "lun", "baseName": "lun", "type": "number" }, { "name": "portals", "baseName": "portals", "type": "Array" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "targetPortal", "baseName": "targetPortal", "type": "string" } ]; //# sourceMappingURL=v1ISCSIPersistentVolumeSource.js.map /***/ }), /***/ 68021: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ISCSIVolumeSource = void 0; /** * Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling. */ class V1ISCSIVolumeSource { static getAttributeTypeMap() { return V1ISCSIVolumeSource.attributeTypeMap; } } exports.V1ISCSIVolumeSource = V1ISCSIVolumeSource; V1ISCSIVolumeSource.discriminator = undefined; V1ISCSIVolumeSource.attributeTypeMap = [ { "name": "chapAuthDiscovery", "baseName": "chapAuthDiscovery", "type": "boolean" }, { "name": "chapAuthSession", "baseName": "chapAuthSession", "type": "boolean" }, { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "initiatorName", "baseName": "initiatorName", "type": "string" }, { "name": "iqn", "baseName": "iqn", "type": "string" }, { "name": "iscsiInterface", "baseName": "iscsiInterface", "type": "string" }, { "name": "lun", "baseName": "lun", "type": "number" }, { "name": "portals", "baseName": "portals", "type": "Array" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "targetPortal", "baseName": "targetPortal", "type": "string" } ]; //# sourceMappingURL=v1ISCSIVolumeSource.js.map /***/ }), /***/ 32492: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Ingress = void 0; /** * Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. */ class V1Ingress { static getAttributeTypeMap() { return V1Ingress.attributeTypeMap; } } exports.V1Ingress = V1Ingress; V1Ingress.discriminator = undefined; V1Ingress.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1IngressSpec" }, { "name": "status", "baseName": "status", "type": "V1IngressStatus" } ]; //# sourceMappingURL=v1Ingress.js.map /***/ }), /***/ 44340: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressBackend = void 0; /** * IngressBackend describes all endpoints for a given service and port. */ class V1IngressBackend { static getAttributeTypeMap() { return V1IngressBackend.attributeTypeMap; } } exports.V1IngressBackend = V1IngressBackend; V1IngressBackend.discriminator = undefined; V1IngressBackend.attributeTypeMap = [ { "name": "resource", "baseName": "resource", "type": "V1TypedLocalObjectReference" }, { "name": "service", "baseName": "service", "type": "V1IngressServiceBackend" } ]; //# sourceMappingURL=v1IngressBackend.js.map /***/ }), /***/ 93865: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressClass = void 0; /** * IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be used to indicate that an IngressClass should be considered default. When a single IngressClass resource has this annotation set to true, new Ingress resources without a class specified will be assigned this default class. */ class V1IngressClass { static getAttributeTypeMap() { return V1IngressClass.attributeTypeMap; } } exports.V1IngressClass = V1IngressClass; V1IngressClass.discriminator = undefined; V1IngressClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1IngressClassSpec" } ]; //# sourceMappingURL=v1IngressClass.js.map /***/ }), /***/ 76125: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressClassList = void 0; /** * IngressClassList is a collection of IngressClasses. */ class V1IngressClassList { static getAttributeTypeMap() { return V1IngressClassList.attributeTypeMap; } } exports.V1IngressClassList = V1IngressClassList; V1IngressClassList.discriminator = undefined; V1IngressClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1IngressClassList.js.map /***/ }), /***/ 92069: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressClassSpec = void 0; /** * IngressClassSpec provides information about the class of an Ingress. */ class V1IngressClassSpec { static getAttributeTypeMap() { return V1IngressClassSpec.attributeTypeMap; } } exports.V1IngressClassSpec = V1IngressClassSpec; V1IngressClassSpec.discriminator = undefined; V1IngressClassSpec.attributeTypeMap = [ { "name": "controller", "baseName": "controller", "type": "string" }, { "name": "parameters", "baseName": "parameters", "type": "V1TypedLocalObjectReference" } ]; //# sourceMappingURL=v1IngressClassSpec.js.map /***/ }), /***/ 43693: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressList = void 0; /** * IngressList is a collection of Ingress. */ class V1IngressList { static getAttributeTypeMap() { return V1IngressList.attributeTypeMap; } } exports.V1IngressList = V1IngressList; V1IngressList.discriminator = undefined; V1IngressList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1IngressList.js.map /***/ }), /***/ 89541: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressRule = void 0; /** * IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue. */ class V1IngressRule { static getAttributeTypeMap() { return V1IngressRule.attributeTypeMap; } } exports.V1IngressRule = V1IngressRule; V1IngressRule.discriminator = undefined; V1IngressRule.attributeTypeMap = [ { "name": "host", "baseName": "host", "type": "string" }, { "name": "http", "baseName": "http", "type": "V1HTTPIngressRuleValue" } ]; //# sourceMappingURL=v1IngressRule.js.map /***/ }), /***/ 62476: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressServiceBackend = void 0; /** * IngressServiceBackend references a Kubernetes Service as a Backend. */ class V1IngressServiceBackend { static getAttributeTypeMap() { return V1IngressServiceBackend.attributeTypeMap; } } exports.V1IngressServiceBackend = V1IngressServiceBackend; V1IngressServiceBackend.discriminator = undefined; V1IngressServiceBackend.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "port", "baseName": "port", "type": "V1ServiceBackendPort" } ]; //# sourceMappingURL=v1IngressServiceBackend.js.map /***/ }), /***/ 59689: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressSpec = void 0; /** * IngressSpec describes the Ingress the user wishes to exist. */ class V1IngressSpec { static getAttributeTypeMap() { return V1IngressSpec.attributeTypeMap; } } exports.V1IngressSpec = V1IngressSpec; V1IngressSpec.discriminator = undefined; V1IngressSpec.attributeTypeMap = [ { "name": "defaultBackend", "baseName": "defaultBackend", "type": "V1IngressBackend" }, { "name": "ingressClassName", "baseName": "ingressClassName", "type": "string" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "tls", "baseName": "tls", "type": "Array" } ]; //# sourceMappingURL=v1IngressSpec.js.map /***/ }), /***/ 45830: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressStatus = void 0; /** * IngressStatus describe the current state of the Ingress. */ class V1IngressStatus { static getAttributeTypeMap() { return V1IngressStatus.attributeTypeMap; } } exports.V1IngressStatus = V1IngressStatus; V1IngressStatus.discriminator = undefined; V1IngressStatus.attributeTypeMap = [ { "name": "loadBalancer", "baseName": "loadBalancer", "type": "V1LoadBalancerStatus" } ]; //# sourceMappingURL=v1IngressStatus.js.map /***/ }), /***/ 23037: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1IngressTLS = void 0; /** * IngressTLS describes the transport layer security associated with an Ingress. */ class V1IngressTLS { static getAttributeTypeMap() { return V1IngressTLS.attributeTypeMap; } } exports.V1IngressTLS = V1IngressTLS; V1IngressTLS.discriminator = undefined; V1IngressTLS.attributeTypeMap = [ { "name": "hosts", "baseName": "hosts", "type": "Array" }, { "name": "secretName", "baseName": "secretName", "type": "string" } ]; //# sourceMappingURL=v1IngressTLS.js.map /***/ }), /***/ 63580: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1JSONSchemaProps = void 0; /** * JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). */ class V1JSONSchemaProps { static getAttributeTypeMap() { return V1JSONSchemaProps.attributeTypeMap; } } exports.V1JSONSchemaProps = V1JSONSchemaProps; V1JSONSchemaProps.discriminator = undefined; V1JSONSchemaProps.attributeTypeMap = [ { "name": "$ref", "baseName": "$ref", "type": "string" }, { "name": "$schema", "baseName": "$schema", "type": "string" }, { "name": "additionalItems", "baseName": "additionalItems", "type": "object" }, { "name": "additionalProperties", "baseName": "additionalProperties", "type": "object" }, { "name": "allOf", "baseName": "allOf", "type": "Array" }, { "name": "anyOf", "baseName": "anyOf", "type": "Array" }, { "name": "_default", "baseName": "default", "type": "object" }, { "name": "definitions", "baseName": "definitions", "type": "{ [key: string]: V1JSONSchemaProps; }" }, { "name": "dependencies", "baseName": "dependencies", "type": "{ [key: string]: object; }" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "_enum", "baseName": "enum", "type": "Array" }, { "name": "example", "baseName": "example", "type": "object" }, { "name": "exclusiveMaximum", "baseName": "exclusiveMaximum", "type": "boolean" }, { "name": "exclusiveMinimum", "baseName": "exclusiveMinimum", "type": "boolean" }, { "name": "externalDocs", "baseName": "externalDocs", "type": "V1ExternalDocumentation" }, { "name": "format", "baseName": "format", "type": "string" }, { "name": "id", "baseName": "id", "type": "string" }, { "name": "items", "baseName": "items", "type": "object" }, { "name": "maxItems", "baseName": "maxItems", "type": "number" }, { "name": "maxLength", "baseName": "maxLength", "type": "number" }, { "name": "maxProperties", "baseName": "maxProperties", "type": "number" }, { "name": "maximum", "baseName": "maximum", "type": "number" }, { "name": "minItems", "baseName": "minItems", "type": "number" }, { "name": "minLength", "baseName": "minLength", "type": "number" }, { "name": "minProperties", "baseName": "minProperties", "type": "number" }, { "name": "minimum", "baseName": "minimum", "type": "number" }, { "name": "multipleOf", "baseName": "multipleOf", "type": "number" }, { "name": "not", "baseName": "not", "type": "V1JSONSchemaProps" }, { "name": "nullable", "baseName": "nullable", "type": "boolean" }, { "name": "oneOf", "baseName": "oneOf", "type": "Array" }, { "name": "pattern", "baseName": "pattern", "type": "string" }, { "name": "patternProperties", "baseName": "patternProperties", "type": "{ [key: string]: V1JSONSchemaProps; }" }, { "name": "properties", "baseName": "properties", "type": "{ [key: string]: V1JSONSchemaProps; }" }, { "name": "required", "baseName": "required", "type": "Array" }, { "name": "title", "baseName": "title", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" }, { "name": "uniqueItems", "baseName": "uniqueItems", "type": "boolean" }, { "name": "x_kubernetes_embedded_resource", "baseName": "x-kubernetes-embedded-resource", "type": "boolean" }, { "name": "x_kubernetes_int_or_string", "baseName": "x-kubernetes-int-or-string", "type": "boolean" }, { "name": "x_kubernetes_list_map_keys", "baseName": "x-kubernetes-list-map-keys", "type": "Array" }, { "name": "x_kubernetes_list_type", "baseName": "x-kubernetes-list-type", "type": "string" }, { "name": "x_kubernetes_map_type", "baseName": "x-kubernetes-map-type", "type": "string" }, { "name": "x_kubernetes_preserve_unknown_fields", "baseName": "x-kubernetes-preserve-unknown-fields", "type": "boolean" } ]; //# sourceMappingURL=v1JSONSchemaProps.js.map /***/ }), /***/ 91260: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Job = void 0; /** * Job represents the configuration of a single job. */ class V1Job { static getAttributeTypeMap() { return V1Job.attributeTypeMap; } } exports.V1Job = V1Job; V1Job.discriminator = undefined; V1Job.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1JobSpec" }, { "name": "status", "baseName": "status", "type": "V1JobStatus" } ]; //# sourceMappingURL=v1Job.js.map /***/ }), /***/ 94069: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1JobCondition = void 0; /** * JobCondition describes current state of a job. */ class V1JobCondition { static getAttributeTypeMap() { return V1JobCondition.attributeTypeMap; } } exports.V1JobCondition = V1JobCondition; V1JobCondition.discriminator = undefined; V1JobCondition.attributeTypeMap = [ { "name": "lastProbeTime", "baseName": "lastProbeTime", "type": "Date" }, { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1JobCondition.js.map /***/ }), /***/ 13366: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1JobList = void 0; /** * JobList is a collection of jobs. */ class V1JobList { static getAttributeTypeMap() { return V1JobList.attributeTypeMap; } } exports.V1JobList = V1JobList; V1JobList.discriminator = undefined; V1JobList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1JobList.js.map /***/ }), /***/ 93114: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1JobSpec = void 0; /** * JobSpec describes how the job execution will look like. */ class V1JobSpec { static getAttributeTypeMap() { return V1JobSpec.attributeTypeMap; } } exports.V1JobSpec = V1JobSpec; V1JobSpec.discriminator = undefined; V1JobSpec.attributeTypeMap = [ { "name": "activeDeadlineSeconds", "baseName": "activeDeadlineSeconds", "type": "number" }, { "name": "backoffLimit", "baseName": "backoffLimit", "type": "number" }, { "name": "completions", "baseName": "completions", "type": "number" }, { "name": "manualSelector", "baseName": "manualSelector", "type": "boolean" }, { "name": "parallelism", "baseName": "parallelism", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "ttlSecondsAfterFinished", "baseName": "ttlSecondsAfterFinished", "type": "number" } ]; //# sourceMappingURL=v1JobSpec.js.map /***/ }), /***/ 57345: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1JobStatus = void 0; /** * JobStatus represents the current state of a Job. */ class V1JobStatus { static getAttributeTypeMap() { return V1JobStatus.attributeTypeMap; } } exports.V1JobStatus = V1JobStatus; V1JobStatus.discriminator = undefined; V1JobStatus.attributeTypeMap = [ { "name": "active", "baseName": "active", "type": "number" }, { "name": "completionTime", "baseName": "completionTime", "type": "Date" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "failed", "baseName": "failed", "type": "number" }, { "name": "startTime", "baseName": "startTime", "type": "Date" }, { "name": "succeeded", "baseName": "succeeded", "type": "number" } ]; //# sourceMappingURL=v1JobStatus.js.map /***/ }), /***/ 23549: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1KeyToPath = void 0; /** * Maps a string key to a path within a volume. */ class V1KeyToPath { static getAttributeTypeMap() { return V1KeyToPath.attributeTypeMap; } } exports.V1KeyToPath = V1KeyToPath; V1KeyToPath.discriminator = undefined; V1KeyToPath.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "mode", "baseName": "mode", "type": "number" }, { "name": "path", "baseName": "path", "type": "string" } ]; //# sourceMappingURL=v1KeyToPath.js.map /***/ }), /***/ 22567: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LabelSelector = void 0; /** * A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. */ class V1LabelSelector { static getAttributeTypeMap() { return V1LabelSelector.attributeTypeMap; } } exports.V1LabelSelector = V1LabelSelector; V1LabelSelector.discriminator = undefined; V1LabelSelector.attributeTypeMap = [ { "name": "matchExpressions", "baseName": "matchExpressions", "type": "Array" }, { "name": "matchLabels", "baseName": "matchLabels", "type": "{ [key: string]: string; }" } ]; //# sourceMappingURL=v1LabelSelector.js.map /***/ }), /***/ 50993: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LabelSelectorRequirement = void 0; /** * A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. */ class V1LabelSelectorRequirement { static getAttributeTypeMap() { return V1LabelSelectorRequirement.attributeTypeMap; } } exports.V1LabelSelectorRequirement = V1LabelSelectorRequirement; V1LabelSelectorRequirement.discriminator = undefined; V1LabelSelectorRequirement.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "operator", "baseName": "operator", "type": "string" }, { "name": "values", "baseName": "values", "type": "Array" } ]; //# sourceMappingURL=v1LabelSelectorRequirement.js.map /***/ }), /***/ 98844: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Lease = void 0; /** * Lease defines a lease concept. */ class V1Lease { static getAttributeTypeMap() { return V1Lease.attributeTypeMap; } } exports.V1Lease = V1Lease; V1Lease.discriminator = undefined; V1Lease.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1LeaseSpec" } ]; //# sourceMappingURL=v1Lease.js.map /***/ }), /***/ 76838: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LeaseList = void 0; /** * LeaseList is a list of Lease objects. */ class V1LeaseList { static getAttributeTypeMap() { return V1LeaseList.attributeTypeMap; } } exports.V1LeaseList = V1LeaseList; V1LeaseList.discriminator = undefined; V1LeaseList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1LeaseList.js.map /***/ }), /***/ 44603: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LeaseSpec = void 0; /** * LeaseSpec is a specification of a Lease. */ class V1LeaseSpec { static getAttributeTypeMap() { return V1LeaseSpec.attributeTypeMap; } } exports.V1LeaseSpec = V1LeaseSpec; V1LeaseSpec.discriminator = undefined; V1LeaseSpec.attributeTypeMap = [ { "name": "acquireTime", "baseName": "acquireTime", "type": "Date" }, { "name": "holderIdentity", "baseName": "holderIdentity", "type": "string" }, { "name": "leaseDurationSeconds", "baseName": "leaseDurationSeconds", "type": "number" }, { "name": "leaseTransitions", "baseName": "leaseTransitions", "type": "number" }, { "name": "renewTime", "baseName": "renewTime", "type": "Date" } ]; //# sourceMappingURL=v1LeaseSpec.js.map /***/ }), /***/ 41500: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Lifecycle = void 0; /** * Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted. */ class V1Lifecycle { static getAttributeTypeMap() { return V1Lifecycle.attributeTypeMap; } } exports.V1Lifecycle = V1Lifecycle; V1Lifecycle.discriminator = undefined; V1Lifecycle.attributeTypeMap = [ { "name": "postStart", "baseName": "postStart", "type": "V1Handler" }, { "name": "preStop", "baseName": "preStop", "type": "V1Handler" } ]; //# sourceMappingURL=v1Lifecycle.js.map /***/ }), /***/ 86280: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LimitRange = void 0; /** * LimitRange sets resource usage limits for each kind of resource in a Namespace. */ class V1LimitRange { static getAttributeTypeMap() { return V1LimitRange.attributeTypeMap; } } exports.V1LimitRange = V1LimitRange; V1LimitRange.discriminator = undefined; V1LimitRange.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1LimitRangeSpec" } ]; //# sourceMappingURL=v1LimitRange.js.map /***/ }), /***/ 91128: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LimitRangeItem = void 0; /** * LimitRangeItem defines a min/max usage limit for any resource that matches on kind. */ class V1LimitRangeItem { static getAttributeTypeMap() { return V1LimitRangeItem.attributeTypeMap; } } exports.V1LimitRangeItem = V1LimitRangeItem; V1LimitRangeItem.discriminator = undefined; V1LimitRangeItem.attributeTypeMap = [ { "name": "_default", "baseName": "default", "type": "{ [key: string]: string; }" }, { "name": "defaultRequest", "baseName": "defaultRequest", "type": "{ [key: string]: string; }" }, { "name": "max", "baseName": "max", "type": "{ [key: string]: string; }" }, { "name": "maxLimitRequestRatio", "baseName": "maxLimitRequestRatio", "type": "{ [key: string]: string; }" }, { "name": "min", "baseName": "min", "type": "{ [key: string]: string; }" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1LimitRangeItem.js.map /***/ }), /***/ 82578: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LimitRangeList = void 0; /** * LimitRangeList is a list of LimitRange items. */ class V1LimitRangeList { static getAttributeTypeMap() { return V1LimitRangeList.attributeTypeMap; } } exports.V1LimitRangeList = V1LimitRangeList; V1LimitRangeList.discriminator = undefined; V1LimitRangeList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1LimitRangeList.js.map /***/ }), /***/ 83039: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LimitRangeSpec = void 0; /** * LimitRangeSpec defines a min/max usage limit for resources that match on kind. */ class V1LimitRangeSpec { static getAttributeTypeMap() { return V1LimitRangeSpec.attributeTypeMap; } } exports.V1LimitRangeSpec = V1LimitRangeSpec; V1LimitRangeSpec.discriminator = undefined; V1LimitRangeSpec.attributeTypeMap = [ { "name": "limits", "baseName": "limits", "type": "Array" } ]; //# sourceMappingURL=v1LimitRangeSpec.js.map /***/ }), /***/ 88593: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ListMeta = void 0; /** * ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}. */ class V1ListMeta { static getAttributeTypeMap() { return V1ListMeta.attributeTypeMap; } } exports.V1ListMeta = V1ListMeta; V1ListMeta.discriminator = undefined; V1ListMeta.attributeTypeMap = [ { "name": "_continue", "baseName": "continue", "type": "string" }, { "name": "remainingItemCount", "baseName": "remainingItemCount", "type": "number" }, { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "selfLink", "baseName": "selfLink", "type": "string" } ]; //# sourceMappingURL=v1ListMeta.js.map /***/ }), /***/ 25667: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LoadBalancerIngress = void 0; /** * LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point. */ class V1LoadBalancerIngress { static getAttributeTypeMap() { return V1LoadBalancerIngress.attributeTypeMap; } } exports.V1LoadBalancerIngress = V1LoadBalancerIngress; V1LoadBalancerIngress.discriminator = undefined; V1LoadBalancerIngress.attributeTypeMap = [ { "name": "hostname", "baseName": "hostname", "type": "string" }, { "name": "ip", "baseName": "ip", "type": "string" }, { "name": "ports", "baseName": "ports", "type": "Array" } ]; //# sourceMappingURL=v1LoadBalancerIngress.js.map /***/ }), /***/ 46630: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LoadBalancerStatus = void 0; /** * LoadBalancerStatus represents the status of a load-balancer. */ class V1LoadBalancerStatus { static getAttributeTypeMap() { return V1LoadBalancerStatus.attributeTypeMap; } } exports.V1LoadBalancerStatus = V1LoadBalancerStatus; V1LoadBalancerStatus.discriminator = undefined; V1LoadBalancerStatus.attributeTypeMap = [ { "name": "ingress", "baseName": "ingress", "type": "Array" } ]; //# sourceMappingURL=v1LoadBalancerStatus.js.map /***/ }), /***/ 12229: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LocalObjectReference = void 0; /** * LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. */ class V1LocalObjectReference { static getAttributeTypeMap() { return V1LocalObjectReference.attributeTypeMap; } } exports.V1LocalObjectReference = V1LocalObjectReference; V1LocalObjectReference.discriminator = undefined; V1LocalObjectReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1LocalObjectReference.js.map /***/ }), /***/ 31674: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LocalSubjectAccessReview = void 0; /** * LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. */ class V1LocalSubjectAccessReview { static getAttributeTypeMap() { return V1LocalSubjectAccessReview.attributeTypeMap; } } exports.V1LocalSubjectAccessReview = V1LocalSubjectAccessReview; V1LocalSubjectAccessReview.discriminator = undefined; V1LocalSubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1SubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1SubjectAccessReviewStatus" } ]; //# sourceMappingURL=v1LocalSubjectAccessReview.js.map /***/ }), /***/ 72729: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1LocalVolumeSource = void 0; /** * Local represents directly-attached storage with node affinity (Beta feature) */ class V1LocalVolumeSource { static getAttributeTypeMap() { return V1LocalVolumeSource.attributeTypeMap; } } exports.V1LocalVolumeSource = V1LocalVolumeSource; V1LocalVolumeSource.discriminator = undefined; V1LocalVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "path", "baseName": "path", "type": "string" } ]; //# sourceMappingURL=v1LocalVolumeSource.js.map /***/ }), /***/ 82187: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ManagedFieldsEntry = void 0; /** * ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to. */ class V1ManagedFieldsEntry { static getAttributeTypeMap() { return V1ManagedFieldsEntry.attributeTypeMap; } } exports.V1ManagedFieldsEntry = V1ManagedFieldsEntry; V1ManagedFieldsEntry.discriminator = undefined; V1ManagedFieldsEntry.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "fieldsType", "baseName": "fieldsType", "type": "string" }, { "name": "fieldsV1", "baseName": "fieldsV1", "type": "object" }, { "name": "manager", "baseName": "manager", "type": "string" }, { "name": "operation", "baseName": "operation", "type": "string" }, { "name": "time", "baseName": "time", "type": "Date" } ]; //# sourceMappingURL=v1ManagedFieldsEntry.js.map /***/ }), /***/ 95354: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1MutatingWebhook = void 0; /** * MutatingWebhook describes an admission webhook and the resources and operations it applies to. */ class V1MutatingWebhook { static getAttributeTypeMap() { return V1MutatingWebhook.attributeTypeMap; } } exports.V1MutatingWebhook = V1MutatingWebhook; V1MutatingWebhook.discriminator = undefined; V1MutatingWebhook.attributeTypeMap = [ { "name": "admissionReviewVersions", "baseName": "admissionReviewVersions", "type": "Array" }, { "name": "clientConfig", "baseName": "clientConfig", "type": "AdmissionregistrationV1WebhookClientConfig" }, { "name": "failurePolicy", "baseName": "failurePolicy", "type": "string" }, { "name": "matchPolicy", "baseName": "matchPolicy", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespaceSelector", "baseName": "namespaceSelector", "type": "V1LabelSelector" }, { "name": "objectSelector", "baseName": "objectSelector", "type": "V1LabelSelector" }, { "name": "reinvocationPolicy", "baseName": "reinvocationPolicy", "type": "string" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "sideEffects", "baseName": "sideEffects", "type": "string" }, { "name": "timeoutSeconds", "baseName": "timeoutSeconds", "type": "number" } ]; //# sourceMappingURL=v1MutatingWebhook.js.map /***/ }), /***/ 2006: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1MutatingWebhookConfiguration = void 0; /** * MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. */ class V1MutatingWebhookConfiguration { static getAttributeTypeMap() { return V1MutatingWebhookConfiguration.attributeTypeMap; } } exports.V1MutatingWebhookConfiguration = V1MutatingWebhookConfiguration; V1MutatingWebhookConfiguration.discriminator = undefined; V1MutatingWebhookConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "webhooks", "baseName": "webhooks", "type": "Array" } ]; //# sourceMappingURL=v1MutatingWebhookConfiguration.js.map /***/ }), /***/ 22665: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1MutatingWebhookConfigurationList = void 0; /** * MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. */ class V1MutatingWebhookConfigurationList { static getAttributeTypeMap() { return V1MutatingWebhookConfigurationList.attributeTypeMap; } } exports.V1MutatingWebhookConfigurationList = V1MutatingWebhookConfigurationList; V1MutatingWebhookConfigurationList.discriminator = undefined; V1MutatingWebhookConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1MutatingWebhookConfigurationList.js.map /***/ }), /***/ 35432: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NFSVolumeSource = void 0; /** * Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling. */ class V1NFSVolumeSource { static getAttributeTypeMap() { return V1NFSVolumeSource.attributeTypeMap; } } exports.V1NFSVolumeSource = V1NFSVolumeSource; V1NFSVolumeSource.discriminator = undefined; V1NFSVolumeSource.attributeTypeMap = [ { "name": "path", "baseName": "path", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "server", "baseName": "server", "type": "string" } ]; //# sourceMappingURL=v1NFSVolumeSource.js.map /***/ }), /***/ 95469: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Namespace = void 0; /** * Namespace provides a scope for Names. Use of multiple namespaces is optional. */ class V1Namespace { static getAttributeTypeMap() { return V1Namespace.attributeTypeMap; } } exports.V1Namespace = V1Namespace; V1Namespace.discriminator = undefined; V1Namespace.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1NamespaceSpec" }, { "name": "status", "baseName": "status", "type": "V1NamespaceStatus" } ]; //# sourceMappingURL=v1Namespace.js.map /***/ }), /***/ 314: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NamespaceCondition = void 0; /** * NamespaceCondition contains details about state of namespace. */ class V1NamespaceCondition { static getAttributeTypeMap() { return V1NamespaceCondition.attributeTypeMap; } } exports.V1NamespaceCondition = V1NamespaceCondition; V1NamespaceCondition.discriminator = undefined; V1NamespaceCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1NamespaceCondition.js.map /***/ }), /***/ 22366: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NamespaceList = void 0; /** * NamespaceList is a list of Namespaces. */ class V1NamespaceList { static getAttributeTypeMap() { return V1NamespaceList.attributeTypeMap; } } exports.V1NamespaceList = V1NamespaceList; V1NamespaceList.discriminator = undefined; V1NamespaceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1NamespaceList.js.map /***/ }), /***/ 49076: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NamespaceSpec = void 0; /** * NamespaceSpec describes the attributes on a Namespace. */ class V1NamespaceSpec { static getAttributeTypeMap() { return V1NamespaceSpec.attributeTypeMap; } } exports.V1NamespaceSpec = V1NamespaceSpec; V1NamespaceSpec.discriminator = undefined; V1NamespaceSpec.attributeTypeMap = [ { "name": "finalizers", "baseName": "finalizers", "type": "Array" } ]; //# sourceMappingURL=v1NamespaceSpec.js.map /***/ }), /***/ 8833: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NamespaceStatus = void 0; /** * NamespaceStatus is information about the current status of a Namespace. */ class V1NamespaceStatus { static getAttributeTypeMap() { return V1NamespaceStatus.attributeTypeMap; } } exports.V1NamespaceStatus = V1NamespaceStatus; V1NamespaceStatus.discriminator = undefined; V1NamespaceStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "phase", "baseName": "phase", "type": "string" } ]; //# sourceMappingURL=v1NamespaceStatus.js.map /***/ }), /***/ 47995: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NetworkPolicy = void 0; /** * NetworkPolicy describes what network traffic is allowed for a set of Pods */ class V1NetworkPolicy { static getAttributeTypeMap() { return V1NetworkPolicy.attributeTypeMap; } } exports.V1NetworkPolicy = V1NetworkPolicy; V1NetworkPolicy.discriminator = undefined; V1NetworkPolicy.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1NetworkPolicySpec" } ]; //# sourceMappingURL=v1NetworkPolicy.js.map /***/ }), /***/ 60886: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NetworkPolicyEgressRule = void 0; /** * NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods matched by a NetworkPolicySpec\'s podSelector. The traffic must match both ports and to. This type is beta-level in 1.8 */ class V1NetworkPolicyEgressRule { static getAttributeTypeMap() { return V1NetworkPolicyEgressRule.attributeTypeMap; } } exports.V1NetworkPolicyEgressRule = V1NetworkPolicyEgressRule; V1NetworkPolicyEgressRule.discriminator = undefined; V1NetworkPolicyEgressRule.attributeTypeMap = [ { "name": "ports", "baseName": "ports", "type": "Array" }, { "name": "to", "baseName": "to", "type": "Array" } ]; //# sourceMappingURL=v1NetworkPolicyEgressRule.js.map /***/ }), /***/ 89952: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NetworkPolicyIngressRule = void 0; /** * NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods matched by a NetworkPolicySpec\'s podSelector. The traffic must match both ports and from. */ class V1NetworkPolicyIngressRule { static getAttributeTypeMap() { return V1NetworkPolicyIngressRule.attributeTypeMap; } } exports.V1NetworkPolicyIngressRule = V1NetworkPolicyIngressRule; V1NetworkPolicyIngressRule.discriminator = undefined; V1NetworkPolicyIngressRule.attributeTypeMap = [ { "name": "from", "baseName": "from", "type": "Array" }, { "name": "ports", "baseName": "ports", "type": "Array" } ]; //# sourceMappingURL=v1NetworkPolicyIngressRule.js.map /***/ }), /***/ 74436: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NetworkPolicyList = void 0; /** * NetworkPolicyList is a list of NetworkPolicy objects. */ class V1NetworkPolicyList { static getAttributeTypeMap() { return V1NetworkPolicyList.attributeTypeMap; } } exports.V1NetworkPolicyList = V1NetworkPolicyList; V1NetworkPolicyList.discriminator = undefined; V1NetworkPolicyList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1NetworkPolicyList.js.map /***/ }), /***/ 22173: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NetworkPolicyPeer = void 0; /** * NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed */ class V1NetworkPolicyPeer { static getAttributeTypeMap() { return V1NetworkPolicyPeer.attributeTypeMap; } } exports.V1NetworkPolicyPeer = V1NetworkPolicyPeer; V1NetworkPolicyPeer.discriminator = undefined; V1NetworkPolicyPeer.attributeTypeMap = [ { "name": "ipBlock", "baseName": "ipBlock", "type": "V1IPBlock" }, { "name": "namespaceSelector", "baseName": "namespaceSelector", "type": "V1LabelSelector" }, { "name": "podSelector", "baseName": "podSelector", "type": "V1LabelSelector" } ]; //# sourceMappingURL=v1NetworkPolicyPeer.js.map /***/ }), /***/ 71056: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NetworkPolicyPort = void 0; /** * NetworkPolicyPort describes a port to allow traffic on */ class V1NetworkPolicyPort { static getAttributeTypeMap() { return V1NetworkPolicyPort.attributeTypeMap; } } exports.V1NetworkPolicyPort = V1NetworkPolicyPort; V1NetworkPolicyPort.discriminator = undefined; V1NetworkPolicyPort.attributeTypeMap = [ { "name": "port", "baseName": "port", "type": "object" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; //# sourceMappingURL=v1NetworkPolicyPort.js.map /***/ }), /***/ 63061: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NetworkPolicySpec = void 0; /** * NetworkPolicySpec provides the specification of a NetworkPolicy */ class V1NetworkPolicySpec { static getAttributeTypeMap() { return V1NetworkPolicySpec.attributeTypeMap; } } exports.V1NetworkPolicySpec = V1NetworkPolicySpec; V1NetworkPolicySpec.discriminator = undefined; V1NetworkPolicySpec.attributeTypeMap = [ { "name": "egress", "baseName": "egress", "type": "Array" }, { "name": "ingress", "baseName": "ingress", "type": "Array" }, { "name": "podSelector", "baseName": "podSelector", "type": "V1LabelSelector" }, { "name": "policyTypes", "baseName": "policyTypes", "type": "Array" } ]; //# sourceMappingURL=v1NetworkPolicySpec.js.map /***/ }), /***/ 3667: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Node = void 0; /** * Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). */ class V1Node { static getAttributeTypeMap() { return V1Node.attributeTypeMap; } } exports.V1Node = V1Node; V1Node.discriminator = undefined; V1Node.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1NodeSpec" }, { "name": "status", "baseName": "status", "type": "V1NodeStatus" } ]; //# sourceMappingURL=v1Node.js.map /***/ }), /***/ 84893: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeAddress = void 0; /** * NodeAddress contains information for the node\'s address. */ class V1NodeAddress { static getAttributeTypeMap() { return V1NodeAddress.attributeTypeMap; } } exports.V1NodeAddress = V1NodeAddress; V1NodeAddress.discriminator = undefined; V1NodeAddress.attributeTypeMap = [ { "name": "address", "baseName": "address", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1NodeAddress.js.map /***/ }), /***/ 10627: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeAffinity = void 0; /** * Node affinity is a group of node affinity scheduling rules. */ class V1NodeAffinity { static getAttributeTypeMap() { return V1NodeAffinity.attributeTypeMap; } } exports.V1NodeAffinity = V1NodeAffinity; V1NodeAffinity.discriminator = undefined; V1NodeAffinity.attributeTypeMap = [ { "name": "preferredDuringSchedulingIgnoredDuringExecution", "baseName": "preferredDuringSchedulingIgnoredDuringExecution", "type": "Array" }, { "name": "requiredDuringSchedulingIgnoredDuringExecution", "baseName": "requiredDuringSchedulingIgnoredDuringExecution", "type": "V1NodeSelector" } ]; //# sourceMappingURL=v1NodeAffinity.js.map /***/ }), /***/ 11740: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeCondition = void 0; /** * NodeCondition contains condition information for a node. */ class V1NodeCondition { static getAttributeTypeMap() { return V1NodeCondition.attributeTypeMap; } } exports.V1NodeCondition = V1NodeCondition; V1NodeCondition.discriminator = undefined; V1NodeCondition.attributeTypeMap = [ { "name": "lastHeartbeatTime", "baseName": "lastHeartbeatTime", "type": "Date" }, { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1NodeCondition.js.map /***/ }), /***/ 4272: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeConfigSource = void 0; /** * NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. */ class V1NodeConfigSource { static getAttributeTypeMap() { return V1NodeConfigSource.attributeTypeMap; } } exports.V1NodeConfigSource = V1NodeConfigSource; V1NodeConfigSource.discriminator = undefined; V1NodeConfigSource.attributeTypeMap = [ { "name": "configMap", "baseName": "configMap", "type": "V1ConfigMapNodeConfigSource" } ]; //# sourceMappingURL=v1NodeConfigSource.js.map /***/ }), /***/ 10912: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeConfigStatus = void 0; /** * NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource. */ class V1NodeConfigStatus { static getAttributeTypeMap() { return V1NodeConfigStatus.attributeTypeMap; } } exports.V1NodeConfigStatus = V1NodeConfigStatus; V1NodeConfigStatus.discriminator = undefined; V1NodeConfigStatus.attributeTypeMap = [ { "name": "active", "baseName": "active", "type": "V1NodeConfigSource" }, { "name": "assigned", "baseName": "assigned", "type": "V1NodeConfigSource" }, { "name": "error", "baseName": "error", "type": "string" }, { "name": "lastKnownGood", "baseName": "lastKnownGood", "type": "V1NodeConfigSource" } ]; //# sourceMappingURL=v1NodeConfigStatus.js.map /***/ }), /***/ 24894: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeDaemonEndpoints = void 0; /** * NodeDaemonEndpoints lists ports opened by daemons running on the Node. */ class V1NodeDaemonEndpoints { static getAttributeTypeMap() { return V1NodeDaemonEndpoints.attributeTypeMap; } } exports.V1NodeDaemonEndpoints = V1NodeDaemonEndpoints; V1NodeDaemonEndpoints.discriminator = undefined; V1NodeDaemonEndpoints.attributeTypeMap = [ { "name": "kubeletEndpoint", "baseName": "kubeletEndpoint", "type": "V1DaemonEndpoint" } ]; //# sourceMappingURL=v1NodeDaemonEndpoints.js.map /***/ }), /***/ 42762: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeList = void 0; /** * NodeList is the whole list of all Nodes which have been registered with master. */ class V1NodeList { static getAttributeTypeMap() { return V1NodeList.attributeTypeMap; } } exports.V1NodeList = V1NodeList; V1NodeList.discriminator = undefined; V1NodeList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1NodeList.js.map /***/ }), /***/ 32293: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeSelector = void 0; /** * A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms. */ class V1NodeSelector { static getAttributeTypeMap() { return V1NodeSelector.attributeTypeMap; } } exports.V1NodeSelector = V1NodeSelector; V1NodeSelector.discriminator = undefined; V1NodeSelector.attributeTypeMap = [ { "name": "nodeSelectorTerms", "baseName": "nodeSelectorTerms", "type": "Array" } ]; //# sourceMappingURL=v1NodeSelector.js.map /***/ }), /***/ 85161: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeSelectorRequirement = void 0; /** * A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. */ class V1NodeSelectorRequirement { static getAttributeTypeMap() { return V1NodeSelectorRequirement.attributeTypeMap; } } exports.V1NodeSelectorRequirement = V1NodeSelectorRequirement; V1NodeSelectorRequirement.discriminator = undefined; V1NodeSelectorRequirement.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "operator", "baseName": "operator", "type": "string" }, { "name": "values", "baseName": "values", "type": "Array" } ]; //# sourceMappingURL=v1NodeSelectorRequirement.js.map /***/ }), /***/ 51128: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeSelectorTerm = void 0; /** * A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. */ class V1NodeSelectorTerm { static getAttributeTypeMap() { return V1NodeSelectorTerm.attributeTypeMap; } } exports.V1NodeSelectorTerm = V1NodeSelectorTerm; V1NodeSelectorTerm.discriminator = undefined; V1NodeSelectorTerm.attributeTypeMap = [ { "name": "matchExpressions", "baseName": "matchExpressions", "type": "Array" }, { "name": "matchFields", "baseName": "matchFields", "type": "Array" } ]; //# sourceMappingURL=v1NodeSelectorTerm.js.map /***/ }), /***/ 41752: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeSpec = void 0; /** * NodeSpec describes the attributes that a node is created with. */ class V1NodeSpec { static getAttributeTypeMap() { return V1NodeSpec.attributeTypeMap; } } exports.V1NodeSpec = V1NodeSpec; V1NodeSpec.discriminator = undefined; V1NodeSpec.attributeTypeMap = [ { "name": "configSource", "baseName": "configSource", "type": "V1NodeConfigSource" }, { "name": "externalID", "baseName": "externalID", "type": "string" }, { "name": "podCIDR", "baseName": "podCIDR", "type": "string" }, { "name": "podCIDRs", "baseName": "podCIDRs", "type": "Array" }, { "name": "providerID", "baseName": "providerID", "type": "string" }, { "name": "taints", "baseName": "taints", "type": "Array" }, { "name": "unschedulable", "baseName": "unschedulable", "type": "boolean" } ]; //# sourceMappingURL=v1NodeSpec.js.map /***/ }), /***/ 21656: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeStatus = void 0; /** * NodeStatus is information about the current status of a node. */ class V1NodeStatus { static getAttributeTypeMap() { return V1NodeStatus.attributeTypeMap; } } exports.V1NodeStatus = V1NodeStatus; V1NodeStatus.discriminator = undefined; V1NodeStatus.attributeTypeMap = [ { "name": "addresses", "baseName": "addresses", "type": "Array" }, { "name": "allocatable", "baseName": "allocatable", "type": "{ [key: string]: string; }" }, { "name": "capacity", "baseName": "capacity", "type": "{ [key: string]: string; }" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "config", "baseName": "config", "type": "V1NodeConfigStatus" }, { "name": "daemonEndpoints", "baseName": "daemonEndpoints", "type": "V1NodeDaemonEndpoints" }, { "name": "images", "baseName": "images", "type": "Array" }, { "name": "nodeInfo", "baseName": "nodeInfo", "type": "V1NodeSystemInfo" }, { "name": "phase", "baseName": "phase", "type": "string" }, { "name": "volumesAttached", "baseName": "volumesAttached", "type": "Array" }, { "name": "volumesInUse", "baseName": "volumesInUse", "type": "Array" } ]; //# sourceMappingURL=v1NodeStatus.js.map /***/ }), /***/ 33645: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NodeSystemInfo = void 0; /** * NodeSystemInfo is a set of ids/uuids to uniquely identify the node. */ class V1NodeSystemInfo { static getAttributeTypeMap() { return V1NodeSystemInfo.attributeTypeMap; } } exports.V1NodeSystemInfo = V1NodeSystemInfo; V1NodeSystemInfo.discriminator = undefined; V1NodeSystemInfo.attributeTypeMap = [ { "name": "architecture", "baseName": "architecture", "type": "string" }, { "name": "bootID", "baseName": "bootID", "type": "string" }, { "name": "containerRuntimeVersion", "baseName": "containerRuntimeVersion", "type": "string" }, { "name": "kernelVersion", "baseName": "kernelVersion", "type": "string" }, { "name": "kubeProxyVersion", "baseName": "kubeProxyVersion", "type": "string" }, { "name": "kubeletVersion", "baseName": "kubeletVersion", "type": "string" }, { "name": "machineID", "baseName": "machineID", "type": "string" }, { "name": "operatingSystem", "baseName": "operatingSystem", "type": "string" }, { "name": "osImage", "baseName": "osImage", "type": "string" }, { "name": "systemUUID", "baseName": "systemUUID", "type": "string" } ]; //# sourceMappingURL=v1NodeSystemInfo.js.map /***/ }), /***/ 70019: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NonResourceAttributes = void 0; /** * NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface */ class V1NonResourceAttributes { static getAttributeTypeMap() { return V1NonResourceAttributes.attributeTypeMap; } } exports.V1NonResourceAttributes = V1NonResourceAttributes; V1NonResourceAttributes.discriminator = undefined; V1NonResourceAttributes.attributeTypeMap = [ { "name": "path", "baseName": "path", "type": "string" }, { "name": "verb", "baseName": "verb", "type": "string" } ]; //# sourceMappingURL=v1NonResourceAttributes.js.map /***/ }), /***/ 99191: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1NonResourceRule = void 0; /** * NonResourceRule holds information that describes a rule for the non-resource */ class V1NonResourceRule { static getAttributeTypeMap() { return V1NonResourceRule.attributeTypeMap; } } exports.V1NonResourceRule = V1NonResourceRule; V1NonResourceRule.discriminator = undefined; V1NonResourceRule.attributeTypeMap = [ { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1NonResourceRule.js.map /***/ }), /***/ 86171: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ObjectFieldSelector = void 0; /** * ObjectFieldSelector selects an APIVersioned field of an object. */ class V1ObjectFieldSelector { static getAttributeTypeMap() { return V1ObjectFieldSelector.attributeTypeMap; } } exports.V1ObjectFieldSelector = V1ObjectFieldSelector; V1ObjectFieldSelector.discriminator = undefined; V1ObjectFieldSelector.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "fieldPath", "baseName": "fieldPath", "type": "string" } ]; //# sourceMappingURL=v1ObjectFieldSelector.js.map /***/ }), /***/ 44696: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ObjectMeta = void 0; /** * ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. */ class V1ObjectMeta { static getAttributeTypeMap() { return V1ObjectMeta.attributeTypeMap; } } exports.V1ObjectMeta = V1ObjectMeta; V1ObjectMeta.discriminator = undefined; V1ObjectMeta.attributeTypeMap = [ { "name": "annotations", "baseName": "annotations", "type": "{ [key: string]: string; }" }, { "name": "clusterName", "baseName": "clusterName", "type": "string" }, { "name": "creationTimestamp", "baseName": "creationTimestamp", "type": "Date" }, { "name": "deletionGracePeriodSeconds", "baseName": "deletionGracePeriodSeconds", "type": "number" }, { "name": "deletionTimestamp", "baseName": "deletionTimestamp", "type": "Date" }, { "name": "finalizers", "baseName": "finalizers", "type": "Array" }, { "name": "generateName", "baseName": "generateName", "type": "string" }, { "name": "generation", "baseName": "generation", "type": "number" }, { "name": "labels", "baseName": "labels", "type": "{ [key: string]: string; }" }, { "name": "managedFields", "baseName": "managedFields", "type": "Array" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "ownerReferences", "baseName": "ownerReferences", "type": "Array" }, { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "selfLink", "baseName": "selfLink", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; //# sourceMappingURL=v1ObjectMeta.js.map /***/ }), /***/ 19051: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ObjectReference = void 0; /** * ObjectReference contains enough information to let you inspect or modify the referred object. */ class V1ObjectReference { static getAttributeTypeMap() { return V1ObjectReference.attributeTypeMap; } } exports.V1ObjectReference = V1ObjectReference; V1ObjectReference.discriminator = undefined; V1ObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "fieldPath", "baseName": "fieldPath", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; //# sourceMappingURL=v1ObjectReference.js.map /***/ }), /***/ 90114: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Overhead = void 0; /** * Overhead structure represents the resource overhead associated with running a pod. */ class V1Overhead { static getAttributeTypeMap() { return V1Overhead.attributeTypeMap; } } exports.V1Overhead = V1Overhead; V1Overhead.discriminator = undefined; V1Overhead.attributeTypeMap = [ { "name": "podFixed", "baseName": "podFixed", "type": "{ [key: string]: string; }" } ]; //# sourceMappingURL=v1Overhead.js.map /***/ }), /***/ 7924: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1OwnerReference = void 0; /** * OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field. */ class V1OwnerReference { static getAttributeTypeMap() { return V1OwnerReference.attributeTypeMap; } } exports.V1OwnerReference = V1OwnerReference; V1OwnerReference.discriminator = undefined; V1OwnerReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "blockOwnerDeletion", "baseName": "blockOwnerDeletion", "type": "boolean" }, { "name": "controller", "baseName": "controller", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; //# sourceMappingURL=v1OwnerReference.js.map /***/ }), /***/ 25570: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolume = void 0; /** * PersistentVolume (PV) is a storage resource provisioned by an administrator. It is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes */ class V1PersistentVolume { static getAttributeTypeMap() { return V1PersistentVolume.attributeTypeMap; } } exports.V1PersistentVolume = V1PersistentVolume; V1PersistentVolume.discriminator = undefined; V1PersistentVolume.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PersistentVolumeSpec" }, { "name": "status", "baseName": "status", "type": "V1PersistentVolumeStatus" } ]; //# sourceMappingURL=v1PersistentVolume.js.map /***/ }), /***/ 89974: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeClaim = void 0; /** * PersistentVolumeClaim is a user\'s request for and claim to a persistent volume */ class V1PersistentVolumeClaim { static getAttributeTypeMap() { return V1PersistentVolumeClaim.attributeTypeMap; } } exports.V1PersistentVolumeClaim = V1PersistentVolumeClaim; V1PersistentVolumeClaim.discriminator = undefined; V1PersistentVolumeClaim.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PersistentVolumeClaimSpec" }, { "name": "status", "baseName": "status", "type": "V1PersistentVolumeClaimStatus" } ]; //# sourceMappingURL=v1PersistentVolumeClaim.js.map /***/ }), /***/ 32966: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeClaimCondition = void 0; /** * PersistentVolumeClaimCondition contails details about state of pvc */ class V1PersistentVolumeClaimCondition { static getAttributeTypeMap() { return V1PersistentVolumeClaimCondition.attributeTypeMap; } } exports.V1PersistentVolumeClaimCondition = V1PersistentVolumeClaimCondition; V1PersistentVolumeClaimCondition.discriminator = undefined; V1PersistentVolumeClaimCondition.attributeTypeMap = [ { "name": "lastProbeTime", "baseName": "lastProbeTime", "type": "Date" }, { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1PersistentVolumeClaimCondition.js.map /***/ }), /***/ 78594: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeClaimList = void 0; /** * PersistentVolumeClaimList is a list of PersistentVolumeClaim items. */ class V1PersistentVolumeClaimList { static getAttributeTypeMap() { return V1PersistentVolumeClaimList.attributeTypeMap; } } exports.V1PersistentVolumeClaimList = V1PersistentVolumeClaimList; V1PersistentVolumeClaimList.discriminator = undefined; V1PersistentVolumeClaimList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1PersistentVolumeClaimList.js.map /***/ }), /***/ 99911: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeClaimSpec = void 0; /** * PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes */ class V1PersistentVolumeClaimSpec { static getAttributeTypeMap() { return V1PersistentVolumeClaimSpec.attributeTypeMap; } } exports.V1PersistentVolumeClaimSpec = V1PersistentVolumeClaimSpec; V1PersistentVolumeClaimSpec.discriminator = undefined; V1PersistentVolumeClaimSpec.attributeTypeMap = [ { "name": "accessModes", "baseName": "accessModes", "type": "Array" }, { "name": "dataSource", "baseName": "dataSource", "type": "V1TypedLocalObjectReference" }, { "name": "resources", "baseName": "resources", "type": "V1ResourceRequirements" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "storageClassName", "baseName": "storageClassName", "type": "string" }, { "name": "volumeMode", "baseName": "volumeMode", "type": "string" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" } ]; //# sourceMappingURL=v1PersistentVolumeClaimSpec.js.map /***/ }), /***/ 42951: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeClaimStatus = void 0; /** * PersistentVolumeClaimStatus is the current status of a persistent volume claim. */ class V1PersistentVolumeClaimStatus { static getAttributeTypeMap() { return V1PersistentVolumeClaimStatus.attributeTypeMap; } } exports.V1PersistentVolumeClaimStatus = V1PersistentVolumeClaimStatus; V1PersistentVolumeClaimStatus.discriminator = undefined; V1PersistentVolumeClaimStatus.attributeTypeMap = [ { "name": "accessModes", "baseName": "accessModes", "type": "Array" }, { "name": "capacity", "baseName": "capacity", "type": "{ [key: string]: string; }" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "phase", "baseName": "phase", "type": "string" } ]; //# sourceMappingURL=v1PersistentVolumeClaimStatus.js.map /***/ }), /***/ 92114: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeClaimTemplate = void 0; /** * PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource. */ class V1PersistentVolumeClaimTemplate { static getAttributeTypeMap() { return V1PersistentVolumeClaimTemplate.attributeTypeMap; } } exports.V1PersistentVolumeClaimTemplate = V1PersistentVolumeClaimTemplate; V1PersistentVolumeClaimTemplate.discriminator = undefined; V1PersistentVolumeClaimTemplate.attributeTypeMap = [ { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PersistentVolumeClaimSpec" } ]; //# sourceMappingURL=v1PersistentVolumeClaimTemplate.js.map /***/ }), /***/ 69811: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeClaimVolumeSource = void 0; /** * PersistentVolumeClaimVolumeSource references the user\'s PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system). */ class V1PersistentVolumeClaimVolumeSource { static getAttributeTypeMap() { return V1PersistentVolumeClaimVolumeSource.attributeTypeMap; } } exports.V1PersistentVolumeClaimVolumeSource = V1PersistentVolumeClaimVolumeSource; V1PersistentVolumeClaimVolumeSource.discriminator = undefined; V1PersistentVolumeClaimVolumeSource.attributeTypeMap = [ { "name": "claimName", "baseName": "claimName", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; //# sourceMappingURL=v1PersistentVolumeClaimVolumeSource.js.map /***/ }), /***/ 86312: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeList = void 0; /** * PersistentVolumeList is a list of PersistentVolume items. */ class V1PersistentVolumeList { static getAttributeTypeMap() { return V1PersistentVolumeList.attributeTypeMap; } } exports.V1PersistentVolumeList = V1PersistentVolumeList; V1PersistentVolumeList.discriminator = undefined; V1PersistentVolumeList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1PersistentVolumeList.js.map /***/ }), /***/ 86628: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeSpec = void 0; /** * PersistentVolumeSpec is the specification of a persistent volume. */ class V1PersistentVolumeSpec { static getAttributeTypeMap() { return V1PersistentVolumeSpec.attributeTypeMap; } } exports.V1PersistentVolumeSpec = V1PersistentVolumeSpec; V1PersistentVolumeSpec.discriminator = undefined; V1PersistentVolumeSpec.attributeTypeMap = [ { "name": "accessModes", "baseName": "accessModes", "type": "Array" }, { "name": "awsElasticBlockStore", "baseName": "awsElasticBlockStore", "type": "V1AWSElasticBlockStoreVolumeSource" }, { "name": "azureDisk", "baseName": "azureDisk", "type": "V1AzureDiskVolumeSource" }, { "name": "azureFile", "baseName": "azureFile", "type": "V1AzureFilePersistentVolumeSource" }, { "name": "capacity", "baseName": "capacity", "type": "{ [key: string]: string; }" }, { "name": "cephfs", "baseName": "cephfs", "type": "V1CephFSPersistentVolumeSource" }, { "name": "cinder", "baseName": "cinder", "type": "V1CinderPersistentVolumeSource" }, { "name": "claimRef", "baseName": "claimRef", "type": "V1ObjectReference" }, { "name": "csi", "baseName": "csi", "type": "V1CSIPersistentVolumeSource" }, { "name": "fc", "baseName": "fc", "type": "V1FCVolumeSource" }, { "name": "flexVolume", "baseName": "flexVolume", "type": "V1FlexPersistentVolumeSource" }, { "name": "flocker", "baseName": "flocker", "type": "V1FlockerVolumeSource" }, { "name": "gcePersistentDisk", "baseName": "gcePersistentDisk", "type": "V1GCEPersistentDiskVolumeSource" }, { "name": "glusterfs", "baseName": "glusterfs", "type": "V1GlusterfsPersistentVolumeSource" }, { "name": "hostPath", "baseName": "hostPath", "type": "V1HostPathVolumeSource" }, { "name": "iscsi", "baseName": "iscsi", "type": "V1ISCSIPersistentVolumeSource" }, { "name": "local", "baseName": "local", "type": "V1LocalVolumeSource" }, { "name": "mountOptions", "baseName": "mountOptions", "type": "Array" }, { "name": "nfs", "baseName": "nfs", "type": "V1NFSVolumeSource" }, { "name": "nodeAffinity", "baseName": "nodeAffinity", "type": "V1VolumeNodeAffinity" }, { "name": "persistentVolumeReclaimPolicy", "baseName": "persistentVolumeReclaimPolicy", "type": "string" }, { "name": "photonPersistentDisk", "baseName": "photonPersistentDisk", "type": "V1PhotonPersistentDiskVolumeSource" }, { "name": "portworxVolume", "baseName": "portworxVolume", "type": "V1PortworxVolumeSource" }, { "name": "quobyte", "baseName": "quobyte", "type": "V1QuobyteVolumeSource" }, { "name": "rbd", "baseName": "rbd", "type": "V1RBDPersistentVolumeSource" }, { "name": "scaleIO", "baseName": "scaleIO", "type": "V1ScaleIOPersistentVolumeSource" }, { "name": "storageClassName", "baseName": "storageClassName", "type": "string" }, { "name": "storageos", "baseName": "storageos", "type": "V1StorageOSPersistentVolumeSource" }, { "name": "volumeMode", "baseName": "volumeMode", "type": "string" }, { "name": "vsphereVolume", "baseName": "vsphereVolume", "type": "V1VsphereVirtualDiskVolumeSource" } ]; //# sourceMappingURL=v1PersistentVolumeSpec.js.map /***/ }), /***/ 19839: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PersistentVolumeStatus = void 0; /** * PersistentVolumeStatus is the current status of a persistent volume. */ class V1PersistentVolumeStatus { static getAttributeTypeMap() { return V1PersistentVolumeStatus.attributeTypeMap; } } exports.V1PersistentVolumeStatus = V1PersistentVolumeStatus; V1PersistentVolumeStatus.discriminator = undefined; V1PersistentVolumeStatus.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "phase", "baseName": "phase", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; //# sourceMappingURL=v1PersistentVolumeStatus.js.map /***/ }), /***/ 51817: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PhotonPersistentDiskVolumeSource = void 0; /** * Represents a Photon Controller persistent disk resource. */ class V1PhotonPersistentDiskVolumeSource { static getAttributeTypeMap() { return V1PhotonPersistentDiskVolumeSource.attributeTypeMap; } } exports.V1PhotonPersistentDiskVolumeSource = V1PhotonPersistentDiskVolumeSource; V1PhotonPersistentDiskVolumeSource.discriminator = undefined; V1PhotonPersistentDiskVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "pdID", "baseName": "pdID", "type": "string" } ]; //# sourceMappingURL=v1PhotonPersistentDiskVolumeSource.js.map /***/ }), /***/ 99975: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Pod = void 0; /** * Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. */ class V1Pod { static getAttributeTypeMap() { return V1Pod.attributeTypeMap; } } exports.V1Pod = V1Pod; V1Pod.discriminator = undefined; V1Pod.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PodSpec" }, { "name": "status", "baseName": "status", "type": "V1PodStatus" } ]; //# sourceMappingURL=v1Pod.js.map /***/ }), /***/ 509: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodAffinity = void 0; /** * Pod affinity is a group of inter pod affinity scheduling rules. */ class V1PodAffinity { static getAttributeTypeMap() { return V1PodAffinity.attributeTypeMap; } } exports.V1PodAffinity = V1PodAffinity; V1PodAffinity.discriminator = undefined; V1PodAffinity.attributeTypeMap = [ { "name": "preferredDuringSchedulingIgnoredDuringExecution", "baseName": "preferredDuringSchedulingIgnoredDuringExecution", "type": "Array" }, { "name": "requiredDuringSchedulingIgnoredDuringExecution", "baseName": "requiredDuringSchedulingIgnoredDuringExecution", "type": "Array" } ]; //# sourceMappingURL=v1PodAffinity.js.map /***/ }), /***/ 65970: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodAffinityTerm = void 0; /** * Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running */ class V1PodAffinityTerm { static getAttributeTypeMap() { return V1PodAffinityTerm.attributeTypeMap; } } exports.V1PodAffinityTerm = V1PodAffinityTerm; V1PodAffinityTerm.discriminator = undefined; V1PodAffinityTerm.attributeTypeMap = [ { "name": "labelSelector", "baseName": "labelSelector", "type": "V1LabelSelector" }, { "name": "namespaces", "baseName": "namespaces", "type": "Array" }, { "name": "topologyKey", "baseName": "topologyKey", "type": "string" } ]; //# sourceMappingURL=v1PodAffinityTerm.js.map /***/ }), /***/ 19574: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodAntiAffinity = void 0; /** * Pod anti affinity is a group of inter pod anti affinity scheduling rules. */ class V1PodAntiAffinity { static getAttributeTypeMap() { return V1PodAntiAffinity.attributeTypeMap; } } exports.V1PodAntiAffinity = V1PodAntiAffinity; V1PodAntiAffinity.discriminator = undefined; V1PodAntiAffinity.attributeTypeMap = [ { "name": "preferredDuringSchedulingIgnoredDuringExecution", "baseName": "preferredDuringSchedulingIgnoredDuringExecution", "type": "Array" }, { "name": "requiredDuringSchedulingIgnoredDuringExecution", "baseName": "requiredDuringSchedulingIgnoredDuringExecution", "type": "Array" } ]; //# sourceMappingURL=v1PodAntiAffinity.js.map /***/ }), /***/ 78045: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodCondition = void 0; /** * PodCondition contains details for the current condition of this pod. */ class V1PodCondition { static getAttributeTypeMap() { return V1PodCondition.attributeTypeMap; } } exports.V1PodCondition = V1PodCondition; V1PodCondition.discriminator = undefined; V1PodCondition.attributeTypeMap = [ { "name": "lastProbeTime", "baseName": "lastProbeTime", "type": "Date" }, { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1PodCondition.js.map /***/ }), /***/ 67831: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodDNSConfig = void 0; /** * PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy. */ class V1PodDNSConfig { static getAttributeTypeMap() { return V1PodDNSConfig.attributeTypeMap; } } exports.V1PodDNSConfig = V1PodDNSConfig; V1PodDNSConfig.discriminator = undefined; V1PodDNSConfig.attributeTypeMap = [ { "name": "nameservers", "baseName": "nameservers", "type": "Array" }, { "name": "options", "baseName": "options", "type": "Array" }, { "name": "searches", "baseName": "searches", "type": "Array" } ]; //# sourceMappingURL=v1PodDNSConfig.js.map /***/ }), /***/ 74548: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodDNSConfigOption = void 0; /** * PodDNSConfigOption defines DNS resolver options of a pod. */ class V1PodDNSConfigOption { static getAttributeTypeMap() { return V1PodDNSConfigOption.attributeTypeMap; } } exports.V1PodDNSConfigOption = V1PodDNSConfigOption; V1PodDNSConfigOption.discriminator = undefined; V1PodDNSConfigOption.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; //# sourceMappingURL=v1PodDNSConfigOption.js.map /***/ }), /***/ 76774: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodIP = void 0; /** * IP address information for entries in the (plural) PodIPs field. Each entry includes: IP: An IP address allocated to the pod. Routable at least within the cluster. */ class V1PodIP { static getAttributeTypeMap() { return V1PodIP.attributeTypeMap; } } exports.V1PodIP = V1PodIP; V1PodIP.discriminator = undefined; V1PodIP.attributeTypeMap = [ { "name": "ip", "baseName": "ip", "type": "string" } ]; //# sourceMappingURL=v1PodIP.js.map /***/ }), /***/ 71948: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodList = void 0; /** * PodList is a list of Pods. */ class V1PodList { static getAttributeTypeMap() { return V1PodList.attributeTypeMap; } } exports.V1PodList = V1PodList; V1PodList.discriminator = undefined; V1PodList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1PodList.js.map /***/ }), /***/ 84135: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodReadinessGate = void 0; /** * PodReadinessGate contains the reference to a pod condition */ class V1PodReadinessGate { static getAttributeTypeMap() { return V1PodReadinessGate.attributeTypeMap; } } exports.V1PodReadinessGate = V1PodReadinessGate; V1PodReadinessGate.discriminator = undefined; V1PodReadinessGate.attributeTypeMap = [ { "name": "conditionType", "baseName": "conditionType", "type": "string" } ]; //# sourceMappingURL=v1PodReadinessGate.js.map /***/ }), /***/ 79850: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodSecurityContext = void 0; /** * PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext. */ class V1PodSecurityContext { static getAttributeTypeMap() { return V1PodSecurityContext.attributeTypeMap; } } exports.V1PodSecurityContext = V1PodSecurityContext; V1PodSecurityContext.discriminator = undefined; V1PodSecurityContext.attributeTypeMap = [ { "name": "fsGroup", "baseName": "fsGroup", "type": "number" }, { "name": "fsGroupChangePolicy", "baseName": "fsGroupChangePolicy", "type": "string" }, { "name": "runAsGroup", "baseName": "runAsGroup", "type": "number" }, { "name": "runAsNonRoot", "baseName": "runAsNonRoot", "type": "boolean" }, { "name": "runAsUser", "baseName": "runAsUser", "type": "number" }, { "name": "seLinuxOptions", "baseName": "seLinuxOptions", "type": "V1SELinuxOptions" }, { "name": "seccompProfile", "baseName": "seccompProfile", "type": "V1SeccompProfile" }, { "name": "supplementalGroups", "baseName": "supplementalGroups", "type": "Array" }, { "name": "sysctls", "baseName": "sysctls", "type": "Array" }, { "name": "windowsOptions", "baseName": "windowsOptions", "type": "V1WindowsSecurityContextOptions" } ]; //# sourceMappingURL=v1PodSecurityContext.js.map /***/ }), /***/ 58881: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodSpec = void 0; /** * PodSpec is a description of a pod. */ class V1PodSpec { static getAttributeTypeMap() { return V1PodSpec.attributeTypeMap; } } exports.V1PodSpec = V1PodSpec; V1PodSpec.discriminator = undefined; V1PodSpec.attributeTypeMap = [ { "name": "activeDeadlineSeconds", "baseName": "activeDeadlineSeconds", "type": "number" }, { "name": "affinity", "baseName": "affinity", "type": "V1Affinity" }, { "name": "automountServiceAccountToken", "baseName": "automountServiceAccountToken", "type": "boolean" }, { "name": "containers", "baseName": "containers", "type": "Array" }, { "name": "dnsConfig", "baseName": "dnsConfig", "type": "V1PodDNSConfig" }, { "name": "dnsPolicy", "baseName": "dnsPolicy", "type": "string" }, { "name": "enableServiceLinks", "baseName": "enableServiceLinks", "type": "boolean" }, { "name": "ephemeralContainers", "baseName": "ephemeralContainers", "type": "Array" }, { "name": "hostAliases", "baseName": "hostAliases", "type": "Array" }, { "name": "hostIPC", "baseName": "hostIPC", "type": "boolean" }, { "name": "hostNetwork", "baseName": "hostNetwork", "type": "boolean" }, { "name": "hostPID", "baseName": "hostPID", "type": "boolean" }, { "name": "hostname", "baseName": "hostname", "type": "string" }, { "name": "imagePullSecrets", "baseName": "imagePullSecrets", "type": "Array" }, { "name": "initContainers", "baseName": "initContainers", "type": "Array" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "nodeSelector", "baseName": "nodeSelector", "type": "{ [key: string]: string; }" }, { "name": "overhead", "baseName": "overhead", "type": "{ [key: string]: string; }" }, { "name": "preemptionPolicy", "baseName": "preemptionPolicy", "type": "string" }, { "name": "priority", "baseName": "priority", "type": "number" }, { "name": "priorityClassName", "baseName": "priorityClassName", "type": "string" }, { "name": "readinessGates", "baseName": "readinessGates", "type": "Array" }, { "name": "restartPolicy", "baseName": "restartPolicy", "type": "string" }, { "name": "runtimeClassName", "baseName": "runtimeClassName", "type": "string" }, { "name": "schedulerName", "baseName": "schedulerName", "type": "string" }, { "name": "securityContext", "baseName": "securityContext", "type": "V1PodSecurityContext" }, { "name": "serviceAccount", "baseName": "serviceAccount", "type": "string" }, { "name": "serviceAccountName", "baseName": "serviceAccountName", "type": "string" }, { "name": "setHostnameAsFQDN", "baseName": "setHostnameAsFQDN", "type": "boolean" }, { "name": "shareProcessNamespace", "baseName": "shareProcessNamespace", "type": "boolean" }, { "name": "subdomain", "baseName": "subdomain", "type": "string" }, { "name": "terminationGracePeriodSeconds", "baseName": "terminationGracePeriodSeconds", "type": "number" }, { "name": "tolerations", "baseName": "tolerations", "type": "Array" }, { "name": "topologySpreadConstraints", "baseName": "topologySpreadConstraints", "type": "Array" }, { "name": "volumes", "baseName": "volumes", "type": "Array" } ]; //# sourceMappingURL=v1PodSpec.js.map /***/ }), /***/ 42892: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodStatus = void 0; /** * PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane. */ class V1PodStatus { static getAttributeTypeMap() { return V1PodStatus.attributeTypeMap; } } exports.V1PodStatus = V1PodStatus; V1PodStatus.discriminator = undefined; V1PodStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "containerStatuses", "baseName": "containerStatuses", "type": "Array" }, { "name": "ephemeralContainerStatuses", "baseName": "ephemeralContainerStatuses", "type": "Array" }, { "name": "hostIP", "baseName": "hostIP", "type": "string" }, { "name": "initContainerStatuses", "baseName": "initContainerStatuses", "type": "Array" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "nominatedNodeName", "baseName": "nominatedNodeName", "type": "string" }, { "name": "phase", "baseName": "phase", "type": "string" }, { "name": "podIP", "baseName": "podIP", "type": "string" }, { "name": "podIPs", "baseName": "podIPs", "type": "Array" }, { "name": "qosClass", "baseName": "qosClass", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "startTime", "baseName": "startTime", "type": "Date" } ]; //# sourceMappingURL=v1PodStatus.js.map /***/ }), /***/ 39894: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodTemplate = void 0; /** * PodTemplate describes a template for creating copies of a predefined pod. */ class V1PodTemplate { static getAttributeTypeMap() { return V1PodTemplate.attributeTypeMap; } } exports.V1PodTemplate = V1PodTemplate; V1PodTemplate.discriminator = undefined; V1PodTemplate.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; //# sourceMappingURL=v1PodTemplate.js.map /***/ }), /***/ 88279: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodTemplateList = void 0; /** * PodTemplateList is a list of PodTemplates. */ class V1PodTemplateList { static getAttributeTypeMap() { return V1PodTemplateList.attributeTypeMap; } } exports.V1PodTemplateList = V1PodTemplateList; V1PodTemplateList.discriminator = undefined; V1PodTemplateList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1PodTemplateList.js.map /***/ }), /***/ 97621: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PodTemplateSpec = void 0; /** * PodTemplateSpec describes the data a pod should have when created from a template */ class V1PodTemplateSpec { static getAttributeTypeMap() { return V1PodTemplateSpec.attributeTypeMap; } } exports.V1PodTemplateSpec = V1PodTemplateSpec; V1PodTemplateSpec.discriminator = undefined; V1PodTemplateSpec.attributeTypeMap = [ { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1PodSpec" } ]; //# sourceMappingURL=v1PodTemplateSpec.js.map /***/ }), /***/ 74625: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PolicyRule = void 0; /** * PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. */ class V1PolicyRule { static getAttributeTypeMap() { return V1PolicyRule.attributeTypeMap; } } exports.V1PolicyRule = V1PolicyRule; V1PolicyRule.discriminator = undefined; V1PolicyRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1PolicyRule.js.map /***/ }), /***/ 85571: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PortStatus = void 0; class V1PortStatus { static getAttributeTypeMap() { return V1PortStatus.attributeTypeMap; } } exports.V1PortStatus = V1PortStatus; V1PortStatus.discriminator = undefined; V1PortStatus.attributeTypeMap = [ { "name": "error", "baseName": "error", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; //# sourceMappingURL=v1PortStatus.js.map /***/ }), /***/ 3317: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PortworxVolumeSource = void 0; /** * PortworxVolumeSource represents a Portworx volume resource. */ class V1PortworxVolumeSource { static getAttributeTypeMap() { return V1PortworxVolumeSource.attributeTypeMap; } } exports.V1PortworxVolumeSource = V1PortworxVolumeSource; V1PortworxVolumeSource.discriminator = undefined; V1PortworxVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "volumeID", "baseName": "volumeID", "type": "string" } ]; //# sourceMappingURL=v1PortworxVolumeSource.js.map /***/ }), /***/ 85751: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Preconditions = void 0; /** * Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. */ class V1Preconditions { static getAttributeTypeMap() { return V1Preconditions.attributeTypeMap; } } exports.V1Preconditions = V1Preconditions; V1Preconditions.discriminator = undefined; V1Preconditions.attributeTypeMap = [ { "name": "resourceVersion", "baseName": "resourceVersion", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; //# sourceMappingURL=v1Preconditions.js.map /***/ }), /***/ 50837: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PreferredSchedulingTerm = void 0; /** * An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it\'s a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). */ class V1PreferredSchedulingTerm { static getAttributeTypeMap() { return V1PreferredSchedulingTerm.attributeTypeMap; } } exports.V1PreferredSchedulingTerm = V1PreferredSchedulingTerm; V1PreferredSchedulingTerm.discriminator = undefined; V1PreferredSchedulingTerm.attributeTypeMap = [ { "name": "preference", "baseName": "preference", "type": "V1NodeSelectorTerm" }, { "name": "weight", "baseName": "weight", "type": "number" } ]; //# sourceMappingURL=v1PreferredSchedulingTerm.js.map /***/ }), /***/ 35698: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PriorityClass = void 0; /** * PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. */ class V1PriorityClass { static getAttributeTypeMap() { return V1PriorityClass.attributeTypeMap; } } exports.V1PriorityClass = V1PriorityClass; V1PriorityClass.discriminator = undefined; V1PriorityClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "globalDefault", "baseName": "globalDefault", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "preemptionPolicy", "baseName": "preemptionPolicy", "type": "string" }, { "name": "value", "baseName": "value", "type": "number" } ]; //# sourceMappingURL=v1PriorityClass.js.map /***/ }), /***/ 80966: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1PriorityClassList = void 0; /** * PriorityClassList is a collection of priority classes. */ class V1PriorityClassList { static getAttributeTypeMap() { return V1PriorityClassList.attributeTypeMap; } } exports.V1PriorityClassList = V1PriorityClassList; V1PriorityClassList.discriminator = undefined; V1PriorityClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1PriorityClassList.js.map /***/ }), /***/ 43933: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Probe = void 0; /** * Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. */ class V1Probe { static getAttributeTypeMap() { return V1Probe.attributeTypeMap; } } exports.V1Probe = V1Probe; V1Probe.discriminator = undefined; V1Probe.attributeTypeMap = [ { "name": "exec", "baseName": "exec", "type": "V1ExecAction" }, { "name": "failureThreshold", "baseName": "failureThreshold", "type": "number" }, { "name": "httpGet", "baseName": "httpGet", "type": "V1HTTPGetAction" }, { "name": "initialDelaySeconds", "baseName": "initialDelaySeconds", "type": "number" }, { "name": "periodSeconds", "baseName": "periodSeconds", "type": "number" }, { "name": "successThreshold", "baseName": "successThreshold", "type": "number" }, { "name": "tcpSocket", "baseName": "tcpSocket", "type": "V1TCPSocketAction" }, { "name": "timeoutSeconds", "baseName": "timeoutSeconds", "type": "number" } ]; //# sourceMappingURL=v1Probe.js.map /***/ }), /***/ 54662: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ProjectedVolumeSource = void 0; /** * Represents a projected volume source */ class V1ProjectedVolumeSource { static getAttributeTypeMap() { return V1ProjectedVolumeSource.attributeTypeMap; } } exports.V1ProjectedVolumeSource = V1ProjectedVolumeSource; V1ProjectedVolumeSource.discriminator = undefined; V1ProjectedVolumeSource.attributeTypeMap = [ { "name": "defaultMode", "baseName": "defaultMode", "type": "number" }, { "name": "sources", "baseName": "sources", "type": "Array" } ]; //# sourceMappingURL=v1ProjectedVolumeSource.js.map /***/ }), /***/ 16954: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1QuobyteVolumeSource = void 0; /** * Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling. */ class V1QuobyteVolumeSource { static getAttributeTypeMap() { return V1QuobyteVolumeSource.attributeTypeMap; } } exports.V1QuobyteVolumeSource = V1QuobyteVolumeSource; V1QuobyteVolumeSource.discriminator = undefined; V1QuobyteVolumeSource.attributeTypeMap = [ { "name": "group", "baseName": "group", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "registry", "baseName": "registry", "type": "string" }, { "name": "tenant", "baseName": "tenant", "type": "string" }, { "name": "user", "baseName": "user", "type": "string" }, { "name": "volume", "baseName": "volume", "type": "string" } ]; //# sourceMappingURL=v1QuobyteVolumeSource.js.map /***/ }), /***/ 70634: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RBDPersistentVolumeSource = void 0; /** * Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling. */ class V1RBDPersistentVolumeSource { static getAttributeTypeMap() { return V1RBDPersistentVolumeSource.attributeTypeMap; } } exports.V1RBDPersistentVolumeSource = V1RBDPersistentVolumeSource; V1RBDPersistentVolumeSource.discriminator = undefined; V1RBDPersistentVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "keyring", "baseName": "keyring", "type": "string" }, { "name": "monitors", "baseName": "monitors", "type": "Array" }, { "name": "pool", "baseName": "pool", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "user", "baseName": "user", "type": "string" } ]; //# sourceMappingURL=v1RBDPersistentVolumeSource.js.map /***/ }), /***/ 26573: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RBDVolumeSource = void 0; /** * Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling. */ class V1RBDVolumeSource { static getAttributeTypeMap() { return V1RBDVolumeSource.attributeTypeMap; } } exports.V1RBDVolumeSource = V1RBDVolumeSource; V1RBDVolumeSource.discriminator = undefined; V1RBDVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "image", "baseName": "image", "type": "string" }, { "name": "keyring", "baseName": "keyring", "type": "string" }, { "name": "monitors", "baseName": "monitors", "type": "Array" }, { "name": "pool", "baseName": "pool", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "user", "baseName": "user", "type": "string" } ]; //# sourceMappingURL=v1RBDVolumeSource.js.map /***/ }), /***/ 69009: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicaSet = void 0; /** * ReplicaSet ensures that a specified number of pod replicas are running at any given time. */ class V1ReplicaSet { static getAttributeTypeMap() { return V1ReplicaSet.attributeTypeMap; } } exports.V1ReplicaSet = V1ReplicaSet; V1ReplicaSet.discriminator = undefined; V1ReplicaSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ReplicaSetSpec" }, { "name": "status", "baseName": "status", "type": "V1ReplicaSetStatus" } ]; //# sourceMappingURL=v1ReplicaSet.js.map /***/ }), /***/ 14870: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicaSetCondition = void 0; /** * ReplicaSetCondition describes the state of a replica set at a certain point. */ class V1ReplicaSetCondition { static getAttributeTypeMap() { return V1ReplicaSetCondition.attributeTypeMap; } } exports.V1ReplicaSetCondition = V1ReplicaSetCondition; V1ReplicaSetCondition.discriminator = undefined; V1ReplicaSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1ReplicaSetCondition.js.map /***/ }), /***/ 40475: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicaSetList = void 0; /** * ReplicaSetList is a collection of ReplicaSets. */ class V1ReplicaSetList { static getAttributeTypeMap() { return V1ReplicaSetList.attributeTypeMap; } } exports.V1ReplicaSetList = V1ReplicaSetList; V1ReplicaSetList.discriminator = undefined; V1ReplicaSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ReplicaSetList.js.map /***/ }), /***/ 90975: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicaSetSpec = void 0; /** * ReplicaSetSpec is the specification of a ReplicaSet. */ class V1ReplicaSetSpec { static getAttributeTypeMap() { return V1ReplicaSetSpec.attributeTypeMap; } } exports.V1ReplicaSetSpec = V1ReplicaSetSpec; V1ReplicaSetSpec.discriminator = undefined; V1ReplicaSetSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; //# sourceMappingURL=v1ReplicaSetSpec.js.map /***/ }), /***/ 66859: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicaSetStatus = void 0; /** * ReplicaSetStatus represents the current status of a ReplicaSet. */ class V1ReplicaSetStatus { static getAttributeTypeMap() { return V1ReplicaSetStatus.attributeTypeMap; } } exports.V1ReplicaSetStatus = V1ReplicaSetStatus; V1ReplicaSetStatus.discriminator = undefined; V1ReplicaSetStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "fullyLabeledReplicas", "baseName": "fullyLabeledReplicas", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" } ]; //# sourceMappingURL=v1ReplicaSetStatus.js.map /***/ }), /***/ 64888: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicationController = void 0; /** * ReplicationController represents the configuration of a replication controller. */ class V1ReplicationController { static getAttributeTypeMap() { return V1ReplicationController.attributeTypeMap; } } exports.V1ReplicationController = V1ReplicationController; V1ReplicationController.discriminator = undefined; V1ReplicationController.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ReplicationControllerSpec" }, { "name": "status", "baseName": "status", "type": "V1ReplicationControllerStatus" } ]; //# sourceMappingURL=v1ReplicationController.js.map /***/ }), /***/ 36376: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicationControllerCondition = void 0; /** * ReplicationControllerCondition describes the state of a replication controller at a certain point. */ class V1ReplicationControllerCondition { static getAttributeTypeMap() { return V1ReplicationControllerCondition.attributeTypeMap; } } exports.V1ReplicationControllerCondition = V1ReplicationControllerCondition; V1ReplicationControllerCondition.discriminator = undefined; V1ReplicationControllerCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1ReplicationControllerCondition.js.map /***/ }), /***/ 8350: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicationControllerList = void 0; /** * ReplicationControllerList is a collection of replication controllers. */ class V1ReplicationControllerList { static getAttributeTypeMap() { return V1ReplicationControllerList.attributeTypeMap; } } exports.V1ReplicationControllerList = V1ReplicationControllerList; V1ReplicationControllerList.discriminator = undefined; V1ReplicationControllerList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ReplicationControllerList.js.map /***/ }), /***/ 21782: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicationControllerSpec = void 0; /** * ReplicationControllerSpec is the specification of a replication controller. */ class V1ReplicationControllerSpec { static getAttributeTypeMap() { return V1ReplicationControllerSpec.attributeTypeMap; } } exports.V1ReplicationControllerSpec = V1ReplicationControllerSpec; V1ReplicationControllerSpec.discriminator = undefined; V1ReplicationControllerSpec.attributeTypeMap = [ { "name": "minReadySeconds", "baseName": "minReadySeconds", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "{ [key: string]: string; }" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" } ]; //# sourceMappingURL=v1ReplicationControllerSpec.js.map /***/ }), /***/ 19870: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ReplicationControllerStatus = void 0; /** * ReplicationControllerStatus represents the current status of a replication controller. */ class V1ReplicationControllerStatus { static getAttributeTypeMap() { return V1ReplicationControllerStatus.attributeTypeMap; } } exports.V1ReplicationControllerStatus = V1ReplicationControllerStatus; V1ReplicationControllerStatus.discriminator = undefined; V1ReplicationControllerStatus.attributeTypeMap = [ { "name": "availableReplicas", "baseName": "availableReplicas", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "fullyLabeledReplicas", "baseName": "fullyLabeledReplicas", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" } ]; //# sourceMappingURL=v1ReplicationControllerStatus.js.map /***/ }), /***/ 94221: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ResourceAttributes = void 0; /** * ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface */ class V1ResourceAttributes { static getAttributeTypeMap() { return V1ResourceAttributes.attributeTypeMap; } } exports.V1ResourceAttributes = V1ResourceAttributes; V1ResourceAttributes.discriminator = undefined; V1ResourceAttributes.attributeTypeMap = [ { "name": "group", "baseName": "group", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "resource", "baseName": "resource", "type": "string" }, { "name": "subresource", "baseName": "subresource", "type": "string" }, { "name": "verb", "baseName": "verb", "type": "string" }, { "name": "version", "baseName": "version", "type": "string" } ]; //# sourceMappingURL=v1ResourceAttributes.js.map /***/ }), /***/ 10936: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ResourceFieldSelector = void 0; /** * ResourceFieldSelector represents container resources (cpu, memory) and their output format */ class V1ResourceFieldSelector { static getAttributeTypeMap() { return V1ResourceFieldSelector.attributeTypeMap; } } exports.V1ResourceFieldSelector = V1ResourceFieldSelector; V1ResourceFieldSelector.discriminator = undefined; V1ResourceFieldSelector.attributeTypeMap = [ { "name": "containerName", "baseName": "containerName", "type": "string" }, { "name": "divisor", "baseName": "divisor", "type": "string" }, { "name": "resource", "baseName": "resource", "type": "string" } ]; //# sourceMappingURL=v1ResourceFieldSelector.js.map /***/ }), /***/ 5827: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ResourceQuota = void 0; /** * ResourceQuota sets aggregate quota restrictions enforced per namespace */ class V1ResourceQuota { static getAttributeTypeMap() { return V1ResourceQuota.attributeTypeMap; } } exports.V1ResourceQuota = V1ResourceQuota; V1ResourceQuota.discriminator = undefined; V1ResourceQuota.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ResourceQuotaSpec" }, { "name": "status", "baseName": "status", "type": "V1ResourceQuotaStatus" } ]; //# sourceMappingURL=v1ResourceQuota.js.map /***/ }), /***/ 48994: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ResourceQuotaList = void 0; /** * ResourceQuotaList is a list of ResourceQuota items. */ class V1ResourceQuotaList { static getAttributeTypeMap() { return V1ResourceQuotaList.attributeTypeMap; } } exports.V1ResourceQuotaList = V1ResourceQuotaList; V1ResourceQuotaList.discriminator = undefined; V1ResourceQuotaList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ResourceQuotaList.js.map /***/ }), /***/ 55397: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ResourceQuotaSpec = void 0; /** * ResourceQuotaSpec defines the desired hard limits to enforce for Quota. */ class V1ResourceQuotaSpec { static getAttributeTypeMap() { return V1ResourceQuotaSpec.attributeTypeMap; } } exports.V1ResourceQuotaSpec = V1ResourceQuotaSpec; V1ResourceQuotaSpec.discriminator = undefined; V1ResourceQuotaSpec.attributeTypeMap = [ { "name": "hard", "baseName": "hard", "type": "{ [key: string]: string; }" }, { "name": "scopeSelector", "baseName": "scopeSelector", "type": "V1ScopeSelector" }, { "name": "scopes", "baseName": "scopes", "type": "Array" } ]; //# sourceMappingURL=v1ResourceQuotaSpec.js.map /***/ }), /***/ 91686: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ResourceQuotaStatus = void 0; /** * ResourceQuotaStatus defines the enforced hard limits and observed use. */ class V1ResourceQuotaStatus { static getAttributeTypeMap() { return V1ResourceQuotaStatus.attributeTypeMap; } } exports.V1ResourceQuotaStatus = V1ResourceQuotaStatus; V1ResourceQuotaStatus.discriminator = undefined; V1ResourceQuotaStatus.attributeTypeMap = [ { "name": "hard", "baseName": "hard", "type": "{ [key: string]: string; }" }, { "name": "used", "baseName": "used", "type": "{ [key: string]: string; }" } ]; //# sourceMappingURL=v1ResourceQuotaStatus.js.map /***/ }), /***/ 22421: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ResourceRequirements = void 0; /** * ResourceRequirements describes the compute resource requirements. */ class V1ResourceRequirements { static getAttributeTypeMap() { return V1ResourceRequirements.attributeTypeMap; } } exports.V1ResourceRequirements = V1ResourceRequirements; V1ResourceRequirements.discriminator = undefined; V1ResourceRequirements.attributeTypeMap = [ { "name": "limits", "baseName": "limits", "type": "{ [key: string]: string; }" }, { "name": "requests", "baseName": "requests", "type": "{ [key: string]: string; }" } ]; //# sourceMappingURL=v1ResourceRequirements.js.map /***/ }), /***/ 1581: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ResourceRule = void 0; /** * ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn\'t significant, may contain duplicates, and possibly be incomplete. */ class V1ResourceRule { static getAttributeTypeMap() { return V1ResourceRule.attributeTypeMap; } } exports.V1ResourceRule = V1ResourceRule; V1ResourceRule.discriminator = undefined; V1ResourceRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1ResourceRule.js.map /***/ }), /***/ 61114: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Role = void 0; /** * Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. */ class V1Role { static getAttributeTypeMap() { return V1Role.attributeTypeMap; } } exports.V1Role = V1Role; V1Role.discriminator = undefined; V1Role.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; //# sourceMappingURL=v1Role.js.map /***/ }), /***/ 77568: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RoleBinding = void 0; /** * RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace. */ class V1RoleBinding { static getAttributeTypeMap() { return V1RoleBinding.attributeTypeMap; } } exports.V1RoleBinding = V1RoleBinding; V1RoleBinding.discriminator = undefined; V1RoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; //# sourceMappingURL=v1RoleBinding.js.map /***/ }), /***/ 55014: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RoleBindingList = void 0; /** * RoleBindingList is a collection of RoleBindings */ class V1RoleBindingList { static getAttributeTypeMap() { return V1RoleBindingList.attributeTypeMap; } } exports.V1RoleBindingList = V1RoleBindingList; V1RoleBindingList.discriminator = undefined; V1RoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1RoleBindingList.js.map /***/ }), /***/ 63909: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RoleList = void 0; /** * RoleList is a collection of Roles */ class V1RoleList { static getAttributeTypeMap() { return V1RoleList.attributeTypeMap; } } exports.V1RoleList = V1RoleList; V1RoleList.discriminator = undefined; V1RoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1RoleList.js.map /***/ }), /***/ 56149: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RoleRef = void 0; /** * RoleRef contains information that points to the role being used */ class V1RoleRef { static getAttributeTypeMap() { return V1RoleRef.attributeTypeMap; } } exports.V1RoleRef = V1RoleRef; V1RoleRef.discriminator = undefined; V1RoleRef.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1RoleRef.js.map /***/ }), /***/ 46136: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RollingUpdateDaemonSet = void 0; /** * Spec to control the desired behavior of daemon set rolling update. */ class V1RollingUpdateDaemonSet { static getAttributeTypeMap() { return V1RollingUpdateDaemonSet.attributeTypeMap; } } exports.V1RollingUpdateDaemonSet = V1RollingUpdateDaemonSet; V1RollingUpdateDaemonSet.discriminator = undefined; V1RollingUpdateDaemonSet.attributeTypeMap = [ { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "object" } ]; //# sourceMappingURL=v1RollingUpdateDaemonSet.js.map /***/ }), /***/ 70215: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RollingUpdateDeployment = void 0; /** * Spec to control the desired behavior of rolling update. */ class V1RollingUpdateDeployment { static getAttributeTypeMap() { return V1RollingUpdateDeployment.attributeTypeMap; } } exports.V1RollingUpdateDeployment = V1RollingUpdateDeployment; V1RollingUpdateDeployment.discriminator = undefined; V1RollingUpdateDeployment.attributeTypeMap = [ { "name": "maxSurge", "baseName": "maxSurge", "type": "object" }, { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "object" } ]; //# sourceMappingURL=v1RollingUpdateDeployment.js.map /***/ }), /***/ 37088: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RollingUpdateStatefulSetStrategy = void 0; /** * RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. */ class V1RollingUpdateStatefulSetStrategy { static getAttributeTypeMap() { return V1RollingUpdateStatefulSetStrategy.attributeTypeMap; } } exports.V1RollingUpdateStatefulSetStrategy = V1RollingUpdateStatefulSetStrategy; V1RollingUpdateStatefulSetStrategy.discriminator = undefined; V1RollingUpdateStatefulSetStrategy.attributeTypeMap = [ { "name": "partition", "baseName": "partition", "type": "number" } ]; //# sourceMappingURL=v1RollingUpdateStatefulSetStrategy.js.map /***/ }), /***/ 1824: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RuleWithOperations = void 0; /** * RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid. */ class V1RuleWithOperations { static getAttributeTypeMap() { return V1RuleWithOperations.attributeTypeMap; } } exports.V1RuleWithOperations = V1RuleWithOperations; V1RuleWithOperations.discriminator = undefined; V1RuleWithOperations.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "apiVersions", "baseName": "apiVersions", "type": "Array" }, { "name": "operations", "baseName": "operations", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "scope", "baseName": "scope", "type": "string" } ]; //# sourceMappingURL=v1RuleWithOperations.js.map /***/ }), /***/ 31828: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RuntimeClass = void 0; /** * RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://kubernetes.io/docs/concepts/containers/runtime-class/ */ class V1RuntimeClass { static getAttributeTypeMap() { return V1RuntimeClass.attributeTypeMap; } } exports.V1RuntimeClass = V1RuntimeClass; V1RuntimeClass.discriminator = undefined; V1RuntimeClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "handler", "baseName": "handler", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "overhead", "baseName": "overhead", "type": "V1Overhead" }, { "name": "scheduling", "baseName": "scheduling", "type": "V1Scheduling" } ]; //# sourceMappingURL=v1RuntimeClass.js.map /***/ }), /***/ 96736: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1RuntimeClassList = void 0; /** * RuntimeClassList is a list of RuntimeClass objects. */ class V1RuntimeClassList { static getAttributeTypeMap() { return V1RuntimeClassList.attributeTypeMap; } } exports.V1RuntimeClassList = V1RuntimeClassList; V1RuntimeClassList.discriminator = undefined; V1RuntimeClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1RuntimeClassList.js.map /***/ }), /***/ 99411: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SELinuxOptions = void 0; /** * SELinuxOptions are the labels to be applied to the container */ class V1SELinuxOptions { static getAttributeTypeMap() { return V1SELinuxOptions.attributeTypeMap; } } exports.V1SELinuxOptions = V1SELinuxOptions; V1SELinuxOptions.discriminator = undefined; V1SELinuxOptions.attributeTypeMap = [ { "name": "level", "baseName": "level", "type": "string" }, { "name": "role", "baseName": "role", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" }, { "name": "user", "baseName": "user", "type": "string" } ]; //# sourceMappingURL=v1SELinuxOptions.js.map /***/ }), /***/ 9764: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Scale = void 0; /** * Scale represents a scaling request for a resource. */ class V1Scale { static getAttributeTypeMap() { return V1Scale.attributeTypeMap; } } exports.V1Scale = V1Scale; V1Scale.discriminator = undefined; V1Scale.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ScaleSpec" }, { "name": "status", "baseName": "status", "type": "V1ScaleStatus" } ]; //# sourceMappingURL=v1Scale.js.map /***/ }), /***/ 21058: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ScaleIOPersistentVolumeSource = void 0; /** * ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume */ class V1ScaleIOPersistentVolumeSource { static getAttributeTypeMap() { return V1ScaleIOPersistentVolumeSource.attributeTypeMap; } } exports.V1ScaleIOPersistentVolumeSource = V1ScaleIOPersistentVolumeSource; V1ScaleIOPersistentVolumeSource.discriminator = undefined; V1ScaleIOPersistentVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "gateway", "baseName": "gateway", "type": "string" }, { "name": "protectionDomain", "baseName": "protectionDomain", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1SecretReference" }, { "name": "sslEnabled", "baseName": "sslEnabled", "type": "boolean" }, { "name": "storageMode", "baseName": "storageMode", "type": "string" }, { "name": "storagePool", "baseName": "storagePool", "type": "string" }, { "name": "system", "baseName": "system", "type": "string" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" } ]; //# sourceMappingURL=v1ScaleIOPersistentVolumeSource.js.map /***/ }), /***/ 31382: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ScaleIOVolumeSource = void 0; /** * ScaleIOVolumeSource represents a persistent ScaleIO volume */ class V1ScaleIOVolumeSource { static getAttributeTypeMap() { return V1ScaleIOVolumeSource.attributeTypeMap; } } exports.V1ScaleIOVolumeSource = V1ScaleIOVolumeSource; V1ScaleIOVolumeSource.discriminator = undefined; V1ScaleIOVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "gateway", "baseName": "gateway", "type": "string" }, { "name": "protectionDomain", "baseName": "protectionDomain", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "sslEnabled", "baseName": "sslEnabled", "type": "boolean" }, { "name": "storageMode", "baseName": "storageMode", "type": "string" }, { "name": "storagePool", "baseName": "storagePool", "type": "string" }, { "name": "system", "baseName": "system", "type": "string" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" } ]; //# sourceMappingURL=v1ScaleIOVolumeSource.js.map /***/ }), /***/ 15895: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ScaleSpec = void 0; /** * ScaleSpec describes the attributes of a scale subresource. */ class V1ScaleSpec { static getAttributeTypeMap() { return V1ScaleSpec.attributeTypeMap; } } exports.V1ScaleSpec = V1ScaleSpec; V1ScaleSpec.discriminator = undefined; V1ScaleSpec.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" } ]; //# sourceMappingURL=v1ScaleSpec.js.map /***/ }), /***/ 56891: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ScaleStatus = void 0; /** * ScaleStatus represents the current status of a scale subresource. */ class V1ScaleStatus { static getAttributeTypeMap() { return V1ScaleStatus.attributeTypeMap; } } exports.V1ScaleStatus = V1ScaleStatus; V1ScaleStatus.discriminator = undefined; V1ScaleStatus.attributeTypeMap = [ { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "string" } ]; //# sourceMappingURL=v1ScaleStatus.js.map /***/ }), /***/ 79991: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Scheduling = void 0; /** * Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass. */ class V1Scheduling { static getAttributeTypeMap() { return V1Scheduling.attributeTypeMap; } } exports.V1Scheduling = V1Scheduling; V1Scheduling.discriminator = undefined; V1Scheduling.attributeTypeMap = [ { "name": "nodeSelector", "baseName": "nodeSelector", "type": "{ [key: string]: string; }" }, { "name": "tolerations", "baseName": "tolerations", "type": "Array" } ]; //# sourceMappingURL=v1Scheduling.js.map /***/ }), /***/ 60711: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ScopeSelector = void 0; /** * A scope selector represents the AND of the selectors represented by the scoped-resource selector requirements. */ class V1ScopeSelector { static getAttributeTypeMap() { return V1ScopeSelector.attributeTypeMap; } } exports.V1ScopeSelector = V1ScopeSelector; V1ScopeSelector.discriminator = undefined; V1ScopeSelector.attributeTypeMap = [ { "name": "matchExpressions", "baseName": "matchExpressions", "type": "Array" } ]; //# sourceMappingURL=v1ScopeSelector.js.map /***/ }), /***/ 25888: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ScopedResourceSelectorRequirement = void 0; /** * A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator that relates the scope name and values. */ class V1ScopedResourceSelectorRequirement { static getAttributeTypeMap() { return V1ScopedResourceSelectorRequirement.attributeTypeMap; } } exports.V1ScopedResourceSelectorRequirement = V1ScopedResourceSelectorRequirement; V1ScopedResourceSelectorRequirement.discriminator = undefined; V1ScopedResourceSelectorRequirement.attributeTypeMap = [ { "name": "operator", "baseName": "operator", "type": "string" }, { "name": "scopeName", "baseName": "scopeName", "type": "string" }, { "name": "values", "baseName": "values", "type": "Array" } ]; //# sourceMappingURL=v1ScopedResourceSelectorRequirement.js.map /***/ }), /***/ 845: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SeccompProfile = void 0; /** * SeccompProfile defines a pod/container\'s seccomp profile settings. Only one profile source may be set. */ class V1SeccompProfile { static getAttributeTypeMap() { return V1SeccompProfile.attributeTypeMap; } } exports.V1SeccompProfile = V1SeccompProfile; V1SeccompProfile.discriminator = undefined; V1SeccompProfile.attributeTypeMap = [ { "name": "localhostProfile", "baseName": "localhostProfile", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1SeccompProfile.js.map /***/ }), /***/ 49696: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Secret = void 0; /** * Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. */ class V1Secret { static getAttributeTypeMap() { return V1Secret.attributeTypeMap; } } exports.V1Secret = V1Secret; V1Secret.discriminator = undefined; V1Secret.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "data", "baseName": "data", "type": "{ [key: string]: string; }" }, { "name": "immutable", "baseName": "immutable", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "stringData", "baseName": "stringData", "type": "{ [key: string]: string; }" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1Secret.js.map /***/ }), /***/ 7056: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SecretEnvSource = void 0; /** * SecretEnvSource selects a Secret to populate the environment variables with. The contents of the target Secret\'s Data field will represent the key-value pairs as environment variables. */ class V1SecretEnvSource { static getAttributeTypeMap() { return V1SecretEnvSource.attributeTypeMap; } } exports.V1SecretEnvSource = V1SecretEnvSource; V1SecretEnvSource.discriminator = undefined; V1SecretEnvSource.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; //# sourceMappingURL=v1SecretEnvSource.js.map /***/ }), /***/ 3884: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SecretKeySelector = void 0; /** * SecretKeySelector selects a key of a Secret. */ class V1SecretKeySelector { static getAttributeTypeMap() { return V1SecretKeySelector.attributeTypeMap; } } exports.V1SecretKeySelector = V1SecretKeySelector; V1SecretKeySelector.discriminator = undefined; V1SecretKeySelector.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; //# sourceMappingURL=v1SecretKeySelector.js.map /***/ }), /***/ 4248: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SecretList = void 0; /** * SecretList is a list of Secret. */ class V1SecretList { static getAttributeTypeMap() { return V1SecretList.attributeTypeMap; } } exports.V1SecretList = V1SecretList; V1SecretList.discriminator = undefined; V1SecretList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1SecretList.js.map /***/ }), /***/ 39203: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SecretProjection = void 0; /** * Adapts a secret into a projected volume. The contents of the target Secret\'s Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode. */ class V1SecretProjection { static getAttributeTypeMap() { return V1SecretProjection.attributeTypeMap; } } exports.V1SecretProjection = V1SecretProjection; V1SecretProjection.discriminator = undefined; V1SecretProjection.attributeTypeMap = [ { "name": "items", "baseName": "items", "type": "Array" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "optional", "baseName": "optional", "type": "boolean" } ]; //# sourceMappingURL=v1SecretProjection.js.map /***/ }), /***/ 33725: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SecretReference = void 0; /** * SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace */ class V1SecretReference { static getAttributeTypeMap() { return V1SecretReference.attributeTypeMap; } } exports.V1SecretReference = V1SecretReference; V1SecretReference.discriminator = undefined; V1SecretReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; //# sourceMappingURL=v1SecretReference.js.map /***/ }), /***/ 19078: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SecretVolumeSource = void 0; /** * Adapts a Secret into a volume. The contents of the target Secret\'s Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling. */ class V1SecretVolumeSource { static getAttributeTypeMap() { return V1SecretVolumeSource.attributeTypeMap; } } exports.V1SecretVolumeSource = V1SecretVolumeSource; V1SecretVolumeSource.discriminator = undefined; V1SecretVolumeSource.attributeTypeMap = [ { "name": "defaultMode", "baseName": "defaultMode", "type": "number" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "optional", "baseName": "optional", "type": "boolean" }, { "name": "secretName", "baseName": "secretName", "type": "string" } ]; //# sourceMappingURL=v1SecretVolumeSource.js.map /***/ }), /***/ 98113: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SecurityContext = void 0; /** * SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence. */ class V1SecurityContext { static getAttributeTypeMap() { return V1SecurityContext.attributeTypeMap; } } exports.V1SecurityContext = V1SecurityContext; V1SecurityContext.discriminator = undefined; V1SecurityContext.attributeTypeMap = [ { "name": "allowPrivilegeEscalation", "baseName": "allowPrivilegeEscalation", "type": "boolean" }, { "name": "capabilities", "baseName": "capabilities", "type": "V1Capabilities" }, { "name": "privileged", "baseName": "privileged", "type": "boolean" }, { "name": "procMount", "baseName": "procMount", "type": "string" }, { "name": "readOnlyRootFilesystem", "baseName": "readOnlyRootFilesystem", "type": "boolean" }, { "name": "runAsGroup", "baseName": "runAsGroup", "type": "number" }, { "name": "runAsNonRoot", "baseName": "runAsNonRoot", "type": "boolean" }, { "name": "runAsUser", "baseName": "runAsUser", "type": "number" }, { "name": "seLinuxOptions", "baseName": "seLinuxOptions", "type": "V1SELinuxOptions" }, { "name": "seccompProfile", "baseName": "seccompProfile", "type": "V1SeccompProfile" }, { "name": "windowsOptions", "baseName": "windowsOptions", "type": "V1WindowsSecurityContextOptions" } ]; //# sourceMappingURL=v1SecurityContext.js.map /***/ }), /***/ 15598: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SelfSubjectAccessReview = void 0; /** * SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \"in all namespaces\". Self is a special case, because users should always be able to check whether they can perform an action */ class V1SelfSubjectAccessReview { static getAttributeTypeMap() { return V1SelfSubjectAccessReview.attributeTypeMap; } } exports.V1SelfSubjectAccessReview = V1SelfSubjectAccessReview; V1SelfSubjectAccessReview.discriminator = undefined; V1SelfSubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1SelfSubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1SubjectAccessReviewStatus" } ]; //# sourceMappingURL=v1SelfSubjectAccessReview.js.map /***/ }), /***/ 39191: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SelfSubjectAccessReviewSpec = void 0; /** * SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set */ class V1SelfSubjectAccessReviewSpec { static getAttributeTypeMap() { return V1SelfSubjectAccessReviewSpec.attributeTypeMap; } } exports.V1SelfSubjectAccessReviewSpec = V1SelfSubjectAccessReviewSpec; V1SelfSubjectAccessReviewSpec.discriminator = undefined; V1SelfSubjectAccessReviewSpec.attributeTypeMap = [ { "name": "nonResourceAttributes", "baseName": "nonResourceAttributes", "type": "V1NonResourceAttributes" }, { "name": "resourceAttributes", "baseName": "resourceAttributes", "type": "V1ResourceAttributes" } ]; //# sourceMappingURL=v1SelfSubjectAccessReviewSpec.js.map /***/ }), /***/ 84279: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SelfSubjectRulesReview = void 0; /** * SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server\'s authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. */ class V1SelfSubjectRulesReview { static getAttributeTypeMap() { return V1SelfSubjectRulesReview.attributeTypeMap; } } exports.V1SelfSubjectRulesReview = V1SelfSubjectRulesReview; V1SelfSubjectRulesReview.discriminator = undefined; V1SelfSubjectRulesReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1SelfSubjectRulesReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1SubjectRulesReviewStatus" } ]; //# sourceMappingURL=v1SelfSubjectRulesReview.js.map /***/ }), /***/ 56581: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SelfSubjectRulesReviewSpec = void 0; class V1SelfSubjectRulesReviewSpec { static getAttributeTypeMap() { return V1SelfSubjectRulesReviewSpec.attributeTypeMap; } } exports.V1SelfSubjectRulesReviewSpec = V1SelfSubjectRulesReviewSpec; V1SelfSubjectRulesReviewSpec.discriminator = undefined; V1SelfSubjectRulesReviewSpec.attributeTypeMap = [ { "name": "namespace", "baseName": "namespace", "type": "string" } ]; //# sourceMappingURL=v1SelfSubjectRulesReviewSpec.js.map /***/ }), /***/ 30254: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServerAddressByClientCIDR = void 0; /** * ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. */ class V1ServerAddressByClientCIDR { static getAttributeTypeMap() { return V1ServerAddressByClientCIDR.attributeTypeMap; } } exports.V1ServerAddressByClientCIDR = V1ServerAddressByClientCIDR; V1ServerAddressByClientCIDR.discriminator = undefined; V1ServerAddressByClientCIDR.attributeTypeMap = [ { "name": "clientCIDR", "baseName": "clientCIDR", "type": "string" }, { "name": "serverAddress", "baseName": "serverAddress", "type": "string" } ]; //# sourceMappingURL=v1ServerAddressByClientCIDR.js.map /***/ }), /***/ 87928: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Service = void 0; /** * Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy. */ class V1Service { static getAttributeTypeMap() { return V1Service.attributeTypeMap; } } exports.V1Service = V1Service; V1Service.discriminator = undefined; V1Service.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1ServiceSpec" }, { "name": "status", "baseName": "status", "type": "V1ServiceStatus" } ]; //# sourceMappingURL=v1Service.js.map /***/ }), /***/ 9350: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServiceAccount = void 0; /** * ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets */ class V1ServiceAccount { static getAttributeTypeMap() { return V1ServiceAccount.attributeTypeMap; } } exports.V1ServiceAccount = V1ServiceAccount; V1ServiceAccount.discriminator = undefined; V1ServiceAccount.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "automountServiceAccountToken", "baseName": "automountServiceAccountToken", "type": "boolean" }, { "name": "imagePullSecrets", "baseName": "imagePullSecrets", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "secrets", "baseName": "secrets", "type": "Array" } ]; //# sourceMappingURL=v1ServiceAccount.js.map /***/ }), /***/ 38169: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServiceAccountList = void 0; /** * ServiceAccountList is a list of ServiceAccount objects */ class V1ServiceAccountList { static getAttributeTypeMap() { return V1ServiceAccountList.attributeTypeMap; } } exports.V1ServiceAccountList = V1ServiceAccountList; V1ServiceAccountList.discriminator = undefined; V1ServiceAccountList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ServiceAccountList.js.map /***/ }), /***/ 18640: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServiceAccountTokenProjection = void 0; /** * ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise). */ class V1ServiceAccountTokenProjection { static getAttributeTypeMap() { return V1ServiceAccountTokenProjection.attributeTypeMap; } } exports.V1ServiceAccountTokenProjection = V1ServiceAccountTokenProjection; V1ServiceAccountTokenProjection.discriminator = undefined; V1ServiceAccountTokenProjection.attributeTypeMap = [ { "name": "audience", "baseName": "audience", "type": "string" }, { "name": "expirationSeconds", "baseName": "expirationSeconds", "type": "number" }, { "name": "path", "baseName": "path", "type": "string" } ]; //# sourceMappingURL=v1ServiceAccountTokenProjection.js.map /***/ }), /***/ 25927: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServiceBackendPort = void 0; /** * ServiceBackendPort is the service port being referenced. */ class V1ServiceBackendPort { static getAttributeTypeMap() { return V1ServiceBackendPort.attributeTypeMap; } } exports.V1ServiceBackendPort = V1ServiceBackendPort; V1ServiceBackendPort.discriminator = undefined; V1ServiceBackendPort.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "number", "baseName": "number", "type": "number" } ]; //# sourceMappingURL=v1ServiceBackendPort.js.map /***/ }), /***/ 26839: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServiceList = void 0; /** * ServiceList holds a list of services. */ class V1ServiceList { static getAttributeTypeMap() { return V1ServiceList.attributeTypeMap; } } exports.V1ServiceList = V1ServiceList; V1ServiceList.discriminator = undefined; V1ServiceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ServiceList.js.map /***/ }), /***/ 46881: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServicePort = void 0; /** * ServicePort contains information on service\'s port. */ class V1ServicePort { static getAttributeTypeMap() { return V1ServicePort.attributeTypeMap; } } exports.V1ServicePort = V1ServicePort; V1ServicePort.discriminator = undefined; V1ServicePort.attributeTypeMap = [ { "name": "appProtocol", "baseName": "appProtocol", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "nodePort", "baseName": "nodePort", "type": "number" }, { "name": "port", "baseName": "port", "type": "number" }, { "name": "protocol", "baseName": "protocol", "type": "string" }, { "name": "targetPort", "baseName": "targetPort", "type": "object" } ]; //# sourceMappingURL=v1ServicePort.js.map /***/ }), /***/ 96339: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServiceSpec = void 0; /** * ServiceSpec describes the attributes that a user creates on a service. */ class V1ServiceSpec { static getAttributeTypeMap() { return V1ServiceSpec.attributeTypeMap; } } exports.V1ServiceSpec = V1ServiceSpec; V1ServiceSpec.discriminator = undefined; V1ServiceSpec.attributeTypeMap = [ { "name": "allocateLoadBalancerNodePorts", "baseName": "allocateLoadBalancerNodePorts", "type": "boolean" }, { "name": "clusterIP", "baseName": "clusterIP", "type": "string" }, { "name": "clusterIPs", "baseName": "clusterIPs", "type": "Array" }, { "name": "externalIPs", "baseName": "externalIPs", "type": "Array" }, { "name": "externalName", "baseName": "externalName", "type": "string" }, { "name": "externalTrafficPolicy", "baseName": "externalTrafficPolicy", "type": "string" }, { "name": "healthCheckNodePort", "baseName": "healthCheckNodePort", "type": "number" }, { "name": "ipFamilies", "baseName": "ipFamilies", "type": "Array" }, { "name": "ipFamilyPolicy", "baseName": "ipFamilyPolicy", "type": "string" }, { "name": "loadBalancerIP", "baseName": "loadBalancerIP", "type": "string" }, { "name": "loadBalancerSourceRanges", "baseName": "loadBalancerSourceRanges", "type": "Array" }, { "name": "ports", "baseName": "ports", "type": "Array" }, { "name": "publishNotReadyAddresses", "baseName": "publishNotReadyAddresses", "type": "boolean" }, { "name": "selector", "baseName": "selector", "type": "{ [key: string]: string; }" }, { "name": "sessionAffinity", "baseName": "sessionAffinity", "type": "string" }, { "name": "sessionAffinityConfig", "baseName": "sessionAffinityConfig", "type": "V1SessionAffinityConfig" }, { "name": "topologyKeys", "baseName": "topologyKeys", "type": "Array" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1ServiceSpec.js.map /***/ }), /***/ 62890: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ServiceStatus = void 0; /** * ServiceStatus represents the current status of a service. */ class V1ServiceStatus { static getAttributeTypeMap() { return V1ServiceStatus.attributeTypeMap; } } exports.V1ServiceStatus = V1ServiceStatus; V1ServiceStatus.discriminator = undefined; V1ServiceStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "loadBalancer", "baseName": "loadBalancer", "type": "V1LoadBalancerStatus" } ]; //# sourceMappingURL=v1ServiceStatus.js.map /***/ }), /***/ 69127: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SessionAffinityConfig = void 0; /** * SessionAffinityConfig represents the configurations of session affinity. */ class V1SessionAffinityConfig { static getAttributeTypeMap() { return V1SessionAffinityConfig.attributeTypeMap; } } exports.V1SessionAffinityConfig = V1SessionAffinityConfig; V1SessionAffinityConfig.discriminator = undefined; V1SessionAffinityConfig.attributeTypeMap = [ { "name": "clientIP", "baseName": "clientIP", "type": "V1ClientIPConfig" } ]; //# sourceMappingURL=v1SessionAffinityConfig.js.map /***/ }), /***/ 76275: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StatefulSet = void 0; /** * StatefulSet represents a set of pods with consistent identities. Identities are defined as: - Network: A single stable DNS and hostname. - Storage: As many VolumeClaims as requested. The StatefulSet guarantees that a given network identity will always map to the same storage identity. */ class V1StatefulSet { static getAttributeTypeMap() { return V1StatefulSet.attributeTypeMap; } } exports.V1StatefulSet = V1StatefulSet; V1StatefulSet.discriminator = undefined; V1StatefulSet.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1StatefulSetSpec" }, { "name": "status", "baseName": "status", "type": "V1StatefulSetStatus" } ]; //# sourceMappingURL=v1StatefulSet.js.map /***/ }), /***/ 49545: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StatefulSetCondition = void 0; /** * StatefulSetCondition describes the state of a statefulset at a certain point. */ class V1StatefulSetCondition { static getAttributeTypeMap() { return V1StatefulSetCondition.attributeTypeMap; } } exports.V1StatefulSetCondition = V1StatefulSetCondition; V1StatefulSetCondition.discriminator = undefined; V1StatefulSetCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1StatefulSetCondition.js.map /***/ }), /***/ 9927: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StatefulSetList = void 0; /** * StatefulSetList is a collection of StatefulSets. */ class V1StatefulSetList { static getAttributeTypeMap() { return V1StatefulSetList.attributeTypeMap; } } exports.V1StatefulSetList = V1StatefulSetList; V1StatefulSetList.discriminator = undefined; V1StatefulSetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1StatefulSetList.js.map /***/ }), /***/ 18622: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StatefulSetSpec = void 0; /** * A StatefulSetSpec is the specification of a StatefulSet. */ class V1StatefulSetSpec { static getAttributeTypeMap() { return V1StatefulSetSpec.attributeTypeMap; } } exports.V1StatefulSetSpec = V1StatefulSetSpec; V1StatefulSetSpec.discriminator = undefined; V1StatefulSetSpec.attributeTypeMap = [ { "name": "podManagementPolicy", "baseName": "podManagementPolicy", "type": "string" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "revisionHistoryLimit", "baseName": "revisionHistoryLimit", "type": "number" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "serviceName", "baseName": "serviceName", "type": "string" }, { "name": "template", "baseName": "template", "type": "V1PodTemplateSpec" }, { "name": "updateStrategy", "baseName": "updateStrategy", "type": "V1StatefulSetUpdateStrategy" }, { "name": "volumeClaimTemplates", "baseName": "volumeClaimTemplates", "type": "Array" } ]; //# sourceMappingURL=v1StatefulSetSpec.js.map /***/ }), /***/ 95926: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StatefulSetStatus = void 0; /** * StatefulSetStatus represents the current state of a StatefulSet. */ class V1StatefulSetStatus { static getAttributeTypeMap() { return V1StatefulSetStatus.attributeTypeMap; } } exports.V1StatefulSetStatus = V1StatefulSetStatus; V1StatefulSetStatus.discriminator = undefined; V1StatefulSetStatus.attributeTypeMap = [ { "name": "collisionCount", "baseName": "collisionCount", "type": "number" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "currentRevision", "baseName": "currentRevision", "type": "string" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "readyReplicas", "baseName": "readyReplicas", "type": "number" }, { "name": "replicas", "baseName": "replicas", "type": "number" }, { "name": "updateRevision", "baseName": "updateRevision", "type": "string" }, { "name": "updatedReplicas", "baseName": "updatedReplicas", "type": "number" } ]; //# sourceMappingURL=v1StatefulSetStatus.js.map /***/ }), /***/ 48971: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StatefulSetUpdateStrategy = void 0; /** * StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy. */ class V1StatefulSetUpdateStrategy { static getAttributeTypeMap() { return V1StatefulSetUpdateStrategy.attributeTypeMap; } } exports.V1StatefulSetUpdateStrategy = V1StatefulSetUpdateStrategy; V1StatefulSetUpdateStrategy.discriminator = undefined; V1StatefulSetUpdateStrategy.attributeTypeMap = [ { "name": "rollingUpdate", "baseName": "rollingUpdate", "type": "V1RollingUpdateStatefulSetStrategy" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1StatefulSetUpdateStrategy.js.map /***/ }), /***/ 31592: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Status = void 0; /** * Status is a return value for calls that don\'t return other objects. */ class V1Status { static getAttributeTypeMap() { return V1Status.attributeTypeMap; } } exports.V1Status = V1Status; V1Status.discriminator = undefined; V1Status.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "code", "baseName": "code", "type": "number" }, { "name": "details", "baseName": "details", "type": "V1StatusDetails" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" } ]; //# sourceMappingURL=v1Status.js.map /***/ }), /***/ 83459: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StatusCause = void 0; /** * StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered. */ class V1StatusCause { static getAttributeTypeMap() { return V1StatusCause.attributeTypeMap; } } exports.V1StatusCause = V1StatusCause; V1StatusCause.discriminator = undefined; V1StatusCause.attributeTypeMap = [ { "name": "field", "baseName": "field", "type": "string" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; //# sourceMappingURL=v1StatusCause.js.map /***/ }), /***/ 9077: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StatusDetails = void 0; /** * StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined. */ class V1StatusDetails { static getAttributeTypeMap() { return V1StatusDetails.attributeTypeMap; } } exports.V1StatusDetails = V1StatusDetails; V1StatusDetails.discriminator = undefined; V1StatusDetails.attributeTypeMap = [ { "name": "causes", "baseName": "causes", "type": "Array" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "retryAfterSeconds", "baseName": "retryAfterSeconds", "type": "number" }, { "name": "uid", "baseName": "uid", "type": "string" } ]; //# sourceMappingURL=v1StatusDetails.js.map /***/ }), /***/ 70127: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StorageClass = void 0; /** * StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned. StorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. */ class V1StorageClass { static getAttributeTypeMap() { return V1StorageClass.attributeTypeMap; } } exports.V1StorageClass = V1StorageClass; V1StorageClass.discriminator = undefined; V1StorageClass.attributeTypeMap = [ { "name": "allowVolumeExpansion", "baseName": "allowVolumeExpansion", "type": "boolean" }, { "name": "allowedTopologies", "baseName": "allowedTopologies", "type": "Array" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "mountOptions", "baseName": "mountOptions", "type": "Array" }, { "name": "parameters", "baseName": "parameters", "type": "{ [key: string]: string; }" }, { "name": "provisioner", "baseName": "provisioner", "type": "string" }, { "name": "reclaimPolicy", "baseName": "reclaimPolicy", "type": "string" }, { "name": "volumeBindingMode", "baseName": "volumeBindingMode", "type": "string" } ]; //# sourceMappingURL=v1StorageClass.js.map /***/ }), /***/ 53615: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StorageClassList = void 0; /** * StorageClassList is a collection of storage classes. */ class V1StorageClassList { static getAttributeTypeMap() { return V1StorageClassList.attributeTypeMap; } } exports.V1StorageClassList = V1StorageClassList; V1StorageClassList.discriminator = undefined; V1StorageClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1StorageClassList.js.map /***/ }), /***/ 14610: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StorageOSPersistentVolumeSource = void 0; /** * Represents a StorageOS persistent volume resource. */ class V1StorageOSPersistentVolumeSource { static getAttributeTypeMap() { return V1StorageOSPersistentVolumeSource.attributeTypeMap; } } exports.V1StorageOSPersistentVolumeSource = V1StorageOSPersistentVolumeSource; V1StorageOSPersistentVolumeSource.discriminator = undefined; V1StorageOSPersistentVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1ObjectReference" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" }, { "name": "volumeNamespace", "baseName": "volumeNamespace", "type": "string" } ]; //# sourceMappingURL=v1StorageOSPersistentVolumeSource.js.map /***/ }), /***/ 60878: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1StorageOSVolumeSource = void 0; /** * Represents a StorageOS persistent volume resource. */ class V1StorageOSVolumeSource { static getAttributeTypeMap() { return V1StorageOSVolumeSource.attributeTypeMap; } } exports.V1StorageOSVolumeSource = V1StorageOSVolumeSource; V1StorageOSVolumeSource.discriminator = undefined; V1StorageOSVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "secretRef", "baseName": "secretRef", "type": "V1LocalObjectReference" }, { "name": "volumeName", "baseName": "volumeName", "type": "string" }, { "name": "volumeNamespace", "baseName": "volumeNamespace", "type": "string" } ]; //# sourceMappingURL=v1StorageOSVolumeSource.js.map /***/ }), /***/ 1655: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Subject = void 0; /** * Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names. */ class V1Subject { static getAttributeTypeMap() { return V1Subject.attributeTypeMap; } } exports.V1Subject = V1Subject; V1Subject.discriminator = undefined; V1Subject.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; //# sourceMappingURL=v1Subject.js.map /***/ }), /***/ 87717: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SubjectAccessReview = void 0; /** * SubjectAccessReview checks whether or not a user or group can perform an action. */ class V1SubjectAccessReview { static getAttributeTypeMap() { return V1SubjectAccessReview.attributeTypeMap; } } exports.V1SubjectAccessReview = V1SubjectAccessReview; V1SubjectAccessReview.discriminator = undefined; V1SubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1SubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1SubjectAccessReviewStatus" } ]; //# sourceMappingURL=v1SubjectAccessReview.js.map /***/ }), /***/ 34417: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SubjectAccessReviewSpec = void 0; /** * SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set */ class V1SubjectAccessReviewSpec { static getAttributeTypeMap() { return V1SubjectAccessReviewSpec.attributeTypeMap; } } exports.V1SubjectAccessReviewSpec = V1SubjectAccessReviewSpec; V1SubjectAccessReviewSpec.discriminator = undefined; V1SubjectAccessReviewSpec.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "nonResourceAttributes", "baseName": "nonResourceAttributes", "type": "V1NonResourceAttributes" }, { "name": "resourceAttributes", "baseName": "resourceAttributes", "type": "V1ResourceAttributes" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "user", "baseName": "user", "type": "string" } ]; //# sourceMappingURL=v1SubjectAccessReviewSpec.js.map /***/ }), /***/ 62967: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SubjectAccessReviewStatus = void 0; /** * SubjectAccessReviewStatus */ class V1SubjectAccessReviewStatus { static getAttributeTypeMap() { return V1SubjectAccessReviewStatus.attributeTypeMap; } } exports.V1SubjectAccessReviewStatus = V1SubjectAccessReviewStatus; V1SubjectAccessReviewStatus.discriminator = undefined; V1SubjectAccessReviewStatus.attributeTypeMap = [ { "name": "allowed", "baseName": "allowed", "type": "boolean" }, { "name": "denied", "baseName": "denied", "type": "boolean" }, { "name": "evaluationError", "baseName": "evaluationError", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; //# sourceMappingURL=v1SubjectAccessReviewStatus.js.map /***/ }), /***/ 41434: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1SubjectRulesReviewStatus = void 0; /** * SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on the set of authorizers the server is configured with and any errors experienced during evaluation. Because authorization rules are additive, if a rule appears in a list it\'s safe to assume the subject has that permission, even if that list is incomplete. */ class V1SubjectRulesReviewStatus { static getAttributeTypeMap() { return V1SubjectRulesReviewStatus.attributeTypeMap; } } exports.V1SubjectRulesReviewStatus = V1SubjectRulesReviewStatus; V1SubjectRulesReviewStatus.discriminator = undefined; V1SubjectRulesReviewStatus.attributeTypeMap = [ { "name": "evaluationError", "baseName": "evaluationError", "type": "string" }, { "name": "incomplete", "baseName": "incomplete", "type": "boolean" }, { "name": "nonResourceRules", "baseName": "nonResourceRules", "type": "Array" }, { "name": "resourceRules", "baseName": "resourceRules", "type": "Array" } ]; //# sourceMappingURL=v1SubjectRulesReviewStatus.js.map /***/ }), /***/ 55885: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Sysctl = void 0; /** * Sysctl defines a kernel parameter to be set */ class V1Sysctl { static getAttributeTypeMap() { return V1Sysctl.attributeTypeMap; } } exports.V1Sysctl = V1Sysctl; V1Sysctl.discriminator = undefined; V1Sysctl.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; //# sourceMappingURL=v1Sysctl.js.map /***/ }), /***/ 20317: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TCPSocketAction = void 0; /** * TCPSocketAction describes an action based on opening a socket */ class V1TCPSocketAction { static getAttributeTypeMap() { return V1TCPSocketAction.attributeTypeMap; } } exports.V1TCPSocketAction = V1TCPSocketAction; V1TCPSocketAction.discriminator = undefined; V1TCPSocketAction.attributeTypeMap = [ { "name": "host", "baseName": "host", "type": "string" }, { "name": "port", "baseName": "port", "type": "object" } ]; //# sourceMappingURL=v1TCPSocketAction.js.map /***/ }), /***/ 65055: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Taint = void 0; /** * The node this Taint is attached to has the \"effect\" on any pod that does not tolerate the Taint. */ class V1Taint { static getAttributeTypeMap() { return V1Taint.attributeTypeMap; } } exports.V1Taint = V1Taint; V1Taint.discriminator = undefined; V1Taint.attributeTypeMap = [ { "name": "effect", "baseName": "effect", "type": "string" }, { "name": "key", "baseName": "key", "type": "string" }, { "name": "timeAdded", "baseName": "timeAdded", "type": "Date" }, { "name": "value", "baseName": "value", "type": "string" } ]; //# sourceMappingURL=v1Taint.js.map /***/ }), /***/ 46022: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TokenRequestSpec = void 0; /** * TokenRequestSpec contains client provided parameters of a token request. */ class V1TokenRequestSpec { static getAttributeTypeMap() { return V1TokenRequestSpec.attributeTypeMap; } } exports.V1TokenRequestSpec = V1TokenRequestSpec; V1TokenRequestSpec.discriminator = undefined; V1TokenRequestSpec.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "boundObjectRef", "baseName": "boundObjectRef", "type": "V1BoundObjectReference" }, { "name": "expirationSeconds", "baseName": "expirationSeconds", "type": "number" } ]; //# sourceMappingURL=v1TokenRequestSpec.js.map /***/ }), /***/ 38664: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TokenRequestStatus = void 0; /** * TokenRequestStatus is the result of a token request. */ class V1TokenRequestStatus { static getAttributeTypeMap() { return V1TokenRequestStatus.attributeTypeMap; } } exports.V1TokenRequestStatus = V1TokenRequestStatus; V1TokenRequestStatus.discriminator = undefined; V1TokenRequestStatus.attributeTypeMap = [ { "name": "expirationTimestamp", "baseName": "expirationTimestamp", "type": "Date" }, { "name": "token", "baseName": "token", "type": "string" } ]; //# sourceMappingURL=v1TokenRequestStatus.js.map /***/ }), /***/ 93238: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TokenReview = void 0; /** * TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver. */ class V1TokenReview { static getAttributeTypeMap() { return V1TokenReview.attributeTypeMap; } } exports.V1TokenReview = V1TokenReview; V1TokenReview.discriminator = undefined; V1TokenReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1TokenReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1TokenReviewStatus" } ]; //# sourceMappingURL=v1TokenReview.js.map /***/ }), /***/ 6538: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TokenReviewSpec = void 0; /** * TokenReviewSpec is a description of the token authentication request. */ class V1TokenReviewSpec { static getAttributeTypeMap() { return V1TokenReviewSpec.attributeTypeMap; } } exports.V1TokenReviewSpec = V1TokenReviewSpec; V1TokenReviewSpec.discriminator = undefined; V1TokenReviewSpec.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "token", "baseName": "token", "type": "string" } ]; //# sourceMappingURL=v1TokenReviewSpec.js.map /***/ }), /***/ 94719: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TokenReviewStatus = void 0; /** * TokenReviewStatus is the result of the token authentication request. */ class V1TokenReviewStatus { static getAttributeTypeMap() { return V1TokenReviewStatus.attributeTypeMap; } } exports.V1TokenReviewStatus = V1TokenReviewStatus; V1TokenReviewStatus.discriminator = undefined; V1TokenReviewStatus.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "authenticated", "baseName": "authenticated", "type": "boolean" }, { "name": "error", "baseName": "error", "type": "string" }, { "name": "user", "baseName": "user", "type": "V1UserInfo" } ]; //# sourceMappingURL=v1TokenReviewStatus.js.map /***/ }), /***/ 26379: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Toleration = void 0; /** * The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . */ class V1Toleration { static getAttributeTypeMap() { return V1Toleration.attributeTypeMap; } } exports.V1Toleration = V1Toleration; V1Toleration.discriminator = undefined; V1Toleration.attributeTypeMap = [ { "name": "effect", "baseName": "effect", "type": "string" }, { "name": "key", "baseName": "key", "type": "string" }, { "name": "operator", "baseName": "operator", "type": "string" }, { "name": "tolerationSeconds", "baseName": "tolerationSeconds", "type": "number" }, { "name": "value", "baseName": "value", "type": "string" } ]; //# sourceMappingURL=v1Toleration.js.map /***/ }), /***/ 14361: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TopologySelectorLabelRequirement = void 0; /** * A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future. */ class V1TopologySelectorLabelRequirement { static getAttributeTypeMap() { return V1TopologySelectorLabelRequirement.attributeTypeMap; } } exports.V1TopologySelectorLabelRequirement = V1TopologySelectorLabelRequirement; V1TopologySelectorLabelRequirement.discriminator = undefined; V1TopologySelectorLabelRequirement.attributeTypeMap = [ { "name": "key", "baseName": "key", "type": "string" }, { "name": "values", "baseName": "values", "type": "Array" } ]; //# sourceMappingURL=v1TopologySelectorLabelRequirement.js.map /***/ }), /***/ 86872: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TopologySelectorTerm = void 0; /** * A topology selector term represents the result of label queries. A null or empty topology selector term matches no objects. The requirements of them are ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an alpha feature and may change in the future. */ class V1TopologySelectorTerm { static getAttributeTypeMap() { return V1TopologySelectorTerm.attributeTypeMap; } } exports.V1TopologySelectorTerm = V1TopologySelectorTerm; V1TopologySelectorTerm.discriminator = undefined; V1TopologySelectorTerm.attributeTypeMap = [ { "name": "matchLabelExpressions", "baseName": "matchLabelExpressions", "type": "Array" } ]; //# sourceMappingURL=v1TopologySelectorTerm.js.map /***/ }), /***/ 89521: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TopologySpreadConstraint = void 0; /** * TopologySpreadConstraint specifies how to spread matching pods among the given topology. */ class V1TopologySpreadConstraint { static getAttributeTypeMap() { return V1TopologySpreadConstraint.attributeTypeMap; } } exports.V1TopologySpreadConstraint = V1TopologySpreadConstraint; V1TopologySpreadConstraint.discriminator = undefined; V1TopologySpreadConstraint.attributeTypeMap = [ { "name": "labelSelector", "baseName": "labelSelector", "type": "V1LabelSelector" }, { "name": "maxSkew", "baseName": "maxSkew", "type": "number" }, { "name": "topologyKey", "baseName": "topologyKey", "type": "string" }, { "name": "whenUnsatisfiable", "baseName": "whenUnsatisfiable", "type": "string" } ]; //# sourceMappingURL=v1TopologySpreadConstraint.js.map /***/ }), /***/ 6602: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1TypedLocalObjectReference = void 0; /** * TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace. */ class V1TypedLocalObjectReference { static getAttributeTypeMap() { return V1TypedLocalObjectReference.attributeTypeMap; } } exports.V1TypedLocalObjectReference = V1TypedLocalObjectReference; V1TypedLocalObjectReference.discriminator = undefined; V1TypedLocalObjectReference.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1TypedLocalObjectReference.js.map /***/ }), /***/ 75476: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1UserInfo = void 0; /** * UserInfo holds the information about the user needed to implement the user.Info interface. */ class V1UserInfo { static getAttributeTypeMap() { return V1UserInfo.attributeTypeMap; } } exports.V1UserInfo = V1UserInfo; V1UserInfo.discriminator = undefined; V1UserInfo.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "username", "baseName": "username", "type": "string" } ]; //# sourceMappingURL=v1UserInfo.js.map /***/ }), /***/ 67027: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ValidatingWebhook = void 0; /** * ValidatingWebhook describes an admission webhook and the resources and operations it applies to. */ class V1ValidatingWebhook { static getAttributeTypeMap() { return V1ValidatingWebhook.attributeTypeMap; } } exports.V1ValidatingWebhook = V1ValidatingWebhook; V1ValidatingWebhook.discriminator = undefined; V1ValidatingWebhook.attributeTypeMap = [ { "name": "admissionReviewVersions", "baseName": "admissionReviewVersions", "type": "Array" }, { "name": "clientConfig", "baseName": "clientConfig", "type": "AdmissionregistrationV1WebhookClientConfig" }, { "name": "failurePolicy", "baseName": "failurePolicy", "type": "string" }, { "name": "matchPolicy", "baseName": "matchPolicy", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespaceSelector", "baseName": "namespaceSelector", "type": "V1LabelSelector" }, { "name": "objectSelector", "baseName": "objectSelector", "type": "V1LabelSelector" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "sideEffects", "baseName": "sideEffects", "type": "string" }, { "name": "timeoutSeconds", "baseName": "timeoutSeconds", "type": "number" } ]; //# sourceMappingURL=v1ValidatingWebhook.js.map /***/ }), /***/ 98205: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ValidatingWebhookConfiguration = void 0; /** * ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. */ class V1ValidatingWebhookConfiguration { static getAttributeTypeMap() { return V1ValidatingWebhookConfiguration.attributeTypeMap; } } exports.V1ValidatingWebhookConfiguration = V1ValidatingWebhookConfiguration; V1ValidatingWebhookConfiguration.discriminator = undefined; V1ValidatingWebhookConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "webhooks", "baseName": "webhooks", "type": "Array" } ]; //# sourceMappingURL=v1ValidatingWebhookConfiguration.js.map /***/ }), /***/ 3099: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1ValidatingWebhookConfigurationList = void 0; /** * ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. */ class V1ValidatingWebhookConfigurationList { static getAttributeTypeMap() { return V1ValidatingWebhookConfigurationList.attributeTypeMap; } } exports.V1ValidatingWebhookConfigurationList = V1ValidatingWebhookConfigurationList; V1ValidatingWebhookConfigurationList.discriminator = undefined; V1ValidatingWebhookConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1ValidatingWebhookConfigurationList.js.map /***/ }), /***/ 61999: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1Volume = void 0; /** * Volume represents a named volume in a pod that may be accessed by any container in the pod. */ class V1Volume { static getAttributeTypeMap() { return V1Volume.attributeTypeMap; } } exports.V1Volume = V1Volume; V1Volume.discriminator = undefined; V1Volume.attributeTypeMap = [ { "name": "awsElasticBlockStore", "baseName": "awsElasticBlockStore", "type": "V1AWSElasticBlockStoreVolumeSource" }, { "name": "azureDisk", "baseName": "azureDisk", "type": "V1AzureDiskVolumeSource" }, { "name": "azureFile", "baseName": "azureFile", "type": "V1AzureFileVolumeSource" }, { "name": "cephfs", "baseName": "cephfs", "type": "V1CephFSVolumeSource" }, { "name": "cinder", "baseName": "cinder", "type": "V1CinderVolumeSource" }, { "name": "configMap", "baseName": "configMap", "type": "V1ConfigMapVolumeSource" }, { "name": "csi", "baseName": "csi", "type": "V1CSIVolumeSource" }, { "name": "downwardAPI", "baseName": "downwardAPI", "type": "V1DownwardAPIVolumeSource" }, { "name": "emptyDir", "baseName": "emptyDir", "type": "V1EmptyDirVolumeSource" }, { "name": "ephemeral", "baseName": "ephemeral", "type": "V1EphemeralVolumeSource" }, { "name": "fc", "baseName": "fc", "type": "V1FCVolumeSource" }, { "name": "flexVolume", "baseName": "flexVolume", "type": "V1FlexVolumeSource" }, { "name": "flocker", "baseName": "flocker", "type": "V1FlockerVolumeSource" }, { "name": "gcePersistentDisk", "baseName": "gcePersistentDisk", "type": "V1GCEPersistentDiskVolumeSource" }, { "name": "gitRepo", "baseName": "gitRepo", "type": "V1GitRepoVolumeSource" }, { "name": "glusterfs", "baseName": "glusterfs", "type": "V1GlusterfsVolumeSource" }, { "name": "hostPath", "baseName": "hostPath", "type": "V1HostPathVolumeSource" }, { "name": "iscsi", "baseName": "iscsi", "type": "V1ISCSIVolumeSource" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "nfs", "baseName": "nfs", "type": "V1NFSVolumeSource" }, { "name": "persistentVolumeClaim", "baseName": "persistentVolumeClaim", "type": "V1PersistentVolumeClaimVolumeSource" }, { "name": "photonPersistentDisk", "baseName": "photonPersistentDisk", "type": "V1PhotonPersistentDiskVolumeSource" }, { "name": "portworxVolume", "baseName": "portworxVolume", "type": "V1PortworxVolumeSource" }, { "name": "projected", "baseName": "projected", "type": "V1ProjectedVolumeSource" }, { "name": "quobyte", "baseName": "quobyte", "type": "V1QuobyteVolumeSource" }, { "name": "rbd", "baseName": "rbd", "type": "V1RBDVolumeSource" }, { "name": "scaleIO", "baseName": "scaleIO", "type": "V1ScaleIOVolumeSource" }, { "name": "secret", "baseName": "secret", "type": "V1SecretVolumeSource" }, { "name": "storageos", "baseName": "storageos", "type": "V1StorageOSVolumeSource" }, { "name": "vsphereVolume", "baseName": "vsphereVolume", "type": "V1VsphereVirtualDiskVolumeSource" } ]; //# sourceMappingURL=v1Volume.js.map /***/ }), /***/ 96086: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeAttachment = void 0; /** * VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced. */ class V1VolumeAttachment { static getAttributeTypeMap() { return V1VolumeAttachment.attributeTypeMap; } } exports.V1VolumeAttachment = V1VolumeAttachment; V1VolumeAttachment.discriminator = undefined; V1VolumeAttachment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1VolumeAttachmentSpec" }, { "name": "status", "baseName": "status", "type": "V1VolumeAttachmentStatus" } ]; //# sourceMappingURL=v1VolumeAttachment.js.map /***/ }), /***/ 50793: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeAttachmentList = void 0; /** * VolumeAttachmentList is a collection of VolumeAttachment objects. */ class V1VolumeAttachmentList { static getAttributeTypeMap() { return V1VolumeAttachmentList.attributeTypeMap; } } exports.V1VolumeAttachmentList = V1VolumeAttachmentList; V1VolumeAttachmentList.discriminator = undefined; V1VolumeAttachmentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1VolumeAttachmentList.js.map /***/ }), /***/ 81906: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeAttachmentSource = void 0; /** * VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set. */ class V1VolumeAttachmentSource { static getAttributeTypeMap() { return V1VolumeAttachmentSource.attributeTypeMap; } } exports.V1VolumeAttachmentSource = V1VolumeAttachmentSource; V1VolumeAttachmentSource.discriminator = undefined; V1VolumeAttachmentSource.attributeTypeMap = [ { "name": "inlineVolumeSpec", "baseName": "inlineVolumeSpec", "type": "V1PersistentVolumeSpec" }, { "name": "persistentVolumeName", "baseName": "persistentVolumeName", "type": "string" } ]; //# sourceMappingURL=v1VolumeAttachmentSource.js.map /***/ }), /***/ 92848: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeAttachmentSpec = void 0; /** * VolumeAttachmentSpec is the specification of a VolumeAttachment request. */ class V1VolumeAttachmentSpec { static getAttributeTypeMap() { return V1VolumeAttachmentSpec.attributeTypeMap; } } exports.V1VolumeAttachmentSpec = V1VolumeAttachmentSpec; V1VolumeAttachmentSpec.discriminator = undefined; V1VolumeAttachmentSpec.attributeTypeMap = [ { "name": "attacher", "baseName": "attacher", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "source", "baseName": "source", "type": "V1VolumeAttachmentSource" } ]; //# sourceMappingURL=v1VolumeAttachmentSpec.js.map /***/ }), /***/ 69489: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeAttachmentStatus = void 0; /** * VolumeAttachmentStatus is the status of a VolumeAttachment request. */ class V1VolumeAttachmentStatus { static getAttributeTypeMap() { return V1VolumeAttachmentStatus.attributeTypeMap; } } exports.V1VolumeAttachmentStatus = V1VolumeAttachmentStatus; V1VolumeAttachmentStatus.discriminator = undefined; V1VolumeAttachmentStatus.attributeTypeMap = [ { "name": "attachError", "baseName": "attachError", "type": "V1VolumeError" }, { "name": "attached", "baseName": "attached", "type": "boolean" }, { "name": "attachmentMetadata", "baseName": "attachmentMetadata", "type": "{ [key: string]: string; }" }, { "name": "detachError", "baseName": "detachError", "type": "V1VolumeError" } ]; //# sourceMappingURL=v1VolumeAttachmentStatus.js.map /***/ }), /***/ 12040: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeDevice = void 0; /** * volumeDevice describes a mapping of a raw block device within a container. */ class V1VolumeDevice { static getAttributeTypeMap() { return V1VolumeDevice.attributeTypeMap; } } exports.V1VolumeDevice = V1VolumeDevice; V1VolumeDevice.discriminator = undefined; V1VolumeDevice.attributeTypeMap = [ { "name": "devicePath", "baseName": "devicePath", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1VolumeDevice.js.map /***/ }), /***/ 67225: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeError = void 0; /** * VolumeError captures an error encountered during a volume operation. */ class V1VolumeError { static getAttributeTypeMap() { return V1VolumeError.attributeTypeMap; } } exports.V1VolumeError = V1VolumeError; V1VolumeError.discriminator = undefined; V1VolumeError.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "time", "baseName": "time", "type": "Date" } ]; //# sourceMappingURL=v1VolumeError.js.map /***/ }), /***/ 6290: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeMount = void 0; /** * VolumeMount describes a mounting of a Volume within a container. */ class V1VolumeMount { static getAttributeTypeMap() { return V1VolumeMount.attributeTypeMap; } } exports.V1VolumeMount = V1VolumeMount; V1VolumeMount.discriminator = undefined; V1VolumeMount.attributeTypeMap = [ { "name": "mountPath", "baseName": "mountPath", "type": "string" }, { "name": "mountPropagation", "baseName": "mountPropagation", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" }, { "name": "subPath", "baseName": "subPath", "type": "string" }, { "name": "subPathExpr", "baseName": "subPathExpr", "type": "string" } ]; //# sourceMappingURL=v1VolumeMount.js.map /***/ }), /***/ 33698: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeNodeAffinity = void 0; /** * VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. */ class V1VolumeNodeAffinity { static getAttributeTypeMap() { return V1VolumeNodeAffinity.attributeTypeMap; } } exports.V1VolumeNodeAffinity = V1VolumeNodeAffinity; V1VolumeNodeAffinity.discriminator = undefined; V1VolumeNodeAffinity.attributeTypeMap = [ { "name": "required", "baseName": "required", "type": "V1NodeSelector" } ]; //# sourceMappingURL=v1VolumeNodeAffinity.js.map /***/ }), /***/ 3991: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeNodeResources = void 0; /** * VolumeNodeResources is a set of resource limits for scheduling of volumes. */ class V1VolumeNodeResources { static getAttributeTypeMap() { return V1VolumeNodeResources.attributeTypeMap; } } exports.V1VolumeNodeResources = V1VolumeNodeResources; V1VolumeNodeResources.discriminator = undefined; V1VolumeNodeResources.attributeTypeMap = [ { "name": "count", "baseName": "count", "type": "number" } ]; //# sourceMappingURL=v1VolumeNodeResources.js.map /***/ }), /***/ 59985: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VolumeProjection = void 0; /** * Projection that may be projected along with other supported volume types */ class V1VolumeProjection { static getAttributeTypeMap() { return V1VolumeProjection.attributeTypeMap; } } exports.V1VolumeProjection = V1VolumeProjection; V1VolumeProjection.discriminator = undefined; V1VolumeProjection.attributeTypeMap = [ { "name": "configMap", "baseName": "configMap", "type": "V1ConfigMapProjection" }, { "name": "downwardAPI", "baseName": "downwardAPI", "type": "V1DownwardAPIProjection" }, { "name": "secret", "baseName": "secret", "type": "V1SecretProjection" }, { "name": "serviceAccountToken", "baseName": "serviceAccountToken", "type": "V1ServiceAccountTokenProjection" } ]; //# sourceMappingURL=v1VolumeProjection.js.map /***/ }), /***/ 52589: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1VsphereVirtualDiskVolumeSource = void 0; /** * Represents a vSphere volume resource. */ class V1VsphereVirtualDiskVolumeSource { static getAttributeTypeMap() { return V1VsphereVirtualDiskVolumeSource.attributeTypeMap; } } exports.V1VsphereVirtualDiskVolumeSource = V1VsphereVirtualDiskVolumeSource; V1VsphereVirtualDiskVolumeSource.discriminator = undefined; V1VsphereVirtualDiskVolumeSource.attributeTypeMap = [ { "name": "fsType", "baseName": "fsType", "type": "string" }, { "name": "storagePolicyID", "baseName": "storagePolicyID", "type": "string" }, { "name": "storagePolicyName", "baseName": "storagePolicyName", "type": "string" }, { "name": "volumePath", "baseName": "volumePath", "type": "string" } ]; //# sourceMappingURL=v1VsphereVirtualDiskVolumeSource.js.map /***/ }), /***/ 67377: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1WatchEvent = void 0; /** * Event represents a single event to a watched resource. */ class V1WatchEvent { static getAttributeTypeMap() { return V1WatchEvent.attributeTypeMap; } } exports.V1WatchEvent = V1WatchEvent; V1WatchEvent.discriminator = undefined; V1WatchEvent.attributeTypeMap = [ { "name": "object", "baseName": "object", "type": "object" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1WatchEvent.js.map /***/ }), /***/ 5757: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1WebhookConversion = void 0; /** * WebhookConversion describes how to call a conversion webhook */ class V1WebhookConversion { static getAttributeTypeMap() { return V1WebhookConversion.attributeTypeMap; } } exports.V1WebhookConversion = V1WebhookConversion; V1WebhookConversion.discriminator = undefined; V1WebhookConversion.attributeTypeMap = [ { "name": "clientConfig", "baseName": "clientConfig", "type": "ApiextensionsV1WebhookClientConfig" }, { "name": "conversionReviewVersions", "baseName": "conversionReviewVersions", "type": "Array" } ]; //# sourceMappingURL=v1WebhookConversion.js.map /***/ }), /***/ 49592: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1WeightedPodAffinityTerm = void 0; /** * The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) */ class V1WeightedPodAffinityTerm { static getAttributeTypeMap() { return V1WeightedPodAffinityTerm.attributeTypeMap; } } exports.V1WeightedPodAffinityTerm = V1WeightedPodAffinityTerm; V1WeightedPodAffinityTerm.discriminator = undefined; V1WeightedPodAffinityTerm.attributeTypeMap = [ { "name": "podAffinityTerm", "baseName": "podAffinityTerm", "type": "V1PodAffinityTerm" }, { "name": "weight", "baseName": "weight", "type": "number" } ]; //# sourceMappingURL=v1WeightedPodAffinityTerm.js.map /***/ }), /***/ 35568: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1WindowsSecurityContextOptions = void 0; /** * WindowsSecurityContextOptions contain Windows-specific options and credentials. */ class V1WindowsSecurityContextOptions { static getAttributeTypeMap() { return V1WindowsSecurityContextOptions.attributeTypeMap; } } exports.V1WindowsSecurityContextOptions = V1WindowsSecurityContextOptions; V1WindowsSecurityContextOptions.discriminator = undefined; V1WindowsSecurityContextOptions.attributeTypeMap = [ { "name": "gmsaCredentialSpec", "baseName": "gmsaCredentialSpec", "type": "string" }, { "name": "gmsaCredentialSpecName", "baseName": "gmsaCredentialSpecName", "type": "string" }, { "name": "runAsUserName", "baseName": "runAsUserName", "type": "string" } ]; //# sourceMappingURL=v1WindowsSecurityContextOptions.js.map /***/ }), /***/ 5287: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1AggregationRule = void 0; /** * AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole */ class V1alpha1AggregationRule { static getAttributeTypeMap() { return V1alpha1AggregationRule.attributeTypeMap; } } exports.V1alpha1AggregationRule = V1alpha1AggregationRule; V1alpha1AggregationRule.discriminator = undefined; V1alpha1AggregationRule.attributeTypeMap = [ { "name": "clusterRoleSelectors", "baseName": "clusterRoleSelectors", "type": "Array" } ]; //# sourceMappingURL=v1alpha1AggregationRule.js.map /***/ }), /***/ 33927: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1ClusterRole = void 0; /** * ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22. */ class V1alpha1ClusterRole { static getAttributeTypeMap() { return V1alpha1ClusterRole.attributeTypeMap; } } exports.V1alpha1ClusterRole = V1alpha1ClusterRole; V1alpha1ClusterRole.discriminator = undefined; V1alpha1ClusterRole.attributeTypeMap = [ { "name": "aggregationRule", "baseName": "aggregationRule", "type": "V1alpha1AggregationRule" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; //# sourceMappingURL=v1alpha1ClusterRole.js.map /***/ }), /***/ 65276: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1ClusterRoleBinding = void 0; /** * ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22. */ class V1alpha1ClusterRoleBinding { static getAttributeTypeMap() { return V1alpha1ClusterRoleBinding.attributeTypeMap; } } exports.V1alpha1ClusterRoleBinding = V1alpha1ClusterRoleBinding; V1alpha1ClusterRoleBinding.discriminator = undefined; V1alpha1ClusterRoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1alpha1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; //# sourceMappingURL=v1alpha1ClusterRoleBinding.js.map /***/ }), /***/ 83787: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1ClusterRoleBindingList = void 0; /** * ClusterRoleBindingList is a collection of ClusterRoleBindings. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindings, and will no longer be served in v1.22. */ class V1alpha1ClusterRoleBindingList { static getAttributeTypeMap() { return V1alpha1ClusterRoleBindingList.attributeTypeMap; } } exports.V1alpha1ClusterRoleBindingList = V1alpha1ClusterRoleBindingList; V1alpha1ClusterRoleBindingList.discriminator = undefined; V1alpha1ClusterRoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1ClusterRoleBindingList.js.map /***/ }), /***/ 90989: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1ClusterRoleList = void 0; /** * ClusterRoleList is a collection of ClusterRoles. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.22. */ class V1alpha1ClusterRoleList { static getAttributeTypeMap() { return V1alpha1ClusterRoleList.attributeTypeMap; } } exports.V1alpha1ClusterRoleList = V1alpha1ClusterRoleList; V1alpha1ClusterRoleList.discriminator = undefined; V1alpha1ClusterRoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1ClusterRoleList.js.map /***/ }), /***/ 80263: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1FlowDistinguisherMethod = void 0; /** * FlowDistinguisherMethod specifies the method of a flow distinguisher. */ class V1alpha1FlowDistinguisherMethod { static getAttributeTypeMap() { return V1alpha1FlowDistinguisherMethod.attributeTypeMap; } } exports.V1alpha1FlowDistinguisherMethod = V1alpha1FlowDistinguisherMethod; V1alpha1FlowDistinguisherMethod.discriminator = undefined; V1alpha1FlowDistinguisherMethod.attributeTypeMap = [ { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1alpha1FlowDistinguisherMethod.js.map /***/ }), /***/ 70914: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1FlowSchema = void 0; /** * FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a \"flow distinguisher\". */ class V1alpha1FlowSchema { static getAttributeTypeMap() { return V1alpha1FlowSchema.attributeTypeMap; } } exports.V1alpha1FlowSchema = V1alpha1FlowSchema; V1alpha1FlowSchema.discriminator = undefined; V1alpha1FlowSchema.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1alpha1FlowSchemaSpec" }, { "name": "status", "baseName": "status", "type": "V1alpha1FlowSchemaStatus" } ]; //# sourceMappingURL=v1alpha1FlowSchema.js.map /***/ }), /***/ 85050: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1FlowSchemaCondition = void 0; /** * FlowSchemaCondition describes conditions for a FlowSchema. */ class V1alpha1FlowSchemaCondition { static getAttributeTypeMap() { return V1alpha1FlowSchemaCondition.attributeTypeMap; } } exports.V1alpha1FlowSchemaCondition = V1alpha1FlowSchemaCondition; V1alpha1FlowSchemaCondition.discriminator = undefined; V1alpha1FlowSchemaCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1alpha1FlowSchemaCondition.js.map /***/ }), /***/ 43969: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1FlowSchemaList = void 0; /** * FlowSchemaList is a list of FlowSchema objects. */ class V1alpha1FlowSchemaList { static getAttributeTypeMap() { return V1alpha1FlowSchemaList.attributeTypeMap; } } exports.V1alpha1FlowSchemaList = V1alpha1FlowSchemaList; V1alpha1FlowSchemaList.discriminator = undefined; V1alpha1FlowSchemaList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1FlowSchemaList.js.map /***/ }), /***/ 31462: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1FlowSchemaSpec = void 0; /** * FlowSchemaSpec describes how the FlowSchema\'s specification looks like. */ class V1alpha1FlowSchemaSpec { static getAttributeTypeMap() { return V1alpha1FlowSchemaSpec.attributeTypeMap; } } exports.V1alpha1FlowSchemaSpec = V1alpha1FlowSchemaSpec; V1alpha1FlowSchemaSpec.discriminator = undefined; V1alpha1FlowSchemaSpec.attributeTypeMap = [ { "name": "distinguisherMethod", "baseName": "distinguisherMethod", "type": "V1alpha1FlowDistinguisherMethod" }, { "name": "matchingPrecedence", "baseName": "matchingPrecedence", "type": "number" }, { "name": "priorityLevelConfiguration", "baseName": "priorityLevelConfiguration", "type": "V1alpha1PriorityLevelConfigurationReference" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; //# sourceMappingURL=v1alpha1FlowSchemaSpec.js.map /***/ }), /***/ 65: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1FlowSchemaStatus = void 0; /** * FlowSchemaStatus represents the current state of a FlowSchema. */ class V1alpha1FlowSchemaStatus { static getAttributeTypeMap() { return V1alpha1FlowSchemaStatus.attributeTypeMap; } } exports.V1alpha1FlowSchemaStatus = V1alpha1FlowSchemaStatus; V1alpha1FlowSchemaStatus.discriminator = undefined; V1alpha1FlowSchemaStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; //# sourceMappingURL=v1alpha1FlowSchemaStatus.js.map /***/ }), /***/ 50767: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1GroupSubject = void 0; /** * GroupSubject holds detailed information for group-kind subject. */ class V1alpha1GroupSubject { static getAttributeTypeMap() { return V1alpha1GroupSubject.attributeTypeMap; } } exports.V1alpha1GroupSubject = V1alpha1GroupSubject; V1alpha1GroupSubject.discriminator = undefined; V1alpha1GroupSubject.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1alpha1GroupSubject.js.map /***/ }), /***/ 77238: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1LimitResponse = void 0; /** * LimitResponse defines how to handle requests that can not be executed right now. */ class V1alpha1LimitResponse { static getAttributeTypeMap() { return V1alpha1LimitResponse.attributeTypeMap; } } exports.V1alpha1LimitResponse = V1alpha1LimitResponse; V1alpha1LimitResponse.discriminator = undefined; V1alpha1LimitResponse.attributeTypeMap = [ { "name": "queuing", "baseName": "queuing", "type": "V1alpha1QueuingConfiguration" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1alpha1LimitResponse.js.map /***/ }), /***/ 52888: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1LimitedPriorityLevelConfiguration = void 0; /** * LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues: * How are requests for this priority level limited? * What should be done with requests that exceed the limit? */ class V1alpha1LimitedPriorityLevelConfiguration { static getAttributeTypeMap() { return V1alpha1LimitedPriorityLevelConfiguration.attributeTypeMap; } } exports.V1alpha1LimitedPriorityLevelConfiguration = V1alpha1LimitedPriorityLevelConfiguration; V1alpha1LimitedPriorityLevelConfiguration.discriminator = undefined; V1alpha1LimitedPriorityLevelConfiguration.attributeTypeMap = [ { "name": "assuredConcurrencyShares", "baseName": "assuredConcurrencyShares", "type": "number" }, { "name": "limitResponse", "baseName": "limitResponse", "type": "V1alpha1LimitResponse" } ]; //# sourceMappingURL=v1alpha1LimitedPriorityLevelConfiguration.js.map /***/ }), /***/ 44901: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1NonResourcePolicyRule = void 0; /** * NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request. */ class V1alpha1NonResourcePolicyRule { static getAttributeTypeMap() { return V1alpha1NonResourcePolicyRule.attributeTypeMap; } } exports.V1alpha1NonResourcePolicyRule = V1alpha1NonResourcePolicyRule; V1alpha1NonResourcePolicyRule.discriminator = undefined; V1alpha1NonResourcePolicyRule.attributeTypeMap = [ { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1alpha1NonResourcePolicyRule.js.map /***/ }), /***/ 8070: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1Overhead = void 0; /** * Overhead structure represents the resource overhead associated with running a pod. */ class V1alpha1Overhead { static getAttributeTypeMap() { return V1alpha1Overhead.attributeTypeMap; } } exports.V1alpha1Overhead = V1alpha1Overhead; V1alpha1Overhead.discriminator = undefined; V1alpha1Overhead.attributeTypeMap = [ { "name": "podFixed", "baseName": "podFixed", "type": "{ [key: string]: string; }" } ]; //# sourceMappingURL=v1alpha1Overhead.js.map /***/ }), /***/ 61014: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PolicyRule = void 0; /** * PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. */ class V1alpha1PolicyRule { static getAttributeTypeMap() { return V1alpha1PolicyRule.attributeTypeMap; } } exports.V1alpha1PolicyRule = V1alpha1PolicyRule; V1alpha1PolicyRule.discriminator = undefined; V1alpha1PolicyRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1alpha1PolicyRule.js.map /***/ }), /***/ 15062: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PolicyRulesWithSubjects = void 0; /** * PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request. */ class V1alpha1PolicyRulesWithSubjects { static getAttributeTypeMap() { return V1alpha1PolicyRulesWithSubjects.attributeTypeMap; } } exports.V1alpha1PolicyRulesWithSubjects = V1alpha1PolicyRulesWithSubjects; V1alpha1PolicyRulesWithSubjects.discriminator = undefined; V1alpha1PolicyRulesWithSubjects.attributeTypeMap = [ { "name": "nonResourceRules", "baseName": "nonResourceRules", "type": "Array" }, { "name": "resourceRules", "baseName": "resourceRules", "type": "Array" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; //# sourceMappingURL=v1alpha1PolicyRulesWithSubjects.js.map /***/ }), /***/ 89642: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PriorityClass = void 0; /** * DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. */ class V1alpha1PriorityClass { static getAttributeTypeMap() { return V1alpha1PriorityClass.attributeTypeMap; } } exports.V1alpha1PriorityClass = V1alpha1PriorityClass; V1alpha1PriorityClass.discriminator = undefined; V1alpha1PriorityClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "globalDefault", "baseName": "globalDefault", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "preemptionPolicy", "baseName": "preemptionPolicy", "type": "string" }, { "name": "value", "baseName": "value", "type": "number" } ]; //# sourceMappingURL=v1alpha1PriorityClass.js.map /***/ }), /***/ 15220: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PriorityClassList = void 0; /** * PriorityClassList is a collection of priority classes. */ class V1alpha1PriorityClassList { static getAttributeTypeMap() { return V1alpha1PriorityClassList.attributeTypeMap; } } exports.V1alpha1PriorityClassList = V1alpha1PriorityClassList; V1alpha1PriorityClassList.discriminator = undefined; V1alpha1PriorityClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1PriorityClassList.js.map /***/ }), /***/ 10932: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PriorityLevelConfiguration = void 0; /** * PriorityLevelConfiguration represents the configuration of a priority level. */ class V1alpha1PriorityLevelConfiguration { static getAttributeTypeMap() { return V1alpha1PriorityLevelConfiguration.attributeTypeMap; } } exports.V1alpha1PriorityLevelConfiguration = V1alpha1PriorityLevelConfiguration; V1alpha1PriorityLevelConfiguration.discriminator = undefined; V1alpha1PriorityLevelConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1alpha1PriorityLevelConfigurationSpec" }, { "name": "status", "baseName": "status", "type": "V1alpha1PriorityLevelConfigurationStatus" } ]; //# sourceMappingURL=v1alpha1PriorityLevelConfiguration.js.map /***/ }), /***/ 73101: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PriorityLevelConfigurationCondition = void 0; /** * PriorityLevelConfigurationCondition defines the condition of priority level. */ class V1alpha1PriorityLevelConfigurationCondition { static getAttributeTypeMap() { return V1alpha1PriorityLevelConfigurationCondition.attributeTypeMap; } } exports.V1alpha1PriorityLevelConfigurationCondition = V1alpha1PriorityLevelConfigurationCondition; V1alpha1PriorityLevelConfigurationCondition.discriminator = undefined; V1alpha1PriorityLevelConfigurationCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1alpha1PriorityLevelConfigurationCondition.js.map /***/ }), /***/ 78760: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PriorityLevelConfigurationList = void 0; /** * PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. */ class V1alpha1PriorityLevelConfigurationList { static getAttributeTypeMap() { return V1alpha1PriorityLevelConfigurationList.attributeTypeMap; } } exports.V1alpha1PriorityLevelConfigurationList = V1alpha1PriorityLevelConfigurationList; V1alpha1PriorityLevelConfigurationList.discriminator = undefined; V1alpha1PriorityLevelConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1PriorityLevelConfigurationList.js.map /***/ }), /***/ 3464: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PriorityLevelConfigurationReference = void 0; /** * PriorityLevelConfigurationReference contains information that points to the \"request-priority\" being used. */ class V1alpha1PriorityLevelConfigurationReference { static getAttributeTypeMap() { return V1alpha1PriorityLevelConfigurationReference.attributeTypeMap; } } exports.V1alpha1PriorityLevelConfigurationReference = V1alpha1PriorityLevelConfigurationReference; V1alpha1PriorityLevelConfigurationReference.discriminator = undefined; V1alpha1PriorityLevelConfigurationReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1alpha1PriorityLevelConfigurationReference.js.map /***/ }), /***/ 47008: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PriorityLevelConfigurationSpec = void 0; /** * PriorityLevelConfigurationSpec specifies the configuration of a priority level. */ class V1alpha1PriorityLevelConfigurationSpec { static getAttributeTypeMap() { return V1alpha1PriorityLevelConfigurationSpec.attributeTypeMap; } } exports.V1alpha1PriorityLevelConfigurationSpec = V1alpha1PriorityLevelConfigurationSpec; V1alpha1PriorityLevelConfigurationSpec.discriminator = undefined; V1alpha1PriorityLevelConfigurationSpec.attributeTypeMap = [ { "name": "limited", "baseName": "limited", "type": "V1alpha1LimitedPriorityLevelConfiguration" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1alpha1PriorityLevelConfigurationSpec.js.map /***/ }), /***/ 1850: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1PriorityLevelConfigurationStatus = void 0; /** * PriorityLevelConfigurationStatus represents the current state of a \"request-priority\". */ class V1alpha1PriorityLevelConfigurationStatus { static getAttributeTypeMap() { return V1alpha1PriorityLevelConfigurationStatus.attributeTypeMap; } } exports.V1alpha1PriorityLevelConfigurationStatus = V1alpha1PriorityLevelConfigurationStatus; V1alpha1PriorityLevelConfigurationStatus.discriminator = undefined; V1alpha1PriorityLevelConfigurationStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; //# sourceMappingURL=v1alpha1PriorityLevelConfigurationStatus.js.map /***/ }), /***/ 62558: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1QueuingConfiguration = void 0; /** * QueuingConfiguration holds the configuration parameters for queuing */ class V1alpha1QueuingConfiguration { static getAttributeTypeMap() { return V1alpha1QueuingConfiguration.attributeTypeMap; } } exports.V1alpha1QueuingConfiguration = V1alpha1QueuingConfiguration; V1alpha1QueuingConfiguration.discriminator = undefined; V1alpha1QueuingConfiguration.attributeTypeMap = [ { "name": "handSize", "baseName": "handSize", "type": "number" }, { "name": "queueLengthLimit", "baseName": "queueLengthLimit", "type": "number" }, { "name": "queues", "baseName": "queues", "type": "number" } ]; //# sourceMappingURL=v1alpha1QueuingConfiguration.js.map /***/ }), /***/ 49471: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1ResourcePolicyRule = void 0; /** * ResourcePolicyRule is a predicate that matches some resource requests, testing the request\'s verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) least one member of namespaces matches the request. */ class V1alpha1ResourcePolicyRule { static getAttributeTypeMap() { return V1alpha1ResourcePolicyRule.attributeTypeMap; } } exports.V1alpha1ResourcePolicyRule = V1alpha1ResourcePolicyRule; V1alpha1ResourcePolicyRule.discriminator = undefined; V1alpha1ResourcePolicyRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "clusterScope", "baseName": "clusterScope", "type": "boolean" }, { "name": "namespaces", "baseName": "namespaces", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1alpha1ResourcePolicyRule.js.map /***/ }), /***/ 45910: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1Role = void 0; /** * Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22. */ class V1alpha1Role { static getAttributeTypeMap() { return V1alpha1Role.attributeTypeMap; } } exports.V1alpha1Role = V1alpha1Role; V1alpha1Role.discriminator = undefined; V1alpha1Role.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; //# sourceMappingURL=v1alpha1Role.js.map /***/ }), /***/ 32036: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1RoleBinding = void 0; /** * RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22. */ class V1alpha1RoleBinding { static getAttributeTypeMap() { return V1alpha1RoleBinding.attributeTypeMap; } } exports.V1alpha1RoleBinding = V1alpha1RoleBinding; V1alpha1RoleBinding.discriminator = undefined; V1alpha1RoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1alpha1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; //# sourceMappingURL=v1alpha1RoleBinding.js.map /***/ }), /***/ 53079: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1RoleBindingList = void 0; /** * RoleBindingList is a collection of RoleBindings Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22. */ class V1alpha1RoleBindingList { static getAttributeTypeMap() { return V1alpha1RoleBindingList.attributeTypeMap; } } exports.V1alpha1RoleBindingList = V1alpha1RoleBindingList; V1alpha1RoleBindingList.discriminator = undefined; V1alpha1RoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1RoleBindingList.js.map /***/ }), /***/ 39479: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1RoleList = void 0; /** * RoleList is a collection of Roles. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.22. */ class V1alpha1RoleList { static getAttributeTypeMap() { return V1alpha1RoleList.attributeTypeMap; } } exports.V1alpha1RoleList = V1alpha1RoleList; V1alpha1RoleList.discriminator = undefined; V1alpha1RoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1RoleList.js.map /***/ }), /***/ 56871: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1RoleRef = void 0; /** * RoleRef contains information that points to the role being used */ class V1alpha1RoleRef { static getAttributeTypeMap() { return V1alpha1RoleRef.attributeTypeMap; } } exports.V1alpha1RoleRef = V1alpha1RoleRef; V1alpha1RoleRef.discriminator = undefined; V1alpha1RoleRef.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1alpha1RoleRef.js.map /***/ }), /***/ 66602: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1RuntimeClass = void 0; /** * RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md */ class V1alpha1RuntimeClass { static getAttributeTypeMap() { return V1alpha1RuntimeClass.attributeTypeMap; } } exports.V1alpha1RuntimeClass = V1alpha1RuntimeClass; V1alpha1RuntimeClass.discriminator = undefined; V1alpha1RuntimeClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1alpha1RuntimeClassSpec" } ]; //# sourceMappingURL=v1alpha1RuntimeClass.js.map /***/ }), /***/ 41934: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1RuntimeClassList = void 0; /** * RuntimeClassList is a list of RuntimeClass objects. */ class V1alpha1RuntimeClassList { static getAttributeTypeMap() { return V1alpha1RuntimeClassList.attributeTypeMap; } } exports.V1alpha1RuntimeClassList = V1alpha1RuntimeClassList; V1alpha1RuntimeClassList.discriminator = undefined; V1alpha1RuntimeClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1RuntimeClassList.js.map /***/ }), /***/ 3593: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1RuntimeClassSpec = void 0; /** * RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters that are required to describe the RuntimeClass to the Container Runtime Interface (CRI) implementation, as well as any other components that need to understand how the pod will be run. The RuntimeClassSpec is immutable. */ class V1alpha1RuntimeClassSpec { static getAttributeTypeMap() { return V1alpha1RuntimeClassSpec.attributeTypeMap; } } exports.V1alpha1RuntimeClassSpec = V1alpha1RuntimeClassSpec; V1alpha1RuntimeClassSpec.discriminator = undefined; V1alpha1RuntimeClassSpec.attributeTypeMap = [ { "name": "overhead", "baseName": "overhead", "type": "V1alpha1Overhead" }, { "name": "runtimeHandler", "baseName": "runtimeHandler", "type": "string" }, { "name": "scheduling", "baseName": "scheduling", "type": "V1alpha1Scheduling" } ]; //# sourceMappingURL=v1alpha1RuntimeClassSpec.js.map /***/ }), /***/ 12511: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1Scheduling = void 0; /** * Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass. */ class V1alpha1Scheduling { static getAttributeTypeMap() { return V1alpha1Scheduling.attributeTypeMap; } } exports.V1alpha1Scheduling = V1alpha1Scheduling; V1alpha1Scheduling.discriminator = undefined; V1alpha1Scheduling.attributeTypeMap = [ { "name": "nodeSelector", "baseName": "nodeSelector", "type": "{ [key: string]: string; }" }, { "name": "tolerations", "baseName": "tolerations", "type": "Array" } ]; //# sourceMappingURL=v1alpha1Scheduling.js.map /***/ }), /***/ 47647: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1ServerStorageVersion = void 0; /** * An API server instance reports the version it can decode and the version it encodes objects to when persisting objects in the backend. */ class V1alpha1ServerStorageVersion { static getAttributeTypeMap() { return V1alpha1ServerStorageVersion.attributeTypeMap; } } exports.V1alpha1ServerStorageVersion = V1alpha1ServerStorageVersion; V1alpha1ServerStorageVersion.discriminator = undefined; V1alpha1ServerStorageVersion.attributeTypeMap = [ { "name": "apiServerID", "baseName": "apiServerID", "type": "string" }, { "name": "decodableVersions", "baseName": "decodableVersions", "type": "Array" }, { "name": "encodingVersion", "baseName": "encodingVersion", "type": "string" } ]; //# sourceMappingURL=v1alpha1ServerStorageVersion.js.map /***/ }), /***/ 23984: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1ServiceAccountSubject = void 0; /** * ServiceAccountSubject holds detailed information for service-account-kind subject. */ class V1alpha1ServiceAccountSubject { static getAttributeTypeMap() { return V1alpha1ServiceAccountSubject.attributeTypeMap; } } exports.V1alpha1ServiceAccountSubject = V1alpha1ServiceAccountSubject; V1alpha1ServiceAccountSubject.discriminator = undefined; V1alpha1ServiceAccountSubject.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; //# sourceMappingURL=v1alpha1ServiceAccountSubject.js.map /***/ }), /***/ 54349: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1StorageVersion = void 0; /** * Storage version of a specific resource. */ class V1alpha1StorageVersion { static getAttributeTypeMap() { return V1alpha1StorageVersion.attributeTypeMap; } } exports.V1alpha1StorageVersion = V1alpha1StorageVersion; V1alpha1StorageVersion.discriminator = undefined; V1alpha1StorageVersion.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "object" }, { "name": "status", "baseName": "status", "type": "V1alpha1StorageVersionStatus" } ]; //# sourceMappingURL=v1alpha1StorageVersion.js.map /***/ }), /***/ 20058: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1StorageVersionCondition = void 0; /** * Describes the state of the storageVersion at a certain point. */ class V1alpha1StorageVersionCondition { static getAttributeTypeMap() { return V1alpha1StorageVersionCondition.attributeTypeMap; } } exports.V1alpha1StorageVersionCondition = V1alpha1StorageVersionCondition; V1alpha1StorageVersionCondition.discriminator = undefined; V1alpha1StorageVersionCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1alpha1StorageVersionCondition.js.map /***/ }), /***/ 53792: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1StorageVersionList = void 0; /** * A list of StorageVersions. */ class V1alpha1StorageVersionList { static getAttributeTypeMap() { return V1alpha1StorageVersionList.attributeTypeMap; } } exports.V1alpha1StorageVersionList = V1alpha1StorageVersionList; V1alpha1StorageVersionList.discriminator = undefined; V1alpha1StorageVersionList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1StorageVersionList.js.map /***/ }), /***/ 20970: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1StorageVersionStatus = void 0; /** * API server instances report the versions they can decode and the version they encode objects to when persisting objects in the backend. */ class V1alpha1StorageVersionStatus { static getAttributeTypeMap() { return V1alpha1StorageVersionStatus.attributeTypeMap; } } exports.V1alpha1StorageVersionStatus = V1alpha1StorageVersionStatus; V1alpha1StorageVersionStatus.discriminator = undefined; V1alpha1StorageVersionStatus.attributeTypeMap = [ { "name": "commonEncodingVersion", "baseName": "commonEncodingVersion", "type": "string" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "storageVersions", "baseName": "storageVersions", "type": "Array" } ]; //# sourceMappingURL=v1alpha1StorageVersionStatus.js.map /***/ }), /***/ 88064: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1UserSubject = void 0; /** * UserSubject holds detailed information for user-kind subject. */ class V1alpha1UserSubject { static getAttributeTypeMap() { return V1alpha1UserSubject.attributeTypeMap; } } exports.V1alpha1UserSubject = V1alpha1UserSubject; V1alpha1UserSubject.discriminator = undefined; V1alpha1UserSubject.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1alpha1UserSubject.js.map /***/ }), /***/ 88392: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1VolumeAttachment = void 0; /** * VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced. */ class V1alpha1VolumeAttachment { static getAttributeTypeMap() { return V1alpha1VolumeAttachment.attributeTypeMap; } } exports.V1alpha1VolumeAttachment = V1alpha1VolumeAttachment; V1alpha1VolumeAttachment.discriminator = undefined; V1alpha1VolumeAttachment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1alpha1VolumeAttachmentSpec" }, { "name": "status", "baseName": "status", "type": "V1alpha1VolumeAttachmentStatus" } ]; //# sourceMappingURL=v1alpha1VolumeAttachment.js.map /***/ }), /***/ 49929: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1VolumeAttachmentList = void 0; /** * VolumeAttachmentList is a collection of VolumeAttachment objects. */ class V1alpha1VolumeAttachmentList { static getAttributeTypeMap() { return V1alpha1VolumeAttachmentList.attributeTypeMap; } } exports.V1alpha1VolumeAttachmentList = V1alpha1VolumeAttachmentList; V1alpha1VolumeAttachmentList.discriminator = undefined; V1alpha1VolumeAttachmentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1alpha1VolumeAttachmentList.js.map /***/ }), /***/ 23402: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1VolumeAttachmentSource = void 0; /** * VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set. */ class V1alpha1VolumeAttachmentSource { static getAttributeTypeMap() { return V1alpha1VolumeAttachmentSource.attributeTypeMap; } } exports.V1alpha1VolumeAttachmentSource = V1alpha1VolumeAttachmentSource; V1alpha1VolumeAttachmentSource.discriminator = undefined; V1alpha1VolumeAttachmentSource.attributeTypeMap = [ { "name": "inlineVolumeSpec", "baseName": "inlineVolumeSpec", "type": "V1PersistentVolumeSpec" }, { "name": "persistentVolumeName", "baseName": "persistentVolumeName", "type": "string" } ]; //# sourceMappingURL=v1alpha1VolumeAttachmentSource.js.map /***/ }), /***/ 49584: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1VolumeAttachmentSpec = void 0; /** * VolumeAttachmentSpec is the specification of a VolumeAttachment request. */ class V1alpha1VolumeAttachmentSpec { static getAttributeTypeMap() { return V1alpha1VolumeAttachmentSpec.attributeTypeMap; } } exports.V1alpha1VolumeAttachmentSpec = V1alpha1VolumeAttachmentSpec; V1alpha1VolumeAttachmentSpec.discriminator = undefined; V1alpha1VolumeAttachmentSpec.attributeTypeMap = [ { "name": "attacher", "baseName": "attacher", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "source", "baseName": "source", "type": "V1alpha1VolumeAttachmentSource" } ]; //# sourceMappingURL=v1alpha1VolumeAttachmentSpec.js.map /***/ }), /***/ 94030: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1VolumeAttachmentStatus = void 0; /** * VolumeAttachmentStatus is the status of a VolumeAttachment request. */ class V1alpha1VolumeAttachmentStatus { static getAttributeTypeMap() { return V1alpha1VolumeAttachmentStatus.attributeTypeMap; } } exports.V1alpha1VolumeAttachmentStatus = V1alpha1VolumeAttachmentStatus; V1alpha1VolumeAttachmentStatus.discriminator = undefined; V1alpha1VolumeAttachmentStatus.attributeTypeMap = [ { "name": "attachError", "baseName": "attachError", "type": "V1alpha1VolumeError" }, { "name": "attached", "baseName": "attached", "type": "boolean" }, { "name": "attachmentMetadata", "baseName": "attachmentMetadata", "type": "{ [key: string]: string; }" }, { "name": "detachError", "baseName": "detachError", "type": "V1alpha1VolumeError" } ]; //# sourceMappingURL=v1alpha1VolumeAttachmentStatus.js.map /***/ }), /***/ 39991: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1alpha1VolumeError = void 0; /** * VolumeError captures an error encountered during a volume operation. */ class V1alpha1VolumeError { static getAttributeTypeMap() { return V1alpha1VolumeError.attributeTypeMap; } } exports.V1alpha1VolumeError = V1alpha1VolumeError; V1alpha1VolumeError.discriminator = undefined; V1alpha1VolumeError.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "time", "baseName": "time", "type": "Date" } ]; //# sourceMappingURL=v1alpha1VolumeError.js.map /***/ }), /***/ 48676: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1APIService = void 0; /** * APIService represents a server for a particular GroupVersion. Name must be \"version.group\". */ class V1beta1APIService { static getAttributeTypeMap() { return V1beta1APIService.attributeTypeMap; } } exports.V1beta1APIService = V1beta1APIService; V1beta1APIService.discriminator = undefined; V1beta1APIService.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1APIServiceSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1APIServiceStatus" } ]; //# sourceMappingURL=v1beta1APIService.js.map /***/ }), /***/ 53943: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1APIServiceCondition = void 0; /** * APIServiceCondition describes the state of an APIService at a particular point */ class V1beta1APIServiceCondition { static getAttributeTypeMap() { return V1beta1APIServiceCondition.attributeTypeMap; } } exports.V1beta1APIServiceCondition = V1beta1APIServiceCondition; V1beta1APIServiceCondition.discriminator = undefined; V1beta1APIServiceCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1APIServiceCondition.js.map /***/ }), /***/ 44271: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1APIServiceList = void 0; /** * APIServiceList is a list of APIService objects. */ class V1beta1APIServiceList { static getAttributeTypeMap() { return V1beta1APIServiceList.attributeTypeMap; } } exports.V1beta1APIServiceList = V1beta1APIServiceList; V1beta1APIServiceList.discriminator = undefined; V1beta1APIServiceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1APIServiceList.js.map /***/ }), /***/ 99792: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1APIServiceSpec = void 0; /** * APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification. */ class V1beta1APIServiceSpec { static getAttributeTypeMap() { return V1beta1APIServiceSpec.attributeTypeMap; } } exports.V1beta1APIServiceSpec = V1beta1APIServiceSpec; V1beta1APIServiceSpec.discriminator = undefined; V1beta1APIServiceSpec.attributeTypeMap = [ { "name": "caBundle", "baseName": "caBundle", "type": "string" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "groupPriorityMinimum", "baseName": "groupPriorityMinimum", "type": "number" }, { "name": "insecureSkipTLSVerify", "baseName": "insecureSkipTLSVerify", "type": "boolean" }, { "name": "service", "baseName": "service", "type": "ApiregistrationV1beta1ServiceReference" }, { "name": "version", "baseName": "version", "type": "string" }, { "name": "versionPriority", "baseName": "versionPriority", "type": "number" } ]; //# sourceMappingURL=v1beta1APIServiceSpec.js.map /***/ }), /***/ 43425: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1APIServiceStatus = void 0; /** * APIServiceStatus contains derived information about an API server */ class V1beta1APIServiceStatus { static getAttributeTypeMap() { return V1beta1APIServiceStatus.attributeTypeMap; } } exports.V1beta1APIServiceStatus = V1beta1APIServiceStatus; V1beta1APIServiceStatus.discriminator = undefined; V1beta1APIServiceStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; //# sourceMappingURL=v1beta1APIServiceStatus.js.map /***/ }), /***/ 7806: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1AggregationRule = void 0; /** * AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole */ class V1beta1AggregationRule { static getAttributeTypeMap() { return V1beta1AggregationRule.attributeTypeMap; } } exports.V1beta1AggregationRule = V1beta1AggregationRule; V1beta1AggregationRule.discriminator = undefined; V1beta1AggregationRule.attributeTypeMap = [ { "name": "clusterRoleSelectors", "baseName": "clusterRoleSelectors", "type": "Array" } ]; //# sourceMappingURL=v1beta1AggregationRule.js.map /***/ }), /***/ 7724: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1AllowedCSIDriver = void 0; /** * AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used. */ class V1beta1AllowedCSIDriver { static getAttributeTypeMap() { return V1beta1AllowedCSIDriver.attributeTypeMap; } } exports.V1beta1AllowedCSIDriver = V1beta1AllowedCSIDriver; V1beta1AllowedCSIDriver.discriminator = undefined; V1beta1AllowedCSIDriver.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1beta1AllowedCSIDriver.js.map /***/ }), /***/ 66666: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1AllowedFlexVolume = void 0; /** * AllowedFlexVolume represents a single Flexvolume that is allowed to be used. */ class V1beta1AllowedFlexVolume { static getAttributeTypeMap() { return V1beta1AllowedFlexVolume.attributeTypeMap; } } exports.V1beta1AllowedFlexVolume = V1beta1AllowedFlexVolume; V1beta1AllowedFlexVolume.discriminator = undefined; V1beta1AllowedFlexVolume.attributeTypeMap = [ { "name": "driver", "baseName": "driver", "type": "string" } ]; //# sourceMappingURL=v1beta1AllowedFlexVolume.js.map /***/ }), /***/ 29863: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1AllowedHostPath = void 0; /** * AllowedHostPath defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined. */ class V1beta1AllowedHostPath { static getAttributeTypeMap() { return V1beta1AllowedHostPath.attributeTypeMap; } } exports.V1beta1AllowedHostPath = V1beta1AllowedHostPath; V1beta1AllowedHostPath.discriminator = undefined; V1beta1AllowedHostPath.attributeTypeMap = [ { "name": "pathPrefix", "baseName": "pathPrefix", "type": "string" }, { "name": "readOnly", "baseName": "readOnly", "type": "boolean" } ]; //# sourceMappingURL=v1beta1AllowedHostPath.js.map /***/ }), /***/ 23519: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CSIDriver = void 0; /** * CSIDriver captures information about a Container Storage Interface (CSI) volume driver deployed on the cluster. CSI drivers do not need to create the CSIDriver object directly. Instead they may use the cluster-driver-registrar sidecar container. When deployed with a CSI driver it automatically creates a CSIDriver object representing the driver. Kubernetes attach detach controller uses this object to determine whether attach is required. Kubelet uses this object to determine whether pod information needs to be passed on mount. CSIDriver objects are non-namespaced. */ class V1beta1CSIDriver { static getAttributeTypeMap() { return V1beta1CSIDriver.attributeTypeMap; } } exports.V1beta1CSIDriver = V1beta1CSIDriver; V1beta1CSIDriver.discriminator = undefined; V1beta1CSIDriver.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1CSIDriverSpec" } ]; //# sourceMappingURL=v1beta1CSIDriver.js.map /***/ }), /***/ 68738: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CSIDriverList = void 0; /** * CSIDriverList is a collection of CSIDriver objects. */ class V1beta1CSIDriverList { static getAttributeTypeMap() { return V1beta1CSIDriverList.attributeTypeMap; } } exports.V1beta1CSIDriverList = V1beta1CSIDriverList; V1beta1CSIDriverList.discriminator = undefined; V1beta1CSIDriverList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1CSIDriverList.js.map /***/ }), /***/ 24519: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CSIDriverSpec = void 0; /** * CSIDriverSpec is the specification of a CSIDriver. */ class V1beta1CSIDriverSpec { static getAttributeTypeMap() { return V1beta1CSIDriverSpec.attributeTypeMap; } } exports.V1beta1CSIDriverSpec = V1beta1CSIDriverSpec; V1beta1CSIDriverSpec.discriminator = undefined; V1beta1CSIDriverSpec.attributeTypeMap = [ { "name": "attachRequired", "baseName": "attachRequired", "type": "boolean" }, { "name": "fsGroupPolicy", "baseName": "fsGroupPolicy", "type": "string" }, { "name": "podInfoOnMount", "baseName": "podInfoOnMount", "type": "boolean" }, { "name": "requiresRepublish", "baseName": "requiresRepublish", "type": "boolean" }, { "name": "storageCapacity", "baseName": "storageCapacity", "type": "boolean" }, { "name": "tokenRequests", "baseName": "tokenRequests", "type": "Array" }, { "name": "volumeLifecycleModes", "baseName": "volumeLifecycleModes", "type": "Array" } ]; //# sourceMappingURL=v1beta1CSIDriverSpec.js.map /***/ }), /***/ 92663: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CSINode = void 0; /** * DEPRECATED - This group version of CSINode is deprecated by storage/v1/CSINode. See the release notes for more information. CSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn\'t create this object. CSINode has an OwnerReference that points to the corresponding node object. */ class V1beta1CSINode { static getAttributeTypeMap() { return V1beta1CSINode.attributeTypeMap; } } exports.V1beta1CSINode = V1beta1CSINode; V1beta1CSINode.discriminator = undefined; V1beta1CSINode.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1CSINodeSpec" } ]; //# sourceMappingURL=v1beta1CSINode.js.map /***/ }), /***/ 37328: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CSINodeDriver = void 0; /** * CSINodeDriver holds information about the specification of one CSI driver installed on a node */ class V1beta1CSINodeDriver { static getAttributeTypeMap() { return V1beta1CSINodeDriver.attributeTypeMap; } } exports.V1beta1CSINodeDriver = V1beta1CSINodeDriver; V1beta1CSINodeDriver.discriminator = undefined; V1beta1CSINodeDriver.attributeTypeMap = [ { "name": "allocatable", "baseName": "allocatable", "type": "V1beta1VolumeNodeResources" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "nodeID", "baseName": "nodeID", "type": "string" }, { "name": "topologyKeys", "baseName": "topologyKeys", "type": "Array" } ]; //# sourceMappingURL=v1beta1CSINodeDriver.js.map /***/ }), /***/ 16242: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CSINodeList = void 0; /** * CSINodeList is a collection of CSINode objects. */ class V1beta1CSINodeList { static getAttributeTypeMap() { return V1beta1CSINodeList.attributeTypeMap; } } exports.V1beta1CSINodeList = V1beta1CSINodeList; V1beta1CSINodeList.discriminator = undefined; V1beta1CSINodeList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1CSINodeList.js.map /***/ }), /***/ 25978: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CSINodeSpec = void 0; /** * CSINodeSpec holds information about the specification of all CSI drivers installed on a node */ class V1beta1CSINodeSpec { static getAttributeTypeMap() { return V1beta1CSINodeSpec.attributeTypeMap; } } exports.V1beta1CSINodeSpec = V1beta1CSINodeSpec; V1beta1CSINodeSpec.discriminator = undefined; V1beta1CSINodeSpec.attributeTypeMap = [ { "name": "drivers", "baseName": "drivers", "type": "Array" } ]; //# sourceMappingURL=v1beta1CSINodeSpec.js.map /***/ }), /***/ 16589: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CertificateSigningRequest = void 0; /** * Describes a certificate signing request */ class V1beta1CertificateSigningRequest { static getAttributeTypeMap() { return V1beta1CertificateSigningRequest.attributeTypeMap; } } exports.V1beta1CertificateSigningRequest = V1beta1CertificateSigningRequest; V1beta1CertificateSigningRequest.discriminator = undefined; V1beta1CertificateSigningRequest.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1CertificateSigningRequestSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1CertificateSigningRequestStatus" } ]; //# sourceMappingURL=v1beta1CertificateSigningRequest.js.map /***/ }), /***/ 91864: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CertificateSigningRequestCondition = void 0; class V1beta1CertificateSigningRequestCondition { static getAttributeTypeMap() { return V1beta1CertificateSigningRequestCondition.attributeTypeMap; } } exports.V1beta1CertificateSigningRequestCondition = V1beta1CertificateSigningRequestCondition; V1beta1CertificateSigningRequestCondition.discriminator = undefined; V1beta1CertificateSigningRequestCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "lastUpdateTime", "baseName": "lastUpdateTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1CertificateSigningRequestCondition.js.map /***/ }), /***/ 97720: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CertificateSigningRequestList = void 0; class V1beta1CertificateSigningRequestList { static getAttributeTypeMap() { return V1beta1CertificateSigningRequestList.attributeTypeMap; } } exports.V1beta1CertificateSigningRequestList = V1beta1CertificateSigningRequestList; V1beta1CertificateSigningRequestList.discriminator = undefined; V1beta1CertificateSigningRequestList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1CertificateSigningRequestList.js.map /***/ }), /***/ 52843: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CertificateSigningRequestSpec = void 0; /** * This information is immutable after the request is created. Only the Request and Usages fields can be set on creation, other fields are derived by Kubernetes and cannot be modified by users. */ class V1beta1CertificateSigningRequestSpec { static getAttributeTypeMap() { return V1beta1CertificateSigningRequestSpec.attributeTypeMap; } } exports.V1beta1CertificateSigningRequestSpec = V1beta1CertificateSigningRequestSpec; V1beta1CertificateSigningRequestSpec.discriminator = undefined; V1beta1CertificateSigningRequestSpec.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "request", "baseName": "request", "type": "string" }, { "name": "signerName", "baseName": "signerName", "type": "string" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "usages", "baseName": "usages", "type": "Array" }, { "name": "username", "baseName": "username", "type": "string" } ]; //# sourceMappingURL=v1beta1CertificateSigningRequestSpec.js.map /***/ }), /***/ 63675: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CertificateSigningRequestStatus = void 0; class V1beta1CertificateSigningRequestStatus { static getAttributeTypeMap() { return V1beta1CertificateSigningRequestStatus.attributeTypeMap; } } exports.V1beta1CertificateSigningRequestStatus = V1beta1CertificateSigningRequestStatus; V1beta1CertificateSigningRequestStatus.discriminator = undefined; V1beta1CertificateSigningRequestStatus.attributeTypeMap = [ { "name": "certificate", "baseName": "certificate", "type": "string" }, { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; //# sourceMappingURL=v1beta1CertificateSigningRequestStatus.js.map /***/ }), /***/ 34506: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ClusterRole = void 0; /** * ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22. */ class V1beta1ClusterRole { static getAttributeTypeMap() { return V1beta1ClusterRole.attributeTypeMap; } } exports.V1beta1ClusterRole = V1beta1ClusterRole; V1beta1ClusterRole.discriminator = undefined; V1beta1ClusterRole.attributeTypeMap = [ { "name": "aggregationRule", "baseName": "aggregationRule", "type": "V1beta1AggregationRule" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; //# sourceMappingURL=v1beta1ClusterRole.js.map /***/ }), /***/ 72413: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ClusterRoleBinding = void 0; /** * ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22. */ class V1beta1ClusterRoleBinding { static getAttributeTypeMap() { return V1beta1ClusterRoleBinding.attributeTypeMap; } } exports.V1beta1ClusterRoleBinding = V1beta1ClusterRoleBinding; V1beta1ClusterRoleBinding.discriminator = undefined; V1beta1ClusterRoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1beta1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; //# sourceMappingURL=v1beta1ClusterRoleBinding.js.map /***/ }), /***/ 58847: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ClusterRoleBindingList = void 0; /** * ClusterRoleBindingList is a collection of ClusterRoleBindings. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindingList, and will no longer be served in v1.22. */ class V1beta1ClusterRoleBindingList { static getAttributeTypeMap() { return V1beta1ClusterRoleBindingList.attributeTypeMap; } } exports.V1beta1ClusterRoleBindingList = V1beta1ClusterRoleBindingList; V1beta1ClusterRoleBindingList.discriminator = undefined; V1beta1ClusterRoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1ClusterRoleBindingList.js.map /***/ }), /***/ 38268: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ClusterRoleList = void 0; /** * ClusterRoleList is a collection of ClusterRoles. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.22. */ class V1beta1ClusterRoleList { static getAttributeTypeMap() { return V1beta1ClusterRoleList.attributeTypeMap; } } exports.V1beta1ClusterRoleList = V1beta1ClusterRoleList; V1beta1ClusterRoleList.discriminator = undefined; V1beta1ClusterRoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1ClusterRoleList.js.map /***/ }), /***/ 21270: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CronJob = void 0; /** * CronJob represents the configuration of a single cron job. */ class V1beta1CronJob { static getAttributeTypeMap() { return V1beta1CronJob.attributeTypeMap; } } exports.V1beta1CronJob = V1beta1CronJob; V1beta1CronJob.discriminator = undefined; V1beta1CronJob.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1CronJobSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1CronJobStatus" } ]; //# sourceMappingURL=v1beta1CronJob.js.map /***/ }), /***/ 9165: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CronJobList = void 0; /** * CronJobList is a collection of cron jobs. */ class V1beta1CronJobList { static getAttributeTypeMap() { return V1beta1CronJobList.attributeTypeMap; } } exports.V1beta1CronJobList = V1beta1CronJobList; V1beta1CronJobList.discriminator = undefined; V1beta1CronJobList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1CronJobList.js.map /***/ }), /***/ 64672: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CronJobSpec = void 0; /** * CronJobSpec describes how the job execution will look like and when it will actually run. */ class V1beta1CronJobSpec { static getAttributeTypeMap() { return V1beta1CronJobSpec.attributeTypeMap; } } exports.V1beta1CronJobSpec = V1beta1CronJobSpec; V1beta1CronJobSpec.discriminator = undefined; V1beta1CronJobSpec.attributeTypeMap = [ { "name": "concurrencyPolicy", "baseName": "concurrencyPolicy", "type": "string" }, { "name": "failedJobsHistoryLimit", "baseName": "failedJobsHistoryLimit", "type": "number" }, { "name": "jobTemplate", "baseName": "jobTemplate", "type": "V1beta1JobTemplateSpec" }, { "name": "schedule", "baseName": "schedule", "type": "string" }, { "name": "startingDeadlineSeconds", "baseName": "startingDeadlineSeconds", "type": "number" }, { "name": "successfulJobsHistoryLimit", "baseName": "successfulJobsHistoryLimit", "type": "number" }, { "name": "suspend", "baseName": "suspend", "type": "boolean" } ]; //# sourceMappingURL=v1beta1CronJobSpec.js.map /***/ }), /***/ 60049: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CronJobStatus = void 0; /** * CronJobStatus represents the current state of a cron job. */ class V1beta1CronJobStatus { static getAttributeTypeMap() { return V1beta1CronJobStatus.attributeTypeMap; } } exports.V1beta1CronJobStatus = V1beta1CronJobStatus; V1beta1CronJobStatus.discriminator = undefined; V1beta1CronJobStatus.attributeTypeMap = [ { "name": "active", "baseName": "active", "type": "Array" }, { "name": "lastScheduleTime", "baseName": "lastScheduleTime", "type": "Date" } ]; //# sourceMappingURL=v1beta1CronJobStatus.js.map /***/ }), /***/ 15358: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceColumnDefinition = void 0; /** * CustomResourceColumnDefinition specifies a column for server side printing. */ class V1beta1CustomResourceColumnDefinition { static getAttributeTypeMap() { return V1beta1CustomResourceColumnDefinition.attributeTypeMap; } } exports.V1beta1CustomResourceColumnDefinition = V1beta1CustomResourceColumnDefinition; V1beta1CustomResourceColumnDefinition.discriminator = undefined; V1beta1CustomResourceColumnDefinition.attributeTypeMap = [ { "name": "JSONPath", "baseName": "JSONPath", "type": "string" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "format", "baseName": "format", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "priority", "baseName": "priority", "type": "number" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1CustomResourceColumnDefinition.js.map /***/ }), /***/ 9944: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceConversion = void 0; /** * CustomResourceConversion describes how to convert different versions of a CR. */ class V1beta1CustomResourceConversion { static getAttributeTypeMap() { return V1beta1CustomResourceConversion.attributeTypeMap; } } exports.V1beta1CustomResourceConversion = V1beta1CustomResourceConversion; V1beta1CustomResourceConversion.discriminator = undefined; V1beta1CustomResourceConversion.attributeTypeMap = [ { "name": "conversionReviewVersions", "baseName": "conversionReviewVersions", "type": "Array" }, { "name": "strategy", "baseName": "strategy", "type": "string" }, { "name": "webhookClientConfig", "baseName": "webhookClientConfig", "type": "ApiextensionsV1beta1WebhookClientConfig" } ]; //# sourceMappingURL=v1beta1CustomResourceConversion.js.map /***/ }), /***/ 18555: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceDefinition = void 0; /** * CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. Deprecated in v1.16, planned for removal in v1.22. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead. */ class V1beta1CustomResourceDefinition { static getAttributeTypeMap() { return V1beta1CustomResourceDefinition.attributeTypeMap; } } exports.V1beta1CustomResourceDefinition = V1beta1CustomResourceDefinition; V1beta1CustomResourceDefinition.discriminator = undefined; V1beta1CustomResourceDefinition.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1CustomResourceDefinitionSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1CustomResourceDefinitionStatus" } ]; //# sourceMappingURL=v1beta1CustomResourceDefinition.js.map /***/ }), /***/ 49145: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceDefinitionCondition = void 0; /** * CustomResourceDefinitionCondition contains details for the current condition of this pod. */ class V1beta1CustomResourceDefinitionCondition { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionCondition.attributeTypeMap; } } exports.V1beta1CustomResourceDefinitionCondition = V1beta1CustomResourceDefinitionCondition; V1beta1CustomResourceDefinitionCondition.discriminator = undefined; V1beta1CustomResourceDefinitionCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1CustomResourceDefinitionCondition.js.map /***/ }), /***/ 87178: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceDefinitionList = void 0; /** * CustomResourceDefinitionList is a list of CustomResourceDefinition objects. */ class V1beta1CustomResourceDefinitionList { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionList.attributeTypeMap; } } exports.V1beta1CustomResourceDefinitionList = V1beta1CustomResourceDefinitionList; V1beta1CustomResourceDefinitionList.discriminator = undefined; V1beta1CustomResourceDefinitionList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1CustomResourceDefinitionList.js.map /***/ }), /***/ 86145: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceDefinitionNames = void 0; /** * CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition */ class V1beta1CustomResourceDefinitionNames { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionNames.attributeTypeMap; } } exports.V1beta1CustomResourceDefinitionNames = V1beta1CustomResourceDefinitionNames; V1beta1CustomResourceDefinitionNames.discriminator = undefined; V1beta1CustomResourceDefinitionNames.attributeTypeMap = [ { "name": "categories", "baseName": "categories", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "listKind", "baseName": "listKind", "type": "string" }, { "name": "plural", "baseName": "plural", "type": "string" }, { "name": "shortNames", "baseName": "shortNames", "type": "Array" }, { "name": "singular", "baseName": "singular", "type": "string" } ]; //# sourceMappingURL=v1beta1CustomResourceDefinitionNames.js.map /***/ }), /***/ 52618: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceDefinitionSpec = void 0; /** * CustomResourceDefinitionSpec describes how a user wants their resource to appear */ class V1beta1CustomResourceDefinitionSpec { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionSpec.attributeTypeMap; } } exports.V1beta1CustomResourceDefinitionSpec = V1beta1CustomResourceDefinitionSpec; V1beta1CustomResourceDefinitionSpec.discriminator = undefined; V1beta1CustomResourceDefinitionSpec.attributeTypeMap = [ { "name": "additionalPrinterColumns", "baseName": "additionalPrinterColumns", "type": "Array" }, { "name": "conversion", "baseName": "conversion", "type": "V1beta1CustomResourceConversion" }, { "name": "group", "baseName": "group", "type": "string" }, { "name": "names", "baseName": "names", "type": "V1beta1CustomResourceDefinitionNames" }, { "name": "preserveUnknownFields", "baseName": "preserveUnknownFields", "type": "boolean" }, { "name": "scope", "baseName": "scope", "type": "string" }, { "name": "subresources", "baseName": "subresources", "type": "V1beta1CustomResourceSubresources" }, { "name": "validation", "baseName": "validation", "type": "V1beta1CustomResourceValidation" }, { "name": "version", "baseName": "version", "type": "string" }, { "name": "versions", "baseName": "versions", "type": "Array" } ]; //# sourceMappingURL=v1beta1CustomResourceDefinitionSpec.js.map /***/ }), /***/ 18241: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceDefinitionStatus = void 0; /** * CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition */ class V1beta1CustomResourceDefinitionStatus { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionStatus.attributeTypeMap; } } exports.V1beta1CustomResourceDefinitionStatus = V1beta1CustomResourceDefinitionStatus; V1beta1CustomResourceDefinitionStatus.discriminator = undefined; V1beta1CustomResourceDefinitionStatus.attributeTypeMap = [ { "name": "acceptedNames", "baseName": "acceptedNames", "type": "V1beta1CustomResourceDefinitionNames" }, { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "storedVersions", "baseName": "storedVersions", "type": "Array" } ]; //# sourceMappingURL=v1beta1CustomResourceDefinitionStatus.js.map /***/ }), /***/ 67694: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceDefinitionVersion = void 0; /** * CustomResourceDefinitionVersion describes a version for CRD. */ class V1beta1CustomResourceDefinitionVersion { static getAttributeTypeMap() { return V1beta1CustomResourceDefinitionVersion.attributeTypeMap; } } exports.V1beta1CustomResourceDefinitionVersion = V1beta1CustomResourceDefinitionVersion; V1beta1CustomResourceDefinitionVersion.discriminator = undefined; V1beta1CustomResourceDefinitionVersion.attributeTypeMap = [ { "name": "additionalPrinterColumns", "baseName": "additionalPrinterColumns", "type": "Array" }, { "name": "deprecated", "baseName": "deprecated", "type": "boolean" }, { "name": "deprecationWarning", "baseName": "deprecationWarning", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "schema", "baseName": "schema", "type": "V1beta1CustomResourceValidation" }, { "name": "served", "baseName": "served", "type": "boolean" }, { "name": "storage", "baseName": "storage", "type": "boolean" }, { "name": "subresources", "baseName": "subresources", "type": "V1beta1CustomResourceSubresources" } ]; //# sourceMappingURL=v1beta1CustomResourceDefinitionVersion.js.map /***/ }), /***/ 41365: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceSubresourceScale = void 0; /** * CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources. */ class V1beta1CustomResourceSubresourceScale { static getAttributeTypeMap() { return V1beta1CustomResourceSubresourceScale.attributeTypeMap; } } exports.V1beta1CustomResourceSubresourceScale = V1beta1CustomResourceSubresourceScale; V1beta1CustomResourceSubresourceScale.discriminator = undefined; V1beta1CustomResourceSubresourceScale.attributeTypeMap = [ { "name": "labelSelectorPath", "baseName": "labelSelectorPath", "type": "string" }, { "name": "specReplicasPath", "baseName": "specReplicasPath", "type": "string" }, { "name": "statusReplicasPath", "baseName": "statusReplicasPath", "type": "string" } ]; //# sourceMappingURL=v1beta1CustomResourceSubresourceScale.js.map /***/ }), /***/ 13153: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceSubresources = void 0; /** * CustomResourceSubresources defines the status and scale subresources for CustomResources. */ class V1beta1CustomResourceSubresources { static getAttributeTypeMap() { return V1beta1CustomResourceSubresources.attributeTypeMap; } } exports.V1beta1CustomResourceSubresources = V1beta1CustomResourceSubresources; V1beta1CustomResourceSubresources.discriminator = undefined; V1beta1CustomResourceSubresources.attributeTypeMap = [ { "name": "scale", "baseName": "scale", "type": "V1beta1CustomResourceSubresourceScale" }, { "name": "status", "baseName": "status", "type": "object" } ]; //# sourceMappingURL=v1beta1CustomResourceSubresources.js.map /***/ }), /***/ 27347: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1CustomResourceValidation = void 0; /** * CustomResourceValidation is a list of validation methods for CustomResources. */ class V1beta1CustomResourceValidation { static getAttributeTypeMap() { return V1beta1CustomResourceValidation.attributeTypeMap; } } exports.V1beta1CustomResourceValidation = V1beta1CustomResourceValidation; V1beta1CustomResourceValidation.discriminator = undefined; V1beta1CustomResourceValidation.attributeTypeMap = [ { "name": "openAPIV3Schema", "baseName": "openAPIV3Schema", "type": "V1beta1JSONSchemaProps" } ]; //# sourceMappingURL=v1beta1CustomResourceValidation.js.map /***/ }), /***/ 61730: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1Endpoint = void 0; /** * Endpoint represents a single logical \"backend\" implementing a service. */ class V1beta1Endpoint { static getAttributeTypeMap() { return V1beta1Endpoint.attributeTypeMap; } } exports.V1beta1Endpoint = V1beta1Endpoint; V1beta1Endpoint.discriminator = undefined; V1beta1Endpoint.attributeTypeMap = [ { "name": "addresses", "baseName": "addresses", "type": "Array" }, { "name": "conditions", "baseName": "conditions", "type": "V1beta1EndpointConditions" }, { "name": "hostname", "baseName": "hostname", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "targetRef", "baseName": "targetRef", "type": "V1ObjectReference" }, { "name": "topology", "baseName": "topology", "type": "{ [key: string]: string; }" } ]; //# sourceMappingURL=v1beta1Endpoint.js.map /***/ }), /***/ 37085: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1EndpointConditions = void 0; /** * EndpointConditions represents the current condition of an endpoint. */ class V1beta1EndpointConditions { static getAttributeTypeMap() { return V1beta1EndpointConditions.attributeTypeMap; } } exports.V1beta1EndpointConditions = V1beta1EndpointConditions; V1beta1EndpointConditions.discriminator = undefined; V1beta1EndpointConditions.attributeTypeMap = [ { "name": "ready", "baseName": "ready", "type": "boolean" }, { "name": "serving", "baseName": "serving", "type": "boolean" }, { "name": "terminating", "baseName": "terminating", "type": "boolean" } ]; //# sourceMappingURL=v1beta1EndpointConditions.js.map /***/ }), /***/ 7423: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1EndpointPort = void 0; /** * EndpointPort represents a Port used by an EndpointSlice */ class V1beta1EndpointPort { static getAttributeTypeMap() { return V1beta1EndpointPort.attributeTypeMap; } } exports.V1beta1EndpointPort = V1beta1EndpointPort; V1beta1EndpointPort.discriminator = undefined; V1beta1EndpointPort.attributeTypeMap = [ { "name": "appProtocol", "baseName": "appProtocol", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "port", "baseName": "port", "type": "number" }, { "name": "protocol", "baseName": "protocol", "type": "string" } ]; //# sourceMappingURL=v1beta1EndpointPort.js.map /***/ }), /***/ 34706: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1EndpointSlice = void 0; /** * EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints. */ class V1beta1EndpointSlice { static getAttributeTypeMap() { return V1beta1EndpointSlice.attributeTypeMap; } } exports.V1beta1EndpointSlice = V1beta1EndpointSlice; V1beta1EndpointSlice.discriminator = undefined; V1beta1EndpointSlice.attributeTypeMap = [ { "name": "addressType", "baseName": "addressType", "type": "string" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "endpoints", "baseName": "endpoints", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "ports", "baseName": "ports", "type": "Array" } ]; //# sourceMappingURL=v1beta1EndpointSlice.js.map /***/ }), /***/ 98830: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1EndpointSliceList = void 0; /** * EndpointSliceList represents a list of endpoint slices */ class V1beta1EndpointSliceList { static getAttributeTypeMap() { return V1beta1EndpointSliceList.attributeTypeMap; } } exports.V1beta1EndpointSliceList = V1beta1EndpointSliceList; V1beta1EndpointSliceList.discriminator = undefined; V1beta1EndpointSliceList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1EndpointSliceList.js.map /***/ }), /***/ 93967: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1Event = void 0; /** * Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data. */ class V1beta1Event { static getAttributeTypeMap() { return V1beta1Event.attributeTypeMap; } } exports.V1beta1Event = V1beta1Event; V1beta1Event.discriminator = undefined; V1beta1Event.attributeTypeMap = [ { "name": "action", "baseName": "action", "type": "string" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "deprecatedCount", "baseName": "deprecatedCount", "type": "number" }, { "name": "deprecatedFirstTimestamp", "baseName": "deprecatedFirstTimestamp", "type": "Date" }, { "name": "deprecatedLastTimestamp", "baseName": "deprecatedLastTimestamp", "type": "Date" }, { "name": "deprecatedSource", "baseName": "deprecatedSource", "type": "V1EventSource" }, { "name": "eventTime", "baseName": "eventTime", "type": "Date" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "note", "baseName": "note", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "regarding", "baseName": "regarding", "type": "V1ObjectReference" }, { "name": "related", "baseName": "related", "type": "V1ObjectReference" }, { "name": "reportingController", "baseName": "reportingController", "type": "string" }, { "name": "reportingInstance", "baseName": "reportingInstance", "type": "string" }, { "name": "series", "baseName": "series", "type": "V1beta1EventSeries" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1Event.js.map /***/ }), /***/ 64484: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1EventList = void 0; /** * EventList is a list of Event objects. */ class V1beta1EventList { static getAttributeTypeMap() { return V1beta1EventList.attributeTypeMap; } } exports.V1beta1EventList = V1beta1EventList; V1beta1EventList.discriminator = undefined; V1beta1EventList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1EventList.js.map /***/ }), /***/ 63533: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1EventSeries = void 0; /** * EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time. */ class V1beta1EventSeries { static getAttributeTypeMap() { return V1beta1EventSeries.attributeTypeMap; } } exports.V1beta1EventSeries = V1beta1EventSeries; V1beta1EventSeries.discriminator = undefined; V1beta1EventSeries.attributeTypeMap = [ { "name": "count", "baseName": "count", "type": "number" }, { "name": "lastObservedTime", "baseName": "lastObservedTime", "type": "Date" } ]; //# sourceMappingURL=v1beta1EventSeries.js.map /***/ }), /***/ 96254: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1Eviction = void 0; /** * Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions. */ class V1beta1Eviction { static getAttributeTypeMap() { return V1beta1Eviction.attributeTypeMap; } } exports.V1beta1Eviction = V1beta1Eviction; V1beta1Eviction.discriminator = undefined; V1beta1Eviction.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "deleteOptions", "baseName": "deleteOptions", "type": "V1DeleteOptions" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" } ]; //# sourceMappingURL=v1beta1Eviction.js.map /***/ }), /***/ 1040: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ExternalDocumentation = void 0; /** * ExternalDocumentation allows referencing an external resource for extended documentation. */ class V1beta1ExternalDocumentation { static getAttributeTypeMap() { return V1beta1ExternalDocumentation.attributeTypeMap; } } exports.V1beta1ExternalDocumentation = V1beta1ExternalDocumentation; V1beta1ExternalDocumentation.discriminator = undefined; V1beta1ExternalDocumentation.attributeTypeMap = [ { "name": "description", "baseName": "description", "type": "string" }, { "name": "url", "baseName": "url", "type": "string" } ]; //# sourceMappingURL=v1beta1ExternalDocumentation.js.map /***/ }), /***/ 57091: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1FSGroupStrategyOptions = void 0; /** * FSGroupStrategyOptions defines the strategy type and options used to create the strategy. */ class V1beta1FSGroupStrategyOptions { static getAttributeTypeMap() { return V1beta1FSGroupStrategyOptions.attributeTypeMap; } } exports.V1beta1FSGroupStrategyOptions = V1beta1FSGroupStrategyOptions; V1beta1FSGroupStrategyOptions.discriminator = undefined; V1beta1FSGroupStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; //# sourceMappingURL=v1beta1FSGroupStrategyOptions.js.map /***/ }), /***/ 98441: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1FlowDistinguisherMethod = void 0; /** * FlowDistinguisherMethod specifies the method of a flow distinguisher. */ class V1beta1FlowDistinguisherMethod { static getAttributeTypeMap() { return V1beta1FlowDistinguisherMethod.attributeTypeMap; } } exports.V1beta1FlowDistinguisherMethod = V1beta1FlowDistinguisherMethod; V1beta1FlowDistinguisherMethod.discriminator = undefined; V1beta1FlowDistinguisherMethod.attributeTypeMap = [ { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1FlowDistinguisherMethod.js.map /***/ }), /***/ 30089: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1FlowSchema = void 0; /** * FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a \"flow distinguisher\". */ class V1beta1FlowSchema { static getAttributeTypeMap() { return V1beta1FlowSchema.attributeTypeMap; } } exports.V1beta1FlowSchema = V1beta1FlowSchema; V1beta1FlowSchema.discriminator = undefined; V1beta1FlowSchema.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1FlowSchemaSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1FlowSchemaStatus" } ]; //# sourceMappingURL=v1beta1FlowSchema.js.map /***/ }), /***/ 43801: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1FlowSchemaCondition = void 0; /** * FlowSchemaCondition describes conditions for a FlowSchema. */ class V1beta1FlowSchemaCondition { static getAttributeTypeMap() { return V1beta1FlowSchemaCondition.attributeTypeMap; } } exports.V1beta1FlowSchemaCondition = V1beta1FlowSchemaCondition; V1beta1FlowSchemaCondition.discriminator = undefined; V1beta1FlowSchemaCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1FlowSchemaCondition.js.map /***/ }), /***/ 58382: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1FlowSchemaList = void 0; /** * FlowSchemaList is a list of FlowSchema objects. */ class V1beta1FlowSchemaList { static getAttributeTypeMap() { return V1beta1FlowSchemaList.attributeTypeMap; } } exports.V1beta1FlowSchemaList = V1beta1FlowSchemaList; V1beta1FlowSchemaList.discriminator = undefined; V1beta1FlowSchemaList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1FlowSchemaList.js.map /***/ }), /***/ 84478: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1FlowSchemaSpec = void 0; /** * FlowSchemaSpec describes how the FlowSchema\'s specification looks like. */ class V1beta1FlowSchemaSpec { static getAttributeTypeMap() { return V1beta1FlowSchemaSpec.attributeTypeMap; } } exports.V1beta1FlowSchemaSpec = V1beta1FlowSchemaSpec; V1beta1FlowSchemaSpec.discriminator = undefined; V1beta1FlowSchemaSpec.attributeTypeMap = [ { "name": "distinguisherMethod", "baseName": "distinguisherMethod", "type": "V1beta1FlowDistinguisherMethod" }, { "name": "matchingPrecedence", "baseName": "matchingPrecedence", "type": "number" }, { "name": "priorityLevelConfiguration", "baseName": "priorityLevelConfiguration", "type": "V1beta1PriorityLevelConfigurationReference" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; //# sourceMappingURL=v1beta1FlowSchemaSpec.js.map /***/ }), /***/ 8076: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1FlowSchemaStatus = void 0; /** * FlowSchemaStatus represents the current state of a FlowSchema. */ class V1beta1FlowSchemaStatus { static getAttributeTypeMap() { return V1beta1FlowSchemaStatus.attributeTypeMap; } } exports.V1beta1FlowSchemaStatus = V1beta1FlowSchemaStatus; V1beta1FlowSchemaStatus.discriminator = undefined; V1beta1FlowSchemaStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; //# sourceMappingURL=v1beta1FlowSchemaStatus.js.map /***/ }), /***/ 51807: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1GroupSubject = void 0; /** * GroupSubject holds detailed information for group-kind subject. */ class V1beta1GroupSubject { static getAttributeTypeMap() { return V1beta1GroupSubject.attributeTypeMap; } } exports.V1beta1GroupSubject = V1beta1GroupSubject; V1beta1GroupSubject.discriminator = undefined; V1beta1GroupSubject.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1beta1GroupSubject.js.map /***/ }), /***/ 59514: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1HostPortRange = void 0; /** * HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined. */ class V1beta1HostPortRange { static getAttributeTypeMap() { return V1beta1HostPortRange.attributeTypeMap; } } exports.V1beta1HostPortRange = V1beta1HostPortRange; V1beta1HostPortRange.discriminator = undefined; V1beta1HostPortRange.attributeTypeMap = [ { "name": "max", "baseName": "max", "type": "number" }, { "name": "min", "baseName": "min", "type": "number" } ]; //# sourceMappingURL=v1beta1HostPortRange.js.map /***/ }), /***/ 96831: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1IDRange = void 0; /** * IDRange provides a min/max of an allowed range of IDs. */ class V1beta1IDRange { static getAttributeTypeMap() { return V1beta1IDRange.attributeTypeMap; } } exports.V1beta1IDRange = V1beta1IDRange; V1beta1IDRange.discriminator = undefined; V1beta1IDRange.attributeTypeMap = [ { "name": "max", "baseName": "max", "type": "number" }, { "name": "min", "baseName": "min", "type": "number" } ]; //# sourceMappingURL=v1beta1IDRange.js.map /***/ }), /***/ 41330: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1IngressClass = void 0; /** * IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be used to indicate that an IngressClass should be considered default. When a single IngressClass resource has this annotation set to true, new Ingress resources without a class specified will be assigned this default class. */ class V1beta1IngressClass { static getAttributeTypeMap() { return V1beta1IngressClass.attributeTypeMap; } } exports.V1beta1IngressClass = V1beta1IngressClass; V1beta1IngressClass.discriminator = undefined; V1beta1IngressClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1IngressClassSpec" } ]; //# sourceMappingURL=v1beta1IngressClass.js.map /***/ }), /***/ 98895: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1IngressClassList = void 0; /** * IngressClassList is a collection of IngressClasses. */ class V1beta1IngressClassList { static getAttributeTypeMap() { return V1beta1IngressClassList.attributeTypeMap; } } exports.V1beta1IngressClassList = V1beta1IngressClassList; V1beta1IngressClassList.discriminator = undefined; V1beta1IngressClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1IngressClassList.js.map /***/ }), /***/ 95359: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1IngressClassSpec = void 0; /** * IngressClassSpec provides information about the class of an Ingress. */ class V1beta1IngressClassSpec { static getAttributeTypeMap() { return V1beta1IngressClassSpec.attributeTypeMap; } } exports.V1beta1IngressClassSpec = V1beta1IngressClassSpec; V1beta1IngressClassSpec.discriminator = undefined; V1beta1IngressClassSpec.attributeTypeMap = [ { "name": "controller", "baseName": "controller", "type": "string" }, { "name": "parameters", "baseName": "parameters", "type": "V1TypedLocalObjectReference" } ]; //# sourceMappingURL=v1beta1IngressClassSpec.js.map /***/ }), /***/ 24695: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1JSONSchemaProps = void 0; /** * JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). */ class V1beta1JSONSchemaProps { static getAttributeTypeMap() { return V1beta1JSONSchemaProps.attributeTypeMap; } } exports.V1beta1JSONSchemaProps = V1beta1JSONSchemaProps; V1beta1JSONSchemaProps.discriminator = undefined; V1beta1JSONSchemaProps.attributeTypeMap = [ { "name": "$ref", "baseName": "$ref", "type": "string" }, { "name": "$schema", "baseName": "$schema", "type": "string" }, { "name": "additionalItems", "baseName": "additionalItems", "type": "object" }, { "name": "additionalProperties", "baseName": "additionalProperties", "type": "object" }, { "name": "allOf", "baseName": "allOf", "type": "Array" }, { "name": "anyOf", "baseName": "anyOf", "type": "Array" }, { "name": "_default", "baseName": "default", "type": "object" }, { "name": "definitions", "baseName": "definitions", "type": "{ [key: string]: V1beta1JSONSchemaProps; }" }, { "name": "dependencies", "baseName": "dependencies", "type": "{ [key: string]: object; }" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "_enum", "baseName": "enum", "type": "Array" }, { "name": "example", "baseName": "example", "type": "object" }, { "name": "exclusiveMaximum", "baseName": "exclusiveMaximum", "type": "boolean" }, { "name": "exclusiveMinimum", "baseName": "exclusiveMinimum", "type": "boolean" }, { "name": "externalDocs", "baseName": "externalDocs", "type": "V1beta1ExternalDocumentation" }, { "name": "format", "baseName": "format", "type": "string" }, { "name": "id", "baseName": "id", "type": "string" }, { "name": "items", "baseName": "items", "type": "object" }, { "name": "maxItems", "baseName": "maxItems", "type": "number" }, { "name": "maxLength", "baseName": "maxLength", "type": "number" }, { "name": "maxProperties", "baseName": "maxProperties", "type": "number" }, { "name": "maximum", "baseName": "maximum", "type": "number" }, { "name": "minItems", "baseName": "minItems", "type": "number" }, { "name": "minLength", "baseName": "minLength", "type": "number" }, { "name": "minProperties", "baseName": "minProperties", "type": "number" }, { "name": "minimum", "baseName": "minimum", "type": "number" }, { "name": "multipleOf", "baseName": "multipleOf", "type": "number" }, { "name": "not", "baseName": "not", "type": "V1beta1JSONSchemaProps" }, { "name": "nullable", "baseName": "nullable", "type": "boolean" }, { "name": "oneOf", "baseName": "oneOf", "type": "Array" }, { "name": "pattern", "baseName": "pattern", "type": "string" }, { "name": "patternProperties", "baseName": "patternProperties", "type": "{ [key: string]: V1beta1JSONSchemaProps; }" }, { "name": "properties", "baseName": "properties", "type": "{ [key: string]: V1beta1JSONSchemaProps; }" }, { "name": "required", "baseName": "required", "type": "Array" }, { "name": "title", "baseName": "title", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" }, { "name": "uniqueItems", "baseName": "uniqueItems", "type": "boolean" }, { "name": "x_kubernetes_embedded_resource", "baseName": "x-kubernetes-embedded-resource", "type": "boolean" }, { "name": "x_kubernetes_int_or_string", "baseName": "x-kubernetes-int-or-string", "type": "boolean" }, { "name": "x_kubernetes_list_map_keys", "baseName": "x-kubernetes-list-map-keys", "type": "Array" }, { "name": "x_kubernetes_list_type", "baseName": "x-kubernetes-list-type", "type": "string" }, { "name": "x_kubernetes_map_type", "baseName": "x-kubernetes-map-type", "type": "string" }, { "name": "x_kubernetes_preserve_unknown_fields", "baseName": "x-kubernetes-preserve-unknown-fields", "type": "boolean" } ]; //# sourceMappingURL=v1beta1JSONSchemaProps.js.map /***/ }), /***/ 75855: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1JobTemplateSpec = void 0; /** * JobTemplateSpec describes the data a Job should have when created from a template */ class V1beta1JobTemplateSpec { static getAttributeTypeMap() { return V1beta1JobTemplateSpec.attributeTypeMap; } } exports.V1beta1JobTemplateSpec = V1beta1JobTemplateSpec; V1beta1JobTemplateSpec.discriminator = undefined; V1beta1JobTemplateSpec.attributeTypeMap = [ { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1JobSpec" } ]; //# sourceMappingURL=v1beta1JobTemplateSpec.js.map /***/ }), /***/ 56981: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1Lease = void 0; /** * Lease defines a lease concept. */ class V1beta1Lease { static getAttributeTypeMap() { return V1beta1Lease.attributeTypeMap; } } exports.V1beta1Lease = V1beta1Lease; V1beta1Lease.discriminator = undefined; V1beta1Lease.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1LeaseSpec" } ]; //# sourceMappingURL=v1beta1Lease.js.map /***/ }), /***/ 55914: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1LeaseList = void 0; /** * LeaseList is a list of Lease objects. */ class V1beta1LeaseList { static getAttributeTypeMap() { return V1beta1LeaseList.attributeTypeMap; } } exports.V1beta1LeaseList = V1beta1LeaseList; V1beta1LeaseList.discriminator = undefined; V1beta1LeaseList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1LeaseList.js.map /***/ }), /***/ 14010: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1LeaseSpec = void 0; /** * LeaseSpec is a specification of a Lease. */ class V1beta1LeaseSpec { static getAttributeTypeMap() { return V1beta1LeaseSpec.attributeTypeMap; } } exports.V1beta1LeaseSpec = V1beta1LeaseSpec; V1beta1LeaseSpec.discriminator = undefined; V1beta1LeaseSpec.attributeTypeMap = [ { "name": "acquireTime", "baseName": "acquireTime", "type": "Date" }, { "name": "holderIdentity", "baseName": "holderIdentity", "type": "string" }, { "name": "leaseDurationSeconds", "baseName": "leaseDurationSeconds", "type": "number" }, { "name": "leaseTransitions", "baseName": "leaseTransitions", "type": "number" }, { "name": "renewTime", "baseName": "renewTime", "type": "Date" } ]; //# sourceMappingURL=v1beta1LeaseSpec.js.map /***/ }), /***/ 8326: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1LimitResponse = void 0; /** * LimitResponse defines how to handle requests that can not be executed right now. */ class V1beta1LimitResponse { static getAttributeTypeMap() { return V1beta1LimitResponse.attributeTypeMap; } } exports.V1beta1LimitResponse = V1beta1LimitResponse; V1beta1LimitResponse.discriminator = undefined; V1beta1LimitResponse.attributeTypeMap = [ { "name": "queuing", "baseName": "queuing", "type": "V1beta1QueuingConfiguration" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1LimitResponse.js.map /***/ }), /***/ 40541: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1LimitedPriorityLevelConfiguration = void 0; /** * LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues: * How are requests for this priority level limited? * What should be done with requests that exceed the limit? */ class V1beta1LimitedPriorityLevelConfiguration { static getAttributeTypeMap() { return V1beta1LimitedPriorityLevelConfiguration.attributeTypeMap; } } exports.V1beta1LimitedPriorityLevelConfiguration = V1beta1LimitedPriorityLevelConfiguration; V1beta1LimitedPriorityLevelConfiguration.discriminator = undefined; V1beta1LimitedPriorityLevelConfiguration.attributeTypeMap = [ { "name": "assuredConcurrencyShares", "baseName": "assuredConcurrencyShares", "type": "number" }, { "name": "limitResponse", "baseName": "limitResponse", "type": "V1beta1LimitResponse" } ]; //# sourceMappingURL=v1beta1LimitedPriorityLevelConfiguration.js.map /***/ }), /***/ 59918: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1LocalSubjectAccessReview = void 0; /** * LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. */ class V1beta1LocalSubjectAccessReview { static getAttributeTypeMap() { return V1beta1LocalSubjectAccessReview.attributeTypeMap; } } exports.V1beta1LocalSubjectAccessReview = V1beta1LocalSubjectAccessReview; V1beta1LocalSubjectAccessReview.discriminator = undefined; V1beta1LocalSubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1SubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1SubjectAccessReviewStatus" } ]; //# sourceMappingURL=v1beta1LocalSubjectAccessReview.js.map /***/ }), /***/ 74749: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1MutatingWebhook = void 0; /** * MutatingWebhook describes an admission webhook and the resources and operations it applies to. */ class V1beta1MutatingWebhook { static getAttributeTypeMap() { return V1beta1MutatingWebhook.attributeTypeMap; } } exports.V1beta1MutatingWebhook = V1beta1MutatingWebhook; V1beta1MutatingWebhook.discriminator = undefined; V1beta1MutatingWebhook.attributeTypeMap = [ { "name": "admissionReviewVersions", "baseName": "admissionReviewVersions", "type": "Array" }, { "name": "clientConfig", "baseName": "clientConfig", "type": "AdmissionregistrationV1beta1WebhookClientConfig" }, { "name": "failurePolicy", "baseName": "failurePolicy", "type": "string" }, { "name": "matchPolicy", "baseName": "matchPolicy", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespaceSelector", "baseName": "namespaceSelector", "type": "V1LabelSelector" }, { "name": "objectSelector", "baseName": "objectSelector", "type": "V1LabelSelector" }, { "name": "reinvocationPolicy", "baseName": "reinvocationPolicy", "type": "string" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "sideEffects", "baseName": "sideEffects", "type": "string" }, { "name": "timeoutSeconds", "baseName": "timeoutSeconds", "type": "number" } ]; //# sourceMappingURL=v1beta1MutatingWebhook.js.map /***/ }), /***/ 66991: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1MutatingWebhookConfiguration = void 0; /** * MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration instead. */ class V1beta1MutatingWebhookConfiguration { static getAttributeTypeMap() { return V1beta1MutatingWebhookConfiguration.attributeTypeMap; } } exports.V1beta1MutatingWebhookConfiguration = V1beta1MutatingWebhookConfiguration; V1beta1MutatingWebhookConfiguration.discriminator = undefined; V1beta1MutatingWebhookConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "webhooks", "baseName": "webhooks", "type": "Array" } ]; //# sourceMappingURL=v1beta1MutatingWebhookConfiguration.js.map /***/ }), /***/ 4046: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1MutatingWebhookConfigurationList = void 0; /** * MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. */ class V1beta1MutatingWebhookConfigurationList { static getAttributeTypeMap() { return V1beta1MutatingWebhookConfigurationList.attributeTypeMap; } } exports.V1beta1MutatingWebhookConfigurationList = V1beta1MutatingWebhookConfigurationList; V1beta1MutatingWebhookConfigurationList.discriminator = undefined; V1beta1MutatingWebhookConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1MutatingWebhookConfigurationList.js.map /***/ }), /***/ 14255: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1NonResourceAttributes = void 0; /** * NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface */ class V1beta1NonResourceAttributes { static getAttributeTypeMap() { return V1beta1NonResourceAttributes.attributeTypeMap; } } exports.V1beta1NonResourceAttributes = V1beta1NonResourceAttributes; V1beta1NonResourceAttributes.discriminator = undefined; V1beta1NonResourceAttributes.attributeTypeMap = [ { "name": "path", "baseName": "path", "type": "string" }, { "name": "verb", "baseName": "verb", "type": "string" } ]; //# sourceMappingURL=v1beta1NonResourceAttributes.js.map /***/ }), /***/ 81655: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1NonResourcePolicyRule = void 0; /** * NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request. */ class V1beta1NonResourcePolicyRule { static getAttributeTypeMap() { return V1beta1NonResourcePolicyRule.attributeTypeMap; } } exports.V1beta1NonResourcePolicyRule = V1beta1NonResourcePolicyRule; V1beta1NonResourcePolicyRule.discriminator = undefined; V1beta1NonResourcePolicyRule.attributeTypeMap = [ { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1beta1NonResourcePolicyRule.js.map /***/ }), /***/ 83111: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1NonResourceRule = void 0; /** * NonResourceRule holds information that describes a rule for the non-resource */ class V1beta1NonResourceRule { static getAttributeTypeMap() { return V1beta1NonResourceRule.attributeTypeMap; } } exports.V1beta1NonResourceRule = V1beta1NonResourceRule; V1beta1NonResourceRule.discriminator = undefined; V1beta1NonResourceRule.attributeTypeMap = [ { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1beta1NonResourceRule.js.map /***/ }), /***/ 34396: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1Overhead = void 0; /** * Overhead structure represents the resource overhead associated with running a pod. */ class V1beta1Overhead { static getAttributeTypeMap() { return V1beta1Overhead.attributeTypeMap; } } exports.V1beta1Overhead = V1beta1Overhead; V1beta1Overhead.discriminator = undefined; V1beta1Overhead.attributeTypeMap = [ { "name": "podFixed", "baseName": "podFixed", "type": "{ [key: string]: string; }" } ]; //# sourceMappingURL=v1beta1Overhead.js.map /***/ }), /***/ 43485: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PodDisruptionBudget = void 0; /** * PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods */ class V1beta1PodDisruptionBudget { static getAttributeTypeMap() { return V1beta1PodDisruptionBudget.attributeTypeMap; } } exports.V1beta1PodDisruptionBudget = V1beta1PodDisruptionBudget; V1beta1PodDisruptionBudget.discriminator = undefined; V1beta1PodDisruptionBudget.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1PodDisruptionBudgetSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1PodDisruptionBudgetStatus" } ]; //# sourceMappingURL=v1beta1PodDisruptionBudget.js.map /***/ }), /***/ 63931: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PodDisruptionBudgetList = void 0; /** * PodDisruptionBudgetList is a collection of PodDisruptionBudgets. */ class V1beta1PodDisruptionBudgetList { static getAttributeTypeMap() { return V1beta1PodDisruptionBudgetList.attributeTypeMap; } } exports.V1beta1PodDisruptionBudgetList = V1beta1PodDisruptionBudgetList; V1beta1PodDisruptionBudgetList.discriminator = undefined; V1beta1PodDisruptionBudgetList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1PodDisruptionBudgetList.js.map /***/ }), /***/ 23257: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PodDisruptionBudgetSpec = void 0; /** * PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. */ class V1beta1PodDisruptionBudgetSpec { static getAttributeTypeMap() { return V1beta1PodDisruptionBudgetSpec.attributeTypeMap; } } exports.V1beta1PodDisruptionBudgetSpec = V1beta1PodDisruptionBudgetSpec; V1beta1PodDisruptionBudgetSpec.discriminator = undefined; V1beta1PodDisruptionBudgetSpec.attributeTypeMap = [ { "name": "maxUnavailable", "baseName": "maxUnavailable", "type": "object" }, { "name": "minAvailable", "baseName": "minAvailable", "type": "object" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" } ]; //# sourceMappingURL=v1beta1PodDisruptionBudgetSpec.js.map /***/ }), /***/ 84404: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PodDisruptionBudgetStatus = void 0; /** * PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system. */ class V1beta1PodDisruptionBudgetStatus { static getAttributeTypeMap() { return V1beta1PodDisruptionBudgetStatus.attributeTypeMap; } } exports.V1beta1PodDisruptionBudgetStatus = V1beta1PodDisruptionBudgetStatus; V1beta1PodDisruptionBudgetStatus.discriminator = undefined; V1beta1PodDisruptionBudgetStatus.attributeTypeMap = [ { "name": "currentHealthy", "baseName": "currentHealthy", "type": "number" }, { "name": "desiredHealthy", "baseName": "desiredHealthy", "type": "number" }, { "name": "disruptedPods", "baseName": "disruptedPods", "type": "{ [key: string]: Date; }" }, { "name": "disruptionsAllowed", "baseName": "disruptionsAllowed", "type": "number" }, { "name": "expectedPods", "baseName": "expectedPods", "type": "number" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" } ]; //# sourceMappingURL=v1beta1PodDisruptionBudgetStatus.js.map /***/ }), /***/ 44289: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PodSecurityPolicy = void 0; /** * PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. */ class V1beta1PodSecurityPolicy { static getAttributeTypeMap() { return V1beta1PodSecurityPolicy.attributeTypeMap; } } exports.V1beta1PodSecurityPolicy = V1beta1PodSecurityPolicy; V1beta1PodSecurityPolicy.discriminator = undefined; V1beta1PodSecurityPolicy.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1PodSecurityPolicySpec" } ]; //# sourceMappingURL=v1beta1PodSecurityPolicy.js.map /***/ }), /***/ 90147: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PodSecurityPolicyList = void 0; /** * PodSecurityPolicyList is a list of PodSecurityPolicy objects. */ class V1beta1PodSecurityPolicyList { static getAttributeTypeMap() { return V1beta1PodSecurityPolicyList.attributeTypeMap; } } exports.V1beta1PodSecurityPolicyList = V1beta1PodSecurityPolicyList; V1beta1PodSecurityPolicyList.discriminator = undefined; V1beta1PodSecurityPolicyList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1PodSecurityPolicyList.js.map /***/ }), /***/ 72683: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PodSecurityPolicySpec = void 0; /** * PodSecurityPolicySpec defines the policy enforced. */ class V1beta1PodSecurityPolicySpec { static getAttributeTypeMap() { return V1beta1PodSecurityPolicySpec.attributeTypeMap; } } exports.V1beta1PodSecurityPolicySpec = V1beta1PodSecurityPolicySpec; V1beta1PodSecurityPolicySpec.discriminator = undefined; V1beta1PodSecurityPolicySpec.attributeTypeMap = [ { "name": "allowPrivilegeEscalation", "baseName": "allowPrivilegeEscalation", "type": "boolean" }, { "name": "allowedCSIDrivers", "baseName": "allowedCSIDrivers", "type": "Array" }, { "name": "allowedCapabilities", "baseName": "allowedCapabilities", "type": "Array" }, { "name": "allowedFlexVolumes", "baseName": "allowedFlexVolumes", "type": "Array" }, { "name": "allowedHostPaths", "baseName": "allowedHostPaths", "type": "Array" }, { "name": "allowedProcMountTypes", "baseName": "allowedProcMountTypes", "type": "Array" }, { "name": "allowedUnsafeSysctls", "baseName": "allowedUnsafeSysctls", "type": "Array" }, { "name": "defaultAddCapabilities", "baseName": "defaultAddCapabilities", "type": "Array" }, { "name": "defaultAllowPrivilegeEscalation", "baseName": "defaultAllowPrivilegeEscalation", "type": "boolean" }, { "name": "forbiddenSysctls", "baseName": "forbiddenSysctls", "type": "Array" }, { "name": "fsGroup", "baseName": "fsGroup", "type": "V1beta1FSGroupStrategyOptions" }, { "name": "hostIPC", "baseName": "hostIPC", "type": "boolean" }, { "name": "hostNetwork", "baseName": "hostNetwork", "type": "boolean" }, { "name": "hostPID", "baseName": "hostPID", "type": "boolean" }, { "name": "hostPorts", "baseName": "hostPorts", "type": "Array" }, { "name": "privileged", "baseName": "privileged", "type": "boolean" }, { "name": "readOnlyRootFilesystem", "baseName": "readOnlyRootFilesystem", "type": "boolean" }, { "name": "requiredDropCapabilities", "baseName": "requiredDropCapabilities", "type": "Array" }, { "name": "runAsGroup", "baseName": "runAsGroup", "type": "V1beta1RunAsGroupStrategyOptions" }, { "name": "runAsUser", "baseName": "runAsUser", "type": "V1beta1RunAsUserStrategyOptions" }, { "name": "runtimeClass", "baseName": "runtimeClass", "type": "V1beta1RuntimeClassStrategyOptions" }, { "name": "seLinux", "baseName": "seLinux", "type": "V1beta1SELinuxStrategyOptions" }, { "name": "supplementalGroups", "baseName": "supplementalGroups", "type": "V1beta1SupplementalGroupsStrategyOptions" }, { "name": "volumes", "baseName": "volumes", "type": "Array" } ]; //# sourceMappingURL=v1beta1PodSecurityPolicySpec.js.map /***/ }), /***/ 2177: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PolicyRule = void 0; /** * PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. */ class V1beta1PolicyRule { static getAttributeTypeMap() { return V1beta1PolicyRule.attributeTypeMap; } } exports.V1beta1PolicyRule = V1beta1PolicyRule; V1beta1PolicyRule.discriminator = undefined; V1beta1PolicyRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "nonResourceURLs", "baseName": "nonResourceURLs", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1beta1PolicyRule.js.map /***/ }), /***/ 75714: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PolicyRulesWithSubjects = void 0; /** * PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request. */ class V1beta1PolicyRulesWithSubjects { static getAttributeTypeMap() { return V1beta1PolicyRulesWithSubjects.attributeTypeMap; } } exports.V1beta1PolicyRulesWithSubjects = V1beta1PolicyRulesWithSubjects; V1beta1PolicyRulesWithSubjects.discriminator = undefined; V1beta1PolicyRulesWithSubjects.attributeTypeMap = [ { "name": "nonResourceRules", "baseName": "nonResourceRules", "type": "Array" }, { "name": "resourceRules", "baseName": "resourceRules", "type": "Array" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; //# sourceMappingURL=v1beta1PolicyRulesWithSubjects.js.map /***/ }), /***/ 59684: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PriorityClass = void 0; /** * DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. */ class V1beta1PriorityClass { static getAttributeTypeMap() { return V1beta1PriorityClass.attributeTypeMap; } } exports.V1beta1PriorityClass = V1beta1PriorityClass; V1beta1PriorityClass.discriminator = undefined; V1beta1PriorityClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "description", "baseName": "description", "type": "string" }, { "name": "globalDefault", "baseName": "globalDefault", "type": "boolean" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "preemptionPolicy", "baseName": "preemptionPolicy", "type": "string" }, { "name": "value", "baseName": "value", "type": "number" } ]; //# sourceMappingURL=v1beta1PriorityClass.js.map /***/ }), /***/ 26149: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PriorityClassList = void 0; /** * PriorityClassList is a collection of priority classes. */ class V1beta1PriorityClassList { static getAttributeTypeMap() { return V1beta1PriorityClassList.attributeTypeMap; } } exports.V1beta1PriorityClassList = V1beta1PriorityClassList; V1beta1PriorityClassList.discriminator = undefined; V1beta1PriorityClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1PriorityClassList.js.map /***/ }), /***/ 67813: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PriorityLevelConfiguration = void 0; /** * PriorityLevelConfiguration represents the configuration of a priority level. */ class V1beta1PriorityLevelConfiguration { static getAttributeTypeMap() { return V1beta1PriorityLevelConfiguration.attributeTypeMap; } } exports.V1beta1PriorityLevelConfiguration = V1beta1PriorityLevelConfiguration; V1beta1PriorityLevelConfiguration.discriminator = undefined; V1beta1PriorityLevelConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1PriorityLevelConfigurationSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1PriorityLevelConfigurationStatus" } ]; //# sourceMappingURL=v1beta1PriorityLevelConfiguration.js.map /***/ }), /***/ 60270: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PriorityLevelConfigurationCondition = void 0; /** * PriorityLevelConfigurationCondition defines the condition of priority level. */ class V1beta1PriorityLevelConfigurationCondition { static getAttributeTypeMap() { return V1beta1PriorityLevelConfigurationCondition.attributeTypeMap; } } exports.V1beta1PriorityLevelConfigurationCondition = V1beta1PriorityLevelConfigurationCondition; V1beta1PriorityLevelConfigurationCondition.discriminator = undefined; V1beta1PriorityLevelConfigurationCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1PriorityLevelConfigurationCondition.js.map /***/ }), /***/ 90435: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PriorityLevelConfigurationList = void 0; /** * PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. */ class V1beta1PriorityLevelConfigurationList { static getAttributeTypeMap() { return V1beta1PriorityLevelConfigurationList.attributeTypeMap; } } exports.V1beta1PriorityLevelConfigurationList = V1beta1PriorityLevelConfigurationList; V1beta1PriorityLevelConfigurationList.discriminator = undefined; V1beta1PriorityLevelConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1PriorityLevelConfigurationList.js.map /***/ }), /***/ 42319: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PriorityLevelConfigurationReference = void 0; /** * PriorityLevelConfigurationReference contains information that points to the \"request-priority\" being used. */ class V1beta1PriorityLevelConfigurationReference { static getAttributeTypeMap() { return V1beta1PriorityLevelConfigurationReference.attributeTypeMap; } } exports.V1beta1PriorityLevelConfigurationReference = V1beta1PriorityLevelConfigurationReference; V1beta1PriorityLevelConfigurationReference.discriminator = undefined; V1beta1PriorityLevelConfigurationReference.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1beta1PriorityLevelConfigurationReference.js.map /***/ }), /***/ 10530: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PriorityLevelConfigurationSpec = void 0; /** * PriorityLevelConfigurationSpec specifies the configuration of a priority level. */ class V1beta1PriorityLevelConfigurationSpec { static getAttributeTypeMap() { return V1beta1PriorityLevelConfigurationSpec.attributeTypeMap; } } exports.V1beta1PriorityLevelConfigurationSpec = V1beta1PriorityLevelConfigurationSpec; V1beta1PriorityLevelConfigurationSpec.discriminator = undefined; V1beta1PriorityLevelConfigurationSpec.attributeTypeMap = [ { "name": "limited", "baseName": "limited", "type": "V1beta1LimitedPriorityLevelConfiguration" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v1beta1PriorityLevelConfigurationSpec.js.map /***/ }), /***/ 22546: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1PriorityLevelConfigurationStatus = void 0; /** * PriorityLevelConfigurationStatus represents the current state of a \"request-priority\". */ class V1beta1PriorityLevelConfigurationStatus { static getAttributeTypeMap() { return V1beta1PriorityLevelConfigurationStatus.attributeTypeMap; } } exports.V1beta1PriorityLevelConfigurationStatus = V1beta1PriorityLevelConfigurationStatus; V1beta1PriorityLevelConfigurationStatus.discriminator = undefined; V1beta1PriorityLevelConfigurationStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" } ]; //# sourceMappingURL=v1beta1PriorityLevelConfigurationStatus.js.map /***/ }), /***/ 62252: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1QueuingConfiguration = void 0; /** * QueuingConfiguration holds the configuration parameters for queuing */ class V1beta1QueuingConfiguration { static getAttributeTypeMap() { return V1beta1QueuingConfiguration.attributeTypeMap; } } exports.V1beta1QueuingConfiguration = V1beta1QueuingConfiguration; V1beta1QueuingConfiguration.discriminator = undefined; V1beta1QueuingConfiguration.attributeTypeMap = [ { "name": "handSize", "baseName": "handSize", "type": "number" }, { "name": "queueLengthLimit", "baseName": "queueLengthLimit", "type": "number" }, { "name": "queues", "baseName": "queues", "type": "number" } ]; //# sourceMappingURL=v1beta1QueuingConfiguration.js.map /***/ }), /***/ 76021: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ResourceAttributes = void 0; /** * ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface */ class V1beta1ResourceAttributes { static getAttributeTypeMap() { return V1beta1ResourceAttributes.attributeTypeMap; } } exports.V1beta1ResourceAttributes = V1beta1ResourceAttributes; V1beta1ResourceAttributes.discriminator = undefined; V1beta1ResourceAttributes.attributeTypeMap = [ { "name": "group", "baseName": "group", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" }, { "name": "resource", "baseName": "resource", "type": "string" }, { "name": "subresource", "baseName": "subresource", "type": "string" }, { "name": "verb", "baseName": "verb", "type": "string" }, { "name": "version", "baseName": "version", "type": "string" } ]; //# sourceMappingURL=v1beta1ResourceAttributes.js.map /***/ }), /***/ 5461: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ResourcePolicyRule = void 0; /** * ResourcePolicyRule is a predicate that matches some resource requests, testing the request\'s verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) least one member of namespaces matches the request. */ class V1beta1ResourcePolicyRule { static getAttributeTypeMap() { return V1beta1ResourcePolicyRule.attributeTypeMap; } } exports.V1beta1ResourcePolicyRule = V1beta1ResourcePolicyRule; V1beta1ResourcePolicyRule.discriminator = undefined; V1beta1ResourcePolicyRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "clusterScope", "baseName": "clusterScope", "type": "boolean" }, { "name": "namespaces", "baseName": "namespaces", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1beta1ResourcePolicyRule.js.map /***/ }), /***/ 28787: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ResourceRule = void 0; /** * ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn\'t significant, may contain duplicates, and possibly be incomplete. */ class V1beta1ResourceRule { static getAttributeTypeMap() { return V1beta1ResourceRule.attributeTypeMap; } } exports.V1beta1ResourceRule = V1beta1ResourceRule; V1beta1ResourceRule.discriminator = undefined; V1beta1ResourceRule.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "resourceNames", "baseName": "resourceNames", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "verbs", "baseName": "verbs", "type": "Array" } ]; //# sourceMappingURL=v1beta1ResourceRule.js.map /***/ }), /***/ 51959: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1Role = void 0; /** * Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22. */ class V1beta1Role { static getAttributeTypeMap() { return V1beta1Role.attributeTypeMap; } } exports.V1beta1Role = V1beta1Role; V1beta1Role.discriminator = undefined; V1beta1Role.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "rules", "baseName": "rules", "type": "Array" } ]; //# sourceMappingURL=v1beta1Role.js.map /***/ }), /***/ 71667: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RoleBinding = void 0; /** * RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22. */ class V1beta1RoleBinding { static getAttributeTypeMap() { return V1beta1RoleBinding.attributeTypeMap; } } exports.V1beta1RoleBinding = V1beta1RoleBinding; V1beta1RoleBinding.discriminator = undefined; V1beta1RoleBinding.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "roleRef", "baseName": "roleRef", "type": "V1beta1RoleRef" }, { "name": "subjects", "baseName": "subjects", "type": "Array" } ]; //# sourceMappingURL=v1beta1RoleBinding.js.map /***/ }), /***/ 24775: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RoleBindingList = void 0; /** * RoleBindingList is a collection of RoleBindings Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22. */ class V1beta1RoleBindingList { static getAttributeTypeMap() { return V1beta1RoleBindingList.attributeTypeMap; } } exports.V1beta1RoleBindingList = V1beta1RoleBindingList; V1beta1RoleBindingList.discriminator = undefined; V1beta1RoleBindingList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1RoleBindingList.js.map /***/ }), /***/ 2230: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RoleList = void 0; /** * RoleList is a collection of Roles Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.22. */ class V1beta1RoleList { static getAttributeTypeMap() { return V1beta1RoleList.attributeTypeMap; } } exports.V1beta1RoleList = V1beta1RoleList; V1beta1RoleList.discriminator = undefined; V1beta1RoleList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1RoleList.js.map /***/ }), /***/ 74299: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RoleRef = void 0; /** * RoleRef contains information that points to the role being used */ class V1beta1RoleRef { static getAttributeTypeMap() { return V1beta1RoleRef.attributeTypeMap; } } exports.V1beta1RoleRef = V1beta1RoleRef; V1beta1RoleRef.discriminator = undefined; V1beta1RoleRef.attributeTypeMap = [ { "name": "apiGroup", "baseName": "apiGroup", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1beta1RoleRef.js.map /***/ }), /***/ 87497: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RuleWithOperations = void 0; /** * RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid. */ class V1beta1RuleWithOperations { static getAttributeTypeMap() { return V1beta1RuleWithOperations.attributeTypeMap; } } exports.V1beta1RuleWithOperations = V1beta1RuleWithOperations; V1beta1RuleWithOperations.discriminator = undefined; V1beta1RuleWithOperations.attributeTypeMap = [ { "name": "apiGroups", "baseName": "apiGroups", "type": "Array" }, { "name": "apiVersions", "baseName": "apiVersions", "type": "Array" }, { "name": "operations", "baseName": "operations", "type": "Array" }, { "name": "resources", "baseName": "resources", "type": "Array" }, { "name": "scope", "baseName": "scope", "type": "string" } ]; //# sourceMappingURL=v1beta1RuleWithOperations.js.map /***/ }), /***/ 65831: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RunAsGroupStrategyOptions = void 0; /** * RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy. */ class V1beta1RunAsGroupStrategyOptions { static getAttributeTypeMap() { return V1beta1RunAsGroupStrategyOptions.attributeTypeMap; } } exports.V1beta1RunAsGroupStrategyOptions = V1beta1RunAsGroupStrategyOptions; V1beta1RunAsGroupStrategyOptions.discriminator = undefined; V1beta1RunAsGroupStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; //# sourceMappingURL=v1beta1RunAsGroupStrategyOptions.js.map /***/ }), /***/ 31079: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RunAsUserStrategyOptions = void 0; /** * RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy. */ class V1beta1RunAsUserStrategyOptions { static getAttributeTypeMap() { return V1beta1RunAsUserStrategyOptions.attributeTypeMap; } } exports.V1beta1RunAsUserStrategyOptions = V1beta1RunAsUserStrategyOptions; V1beta1RunAsUserStrategyOptions.discriminator = undefined; V1beta1RunAsUserStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; //# sourceMappingURL=v1beta1RunAsUserStrategyOptions.js.map /***/ }), /***/ 75281: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RuntimeClass = void 0; /** * RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md */ class V1beta1RuntimeClass { static getAttributeTypeMap() { return V1beta1RuntimeClass.attributeTypeMap; } } exports.V1beta1RuntimeClass = V1beta1RuntimeClass; V1beta1RuntimeClass.discriminator = undefined; V1beta1RuntimeClass.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "handler", "baseName": "handler", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "overhead", "baseName": "overhead", "type": "V1beta1Overhead" }, { "name": "scheduling", "baseName": "scheduling", "type": "V1beta1Scheduling" } ]; //# sourceMappingURL=v1beta1RuntimeClass.js.map /***/ }), /***/ 8109: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RuntimeClassList = void 0; /** * RuntimeClassList is a list of RuntimeClass objects. */ class V1beta1RuntimeClassList { static getAttributeTypeMap() { return V1beta1RuntimeClassList.attributeTypeMap; } } exports.V1beta1RuntimeClassList = V1beta1RuntimeClassList; V1beta1RuntimeClassList.discriminator = undefined; V1beta1RuntimeClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1RuntimeClassList.js.map /***/ }), /***/ 50769: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1RuntimeClassStrategyOptions = void 0; /** * RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses for a pod. */ class V1beta1RuntimeClassStrategyOptions { static getAttributeTypeMap() { return V1beta1RuntimeClassStrategyOptions.attributeTypeMap; } } exports.V1beta1RuntimeClassStrategyOptions = V1beta1RuntimeClassStrategyOptions; V1beta1RuntimeClassStrategyOptions.discriminator = undefined; V1beta1RuntimeClassStrategyOptions.attributeTypeMap = [ { "name": "allowedRuntimeClassNames", "baseName": "allowedRuntimeClassNames", "type": "Array" }, { "name": "defaultRuntimeClassName", "baseName": "defaultRuntimeClassName", "type": "string" } ]; //# sourceMappingURL=v1beta1RuntimeClassStrategyOptions.js.map /***/ }), /***/ 49098: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SELinuxStrategyOptions = void 0; /** * SELinuxStrategyOptions defines the strategy type and any options used to create the strategy. */ class V1beta1SELinuxStrategyOptions { static getAttributeTypeMap() { return V1beta1SELinuxStrategyOptions.attributeTypeMap; } } exports.V1beta1SELinuxStrategyOptions = V1beta1SELinuxStrategyOptions; V1beta1SELinuxStrategyOptions.discriminator = undefined; V1beta1SELinuxStrategyOptions.attributeTypeMap = [ { "name": "rule", "baseName": "rule", "type": "string" }, { "name": "seLinuxOptions", "baseName": "seLinuxOptions", "type": "V1SELinuxOptions" } ]; //# sourceMappingURL=v1beta1SELinuxStrategyOptions.js.map /***/ }), /***/ 34651: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1Scheduling = void 0; /** * Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass. */ class V1beta1Scheduling { static getAttributeTypeMap() { return V1beta1Scheduling.attributeTypeMap; } } exports.V1beta1Scheduling = V1beta1Scheduling; V1beta1Scheduling.discriminator = undefined; V1beta1Scheduling.attributeTypeMap = [ { "name": "nodeSelector", "baseName": "nodeSelector", "type": "{ [key: string]: string; }" }, { "name": "tolerations", "baseName": "tolerations", "type": "Array" } ]; //# sourceMappingURL=v1beta1Scheduling.js.map /***/ }), /***/ 35033: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SelfSubjectAccessReview = void 0; /** * SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \"in all namespaces\". Self is a special case, because users should always be able to check whether they can perform an action */ class V1beta1SelfSubjectAccessReview { static getAttributeTypeMap() { return V1beta1SelfSubjectAccessReview.attributeTypeMap; } } exports.V1beta1SelfSubjectAccessReview = V1beta1SelfSubjectAccessReview; V1beta1SelfSubjectAccessReview.discriminator = undefined; V1beta1SelfSubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1SelfSubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1SubjectAccessReviewStatus" } ]; //# sourceMappingURL=v1beta1SelfSubjectAccessReview.js.map /***/ }), /***/ 90080: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SelfSubjectAccessReviewSpec = void 0; /** * SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set */ class V1beta1SelfSubjectAccessReviewSpec { static getAttributeTypeMap() { return V1beta1SelfSubjectAccessReviewSpec.attributeTypeMap; } } exports.V1beta1SelfSubjectAccessReviewSpec = V1beta1SelfSubjectAccessReviewSpec; V1beta1SelfSubjectAccessReviewSpec.discriminator = undefined; V1beta1SelfSubjectAccessReviewSpec.attributeTypeMap = [ { "name": "nonResourceAttributes", "baseName": "nonResourceAttributes", "type": "V1beta1NonResourceAttributes" }, { "name": "resourceAttributes", "baseName": "resourceAttributes", "type": "V1beta1ResourceAttributes" } ]; //# sourceMappingURL=v1beta1SelfSubjectAccessReviewSpec.js.map /***/ }), /***/ 13129: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SelfSubjectRulesReview = void 0; /** * SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server\'s authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. */ class V1beta1SelfSubjectRulesReview { static getAttributeTypeMap() { return V1beta1SelfSubjectRulesReview.attributeTypeMap; } } exports.V1beta1SelfSubjectRulesReview = V1beta1SelfSubjectRulesReview; V1beta1SelfSubjectRulesReview.discriminator = undefined; V1beta1SelfSubjectRulesReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1SelfSubjectRulesReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1SubjectRulesReviewStatus" } ]; //# sourceMappingURL=v1beta1SelfSubjectRulesReview.js.map /***/ }), /***/ 14474: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SelfSubjectRulesReviewSpec = void 0; class V1beta1SelfSubjectRulesReviewSpec { static getAttributeTypeMap() { return V1beta1SelfSubjectRulesReviewSpec.attributeTypeMap; } } exports.V1beta1SelfSubjectRulesReviewSpec = V1beta1SelfSubjectRulesReviewSpec; V1beta1SelfSubjectRulesReviewSpec.discriminator = undefined; V1beta1SelfSubjectRulesReviewSpec.attributeTypeMap = [ { "name": "namespace", "baseName": "namespace", "type": "string" } ]; //# sourceMappingURL=v1beta1SelfSubjectRulesReviewSpec.js.map /***/ }), /***/ 473: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ServiceAccountSubject = void 0; /** * ServiceAccountSubject holds detailed information for service-account-kind subject. */ class V1beta1ServiceAccountSubject { static getAttributeTypeMap() { return V1beta1ServiceAccountSubject.attributeTypeMap; } } exports.V1beta1ServiceAccountSubject = V1beta1ServiceAccountSubject; V1beta1ServiceAccountSubject.discriminator = undefined; V1beta1ServiceAccountSubject.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespace", "baseName": "namespace", "type": "string" } ]; //# sourceMappingURL=v1beta1ServiceAccountSubject.js.map /***/ }), /***/ 88465: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1StorageClass = void 0; /** * StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned. StorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. */ class V1beta1StorageClass { static getAttributeTypeMap() { return V1beta1StorageClass.attributeTypeMap; } } exports.V1beta1StorageClass = V1beta1StorageClass; V1beta1StorageClass.discriminator = undefined; V1beta1StorageClass.attributeTypeMap = [ { "name": "allowVolumeExpansion", "baseName": "allowVolumeExpansion", "type": "boolean" }, { "name": "allowedTopologies", "baseName": "allowedTopologies", "type": "Array" }, { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "mountOptions", "baseName": "mountOptions", "type": "Array" }, { "name": "parameters", "baseName": "parameters", "type": "{ [key: string]: string; }" }, { "name": "provisioner", "baseName": "provisioner", "type": "string" }, { "name": "reclaimPolicy", "baseName": "reclaimPolicy", "type": "string" }, { "name": "volumeBindingMode", "baseName": "volumeBindingMode", "type": "string" } ]; //# sourceMappingURL=v1beta1StorageClass.js.map /***/ }), /***/ 2146: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1StorageClassList = void 0; /** * StorageClassList is a collection of storage classes. */ class V1beta1StorageClassList { static getAttributeTypeMap() { return V1beta1StorageClassList.attributeTypeMap; } } exports.V1beta1StorageClassList = V1beta1StorageClassList; V1beta1StorageClassList.discriminator = undefined; V1beta1StorageClassList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1StorageClassList.js.map /***/ }), /***/ 88931: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SubjectAccessReview = void 0; /** * SubjectAccessReview checks whether or not a user or group can perform an action. */ class V1beta1SubjectAccessReview { static getAttributeTypeMap() { return V1beta1SubjectAccessReview.attributeTypeMap; } } exports.V1beta1SubjectAccessReview = V1beta1SubjectAccessReview; V1beta1SubjectAccessReview.discriminator = undefined; V1beta1SubjectAccessReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1SubjectAccessReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1SubjectAccessReviewStatus" } ]; //# sourceMappingURL=v1beta1SubjectAccessReview.js.map /***/ }), /***/ 46198: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SubjectAccessReviewSpec = void 0; /** * SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set */ class V1beta1SubjectAccessReviewSpec { static getAttributeTypeMap() { return V1beta1SubjectAccessReviewSpec.attributeTypeMap; } } exports.V1beta1SubjectAccessReviewSpec = V1beta1SubjectAccessReviewSpec; V1beta1SubjectAccessReviewSpec.discriminator = undefined; V1beta1SubjectAccessReviewSpec.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "group", "baseName": "group", "type": "Array" }, { "name": "nonResourceAttributes", "baseName": "nonResourceAttributes", "type": "V1beta1NonResourceAttributes" }, { "name": "resourceAttributes", "baseName": "resourceAttributes", "type": "V1beta1ResourceAttributes" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "user", "baseName": "user", "type": "string" } ]; //# sourceMappingURL=v1beta1SubjectAccessReviewSpec.js.map /***/ }), /***/ 95797: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SubjectAccessReviewStatus = void 0; /** * SubjectAccessReviewStatus */ class V1beta1SubjectAccessReviewStatus { static getAttributeTypeMap() { return V1beta1SubjectAccessReviewStatus.attributeTypeMap; } } exports.V1beta1SubjectAccessReviewStatus = V1beta1SubjectAccessReviewStatus; V1beta1SubjectAccessReviewStatus.discriminator = undefined; V1beta1SubjectAccessReviewStatus.attributeTypeMap = [ { "name": "allowed", "baseName": "allowed", "type": "boolean" }, { "name": "denied", "baseName": "denied", "type": "boolean" }, { "name": "evaluationError", "baseName": "evaluationError", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" } ]; //# sourceMappingURL=v1beta1SubjectAccessReviewStatus.js.map /***/ }), /***/ 31397: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SubjectRulesReviewStatus = void 0; /** * SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on the set of authorizers the server is configured with and any errors experienced during evaluation. Because authorization rules are additive, if a rule appears in a list it\'s safe to assume the subject has that permission, even if that list is incomplete. */ class V1beta1SubjectRulesReviewStatus { static getAttributeTypeMap() { return V1beta1SubjectRulesReviewStatus.attributeTypeMap; } } exports.V1beta1SubjectRulesReviewStatus = V1beta1SubjectRulesReviewStatus; V1beta1SubjectRulesReviewStatus.discriminator = undefined; V1beta1SubjectRulesReviewStatus.attributeTypeMap = [ { "name": "evaluationError", "baseName": "evaluationError", "type": "string" }, { "name": "incomplete", "baseName": "incomplete", "type": "boolean" }, { "name": "nonResourceRules", "baseName": "nonResourceRules", "type": "Array" }, { "name": "resourceRules", "baseName": "resourceRules", "type": "Array" } ]; //# sourceMappingURL=v1beta1SubjectRulesReviewStatus.js.map /***/ }), /***/ 12802: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1SupplementalGroupsStrategyOptions = void 0; /** * SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy. */ class V1beta1SupplementalGroupsStrategyOptions { static getAttributeTypeMap() { return V1beta1SupplementalGroupsStrategyOptions.attributeTypeMap; } } exports.V1beta1SupplementalGroupsStrategyOptions = V1beta1SupplementalGroupsStrategyOptions; V1beta1SupplementalGroupsStrategyOptions.discriminator = undefined; V1beta1SupplementalGroupsStrategyOptions.attributeTypeMap = [ { "name": "ranges", "baseName": "ranges", "type": "Array" }, { "name": "rule", "baseName": "rule", "type": "string" } ]; //# sourceMappingURL=v1beta1SupplementalGroupsStrategyOptions.js.map /***/ }), /***/ 61521: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1TokenRequest = void 0; /** * TokenRequest contains parameters of a service account token. */ class V1beta1TokenRequest { static getAttributeTypeMap() { return V1beta1TokenRequest.attributeTypeMap; } } exports.V1beta1TokenRequest = V1beta1TokenRequest; V1beta1TokenRequest.discriminator = undefined; V1beta1TokenRequest.attributeTypeMap = [ { "name": "audience", "baseName": "audience", "type": "string" }, { "name": "expirationSeconds", "baseName": "expirationSeconds", "type": "number" } ]; //# sourceMappingURL=v1beta1TokenRequest.js.map /***/ }), /***/ 15956: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1TokenReview = void 0; /** * TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver. */ class V1beta1TokenReview { static getAttributeTypeMap() { return V1beta1TokenReview.attributeTypeMap; } } exports.V1beta1TokenReview = V1beta1TokenReview; V1beta1TokenReview.discriminator = undefined; V1beta1TokenReview.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1TokenReviewSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1TokenReviewStatus" } ]; //# sourceMappingURL=v1beta1TokenReview.js.map /***/ }), /***/ 54910: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1TokenReviewSpec = void 0; /** * TokenReviewSpec is a description of the token authentication request. */ class V1beta1TokenReviewSpec { static getAttributeTypeMap() { return V1beta1TokenReviewSpec.attributeTypeMap; } } exports.V1beta1TokenReviewSpec = V1beta1TokenReviewSpec; V1beta1TokenReviewSpec.discriminator = undefined; V1beta1TokenReviewSpec.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "token", "baseName": "token", "type": "string" } ]; //# sourceMappingURL=v1beta1TokenReviewSpec.js.map /***/ }), /***/ 10285: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1TokenReviewStatus = void 0; /** * TokenReviewStatus is the result of the token authentication request. */ class V1beta1TokenReviewStatus { static getAttributeTypeMap() { return V1beta1TokenReviewStatus.attributeTypeMap; } } exports.V1beta1TokenReviewStatus = V1beta1TokenReviewStatus; V1beta1TokenReviewStatus.discriminator = undefined; V1beta1TokenReviewStatus.attributeTypeMap = [ { "name": "audiences", "baseName": "audiences", "type": "Array" }, { "name": "authenticated", "baseName": "authenticated", "type": "boolean" }, { "name": "error", "baseName": "error", "type": "string" }, { "name": "user", "baseName": "user", "type": "V1beta1UserInfo" } ]; //# sourceMappingURL=v1beta1TokenReviewStatus.js.map /***/ }), /***/ 53523: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1UserInfo = void 0; /** * UserInfo holds the information about the user needed to implement the user.Info interface. */ class V1beta1UserInfo { static getAttributeTypeMap() { return V1beta1UserInfo.attributeTypeMap; } } exports.V1beta1UserInfo = V1beta1UserInfo; V1beta1UserInfo.discriminator = undefined; V1beta1UserInfo.attributeTypeMap = [ { "name": "extra", "baseName": "extra", "type": "{ [key: string]: Array; }" }, { "name": "groups", "baseName": "groups", "type": "Array" }, { "name": "uid", "baseName": "uid", "type": "string" }, { "name": "username", "baseName": "username", "type": "string" } ]; //# sourceMappingURL=v1beta1UserInfo.js.map /***/ }), /***/ 11202: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1UserSubject = void 0; /** * UserSubject holds detailed information for user-kind subject. */ class V1beta1UserSubject { static getAttributeTypeMap() { return V1beta1UserSubject.attributeTypeMap; } } exports.V1beta1UserSubject = V1beta1UserSubject; V1beta1UserSubject.discriminator = undefined; V1beta1UserSubject.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v1beta1UserSubject.js.map /***/ }), /***/ 39491: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ValidatingWebhook = void 0; /** * ValidatingWebhook describes an admission webhook and the resources and operations it applies to. */ class V1beta1ValidatingWebhook { static getAttributeTypeMap() { return V1beta1ValidatingWebhook.attributeTypeMap; } } exports.V1beta1ValidatingWebhook = V1beta1ValidatingWebhook; V1beta1ValidatingWebhook.discriminator = undefined; V1beta1ValidatingWebhook.attributeTypeMap = [ { "name": "admissionReviewVersions", "baseName": "admissionReviewVersions", "type": "Array" }, { "name": "clientConfig", "baseName": "clientConfig", "type": "AdmissionregistrationV1beta1WebhookClientConfig" }, { "name": "failurePolicy", "baseName": "failurePolicy", "type": "string" }, { "name": "matchPolicy", "baseName": "matchPolicy", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "namespaceSelector", "baseName": "namespaceSelector", "type": "V1LabelSelector" }, { "name": "objectSelector", "baseName": "objectSelector", "type": "V1LabelSelector" }, { "name": "rules", "baseName": "rules", "type": "Array" }, { "name": "sideEffects", "baseName": "sideEffects", "type": "string" }, { "name": "timeoutSeconds", "baseName": "timeoutSeconds", "type": "number" } ]; //# sourceMappingURL=v1beta1ValidatingWebhook.js.map /***/ }), /***/ 20812: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ValidatingWebhookConfiguration = void 0; /** * ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration instead. */ class V1beta1ValidatingWebhookConfiguration { static getAttributeTypeMap() { return V1beta1ValidatingWebhookConfiguration.attributeTypeMap; } } exports.V1beta1ValidatingWebhookConfiguration = V1beta1ValidatingWebhookConfiguration; V1beta1ValidatingWebhookConfiguration.discriminator = undefined; V1beta1ValidatingWebhookConfiguration.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "webhooks", "baseName": "webhooks", "type": "Array" } ]; //# sourceMappingURL=v1beta1ValidatingWebhookConfiguration.js.map /***/ }), /***/ 18685: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1ValidatingWebhookConfigurationList = void 0; /** * ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. */ class V1beta1ValidatingWebhookConfigurationList { static getAttributeTypeMap() { return V1beta1ValidatingWebhookConfigurationList.attributeTypeMap; } } exports.V1beta1ValidatingWebhookConfigurationList = V1beta1ValidatingWebhookConfigurationList; V1beta1ValidatingWebhookConfigurationList.discriminator = undefined; V1beta1ValidatingWebhookConfigurationList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1ValidatingWebhookConfigurationList.js.map /***/ }), /***/ 72711: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1VolumeAttachment = void 0; /** * VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced. */ class V1beta1VolumeAttachment { static getAttributeTypeMap() { return V1beta1VolumeAttachment.attributeTypeMap; } } exports.V1beta1VolumeAttachment = V1beta1VolumeAttachment; V1beta1VolumeAttachment.discriminator = undefined; V1beta1VolumeAttachment.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1beta1VolumeAttachmentSpec" }, { "name": "status", "baseName": "status", "type": "V1beta1VolumeAttachmentStatus" } ]; //# sourceMappingURL=v1beta1VolumeAttachment.js.map /***/ }), /***/ 72167: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1VolumeAttachmentList = void 0; /** * VolumeAttachmentList is a collection of VolumeAttachment objects. */ class V1beta1VolumeAttachmentList { static getAttributeTypeMap() { return V1beta1VolumeAttachmentList.attributeTypeMap; } } exports.V1beta1VolumeAttachmentList = V1beta1VolumeAttachmentList; V1beta1VolumeAttachmentList.discriminator = undefined; V1beta1VolumeAttachmentList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v1beta1VolumeAttachmentList.js.map /***/ }), /***/ 55473: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1VolumeAttachmentSource = void 0; /** * VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set. */ class V1beta1VolumeAttachmentSource { static getAttributeTypeMap() { return V1beta1VolumeAttachmentSource.attributeTypeMap; } } exports.V1beta1VolumeAttachmentSource = V1beta1VolumeAttachmentSource; V1beta1VolumeAttachmentSource.discriminator = undefined; V1beta1VolumeAttachmentSource.attributeTypeMap = [ { "name": "inlineVolumeSpec", "baseName": "inlineVolumeSpec", "type": "V1PersistentVolumeSpec" }, { "name": "persistentVolumeName", "baseName": "persistentVolumeName", "type": "string" } ]; //# sourceMappingURL=v1beta1VolumeAttachmentSource.js.map /***/ }), /***/ 53805: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1VolumeAttachmentSpec = void 0; /** * VolumeAttachmentSpec is the specification of a VolumeAttachment request. */ class V1beta1VolumeAttachmentSpec { static getAttributeTypeMap() { return V1beta1VolumeAttachmentSpec.attributeTypeMap; } } exports.V1beta1VolumeAttachmentSpec = V1beta1VolumeAttachmentSpec; V1beta1VolumeAttachmentSpec.discriminator = undefined; V1beta1VolumeAttachmentSpec.attributeTypeMap = [ { "name": "attacher", "baseName": "attacher", "type": "string" }, { "name": "nodeName", "baseName": "nodeName", "type": "string" }, { "name": "source", "baseName": "source", "type": "V1beta1VolumeAttachmentSource" } ]; //# sourceMappingURL=v1beta1VolumeAttachmentSpec.js.map /***/ }), /***/ 94350: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1VolumeAttachmentStatus = void 0; /** * VolumeAttachmentStatus is the status of a VolumeAttachment request. */ class V1beta1VolumeAttachmentStatus { static getAttributeTypeMap() { return V1beta1VolumeAttachmentStatus.attributeTypeMap; } } exports.V1beta1VolumeAttachmentStatus = V1beta1VolumeAttachmentStatus; V1beta1VolumeAttachmentStatus.discriminator = undefined; V1beta1VolumeAttachmentStatus.attributeTypeMap = [ { "name": "attachError", "baseName": "attachError", "type": "V1beta1VolumeError" }, { "name": "attached", "baseName": "attached", "type": "boolean" }, { "name": "attachmentMetadata", "baseName": "attachmentMetadata", "type": "{ [key: string]: string; }" }, { "name": "detachError", "baseName": "detachError", "type": "V1beta1VolumeError" } ]; //# sourceMappingURL=v1beta1VolumeAttachmentStatus.js.map /***/ }), /***/ 53849: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1VolumeError = void 0; /** * VolumeError captures an error encountered during a volume operation. */ class V1beta1VolumeError { static getAttributeTypeMap() { return V1beta1VolumeError.attributeTypeMap; } } exports.V1beta1VolumeError = V1beta1VolumeError; V1beta1VolumeError.discriminator = undefined; V1beta1VolumeError.attributeTypeMap = [ { "name": "message", "baseName": "message", "type": "string" }, { "name": "time", "baseName": "time", "type": "Date" } ]; //# sourceMappingURL=v1beta1VolumeError.js.map /***/ }), /***/ 71688: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V1beta1VolumeNodeResources = void 0; /** * VolumeNodeResources is a set of resource limits for scheduling of volumes. */ class V1beta1VolumeNodeResources { static getAttributeTypeMap() { return V1beta1VolumeNodeResources.attributeTypeMap; } } exports.V1beta1VolumeNodeResources = V1beta1VolumeNodeResources; V1beta1VolumeNodeResources.discriminator = undefined; V1beta1VolumeNodeResources.attributeTypeMap = [ { "name": "count", "baseName": "count", "type": "number" } ]; //# sourceMappingURL=v1beta1VolumeNodeResources.js.map /***/ }), /***/ 5710: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2alpha1CronJob = void 0; /** * CronJob represents the configuration of a single cron job. */ class V2alpha1CronJob { static getAttributeTypeMap() { return V2alpha1CronJob.attributeTypeMap; } } exports.V2alpha1CronJob = V2alpha1CronJob; V2alpha1CronJob.discriminator = undefined; V2alpha1CronJob.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V2alpha1CronJobSpec" }, { "name": "status", "baseName": "status", "type": "V2alpha1CronJobStatus" } ]; //# sourceMappingURL=v2alpha1CronJob.js.map /***/ }), /***/ 98026: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2alpha1CronJobList = void 0; /** * CronJobList is a collection of cron jobs. */ class V2alpha1CronJobList { static getAttributeTypeMap() { return V2alpha1CronJobList.attributeTypeMap; } } exports.V2alpha1CronJobList = V2alpha1CronJobList; V2alpha1CronJobList.discriminator = undefined; V2alpha1CronJobList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v2alpha1CronJobList.js.map /***/ }), /***/ 41784: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2alpha1CronJobSpec = void 0; /** * CronJobSpec describes how the job execution will look like and when it will actually run. */ class V2alpha1CronJobSpec { static getAttributeTypeMap() { return V2alpha1CronJobSpec.attributeTypeMap; } } exports.V2alpha1CronJobSpec = V2alpha1CronJobSpec; V2alpha1CronJobSpec.discriminator = undefined; V2alpha1CronJobSpec.attributeTypeMap = [ { "name": "concurrencyPolicy", "baseName": "concurrencyPolicy", "type": "string" }, { "name": "failedJobsHistoryLimit", "baseName": "failedJobsHistoryLimit", "type": "number" }, { "name": "jobTemplate", "baseName": "jobTemplate", "type": "V2alpha1JobTemplateSpec" }, { "name": "schedule", "baseName": "schedule", "type": "string" }, { "name": "startingDeadlineSeconds", "baseName": "startingDeadlineSeconds", "type": "number" }, { "name": "successfulJobsHistoryLimit", "baseName": "successfulJobsHistoryLimit", "type": "number" }, { "name": "suspend", "baseName": "suspend", "type": "boolean" } ]; //# sourceMappingURL=v2alpha1CronJobSpec.js.map /***/ }), /***/ 2411: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2alpha1CronJobStatus = void 0; /** * CronJobStatus represents the current state of a cron job. */ class V2alpha1CronJobStatus { static getAttributeTypeMap() { return V2alpha1CronJobStatus.attributeTypeMap; } } exports.V2alpha1CronJobStatus = V2alpha1CronJobStatus; V2alpha1CronJobStatus.discriminator = undefined; V2alpha1CronJobStatus.attributeTypeMap = [ { "name": "active", "baseName": "active", "type": "Array" }, { "name": "lastScheduleTime", "baseName": "lastScheduleTime", "type": "Date" } ]; //# sourceMappingURL=v2alpha1CronJobStatus.js.map /***/ }), /***/ 3849: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2alpha1JobTemplateSpec = void 0; /** * JobTemplateSpec describes the data a Job should have when created from a template */ class V2alpha1JobTemplateSpec { static getAttributeTypeMap() { return V2alpha1JobTemplateSpec.attributeTypeMap; } } exports.V2alpha1JobTemplateSpec = V2alpha1JobTemplateSpec; V2alpha1JobTemplateSpec.discriminator = undefined; V2alpha1JobTemplateSpec.attributeTypeMap = [ { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V1JobSpec" } ]; //# sourceMappingURL=v2alpha1JobTemplateSpec.js.map /***/ }), /***/ 37196: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1ContainerResourceMetricSource = void 0; /** * ContainerResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set. */ class V2beta1ContainerResourceMetricSource { static getAttributeTypeMap() { return V2beta1ContainerResourceMetricSource.attributeTypeMap; } } exports.V2beta1ContainerResourceMetricSource = V2beta1ContainerResourceMetricSource; V2beta1ContainerResourceMetricSource.discriminator = undefined; V2beta1ContainerResourceMetricSource.attributeTypeMap = [ { "name": "container", "baseName": "container", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "targetAverageUtilization", "baseName": "targetAverageUtilization", "type": "number" }, { "name": "targetAverageValue", "baseName": "targetAverageValue", "type": "string" } ]; //# sourceMappingURL=v2beta1ContainerResourceMetricSource.js.map /***/ }), /***/ 27287: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1ContainerResourceMetricStatus = void 0; /** * ContainerResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. */ class V2beta1ContainerResourceMetricStatus { static getAttributeTypeMap() { return V2beta1ContainerResourceMetricStatus.attributeTypeMap; } } exports.V2beta1ContainerResourceMetricStatus = V2beta1ContainerResourceMetricStatus; V2beta1ContainerResourceMetricStatus.discriminator = undefined; V2beta1ContainerResourceMetricStatus.attributeTypeMap = [ { "name": "container", "baseName": "container", "type": "string" }, { "name": "currentAverageUtilization", "baseName": "currentAverageUtilization", "type": "number" }, { "name": "currentAverageValue", "baseName": "currentAverageValue", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v2beta1ContainerResourceMetricStatus.js.map /***/ }), /***/ 79262: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1CrossVersionObjectReference = void 0; /** * CrossVersionObjectReference contains enough information to let you identify the referred resource. */ class V2beta1CrossVersionObjectReference { static getAttributeTypeMap() { return V2beta1CrossVersionObjectReference.attributeTypeMap; } } exports.V2beta1CrossVersionObjectReference = V2beta1CrossVersionObjectReference; V2beta1CrossVersionObjectReference.discriminator = undefined; V2beta1CrossVersionObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v2beta1CrossVersionObjectReference.js.map /***/ }), /***/ 43128: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1ExternalMetricSource = void 0; /** * ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). Exactly one \"target\" type should be set. */ class V2beta1ExternalMetricSource { static getAttributeTypeMap() { return V2beta1ExternalMetricSource.attributeTypeMap; } } exports.V2beta1ExternalMetricSource = V2beta1ExternalMetricSource; V2beta1ExternalMetricSource.discriminator = undefined; V2beta1ExternalMetricSource.attributeTypeMap = [ { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "metricSelector", "baseName": "metricSelector", "type": "V1LabelSelector" }, { "name": "targetAverageValue", "baseName": "targetAverageValue", "type": "string" }, { "name": "targetValue", "baseName": "targetValue", "type": "string" } ]; //# sourceMappingURL=v2beta1ExternalMetricSource.js.map /***/ }), /***/ 96606: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1ExternalMetricStatus = void 0; /** * ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object. */ class V2beta1ExternalMetricStatus { static getAttributeTypeMap() { return V2beta1ExternalMetricStatus.attributeTypeMap; } } exports.V2beta1ExternalMetricStatus = V2beta1ExternalMetricStatus; V2beta1ExternalMetricStatus.discriminator = undefined; V2beta1ExternalMetricStatus.attributeTypeMap = [ { "name": "currentAverageValue", "baseName": "currentAverageValue", "type": "string" }, { "name": "currentValue", "baseName": "currentValue", "type": "string" }, { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "metricSelector", "baseName": "metricSelector", "type": "V1LabelSelector" } ]; //# sourceMappingURL=v2beta1ExternalMetricStatus.js.map /***/ }), /***/ 74687: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1HorizontalPodAutoscaler = void 0; /** * HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. */ class V2beta1HorizontalPodAutoscaler { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscaler.attributeTypeMap; } } exports.V2beta1HorizontalPodAutoscaler = V2beta1HorizontalPodAutoscaler; V2beta1HorizontalPodAutoscaler.discriminator = undefined; V2beta1HorizontalPodAutoscaler.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V2beta1HorizontalPodAutoscalerSpec" }, { "name": "status", "baseName": "status", "type": "V2beta1HorizontalPodAutoscalerStatus" } ]; //# sourceMappingURL=v2beta1HorizontalPodAutoscaler.js.map /***/ }), /***/ 89728: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1HorizontalPodAutoscalerCondition = void 0; /** * HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point. */ class V2beta1HorizontalPodAutoscalerCondition { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscalerCondition.attributeTypeMap; } } exports.V2beta1HorizontalPodAutoscalerCondition = V2beta1HorizontalPodAutoscalerCondition; V2beta1HorizontalPodAutoscalerCondition.discriminator = undefined; V2beta1HorizontalPodAutoscalerCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v2beta1HorizontalPodAutoscalerCondition.js.map /***/ }), /***/ 89151: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1HorizontalPodAutoscalerList = void 0; /** * HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. */ class V2beta1HorizontalPodAutoscalerList { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscalerList.attributeTypeMap; } } exports.V2beta1HorizontalPodAutoscalerList = V2beta1HorizontalPodAutoscalerList; V2beta1HorizontalPodAutoscalerList.discriminator = undefined; V2beta1HorizontalPodAutoscalerList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v2beta1HorizontalPodAutoscalerList.js.map /***/ }), /***/ 8786: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1HorizontalPodAutoscalerSpec = void 0; /** * HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. */ class V2beta1HorizontalPodAutoscalerSpec { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscalerSpec.attributeTypeMap; } } exports.V2beta1HorizontalPodAutoscalerSpec = V2beta1HorizontalPodAutoscalerSpec; V2beta1HorizontalPodAutoscalerSpec.discriminator = undefined; V2beta1HorizontalPodAutoscalerSpec.attributeTypeMap = [ { "name": "maxReplicas", "baseName": "maxReplicas", "type": "number" }, { "name": "metrics", "baseName": "metrics", "type": "Array" }, { "name": "minReplicas", "baseName": "minReplicas", "type": "number" }, { "name": "scaleTargetRef", "baseName": "scaleTargetRef", "type": "V2beta1CrossVersionObjectReference" } ]; //# sourceMappingURL=v2beta1HorizontalPodAutoscalerSpec.js.map /***/ }), /***/ 66258: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1HorizontalPodAutoscalerStatus = void 0; /** * HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler. */ class V2beta1HorizontalPodAutoscalerStatus { static getAttributeTypeMap() { return V2beta1HorizontalPodAutoscalerStatus.attributeTypeMap; } } exports.V2beta1HorizontalPodAutoscalerStatus = V2beta1HorizontalPodAutoscalerStatus; V2beta1HorizontalPodAutoscalerStatus.discriminator = undefined; V2beta1HorizontalPodAutoscalerStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentMetrics", "baseName": "currentMetrics", "type": "Array" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "desiredReplicas", "baseName": "desiredReplicas", "type": "number" }, { "name": "lastScaleTime", "baseName": "lastScaleTime", "type": "Date" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" } ]; //# sourceMappingURL=v2beta1HorizontalPodAutoscalerStatus.js.map /***/ }), /***/ 98064: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1MetricSpec = void 0; /** * MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once). */ class V2beta1MetricSpec { static getAttributeTypeMap() { return V2beta1MetricSpec.attributeTypeMap; } } exports.V2beta1MetricSpec = V2beta1MetricSpec; V2beta1MetricSpec.discriminator = undefined; V2beta1MetricSpec.attributeTypeMap = [ { "name": "containerResource", "baseName": "containerResource", "type": "V2beta1ContainerResourceMetricSource" }, { "name": "external", "baseName": "external", "type": "V2beta1ExternalMetricSource" }, { "name": "object", "baseName": "object", "type": "V2beta1ObjectMetricSource" }, { "name": "pods", "baseName": "pods", "type": "V2beta1PodsMetricSource" }, { "name": "resource", "baseName": "resource", "type": "V2beta1ResourceMetricSource" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v2beta1MetricSpec.js.map /***/ }), /***/ 25083: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1MetricStatus = void 0; /** * MetricStatus describes the last-read state of a single metric. */ class V2beta1MetricStatus { static getAttributeTypeMap() { return V2beta1MetricStatus.attributeTypeMap; } } exports.V2beta1MetricStatus = V2beta1MetricStatus; V2beta1MetricStatus.discriminator = undefined; V2beta1MetricStatus.attributeTypeMap = [ { "name": "containerResource", "baseName": "containerResource", "type": "V2beta1ContainerResourceMetricStatus" }, { "name": "external", "baseName": "external", "type": "V2beta1ExternalMetricStatus" }, { "name": "object", "baseName": "object", "type": "V2beta1ObjectMetricStatus" }, { "name": "pods", "baseName": "pods", "type": "V2beta1PodsMetricStatus" }, { "name": "resource", "baseName": "resource", "type": "V2beta1ResourceMetricStatus" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v2beta1MetricStatus.js.map /***/ }), /***/ 30639: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1ObjectMetricSource = void 0; /** * ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object). */ class V2beta1ObjectMetricSource { static getAttributeTypeMap() { return V2beta1ObjectMetricSource.attributeTypeMap; } } exports.V2beta1ObjectMetricSource = V2beta1ObjectMetricSource; V2beta1ObjectMetricSource.discriminator = undefined; V2beta1ObjectMetricSource.attributeTypeMap = [ { "name": "averageValue", "baseName": "averageValue", "type": "string" }, { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "target", "baseName": "target", "type": "V2beta1CrossVersionObjectReference" }, { "name": "targetValue", "baseName": "targetValue", "type": "string" } ]; //# sourceMappingURL=v2beta1ObjectMetricSource.js.map /***/ }), /***/ 5950: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1ObjectMetricStatus = void 0; /** * ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object). */ class V2beta1ObjectMetricStatus { static getAttributeTypeMap() { return V2beta1ObjectMetricStatus.attributeTypeMap; } } exports.V2beta1ObjectMetricStatus = V2beta1ObjectMetricStatus; V2beta1ObjectMetricStatus.discriminator = undefined; V2beta1ObjectMetricStatus.attributeTypeMap = [ { "name": "averageValue", "baseName": "averageValue", "type": "string" }, { "name": "currentValue", "baseName": "currentValue", "type": "string" }, { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "target", "baseName": "target", "type": "V2beta1CrossVersionObjectReference" } ]; //# sourceMappingURL=v2beta1ObjectMetricStatus.js.map /***/ }), /***/ 18291: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1PodsMetricSource = void 0; /** * PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value. */ class V2beta1PodsMetricSource { static getAttributeTypeMap() { return V2beta1PodsMetricSource.attributeTypeMap; } } exports.V2beta1PodsMetricSource = V2beta1PodsMetricSource; V2beta1PodsMetricSource.discriminator = undefined; V2beta1PodsMetricSource.attributeTypeMap = [ { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" }, { "name": "targetAverageValue", "baseName": "targetAverageValue", "type": "string" } ]; //# sourceMappingURL=v2beta1PodsMetricSource.js.map /***/ }), /***/ 83162: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1PodsMetricStatus = void 0; /** * PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second). */ class V2beta1PodsMetricStatus { static getAttributeTypeMap() { return V2beta1PodsMetricStatus.attributeTypeMap; } } exports.V2beta1PodsMetricStatus = V2beta1PodsMetricStatus; V2beta1PodsMetricStatus.discriminator = undefined; V2beta1PodsMetricStatus.attributeTypeMap = [ { "name": "currentAverageValue", "baseName": "currentAverageValue", "type": "string" }, { "name": "metricName", "baseName": "metricName", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" } ]; //# sourceMappingURL=v2beta1PodsMetricStatus.js.map /***/ }), /***/ 10150: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1ResourceMetricSource = void 0; /** * ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set. */ class V2beta1ResourceMetricSource { static getAttributeTypeMap() { return V2beta1ResourceMetricSource.attributeTypeMap; } } exports.V2beta1ResourceMetricSource = V2beta1ResourceMetricSource; V2beta1ResourceMetricSource.discriminator = undefined; V2beta1ResourceMetricSource.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "targetAverageUtilization", "baseName": "targetAverageUtilization", "type": "number" }, { "name": "targetAverageValue", "baseName": "targetAverageValue", "type": "string" } ]; //# sourceMappingURL=v2beta1ResourceMetricSource.js.map /***/ }), /***/ 29521: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta1ResourceMetricStatus = void 0; /** * ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. */ class V2beta1ResourceMetricStatus { static getAttributeTypeMap() { return V2beta1ResourceMetricStatus.attributeTypeMap; } } exports.V2beta1ResourceMetricStatus = V2beta1ResourceMetricStatus; V2beta1ResourceMetricStatus.discriminator = undefined; V2beta1ResourceMetricStatus.attributeTypeMap = [ { "name": "currentAverageUtilization", "baseName": "currentAverageUtilization", "type": "number" }, { "name": "currentAverageValue", "baseName": "currentAverageValue", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v2beta1ResourceMetricStatus.js.map /***/ }), /***/ 53209: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2ContainerResourceMetricSource = void 0; /** * ContainerResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set. */ class V2beta2ContainerResourceMetricSource { static getAttributeTypeMap() { return V2beta2ContainerResourceMetricSource.attributeTypeMap; } } exports.V2beta2ContainerResourceMetricSource = V2beta2ContainerResourceMetricSource; V2beta2ContainerResourceMetricSource.discriminator = undefined; V2beta2ContainerResourceMetricSource.attributeTypeMap = [ { "name": "container", "baseName": "container", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; //# sourceMappingURL=v2beta2ContainerResourceMetricSource.js.map /***/ }), /***/ 69602: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2ContainerResourceMetricStatus = void 0; /** * ContainerResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. */ class V2beta2ContainerResourceMetricStatus { static getAttributeTypeMap() { return V2beta2ContainerResourceMetricStatus.attributeTypeMap; } } exports.V2beta2ContainerResourceMetricStatus = V2beta2ContainerResourceMetricStatus; V2beta2ContainerResourceMetricStatus.discriminator = undefined; V2beta2ContainerResourceMetricStatus.attributeTypeMap = [ { "name": "container", "baseName": "container", "type": "string" }, { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v2beta2ContainerResourceMetricStatus.js.map /***/ }), /***/ 85029: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2CrossVersionObjectReference = void 0; /** * CrossVersionObjectReference contains enough information to let you identify the referred resource. */ class V2beta2CrossVersionObjectReference { static getAttributeTypeMap() { return V2beta2CrossVersionObjectReference.attributeTypeMap; } } exports.V2beta2CrossVersionObjectReference = V2beta2CrossVersionObjectReference; V2beta2CrossVersionObjectReference.discriminator = undefined; V2beta2CrossVersionObjectReference.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v2beta2CrossVersionObjectReference.js.map /***/ }), /***/ 75145: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2ExternalMetricSource = void 0; /** * ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). */ class V2beta2ExternalMetricSource { static getAttributeTypeMap() { return V2beta2ExternalMetricSource.attributeTypeMap; } } exports.V2beta2ExternalMetricSource = V2beta2ExternalMetricSource; V2beta2ExternalMetricSource.discriminator = undefined; V2beta2ExternalMetricSource.attributeTypeMap = [ { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; //# sourceMappingURL=v2beta2ExternalMetricSource.js.map /***/ }), /***/ 12390: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2ExternalMetricStatus = void 0; /** * ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object. */ class V2beta2ExternalMetricStatus { static getAttributeTypeMap() { return V2beta2ExternalMetricStatus.attributeTypeMap; } } exports.V2beta2ExternalMetricStatus = V2beta2ExternalMetricStatus; V2beta2ExternalMetricStatus.discriminator = undefined; V2beta2ExternalMetricStatus.attributeTypeMap = [ { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" } ]; //# sourceMappingURL=v2beta2ExternalMetricStatus.js.map /***/ }), /***/ 34096: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2HPAScalingPolicy = void 0; /** * HPAScalingPolicy is a single policy which must hold true for a specified past interval. */ class V2beta2HPAScalingPolicy { static getAttributeTypeMap() { return V2beta2HPAScalingPolicy.attributeTypeMap; } } exports.V2beta2HPAScalingPolicy = V2beta2HPAScalingPolicy; V2beta2HPAScalingPolicy.discriminator = undefined; V2beta2HPAScalingPolicy.attributeTypeMap = [ { "name": "periodSeconds", "baseName": "periodSeconds", "type": "number" }, { "name": "type", "baseName": "type", "type": "string" }, { "name": "value", "baseName": "value", "type": "number" } ]; //# sourceMappingURL=v2beta2HPAScalingPolicy.js.map /***/ }), /***/ 33665: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2HPAScalingRules = void 0; /** * HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen. */ class V2beta2HPAScalingRules { static getAttributeTypeMap() { return V2beta2HPAScalingRules.attributeTypeMap; } } exports.V2beta2HPAScalingRules = V2beta2HPAScalingRules; V2beta2HPAScalingRules.discriminator = undefined; V2beta2HPAScalingRules.attributeTypeMap = [ { "name": "policies", "baseName": "policies", "type": "Array" }, { "name": "selectPolicy", "baseName": "selectPolicy", "type": "string" }, { "name": "stabilizationWindowSeconds", "baseName": "stabilizationWindowSeconds", "type": "number" } ]; //# sourceMappingURL=v2beta2HPAScalingRules.js.map /***/ }), /***/ 96952: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2HorizontalPodAutoscaler = void 0; /** * HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. */ class V2beta2HorizontalPodAutoscaler { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscaler.attributeTypeMap; } } exports.V2beta2HorizontalPodAutoscaler = V2beta2HorizontalPodAutoscaler; V2beta2HorizontalPodAutoscaler.discriminator = undefined; V2beta2HorizontalPodAutoscaler.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ObjectMeta" }, { "name": "spec", "baseName": "spec", "type": "V2beta2HorizontalPodAutoscalerSpec" }, { "name": "status", "baseName": "status", "type": "V2beta2HorizontalPodAutoscalerStatus" } ]; //# sourceMappingURL=v2beta2HorizontalPodAutoscaler.js.map /***/ }), /***/ 41473: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2HorizontalPodAutoscalerBehavior = void 0; /** * HorizontalPodAutoscalerBehavior configures the scaling behavior of the target in both Up and Down directions (scaleUp and scaleDown fields respectively). */ class V2beta2HorizontalPodAutoscalerBehavior { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerBehavior.attributeTypeMap; } } exports.V2beta2HorizontalPodAutoscalerBehavior = V2beta2HorizontalPodAutoscalerBehavior; V2beta2HorizontalPodAutoscalerBehavior.discriminator = undefined; V2beta2HorizontalPodAutoscalerBehavior.attributeTypeMap = [ { "name": "scaleDown", "baseName": "scaleDown", "type": "V2beta2HPAScalingRules" }, { "name": "scaleUp", "baseName": "scaleUp", "type": "V2beta2HPAScalingRules" } ]; //# sourceMappingURL=v2beta2HorizontalPodAutoscalerBehavior.js.map /***/ }), /***/ 67231: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2HorizontalPodAutoscalerCondition = void 0; /** * HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point. */ class V2beta2HorizontalPodAutoscalerCondition { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerCondition.attributeTypeMap; } } exports.V2beta2HorizontalPodAutoscalerCondition = V2beta2HorizontalPodAutoscalerCondition; V2beta2HorizontalPodAutoscalerCondition.discriminator = undefined; V2beta2HorizontalPodAutoscalerCondition.attributeTypeMap = [ { "name": "lastTransitionTime", "baseName": "lastTransitionTime", "type": "Date" }, { "name": "message", "baseName": "message", "type": "string" }, { "name": "reason", "baseName": "reason", "type": "string" }, { "name": "status", "baseName": "status", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v2beta2HorizontalPodAutoscalerCondition.js.map /***/ }), /***/ 29409: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2HorizontalPodAutoscalerList = void 0; /** * HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects. */ class V2beta2HorizontalPodAutoscalerList { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerList.attributeTypeMap; } } exports.V2beta2HorizontalPodAutoscalerList = V2beta2HorizontalPodAutoscalerList; V2beta2HorizontalPodAutoscalerList.discriminator = undefined; V2beta2HorizontalPodAutoscalerList.attributeTypeMap = [ { "name": "apiVersion", "baseName": "apiVersion", "type": "string" }, { "name": "items", "baseName": "items", "type": "Array" }, { "name": "kind", "baseName": "kind", "type": "string" }, { "name": "metadata", "baseName": "metadata", "type": "V1ListMeta" } ]; //# sourceMappingURL=v2beta2HorizontalPodAutoscalerList.js.map /***/ }), /***/ 17298: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2HorizontalPodAutoscalerSpec = void 0; /** * HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler. */ class V2beta2HorizontalPodAutoscalerSpec { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerSpec.attributeTypeMap; } } exports.V2beta2HorizontalPodAutoscalerSpec = V2beta2HorizontalPodAutoscalerSpec; V2beta2HorizontalPodAutoscalerSpec.discriminator = undefined; V2beta2HorizontalPodAutoscalerSpec.attributeTypeMap = [ { "name": "behavior", "baseName": "behavior", "type": "V2beta2HorizontalPodAutoscalerBehavior" }, { "name": "maxReplicas", "baseName": "maxReplicas", "type": "number" }, { "name": "metrics", "baseName": "metrics", "type": "Array" }, { "name": "minReplicas", "baseName": "minReplicas", "type": "number" }, { "name": "scaleTargetRef", "baseName": "scaleTargetRef", "type": "V2beta2CrossVersionObjectReference" } ]; //# sourceMappingURL=v2beta2HorizontalPodAutoscalerSpec.js.map /***/ }), /***/ 60715: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2HorizontalPodAutoscalerStatus = void 0; /** * HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler. */ class V2beta2HorizontalPodAutoscalerStatus { static getAttributeTypeMap() { return V2beta2HorizontalPodAutoscalerStatus.attributeTypeMap; } } exports.V2beta2HorizontalPodAutoscalerStatus = V2beta2HorizontalPodAutoscalerStatus; V2beta2HorizontalPodAutoscalerStatus.discriminator = undefined; V2beta2HorizontalPodAutoscalerStatus.attributeTypeMap = [ { "name": "conditions", "baseName": "conditions", "type": "Array" }, { "name": "currentMetrics", "baseName": "currentMetrics", "type": "Array" }, { "name": "currentReplicas", "baseName": "currentReplicas", "type": "number" }, { "name": "desiredReplicas", "baseName": "desiredReplicas", "type": "number" }, { "name": "lastScaleTime", "baseName": "lastScaleTime", "type": "Date" }, { "name": "observedGeneration", "baseName": "observedGeneration", "type": "number" } ]; //# sourceMappingURL=v2beta2HorizontalPodAutoscalerStatus.js.map /***/ }), /***/ 73280: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2MetricIdentifier = void 0; /** * MetricIdentifier defines the name and optionally selector for a metric */ class V2beta2MetricIdentifier { static getAttributeTypeMap() { return V2beta2MetricIdentifier.attributeTypeMap; } } exports.V2beta2MetricIdentifier = V2beta2MetricIdentifier; V2beta2MetricIdentifier.discriminator = undefined; V2beta2MetricIdentifier.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "selector", "baseName": "selector", "type": "V1LabelSelector" } ]; //# sourceMappingURL=v2beta2MetricIdentifier.js.map /***/ }), /***/ 54941: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2MetricSpec = void 0; /** * MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once). */ class V2beta2MetricSpec { static getAttributeTypeMap() { return V2beta2MetricSpec.attributeTypeMap; } } exports.V2beta2MetricSpec = V2beta2MetricSpec; V2beta2MetricSpec.discriminator = undefined; V2beta2MetricSpec.attributeTypeMap = [ { "name": "containerResource", "baseName": "containerResource", "type": "V2beta2ContainerResourceMetricSource" }, { "name": "external", "baseName": "external", "type": "V2beta2ExternalMetricSource" }, { "name": "object", "baseName": "object", "type": "V2beta2ObjectMetricSource" }, { "name": "pods", "baseName": "pods", "type": "V2beta2PodsMetricSource" }, { "name": "resource", "baseName": "resource", "type": "V2beta2ResourceMetricSource" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v2beta2MetricSpec.js.map /***/ }), /***/ 5415: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2MetricStatus = void 0; /** * MetricStatus describes the last-read state of a single metric. */ class V2beta2MetricStatus { static getAttributeTypeMap() { return V2beta2MetricStatus.attributeTypeMap; } } exports.V2beta2MetricStatus = V2beta2MetricStatus; V2beta2MetricStatus.discriminator = undefined; V2beta2MetricStatus.attributeTypeMap = [ { "name": "containerResource", "baseName": "containerResource", "type": "V2beta2ContainerResourceMetricStatus" }, { "name": "external", "baseName": "external", "type": "V2beta2ExternalMetricStatus" }, { "name": "object", "baseName": "object", "type": "V2beta2ObjectMetricStatus" }, { "name": "pods", "baseName": "pods", "type": "V2beta2PodsMetricStatus" }, { "name": "resource", "baseName": "resource", "type": "V2beta2ResourceMetricStatus" }, { "name": "type", "baseName": "type", "type": "string" } ]; //# sourceMappingURL=v2beta2MetricStatus.js.map /***/ }), /***/ 17383: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2MetricTarget = void 0; /** * MetricTarget defines the target value, average value, or average utilization of a specific metric */ class V2beta2MetricTarget { static getAttributeTypeMap() { return V2beta2MetricTarget.attributeTypeMap; } } exports.V2beta2MetricTarget = V2beta2MetricTarget; V2beta2MetricTarget.discriminator = undefined; V2beta2MetricTarget.attributeTypeMap = [ { "name": "averageUtilization", "baseName": "averageUtilization", "type": "number" }, { "name": "averageValue", "baseName": "averageValue", "type": "string" }, { "name": "type", "baseName": "type", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; //# sourceMappingURL=v2beta2MetricTarget.js.map /***/ }), /***/ 61416: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2MetricValueStatus = void 0; /** * MetricValueStatus holds the current value for a metric */ class V2beta2MetricValueStatus { static getAttributeTypeMap() { return V2beta2MetricValueStatus.attributeTypeMap; } } exports.V2beta2MetricValueStatus = V2beta2MetricValueStatus; V2beta2MetricValueStatus.discriminator = undefined; V2beta2MetricValueStatus.attributeTypeMap = [ { "name": "averageUtilization", "baseName": "averageUtilization", "type": "number" }, { "name": "averageValue", "baseName": "averageValue", "type": "string" }, { "name": "value", "baseName": "value", "type": "string" } ]; //# sourceMappingURL=v2beta2MetricValueStatus.js.map /***/ }), /***/ 56126: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2ObjectMetricSource = void 0; /** * ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object). */ class V2beta2ObjectMetricSource { static getAttributeTypeMap() { return V2beta2ObjectMetricSource.attributeTypeMap; } } exports.V2beta2ObjectMetricSource = V2beta2ObjectMetricSource; V2beta2ObjectMetricSource.discriminator = undefined; V2beta2ObjectMetricSource.attributeTypeMap = [ { "name": "describedObject", "baseName": "describedObject", "type": "V2beta2CrossVersionObjectReference" }, { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; //# sourceMappingURL=v2beta2ObjectMetricSource.js.map /***/ }), /***/ 60958: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2ObjectMetricStatus = void 0; /** * ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object). */ class V2beta2ObjectMetricStatus { static getAttributeTypeMap() { return V2beta2ObjectMetricStatus.attributeTypeMap; } } exports.V2beta2ObjectMetricStatus = V2beta2ObjectMetricStatus; V2beta2ObjectMetricStatus.discriminator = undefined; V2beta2ObjectMetricStatus.attributeTypeMap = [ { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "describedObject", "baseName": "describedObject", "type": "V2beta2CrossVersionObjectReference" }, { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" } ]; //# sourceMappingURL=v2beta2ObjectMetricStatus.js.map /***/ }), /***/ 46865: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2PodsMetricSource = void 0; /** * PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value. */ class V2beta2PodsMetricSource { static getAttributeTypeMap() { return V2beta2PodsMetricSource.attributeTypeMap; } } exports.V2beta2PodsMetricSource = V2beta2PodsMetricSource; V2beta2PodsMetricSource.discriminator = undefined; V2beta2PodsMetricSource.attributeTypeMap = [ { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; //# sourceMappingURL=v2beta2PodsMetricSource.js.map /***/ }), /***/ 78411: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2PodsMetricStatus = void 0; /** * PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second). */ class V2beta2PodsMetricStatus { static getAttributeTypeMap() { return V2beta2PodsMetricStatus.attributeTypeMap; } } exports.V2beta2PodsMetricStatus = V2beta2PodsMetricStatus; V2beta2PodsMetricStatus.discriminator = undefined; V2beta2PodsMetricStatus.attributeTypeMap = [ { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "metric", "baseName": "metric", "type": "V2beta2MetricIdentifier" } ]; //# sourceMappingURL=v2beta2PodsMetricStatus.js.map /***/ }), /***/ 23137: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2ResourceMetricSource = void 0; /** * ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. Only one \"target\" type should be set. */ class V2beta2ResourceMetricSource { static getAttributeTypeMap() { return V2beta2ResourceMetricSource.attributeTypeMap; } } exports.V2beta2ResourceMetricSource = V2beta2ResourceMetricSource; V2beta2ResourceMetricSource.discriminator = undefined; V2beta2ResourceMetricSource.attributeTypeMap = [ { "name": "name", "baseName": "name", "type": "string" }, { "name": "target", "baseName": "target", "type": "V2beta2MetricTarget" } ]; //# sourceMappingURL=v2beta2ResourceMetricSource.js.map /***/ }), /***/ 849: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.V2beta2ResourceMetricStatus = void 0; /** * ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source. */ class V2beta2ResourceMetricStatus { static getAttributeTypeMap() { return V2beta2ResourceMetricStatus.attributeTypeMap; } } exports.V2beta2ResourceMetricStatus = V2beta2ResourceMetricStatus; V2beta2ResourceMetricStatus.discriminator = undefined; V2beta2ResourceMetricStatus.attributeTypeMap = [ { "name": "current", "baseName": "current", "type": "V2beta2MetricValueStatus" }, { "name": "name", "baseName": "name", "type": "string" } ]; //# sourceMappingURL=v2beta2ResourceMetricStatus.js.map /***/ }), /***/ 17451: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1.20.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VersionInfo = void 0; /** * Info contains versioning information. how we\'ll want to distribute that information. */ class VersionInfo { static getAttributeTypeMap() { return VersionInfo.attributeTypeMap; } } exports.VersionInfo = VersionInfo; VersionInfo.discriminator = undefined; VersionInfo.attributeTypeMap = [ { "name": "buildDate", "baseName": "buildDate", "type": "string" }, { "name": "compiler", "baseName": "compiler", "type": "string" }, { "name": "gitCommit", "baseName": "gitCommit", "type": "string" }, { "name": "gitTreeState", "baseName": "gitTreeState", "type": "string" }, { "name": "gitVersion", "baseName": "gitVersion", "type": "string" }, { "name": "goVersion", "baseName": "goVersion", "type": "string" }, { "name": "major", "baseName": "major", "type": "string" }, { "name": "minor", "baseName": "minor", "type": "string" }, { "name": "platform", "baseName": "platform", "type": "string" } ]; //# sourceMappingURL=versionInfo.js.map /***/ }), /***/ 89679: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const tslib_1 = __webpack_require__(75636); tslib_1.__exportStar(__webpack_require__(14958), exports); tslib_1.__exportStar(__webpack_require__(5434), exports); tslib_1.__exportStar(__webpack_require__(56664), exports); tslib_1.__exportStar(__webpack_require__(61041), exports); tslib_1.__exportStar(__webpack_require__(7633), exports); tslib_1.__exportStar(__webpack_require__(62864), exports); tslib_1.__exportStar(__webpack_require__(32390), exports); tslib_1.__exportStar(__webpack_require__(74949), exports); tslib_1.__exportStar(__webpack_require__(18122), exports); tslib_1.__exportStar(__webpack_require__(44756), exports); tslib_1.__exportStar(__webpack_require__(88029), exports); tslib_1.__exportStar(__webpack_require__(23091), exports); tslib_1.__exportStar(__webpack_require__(12743), exports); tslib_1.__exportStar(__webpack_require__(54815), exports); tslib_1.__exportStar(__webpack_require__(91188), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 88029: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.makeInformer = exports.ERROR = exports.DELETE = exports.CHANGE = exports.UPDATE = exports.ADD = void 0; const cache_1 = __webpack_require__(5434); const watch_1 = __webpack_require__(7633); exports.ADD = 'add'; exports.UPDATE = 'update'; exports.CHANGE = 'change'; exports.DELETE = 'delete'; exports.ERROR = 'error'; function makeInformer(kubeconfig, path, listPromiseFn) { const watch = new watch_1.Watch(kubeconfig); return new cache_1.ListWatch(path, watch, listPromiseFn, false); } exports.makeInformer = makeInformer; //# sourceMappingURL=informer.js.map /***/ }), /***/ 44756: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Log = void 0; const tslib_1 = __webpack_require__(75636); const request = __webpack_require__(48699); class Log { constructor(config) { this.config = config; } log(namespace, podName, containerName, stream, done, options = {}) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const path = `/api/v1/namespaces/${namespace}/pods/${podName}/log`; const cluster = this.config.getCurrentCluster(); if (!cluster) { throw new Error('No currently active cluster'); } const url = cluster.server + path; const requestOptions = { method: 'GET', qs: Object.assign(Object.assign({}, options), { container: containerName }), uri: url, }; yield this.config.applyToRequest(requestOptions); const req = request(requestOptions, (error, response, body) => { if (error) { done(error); } else if (response && response.statusCode !== 200) { done(body); } else { done(null); } }).on('response', (response) => { if (response.statusCode === 200) { req.pipe(stream); } }); return req; }); } } exports.Log = Log; //# sourceMappingURL=log.js.map /***/ }), /***/ 12743: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.KubernetesObjectApi = void 0; const tslib_1 = __webpack_require__(75636); const request = __webpack_require__(48699); const api_1 = __webpack_require__(56664); /** * Valid Content-Type header values for patch operations. See * https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/ * for details. */ var KubernetesPatchStrategies; (function (KubernetesPatchStrategies) { /** Diff-like JSON format. */ KubernetesPatchStrategies["JsonPatch"] = "application/json-patch+json"; /** Simple merge. */ KubernetesPatchStrategies["MergePatch"] = "application/merge-patch+json"; /** Merge with different strategies depending on field metadata. */ KubernetesPatchStrategies["StrategicMergePatch"] = "application/strategic-merge-patch+json"; })(KubernetesPatchStrategies || (KubernetesPatchStrategies = {})); /** * Dynamically construct Kubernetes API request URIs so client does not have to know what type of object it is acting * on. */ class KubernetesObjectApi extends api_1.ApisApi { constructor() { super(...arguments); /** Initialize the default namespace. May be overwritten by context. */ this.defaultNamespace = 'default'; /** Cache resource API response. */ this.apiVersionResourceCache = {}; } /** * Create a KubernetesObjectApi object from the provided KubeConfig. This method should be used rather than * [[KubeConfig.makeApiClient]] so we can properly determine the default namespace if one is provided by the current * context. * * @param kc Valid Kubernetes config * @return Properly instantiated [[KubernetesObjectApi]] object */ static makeApiClient(kc) { const client = kc.makeApiClient(KubernetesObjectApi); client.setDefaultNamespace(kc); return client; } /** * Create any Kubernetes resource. * @param spec Kubernetes resource spec. * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized * dryRun directive will result in an error response and no further processing of the request. Valid values * are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The * value must be less than or 128 characters long, and only contain printable characters, as defined by * https://golang.org/pkg/unicode/#IsPrint. * @param options Optional headers to use in the request. * @return Promise containing the request response and [[KubernetesObject]]. */ create(spec, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // verify required parameter 'spec' is not null or undefined if (spec === null || spec === undefined) { throw new Error('Required parameter spec was null or undefined when calling create.'); } const localVarPath = yield this.specUriPath(spec, 'create'); const localVarQueryParameters = {}; const localVarHeaderParams = this.generateHeaders(options.headers); if (pretty !== undefined) { localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string'); } if (dryRun !== undefined) { localVarQueryParameters.dryRun = api_1.ObjectSerializer.serialize(dryRun, 'string'); } if (fieldManager !== undefined) { localVarQueryParameters.fieldManager = api_1.ObjectSerializer.serialize(fieldManager, 'string'); } const localVarRequestOptions = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: api_1.ObjectSerializer.serialize(spec, 'KubernetesObject'), }; return this.requestPromise(localVarRequestOptions); }); } /** * Delete any Kubernetes resource. * @param spec Kubernetes resource spec * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized * dryRun directive will result in an error response and no further processing of the request. Valid values * are: - All: all dry run stages will be processed * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative * integer. The value zero indicates delete immediately. If this value is nil, the default grace period for * the specified type will be used. Defaults to a per object value if not specified. zero means delete * immediately. * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in * 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be * added to/removed from the object\'s finalizers list. Either this field or PropagationPolicy may be * set, but not both. * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or * OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in * the metadata.finalizers and the resource-specific default policy. Acceptable values are: * \'Orphan\' - orphan the dependents; \'Background\' - allow the garbage collector to delete * the dependents in the background; \'Foreground\' - a cascading policy that deletes all dependents * in the foreground. * @param body See [[V1DeleteOptions]]. * @param options Optional headers to use in the request. * @return Promise containing the request response and a Kubernetes [[V1Status]]. */ delete(spec, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // verify required parameter 'spec' is not null or undefined if (spec === null || spec === undefined) { throw new Error('Required parameter spec was null or undefined when calling delete.'); } const localVarPath = yield this.specUriPath(spec, 'delete'); const localVarQueryParameters = {}; const localVarHeaderParams = this.generateHeaders(options.headers); if (pretty !== undefined) { localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string'); } if (dryRun !== undefined) { localVarQueryParameters.dryRun = api_1.ObjectSerializer.serialize(dryRun, 'string'); } if (gracePeriodSeconds !== undefined) { localVarQueryParameters.gracePeriodSeconds = api_1.ObjectSerializer.serialize(gracePeriodSeconds, 'number'); } if (orphanDependents !== undefined) { localVarQueryParameters.orphanDependents = api_1.ObjectSerializer.serialize(orphanDependents, 'boolean'); } if (propagationPolicy !== undefined) { localVarQueryParameters.propagationPolicy = api_1.ObjectSerializer.serialize(propagationPolicy, 'string'); } const localVarRequestOptions = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: api_1.ObjectSerializer.serialize(body, 'V1DeleteOptions'), }; return this.requestPromise(localVarRequestOptions, 'V1Status'); }); } /** * Patch any Kubernetes resource. * @param spec Kubernetes resource spec * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized * dryRun directive will result in an error response and no further processing of the request. Valid values * are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The * value must be less than or 128 characters long, and only contain printable characters, as defined by * https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests * (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, * StrategicMergePatch). * @param force Force is going to \"force\" Apply requests. It means user will re-acquire conflicting * fields owned by other people. Force flag must be unset for non-apply patch requests. * @param options Optional headers to use in the request. * @return Promise containing the request response and [[KubernetesObject]]. */ patch(spec, pretty, dryRun, fieldManager, force, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // verify required parameter 'spec' is not null or undefined if (spec === null || spec === undefined) { throw new Error('Required parameter spec was null or undefined when calling patch.'); } const localVarPath = yield this.specUriPath(spec, 'patch'); const localVarQueryParameters = {}; const localVarHeaderParams = this.generateHeaders(options.headers, 'PATCH'); if (pretty !== undefined) { localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string'); } if (dryRun !== undefined) { localVarQueryParameters.dryRun = api_1.ObjectSerializer.serialize(dryRun, 'string'); } if (fieldManager !== undefined) { localVarQueryParameters.fieldManager = api_1.ObjectSerializer.serialize(fieldManager, 'string'); } if (force !== undefined) { localVarQueryParameters.force = api_1.ObjectSerializer.serialize(force, 'boolean'); } const localVarRequestOptions = { method: 'PATCH', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: api_1.ObjectSerializer.serialize(spec, 'object'), }; return this.requestPromise(localVarRequestOptions); }); } /** * Read any Kubernetes resource. * @param spec Kubernetes resource spec * @param pretty If \'true\', then the output is pretty printed. * @param exact Should the export be exact. Exact export maintains cluster-specific fields like * \'Namespace\'. Deprecated. Planned for removal in 1.18. * @param exportt Should this value be exported. Export strips fields that a user can not * specify. Deprecated. Planned for removal in 1.18. * @param options Optional headers to use in the request. * @return Promise containing the request response and [[KubernetesObject]]. */ read(spec, pretty, exact, exportt, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // verify required parameter 'spec' is not null or undefined if (spec === null || spec === undefined) { throw new Error('Required parameter spec was null or undefined when calling read.'); } const localVarPath = yield this.specUriPath(spec, 'read'); const localVarQueryParameters = {}; const localVarHeaderParams = this.generateHeaders(options.headers); if (pretty !== undefined) { localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string'); } if (exact !== undefined) { localVarQueryParameters.exact = api_1.ObjectSerializer.serialize(exact, 'boolean'); } if (exportt !== undefined) { localVarQueryParameters.export = api_1.ObjectSerializer.serialize(exportt, 'boolean'); } const localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; return this.requestPromise(localVarRequestOptions); }); } /** * Replace any Kubernetes resource. * @param spec Kubernetes resource spec * @param pretty If \'true\', then the output is pretty printed. * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized * dryRun directive will result in an error response and no further processing of the request. Valid values * are: - All: all dry run stages will be processed * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The * value must be less than or 128 characters long, and only contain printable characters, as defined by * https://golang.org/pkg/unicode/#IsPrint. * @param options Optional headers to use in the request. * @return Promise containing the request response and [[KubernetesObject]]. */ replace(spec, pretty, dryRun, fieldManager, options = { headers: {} }) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // verify required parameter 'spec' is not null or undefined if (spec === null || spec === undefined) { throw new Error('Required parameter spec was null or undefined when calling replace.'); } const localVarPath = yield this.specUriPath(spec, 'replace'); const localVarQueryParameters = {}; const localVarHeaderParams = this.generateHeaders(options.headers); if (pretty !== undefined) { localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string'); } if (dryRun !== undefined) { localVarQueryParameters.dryRun = api_1.ObjectSerializer.serialize(dryRun, 'string'); } if (fieldManager !== undefined) { localVarQueryParameters.fieldManager = api_1.ObjectSerializer.serialize(fieldManager, 'string'); } const localVarRequestOptions = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: api_1.ObjectSerializer.serialize(spec, 'KubernetesObject'), }; return this.requestPromise(localVarRequestOptions); }); } /** Set default namespace from current context, if available. */ setDefaultNamespace(kc) { if (kc.currentContext) { const currentContext = kc.getContextObject(kc.currentContext); if (currentContext && currentContext.namespace) { this.defaultNamespace = currentContext.namespace; } } return this.defaultNamespace; } /** * Use spec information to construct resource URI path. If any required information in not provided, an Error is * thrown. If an `apiVersion` is not provided, 'v1' is used. If a `metadata.namespace` is not provided for a * request that requires one, the context default is used, if available, if not, 'default' is used. * * @param spec Kubernetes resource spec which must define kind and apiVersion properties. * @param action API action, see [[K8sApiAction]]. * @return tail of resource-specific URI */ specUriPath(spec, action) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (!spec.kind) { throw new Error('Required spec property kind is not set'); } if (!spec.apiVersion) { spec.apiVersion = 'v1'; } if (!spec.metadata) { spec.metadata = {}; } const resource = yield this.resource(spec.apiVersion, spec.kind); if (!resource) { throw new Error(`Unrecognized API version and kind: ${spec.apiVersion} ${spec.kind}`); } if (resource.namespaced && !spec.metadata.namespace) { spec.metadata.namespace = this.defaultNamespace; } const parts = [this.apiVersionPath(spec.apiVersion)]; if (resource.namespaced && spec.metadata.namespace) { parts.push('namespaces', encodeURIComponent(String(spec.metadata.namespace))); } parts.push(resource.name); if (action !== 'create') { if (!spec.metadata.name) { throw new Error('Required spec property name is not set'); } parts.push(encodeURIComponent(String(spec.metadata.name))); } return parts.join('/').toLowerCase(); }); } /** Return root of API path up to API version. */ apiVersionPath(apiVersion) { const api = apiVersion.includes('/') ? 'apis' : 'api'; return [this.basePath, api, apiVersion].join('/'); } /** * Merge default headers and provided headers, setting the 'Accept' header to 'application/json' and, if the * `action` is 'PATCH', the 'Content-Type' header to [[KubernetesPatchStrategies.StrategicMergePatch]]. Both of * these defaults can be overriden by values provided in `optionsHeaders`. * * @param optionHeaders Headers from method's options argument. * @param action HTTP action headers are being generated for. * @return Headers to use in request. */ generateHeaders(optionsHeaders, action = 'GET') { const headers = Object.assign({}, this._defaultHeaders); headers.accept = 'application/json'; if (action === 'PATCH') { headers['content-type'] = KubernetesPatchStrategies.StrategicMergePatch; } Object.assign(headers, optionsHeaders); return headers; } /** * Get metadata from Kubernetes API for resources described by `kind` and `apiVersion`. If it is unable to find the * resource `kind` under the provided `apiVersion`, `undefined` is returned. * * This method caches responses from the Kubernetes API to use for future requests. If the cache for apiVersion * exists but the kind is not found the request is attempted again. * * @param apiVersion Kubernetes API version, e.g., 'v1' or 'apps/v1'. * @param kind Kubernetes resource kind, e.g., 'Pod' or 'Namespace'. * @return Promise of the resource metadata or `undefined` if the resource is not found. */ resource(apiVersion, kind) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // verify required parameter 'apiVersion' is not null or undefined if (apiVersion === null || apiVersion === undefined) { throw new Error('Required parameter apiVersion was null or undefined when calling resource'); } // verify required parameter 'kind' is not null or undefined if (kind === null || kind === undefined) { throw new Error('Required parameter kind was null or undefined when calling resource'); } if (this.apiVersionResourceCache[apiVersion]) { const resource = this.apiVersionResourceCache[apiVersion].resources.find((r) => r.kind === kind); if (resource) { return resource; } } const localVarPath = this.apiVersionPath(apiVersion); const localVarQueryParameters = {}; const localVarHeaderParams = this.generateHeaders({}); const localVarRequestOptions = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; try { const getApiResponse = yield this.requestPromise(localVarRequestOptions, 'V1APIResourceList'); this.apiVersionResourceCache[apiVersion] = getApiResponse.body; return this.apiVersionResourceCache[apiVersion].resources.find((r) => r.kind === kind); } catch (e) { e.message = `Failed to fetch resource metadata for ${apiVersion}/${kind}: ${e.message}`; throw e; } }); } /** * Standard Kubernetes request wrapped in a Promise. */ requestPromise(requestOptions, tipe = 'KubernetesObject') { return tslib_1.__awaiter(this, void 0, void 0, function* () { let authenticationPromise = Promise.resolve(); if (this.authentications.BearerToken.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(requestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(requestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(requestOptions)); } yield interceptorPromise; return new Promise((resolve, reject) => { request(requestOptions, (error, response, body) => { if (error) { reject(error); } else { body = api_1.ObjectSerializer.deserialize(body, tipe); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response, body }); } else { reject(new api_1.HttpError(response, body, response.statusCode)); } } }); }); }); } } exports.KubernetesObjectApi = KubernetesObjectApi; //# sourceMappingURL=object.js.map /***/ }), /***/ 41691: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OpenIDConnectAuth = void 0; const tslib_1 = __webpack_require__(75636); const openid_client_1 = __webpack_require__(22881); const rfc4648_1 = __webpack_require__(3487); const util_1 = __webpack_require__(31669); class OpenIDConnectAuth { constructor() { // public for testing purposes. this.currentTokenExpiration = 0; } static decodeJWT(token) { const parts = token.split('.'); if (parts.length !== 3) { return null; } const header = JSON.parse(new util_1.TextDecoder().decode(rfc4648_1.base64url.parse(parts[0], { loose: true }))); const payload = JSON.parse(new util_1.TextDecoder().decode(rfc4648_1.base64url.parse(parts[1], { loose: true }))); const signature = parts[2]; return { header, payload, signature, }; } static expirationFromToken(token) { const jwt = OpenIDConnectAuth.decodeJWT(token); if (!jwt) { return 0; } return jwt.payload.exp; } isAuthProvider(user) { if (!user.authProvider) { return false; } return user.authProvider.name === 'oidc'; } /** * Setup the authentication header for oidc authed clients * @param user user info * @param opts request options * @param overrideClient for testing, a preconfigured oidc client */ applyAuthentication(user, opts, overrideClient) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const token = yield this.getToken(user, overrideClient); if (token) { opts.headers.Authorization = `Bearer ${token}`; } }); } getToken(user, overrideClient) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (!user.authProvider.config) { return null; } if (!user.authProvider.config['client-secret']) { user.authProvider.config['client-secret'] = ''; } if (!user.authProvider.config || !user.authProvider.config['id-token']) { return null; } return this.refresh(user, overrideClient); }); } refresh(user, overrideClient) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (this.currentTokenExpiration === 0) { this.currentTokenExpiration = OpenIDConnectAuth.expirationFromToken(user.authProvider.config['id-token']); } if (Date.now() / 1000 > this.currentTokenExpiration) { if (!user.authProvider.config['client-id'] || !user.authProvider.config['refresh-token'] || !user.authProvider.config['idp-issuer-url']) { return null; } const client = overrideClient ? overrideClient : yield this.getClient(user); const newToken = yield client.refresh(user.authProvider.config['refresh-token']); user.authProvider.config['id-token'] = newToken.id_token; user.authProvider.config['refresh-token'] = newToken.refresh_token; this.currentTokenExpiration = newToken.expires_at || 0; } return user.authProvider.config['id-token']; }); } getClient(user) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const oidcIssuer = yield openid_client_1.Issuer.discover(user.authProvider.config['idp-issuer-url']); return new oidcIssuer.Client({ client_id: user.authProvider.config['client-id'], client_secret: user.authProvider.config['client-secret'], }); }); } } exports.OpenIDConnectAuth = OpenIDConnectAuth; //# sourceMappingURL=oidc_auth.js.map /***/ }), /***/ 91188: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PatchUtils = void 0; class PatchUtils { } exports.PatchUtils = PatchUtils; PatchUtils.PATCH_FORMAT_JSON_PATCH = 'application/json-patch+json'; PatchUtils.PATCH_FORMAT_JSON_MERGE_PATCH = 'application/merge-patch+json'; PatchUtils.PATCH_FORMAT_STRATEGIC_MERGE_PATCH = 'application/strategic-merge-patch+json'; PatchUtils.PATCH_FORMAT_APPLY_YAML = 'application/apply-patch+yaml'; //# sourceMappingURL=patch.js.map /***/ }), /***/ 32390: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PortForward = void 0; const tslib_1 = __webpack_require__(75636); const querystring = __webpack_require__(71191); const util_1 = __webpack_require__(31669); const web_socket_handler_1 = __webpack_require__(47581); class PortForward { // handler is a parameter really only for injecting for testing. constructor(config, disconnectOnErr, handler) { this.handler = handler || new web_socket_handler_1.WebSocketHandler(config); this.disconnectOnErr = util_1.isUndefined(disconnectOnErr) ? true : disconnectOnErr; } // TODO: support multiple ports for real... portForward(namespace, podName, targetPorts, output, err, input, retryCount = 0) { return tslib_1.__awaiter(this, void 0, void 0, function* () { if (targetPorts.length === 0) { throw new Error('You must provide at least one port to forward to.'); } if (targetPorts.length > 1) { throw new Error('Only one port is currently supported for port-forward'); } const query = { ports: targetPorts[0], }; const queryStr = querystring.stringify(query); const needsToReadPortNumber = []; targetPorts.forEach((value, index) => { needsToReadPortNumber[index * 2] = true; needsToReadPortNumber[index * 2 + 1] = true; }); const path = `/api/v1/namespaces/${namespace}/pods/${podName}/portforward?${queryStr}`; const createWebSocket = () => { return this.handler.connect(path, null, (streamNum, buff) => { if (streamNum >= targetPorts.length * 2) { return !this.disconnectOnErr; } // First two bytes of each stream are the port number if (needsToReadPortNumber[streamNum]) { buff = buff.slice(2); needsToReadPortNumber[streamNum] = false; } if (streamNum % 2 === 1) { if (err) { err.write(buff); } } else { output.write(buff); } return true; }); }; if (retryCount < 1) { const ws = yield createWebSocket(); web_socket_handler_1.WebSocketHandler.handleStandardInput(ws, input, 0); return ws; } return web_socket_handler_1.WebSocketHandler.restartableHandleStandardInput(createWebSocket, input, 0, retryCount); }); } } exports.PortForward = PortForward; //# sourceMappingURL=portforward.js.map /***/ }), /***/ 76023: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isResizable = exports.TerminalSizeQueue = void 0; const stream_1 = __webpack_require__(92413); class TerminalSizeQueue extends stream_1.Readable { constructor(opts = {}) { super(Object.assign(Object.assign({}, opts), { // tslint:disable-next-line:no-empty read() { } })); } handleResizes(writeStream) { // Set initial size this.resize(getTerminalSize(writeStream)); // Handle future size updates writeStream.on('resize', () => this.resize(getTerminalSize(writeStream))); } resize(size) { this.push(JSON.stringify(size)); } } exports.TerminalSizeQueue = TerminalSizeQueue; function isResizable(stream) { if (stream == null) { return false; } const hasRows = 'rows' in stream; const hasColumns = 'columns' in stream; const hasOn = typeof stream.on === 'function'; return hasRows && hasColumns && hasOn; } exports.isResizable = isResizable; function getTerminalSize(writeStream) { return { height: writeStream.rows, width: writeStream.columns }; } //# sourceMappingURL=terminal-size-queue.js.map /***/ }), /***/ 23091: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.topNodes = exports.NodeStatus = exports.ResourceUsage = void 0; const tslib_1 = __webpack_require__(75636); const util_1 = __webpack_require__(26318); class ResourceUsage { constructor(Capacity, RequestTotal, LimitTotal) { this.Capacity = Capacity; this.RequestTotal = RequestTotal; this.LimitTotal = LimitTotal; } } exports.ResourceUsage = ResourceUsage; class NodeStatus { constructor(Node, CPU, Memory) { this.Node = Node; this.CPU = CPU; this.Memory = Memory; } } exports.NodeStatus = NodeStatus; function topNodes(api) { return tslib_1.__awaiter(this, void 0, void 0, function* () { // TODO: Support metrics APIs in the client and this library const nodes = yield api.listNode(); const result = []; for (const node of nodes.body.items) { const availableCPU = util_1.quantityToScalar(node.status.allocatable.cpu); const availableMem = util_1.quantityToScalar(node.status.allocatable.memory); let totalPodCPU = 0; let totalPodCPULimit = 0; let totalPodMem = 0; let totalPodMemLimit = 0; let pods = yield util_1.podsForNode(api, node.metadata.name); pods = pods.filter((pod) => pod.status.phase === 'Running'); pods.forEach((pod) => { const cpuTotal = util_1.totalCPU(pod); totalPodCPU += cpuTotal.request; totalPodCPULimit += cpuTotal.limit; const memTotal = util_1.totalMemory(pod); totalPodMem += memTotal.request; totalPodMemLimit += memTotal.limit; }); const cpuUsage = new ResourceUsage(availableCPU, totalPodCPU, totalPodCPULimit); const memUsage = new ResourceUsage(availableMem, totalPodMem, totalPodMemLimit); result.push(new NodeStatus(node, cpuUsage, memUsage)); } return result; }); } exports.topNodes = topNodes; //# sourceMappingURL=top.js.map /***/ }), /***/ 74949: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); //# sourceMappingURL=types.js.map /***/ }), /***/ 26318: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.totalForResource = exports.totalMemory = exports.totalCPU = exports.ResourceStatus = exports.quantityToScalar = exports.podsForNode = void 0; const tslib_1 = __webpack_require__(75636); function podsForNode(api, nodeName) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const allPods = yield api.listPodForAllNamespaces(); return allPods.body.items.filter((pod) => pod.spec.nodeName === nodeName); }); } exports.podsForNode = podsForNode; function quantityToScalar(quantity) { if (!quantity) { return 0; } if (quantity.endsWith('m')) { return parseInt(quantity.substr(0, quantity.length - 1), 10) / 1000.0; } if (quantity.endsWith('Ki')) { return parseInt(quantity.substr(0, quantity.length - 2), 10) * 1024; } const num = parseInt(quantity, 10); if (isNaN(num)) { throw new Error('Unknown quantity ' + quantity); } return num; } exports.quantityToScalar = quantityToScalar; class ResourceStatus { constructor(request, limit, resourceType) { this.request = request; this.limit = limit; this.resourceType = resourceType; } } exports.ResourceStatus = ResourceStatus; function totalCPU(pod) { return totalForResource(pod, 'cpu'); } exports.totalCPU = totalCPU; function totalMemory(pod) { return totalForResource(pod, 'memory'); } exports.totalMemory = totalMemory; function totalForResource(pod, resource) { let reqTotal = 0; let limitTotal = 0; pod.spec.containers.forEach((container) => { if (container.resources) { if (container.resources.requests) { reqTotal += quantityToScalar(container.resources.requests[resource]); } if (container.resources.limits) { limitTotal += quantityToScalar(container.resources.limits[resource]); } } }); return new ResourceStatus(reqTotal, limitTotal, resource); } exports.totalForResource = totalForResource; //# sourceMappingURL=util.js.map /***/ }), /***/ 7633: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Watch = exports.DefaultRequest = void 0; const tslib_1 = __webpack_require__(75636); const byline = __webpack_require__(29700); const request = __webpack_require__(48699); class DefaultRequest { constructor(requestImpl) { this.requestImpl = requestImpl ? requestImpl : request; } // Using request lib can be confusing when combining Stream- with Callback- // style API. We avoid the callback and handle HTTP response errors, that // would otherwise require a different error handling, in a transparent way // to the user (see github issue request/request#647 for more info). webRequest(opts) { const req = this.requestImpl(opts); // pause the stream until we get a response not to miss any bytes req.pause(); req.on('response', (resp) => { if (resp.statusCode === 200) { req.resume(); } else { req.emit('error', new Error(resp.statusMessage)); } }); return req; } } exports.DefaultRequest = DefaultRequest; class Watch { constructor(config, requestImpl) { this.config = config; if (requestImpl) { this.requestImpl = requestImpl; } else { this.requestImpl = new DefaultRequest(); } } // Watch the resource and call provided callback with parsed json object // upon event received over the watcher connection. // // "done" callback is called either when connection is closed or when there // is an error. In either case, watcher takes care of properly closing the // underlaying connection so that it doesn't leak any resources. watch(path, queryParams, callback, done) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const cluster = this.config.getCurrentCluster(); if (!cluster) { throw new Error('No currently active cluster'); } const url = cluster.server + path; queryParams.watch = true; const headerParams = {}; const requestOptions = { method: 'GET', qs: queryParams, headers: headerParams, uri: url, useQuerystring: true, json: true, pool: false, }; yield this.config.applyToRequest(requestOptions); let req; let doneCalled = false; const doneCallOnce = (err) => { if (!doneCalled) { req.abort(); doneCalled = true; done(err); } }; req = this.requestImpl.webRequest(requestOptions); const stream = byline.createStream(); req.on('error', doneCallOnce); req.on('socket', (socket) => { socket.setTimeout(30000); socket.setKeepAlive(true, 30000); }); stream.on('error', doneCallOnce); stream.on('close', () => doneCallOnce(null)); stream.on('data', (line) => { try { const data = JSON.parse(line); callback(data.type, data.object, data); } catch (ignore) { // ignore parse errors } }); req.pipe(stream); return req; }); } } exports.Watch = Watch; Watch.SERVER_SIDE_CLOSE = { error: 'Connection closed on server' }; //# sourceMappingURL=watch.js.map /***/ }), /***/ 47581: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.WebSocketHandler = void 0; const tslib_1 = __webpack_require__(75636); const WebSocket = __webpack_require__(64713); const protocols = ['v4.channel.k8s.io', 'v3.channel.k8s.io', 'v2.channel.k8s.io', 'channel.k8s.io']; class WebSocketHandler { // factory is really just for test injection constructor(config, socketFactory) { this.config = config; this.socketFactory = socketFactory; } static handleStandardStreams(streamNum, buff, stdout, stderr) { if (buff.length < 1) { return null; } if (stdout && streamNum === WebSocketHandler.StdoutStream) { stdout.write(buff); } else if (stderr && streamNum === WebSocketHandler.StderrStream) { stderr.write(buff); } else if (streamNum === WebSocketHandler.StatusStream) { // stream closing. if (stdout && stdout !== process.stdout) { stdout.end(); } if (stderr && stderr !== process.stderr) { stderr.end(); } return JSON.parse(buff.toString('utf8')); } else { throw new Error('Unknown stream: ' + streamNum); } return null; } static handleStandardInput(ws, stdin, streamNum = 0) { stdin.on('data', (data) => { const buff = Buffer.alloc(data.length + 1); buff.writeInt8(streamNum, 0); if (data instanceof Buffer) { data.copy(buff, 1); } else { buff.write(data, 1); } ws.send(buff); }); stdin.on('end', () => { ws.close(); }); // Keep the stream open return true; } static processData(data, ws, createWS, streamNum = 0, retryCount = 3) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const buff = Buffer.alloc(data.length + 1); buff.writeInt8(streamNum, 0); if (data instanceof Buffer) { data.copy(buff, 1); } else { buff.write(data, 1); } let i = 0; for (; i < retryCount; ++i) { if (ws !== null && ws.readyState === WebSocket.OPEN) { ws.send(buff); break; } else { ws = yield createWS(); } } // This throw doesn't go anywhere. // TODO: Figure out the right way to return an error. if (i >= retryCount) { throw new Error("can't send data to ws"); } return ws; }); } static restartableHandleStandardInput(createWS, stdin, streamNum = 0, retryCount = 3) { if (retryCount < 0) { throw new Error("retryCount can't be lower than 0."); } let queue = Promise.resolve(); let ws = null; stdin.on('data', (data) => { queue = queue.then(() => tslib_1.__awaiter(this, void 0, void 0, function* () { ws = yield WebSocketHandler.processData(data, ws, createWS, streamNum, retryCount); })); }); stdin.on('end', () => { if (ws) { ws.close(); } }); return () => ws; } /** * Connect to a web socket endpoint. * @param path The HTTP Path to connect to on the server. * @param textHandler Callback for text over the web socket. * Returns true if the connection should be kept alive, false to disconnect. * @param binaryHandler Callback for binary data over the web socket. * Returns true if the connection should be kept alive, false to disconnect. */ connect(path, textHandler, binaryHandler) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const cluster = this.config.getCurrentCluster(); if (!cluster) { throw new Error('No cluster is defined.'); } const server = cluster.server; const ssl = server.startsWith('https://'); const target = ssl ? server.substr(8) : server.substr(7); const proto = ssl ? 'wss' : 'ws'; const uri = `${proto}://${target}${path}`; const opts = {}; yield this.config.applytoHTTPSOptions(opts); return yield new Promise((resolve, reject) => { const client = this.socketFactory ? this.socketFactory(uri, opts) : new WebSocket(uri, protocols, opts); let resolved = false; client.onopen = () => { resolved = true; resolve(client); }; client.onerror = (err) => { if (!resolved) { reject(err); } }; client.onmessage = ({ data }) => { // TODO: support ArrayBuffer and Buffer[] data types? if (typeof data === 'string') { if (textHandler && !textHandler(data)) { client.close(); } } else if (data instanceof Buffer) { const streamNum = data.readInt8(0); if (binaryHandler && !binaryHandler(streamNum, data.slice(1))) { client.close(); } } }; }); }); } } exports.WebSocketHandler = WebSocketHandler; WebSocketHandler.StdinStream = 0; WebSocketHandler.StdoutStream = 1; WebSocketHandler.StderrStream = 2; WebSocketHandler.StatusStream = 3; WebSocketHandler.ResizeStream = 4; //# sourceMappingURL=web-socket-handler.js.map /***/ }), /***/ 18122: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.dumpYaml = exports.loadAllYaml = exports.loadYaml = void 0; const yaml = __webpack_require__(98286); function loadYaml(data, opts) { return yaml.safeLoad(data, opts); } exports.loadYaml = loadYaml; function loadAllYaml(data, opts) { return yaml.safeLoadAll(data, undefined, opts); } exports.loadAllYaml = loadAllYaml; function dumpYaml(object, opts) { return yaml.safeDump(object, opts); } exports.dumpYaml = dumpYaml; //# sourceMappingURL=yaml.js.map /***/ }), /***/ 35132: /***/ ((module) => { const CODES = { JOSEAlgNotWhitelisted: 'ERR_JOSE_ALG_NOT_WHITELISTED', JOSECritNotUnderstood: 'ERR_JOSE_CRIT_NOT_UNDERSTOOD', JOSEInvalidEncoding: 'ERR_JOSE_INVALID_ENCODING', JOSEMultiError: 'ERR_JOSE_MULTIPLE_ERRORS', JOSENotSupported: 'ERR_JOSE_NOT_SUPPORTED', JWEDecryptionFailed: 'ERR_JWE_DECRYPTION_FAILED', JWEInvalid: 'ERR_JWE_INVALID', JWKImportFailed: 'ERR_JWK_IMPORT_FAILED', JWKInvalid: 'ERR_JWK_INVALID', JWKKeySupport: 'ERR_JWK_KEY_SUPPORT', JWKSNoMatchingKey: 'ERR_JWKS_NO_MATCHING_KEY', JWSInvalid: 'ERR_JWS_INVALID', JWSVerificationFailed: 'ERR_JWS_VERIFICATION_FAILED', JWTClaimInvalid: 'ERR_JWT_CLAIM_INVALID', JWTExpired: 'ERR_JWT_EXPIRED', JWTMalformed: 'ERR_JWT_MALFORMED' } const DEFAULT_MESSAGES = { JWEDecryptionFailed: 'decryption operation failed', JWEInvalid: 'JWE invalid', JWKSNoMatchingKey: 'no matching key found in the KeyStore', JWSInvalid: 'JWS invalid', JWSVerificationFailed: 'signature verification failed' } class JOSEError extends Error { constructor (message) { super(message) if (message === undefined) { this.message = DEFAULT_MESSAGES[this.constructor.name] } this.name = this.constructor.name this.code = CODES[this.constructor.name] Error.captureStackTrace(this, this.constructor) } } const isMulti = e => e instanceof JOSEMultiError class JOSEMultiError extends JOSEError { constructor (errors) { super() let i while ((i = errors.findIndex(isMulti)) && i !== -1) { errors.splice(i, 1, ...errors[i]) } Object.defineProperty(this, 'errors', { value: errors }) } * [Symbol.iterator] () { for (const error of this.errors) { yield error } } } module.exports.JOSEError = JOSEError module.exports.JOSEAlgNotWhitelisted = class JOSEAlgNotWhitelisted extends JOSEError {} module.exports.JOSECritNotUnderstood = class JOSECritNotUnderstood extends JOSEError {} module.exports.JOSEInvalidEncoding = class JOSEInvalidEncoding extends JOSEError {} module.exports.JOSEMultiError = JOSEMultiError module.exports.JOSENotSupported = class JOSENotSupported extends JOSEError {} module.exports.JWEDecryptionFailed = class JWEDecryptionFailed extends JOSEError {} module.exports.JWEInvalid = class JWEInvalid extends JOSEError {} module.exports.JWKImportFailed = class JWKImportFailed extends JOSEError {} module.exports.JWKInvalid = class JWKInvalid extends JOSEError {} module.exports.JWKKeySupport = class JWKKeySupport extends JOSEError {} module.exports.JWKSNoMatchingKey = class JWKSNoMatchingKey extends JOSEError {} module.exports.JWSInvalid = class JWSInvalid extends JOSEError {} module.exports.JWSVerificationFailed = class JWSVerificationFailed extends JOSEError {} class JWTClaimInvalid extends JOSEError { constructor (message, claim = 'unspecified', reason = 'unspecified') { super(message) this.claim = claim this.reason = reason } } module.exports.JWTClaimInvalid = JWTClaimInvalid module.exports.JWTExpired = class JWTExpired extends JWTClaimInvalid {} module.exports.JWTMalformed = class JWTMalformed extends JOSEError {} /***/ }), /***/ 3006: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const oids = __webpack_require__(33875) module.exports = function () { this.seq().obj( this.key('algorithm').objid(oids), this.key('parameters').optional().choice({ namedCurve: this.objid(oids), null: this.null_() }) ) } /***/ }), /***/ 19377: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const oids = __webpack_require__(33875) module.exports = function () { this.seq().obj( this.key('version').int(), this.key('privateKey').octstr(), this.key('parameters').explicit(0).optional().choice({ namedCurve: this.objid(oids) }), this.key('publicKey').explicit(1).optional().bitstr() ) } /***/ }), /***/ 77456: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const asn1 = __webpack_require__(39436) const types = new Map() const AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', __webpack_require__(3006)) types.set('AlgorithmIdentifier', AlgorithmIdentifier) const ECPrivateKey = asn1.define('ECPrivateKey', __webpack_require__(19377)) types.set('ECPrivateKey', ECPrivateKey) const PrivateKeyInfo = asn1.define('PrivateKeyInfo', __webpack_require__(37542)(AlgorithmIdentifier)) types.set('PrivateKeyInfo', PrivateKeyInfo) const PublicKeyInfo = asn1.define('PublicKeyInfo', __webpack_require__(26331)(AlgorithmIdentifier)) types.set('PublicKeyInfo', PublicKeyInfo) const PrivateKey = asn1.define('PrivateKey', __webpack_require__(10815)) types.set('PrivateKey', PrivateKey) const OneAsymmetricKey = asn1.define('OneAsymmetricKey', __webpack_require__(64800)(AlgorithmIdentifier, PrivateKey)) types.set('OneAsymmetricKey', OneAsymmetricKey) const RSAPrivateKey = asn1.define('RSAPrivateKey', __webpack_require__(83407)) types.set('RSAPrivateKey', RSAPrivateKey) const RSAPublicKey = asn1.define('RSAPublicKey', __webpack_require__(457)) types.set('RSAPublicKey', RSAPublicKey) module.exports = types /***/ }), /***/ 33875: /***/ ((module) => { const oids = { '1 2 840 10045 3 1 7': 'P-256', '1 3 132 0 10': 'secp256k1', '1 3 132 0 34': 'P-384', '1 3 132 0 35': 'P-521', '1 2 840 10045 2 1': 'ecPublicKey', '1 2 840 113549 1 1 1': 'rsaEncryption', '1 3 101 110': 'X25519', '1 3 101 111': 'X448', '1 3 101 112': 'Ed25519', '1 3 101 113': 'Ed448' } module.exports = oids /***/ }), /***/ 64800: /***/ ((module) => { module.exports = (AlgorithmIdentifier, PrivateKey) => function () { this.seq().obj( this.key('version').int(), this.key('algorithm').use(AlgorithmIdentifier), this.key('privateKey').use(PrivateKey) ) } /***/ }), /***/ 10815: /***/ ((module) => { module.exports = function () { this.octstr().contains().obj( this.key('privateKey').octstr() ) } /***/ }), /***/ 37542: /***/ ((module) => { module.exports = (AlgorithmIdentifier) => function () { this.seq().obj( this.key('version').int(), this.key('algorithm').use(AlgorithmIdentifier), this.key('privateKey').octstr() ) } /***/ }), /***/ 26331: /***/ ((module) => { module.exports = AlgorithmIdentifier => function () { this.seq().obj( this.key('algorithm').use(AlgorithmIdentifier), this.key('publicKey').bitstr() ) } /***/ }), /***/ 83407: /***/ ((module) => { module.exports = function () { this.seq().obj( this.key('version').int({ 0: 'two-prime', 1: 'multi' }), this.key('n').int(), this.key('e').int(), this.key('d').int(), this.key('p').int(), this.key('q').int(), this.key('dp').int(), this.key('dq').int(), this.key('qi').int() ) } /***/ }), /***/ 457: /***/ ((module) => { module.exports = function () { this.seq().obj( this.key('n').int(), this.key('e').int() ) } /***/ }), /***/ 93312: /***/ ((module) => { let encode let encodeBuffer if (Buffer.isEncoding('base64url')) { encode = (input, encoding = 'utf8') => Buffer.from(input, encoding).toString('base64url') encodeBuffer = (buf) => buf.toString('base64url') } else { const fromBase64 = (base64) => base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_') encode = (input, encoding = 'utf8') => fromBase64(Buffer.from(input, encoding).toString('base64')) encodeBuffer = (buf) => fromBase64(buf.toString('base64')) } const decodeToBuffer = (input) => { return Buffer.from(input, 'base64') } const decode = (input, encoding = 'utf8') => { return decodeToBuffer(input).toString(encoding) } const b64uJSON = { encode: (input) => { return encode(JSON.stringify(input)) }, decode: (input, encoding = 'utf8') => { return JSON.parse(decode(input, encoding)) } } b64uJSON.decode.try = (input, encoding = 'utf8') => { try { return b64uJSON.decode(input, encoding) } catch (err) { return decode(input, encoding) } } const bnToBuf = (bn) => { let hex = BigInt(bn).toString(16) if (hex.length % 2) { hex = `0${hex}` } const len = hex.length / 2 const u8 = new Uint8Array(len) let i = 0 let j = 0 while (i < len) { u8[i] = parseInt(hex.slice(j, j + 2), 16) i += 1 j += 2 } return u8 } const encodeBigInt = (bn) => encodeBuffer(Buffer.from(bnToBuf(bn))) module.exports.decode = decode module.exports.decodeToBuffer = decodeToBuffer module.exports.encode = encode module.exports.encodeBuffer = encodeBuffer module.exports.JSON = b64uJSON module.exports.encodeBigInt = encodeBigInt /***/ }), /***/ 62928: /***/ ((module) => { module.exports.KEYOBJECT = Symbol('KEYOBJECT') module.exports.PRIVATE_MEMBERS = Symbol('PRIVATE_MEMBERS') module.exports.PUBLIC_MEMBERS = Symbol('PUBLIC_MEMBERS') module.exports.THUMBPRINT_MATERIAL = Symbol('THUMBPRINT_MATERIAL') module.exports.JWK_MEMBERS = Symbol('JWK_MEMBERS') module.exports.KEY_MANAGEMENT_ENCRYPT = Symbol('KEY_MANAGEMENT_ENCRYPT') module.exports.KEY_MANAGEMENT_DECRYPT = Symbol('KEY_MANAGEMENT_DECRYPT') const USES_MAPPING = { sig: new Set(['sign', 'verify']), enc: new Set(['encrypt', 'decrypt', 'wrapKey', 'unwrapKey', 'deriveKey']) } const OPS = new Set([...USES_MAPPING.sig, ...USES_MAPPING.enc]) const USES = new Set(Object.keys(USES_MAPPING)) module.exports.USES_MAPPING = USES_MAPPING module.exports.OPS = OPS module.exports.USES = USES /***/ }), /***/ 52083: /***/ ((module) => { module.exports = obj => JSON.parse(JSON.stringify(obj)) /***/ }), /***/ 64575: /***/ ((module) => { const MAX_OCTET = 0x80 const CLASS_UNIVERSAL = 0 const PRIMITIVE_BIT = 0x20 const TAG_SEQ = 0x10 const TAG_INT = 0x02 const ENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6) const ENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6) const getParamSize = keySize => ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1) const paramBytesForAlg = { ES256: getParamSize(256), ES256K: getParamSize(256), ES384: getParamSize(384), ES512: getParamSize(521) } const countPadding = (buf, start, stop) => { let padding = 0 while (start + padding < stop && buf[start + padding] === 0) { ++padding } const needsSign = buf[start + padding] >= MAX_OCTET if (needsSign) { --padding } return padding } module.exports.derToJose = (signature, alg) => { if (!Buffer.isBuffer(signature)) { throw new TypeError('ECDSA signature must be a Buffer') } if (!paramBytesForAlg[alg]) { throw new Error(`Unknown algorithm "${alg}"`) } const paramBytes = paramBytesForAlg[alg] // the DER encoded param should at most be the param size, plus a padding // zero, since due to being a signed integer const maxEncodedParamLength = paramBytes + 1 const inputLength = signature.length let offset = 0 if (signature[offset++] !== ENCODED_TAG_SEQ) { throw new Error('Could not find expected "seq"') } let seqLength = signature[offset++] if (seqLength === (MAX_OCTET | 1)) { seqLength = signature[offset++] } if (inputLength - offset < seqLength) { throw new Error(`"seq" specified length of ${seqLength}", only ${inputLength - offset}" remaining`) } if (signature[offset++] !== ENCODED_TAG_INT) { throw new Error('Could not find expected "int" for "r"') } const rLength = signature[offset++] if (inputLength - offset - 2 < rLength) { throw new Error(`"r" specified length of "${rLength}", only "${inputLength - offset - 2}" available`) } if (maxEncodedParamLength < rLength) { throw new Error(`"r" specified length of "${rLength}", max of "${maxEncodedParamLength}" is acceptable`) } const rOffset = offset offset += rLength if (signature[offset++] !== ENCODED_TAG_INT) { throw new Error('Could not find expected "int" for "s"') } const sLength = signature[offset++] if (inputLength - offset !== sLength) { throw new Error(`"s" specified length of "${sLength}", expected "${inputLength - offset}"`) } if (maxEncodedParamLength < sLength) { throw new Error(`"s" specified length of "${sLength}", max of "${maxEncodedParamLength}" is acceptable`) } const sOffset = offset offset += sLength if (offset !== inputLength) { throw new Error(`Expected to consume entire buffer, but "${inputLength - offset}" bytes remain`) } const rPadding = paramBytes - rLength const sPadding = paramBytes - sLength const dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength) for (offset = 0; offset < rPadding; ++offset) { dst[offset] = 0 } signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength) offset = paramBytes for (const o = offset; offset < o + sPadding; ++offset) { dst[offset] = 0 } signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength) return dst } module.exports.joseToDer = (signature, alg) => { if (!Buffer.isBuffer(signature)) { throw new TypeError('ECDSA signature must be a Buffer') } if (!paramBytesForAlg[alg]) { throw new TypeError(`Unknown algorithm "${alg}"`) } const paramBytes = paramBytesForAlg[alg] const signatureBytes = signature.length if (signatureBytes !== paramBytes * 2) { throw new Error(`"${alg}" signatures must be "${paramBytes * 2}" bytes, saw "${signatureBytes}"`) } const rPadding = countPadding(signature, 0, paramBytes) const sPadding = countPadding(signature, paramBytes, signature.length) const rLength = paramBytes - rPadding const sLength = paramBytes - sPadding const rsBytes = 1 + 1 + rLength + 1 + 1 + sLength const shortLength = rsBytes < MAX_OCTET const dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes) let offset = 0 dst[offset++] = ENCODED_TAG_SEQ if (shortLength) { // Bit 8 has value "0" // bits 7-1 give the length. dst[offset++] = rsBytes } else { // Bit 8 of first octet has value "1" // bits 7-1 give the number of additional length octets. dst[offset++] = MAX_OCTET | 1 // eslint-disable-line no-tabs // length, base 256 dst[offset++] = rsBytes & 0xff } dst[offset++] = ENCODED_TAG_INT dst[offset++] = rLength if (rPadding < 0) { dst[offset++] = 0 offset += signature.copy(dst, offset, 0, paramBytes) } else { offset += signature.copy(dst, offset, rPadding, paramBytes) } dst[offset++] = ENCODED_TAG_INT dst[offset++] = sLength if (sPadding < 0) { dst[offset++] = 0 signature.copy(dst, offset, paramBytes) } else { signature.copy(dst, offset, paramBytes + sPadding) } return dst } /***/ }), /***/ 33773: /***/ ((module) => { module.exports = (date) => Math.floor(date.getTime() / 1000) /***/ }), /***/ 3796: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { randomBytes } = __webpack_require__(76417) const { IVLENGTHS } = __webpack_require__(47359) module.exports = alg => randomBytes(IVLENGTHS.get(alg) / 8) /***/ }), /***/ 7090: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const errors = __webpack_require__(35132) const Key = __webpack_require__(99795) const importKey = __webpack_require__(77722) const { KeyStore } = __webpack_require__(44201) module.exports = (input, keyStoreAllowed = false) => { if (input instanceof Key) { return input } if (input instanceof KeyStore) { if (!keyStoreAllowed) { throw new TypeError('key argument for this operation must not be a JWKS.KeyStore instance') } return input } try { return importKey(input) } catch (err) { if (err instanceof errors.JOSEError && !(err instanceof errors.JWKImportFailed)) { throw err } let msg if (keyStoreAllowed) { msg = 'key must be an instance of a key instantiated by JWK.asKey, a valid JWK.asKey input, or a JWKS.KeyStore instance' } else { msg = 'key must be an instance of a key instantiated by JWK.asKey, or a valid JWK.asKey input' } throw new TypeError(msg) } } /***/ }), /***/ 48899: /***/ ((module) => { module.exports = (a = {}, b = {}) => { const keysA = Object.keys(a) const keysB = new Set(Object.keys(b)) return !keysA.some((ka) => keysB.has(ka)) } /***/ }), /***/ 50243: /***/ ((module) => { module.exports = a => !!a && a.constructor === Object /***/ }), /***/ 31032: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { keyObjectSupported } = __webpack_require__(57494) let createPublicKey let createPrivateKey let createSecretKey let KeyObject let asInput if (keyObjectSupported) { ({ createPublicKey, createPrivateKey, createSecretKey, KeyObject } = __webpack_require__(76417)) asInput = (input) => input } else { const { EOL } = __webpack_require__(12087) const errors = __webpack_require__(35132) const isObject = __webpack_require__(50243) const asn1 = __webpack_require__(77456) const toInput = Symbol('toInput') const namedCurve = Symbol('namedCurve') asInput = (keyObject, needsPublic) => { if (keyObject instanceof KeyObject) { return keyObject[toInput](needsPublic) } return createSecretKey(keyObject)[toInput](needsPublic) } const pemToDer = pem => Buffer.from(pem.replace(/(?:-----(?:BEGIN|END)(?: (?:RSA|EC))? (?:PRIVATE|PUBLIC) KEY-----|\s)/g, ''), 'base64') const derToPem = (der, label) => `-----BEGIN ${label}-----${EOL}${(der.toString('base64').match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END ${label}-----` const unsupported = (input) => { const label = typeof input === 'string' ? input : `OID ${input.join('.')}` throw new errors.JOSENotSupported(`${label} is not supported in your Node.js runtime version`) } KeyObject = class KeyObject { export ({ cipher, passphrase, type, format } = {}) { if (this._type === 'secret') { return this._buffer } if (this._type === 'public') { if (this.asymmetricKeyType === 'rsa') { switch (type) { case 'pkcs1': if (format === 'pem') { return this._pem } return pemToDer(this._pem) case 'spki': { const PublicKeyInfo = asn1.get('PublicKeyInfo') const pem = PublicKeyInfo.encode({ algorithm: { algorithm: 'rsaEncryption', parameters: { type: 'null' } }, publicKey: { unused: 0, data: pemToDer(this._pem) } }, 'pem', { label: 'PUBLIC KEY' }) return format === 'pem' ? pem : pemToDer(pem) } default: throw new TypeError(`The value ${type} is invalid for option "type"`) } } if (this.asymmetricKeyType === 'ec') { if (type !== 'spki') { throw new TypeError(`The value ${type} is invalid for option "type"`) } if (format === 'pem') { return this._pem } return pemToDer(this._pem) } } if (this._type === 'private') { if (passphrase !== undefined || cipher !== undefined) { throw new errors.JOSENotSupported('encrypted private keys are not supported in your Node.js runtime version') } if (type === 'pkcs8') { if (this._pkcs8) { if (format === 'der' && typeof this._pkcs8 === 'string') { return pemToDer(this._pkcs8) } if (format === 'pem' && Buffer.isBuffer(this._pkcs8)) { return derToPem(this._pkcs8, 'PRIVATE KEY') } return this._pkcs8 } if (this.asymmetricKeyType === 'rsa') { const parsed = this._asn1 const RSAPrivateKey = asn1.get('RSAPrivateKey') const privateKey = RSAPrivateKey.encode(parsed) const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const pkcs8 = PrivateKeyInfo.encode({ version: 0, privateKey, algorithm: { algorithm: 'rsaEncryption', parameters: { type: 'null' } } }) this._pkcs8 = pkcs8 return this.export({ type, format }) } if (this.asymmetricKeyType === 'ec') { const parsed = this._asn1 const ECPrivateKey = asn1.get('ECPrivateKey') const privateKey = ECPrivateKey.encode({ version: parsed.version, privateKey: parsed.privateKey, publicKey: parsed.publicKey }) const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const pkcs8 = PrivateKeyInfo.encode({ version: 0, privateKey, algorithm: { algorithm: 'ecPublicKey', parameters: this._asn1.parameters } }) this._pkcs8 = pkcs8 return this.export({ type, format }) } } if (this.asymmetricKeyType === 'rsa' && type === 'pkcs1') { if (format === 'pem') { return this._pem } return pemToDer(this._pem) } else if (this.asymmetricKeyType === 'ec' && type === 'sec1') { if (format === 'pem') { return this._pem } return pemToDer(this._pem) } else { throw new TypeError(`The value ${type} is invalid for option "type"`) } } } get type () { return this._type } get asymmetricKeyType () { return this._asymmetricKeyType } get symmetricKeySize () { return this._symmetricKeySize } [toInput] (needsPublic) { switch (this._type) { case 'secret': return this._buffer case 'public': return this._pem default: if (needsPublic) { if (!('_pub' in this)) { this._pub = createPublicKey(this) } return this._pub[toInput](false) } return this._pem } } } createSecretKey = (buffer) => { if (!Buffer.isBuffer(buffer) || !buffer.length) { throw new TypeError('input must be a non-empty Buffer instance') } const keyObject = new KeyObject() keyObject._buffer = Buffer.from(buffer) keyObject._symmetricKeySize = buffer.length keyObject._type = 'secret' return keyObject } createPublicKey = (input) => { if (input instanceof KeyObject) { if (input.type !== 'private') { throw new TypeError(`Invalid key object type ${input.type}, expected private.`) } switch (input.asymmetricKeyType) { case 'ec': { const PublicKeyInfo = asn1.get('PublicKeyInfo') const key = PublicKeyInfo.encode({ algorithm: { algorithm: 'ecPublicKey', parameters: input._asn1.parameters }, publicKey: input._asn1.publicKey }) return createPublicKey({ key, format: 'der', type: 'spki' }) } case 'rsa': { const RSAPublicKey = asn1.get('RSAPublicKey') const key = RSAPublicKey.encode(input._asn1) return createPublicKey({ key, format: 'der', type: 'pkcs1' }) } } } if (typeof input === 'string' || Buffer.isBuffer(input)) { input = { key: input, format: 'pem' } } if (!isObject(input)) { throw new TypeError('input must be a string, Buffer or an object') } const { format, passphrase } = input let { key, type } = input if (typeof key !== 'string' && !Buffer.isBuffer(key)) { throw new TypeError('key must be a string or Buffer') } if (format !== 'pem' && format !== 'der') { throw new TypeError('format must be one of "pem" or "der"') } let label if (format === 'pem') { key = key.toString() switch (key.split(/\r?\n/g)[0].toString()) { case '-----BEGIN PUBLIC KEY-----': type = 'spki' label = 'PUBLIC KEY' break case '-----BEGIN RSA PUBLIC KEY-----': type = 'pkcs1' label = 'RSA PUBLIC KEY' break case '-----BEGIN CERTIFICATE-----': throw new errors.JOSENotSupported('X.509 certificates are not supported in your Node.js runtime version') case '-----BEGIN PRIVATE KEY-----': case '-----BEGIN EC PRIVATE KEY-----': case '-----BEGIN RSA PRIVATE KEY-----': return createPublicKey(createPrivateKey(key)) default: throw new TypeError('unknown/unsupported PEM type') } } switch (type) { case 'spki': { const PublicKeyInfo = asn1.get('PublicKeyInfo') const parsed = PublicKeyInfo.decode(key, format, { label }) let type, keyObject switch (parsed.algorithm.algorithm) { case 'ecPublicKey': { keyObject = new KeyObject() keyObject._asn1 = parsed keyObject._asymmetricKeyType = 'ec' keyObject._type = 'public' keyObject._pem = PublicKeyInfo.encode(parsed, 'pem', { label: 'PUBLIC KEY' }) break } case 'rsaEncryption': { type = 'pkcs1' keyObject = createPublicKey({ type, key: parsed.publicKey.data, format: 'der' }) break } default: unsupported(parsed.algorithm.algorithm) } return keyObject } case 'pkcs1': { const RSAPublicKey = asn1.get('RSAPublicKey') const parsed = RSAPublicKey.decode(key, format, { label }) // special case when private pkcs1 PEM / DER is used with createPublicKey if (parsed.n === BigInt(0)) { return createPublicKey(createPrivateKey({ key, format, type, passphrase })) } const keyObject = new KeyObject() keyObject._asn1 = parsed keyObject._asymmetricKeyType = 'rsa' keyObject._type = 'public' keyObject._pem = RSAPublicKey.encode(parsed, 'pem', { label: 'RSA PUBLIC KEY' }) return keyObject } case 'pkcs8': case 'sec1': return createPublicKey(createPrivateKey({ format, key, type, passphrase })) default: throw new TypeError(`The value ${type} is invalid for option "type"`) } } createPrivateKey = (input, hints) => { if (typeof input === 'string' || Buffer.isBuffer(input)) { input = { key: input, format: 'pem' } } if (!isObject(input)) { throw new TypeError('input must be a string, Buffer or an object') } const { format, passphrase } = input let { key, type } = input if (typeof key !== 'string' && !Buffer.isBuffer(key)) { throw new TypeError('key must be a string or Buffer') } if (passphrase !== undefined) { throw new errors.JOSENotSupported('encrypted private keys are not supported in your Node.js runtime version') } if (format !== 'pem' && format !== 'der') { throw new TypeError('format must be one of "pem" or "der"') } let label if (format === 'pem') { key = key.toString() switch (key.split(/\r?\n/g)[0].toString()) { case '-----BEGIN PRIVATE KEY-----': type = 'pkcs8' label = 'PRIVATE KEY' break case '-----BEGIN EC PRIVATE KEY-----': type = 'sec1' label = 'EC PRIVATE KEY' break case '-----BEGIN RSA PRIVATE KEY-----': type = 'pkcs1' label = 'RSA PRIVATE KEY' break default: throw new TypeError('unknown/unsupported PEM type') } } switch (type) { case 'pkcs8': { const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const parsed = PrivateKeyInfo.decode(key, format, { label }) let type, keyObject switch (parsed.algorithm.algorithm) { case 'ecPublicKey': { type = 'sec1' keyObject = createPrivateKey({ type, key: parsed.privateKey, format: 'der' }, { [namedCurve]: parsed.algorithm.parameters.value }) break } case 'rsaEncryption': { type = 'pkcs1' keyObject = createPrivateKey({ type, key: parsed.privateKey, format: 'der' }) break } default: unsupported(parsed.algorithm.algorithm) } keyObject._pkcs8 = key return keyObject } case 'pkcs1': { const RSAPrivateKey = asn1.get('RSAPrivateKey') const parsed = RSAPrivateKey.decode(key, format, { label }) const keyObject = new KeyObject() keyObject._asn1 = parsed keyObject._asymmetricKeyType = 'rsa' keyObject._type = 'private' keyObject._pem = RSAPrivateKey.encode(parsed, 'pem', { label: 'RSA PRIVATE KEY' }) return keyObject } case 'sec1': { const ECPrivateKey = asn1.get('ECPrivateKey') let parsed = ECPrivateKey.decode(key, format, { label }) if (!('parameters' in parsed) && !hints[namedCurve]) { throw new Error('invalid sec1') } else if (!('parameters' in parsed)) { parsed = { ...parsed, parameters: { type: 'namedCurve', value: hints[namedCurve] } } } const keyObject = new KeyObject() keyObject._asn1 = parsed keyObject._asymmetricKeyType = 'ec' keyObject._type = 'private' keyObject._pem = ECPrivateKey.encode(parsed, 'pem', { label: 'EC PRIVATE KEY' }) return keyObject } default: throw new TypeError(`The value ${type} is invalid for option "type"`) } } } module.exports = { createPublicKey, createPrivateKey, createSecretKey, KeyObject, asInput } /***/ }), /***/ 65394: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { EOL } = __webpack_require__(12087) const errors = __webpack_require__(35132) const { keyObjectSupported } = __webpack_require__(57494) const { createPublicKey } = __webpack_require__(31032) const base64url = __webpack_require__(93312) const asn1 = __webpack_require__(77456) const computePrimes = __webpack_require__(4438) const { OKP_CURVES, EC_CURVES } = __webpack_require__(47359) const formatPem = (base64pem, descriptor) => `-----BEGIN ${descriptor} KEY-----${EOL}${(base64pem.match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END ${descriptor} KEY-----` const okpToJWK = { private (crv, keyObject) { const der = keyObject.export({ type: 'pkcs8', format: 'der' }) const OneAsymmetricKey = asn1.get('OneAsymmetricKey') const { privateKey: { privateKey: d } } = OneAsymmetricKey.decode(der) return { ...okpToJWK.public(crv, createPublicKey(keyObject)), d: base64url.encodeBuffer(d) } }, public (crv, keyObject) { const der = keyObject.export({ type: 'spki', format: 'der' }) const PublicKeyInfo = asn1.get('PublicKeyInfo') const { publicKey: { data: x } } = PublicKeyInfo.decode(der) return { kty: 'OKP', crv, x: base64url.encodeBuffer(x) } } } const keyObjectToJWK = { rsa: { private (keyObject) { const der = keyObject.export({ type: 'pkcs8', format: 'der' }) const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const RSAPrivateKey = asn1.get('RSAPrivateKey') const { privateKey } = PrivateKeyInfo.decode(der) const { version, n, e, d, p, q, dp, dq, qi } = RSAPrivateKey.decode(privateKey) if (version !== 'two-prime') { throw new errors.JOSENotSupported('Private RSA keys with more than two primes are not supported') } return { kty: 'RSA', n: base64url.encodeBigInt(n), e: base64url.encodeBigInt(e), d: base64url.encodeBigInt(d), p: base64url.encodeBigInt(p), q: base64url.encodeBigInt(q), dp: base64url.encodeBigInt(dp), dq: base64url.encodeBigInt(dq), qi: base64url.encodeBigInt(qi) } }, public (keyObject) { const der = keyObject.export({ type: 'spki', format: 'der' }) const PublicKeyInfo = asn1.get('PublicKeyInfo') const RSAPublicKey = asn1.get('RSAPublicKey') const { publicKey: { data: publicKey } } = PublicKeyInfo.decode(der) const { n, e } = RSAPublicKey.decode(publicKey) return { kty: 'RSA', n: base64url.encodeBigInt(n), e: base64url.encodeBigInt(e) } } }, ec: { private (keyObject) { const der = keyObject.export({ type: 'pkcs8', format: 'der' }) const PrivateKeyInfo = asn1.get('PrivateKeyInfo') const ECPrivateKey = asn1.get('ECPrivateKey') const { privateKey, algorithm: { parameters: { value: crv } } } = PrivateKeyInfo.decode(der) const { privateKey: d, publicKey } = ECPrivateKey.decode(privateKey) if (typeof publicKey === 'undefined') { if (keyObjectSupported) { return { ...keyObjectToJWK.ec.public(createPublicKey(keyObject)), d: base64url.encodeBuffer(d) } } throw new errors.JOSENotSupported('Private EC keys without the public key embedded are not supported in your Node.js runtime version') } const x = publicKey.data.slice(1, ((publicKey.data.length - 1) / 2) + 1) const y = publicKey.data.slice(((publicKey.data.length - 1) / 2) + 1) return { kty: 'EC', crv, d: base64url.encodeBuffer(d), x: base64url.encodeBuffer(x), y: base64url.encodeBuffer(y) } }, public (keyObject) { const der = keyObject.export({ type: 'spki', format: 'der' }) const PublicKeyInfo = asn1.get('PublicKeyInfo') const { publicKey: { data: publicKey }, algorithm: { parameters: { value: crv } } } = PublicKeyInfo.decode(der) const x = publicKey.slice(1, ((publicKey.length - 1) / 2) + 1) const y = publicKey.slice(((publicKey.length - 1) / 2) + 1) return { kty: 'EC', crv, x: base64url.encodeBuffer(x), y: base64url.encodeBuffer(y) } } }, ed25519: { private (keyObject) { return okpToJWK.private('Ed25519', keyObject) }, public (keyObject) { return okpToJWK.public('Ed25519', keyObject) } }, ed448: { private (keyObject) { return okpToJWK.private('Ed448', keyObject) }, public (keyObject) { return okpToJWK.public('Ed448', keyObject) } }, x25519: { private (keyObject) { return okpToJWK.private('X25519', keyObject) }, public (keyObject) { return okpToJWK.public('X25519', keyObject) } }, x448: { private (keyObject) { return okpToJWK.private('X448', keyObject) }, public (keyObject) { return okpToJWK.public('X448', keyObject) } } } module.exports.keyObjectToJWK = (keyObject) => { if (keyObject.type === 'private') { return keyObjectToJWK[keyObject.asymmetricKeyType].private(keyObject) } return keyObjectToJWK[keyObject.asymmetricKeyType].public(keyObject) } const concatEcPublicKey = (x, y) => ({ unused: 0, data: Buffer.concat([ Buffer.alloc(1, 4), base64url.decodeToBuffer(x), base64url.decodeToBuffer(y) ]) }) const jwkToPem = { RSA: { private (jwk, { calculateMissingRSAPrimes }) { const RSAPrivateKey = asn1.get('RSAPrivateKey') if ('oth' in jwk) { throw new errors.JOSENotSupported('Private RSA keys with more than two primes are not supported') } if (jwk.p || jwk.q || jwk.dp || jwk.dq || jwk.qi) { if (!(jwk.p && jwk.q && jwk.dp && jwk.dq && jwk.qi)) { throw new errors.JWKInvalid('all other private key parameters must be present when any one of them is present') } } else if (calculateMissingRSAPrimes) { jwk = computePrimes(jwk) } else if (!calculateMissingRSAPrimes) { throw new errors.JOSENotSupported('importing private RSA keys without all other private key parameters is not enabled, see documentation and its advisory on how and when its ok to enable it') } return RSAPrivateKey.encode({ version: 0, n: BigInt(`0x${base64url.decodeToBuffer(jwk.n).toString('hex')}`), e: BigInt(`0x${base64url.decodeToBuffer(jwk.e).toString('hex')}`), d: BigInt(`0x${base64url.decodeToBuffer(jwk.d).toString('hex')}`), p: BigInt(`0x${base64url.decodeToBuffer(jwk.p).toString('hex')}`), q: BigInt(`0x${base64url.decodeToBuffer(jwk.q).toString('hex')}`), dp: BigInt(`0x${base64url.decodeToBuffer(jwk.dp).toString('hex')}`), dq: BigInt(`0x${base64url.decodeToBuffer(jwk.dq).toString('hex')}`), qi: BigInt(`0x${base64url.decodeToBuffer(jwk.qi).toString('hex')}`) }, 'pem', { label: 'RSA PRIVATE KEY' }) }, public (jwk) { const RSAPublicKey = asn1.get('RSAPublicKey') return RSAPublicKey.encode({ version: 0, n: BigInt(`0x${base64url.decodeToBuffer(jwk.n).toString('hex')}`), e: BigInt(`0x${base64url.decodeToBuffer(jwk.e).toString('hex')}`) }, 'pem', { label: 'RSA PUBLIC KEY' }) } }, EC: { private (jwk) { const ECPrivateKey = asn1.get('ECPrivateKey') return ECPrivateKey.encode({ version: 1, privateKey: base64url.decodeToBuffer(jwk.d), parameters: { type: 'namedCurve', value: jwk.crv }, publicKey: concatEcPublicKey(jwk.x, jwk.y) }, 'pem', { label: 'EC PRIVATE KEY' }) }, public (jwk) { const PublicKeyInfo = asn1.get('PublicKeyInfo') return PublicKeyInfo.encode({ algorithm: { algorithm: 'ecPublicKey', parameters: { type: 'namedCurve', value: jwk.crv } }, publicKey: concatEcPublicKey(jwk.x, jwk.y) }, 'pem', { label: 'PUBLIC KEY' }) } }, OKP: { private (jwk) { const OneAsymmetricKey = asn1.get('OneAsymmetricKey') const b64 = OneAsymmetricKey.encode({ version: 0, privateKey: { privateKey: base64url.decodeToBuffer(jwk.d) }, algorithm: { algorithm: jwk.crv } }, 'der') // TODO: WHYYY? https://github.com/indutny/asn1.js/issues/110 b64.write('04', 12, 1, 'hex') return formatPem(b64.toString('base64'), 'PRIVATE') }, public (jwk) { const PublicKeyInfo = asn1.get('PublicKeyInfo') return PublicKeyInfo.encode({ algorithm: { algorithm: jwk.crv }, publicKey: { unused: 0, data: base64url.decodeToBuffer(jwk.x) } }, 'pem', { label: 'PUBLIC KEY' }) } } } module.exports.jwkToPem = (jwk, { calculateMissingRSAPrimes = false } = {}) => { switch (jwk.kty) { case 'EC': if (!EC_CURVES.has(jwk.crv)) { throw new errors.JOSENotSupported(`unsupported EC key curve: ${jwk.crv}`) } break case 'OKP': if (!OKP_CURVES.has(jwk.crv)) { throw new errors.JOSENotSupported(`unsupported OKP key curve: ${jwk.crv}`) } break case 'RSA': break default: throw new errors.JOSENotSupported(`unsupported key type: ${jwk.kty}`) } if (jwk.d) { return jwkToPem[jwk.kty].private(jwk, { calculateMissingRSAPrimes }) } return jwkToPem[jwk.kty].public(jwk) } /***/ }), /***/ 81942: /***/ ((module) => { module.exports = alg => `sha${alg.substr(2, 3)}` /***/ }), /***/ 4438: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { randomBytes } = __webpack_require__(76417) const base64url = __webpack_require__(93312) const errors = __webpack_require__(35132) const ZERO = BigInt(0) const ONE = BigInt(1) const TWO = BigInt(2) const toJWKParameter = (n) => { const hex = n.toString(16) return base64url.encodeBuffer(Buffer.from(hex.length % 2 ? `0${hex}` : hex, 'hex')) } const fromBuffer = buf => BigInt(`0x${buf.toString('hex')}`) const bitLength = n => n.toString(2).length const eGcdX = (a, b) => { let x = ZERO let y = ONE let u = ONE let v = ZERO while (a !== ZERO) { const q = b / a const r = b % a const m = x - (u * q) const n = y - (v * q) b = a a = r x = u y = v u = m v = n } return x } const gcd = (a, b) => { let shift = ZERO while (!((a | b) & ONE)) { a >>= ONE b >>= ONE shift++ } while (!(a & ONE)) { a >>= ONE } do { while (!(b & ONE)) { b >>= ONE } if (a > b) { const x = a a = b b = x } b -= a } while (b) return a << shift } const modPow = (a, b, n) => { a = toZn(a, n) let result = ONE let x = a while (b > 0) { const leastSignificantBit = b % TWO b = b / TWO if (leastSignificantBit === ONE) { result = result * x result = result % n } x = x * x x = x % n } return result } const randBetween = (min, max) => { const interval = max - min const bitLen = bitLength(interval) let rnd do { rnd = fromBuffer(randBits(bitLen)) } while (rnd > interval) return rnd + min } const randBits = (bitLength) => { const byteLength = Math.ceil(bitLength / 8) const rndBytes = randomBytes(byteLength) // Fill with 0's the extra bits rndBytes[0] = rndBytes[0] & (2 ** (bitLength % 8) - 1) return rndBytes } const toZn = (a, n) => { a = a % n return (a < 0) ? a + n : a } const odd = (n) => { let r = n while (r % TWO === ZERO) { r = r / TWO } return r } // not sold on these values const maxCountWhileNoY = 30 const maxCountWhileInot0 = 22 const getPrimeFactors = (e, d, n) => { const r = odd(e * d - ONE) let countWhileNoY = 0 let y do { countWhileNoY++ if (countWhileNoY === maxCountWhileNoY) { throw new errors.JWKImportFailed('failed to calculate missing primes') } let countWhileInot0 = 0 let i = modPow(randBetween(TWO, n), r, n) let o = ZERO while (i !== ONE) { countWhileInot0++ if (countWhileInot0 === maxCountWhileInot0) { throw new errors.JWKImportFailed('failed to calculate missing primes') } o = i i = (i * i) % n } if (o !== (n - ONE)) { y = o } } while (!y) const p = gcd(y - ONE, n) const q = n / p return p > q ? { p, q } : { p: q, q: p } } module.exports = (jwk) => { const e = fromBuffer(base64url.decodeToBuffer(jwk.e)) const d = fromBuffer(base64url.decodeToBuffer(jwk.d)) const n = fromBuffer(base64url.decodeToBuffer(jwk.n)) if (d >= n) { throw new errors.JWKInvalid('invalid RSA private exponent') } const { p, q } = getPrimeFactors(e, d, n) const dp = d % (p - ONE) const dq = d % (q - ONE) const qi = toZn(eGcdX(toZn(q, p), p), p) return { ...jwk, p: toJWKParameter(p), q: toJWKParameter(q), dp: toJWKParameter(dp), dq: toJWKParameter(dq), qi: toJWKParameter(qi) } } /***/ }), /***/ 57494: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { diffieHellman, KeyObject, sign, verify } = __webpack_require__(76417) const [major, minor] = process.version.substr(1).split('.').map(x => parseInt(x, 10)) module.exports = { oaepHashSupported: major > 12 || (major === 12 && minor >= 9), keyObjectSupported: !!KeyObject && major >= 12, edDSASupported: !!sign && !!verify, dsaEncodingSupported: major > 13 || (major === 13 && minor >= 2) || (major === 12 && minor >= 16), improvedDH: !!diffieHellman } /***/ }), /***/ 84096: /***/ ((module) => { const minute = 60 const hour = minute * 60 const day = hour * 24 const week = day * 7 const year = day * 365.25 const REGEX = /^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i module.exports = (str) => { const matched = REGEX.exec(str) if (!matched) { throw new TypeError(`invalid time period format ("${str}")`) } const value = parseFloat(matched[1]) const unit = matched[2].toLowerCase() switch (unit) { case 'sec': case 'secs': case 'second': case 'seconds': case 's': return Math.round(value) case 'minute': case 'minutes': case 'min': case 'mins': case 'm': return Math.round(value * minute) case 'hour': case 'hours': case 'hr': case 'hrs': case 'h': return Math.round(value * hour) case 'day': case 'days': case 'd': return Math.round(value * day) case 'week': case 'weeks': case 'w': return Math.round(value * week) case 'year': case 'years': case 'yr': case 'yrs': case 'y': return Math.round(value * year) } } /***/ }), /***/ 15300: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { timingSafeEqual: TSE } = __webpack_require__(76417) const paddedBuffer = (input, length) => { if (input.length === length) { return input } const buffer = Buffer.alloc(length) input.copy(buffer) return buffer } const timingSafeEqual = (a, b) => { const length = Math.max(a.length, b.length) return TSE(paddedBuffer(a, length), paddedBuffer(b, length)) } module.exports = timingSafeEqual /***/ }), /***/ 82267: /***/ ((module) => { const MAX_INT32 = Math.pow(2, 32) module.exports = (value, buf = Buffer.allocUnsafe(8)) => { const high = Math.floor(value / MAX_INT32) const low = value % MAX_INT32 buf.writeUInt32BE(high, 0) buf.writeUInt32BE(low, 4) return buf } /***/ }), /***/ 85822: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { JOSECritNotUnderstood, JWSInvalid } = __webpack_require__(35132) const DEFINED = new Set([ 'alg', 'jku', 'jwk', 'kid', 'x5u', 'x5c', 'x5t', 'x5t#S256', 'typ', 'cty', 'crit', 'enc', 'zip', 'epk', 'apu', 'apv', 'iv', 'tag', 'p2s', 'p2c' ]) module.exports = function validateCrit (Err, protectedHeader, unprotectedHeader, understood) { if (protectedHeader && 'crit' in protectedHeader) { if ( !Array.isArray(protectedHeader.crit) || protectedHeader.crit.length === 0 || protectedHeader.crit.some(s => typeof s !== 'string' || !s) ) { throw new Err('"crit" Header Parameter MUST be an array of non-empty strings when present') } const whitelisted = new Set(understood) const combined = { ...protectedHeader, ...unprotectedHeader } protectedHeader.crit.forEach((parameter) => { if (DEFINED.has(parameter)) { throw new Err(`The critical list contains a non-extension Header Parameter ${parameter}`) } if (!whitelisted.has(parameter)) { throw new JOSECritNotUnderstood(`critical "${parameter}" is not understood`) } if (parameter === 'b64') { if (!('b64' in protectedHeader)) { throw new JWSInvalid('"b64" critical parameter must be integrity protected') } if (typeof protectedHeader.b64 !== 'boolean') { throw new JWSInvalid('"b64" critical parameter must be a boolean') } } else if (!(parameter in combined)) { throw new Err(`critical parameter "${parameter}" is missing`) } }) } if (unprotectedHeader && 'crit' in unprotectedHeader) { throw new Err('"crit" Header Parameter MUST be integrity protected when present') } } /***/ }), /***/ 87115: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { JWE: __webpack_require__(22307), JWK: __webpack_require__(2297), JWKS: __webpack_require__(27397), JWS: __webpack_require__(49830), JWT: __webpack_require__(40449), errors: __webpack_require__(35132) } /***/ }), /***/ 26468: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createCipheriv, createDecipheriv, getCiphers } = __webpack_require__(76417) const uint64be = __webpack_require__(82267) const timingSafeEqual = __webpack_require__(15300) const { KEYOBJECT } = __webpack_require__(62928) const { JWEInvalid, JWEDecryptionFailed } = __webpack_require__(35132) const checkInput = function (size, iv, tag) { if (iv.length !== 16) { throw new JWEInvalid('invalid iv') } if (arguments.length === 3) { if (tag.length !== size / 8) { throw new JWEInvalid('invalid tag') } } } const encrypt = (size, sign, { [KEYOBJECT]: keyObject }, cleartext, { iv, aad = Buffer.alloc(0) }) => { const key = keyObject.export() checkInput(size, iv) const keySize = size / 8 const encKey = key.slice(keySize) const cipher = createCipheriv(`aes-${size}-cbc`, encKey, iv) const ciphertext = Buffer.concat([cipher.update(cleartext), cipher.final()]) const macData = Buffer.concat([aad, iv, ciphertext, uint64be(aad.length * 8)]) const macKey = key.slice(0, keySize) const tag = sign({ [KEYOBJECT]: macKey }, macData).slice(0, keySize) return { ciphertext, tag } } const decrypt = (size, sign, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag = Buffer.alloc(0), aad = Buffer.alloc(0) }) => { checkInput(size, iv, tag) const keySize = size / 8 const key = keyObject.export() const encKey = key.slice(keySize) const macKey = key.slice(0, keySize) const macData = Buffer.concat([aad, iv, ciphertext, uint64be(aad.length * 8)]) const expectedTag = sign({ [KEYOBJECT]: macKey }, macData, tag).slice(0, keySize) const macCheckPassed = timingSafeEqual(tag, expectedTag) if (!macCheckPassed) { throw new JWEDecryptionFailed() } let cleartext try { const cipher = createDecipheriv(`aes-${size}-cbc`, encKey, iv) cleartext = Buffer.concat([cipher.update(ciphertext), cipher.final()]) } catch (err) {} if (!cleartext) { throw new JWEDecryptionFailed() } return cleartext } module.exports = (JWA, JWK) => { ['A128CBC-HS256', 'A192CBC-HS384', 'A256CBC-HS512'].forEach((jwaAlg) => { const size = parseInt(jwaAlg.substr(1, 3), 10) const sign = JWA.sign.get(`HS${size * 2}`) if (getCiphers().includes(`aes-${size}-cbc`)) { JWA.encrypt.set(jwaAlg, encrypt.bind(undefined, size, sign)) JWA.decrypt.set(jwaAlg, decrypt.bind(undefined, size, sign)) JWK.oct.encrypt[jwaAlg] = JWK.oct.decrypt[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length / 2 === size } }) } /***/ }), /***/ 69480: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createCipheriv, createDecipheriv, getCiphers } = __webpack_require__(76417) const { KEYOBJECT } = __webpack_require__(62928) const { JWEInvalid, JWEDecryptionFailed } = __webpack_require__(35132) const { asInput } = __webpack_require__(31032) const checkInput = function (size, iv, tag) { if (iv.length !== 12) { throw new JWEInvalid('invalid iv') } if (arguments.length === 3) { if (tag.length !== 16) { throw new JWEInvalid('invalid tag') } } } const encrypt = (size, { [KEYOBJECT]: keyObject }, cleartext, { iv, aad = Buffer.alloc(0) }) => { const key = asInput(keyObject, false) checkInput(size, iv) const cipher = createCipheriv(`aes-${size}-gcm`, key, iv, { authTagLength: 16 }) cipher.setAAD(aad) const ciphertext = Buffer.concat([cipher.update(cleartext), cipher.final()]) const tag = cipher.getAuthTag() return { ciphertext, tag } } const decrypt = (size, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag = Buffer.alloc(0), aad = Buffer.alloc(0) }) => { const key = asInput(keyObject, false) checkInput(size, iv, tag) try { const cipher = createDecipheriv(`aes-${size}-gcm`, key, iv, { authTagLength: 16 }) cipher.setAuthTag(tag) cipher.setAAD(aad) return Buffer.concat([cipher.update(ciphertext), cipher.final()]) } catch (err) { throw new JWEDecryptionFailed() } } module.exports = (JWA, JWK) => { ['A128GCM', 'A192GCM', 'A256GCM'].forEach((jwaAlg) => { const size = parseInt(jwaAlg.substr(1, 3), 10) if (getCiphers().includes(`aes-${size}-gcm`)) { JWA.encrypt.set(jwaAlg, encrypt.bind(undefined, size)) JWA.decrypt.set(jwaAlg, decrypt.bind(undefined, size)) JWK.oct.encrypt[jwaAlg] = JWK.oct.decrypt[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size } }) } /***/ }), /***/ 15066: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const generateIV = __webpack_require__(3796) const base64url = __webpack_require__(93312) module.exports = (JWA, JWK) => { ['A128GCMKW', 'A192GCMKW', 'A256GCMKW'].forEach((jwaAlg) => { const encAlg = jwaAlg.substr(0, 7) const size = parseInt(jwaAlg.substr(1, 3), 10) const encrypt = JWA.encrypt.get(encAlg) const decrypt = JWA.decrypt.get(encAlg) if (encrypt && decrypt) { JWA.keyManagementEncrypt.set(jwaAlg, (key, payload) => { const iv = generateIV(jwaAlg) const { ciphertext, tag } = encrypt(key, payload, { iv }) return { wrapped: ciphertext, header: { tag: base64url.encodeBuffer(tag), iv: base64url.encodeBuffer(iv) } } }) JWA.keyManagementDecrypt.set(jwaAlg, decrypt) JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size } }) } /***/ }), /***/ 50253: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createCipheriv, createDecipheriv, getCiphers } = __webpack_require__(76417) const { KEYOBJECT } = __webpack_require__(62928) const { asInput } = __webpack_require__(31032) const checkInput = (data) => { if (data !== undefined && data.length % 8 !== 0) { throw new Error('invalid data length') } } const wrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) const cipher = createCipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex')) return { wrapped: Buffer.concat([cipher.update(payload), cipher.final()]) } } const unwrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) checkInput(payload) const cipher = createDecipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex')) return Buffer.concat([cipher.update(payload), cipher.final()]) } module.exports = (JWA, JWK) => { ['A128KW', 'A192KW', 'A256KW'].forEach((jwaAlg) => { const size = parseInt(jwaAlg.substr(1, 3), 10) const alg = `aes${size}-wrap` if (getCiphers().includes(alg)) { JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, alg)) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, alg)) JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size } }) } /***/ }), /***/ 53791: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { improvedDH } = __webpack_require__(57494) if (improvedDH) { const { diffieHellman } = __webpack_require__(76417) const { KeyObject } = __webpack_require__(31032) const importKey = __webpack_require__(77722) module.exports = ({ keyObject: privateKey }, publicKey) => { if (!(publicKey instanceof KeyObject)) { ({ keyObject: publicKey } = importKey(publicKey)) } return diffieHellman({ privateKey, publicKey }) } } else { const { createECDH, constants: { POINT_CONVERSION_UNCOMPRESSED } } = __webpack_require__(76417) const base64url = __webpack_require__(93312) const crvToCurve = (crv) => { switch (crv) { case 'P-256': return 'prime256v1' case 'P-384': return 'secp384r1' case 'P-521': return 'secp521r1' } } const UNCOMPRESSED = Buffer.alloc(1, POINT_CONVERSION_UNCOMPRESSED) const pubToBuffer = (x, y) => Buffer.concat([UNCOMPRESSED, base64url.decodeToBuffer(x), base64url.decodeToBuffer(y)]) module.exports = ({ crv, d }, { x, y }) => { const curve = crvToCurve(crv) const exchange = createECDH(curve) exchange.setPrivateKey(base64url.decodeToBuffer(d)) return exchange.computeSecret(pubToBuffer(x, y)) } } /***/ }), /***/ 95320: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createHash } = __webpack_require__(76417) const ecdhComputeSecret = __webpack_require__(53791) const concat = (key, length, value) => { const iterations = Math.ceil(length / 32) let res for (let iter = 1; iter <= iterations; iter++) { const buf = Buffer.allocUnsafe(4 + key.length + value.length) buf.writeUInt32BE(iter, 0) key.copy(buf, 4) value.copy(buf, 4 + key.length) if (!res) { res = createHash('sha256').update(buf).digest() } else { res = Buffer.concat([res, createHash('sha256').update(buf).digest()]) } } return res.slice(0, length) } const uint32be = (value, buf = Buffer.allocUnsafe(4)) => { buf.writeUInt32BE(value) return buf } const lengthAndInput = input => Buffer.concat([uint32be(input.length), input]) module.exports = (alg, keyLen, privKey, pubKey, { apu = Buffer.alloc(0), apv = Buffer.alloc(0) } = {}, computeSecret = ecdhComputeSecret) => { const value = Buffer.concat([ lengthAndInput(Buffer.from(alg)), lengthAndInput(apu), lengthAndInput(apv), uint32be(keyLen) ]) const sharedSecret = computeSecret(privKey, pubKey) return concat(sharedSecret, keyLen / 8, value) } /***/ }), /***/ 99214: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { improvedDH } = __webpack_require__(57494) const { KEYLENGTHS } = __webpack_require__(47359) const { generateSync } = __webpack_require__(87042) const derive = __webpack_require__(95320) const wrapKey = (key, payload, { enc }) => { const epk = generateSync(key.kty, key.crv) const derivedKey = derive(enc, KEYLENGTHS.get(enc), epk, key) return { wrapped: derivedKey, header: { epk: { kty: key.kty, crv: key.crv, x: epk.x, y: epk.y } } } } const unwrapKey = (key, payload, header) => { const { enc, epk } = header return derive(enc, KEYLENGTHS.get(enc), key, epk, header) } module.exports = (JWA, JWK) => { JWA.keyManagementEncrypt.set('ECDH-ES', wrapKey) JWA.keyManagementDecrypt.set('ECDH-ES', unwrapKey) JWK.EC.deriveKey['ECDH-ES'] = key => (key.use === 'enc' || key.use === undefined) && key.crv !== 'secp256k1' if (improvedDH) { JWK.OKP.deriveKey['ECDH-ES'] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x') } } /***/ }), /***/ 4363: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { improvedDH } = __webpack_require__(57494) const { KEYOBJECT } = __webpack_require__(62928) const { generateSync } = __webpack_require__(87042) const { ECDH_DERIVE_LENGTHS } = __webpack_require__(47359) const derive = __webpack_require__(95320) const wrapKey = (wrap, derive, key, payload) => { const epk = generateSync(key.kty, key.crv) const derivedKey = derive(epk, key, payload) const result = wrap({ [KEYOBJECT]: derivedKey }, payload) result.header = result.header || {} Object.assign(result.header, { epk: { kty: key.kty, crv: key.crv, x: epk.x, y: epk.y } }) return result } const unwrapKey = (unwrap, derive, key, payload, header) => { const { epk } = header const derivedKey = derive(key, epk, header) return unwrap({ [KEYOBJECT]: derivedKey }, payload, header) } module.exports = (JWA, JWK) => { ['ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW'].forEach((jwaAlg) => { const kw = jwaAlg.substr(-6) const kwWrap = JWA.keyManagementEncrypt.get(kw) const kwUnwrap = JWA.keyManagementDecrypt.get(kw) const keylen = parseInt(jwaAlg.substr(9, 3), 10) ECDH_DERIVE_LENGTHS.set(jwaAlg, keylen) if (kwWrap && kwUnwrap) { JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, kwWrap, derive.bind(undefined, jwaAlg, keylen))) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, kwUnwrap, derive.bind(undefined, jwaAlg, keylen))) JWK.EC.deriveKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.crv !== 'secp256k1' if (improvedDH) { JWK.OKP.deriveKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x') } } }) } module.exports.wrapKey = wrapKey module.exports.unwrapKey = unwrapKey /***/ }), /***/ 92251: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { sign: signOneShot, verify: verifyOneShot, createSign, createVerify, getCurves } = __webpack_require__(76417) const { derToJose, joseToDer } = __webpack_require__(64575) const { KEYOBJECT } = __webpack_require__(62928) const resolveNodeAlg = __webpack_require__(81942) const { asInput } = __webpack_require__(31032) const { dsaEncodingSupported } = __webpack_require__(57494) let sign, verify if (dsaEncodingSupported) { sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { if (typeof payload === 'string') { payload = Buffer.from(payload) } return signOneShot(nodeAlg, payload, { key: asInput(keyObject, false), dsaEncoding: 'ieee-p1363' }) } verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { try { return verifyOneShot(nodeAlg, payload, { key: asInput(keyObject, true), dsaEncoding: 'ieee-p1363' }, signature) } catch (err) { return false } } } else { sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { return derToJose(createSign(nodeAlg).update(payload).sign(asInput(keyObject, false)), jwaAlg) } verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { try { return createVerify(nodeAlg).update(payload).verify(asInput(keyObject, true), joseToDer(signature, jwaAlg)) } catch (err) { return false } } } const crvToAlg = (crv) => { switch (crv) { case 'P-256': return 'ES256' case 'secp256k1': return 'ES256K' case 'P-384': return 'ES384' case 'P-521': return 'ES512' } } module.exports = (JWA, JWK) => { const algs = [] if (getCurves().includes('prime256v1')) { algs.push('ES256') } if (getCurves().includes('secp256k1')) { algs.push('ES256K') } if (getCurves().includes('secp384r1')) { algs.push('ES384') } if (getCurves().includes('secp521r1')) { algs.push('ES512') } algs.forEach((jwaAlg) => { const nodeAlg = resolveNodeAlg(jwaAlg) JWA.sign.set(jwaAlg, sign.bind(undefined, jwaAlg, nodeAlg)) JWA.verify.set(jwaAlg, verify.bind(undefined, jwaAlg, nodeAlg)) JWK.EC.sign[jwaAlg] = key => key.private && JWK.EC.verify[jwaAlg](key) JWK.EC.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && crvToAlg(key.crv) === jwaAlg }) } /***/ }), /***/ 81448: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { sign: signOneShot, verify: verifyOneShot } = __webpack_require__(76417) const { KEYOBJECT } = __webpack_require__(62928) const { edDSASupported } = __webpack_require__(57494) const sign = ({ [KEYOBJECT]: keyObject }, payload) => { if (typeof payload === 'string') { payload = Buffer.from(payload) } return signOneShot(undefined, payload, keyObject) } const verify = ({ [KEYOBJECT]: keyObject }, payload, signature) => { return verifyOneShot(undefined, payload, keyObject, signature) } module.exports = (JWA, JWK) => { if (edDSASupported) { JWA.sign.set('EdDSA', sign) JWA.verify.set('EdDSA', verify) JWK.OKP.sign.EdDSA = key => key.private && JWK.OKP.verify.EdDSA(key) JWK.OKP.verify.EdDSA = key => (key.use === 'sig' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('ed') } } /***/ }), /***/ 71367: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createHmac } = __webpack_require__(76417) const { KEYOBJECT } = __webpack_require__(62928) const timingSafeEqual = __webpack_require__(15300) const resolveNodeAlg = __webpack_require__(81942) const { asInput } = __webpack_require__(31032) const sign = (jwaAlg, hmacAlg, { [KEYOBJECT]: keyObject }, payload) => { const hmac = createHmac(hmacAlg, asInput(keyObject, false)) hmac.update(payload) return hmac.digest() } const verify = (jwaAlg, hmacAlg, key, payload, signature) => { const expected = sign(jwaAlg, hmacAlg, key, payload) const actual = signature return timingSafeEqual(actual, expected) } module.exports = (JWA, JWK) => { ['HS256', 'HS384', 'HS512'].forEach((jwaAlg) => { const hmacAlg = resolveNodeAlg(jwaAlg) JWA.sign.set(jwaAlg, sign.bind(undefined, jwaAlg, hmacAlg)) JWA.verify.set(jwaAlg, verify.bind(undefined, jwaAlg, hmacAlg)) JWK.oct.sign[jwaAlg] = JWK.oct.verify[jwaAlg] = key => key.use === 'sig' || key.use === undefined }) } /***/ }), /***/ 40423: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { JWKKeySupport, JOSENotSupported } = __webpack_require__(35132) const { KEY_MANAGEMENT_ENCRYPT, KEY_MANAGEMENT_DECRYPT } = __webpack_require__(62928) const { JWA, JWK } = __webpack_require__(47359) // sign, verify __webpack_require__(71367)(JWA, JWK) __webpack_require__(92251)(JWA, JWK) __webpack_require__(81448)(JWA, JWK) __webpack_require__(90112)(JWA, JWK) __webpack_require__(75778)(JWA, JWK) __webpack_require__(62875)(JWA) // encrypt, decrypt __webpack_require__(26468)(JWA, JWK) __webpack_require__(69480)(JWA, JWK) // wrapKey, unwrapKey __webpack_require__(4061)(JWA, JWK) __webpack_require__(50253)(JWA, JWK) __webpack_require__(15066)(JWA, JWK) // deriveKey __webpack_require__(41613)(JWA, JWK) __webpack_require__(99214)(JWA, JWK) __webpack_require__(4363)(JWA, JWK) const check = (key, op, alg) => { const cache = `_${op}_${alg}` let label let keyOp if (op === 'keyManagementEncrypt') { label = 'key management (encryption)' keyOp = KEY_MANAGEMENT_ENCRYPT } else if (op === 'keyManagementDecrypt') { label = 'key management (decryption)' keyOp = KEY_MANAGEMENT_DECRYPT } if (cache in key) { if (key[cache]) { return } throw new JWKKeySupport(`the key does not support ${alg} ${label || op} algorithm`) } let value = true if (!JWA[op].has(alg)) { throw new JOSENotSupported(`unsupported ${label || op} alg: ${alg}`) } else if (!key.algorithms(keyOp).has(alg)) { value = false } Object.defineProperty(key, cache, { value, enumerable: false }) if (!value) { return check(key, op, alg) } } module.exports = { check, sign: (alg, key, payload) => { check(key, 'sign', alg) return JWA.sign.get(alg)(key, payload) }, verify: (alg, key, payload, signature) => { check(key, 'verify', alg) return JWA.verify.get(alg)(key, payload, signature) }, keyManagementEncrypt: (alg, key, payload, opts) => { check(key, 'keyManagementEncrypt', alg) return JWA.keyManagementEncrypt.get(alg)(key, payload, opts) }, keyManagementDecrypt: (alg, key, payload, opts) => { check(key, 'keyManagementDecrypt', alg) return JWA.keyManagementDecrypt.get(alg)(key, payload, opts) }, encrypt: (alg, key, cleartext, opts) => { check(key, 'encrypt', alg) return JWA.encrypt.get(alg)(key, cleartext, opts) }, decrypt: (alg, key, ciphertext, opts) => { check(key, 'decrypt', alg) return JWA.decrypt.get(alg)(key, ciphertext, opts) } } /***/ }), /***/ 62875: /***/ ((module) => { const sign = () => Buffer.from('') const verify = (key, payload, signature) => !signature.length module.exports = (JWA, JWK) => { JWA.sign.set('none', sign) JWA.verify.set('none', verify) } /***/ }), /***/ 41613: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { pbkdf2Sync: pbkdf2, randomBytes } = __webpack_require__(76417) const { KEYOBJECT } = __webpack_require__(62928) const base64url = __webpack_require__(93312) const SALT_LENGTH = 16 const NULL_BUFFER = Buffer.alloc(1, 0) const concatSalt = (alg, p2s) => { return Buffer.concat([ Buffer.from(alg, 'utf8'), NULL_BUFFER, p2s ]) } const wrapKey = (keylen, sha, concat, wrap, { [KEYOBJECT]: keyObject }, payload) => { // Note that if password-based encryption is used for multiple // recipients, it is expected that each recipient use different values // for the PBES2 parameters "p2s" and "p2c". // here we generate p2c between 2048 and 4096 and random p2s const p2c = Math.floor((Math.random() * 2049) + 2048) const p2s = randomBytes(SALT_LENGTH) const salt = concat(p2s) const derivedKey = pbkdf2(keyObject.export(), salt, p2c, keylen, sha) const result = wrap({ [KEYOBJECT]: derivedKey }, payload) result.header = result.header || {} Object.assign(result.header, { p2c, p2s: base64url.encodeBuffer(p2s) }) return result } const unwrapKey = (keylen, sha, concat, unwrap, { [KEYOBJECT]: keyObject }, payload, header) => { const { p2s, p2c } = header const salt = concat(p2s) const derivedKey = pbkdf2(keyObject.export(), salt, p2c, keylen, sha) return unwrap({ [KEYOBJECT]: derivedKey }, payload, header) } module.exports = (JWA, JWK) => { ['PBES2-HS256+A128KW', 'PBES2-HS384+A192KW', 'PBES2-HS512+A256KW'].forEach((jwaAlg) => { const kw = jwaAlg.substr(-6) const kwWrap = JWA.keyManagementEncrypt.get(kw) const kwUnwrap = JWA.keyManagementDecrypt.get(kw) const keylen = parseInt(jwaAlg.substr(13, 3), 10) / 8 const sha = `sha${jwaAlg.substr(8, 3)}` if (kwWrap && kwUnwrap) { JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwWrap)) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwUnwrap)) JWK.oct.deriveKey[jwaAlg] = key => key.use === 'enc' || key.use === undefined } }) } /***/ }), /***/ 4061: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { publicEncrypt, privateDecrypt, constants } = __webpack_require__(76417) const { oaepHashSupported } = __webpack_require__(57494) const { KEYOBJECT } = __webpack_require__(62928) const { asInput } = __webpack_require__(31032) const resolvePadding = (alg) => { switch (alg) { case 'RSA-OAEP': case 'RSA-OAEP-256': case 'RSA-OAEP-384': case 'RSA-OAEP-512': return constants.RSA_PKCS1_OAEP_PADDING case 'RSA1_5': return constants.RSA_PKCS1_PADDING } } const resolveOaepHash = (alg) => { switch (alg) { case 'RSA-OAEP': return 'sha1' case 'RSA-OAEP-256': return 'sha256' case 'RSA-OAEP-384': return 'sha384' case 'RSA-OAEP-512': return 'sha512' default: return undefined } } const wrapKey = (padding, oaepHash, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, true) return { wrapped: publicEncrypt({ key, oaepHash, padding }, payload) } } const unwrapKey = (padding, oaepHash, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) return privateDecrypt({ key, oaepHash, padding }, payload) } const LENGTHS = { RSA1_5: 0, 'RSA-OAEP': 592, 'RSA-OAEP-256': 784, 'RSA-OAEP-384': 1040, 'RSA-OAEP-512': 1296 } module.exports = (JWA, JWK) => { const algs = ['RSA-OAEP', 'RSA1_5'] if (oaepHashSupported) { algs.splice(1, 0, 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512') } algs.forEach((jwaAlg) => { const padding = resolvePadding(jwaAlg) const oaepHash = resolveOaepHash(jwaAlg) JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, padding, oaepHash)) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, padding, oaepHash)) JWK.RSA.wrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length >= LENGTHS[jwaAlg] JWK.RSA.unwrapKey[jwaAlg] = key => key.private && (key.use === 'enc' || key.use === undefined) && key.length >= LENGTHS[jwaAlg] }) } /***/ }), /***/ 75778: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createSign, createVerify } = __webpack_require__(76417) const { KEYOBJECT } = __webpack_require__(62928) const resolveNodeAlg = __webpack_require__(81942) const { asInput } = __webpack_require__(31032) const sign = (nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { return createSign(nodeAlg).update(payload).sign(asInput(keyObject, false)) } const verify = (nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { return createVerify(nodeAlg).update(payload).verify(asInput(keyObject, true), signature) } const LENGTHS = { RS256: 0, RS384: 624, RS512: 752 } module.exports = (JWA, JWK) => { ['RS256', 'RS384', 'RS512'].forEach((jwaAlg) => { const nodeAlg = resolveNodeAlg(jwaAlg) JWA.sign.set(jwaAlg, sign.bind(undefined, nodeAlg)) JWA.verify.set(jwaAlg, verify.bind(undefined, nodeAlg)) JWK.RSA.sign[jwaAlg] = key => key.private && JWK.RSA.verify[jwaAlg](key) JWK.RSA.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && key.length >= LENGTHS[jwaAlg] }) } /***/ }), /***/ 90112: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createSign, createVerify, constants } = __webpack_require__(76417) const { KEYOBJECT } = __webpack_require__(62928) const resolveNodeAlg = __webpack_require__(81942) const { asInput } = __webpack_require__(31032) const sign = (nodeAlg, { [KEYOBJECT]: keyObject }, payload) => { const key = asInput(keyObject, false) return createSign(nodeAlg).update(payload).sign({ key, padding: constants.RSA_PKCS1_PSS_PADDING, saltLength: constants.RSA_PSS_SALTLEN_DIGEST }) } const verify = (nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => { const key = asInput(keyObject, true) return createVerify(nodeAlg).update(payload).verify({ key, padding: constants.RSA_PKCS1_PSS_PADDING, saltLength: constants.RSA_PSS_SALTLEN_DIGEST }, signature) } const LENGTHS = { PS256: 528, PS384: 784, PS512: 1040 } module.exports = (JWA, JWK) => { ['PS256', 'PS384', 'PS512'].forEach((jwaAlg) => { const nodeAlg = resolveNodeAlg(jwaAlg) JWA.sign.set(jwaAlg, sign.bind(undefined, nodeAlg)) JWA.verify.set(jwaAlg, verify.bind(undefined, nodeAlg)) JWK.RSA.sign[jwaAlg] = key => key.private && JWK.RSA.verify[jwaAlg](key) JWK.RSA.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && key.length >= LENGTHS[jwaAlg] }) } /***/ }), /***/ 20087: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inflateRawSync } = __webpack_require__(78761) const base64url = __webpack_require__(93312) const getKey = __webpack_require__(7090) const { KeyStore } = __webpack_require__(27397) const errors = __webpack_require__(35132) const { check, decrypt, keyManagementDecrypt } = __webpack_require__(40423) const JWK = __webpack_require__(2297) const { createSecretKey } = __webpack_require__(31032) const generateCEK = __webpack_require__(22329) const validateHeaders = __webpack_require__(77997) const { detect: resolveSerialization } = __webpack_require__(14609) const SINGLE_RECIPIENT = new Set(['compact', 'flattened']) const combineHeader = (prot = {}, unprotected = {}, header = {}) => { if (typeof prot === 'string') { prot = base64url.JSON.decode(prot) } const p2s = prot.p2s || unprotected.p2s || header.p2s const apu = prot.apu || unprotected.apu || header.apu const apv = prot.apv || unprotected.apv || header.apv const iv = prot.iv || unprotected.iv || header.iv const tag = prot.tag || unprotected.tag || header.tag return { ...prot, ...unprotected, ...header, ...(typeof p2s === 'string' ? { p2s: base64url.decodeToBuffer(p2s) } : undefined), ...(typeof apu === 'string' ? { apu: base64url.decodeToBuffer(apu) } : undefined), ...(typeof apv === 'string' ? { apv: base64url.decodeToBuffer(apv) } : undefined), ...(typeof iv === 'string' ? { iv: base64url.decodeToBuffer(iv) } : undefined), ...(typeof tag === 'string' ? { tag: base64url.decodeToBuffer(tag) } : undefined) } } const validateAlgorithms = (algorithms, option) => { if (algorithms !== undefined && (!Array.isArray(algorithms) || algorithms.some(s => typeof s !== 'string' || !s))) { throw new TypeError(`"${option}" option must be an array of non-empty strings`) } if (!algorithms) { return undefined } return new Set(algorithms) } /* * @public */ const jweDecrypt = (skipValidateHeaders, serialization, jwe, key, { crit = [], complete = false, keyManagementAlgorithms, contentEncryptionAlgorithms } = {}) => { key = getKey(key, true) keyManagementAlgorithms = validateAlgorithms(keyManagementAlgorithms, 'keyManagementAlgorithms') contentEncryptionAlgorithms = validateAlgorithms(contentEncryptionAlgorithms, 'contentEncryptionAlgorithms') if (!Array.isArray(crit) || crit.some(s => typeof s !== 'string' || !s)) { throw new TypeError('"crit" option must be an array of non-empty strings') } if (!serialization) { serialization = resolveSerialization(jwe) } let alg, ciphertext, enc, encryptedKey, iv, opts, prot, tag, unprotected, cek, aad, header // treat general format with one recipient as flattened // skips iteration and avoids multi errors in this case if (serialization === 'general' && jwe.recipients.length === 1) { serialization = 'flattened' const { recipients, ...root } = jwe jwe = { ...root, ...recipients[0] } } if (SINGLE_RECIPIENT.has(serialization)) { if (serialization === 'compact') { // compact serialization format ([prot, encryptedKey, iv, ciphertext, tag] = jwe.split('.')) } else { // flattened serialization format ({ protected: prot, encrypted_key: encryptedKey, iv, ciphertext, tag, unprotected, aad, header } = jwe) } if (!skipValidateHeaders) { validateHeaders(prot, unprotected, [{ header }], true, crit) } opts = combineHeader(prot, unprotected, header) ;({ alg, enc } = opts) if (keyManagementAlgorithms && !keyManagementAlgorithms.has(alg)) { throw new errors.JOSEAlgNotWhitelisted('key management algorithm not whitelisted') } if (contentEncryptionAlgorithms && !contentEncryptionAlgorithms.has(enc)) { throw new errors.JOSEAlgNotWhitelisted('content encryption algorithm not whitelisted') } if (key instanceof KeyStore) { const keystore = key let keys if (opts.alg === 'dir') { keys = keystore.all({ kid: opts.kid, alg: opts.enc, key_ops: ['decrypt'] }) } else { keys = keystore.all({ kid: opts.kid, alg: opts.alg, key_ops: ['unwrapKey'] }) } switch (keys.length) { case 0: throw new errors.JWKSNoMatchingKey() case 1: // treat the call as if a Key instance was passed in // skips iteration and avoids multi errors in this case key = keys[0] break default: { const errs = [] for (const key of keys) { try { return jweDecrypt(true, serialization, jwe, key, { crit, complete, contentEncryptionAlgorithms: contentEncryptionAlgorithms ? [...contentEncryptionAlgorithms] : undefined, keyManagementAlgorithms: keyManagementAlgorithms ? [...keyManagementAlgorithms] : undefined }) } catch (err) { errs.push(err) continue } } const multi = new errors.JOSEMultiError(errs) if ([...multi].some(e => e instanceof errors.JWEDecryptionFailed)) { throw new errors.JWEDecryptionFailed() } throw multi } } } check(key, ...(alg === 'dir' ? ['decrypt', enc] : ['keyManagementDecrypt', alg])) try { if (alg === 'dir') { cek = JWK.asKey(key, { alg: enc, use: 'enc' }) } else if (alg === 'ECDH-ES') { const unwrapped = keyManagementDecrypt(alg, key, undefined, opts) cek = JWK.asKey(createSecretKey(unwrapped), { alg: enc, use: 'enc' }) } else { const unwrapped = keyManagementDecrypt(alg, key, base64url.decodeToBuffer(encryptedKey), opts) cek = JWK.asKey(createSecretKey(unwrapped), { alg: enc, use: 'enc' }) } } catch (err) { // To mitigate the attacks described in RFC 3218, the // recipient MUST NOT distinguish between format, padding, and length // errors of encrypted keys. It is strongly recommended, in the event // of receiving an improperly formatted key, that the recipient // substitute a randomly generated CEK and proceed to the next step, to // mitigate timing attacks. cek = generateCEK(enc) } let adata if (aad) { adata = Buffer.concat([ Buffer.from(prot || ''), Buffer.from('.'), Buffer.from(aad) ]) } else { adata = Buffer.from(prot || '') } try { iv = base64url.decodeToBuffer(iv) } catch (err) {} try { tag = base64url.decodeToBuffer(tag) } catch (err) {} let cleartext = decrypt(enc, cek, base64url.decodeToBuffer(ciphertext), { iv, tag, aad: adata }) if (opts.zip) { cleartext = inflateRawSync(cleartext) } if (complete) { const result = { cleartext, key, cek } if (aad) result.aad = aad if (header) result.header = header if (unprotected) result.unprotected = unprotected if (prot) result.protected = base64url.JSON.decode(prot) return result } return cleartext } validateHeaders(jwe.protected, jwe.unprotected, jwe.recipients.map(({ header }) => ({ header })), true, crit) // general serialization format const { recipients, ...root } = jwe const errs = [] for (const recipient of recipients) { try { return jweDecrypt(true, 'flattened', { ...root, ...recipient }, key, { crit, complete, contentEncryptionAlgorithms: contentEncryptionAlgorithms ? [...contentEncryptionAlgorithms] : undefined, keyManagementAlgorithms: keyManagementAlgorithms ? [...keyManagementAlgorithms] : undefined }) } catch (err) { errs.push(err) continue } } const multi = new errors.JOSEMultiError(errs) if ([...multi].some(e => e instanceof errors.JWEDecryptionFailed)) { throw new errors.JWEDecryptionFailed() } else if ([...multi].every(e => e instanceof errors.JWKSNoMatchingKey)) { throw new errors.JWKSNoMatchingKey() } throw multi } module.exports = jweDecrypt.bind(undefined, false, undefined) /***/ }), /***/ 47154: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { deflateRawSync } = __webpack_require__(78761) const { KEYOBJECT } = __webpack_require__(62928) const generateIV = __webpack_require__(3796) const base64url = __webpack_require__(93312) const getKey = __webpack_require__(7090) const isObject = __webpack_require__(50243) const { createSecretKey } = __webpack_require__(31032) const deepClone = __webpack_require__(52083) const importKey = __webpack_require__(77722) const { JWEInvalid } = __webpack_require__(35132) const { check, keyManagementEncrypt, encrypt } = __webpack_require__(40423) const serializers = __webpack_require__(14609) const generateCEK = __webpack_require__(22329) const validateHeaders = __webpack_require__(77997) const PROCESS_RECIPIENT = Symbol('PROCESS_RECIPIENT') class Encrypt { constructor (cleartext, protectedHeader, aad, unprotectedHeader) { if (!Buffer.isBuffer(cleartext) && typeof cleartext !== 'string') { throw new TypeError('cleartext argument must be a Buffer or a string') } cleartext = Buffer.from(cleartext) if (aad !== undefined && !Buffer.isBuffer(aad) && typeof aad !== 'string') { throw new TypeError('aad argument must be a Buffer or a string when provided') } aad = aad ? Buffer.from(aad) : undefined if (protectedHeader !== undefined && !isObject(protectedHeader)) { throw new TypeError('protectedHeader argument must be a plain object when provided') } if (unprotectedHeader !== undefined && !isObject(unprotectedHeader)) { throw new TypeError('unprotectedHeader argument must be a plain object when provided') } this._recipients = [] this._cleartext = cleartext this._aad = aad this._unprotected = unprotectedHeader ? deepClone(unprotectedHeader) : undefined this._protected = protectedHeader ? deepClone(protectedHeader) : undefined } /* * @public */ recipient (key, header) { key = getKey(key) if (header !== undefined && !isObject(header)) { throw new TypeError('header argument must be a plain object when provided') } this._recipients.push({ key, header: header ? deepClone(header) : undefined }) return this } /* * @private */ [PROCESS_RECIPIENT] (recipient) { const unprotectedHeader = this._unprotected const protectedHeader = this._protected const { length: recipientCount } = this._recipients const jweHeader = { ...protectedHeader, ...unprotectedHeader, ...recipient.header } const { key } = recipient const enc = jweHeader.enc let alg = jweHeader.alg if (key.use === 'sig') { throw new TypeError('a key with "use":"sig" is not usable for encryption') } if (alg === 'dir') { check(key, 'encrypt', enc) } else if (alg) { check(key, 'keyManagementEncrypt', alg) } else { alg = key.alg || [...key.algorithms('wrapKey')][0] || [...key.algorithms('deriveKey')][0] if (alg === 'ECDH-ES' && recipientCount !== 1) { alg = [...key.algorithms('deriveKey')][1] } if (!alg) { throw new JWEInvalid('could not resolve a usable "alg" for a recipient') } if (recipientCount === 1) { if (protectedHeader) { protectedHeader.alg = alg } else { this._protected = { alg } } } else { if (recipient.header) { recipient.header.alg = alg } else { recipient.header = { alg } } } } let wrapped let generatedHeader if (key.kty === 'oct' && alg === 'dir') { this._cek = importKey(key[KEYOBJECT], { use: 'enc', alg: enc }) } else { check(this._cek, 'encrypt', enc) ;({ wrapped, header: generatedHeader } = keyManagementEncrypt(alg, key, this._cek[KEYOBJECT].export(), { enc, alg })) if (alg === 'ECDH-ES') { this._cek = importKey(createSecretKey(wrapped), { use: 'enc', alg: enc }) } } if (alg === 'dir' || alg === 'ECDH-ES') { recipient.encrypted_key = '' } else { recipient.encrypted_key = base64url.encodeBuffer(wrapped) } if (generatedHeader) { recipient.generatedHeader = generatedHeader } } /* * @public */ encrypt (serialization) { const serializer = serializers[serialization] if (!serializer) { throw new TypeError('serialization must be one of "compact", "flattened", "general"') } if (!this._recipients.length) { throw new JWEInvalid('missing recipients') } serializer.validate(this._protected, this._unprotected, this._aad, this._recipients) let enc = validateHeaders(this._protected, this._unprotected, this._recipients, false, this._protected ? this._protected.crit : undefined) if (!enc) { enc = 'A128CBC-HS256' if (this._protected) { this._protected.enc = enc } else { this._protected = { enc } } } const final = {} this._cek = generateCEK(enc) for (const recipient of this._recipients) { this[PROCESS_RECIPIENT](recipient) } const iv = generateIV(enc) final.iv = base64url.encodeBuffer(iv) if (this._recipients.length === 1 && this._recipients[0].generatedHeader) { const [{ generatedHeader }] = this._recipients delete this._recipients[0].generatedHeader this._protected = { ...this._protected, ...generatedHeader } } if (this._protected) { final.protected = base64url.JSON.encode(this._protected) } final.unprotected = this._unprotected let aad if (this._aad) { final.aad = base64url.encode(this._aad) aad = Buffer.concat([ Buffer.from(final.protected || ''), Buffer.from('.'), Buffer.from(final.aad) ]) } else { aad = Buffer.from(final.protected || '') } let cleartext = this._cleartext if (this._protected && 'zip' in this._protected) { cleartext = deflateRawSync(cleartext) } const { ciphertext, tag } = encrypt(enc, this._cek, cleartext, { iv, aad }) final.tag = base64url.encodeBuffer(tag) final.ciphertext = base64url.encodeBuffer(ciphertext) return serializer(final, this._recipients) } } module.exports = Encrypt /***/ }), /***/ 22329: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { randomBytes } = __webpack_require__(76417) const { createSecretKey } = __webpack_require__(31032) const { KEYLENGTHS } = __webpack_require__(47359) const Key = __webpack_require__(14591) module.exports = (alg) => { const keyLength = KEYLENGTHS.get(alg) if (!keyLength) { return new Key({ type: 'secret' }) } return new Key(createSecretKey(randomBytes(keyLength / 8)), { use: 'enc', alg }) } /***/ }), /***/ 22307: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Encrypt = __webpack_require__(47154) const decrypt = __webpack_require__(20087) const single = (serialization, cleartext, key, protectedHeader, aad, unprotectedHeader) => { return new Encrypt(cleartext, protectedHeader, aad, unprotectedHeader) .recipient(key) .encrypt(serialization) } module.exports.Encrypt = Encrypt module.exports.encrypt = single.bind(undefined, 'compact') module.exports.encrypt.flattened = single.bind(undefined, 'flattened') module.exports.encrypt.general = single.bind(undefined, 'general') module.exports.decrypt = decrypt /***/ }), /***/ 14609: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isObject = __webpack_require__(50243) let validateCrit = __webpack_require__(85822) const { JWEInvalid } = __webpack_require__(35132) validateCrit = validateCrit.bind(undefined, JWEInvalid) const compactSerializer = (final, [recipient]) => { return `${final.protected}.${recipient.encrypted_key}.${final.iv}.${final.ciphertext}.${final.tag}` } compactSerializer.validate = (protectedHeader, unprotectedHeader, aad, { 0: { header }, length }) => { if (length !== 1 || aad || unprotectedHeader || header) { throw new JWEInvalid('JWE Compact Serialization doesn\'t support multiple recipients, JWE unprotected headers or AAD') } validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined) } const flattenedSerializer = (final, [recipient]) => { const { header, encrypted_key: encryptedKey } = recipient return { ...(final.protected ? { protected: final.protected } : undefined), ...(final.unprotected ? { unprotected: final.unprotected } : undefined), ...(header ? { header } : undefined), ...(encryptedKey ? { encrypted_key: encryptedKey } : undefined), ...(final.aad ? { aad: final.aad } : undefined), iv: final.iv, ciphertext: final.ciphertext, tag: final.tag } } flattenedSerializer.validate = (protectedHeader, unprotectedHeader, aad, { 0: { header }, length }) => { if (length !== 1) { throw new JWEInvalid('Flattened JWE JSON Serialization doesn\'t support multiple recipients') } validateCrit(protectedHeader, { ...unprotectedHeader, ...header }, protectedHeader ? protectedHeader.crit : undefined) } const generalSerializer = (final, recipients) => { const result = { ...(final.protected ? { protected: final.protected } : undefined), ...(final.unprotected ? { unprotected: final.unprotected } : undefined), recipients: recipients.map(({ header, encrypted_key: encryptedKey, generatedHeader }) => { if (!header && !encryptedKey && !generatedHeader) { return false } return { ...(header || generatedHeader ? { header: { ...header, ...generatedHeader } } : undefined), ...(encryptedKey ? { encrypted_key: encryptedKey } : undefined) } }).filter(Boolean), ...(final.aad ? { aad: final.aad } : undefined), iv: final.iv, ciphertext: final.ciphertext, tag: final.tag } if (!result.recipients.length) { delete result.recipients } return result } generalSerializer.validate = (protectedHeader, unprotectedHeader, aad, recipients) => { recipients.forEach(({ header }) => { validateCrit(protectedHeader, { ...header, ...unprotectedHeader }, protectedHeader ? protectedHeader.crit : undefined) }) } const isJSON = (input) => { return isObject(input) && typeof input.ciphertext === 'string' && typeof input.iv === 'string' && typeof input.tag === 'string' && (input.unprotected === undefined || isObject(input.unprotected)) && (input.protected === undefined || typeof input.protected === 'string') && (input.aad === undefined || typeof input.aad === 'string') } const isSingleRecipient = (input) => { return (input.encrypted_key === undefined || typeof input.encrypted_key === 'string') && (input.header === undefined || isObject(input.header)) } const isValidRecipient = (recipient) => { return isObject(recipient) && typeof recipient.encrypted_key === 'string' && (recipient.header === undefined || isObject(recipient.header)) } const isMultiRecipient = (input) => { if (Array.isArray(input.recipients) && input.recipients.every(isValidRecipient)) { return true } return false } const detect = (input) => { if (typeof input === 'string' && input.split('.').length === 5) { return 'compact' } if (isJSON(input)) { if (isMultiRecipient(input)) { return 'general' } if (isSingleRecipient(input)) { return 'flattened' } } throw new JWEInvalid('JWE malformed or invalid serialization') } module.exports = { compact: compactSerializer, flattened: flattenedSerializer, general: generalSerializer, detect } /***/ }), /***/ 77997: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isDisjoint = __webpack_require__(48899) const base64url = __webpack_require__(93312) let validateCrit = __webpack_require__(85822) const { JWEInvalid, JOSENotSupported } = __webpack_require__(35132) validateCrit = validateCrit.bind(undefined, JWEInvalid) module.exports = (prot, unprotected, recipients, checkAlgorithms, crit) => { if (typeof prot === 'string') { try { prot = base64url.JSON.decode(prot) } catch (err) { throw new JWEInvalid('could not parse JWE protected header') } } let alg = [] const enc = new Set() if (!isDisjoint(prot, unprotected) || !recipients.every(({ header }) => { if (typeof header === 'object') { alg.push(header.alg) enc.add(header.enc) } const combined = { ...unprotected, ...header } validateCrit(prot, combined, crit) if ('zip' in combined) { throw new JWEInvalid('"zip" Header Parameter MUST be integrity protected') } else if (prot && 'zip' in prot && prot.zip !== 'DEF') { throw new JOSENotSupported('only "DEF" compression algorithm is supported') } return isDisjoint(header, prot) && isDisjoint(header, unprotected) })) { throw new JWEInvalid('JWE Shared Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint') } if (typeof prot === 'object') { alg.push(prot.alg) enc.add(prot.enc) } if (typeof unprotected === 'object') { alg.push(unprotected.alg) enc.add(unprotected.enc) } alg = alg.filter(Boolean) enc.delete(undefined) if (recipients.length !== 1) { if (alg.includes('dir') || alg.includes('ECDH-ES')) { throw new JWEInvalid('dir and ECDH-ES alg may only be used with a single recipient') } } if (checkAlgorithms) { if (alg.length !== recipients.length) { throw new JWEInvalid('missing Key Management algorithm') } if (enc.size === 0) { throw new JWEInvalid('missing Content Encryption algorithm') } else if (enc.size !== 1) { throw new JWEInvalid('there must only be one Content Encryption algorithm') } } else { if (enc.size > 1) { throw new JWEInvalid('there must only be one Content Encryption algorithm') } } return [...enc][0] } /***/ }), /***/ 87042: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const errors = __webpack_require__(35132) const importKey = __webpack_require__(77722) const RSAKey = __webpack_require__(52679) const ECKey = __webpack_require__(36582) const OKPKey = __webpack_require__(8658) const OctKey = __webpack_require__(14591) const generate = async (kty, crvOrSize, params, generatePrivate = true) => { switch (kty) { case 'RSA': return importKey( await RSAKey.generate(crvOrSize, generatePrivate), params ) case 'EC': return importKey( await ECKey.generate(crvOrSize, generatePrivate), params ) case 'OKP': return importKey( await OKPKey.generate(crvOrSize, generatePrivate), params ) case 'oct': return importKey( await OctKey.generate(crvOrSize, generatePrivate), params ) default: throw new errors.JOSENotSupported(`unsupported key type: ${kty}`) } } const generateSync = (kty, crvOrSize, params, generatePrivate = true) => { switch (kty) { case 'RSA': return importKey(RSAKey.generateSync(crvOrSize, generatePrivate), params) case 'EC': return importKey(ECKey.generateSync(crvOrSize, generatePrivate), params) case 'OKP': return importKey(OKPKey.generateSync(crvOrSize, generatePrivate), params) case 'oct': return importKey(OctKey.generateSync(crvOrSize, generatePrivate), params) default: throw new errors.JOSENotSupported(`unsupported key type: ${kty}`) } } module.exports.generate = generate module.exports.generateSync = generateSync /***/ }), /***/ 77722: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createPublicKey, createPrivateKey, createSecretKey, KeyObject } = __webpack_require__(31032) const base64url = __webpack_require__(93312) const isObject = __webpack_require__(50243) const { jwkToPem } = __webpack_require__(65394) const errors = __webpack_require__(35132) const RSAKey = __webpack_require__(52679) const ECKey = __webpack_require__(36582) const OKPKey = __webpack_require__(8658) const OctKey = __webpack_require__(14591) const importable = new Set(['string', 'buffer', 'object']) const mergedParameters = (target = {}, source = {}) => { return { alg: source.alg, key_ops: source.key_ops, kid: source.kid, use: source.use, x5c: source.x5c, x5t: source.x5t, 'x5t#S256': source['x5t#S256'], ...target } } const openSSHpublicKey = /^[a-zA-Z0-9-]+ AAAA(?:[0-9A-Za-z+/])+(?:==|=)?(?: .*)?$/ const asKey = (key, parameters, { calculateMissingRSAPrimes = false } = {}) => { let privateKey, publicKey, secret if (!importable.has(typeof key)) { throw new TypeError('key argument must be a string, buffer or an object') } if (parameters !== undefined && !isObject(parameters)) { throw new TypeError('parameters argument must be a plain object when provided') } if (key instanceof KeyObject) { switch (key.type) { case 'private': privateKey = key break case 'public': publicKey = key break case 'secret': secret = key break } } else if (typeof key === 'object' && key && 'kty' in key && key.kty === 'oct') { // symmetric key try { secret = createSecretKey(base64url.decodeToBuffer(key.k)) } catch (err) { if (!('k' in key)) { secret = { type: 'secret' } } } parameters = mergedParameters(parameters, key) } else if (typeof key === 'object' && key && 'kty' in key) { // assume JWK formatted asymmetric key ({ calculateMissingRSAPrimes = false } = parameters || { calculateMissingRSAPrimes }) let pem try { pem = jwkToPem(key, { calculateMissingRSAPrimes }) } catch (err) { if (err instanceof errors.JOSEError) { throw err } } if (pem && key.d) { privateKey = createPrivateKey(pem) } else if (pem) { publicKey = createPublicKey(pem) } parameters = mergedParameters({}, key) } else if (key && (typeof key === 'object' || typeof key === 'string')) { // | | passed to crypto.createPrivateKey or crypto.createPublicKey or passed to crypto.createSecretKey try { privateKey = createPrivateKey(key) } catch (err) { if (err instanceof errors.JOSEError) { throw err } } try { publicKey = createPublicKey(key) if (key.startsWith('-----BEGIN CERTIFICATE-----') && (!parameters || !('x5c' in parameters))) { parameters = mergedParameters(parameters, { x5c: [key.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '')] }) } } catch (err) { if (err instanceof errors.JOSEError) { throw err } } try { // this is to filter out invalid PEM keys and certs, i'll rather have them fail import then // have them imported as symmetric "oct" keys if (!key.includes('-----BEGIN') && !openSSHpublicKey.test(key.toString('ascii').replace(/[\r\n]/g, ''))) { secret = createSecretKey(Buffer.isBuffer(key) ? key : Buffer.from(key)) } } catch (err) {} } const keyObject = privateKey || publicKey || secret if (privateKey || publicKey) { switch (keyObject.asymmetricKeyType) { case 'rsa': return new RSAKey(keyObject, parameters) case 'ec': return new ECKey(keyObject, parameters) case 'ed25519': case 'ed448': case 'x25519': case 'x448': return new OKPKey(keyObject, parameters) default: throw new errors.JOSENotSupported('only RSA, EC and OKP asymmetric keys are supported') } } else if (secret) { return new OctKey(keyObject, parameters) } throw new errors.JWKImportFailed('key import failed') } module.exports = asKey /***/ }), /***/ 2297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Key = __webpack_require__(99795) const None = __webpack_require__(48114) const EmbeddedJWK = __webpack_require__(59116) const EmbeddedX5C = __webpack_require__(79313) const importKey = __webpack_require__(77722) const generate = __webpack_require__(87042) module.exports = { ...generate, asKey: importKey, isKey: input => input instanceof Key, None, EmbeddedJWK, EmbeddedX5C } /***/ }), /***/ 99795: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { strict: assert } = __webpack_require__(42357) const { inspect } = __webpack_require__(31669) const { EOL } = __webpack_require__(12087) const { keyObjectSupported } = __webpack_require__(57494) const { createPublicKey } = __webpack_require__(31032) const { keyObjectToJWK } = __webpack_require__(65394) const { THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS, JWK_MEMBERS, KEYOBJECT, USES_MAPPING, OPS, USES } = __webpack_require__(62928) const isObject = __webpack_require__(50243) const thumbprint = __webpack_require__(89020) const errors = __webpack_require__(35132) const privateApi = Symbol('privateApi') const { JWK } = __webpack_require__(47359) class Key { constructor (keyObject, { alg, use, kid, key_ops: ops, x5c, x5t, 'x5t#S256': x5t256 } = {}) { if (use !== undefined) { if (typeof use !== 'string' || !USES.has(use)) { throw new TypeError('`use` must be either "sig" or "enc" string when provided') } } if (alg !== undefined) { if (typeof alg !== 'string' || !alg) { throw new TypeError('`alg` must be a non-empty string when provided') } } if (kid !== undefined) { if (typeof kid !== 'string' || !kid) { throw new TypeError('`kid` must be a non-empty string when provided') } } if (ops !== undefined) { if (!Array.isArray(ops) || !ops.length || ops.some(o => typeof o !== 'string')) { throw new TypeError('`key_ops` must be a non-empty array of strings when provided') } ops = Array.from(new Set(ops)).filter(x => OPS.has(x)) } if (ops && use) { if ( (use === 'enc' && ops.some(x => USES_MAPPING.sig.has(x))) || (use === 'sig' && ops.some(x => USES_MAPPING.enc.has(x))) ) { throw new errors.JWKInvalid('inconsistent JWK "use" and "key_ops"') } } if (keyObjectSupported && x5c !== undefined) { if (!Array.isArray(x5c) || !x5c.length || x5c.some(c => typeof c !== 'string')) { throw new TypeError('`x5c` must be an array of one or more PKIX certificates when provided') } x5c.forEach((cert, i) => { let publicKey try { publicKey = createPublicKey({ key: `-----BEGIN CERTIFICATE-----${EOL}${(cert.match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END CERTIFICATE-----`, format: 'pem' }) } catch (err) { throw new errors.JWKInvalid(`\`x5c\` member at index ${i} is not a valid base64-encoded DER PKIX certificate`) } if (i === 0) { try { assert.deepEqual( publicKey.export({ type: 'spki', format: 'der' }), (keyObject.type === 'public' ? keyObject : createPublicKey(keyObject)).export({ type: 'spki', format: 'der' }) ) } catch (err) { throw new errors.JWKInvalid('The key in the first `x5c` certificate MUST match the public key represented by the JWK') } } }) } Object.defineProperties(this, { [KEYOBJECT]: { value: isObject(keyObject) ? undefined : keyObject }, keyObject: { get () { if (!keyObjectSupported) { throw new errors.JOSENotSupported('KeyObject class is not supported in your Node.js runtime version') } return this[KEYOBJECT] } }, type: { value: keyObject.type }, private: { value: keyObject.type === 'private' }, public: { value: keyObject.type === 'public' }, secret: { value: keyObject.type === 'secret' }, alg: { value: alg, enumerable: alg !== undefined }, use: { value: use, enumerable: use !== undefined }, x5c: { enumerable: x5c !== undefined, ...(x5c ? { get () { return [...x5c] } } : { value: undefined }) }, key_ops: { enumerable: ops !== undefined, ...(ops ? { get () { return [...ops] } } : { value: undefined }) }, kid: { enumerable: true, ...(kid ? { value: kid } : { get () { Object.defineProperty(this, 'kid', { value: this.thumbprint, configurable: false }) return this.kid }, configurable: true }) }, ...(x5c ? { x5t: { enumerable: true, ...(x5t ? { value: x5t } : { get () { Object.defineProperty(this, 'x5t', { value: thumbprint.x5t(this.x5c[0]), configurable: false }) return this.x5t }, configurable: true }) } } : undefined), ...(x5c ? { 'x5t#S256': { enumerable: true, ...(x5t256 ? { value: x5t256 } : { get () { Object.defineProperty(this, 'x5t#S256', { value: thumbprint['x5t#S256'](this.x5c[0]), configurable: false }) return this['x5t#S256'] }, configurable: true }) } } : undefined), thumbprint: { get () { Object.defineProperty(this, 'thumbprint', { value: thumbprint.kid(this[THUMBPRINT_MATERIAL]()), configurable: false }) return this.thumbprint }, configurable: true } }) } toPEM (priv = false, encoding = {}) { if (this.secret) { throw new TypeError('symmetric keys cannot be exported as PEM') } if (priv && this.public === true) { throw new TypeError('public key cannot be exported as private') } const { type = priv ? 'pkcs8' : 'spki', cipher, passphrase } = encoding let keyObject = this[KEYOBJECT] if (!priv) { if (this.private) { keyObject = createPublicKey(keyObject) } if (cipher || passphrase) { throw new TypeError('cipher and passphrase can only be applied when exporting private keys') } } if (priv) { return keyObject.export({ format: 'pem', type, cipher, passphrase }) } return keyObject.export({ format: 'pem', type }) } toJWK (priv = false) { if (priv && this.public === true) { throw new TypeError('public key cannot be exported as private') } const components = [...this.constructor[priv ? PRIVATE_MEMBERS : PUBLIC_MEMBERS]] .map(k => [k, this[k]]) const result = {} Object.keys(components).forEach((key) => { const [k, v] = components[key] result[k] = v }) result.kty = this.kty result.kid = this.kid if (this.alg) { result.alg = this.alg } if (this.key_ops && this.key_ops.length) { result.key_ops = this.key_ops } if (this.use) { result.use = this.use } if (this.x5c) { result.x5c = this.x5c } if (this.x5t) { result.x5t = this.x5t } if (this['x5t#S256']) { result['x5t#S256'] = this['x5t#S256'] } return result } [JWK_MEMBERS] () { const props = this[KEYOBJECT].type === 'private' ? this.constructor[PRIVATE_MEMBERS] : this.constructor[PUBLIC_MEMBERS] Object.defineProperties(this, [...props].reduce((acc, component) => { acc[component] = { get () { const jwk = keyObjectToJWK(this[KEYOBJECT]) Object.defineProperties( this, Object.entries(jwk) .filter(([key]) => props.has(key)) .reduce((acc, [key, value]) => { acc[key] = { value, enumerable: this.constructor[PUBLIC_MEMBERS].has(key), configurable: false } return acc }, {}) ) return this[component] }, enumerable: this.constructor[PUBLIC_MEMBERS].has(component), configurable: true } return acc }, {})) } /* c8 ignore next 8 */ [inspect.custom] () { return `${this.constructor.name} ${inspect(this.toJWK(false), { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true })}` } /* c8 ignore next 3 */ [THUMBPRINT_MATERIAL] () { throw new Error(`"[THUMBPRINT_MATERIAL]()" is not implemented on ${this.constructor.name}`) } algorithms (operation, /* the rest is private API */ int, opts) { const { use = this.use, alg = this.alg, key_ops: ops = this.key_ops } = int === privateApi ? opts : {} if (alg) { return new Set(this.algorithms(operation, privateApi, { alg: null, use, key_ops: ops }).has(alg) ? [alg] : undefined) } if (typeof operation === 'symbol') { try { return this[operation]() } catch (err) { return new Set() } } if (operation && ops && !ops.includes(operation)) { return new Set() } switch (operation) { case 'decrypt': case 'deriveKey': case 'encrypt': case 'sign': case 'unwrapKey': case 'verify': case 'wrapKey': return new Set(Object.entries(JWK[this.kty][operation]).map(([alg, fn]) => fn(this) ? alg : undefined).filter(Boolean)) case undefined: return new Set([ ...this.algorithms('sign'), ...this.algorithms('verify'), ...this.algorithms('decrypt'), ...this.algorithms('encrypt'), ...this.algorithms('unwrapKey'), ...this.algorithms('wrapKey'), ...this.algorithms('deriveKey') ]) default: throw new TypeError('invalid key operation') } } /* c8 ignore next 3 */ static async generate () { throw new Error(`"static async generate()" is not implemented on ${this.name}`) } /* c8 ignore next 3 */ static generateSync () { throw new Error(`"static generateSync()" is not implemented on ${this.name}`) } /* c8 ignore next 3 */ static get [PUBLIC_MEMBERS] () { throw new Error(`"static get [PUBLIC_MEMBERS]()" is not implemented on ${this.name}`) } /* c8 ignore next 3 */ static get [PRIVATE_MEMBERS] () { throw new Error(`"static get [PRIVATE_MEMBERS]()" is not implemented on ${this.name}`) } } module.exports = Key /***/ }), /***/ 36582: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { generateKeyPairSync, generateKeyPair: async } = __webpack_require__(76417) const { promisify } = __webpack_require__(31669) const { THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS, PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT } = __webpack_require__(62928) const { EC_CURVES } = __webpack_require__(47359) const { keyObjectSupported } = __webpack_require__(57494) const { createPublicKey, createPrivateKey } = __webpack_require__(31032) const errors = __webpack_require__(35132) const Key = __webpack_require__(99795) const generateKeyPair = promisify(async) const EC_PUBLIC = new Set(['crv', 'x', 'y']) Object.freeze(EC_PUBLIC) const EC_PRIVATE = new Set([...EC_PUBLIC, 'd']) Object.freeze(EC_PRIVATE) // Elliptic Curve Key Type class ECKey extends Key { constructor (...args) { super(...args) this[JWK_MEMBERS]() Object.defineProperty(this, 'kty', { value: 'EC', enumerable: true }) if (!EC_CURVES.has(this.crv)) { throw new errors.JOSENotSupported('unsupported EC key curve') } } static get [PUBLIC_MEMBERS] () { return EC_PUBLIC } static get [PRIVATE_MEMBERS] () { return EC_PRIVATE } // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special // JSON.stringify handling in V8 [THUMBPRINT_MATERIAL] () { return { crv: this.crv, kty: 'EC', x: this.x, y: this.y } } [KEY_MANAGEMENT_ENCRYPT] () { return this.algorithms('deriveKey') } [KEY_MANAGEMENT_DECRYPT] () { if (this.public) { return new Set() } return this.algorithms('deriveKey') } static async generate (crv = 'P-256', privat = true) { if (!EC_CURVES.has(crv)) { throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`) } let privateKey, publicKey if (keyObjectSupported) { ({ privateKey, publicKey } = await generateKeyPair('ec', { namedCurve: crv })) return privat ? privateKey : publicKey } ({ privateKey, publicKey } = await generateKeyPair('ec', { namedCurve: crv, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } })) if (privat) { return createPrivateKey(privateKey) } else { return createPublicKey(publicKey) } } static generateSync (crv = 'P-256', privat = true) { if (!EC_CURVES.has(crv)) { throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`) } let privateKey, publicKey if (keyObjectSupported) { ({ privateKey, publicKey } = generateKeyPairSync('ec', { namedCurve: crv })) return privat ? privateKey : publicKey } ({ privateKey, publicKey } = generateKeyPairSync('ec', { namedCurve: crv, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } })) if (privat) { return createPrivateKey(privateKey) } else { return createPublicKey(publicKey) } } } module.exports = ECKey /***/ }), /***/ 59116: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inspect } = __webpack_require__(31669) const Key = __webpack_require__(99795) class EmbeddedJWK extends Key { constructor () { super({ type: 'embedded' }) Object.defineProperties(this, { kid: { value: undefined }, kty: { value: undefined }, thumbprint: { value: undefined }, toJWK: { value: undefined }, toPEM: { value: undefined } }) } /* c8 ignore next 3 */ [inspect.custom] () { return 'Embedded.JWK {}' } algorithms () { return new Set() } } module.exports = new EmbeddedJWK() /***/ }), /***/ 79313: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inspect } = __webpack_require__(31669) const Key = __webpack_require__(99795) class EmbeddedX5C extends Key { constructor () { super({ type: 'embedded' }) Object.defineProperties(this, { kid: { value: undefined }, kty: { value: undefined }, thumbprint: { value: undefined }, toJWK: { value: undefined }, toPEM: { value: undefined } }) } /* c8 ignore next 3 */ [inspect.custom] () { return 'Embedded.X5C {}' } algorithms () { return new Set() } } module.exports = new EmbeddedX5C() /***/ }), /***/ 48114: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inspect } = __webpack_require__(31669) const Key = __webpack_require__(99795) class NoneKey extends Key { constructor () { super({ type: 'unsecured' }, { alg: 'none' }) Object.defineProperties(this, { kid: { value: undefined }, kty: { value: undefined }, thumbprint: { value: undefined }, toJWK: { value: undefined }, toPEM: { value: undefined } }) } /* c8 ignore next 3 */ [inspect.custom] () { return 'None {}' } algorithms (operation) { switch (operation) { case 'sign': case 'verify': case undefined: return new Set(['none']) default: return new Set() } } } module.exports = new NoneKey() /***/ }), /***/ 14591: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { randomBytes } = __webpack_require__(76417) const { createSecretKey } = __webpack_require__(31032) const base64url = __webpack_require__(93312) const { THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT, KEYOBJECT } = __webpack_require__(62928) const Key = __webpack_require__(99795) const OCT_PUBLIC = new Set() Object.freeze(OCT_PUBLIC) const OCT_PRIVATE = new Set(['k']) Object.freeze(OCT_PRIVATE) // Octet sequence Key Type class OctKey extends Key { constructor (...args) { super(...args) Object.defineProperties(this, { kty: { value: 'oct', enumerable: true }, length: { value: this[KEYOBJECT] ? this[KEYOBJECT].symmetricKeySize * 8 : undefined }, k: { enumerable: false, get () { if (this[KEYOBJECT]) { Object.defineProperty(this, 'k', { value: base64url.encodeBuffer(this[KEYOBJECT].export()), configurable: false }) } else { Object.defineProperty(this, 'k', { value: undefined, configurable: false }) } return this.k }, configurable: true } }) } static get [PUBLIC_MEMBERS] () { return OCT_PUBLIC } static get [PRIVATE_MEMBERS] () { return OCT_PRIVATE } // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special // JSON.stringify handling in V8 [THUMBPRINT_MATERIAL] () { if (!this[KEYOBJECT]) { throw new TypeError('reference "oct" keys without "k" cannot have their thumbprint calculated') } return { k: this.k, kty: 'oct' } } [KEY_MANAGEMENT_ENCRYPT] () { return new Set([ ...this.algorithms('wrapKey'), ...this.algorithms('deriveKey') ]) } [KEY_MANAGEMENT_DECRYPT] () { return this[KEY_MANAGEMENT_ENCRYPT]() } algorithms (...args) { if (!this[KEYOBJECT]) { return new Set() } return Key.prototype.algorithms.call(this, ...args) } static async generate (...args) { return this.generateSync(...args) } static generateSync (len = 256, privat = true) { if (!privat) { throw new TypeError('"oct" keys cannot be generated as public') } if (!Number.isSafeInteger(len) || !len || len % 8 !== 0) { throw new TypeError('invalid bit length') } return createSecretKey(randomBytes(len / 8)) } } module.exports = OctKey /***/ }), /***/ 8658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { generateKeyPairSync, generateKeyPair: async } = __webpack_require__(76417) const { promisify } = __webpack_require__(31669) const { THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS, PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT } = __webpack_require__(62928) const { OKP_CURVES } = __webpack_require__(47359) const { edDSASupported } = __webpack_require__(57494) const errors = __webpack_require__(35132) const Key = __webpack_require__(99795) const generateKeyPair = promisify(async) const OKP_PUBLIC = new Set(['crv', 'x']) Object.freeze(OKP_PUBLIC) const OKP_PRIVATE = new Set([...OKP_PUBLIC, 'd']) Object.freeze(OKP_PRIVATE) // Octet string key pairs Key Type class OKPKey extends Key { constructor (...args) { super(...args) this[JWK_MEMBERS]() Object.defineProperty(this, 'kty', { value: 'OKP', enumerable: true }) if (!OKP_CURVES.has(this.crv)) { throw new errors.JOSENotSupported('unsupported OKP key curve') } } static get [PUBLIC_MEMBERS] () { return OKP_PUBLIC } static get [PRIVATE_MEMBERS] () { return OKP_PRIVATE } // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special // JSON.stringify handling in V8 [THUMBPRINT_MATERIAL] () { return { crv: this.crv, kty: 'OKP', x: this.x } } [KEY_MANAGEMENT_ENCRYPT] () { return this.algorithms('deriveKey') } [KEY_MANAGEMENT_DECRYPT] () { if (this.public) { return new Set() } return this.algorithms('deriveKey') } static async generate (crv = 'Ed25519', privat = true) { if (!edDSASupported) { throw new errors.JOSENotSupported('OKP keys are not supported in your Node.js runtime version') } if (!OKP_CURVES.has(crv)) { throw new errors.JOSENotSupported(`unsupported OKP key curve: ${crv}`) } const { privateKey, publicKey } = await generateKeyPair(crv.toLowerCase()) return privat ? privateKey : publicKey } static generateSync (crv = 'Ed25519', privat = true) { if (!edDSASupported) { throw new errors.JOSENotSupported('OKP keys are not supported in your Node.js runtime version') } if (!OKP_CURVES.has(crv)) { throw new errors.JOSENotSupported(`unsupported OKP key curve: ${crv}`) } const { privateKey, publicKey } = generateKeyPairSync(crv.toLowerCase()) return privat ? privateKey : publicKey } } module.exports = OKPKey /***/ }), /***/ 52679: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { generateKeyPairSync, generateKeyPair: async } = __webpack_require__(76417) const { promisify } = __webpack_require__(31669) const { THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS, PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT } = __webpack_require__(62928) const { keyObjectSupported } = __webpack_require__(57494) const { createPublicKey, createPrivateKey } = __webpack_require__(31032) const Key = __webpack_require__(99795) const generateKeyPair = promisify(async) const RSA_PUBLIC = new Set(['e', 'n']) Object.freeze(RSA_PUBLIC) const RSA_PRIVATE = new Set([...RSA_PUBLIC, 'd', 'p', 'q', 'dp', 'dq', 'qi']) Object.freeze(RSA_PRIVATE) // RSA Key Type class RSAKey extends Key { constructor (...args) { super(...args) this[JWK_MEMBERS]() Object.defineProperties(this, { kty: { value: 'RSA', enumerable: true }, length: { get () { Object.defineProperty(this, 'length', { value: Buffer.byteLength(this.n, 'base64') * 8, configurable: false }) return this.length }, configurable: true } }) } static get [PUBLIC_MEMBERS] () { return RSA_PUBLIC } static get [PRIVATE_MEMBERS] () { return RSA_PRIVATE } // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special // JSON.stringify handling in V8 [THUMBPRINT_MATERIAL] () { return { e: this.e, kty: 'RSA', n: this.n } } [KEY_MANAGEMENT_ENCRYPT] () { return this.algorithms('wrapKey') } [KEY_MANAGEMENT_DECRYPT] () { return this.algorithms('unwrapKey') } static async generate (len = 2048, privat = true) { if (!Number.isSafeInteger(len) || len < 512 || len % 8 !== 0 || (('electron' in process.versions) && len % 128 !== 0)) { throw new TypeError('invalid bit length') } let privateKey, publicKey if (keyObjectSupported) { ({ privateKey, publicKey } = await generateKeyPair('rsa', { modulusLength: len })) return privat ? privateKey : publicKey } ({ privateKey, publicKey } = await generateKeyPair('rsa', { modulusLength: len, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } })) if (privat) { return createPrivateKey(privateKey) } else { return createPublicKey(publicKey) } } static generateSync (len = 2048, privat = true) { if (!Number.isSafeInteger(len) || len < 512 || len % 8 !== 0 || (('electron' in process.versions) && len % 128 !== 0)) { throw new TypeError('invalid bit length') } let privateKey, publicKey if (keyObjectSupported) { ({ privateKey, publicKey } = generateKeyPairSync('rsa', { modulusLength: len })) return privat ? privateKey : publicKey } ({ privateKey, publicKey } = generateKeyPairSync('rsa', { modulusLength: len, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } })) if (privat) { return createPrivateKey(privateKey) } else { return createPublicKey(publicKey) } } } module.exports = RSAKey /***/ }), /***/ 89020: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createHash } = __webpack_require__(76417) const base64url = __webpack_require__(93312) const x5t = (hash, cert) => base64url.encodeBuffer(createHash(hash).update(Buffer.from(cert, 'base64')).digest()) module.exports.kid = components => base64url.encodeBuffer(createHash('sha256').update(JSON.stringify(components)).digest()) module.exports.x5t = x5t.bind(undefined, 'sha1') module.exports["x5t#S256"] = x5t.bind(undefined, 'sha256') /***/ }), /***/ 27397: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const KeyStore = __webpack_require__(44201) module.exports = KeyStore /***/ }), /***/ 44201: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inspect } = __webpack_require__(31669) const isObject = __webpack_require__(50243) const { generate, generateSync } = __webpack_require__(87042) const { USES_MAPPING } = __webpack_require__(62928) const { isKey, asKey: importKey } = __webpack_require__(2297) const keyscore = (key, { alg, use, ops }) => { let score = 0 if (alg && key.alg) { score++ } if (use && key.use) { score++ } if (ops && key.key_ops) { score++ } return score } class KeyStore { constructor (...keys) { while (keys.some(Array.isArray)) { keys = keys.flat ? keys.flat() : keys.reduce((acc, val) => { if (Array.isArray(val)) { return [...acc, ...val] } acc.push(val) return acc }, []) } if (keys.some(k => !isKey(k) || !k.kty)) { throw new TypeError('all keys must be instances of a key instantiated by JWK.asKey') } this._keys = new Set(keys) } all ({ alg, kid, thumbprint, use, kty, key_ops: ops, x5t, 'x5t#S256': x5t256, crv } = {}) { if (ops !== undefined && (!Array.isArray(ops) || !ops.length || ops.some(x => typeof x !== 'string'))) { throw new TypeError('`key_ops` must be a non-empty array of strings') } const search = { alg, use, ops } return [...this._keys] .filter((key) => { let candidate = true if (candidate && kid !== undefined && key.kid !== kid) { candidate = false } if (candidate && thumbprint !== undefined && key.thumbprint !== thumbprint) { candidate = false } if (candidate && x5t !== undefined && key.x5t !== x5t) { candidate = false } if (candidate && x5t256 !== undefined && key['x5t#S256'] !== x5t256) { candidate = false } if (candidate && kty !== undefined && key.kty !== kty) { candidate = false } if (candidate && crv !== undefined && (key.crv !== crv)) { candidate = false } if (alg !== undefined && !key.algorithms().has(alg)) { candidate = false } if (candidate && use !== undefined && (key.use !== undefined && key.use !== use)) { candidate = false } // TODO: if (candidate && ops !== undefined && (key.key_ops !== undefined || key.use !== undefined)) { let keyOps if (key.key_ops) { keyOps = new Set(key.key_ops) } else { keyOps = USES_MAPPING[key.use] } if (ops.some(x => !keyOps.has(x))) { candidate = false } } return candidate }) .sort((first, second) => keyscore(second, search) - keyscore(first, search)) } get (...args) { return this.all(...args)[0] } add (key) { if (!isKey(key) || !key.kty) { throw new TypeError('key must be an instance of a key instantiated by JWK.asKey') } this._keys.add(key) } remove (key) { if (!isKey(key)) { throw new TypeError('key must be an instance of a key instantiated by JWK.asKey') } this._keys.delete(key) } toJWKS (priv = false) { return { keys: [...this._keys.values()].map( key => key.toJWK(priv && (key.private || (key.secret && key.k))) ) } } async generate (...args) { this._keys.add(await generate(...args)) } generateSync (...args) { this._keys.add(generateSync(...args)) } get size () { return this._keys.size } /* c8 ignore next 8 */ [inspect.custom] () { return `${this.constructor.name} ${inspect(this.toJWKS(false), { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true })}` } * [Symbol.iterator] () { for (const key of this._keys) { yield key } } } function asKeyStore (jwks, { ignoreErrors = false, calculateMissingRSAPrimes = false } = {}) { if (!isObject(jwks) || !Array.isArray(jwks.keys) || jwks.keys.some(k => !isObject(k) || !('kty' in k))) { throw new TypeError('jwks must be a JSON Web Key Set formatted object') } const keys = jwks.keys.map((jwk) => { try { return importKey(jwk, { calculateMissingRSAPrimes }) } catch (err) { if (!ignoreErrors) { throw err } return undefined } }).filter(Boolean) return new KeyStore(...keys) } module.exports = { KeyStore, asKeyStore } /***/ }), /***/ 49830: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Sign = __webpack_require__(81194) const { verify } = __webpack_require__(45057) const single = (serialization, payload, key, protectedHeader, unprotectedHeader) => { return new Sign(payload) .recipient(key, protectedHeader, unprotectedHeader) .sign(serialization) } module.exports.Sign = Sign module.exports.sign = single.bind(undefined, 'compact') module.exports.sign.flattened = single.bind(undefined, 'flattened') module.exports.sign.general = single.bind(undefined, 'general') module.exports.verify = verify /***/ }), /***/ 21708: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isObject = __webpack_require__(50243) let validateCrit = __webpack_require__(85822) const { JWSInvalid } = __webpack_require__(35132) validateCrit = validateCrit.bind(undefined, JWSInvalid) const compactSerializer = (payload, [recipient]) => { return `${recipient.protected}.${payload}.${recipient.signature}` } compactSerializer.validate = (jws, { 0: { unprotectedHeader, protectedHeader }, length }) => { if (length !== 1 || unprotectedHeader) { throw new JWSInvalid('JWS Compact Serialization doesn\'t support multiple recipients or JWS unprotected headers') } validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined) } const flattenedSerializer = (payload, [recipient]) => { const { header, signature, protected: prot } = recipient return { payload, ...prot ? { protected: prot } : undefined, ...header ? { header } : undefined, signature } } flattenedSerializer.validate = (jws, { 0: { unprotectedHeader, protectedHeader }, length }) => { if (length !== 1) { throw new JWSInvalid('Flattened JWS JSON Serialization doesn\'t support multiple recipients') } validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined) } const generalSerializer = (payload, recipients) => { return { payload, signatures: recipients.map(({ header, signature, protected: prot }) => { return { ...prot ? { protected: prot } : undefined, ...header ? { header } : undefined, signature } }) } } generalSerializer.validate = (jws, recipients) => { let validateB64 = false recipients.forEach(({ protectedHeader, unprotectedHeader }) => { if (protectedHeader && !validateB64 && 'b64' in protectedHeader) { validateB64 = true } validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined) }) if (validateB64) { const values = recipients.map(({ protectedHeader }) => protectedHeader && protectedHeader.b64) if (!values.every((actual, i, [expected]) => actual === expected)) { throw new JWSInvalid('the "b64" Header Parameter value MUST be the same for all recipients') } } } const isJSON = (input) => { return isObject(input) && (typeof input.payload === 'string' || Buffer.isBuffer(input.payload)) } const isValidRecipient = (recipient) => { return isObject(recipient) && typeof recipient.signature === 'string' && (recipient.header === undefined || isObject(recipient.header)) && (recipient.protected === undefined || typeof recipient.protected === 'string') } const isMultiRecipient = (input) => { if (Array.isArray(input.signatures) && input.signatures.every(isValidRecipient)) { return true } return false } const detect = (input) => { if (typeof input === 'string' && input.split('.').length === 3) { return 'compact' } if (isJSON(input)) { if (isMultiRecipient(input)) { return 'general' } if (isValidRecipient(input)) { return 'flattened' } } throw new JWSInvalid('JWS malformed or invalid serialization') } module.exports = { compact: compactSerializer, flattened: flattenedSerializer, general: generalSerializer, detect } /***/ }), /***/ 81194: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const base64url = __webpack_require__(93312) const isDisjoint = __webpack_require__(48899) const isObject = __webpack_require__(50243) const deepClone = __webpack_require__(52083) const { JWSInvalid } = __webpack_require__(35132) const { sign } = __webpack_require__(40423) const getKey = __webpack_require__(7090) const serializers = __webpack_require__(21708) const PROCESS_RECIPIENT = Symbol('PROCESS_RECIPIENT') class Sign { constructor (payload) { if (typeof payload === 'string') { payload = base64url.encode(payload) } else if (Buffer.isBuffer(payload)) { payload = base64url.encodeBuffer(payload) this._binary = true } else if (isObject(payload)) { payload = base64url.JSON.encode(payload) } else { throw new TypeError('payload argument must be a Buffer, string or an object') } this._payload = payload this._recipients = [] } /* * @public */ recipient (key, protectedHeader, unprotectedHeader) { key = getKey(key) if (protectedHeader !== undefined && !isObject(protectedHeader)) { throw new TypeError('protectedHeader argument must be a plain object when provided') } if (unprotectedHeader !== undefined && !isObject(unprotectedHeader)) { throw new TypeError('unprotectedHeader argument must be a plain object when provided') } if (!isDisjoint(protectedHeader, unprotectedHeader)) { throw new JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint') } this._recipients.push({ key, protectedHeader: protectedHeader ? deepClone(protectedHeader) : undefined, unprotectedHeader: unprotectedHeader ? deepClone(unprotectedHeader) : undefined }) return this } /* * @private */ [PROCESS_RECIPIENT] (recipient, first) { const { key, protectedHeader, unprotectedHeader } = recipient if (key.use === 'enc') { throw new TypeError('a key with "use":"enc" is not usable for signing') } const joseHeader = { protected: protectedHeader || {}, unprotected: unprotectedHeader || {} } let alg = joseHeader.protected.alg || joseHeader.unprotected.alg if (!alg) { alg = key.alg || [...key.algorithms('sign')][0] if (recipient.protectedHeader) { joseHeader.protected.alg = recipient.protectedHeader.alg = alg } else { joseHeader.protected = recipient.protectedHeader = { alg } } } if (!alg) { throw new JWSInvalid('could not resolve a usable "alg" for a recipient') } recipient.header = unprotectedHeader recipient.protected = Object.keys(joseHeader.protected).length ? base64url.JSON.encode(joseHeader.protected) : '' if (first && joseHeader.protected.crit && joseHeader.protected.crit.includes('b64') && joseHeader.protected.b64 === false) { if (this._binary) { this._payload = base64url.decodeToBuffer(this._payload) } else { this._payload = base64url.decode(this._payload) } } const data = Buffer.concat([ Buffer.from(recipient.protected || ''), Buffer.from('.'), Buffer.from(this._payload) ]) recipient.signature = base64url.encodeBuffer(sign(alg, key, data)) } /* * @public */ sign (serialization) { const serializer = serializers[serialization] if (!serializer) { throw new TypeError('serialization must be one of "compact", "flattened", "general"') } if (!this._recipients.length) { throw new JWSInvalid('missing recipients') } serializer.validate(this, this._recipients) this._recipients.forEach((recipient, i) => { this[PROCESS_RECIPIENT](recipient, i === 0) }) return serializer(this._payload, this._recipients) } } module.exports = Sign /***/ }), /***/ 45057: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { EOL } = __webpack_require__(12087) const base64url = __webpack_require__(93312) const isDisjoint = __webpack_require__(48899) const isObject = __webpack_require__(50243) let validateCrit = __webpack_require__(85822) const getKey = __webpack_require__(7090) const { KeyStore } = __webpack_require__(27397) const errors = __webpack_require__(35132) const { check, verify } = __webpack_require__(40423) const JWK = __webpack_require__(2297) const { detect: resolveSerialization } = __webpack_require__(21708) validateCrit = validateCrit.bind(undefined, errors.JWSInvalid) const SINGLE_RECIPIENT = new Set(['compact', 'flattened', 'preparsed']) /* * @public */ const jwsVerify = (skipDisjointCheck, serialization, jws, key, { crit = [], complete = false, algorithms } = {}) => { key = getKey(key, true) if (algorithms !== undefined && (!Array.isArray(algorithms) || algorithms.some(s => typeof s !== 'string' || !s))) { throw new TypeError('"algorithms" option must be an array of non-empty strings') } else if (algorithms) { algorithms = new Set(algorithms) } if (!Array.isArray(crit) || crit.some(s => typeof s !== 'string' || !s)) { throw new TypeError('"crit" option must be an array of non-empty strings') } if (!serialization) { serialization = resolveSerialization(jws) } let prot // protected header let header // unprotected header let payload let signature let alg // treat general format with one recipient as flattened // skips iteration and avoids multi errors in this case if (serialization === 'general' && jws.signatures.length === 1) { serialization = 'flattened' const { signatures, ...root } = jws jws = { ...root, ...signatures[0] } } let decoded if (SINGLE_RECIPIENT.has(serialization)) { let parsedProt = {} switch (serialization) { case 'compact': // compact serialization format ([prot, payload, signature] = jws.split('.')) break case 'flattened': // flattened serialization format ({ protected: prot, payload, signature, header } = jws) break case 'preparsed': { // from the JWT module ({ decoded } = jws); ([prot, payload, signature] = jws.token.split('.')) break } } if (!header) { skipDisjointCheck = true } if (decoded) { parsedProt = decoded.header } else if (prot) { try { parsedProt = base64url.JSON.decode(prot) } catch (err) { throw new errors.JWSInvalid('could not parse JWS protected header') } } else { skipDisjointCheck = skipDisjointCheck || true } if (!skipDisjointCheck && !isDisjoint(parsedProt, header)) { throw new errors.JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint') } const combinedHeader = { ...parsedProt, ...header } validateCrit(parsedProt, header, crit) alg = parsedProt.alg || (header && header.alg) if (!alg) { throw new errors.JWSInvalid('missing JWS signature algorithm') } else if (algorithms && !algorithms.has(alg)) { throw new errors.JOSEAlgNotWhitelisted('alg not whitelisted') } if (key instanceof KeyStore) { const keystore = key const keys = keystore.all({ kid: combinedHeader.kid, alg: combinedHeader.alg, key_ops: ['verify'] }) switch (keys.length) { case 0: throw new errors.JWKSNoMatchingKey() case 1: // treat the call as if a Key instance was passed in // skips iteration and avoids multi errors in this case key = keys[0] break default: { const errs = [] for (const key of keys) { try { return jwsVerify(true, serialization, jws, key, { crit, complete, algorithms: algorithms ? [...algorithms] : undefined }) } catch (err) { errs.push(err) continue } } const multi = new errors.JOSEMultiError(errs) if ([...multi].some(e => e instanceof errors.JWSVerificationFailed)) { throw new errors.JWSVerificationFailed() } throw multi } } } if (key === JWK.EmbeddedJWK) { if (!isObject(combinedHeader.jwk)) { throw new errors.JWSInvalid('JWS Header Parameter "jwk" must be a JSON object') } key = JWK.asKey(combinedHeader.jwk) if (key.type !== 'public') { throw new errors.JWSInvalid('JWS Header Parameter "jwk" must be a public key') } } else if (key === JWK.EmbeddedX5C) { if (!Array.isArray(combinedHeader.x5c) || !combinedHeader.x5c.length || combinedHeader.x5c.some(c => typeof c !== 'string' || !c)) { throw new errors.JWSInvalid('JWS Header Parameter "x5c" must be a JSON array of certificate value strings') } key = JWK.asKey( `-----BEGIN CERTIFICATE-----${EOL}${(combinedHeader.x5c[0].match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END CERTIFICATE-----`, { x5c: combinedHeader.x5c } ) } check(key, 'verify', alg) const toBeVerified = Buffer.concat([ Buffer.from(prot || ''), Buffer.from('.'), Buffer.isBuffer(payload) ? payload : Buffer.from(payload) ]) if (!verify(alg, key, toBeVerified, base64url.decodeToBuffer(signature))) { throw new errors.JWSVerificationFailed() } if (combinedHeader.b64 === false) { payload = Buffer.from(payload) } else { payload = base64url.decodeToBuffer(payload) } if (complete) { const result = { payload, key } if (prot) result.protected = parsedProt if (header) result.header = header return result } return payload } // general serialization format const { signatures, ...root } = jws const errs = [] for (const recipient of signatures) { try { return jwsVerify(false, 'flattened', { ...root, ...recipient }, key, { crit, complete, algorithms: algorithms ? [...algorithms] : undefined }) } catch (err) { errs.push(err) continue } } const multi = new errors.JOSEMultiError(errs) if ([...multi].some(e => e instanceof errors.JWSVerificationFailed)) { throw new errors.JWSVerificationFailed() } else if ([...multi].every(e => e instanceof errors.JWKSNoMatchingKey)) { throw new errors.JWKSNoMatchingKey() } throw multi } module.exports = { bare: jwsVerify, verify: jwsVerify.bind(undefined, false, undefined) } /***/ }), /***/ 85955: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const base64url = __webpack_require__(93312) const errors = __webpack_require__(35132) module.exports = (token, { complete = false } = {}) => { if (typeof token !== 'string' || !token) { throw new TypeError('JWT must be a string') } const { 0: header, 1: payload, 2: signature, length } = token.split('.') if (length === 5) { throw new TypeError('encrypted JWTs cannot be decoded') } if (length !== 3) { throw new errors.JWTMalformed('JWTs must have three components') } try { const result = { header: base64url.JSON.decode(header), payload: base64url.JSON.decode(payload), signature } return complete ? result : result.payload } catch (err) { throw new errors.JWTMalformed('JWT is malformed') } } /***/ }), /***/ 40449: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const decode = __webpack_require__(85955) const sign = __webpack_require__(82011) const verify = __webpack_require__(88493) const profiles = __webpack_require__(52651) module.exports = { sign, verify, ...profiles } Object.defineProperty(module.exports, "decode", ({ enumerable: false, configurable: true, value: decode })) /***/ }), /***/ 52651: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { JWTClaimInvalid } = __webpack_require__(35132) const secs = __webpack_require__(84096) const epoch = __webpack_require__(33773) const isObject = __webpack_require__(50243) const verify = __webpack_require__(88493) const { isString, isRequired, isTimestamp, isStringOrArrayOfStrings } = __webpack_require__(29051) const isPayloadRequired = isRequired.bind(undefined, JWTClaimInvalid) const isPayloadString = isString.bind(undefined, JWTClaimInvalid) const isOptionString = isString.bind(undefined, TypeError) const defineLazyExportWithWarning = (obj, property, name, definition) => { Object.defineProperty(obj, property, { enumerable: true, configurable: true, value (...args) { process.emitWarning( `The ${name} API implements an IETF draft. Breaking draft implementations are included as minor versions of the jose library, therefore, the ~ semver operator should be used and close attention be payed to library changelog as well as the drafts themselves.`, 'DraftWarning' ) Object.defineProperty(obj, property, { enumerable: true, configurable: true, value: definition }) return obj[property](...args) } }) } const validateCommonOptions = (options, profile) => { if (!isObject(options)) { throw new TypeError('options must be an object') } if (!options.issuer) { throw new TypeError(`"issuer" option is required to validate ${profile}`) } if (!options.audience) { throw new TypeError(`"audience" option is required to validate ${profile}`) } } module.exports = { IdToken: { verify: (token, key, options = {}) => { validateCommonOptions(options, 'an ID Token') if ('maxAuthAge' in options) { isOptionString(options.maxAuthAge, 'options.maxAuthAge') } if ('nonce' in options) { isOptionString(options.nonce, 'options.nonce') } const unix = epoch(options.now || new Date()) const result = verify(token, key, { ...options }) const payload = options.complete ? result.payload : result if (Array.isArray(payload.aud) && payload.aud.length > 1) { isPayloadRequired(payload.azp, '"azp" claim', 'azp') } isPayloadRequired(payload.iat, '"iat" claim', 'iat') isPayloadRequired(payload.sub, '"sub" claim', 'sub') isPayloadRequired(payload.exp, '"exp" claim', 'exp') isTimestamp(payload.auth_time, 'auth_time', !!options.maxAuthAge) isPayloadString(payload.nonce, '"nonce" claim', 'nonce', !!options.nonce) isPayloadString(payload.acr, '"acr" claim', 'acr') isStringOrArrayOfStrings(payload.amr, 'amr') if (options.nonce && payload.nonce !== options.nonce) { throw new JWTClaimInvalid('unexpected "nonce" claim value', 'nonce', 'check_failed') } const tolerance = options.clockTolerance ? secs(options.clockTolerance) : 0 if (options.maxAuthAge) { const maxAuthAgeSeconds = secs(options.maxAuthAge) if (payload.auth_time + maxAuthAgeSeconds < unix - tolerance) { throw new JWTClaimInvalid('"auth_time" claim timestamp check failed (too much time has elapsed since the last End-User authentication)', 'auth_time', 'check_failed') } } if (Array.isArray(payload.aud) && payload.aud.length > 1 && payload.azp !== options.audience) { throw new JWTClaimInvalid('unexpected "azp" claim value', 'azp', 'check_failed') } return result } }, LogoutToken: {}, AccessToken: {} } defineLazyExportWithWarning(module.exports.LogoutToken, 'verify', 'jose.JWT.LogoutToken.verify', (token, key, options = {}) => { validateCommonOptions(options, 'a Logout Token') const result = verify(token, key, { ...options }) const payload = options.complete ? result.payload : result isPayloadRequired(payload.iat, '"iat" claim', 'iat') isPayloadRequired(payload.jti, '"jti" claim', 'jti') isPayloadString(payload.sid, '"sid" claim', 'sid') if (!('sid' in payload) && !('sub' in payload)) { throw new JWTClaimInvalid('either "sid" or "sub" (or both) claims must be present') } if ('nonce' in payload) { throw new JWTClaimInvalid('"nonce" claim is prohibited', 'nonce', 'prohibited') } if (!('events' in payload)) { throw new JWTClaimInvalid('"events" claim is missing', 'events', 'missing') } if (!isObject(payload.events)) { throw new JWTClaimInvalid('"events" claim must be an object', 'events', 'invalid') } if (!('http://schemas.openid.net/event/backchannel-logout' in payload.events)) { throw new JWTClaimInvalid('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim', 'events', 'invalid') } if (!isObject(payload.events['http://schemas.openid.net/event/backchannel-logout'])) { throw new JWTClaimInvalid('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object', 'events', 'invalid') } return result }) defineLazyExportWithWarning(module.exports.AccessToken, 'verify', 'jose.JWT.AccessToken.verify', (token, key, options = {}) => { validateCommonOptions(options, 'a JWT Access Token') isOptionString(options.maxAuthAge, 'options.maxAuthAge') const unix = epoch(options.now || new Date()) const typ = 'at+JWT' const result = verify(token, key, { ...options, typ }) const payload = options.complete ? result.payload : result isPayloadRequired(payload.iat, '"iat" claim', 'iat') isPayloadRequired(payload.exp, '"exp" claim', 'exp') isPayloadRequired(payload.sub, '"sub" claim', 'sub') isPayloadRequired(payload.jti, '"jti" claim', 'jti') isPayloadString(payload.client_id, '"client_id" claim', 'client_id', true) isTimestamp(payload.auth_time, 'auth_time', !!options.maxAuthAge) isPayloadString(payload.acr, '"acr" claim', 'acr') isStringOrArrayOfStrings(payload.amr, 'amr') const tolerance = options.clockTolerance ? secs(options.clockTolerance) : 0 if (options.maxAuthAge) { const maxAuthAgeSeconds = secs(options.maxAuthAge) if (payload.auth_time + maxAuthAgeSeconds < unix - tolerance) { throw new JWTClaimInvalid('"auth_time" claim timestamp check failed (too much time has elapsed since the last End-User authentication)', 'auth_time', 'check_failed') } } return result }) /***/ }), /***/ 29051: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { JWTClaimInvalid } = __webpack_require__(35132) const isNotString = val => typeof val !== 'string' || val.length === 0 const isNotArrayOfStrings = val => !Array.isArray(val) || val.length === 0 || val.some(isNotString) const isRequired = (Err, value, label, claim) => { if (value === undefined) { throw new Err(`${label} is missing`, claim, 'missing') } } const isString = (Err, value, label, claim, required = false) => { if (required) { isRequired(Err, value, label, claim) } if (value !== undefined && isNotString(value)) { throw new Err(`${label} must be a string`, claim, 'invalid') } } const isTimestamp = (value, label, required = false) => { if (required && value === undefined) { throw new JWTClaimInvalid(`"${label}" claim is missing`, label, 'missing') } if (value !== undefined && (typeof value !== 'number')) { throw new JWTClaimInvalid(`"${label}" claim must be a JSON numeric value`, label, 'invalid') } } const isStringOrArrayOfStrings = (value, label, required = false) => { if (required && value === undefined) { throw new JWTClaimInvalid(`"${label}" claim is missing`, label, 'missing') } if (value !== undefined && (isNotString(value) && isNotArrayOfStrings(value))) { throw new JWTClaimInvalid(`"${label}" claim must be a string or array of strings`, label, 'invalid') } } module.exports = { isNotArrayOfStrings, isRequired, isNotString, isString, isTimestamp, isStringOrArrayOfStrings } /***/ }), /***/ 82011: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isObject = __webpack_require__(50243) const secs = __webpack_require__(84096) const epoch = __webpack_require__(33773) const getKey = __webpack_require__(7090) const JWS = __webpack_require__(49830) const isString = __webpack_require__(29051).isString.bind(undefined, TypeError) const validateOptions = (options) => { if (typeof options.iat !== 'boolean') { throw new TypeError('options.iat must be a boolean') } if (typeof options.kid !== 'boolean') { throw new TypeError('options.kid must be a boolean') } isString(options.subject, 'options.subject') isString(options.issuer, 'options.issuer') if ( options.audience !== undefined && ( (typeof options.audience !== 'string' || !options.audience) && (!Array.isArray(options.audience) || options.audience.length === 0 || options.audience.some(a => !a || typeof a !== 'string')) ) ) { throw new TypeError('options.audience must be a string or an array of strings') } if (!isObject(options.header)) { throw new TypeError('options.header must be an object') } isString(options.algorithm, 'options.algorithm') isString(options.expiresIn, 'options.expiresIn') isString(options.notBefore, 'options.notBefore') isString(options.jti, 'options.jti') if (options.now !== undefined && (!(options.now instanceof Date) || !options.now.getTime())) { throw new TypeError('options.now must be a valid Date object') } } module.exports = (payload, key, options = {}) => { if (!isObject(options)) { throw new TypeError('options must be an object') } const { algorithm, audience, expiresIn, header = {}, iat = true, issuer, jti, kid = true, notBefore, subject, now } = options validateOptions({ algorithm, audience, expiresIn, header, iat, issuer, jti, kid, notBefore, now, subject }) if (!isObject(payload)) { throw new TypeError('payload must be an object') } let unix if (expiresIn || notBefore || iat) { unix = epoch(now || new Date()) } payload = { ...payload, sub: subject || payload.sub, aud: audience || payload.aud, iss: issuer || payload.iss, jti: jti || payload.jti, iat: iat ? unix : payload.iat, exp: expiresIn ? unix + secs(expiresIn) : payload.exp, nbf: notBefore ? unix + secs(notBefore) : payload.nbf } key = getKey(key) let includeKid if (typeof options.kid === 'boolean') { includeKid = kid } else { includeKid = !key.secret } return JWS.sign(JSON.stringify(payload), key, { ...header, alg: algorithm || header.alg, kid: includeKid ? key.kid : header.kid }) } /***/ }), /***/ 88493: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const isObject = __webpack_require__(50243) const epoch = __webpack_require__(33773) const secs = __webpack_require__(84096) const getKey = __webpack_require__(7090) const { bare: verify } = __webpack_require__(45057) const { JWTClaimInvalid, JWTExpired } = __webpack_require__(35132) const { isString, isNotString, isNotArrayOfStrings, isTimestamp, isStringOrArrayOfStrings } = __webpack_require__(29051) const decode = __webpack_require__(85955) const isPayloadString = isString.bind(undefined, JWTClaimInvalid) const isOptionString = isString.bind(undefined, TypeError) const normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, '') const validateOptions = ({ algorithms, audience, clockTolerance, complete = false, crit, ignoreExp = false, ignoreIat = false, ignoreNbf = false, issuer, jti, maxTokenAge, now = new Date(), subject, typ }) => { if (typeof complete !== 'boolean') { throw new TypeError('options.complete must be a boolean') } if (typeof ignoreExp !== 'boolean') { throw new TypeError('options.ignoreExp must be a boolean') } if (typeof ignoreNbf !== 'boolean') { throw new TypeError('options.ignoreNbf must be a boolean') } if (typeof ignoreIat !== 'boolean') { throw new TypeError('options.ignoreIat must be a boolean') } isOptionString(maxTokenAge, 'options.maxTokenAge') isOptionString(subject, 'options.subject') isOptionString(jti, 'options.jti') isOptionString(clockTolerance, 'options.clockTolerance') isOptionString(typ, 'options.typ') if (issuer !== undefined && (isNotString(issuer) && isNotArrayOfStrings(issuer))) { throw new TypeError('options.issuer must be a string or an array of strings') } if (audience !== undefined && (isNotString(audience) && isNotArrayOfStrings(audience))) { throw new TypeError('options.audience must be a string or an array of strings') } if (algorithms !== undefined && isNotArrayOfStrings(algorithms)) { throw new TypeError('options.algorithms must be an array of strings') } if (!(now instanceof Date) || !now.getTime()) { throw new TypeError('options.now must be a valid Date object') } if (ignoreIat && maxTokenAge !== undefined) { throw new TypeError('options.ignoreIat and options.maxTokenAge cannot used together') } if (crit !== undefined && isNotArrayOfStrings(crit)) { throw new TypeError('options.crit must be an array of strings') } return { algorithms, audience, clockTolerance, complete, crit, ignoreExp, ignoreIat, ignoreNbf, issuer, jti, maxTokenAge, now, subject, typ } } const validateTypes = ({ header, payload }, options) => { isPayloadString(header.alg, '"alg" header parameter', 'alg', true) isTimestamp(payload.iat, 'iat', !!options.maxTokenAge) isTimestamp(payload.exp, 'exp') isTimestamp(payload.nbf, 'nbf') isPayloadString(payload.jti, '"jti" claim', 'jti', !!options.jti) isStringOrArrayOfStrings(payload.iss, 'iss', !!options.issuer) isPayloadString(payload.sub, '"sub" claim', 'sub', !!options.subject) isStringOrArrayOfStrings(payload.aud, 'aud', !!options.audience) isPayloadString(header.typ, '"typ" header parameter', 'typ', !!options.typ) } const checkAudiencePresence = (audPayload, audOption) => { if (typeof audPayload === 'string') { return audOption.includes(audPayload) } // Each principal intended to process the JWT MUST // identify itself with a value in the audience claim audPayload = new Set(audPayload) return audOption.some(Set.prototype.has.bind(audPayload)) } module.exports = (token, key, options = {}) => { if (!isObject(options)) { throw new TypeError('options must be an object') } const { algorithms, audience, clockTolerance, complete, crit, ignoreExp, ignoreIat, ignoreNbf, issuer, jti, maxTokenAge, now, subject, typ } = options = validateOptions(options) const decoded = decode(token, { complete: true }) key = getKey(key, true) if (complete) { ({ key } = verify(true, 'preparsed', { decoded, token }, key, { crit, algorithms, complete: true })) decoded.key = key } else { verify(true, 'preparsed', { decoded, token }, key, { crit, algorithms }) } const unix = epoch(now) validateTypes(decoded, options) if (issuer && (typeof decoded.payload.iss !== 'string' || !(typeof issuer === 'string' ? [issuer] : issuer).includes(decoded.payload.iss))) { throw new JWTClaimInvalid('unexpected "iss" claim value', 'iss', 'check_failed') } if (subject && decoded.payload.sub !== subject) { throw new JWTClaimInvalid('unexpected "sub" claim value', 'sub', 'check_failed') } if (jti && decoded.payload.jti !== jti) { throw new JWTClaimInvalid('unexpected "jti" claim value', 'jti', 'check_failed') } if (audience && !checkAudiencePresence(decoded.payload.aud, typeof audience === 'string' ? [audience] : audience)) { throw new JWTClaimInvalid('unexpected "aud" claim value', 'aud', 'check_failed') } if (typ && normalizeTyp(decoded.header.typ) !== normalizeTyp(typ)) { throw new JWTClaimInvalid('unexpected "typ" JWT header value', 'typ', 'check_failed') } const tolerance = clockTolerance ? secs(clockTolerance) : 0 if (!ignoreIat && !('exp' in decoded.payload) && 'iat' in decoded.payload && decoded.payload.iat > unix + tolerance) { throw new JWTClaimInvalid('"iat" claim timestamp check failed (it should be in the past)', 'iat', 'check_failed') } if (!ignoreNbf && 'nbf' in decoded.payload && decoded.payload.nbf > unix + tolerance) { throw new JWTClaimInvalid('"nbf" claim timestamp check failed', 'nbf', 'check_failed') } if (!ignoreExp && 'exp' in decoded.payload && decoded.payload.exp <= unix - tolerance) { throw new JWTExpired('"exp" claim timestamp check failed', 'exp', 'check_failed') } if (maxTokenAge) { const age = unix - decoded.payload.iat const max = secs(maxTokenAge) if (age - tolerance > max) { throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', 'iat', 'check_failed') } if (age < 0 - tolerance) { throw new JWTClaimInvalid('"iat" claim timestamp check failed (it should be in the past)', 'iat', 'check_failed') } } return complete ? decoded : decoded.payload } /***/ }), /***/ 91071: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { getCurves } = __webpack_require__(76417) const curves = new Set() if (getCurves().includes('prime256v1')) { curves.add('P-256') } if (getCurves().includes('secp256k1')) { curves.add('secp256k1') } if (getCurves().includes('secp384r1')) { curves.add('P-384') } if (getCurves().includes('secp521r1')) { curves.add('P-521') } module.exports = curves /***/ }), /***/ 81645: /***/ ((module) => { module.exports = new Map() /***/ }), /***/ 47359: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const EC_CURVES = __webpack_require__(91071) const IVLENGTHS = __webpack_require__(70589) const JWA = __webpack_require__(22198) const JWK = __webpack_require__(11648) const KEYLENGTHS = __webpack_require__(62244) const OKP_CURVES = __webpack_require__(52438) const ECDH_DERIVE_LENGTHS = __webpack_require__(81645) module.exports = { EC_CURVES, ECDH_DERIVE_LENGTHS, IVLENGTHS, JWA, JWK, KEYLENGTHS, OKP_CURVES } /***/ }), /***/ 70589: /***/ ((module) => { module.exports = new Map([ ['A128CBC-HS256', 128], ['A128GCM', 96], ['A128GCMKW', 96], ['A192CBC-HS384', 128], ['A192GCM', 96], ['A192GCMKW', 96], ['A256CBC-HS512', 128], ['A256GCM', 96], ['A256GCMKW', 96] ]) /***/ }), /***/ 22198: /***/ ((module) => { module.exports = { sign: new Map(), verify: new Map(), keyManagementEncrypt: new Map(), keyManagementDecrypt: new Map(), encrypt: new Map(), decrypt: new Map() } /***/ }), /***/ 11648: /***/ ((module) => { module.exports = { oct: { decrypt: {}, deriveKey: {}, encrypt: {}, sign: {}, unwrapKey: {}, verify: {}, wrapKey: {} }, EC: { decrypt: {}, deriveKey: {}, encrypt: {}, sign: {}, unwrapKey: {}, verify: {}, wrapKey: {} }, RSA: { decrypt: {}, deriveKey: {}, encrypt: {}, sign: {}, unwrapKey: {}, verify: {}, wrapKey: {} }, OKP: { decrypt: {}, deriveKey: {}, encrypt: {}, sign: {}, unwrapKey: {}, verify: {}, wrapKey: {} } } /***/ }), /***/ 62244: /***/ ((module) => { module.exports = new Map([ ['A128CBC-HS256', 256], ['A128GCM', 128], ['A192CBC-HS384', 384], ['A192GCM', 192], ['A256CBC-HS512', 512], ['A256GCM', 256] ]) /***/ }), /***/ 52438: /***/ ((module) => { const curves = new Set(['Ed25519']) if (!('electron' in process.versions)) { curves.add('Ed448') curves.add('X25519') curves.add('X448') } module.exports = curves /***/ }), /***/ 49609: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable max-classes-per-file */ const { inspect } = __webpack_require__(31669); const stdhttp = __webpack_require__(98605); const crypto = __webpack_require__(76417); const { strict: assert } = __webpack_require__(42357); const querystring = __webpack_require__(71191); const url = __webpack_require__(78835); const { ParseError } = __webpack_require__(93061); const jose = __webpack_require__(87115); const tokenHash = __webpack_require__(80028); const base64url = __webpack_require__(23570); const defaults = __webpack_require__(44129); const { assertSigningAlgValuesSupport, assertIssuerConfiguration } = __webpack_require__(68973); const pick = __webpack_require__(70260); const isPlainObject = __webpack_require__(89717); const processResponse = __webpack_require__(59980); const TokenSet = __webpack_require__(14974); const { OPError, RPError } = __webpack_require__(31151); const now = __webpack_require__(24393); const { random } = __webpack_require__(65894); const request = __webpack_require__(8048); const { CALLBACK_PROPERTIES, CLIENT_DEFAULTS, JWT_CONTENT, CLOCK_TOLERANCE, } = __webpack_require__(6144); const issuerRegistry = __webpack_require__(70011); const instance = __webpack_require__(69020); const { authenticatedPost, resolveResponseType, resolveRedirectUri } = __webpack_require__(26633); const DeviceFlowHandle = __webpack_require__(60679); function pickCb(input) { return pick(input, ...CALLBACK_PROPERTIES); } function authorizationHeaderValue(token, tokenType = 'Bearer') { return `${tokenType} ${token}`; } function cleanUpClaims(claims) { if (Object.keys(claims._claim_names).length === 0) { delete claims._claim_names; } if (Object.keys(claims._claim_sources).length === 0) { delete claims._claim_sources; } } function assignClaim(target, source, sourceName, throwOnMissing = true) { return ([claim, inSource]) => { if (inSource === sourceName) { if (throwOnMissing && source[claim] === undefined) { throw new RPError(`expected claim "${claim}" in "${sourceName}"`); } else if (source[claim] !== undefined) { target[claim] = source[claim]; } delete target._claim_names[claim]; } }; } function verifyPresence(payload, jwt, prop) { if (payload[prop] === undefined) { throw new RPError({ message: `missing required JWT property ${prop}`, jwt, }); } } function authorizationParams(params) { const authParams = { client_id: this.client_id, scope: 'openid', response_type: resolveResponseType.call(this), redirect_uri: resolveRedirectUri.call(this), ...params, }; Object.entries(authParams).forEach(([key, value]) => { if (value === null || value === undefined) { delete authParams[key]; } else if (key === 'claims' && typeof value === 'object') { authParams[key] = JSON.stringify(value); } else if (key === 'resource' && Array.isArray(value)) { authParams[key] = value; } else if (typeof value !== 'string') { authParams[key] = String(value); } }); return authParams; } async function claimJWT(label, jwt) { try { const { header, payload } = jose.JWT.decode(jwt, { complete: true }); const { iss } = payload; if (header.alg === 'none') { return payload; } let key; if (!iss || iss === this.issuer.issuer) { key = await this.issuer.queryKeyStore(header); } else if (issuerRegistry.has(iss)) { key = await issuerRegistry.get(iss).queryKeyStore(header); } else { const discovered = await this.issuer.constructor.discover(iss); key = await discovered.queryKeyStore(header); } return jose.JWT.verify(jwt, key); } catch (err) { if (err instanceof RPError || err instanceof OPError || err.name === 'AggregateError') { throw err; } else { throw new RPError({ printf: ['failed to validate the %s JWT (%s: %s)', label, err.name, err.message], jwt, }); } } } function getKeystore(jwks) { const keystore = jose.JWKS.asKeyStore(jwks); if (keystore.all().some((key) => key.type !== 'private')) { throw new TypeError('jwks must only contain private keys'); } return keystore; } // if an OP doesnt support client_secret_basic but supports client_secret_post, use it instead // this is in place to take care of most common pitfalls when first using discovered Issuers without // the support for default values defined by Discovery 1.0 function checkBasicSupport(client, metadata, properties) { try { const supported = client.issuer.token_endpoint_auth_methods_supported; if (!supported.includes(properties.token_endpoint_auth_method)) { if (supported.includes('client_secret_post')) { properties.token_endpoint_auth_method = 'client_secret_post'; } } } catch (err) {} } function handleCommonMistakes(client, metadata, properties) { if (!metadata.token_endpoint_auth_method) { // if no explicit value was provided checkBasicSupport(client, metadata, properties); } // :fp: c'mon people... RTFM if (metadata.redirect_uri) { if (metadata.redirect_uris) { throw new TypeError('provide a redirect_uri or redirect_uris, not both'); } properties.redirect_uris = [metadata.redirect_uri]; delete properties.redirect_uri; } if (metadata.response_type) { if (metadata.response_types) { throw new TypeError('provide a response_type or response_types, not both'); } properties.response_types = [metadata.response_type]; delete properties.response_type; } } function getDefaultsForEndpoint(endpoint, issuer, properties) { if (!issuer[`${endpoint}_endpoint`]) return; const tokenEndpointAuthMethod = properties.token_endpoint_auth_method; const tokenEndpointAuthSigningAlg = properties.token_endpoint_auth_signing_alg; const eam = `${endpoint}_endpoint_auth_method`; const easa = `${endpoint}_endpoint_auth_signing_alg`; if (properties[eam] === undefined && properties[easa] === undefined) { if (tokenEndpointAuthMethod !== undefined) { properties[eam] = tokenEndpointAuthMethod; } if (tokenEndpointAuthSigningAlg !== undefined) { properties[easa] = tokenEndpointAuthSigningAlg; } } } class BaseClient {} module.exports = (issuer, aadIssValidation = false) => class Client extends BaseClient { /** * @name constructor * @api public */ constructor(metadata = {}, jwks, options) { super(); if (typeof metadata.client_id !== 'string' || !metadata.client_id) { throw new TypeError('client_id is required'); } const properties = { ...CLIENT_DEFAULTS, ...metadata }; handleCommonMistakes(this, metadata, properties); assertSigningAlgValuesSupport('token', this.issuer, properties); ['introspection', 'revocation'].forEach((endpoint) => { getDefaultsForEndpoint(endpoint, this.issuer, properties); assertSigningAlgValuesSupport(endpoint, this.issuer, properties); }); Object.entries(properties).forEach(([key, value]) => { instance(this).get('metadata').set(key, value); if (!this[key]) { Object.defineProperty(this, key, { get() { return instance(this).get('metadata').get(key); }, enumerable: true, }); } }); if (jwks !== undefined) { const keystore = getKeystore.call(this, jwks); instance(this).set('keystore', keystore); } if (options !== undefined) { instance(this).set('options', options); } this[CLOCK_TOLERANCE] = 0; } /** * @name authorizationUrl * @api public */ authorizationUrl(params = {}) { if (!isPlainObject(params)) { throw new TypeError('params must be a plain object'); } assertIssuerConfiguration(this.issuer, 'authorization_endpoint'); const target = url.parse(this.issuer.authorization_endpoint, true); target.search = null; target.query = { ...target.query, ...authorizationParams.call(this, params), }; return url.format(target); } /** * @name authorizationPost * @api public */ authorizationPost(params = {}) { if (!isPlainObject(params)) { throw new TypeError('params must be a plain object'); } const inputs = authorizationParams.call(this, params); const formInputs = Object.keys(inputs) .map((name) => ``).join('\n'); return ` Requesting Authorization
${formInputs}
`; } /** * @name endSessionUrl * @api public */ endSessionUrl(params = {}) { assertIssuerConfiguration(this.issuer, 'end_session_endpoint'); const { 0: postLogout, length, } = this.post_logout_redirect_uris || []; const { post_logout_redirect_uri = length === 1 ? postLogout : undefined, } = params; let hint = params.id_token_hint; if (hint instanceof TokenSet) { if (!hint.id_token) { throw new TypeError('id_token not present in TokenSet'); } hint = hint.id_token; } const target = url.parse(this.issuer.end_session_endpoint, true); target.search = null; target.query = { ...params, ...target.query, ...{ post_logout_redirect_uri, id_token_hint: hint, }, }; Object.entries(target.query).forEach(([key, value]) => { if (value === null || value === undefined) { delete target.query[key]; } }); return url.format(target); } /** * @name callbackParams * @api public */ callbackParams(input) { // eslint-disable-line class-methods-use-this const isIncomingMessage = input instanceof stdhttp.IncomingMessage || (input && input.method && input.url); const isString = typeof input === 'string'; if (!isString && !isIncomingMessage) { throw new TypeError('#callbackParams only accepts string urls, http.IncomingMessage or a lookalike'); } if (isIncomingMessage) { switch (input.method) { case 'GET': return pickCb(url.parse(input.url, true).query); case 'POST': if (input.body === undefined) { throw new TypeError('incoming message body missing, include a body parser prior to this method call'); } switch (typeof input.body) { case 'object': case 'string': if (Buffer.isBuffer(input.body)) { return pickCb(querystring.parse(input.body.toString('utf-8'))); } if (typeof input.body === 'string') { return pickCb(querystring.parse(input.body)); } return pickCb(input.body); default: throw new TypeError('invalid IncomingMessage body object'); } default: throw new TypeError('invalid IncomingMessage method'); } } else { return pickCb(url.parse(input, true).query); } } /** * @name callback * @api public */ async callback( redirectUri, parameters, checks = {}, { exchangeBody, clientAssertionPayload, DPoP } = {}, ) { let params = pickCb(parameters); if (checks.jarm && !('response' in parameters)) { throw new RPError({ message: 'expected a JARM response', checks, params, }); } else if ('response' in parameters) { const decrypted = await this.decryptJARM(params.response); params = await this.validateJARM(decrypted); } if (this.default_max_age && !checks.max_age) { checks.max_age = this.default_max_age; } if (params.state && !checks.state) { throw new TypeError('checks.state argument is missing'); } if (!params.state && checks.state) { throw new RPError({ message: 'state missing from the response', checks, params, }); } if (checks.state !== params.state) { throw new RPError({ printf: ['state mismatch, expected %s, got: %s', checks.state, params.state], checks, params, }); } if (params.error) { throw new OPError(params); } const RESPONSE_TYPE_REQUIRED_PARAMS = { code: ['code'], id_token: ['id_token'], token: ['access_token', 'token_type'], }; if (checks.response_type) { for (const type of checks.response_type.split(' ')) { // eslint-disable-line no-restricted-syntax if (type === 'none') { if (params.code || params.id_token || params.access_token) { throw new RPError({ message: 'unexpected params encountered for "none" response', checks, params, }); } } else { for (const param of RESPONSE_TYPE_REQUIRED_PARAMS[type]) { // eslint-disable-line no-restricted-syntax, max-len if (!params[param]) { throw new RPError({ message: `${param} missing from response`, checks, params, }); } } } } } if (params.id_token) { const tokenset = new TokenSet(params); await this.decryptIdToken(tokenset); await this.validateIdToken(tokenset, checks.nonce, 'authorization', checks.max_age, checks.state); if (!params.code) { return tokenset; } } if (params.code) { const tokenset = await this.grant({ ...exchangeBody, grant_type: 'authorization_code', code: params.code, redirect_uri: redirectUri, code_verifier: checks.code_verifier, }, { clientAssertionPayload, DPoP }); await this.decryptIdToken(tokenset); await this.validateIdToken(tokenset, checks.nonce, 'token', checks.max_age); if (params.session_state) { tokenset.session_state = params.session_state; } return tokenset; } return new TokenSet(params); } /** * @name oauthCallback * @api public */ async oauthCallback( redirectUri, parameters, checks = {}, { exchangeBody, clientAssertionPayload, DPoP } = {}, ) { let params = pickCb(parameters); if (checks.jarm && !('response' in parameters)) { throw new RPError({ message: 'expected a JARM response', checks, params, }); } else if ('response' in parameters) { const decrypted = await this.decryptJARM(params.response); params = await this.validateJARM(decrypted); } if (params.state && !checks.state) { throw new TypeError('checks.state argument is missing'); } if (!params.state && checks.state) { throw new RPError({ message: 'state missing from the response', checks, params, }); } if (checks.state !== params.state) { throw new RPError({ printf: ['state mismatch, expected %s, got: %s', checks.state, params.state], checks, params, }); } if (params.error) { throw new OPError(params); } const RESPONSE_TYPE_REQUIRED_PARAMS = { code: ['code'], token: ['access_token', 'token_type'], }; if (checks.response_type) { for (const type of checks.response_type.split(' ')) { // eslint-disable-line no-restricted-syntax if (type === 'none') { if (params.code || params.id_token || params.access_token) { throw new RPError({ message: 'unexpected params encountered for "none" response', checks, params, }); } } if (RESPONSE_TYPE_REQUIRED_PARAMS[type]) { for (const param of RESPONSE_TYPE_REQUIRED_PARAMS[type]) { // eslint-disable-line no-restricted-syntax, max-len if (!params[param]) { throw new RPError({ message: `${param} missing from response`, checks, params, }); } } } } } if (params.code) { return this.grant({ ...exchangeBody, grant_type: 'authorization_code', code: params.code, redirect_uri: redirectUri, code_verifier: checks.code_verifier, }, { clientAssertionPayload, DPoP }); } return new TokenSet(params); } /** * @name decryptIdToken * @api private */ async decryptIdToken(token) { if (!this.id_token_encrypted_response_alg) { return token; } let idToken = token; if (idToken instanceof TokenSet) { if (!idToken.id_token) { throw new TypeError('id_token not present in TokenSet'); } idToken = idToken.id_token; } const expectedAlg = this.id_token_encrypted_response_alg; const expectedEnc = this.id_token_encrypted_response_enc; const result = await this.decryptJWE(idToken, expectedAlg, expectedEnc); if (token instanceof TokenSet) { token.id_token = result; return token; } return result; } async validateJWTUserinfo(body) { const expectedAlg = this.userinfo_signed_response_alg; return this.validateJWT(body, expectedAlg, []); } /** * @name decryptJARM * @api private */ async decryptJARM(response) { if (!this.authorization_encrypted_response_alg) { return response; } const expectedAlg = this.authorization_encrypted_response_alg; const expectedEnc = this.authorization_encrypted_response_enc; return this.decryptJWE(response, expectedAlg, expectedEnc); } /** * @name decryptJWTUserinfo * @api private */ async decryptJWTUserinfo(body) { if (!this.userinfo_encrypted_response_alg) { return body; } const expectedAlg = this.userinfo_encrypted_response_alg; const expectedEnc = this.userinfo_encrypted_response_enc; return this.decryptJWE(body, expectedAlg, expectedEnc); } /** * @name decryptJWE * @api private */ async decryptJWE(jwe, expectedAlg, expectedEnc = 'A128CBC-HS256') { const header = JSON.parse(base64url.decode(jwe.split('.')[0])); if (header.alg !== expectedAlg) { throw new RPError({ printf: ['unexpected JWE alg received, expected %s, got: %s', expectedAlg, header.alg], jwt: jwe, }); } if (header.enc !== expectedEnc) { throw new RPError({ printf: ['unexpected JWE enc received, expected %s, got: %s', expectedEnc, header.enc], jwt: jwe, }); } let keyOrStore; if (expectedAlg.match(/^(?:RSA|ECDH)/)) { keyOrStore = instance(this).get('keystore'); } else { keyOrStore = await this.joseSecret(expectedAlg === 'dir' ? expectedEnc : expectedAlg); } const payload = jose.JWE.decrypt(jwe, keyOrStore); return payload.toString('utf8'); } /** * @name validateIdToken * @api private */ async validateIdToken(tokenSet, nonce, returnedBy, maxAge, state) { let idToken = tokenSet; const expectedAlg = this.id_token_signed_response_alg; const isTokenSet = idToken instanceof TokenSet; if (isTokenSet) { if (!idToken.id_token) { throw new TypeError('id_token not present in TokenSet'); } idToken = idToken.id_token; } idToken = String(idToken); const timestamp = now(); const { protected: header, payload, key } = await this.validateJWT(idToken, expectedAlg); if (maxAge || (maxAge !== null && this.require_auth_time)) { if (!payload.auth_time) { throw new RPError({ message: 'missing required JWT property auth_time', jwt: idToken, }); } if (typeof payload.auth_time !== 'number') { throw new RPError({ message: 'JWT auth_time claim must be a JSON numeric value', jwt: idToken, }); } } if (maxAge && (payload.auth_time + maxAge < timestamp - this[CLOCK_TOLERANCE])) { throw new RPError({ printf: ['too much time has elapsed since the last End-User authentication, max_age %i, auth_time: %i, now %i', maxAge, payload.auth_time, timestamp - this[CLOCK_TOLERANCE]], now: timestamp, tolerance: this[CLOCK_TOLERANCE], auth_time: payload.auth_time, jwt: idToken, }); } if (nonce !== null && (payload.nonce || nonce !== undefined) && payload.nonce !== nonce) { throw new RPError({ printf: ['nonce mismatch, expected %s, got: %s', nonce, payload.nonce], jwt: idToken, }); } const fapi = this.constructor.name === 'FAPIClient'; if (returnedBy === 'authorization') { if (!payload.at_hash && tokenSet.access_token) { throw new RPError({ message: 'missing required property at_hash', jwt: idToken, }); } if (!payload.c_hash && tokenSet.code) { throw new RPError({ message: 'missing required property c_hash', jwt: idToken, }); } if (fapi) { if (!payload.s_hash && (tokenSet.state || state)) { throw new RPError({ message: 'missing required property s_hash', jwt: idToken, }); } } if (payload.s_hash) { if (!state) { throw new TypeError('cannot verify s_hash, "checks.state" property not provided'); } try { tokenHash.validate({ claim: 's_hash', source: 'state' }, payload.s_hash, state, header.alg, key && key.crv); } catch (err) { throw new RPError({ message: err.message, jwt: idToken }); } } } if (fapi && payload.iat < timestamp - 3600) { throw new RPError({ printf: ['JWT issued too far in the past, now %i, iat %i', timestamp, payload.iat], now: timestamp, tolerance: this[CLOCK_TOLERANCE], iat: payload.iat, jwt: idToken, }); } if (tokenSet.access_token && payload.at_hash !== undefined) { try { tokenHash.validate({ claim: 'at_hash', source: 'access_token' }, payload.at_hash, tokenSet.access_token, header.alg, key && key.crv); } catch (err) { throw new RPError({ message: err.message, jwt: idToken }); } } if (tokenSet.code && payload.c_hash !== undefined) { try { tokenHash.validate({ claim: 'c_hash', source: 'code' }, payload.c_hash, tokenSet.code, header.alg, key && key.crv); } catch (err) { throw new RPError({ message: err.message, jwt: idToken }); } } return tokenSet; } /** * @name validateJWT * @api private */ async validateJWT(jwt, expectedAlg, required = ['iss', 'sub', 'aud', 'exp', 'iat']) { const isSelfIssued = this.issuer.issuer === 'https://self-issued.me'; const timestamp = now(); let header; let payload; try { ({ header, payload } = jose.JWT.decode(jwt, { complete: true })); } catch (err) { throw new RPError({ printf: ['failed to decode JWT (%s: %s)', err.name, err.message], jwt, }); } if (header.alg !== expectedAlg) { throw new RPError({ printf: ['unexpected JWT alg received, expected %s, got: %s', expectedAlg, header.alg], jwt, }); } if (isSelfIssued) { required = [...required, 'sub_jwk']; // eslint-disable-line no-param-reassign } required.forEach(verifyPresence.bind(undefined, payload, jwt)); if (payload.iss !== undefined) { let expectedIss = this.issuer.issuer; if (aadIssValidation) { expectedIss = this.issuer.issuer.replace('{tenantid}', payload.tid); } if (payload.iss !== expectedIss) { throw new RPError({ printf: ['unexpected iss value, expected %s, got: %s', expectedIss, payload.iss], jwt, }); } } if (payload.iat !== undefined) { if (typeof payload.iat !== 'number') { throw new RPError({ message: 'JWT iat claim must be a JSON numeric value', jwt, }); } } if (payload.nbf !== undefined) { if (typeof payload.nbf !== 'number') { throw new RPError({ message: 'JWT nbf claim must be a JSON numeric value', jwt, }); } if (payload.nbf > timestamp + this[CLOCK_TOLERANCE]) { throw new RPError({ printf: ['JWT not active yet, now %i, nbf %i', timestamp + this[CLOCK_TOLERANCE], payload.nbf], now: timestamp, tolerance: this[CLOCK_TOLERANCE], nbf: payload.nbf, jwt, }); } } if (payload.exp !== undefined) { if (typeof payload.exp !== 'number') { throw new RPError({ message: 'JWT exp claim must be a JSON numeric value', jwt, }); } if (timestamp - this[CLOCK_TOLERANCE] >= payload.exp) { throw new RPError({ printf: ['JWT expired, now %i, exp %i', timestamp - this[CLOCK_TOLERANCE], payload.exp], now: timestamp, tolerance: this[CLOCK_TOLERANCE], exp: payload.exp, jwt, }); } } if (payload.aud !== undefined) { if (Array.isArray(payload.aud)) { if (payload.aud.length > 1 && !payload.azp) { throw new RPError({ message: 'missing required JWT property azp', jwt, }); } if (!payload.aud.includes(this.client_id)) { throw new RPError({ printf: ['aud is missing the client_id, expected %s to be included in %j', this.client_id, payload.aud], jwt, }); } } else if (payload.aud !== this.client_id) { throw new RPError({ printf: ['aud mismatch, expected %s, got: %s', this.client_id, payload.aud], jwt, }); } } if (payload.azp !== undefined) { let { additionalAuthorizedParties } = instance(this).get('options') || {}; if (typeof additionalAuthorizedParties === 'string') { additionalAuthorizedParties = [this.client_id, additionalAuthorizedParties]; } else if (Array.isArray(additionalAuthorizedParties)) { additionalAuthorizedParties = [this.client_id, ...additionalAuthorizedParties]; } else { additionalAuthorizedParties = [this.client_id]; } if (!additionalAuthorizedParties.includes(payload.azp)) { throw new RPError({ printf: ['azp mismatch, got: %s', payload.azp], jwt, }); } } let key; if (isSelfIssued) { try { assert(isPlainObject(payload.sub_jwk)); key = jose.JWK.asKey(payload.sub_jwk); assert.equal(key.type, 'public'); } catch (err) { throw new RPError({ message: 'failed to use sub_jwk claim as an asymmetric JSON Web Key', jwt, }); } if (key.thumbprint !== payload.sub) { throw new RPError({ message: 'failed to match the subject with sub_jwk', jwt, }); } } else if (header.alg.startsWith('HS')) { key = await this.joseSecret(); } else if (header.alg !== 'none') { key = await this.issuer.queryKeyStore(header); } if (!key && header.alg === 'none') { return { protected: header, payload }; } try { return { ...jose.JWS.verify(jwt, key, { complete: true }), payload, }; } catch (err) { throw new RPError({ message: 'failed to validate JWT signature', jwt, }); } } /** * @name refresh * @api public */ async refresh(refreshToken, { exchangeBody, clientAssertionPayload, DPoP } = {}) { let token = refreshToken; if (token instanceof TokenSet) { if (!token.refresh_token) { throw new TypeError('refresh_token not present in TokenSet'); } token = token.refresh_token; } const tokenset = await this.grant({ ...exchangeBody, grant_type: 'refresh_token', refresh_token: String(token), }, { clientAssertionPayload, DPoP }); if (tokenset.id_token) { await this.decryptIdToken(tokenset); await this.validateIdToken(tokenset, null, 'token', null); if (refreshToken instanceof TokenSet && refreshToken.id_token) { const expectedSub = refreshToken.claims().sub; const actualSub = tokenset.claims().sub; if (actualSub !== expectedSub) { throw new RPError({ printf: ['sub mismatch, expected %s, got: %s', expectedSub, actualSub], jwt: tokenset.id_token, }); } } } return tokenset; } async requestResource( resourceUrl, accessToken, { method, headers, body, tokenType = accessToken instanceof TokenSet ? accessToken.token_type : 'Bearer', DPoP, } = {}, ) { if (accessToken instanceof TokenSet) { if (!accessToken.access_token) { throw new TypeError('access_token not present in TokenSet'); } accessToken = accessToken.access_token; // eslint-disable-line no-param-reassign } const requestOpts = { headers: { Authorization: authorizationHeaderValue(accessToken, tokenType), ...headers, }, body, }; const mTLS = !!this.tls_client_certificate_bound_access_tokens; return request.call(this, { ...requestOpts, responseType: 'buffer', method, url: resourceUrl, }, { mTLS, DPoP }); } /** * @name userinfo * @api public */ async userinfo(accessToken, { method = 'GET', via = 'header', tokenType, params, DPoP, } = {}) { assertIssuerConfiguration(this.issuer, 'userinfo_endpoint'); const options = { tokenType, method: String(method).toUpperCase(), DPoP, }; if (options.method !== 'GET' && options.method !== 'POST') { throw new TypeError('#userinfo() method can only be POST or a GET'); } if (via === 'query' && options.method !== 'GET') { throw new TypeError('userinfo endpoints will only parse query strings for GET requests'); } else if (via === 'body' && options.method !== 'POST') { throw new TypeError('can only send body on POST'); } const jwt = !!(this.userinfo_signed_response_alg || this.userinfo_encrypted_response_alg); if (jwt) { options.headers = { Accept: 'application/jwt' }; } else { options.headers = { Accept: 'application/json' }; } const mTLS = !!this.tls_client_certificate_bound_access_tokens; let targetUrl; if (mTLS && this.issuer.mtls_endpoint_aliases) { targetUrl = this.issuer.mtls_endpoint_aliases.userinfo_endpoint; } targetUrl = new url.URL(targetUrl || this.issuer.userinfo_endpoint); // when via is not header we clear the Authorization header and add either // query string parameters or urlencoded body access_token parameter if (via === 'query') { options.headers.Authorization = undefined; targetUrl.searchParams.append('access_token', accessToken instanceof TokenSet ? accessToken.access_token : accessToken); } else if (via === 'body') { options.headers.Authorization = undefined; options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; options.body = new url.URLSearchParams(); options.body.append('access_token', accessToken instanceof TokenSet ? accessToken.access_token : accessToken); } // handle additional parameters, GET via querystring, POST via urlencoded body if (params) { if (options.method === 'GET') { Object.entries(params).forEach(([key, value]) => { targetUrl.searchParams.append(key, value); }); } else if (options.body) { // POST && via body Object.entries(params).forEach(([key, value]) => { options.body.append(key, value); }); } else { // POST && via header options.body = new url.URLSearchParams(); options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; Object.entries(params).forEach(([key, value]) => { options.body.append(key, value); }); } } if (options.body) { options.body = options.body.toString(); } const response = await this.requestResource(targetUrl, accessToken, options); let parsed = processResponse(response, { bearer: true }); if (jwt) { if (!JWT_CONTENT.test(response.headers['content-type'])) { throw new RPError({ message: 'expected application/jwt response from the userinfo_endpoint', response, }); } const body = response.body.toString(); const userinfo = await this.decryptJWTUserinfo(body); if (!this.userinfo_signed_response_alg) { try { parsed = JSON.parse(userinfo); assert(isPlainObject(parsed)); } catch (err) { throw new RPError({ message: 'failed to parse userinfo JWE payload as JSON', jwt: userinfo, }); } } else { ({ payload: parsed } = await this.validateJWTUserinfo(userinfo)); } } else { try { parsed = JSON.parse(response.body); } catch (error) { throw new ParseError(error, response); } } if (accessToken instanceof TokenSet && accessToken.id_token) { const expectedSub = accessToken.claims().sub; if (parsed.sub !== expectedSub) { throw new RPError({ printf: ['userinfo sub mismatch, expected %s, got: %s', expectedSub, parsed.sub], body: parsed, jwt: accessToken.id_token, }); } } return parsed; } /** * @name derivedKey * @api private */ async derivedKey(len) { const cacheKey = `${len}_key`; if (instance(this).has(cacheKey)) { return instance(this).get(cacheKey); } const hash = len <= 256 ? 'sha256' : len <= 384 ? 'sha384' : len <= 512 ? 'sha512' : false; // eslint-disable-line no-nested-ternary if (!hash) { throw new Error('unsupported symmetric encryption key derivation'); } const derivedBuffer = crypto.createHash(hash) .update(this.client_secret) .digest() .slice(0, len / 8); const key = jose.JWK.asKey({ k: base64url.encode(derivedBuffer), kty: 'oct' }); instance(this).set(cacheKey, key); return key; } /** * @name joseSecret * @api private */ async joseSecret(alg) { if (!this.client_secret) { throw new TypeError('client_secret is required'); } if (/^A(\d{3})(?:GCM)?KW$/.test(alg)) { return this.derivedKey(parseInt(RegExp.$1, 10)); } if (/^A(\d{3})(?:GCM|CBC-HS(\d{3}))$/.test(alg)) { return this.derivedKey(parseInt(RegExp.$2 || RegExp.$1, 10)); } if (instance(this).has('jose_secret')) { return instance(this).get('jose_secret'); } const key = jose.JWK.asKey({ k: base64url.encode(this.client_secret), kty: 'oct' }); instance(this).set('jose_secret', key); return key; } /** * @name grant * @api public */ async grant(body, { clientAssertionPayload, DPoP } = {}) { assertIssuerConfiguration(this.issuer, 'token_endpoint'); const response = await authenticatedPost.call( this, 'token', { form: body, responseType: 'json', }, { clientAssertionPayload, DPoP }, ); const responseBody = processResponse(response); return new TokenSet(responseBody); } /** * @name deviceAuthorization * @api public */ async deviceAuthorization(params = {}, { exchangeBody, clientAssertionPayload, DPoP } = {}) { assertIssuerConfiguration(this.issuer, 'device_authorization_endpoint'); assertIssuerConfiguration(this.issuer, 'token_endpoint'); const body = authorizationParams.call(this, { client_id: this.client_id, redirect_uri: null, response_type: null, ...params, }); const response = await authenticatedPost.call( this, 'device_authorization', { responseType: 'json', form: body, }, { clientAssertionPayload, endpointAuthMethod: 'token' }, ); const responseBody = processResponse(response); return new DeviceFlowHandle({ client: this, exchangeBody, clientAssertionPayload, response: responseBody, maxAge: params.max_age, DPoP, }); } /** * @name revoke * @api public */ async revoke(token, hint, { revokeBody, clientAssertionPayload } = {}) { assertIssuerConfiguration(this.issuer, 'revocation_endpoint'); if (hint !== undefined && typeof hint !== 'string') { throw new TypeError('hint must be a string'); } const form = { ...revokeBody, token }; if (hint) { form.token_type_hint = hint; } const response = await authenticatedPost.call( this, 'revocation', { form, }, { clientAssertionPayload }, ); processResponse(response, { body: false }); } /** * @name introspect * @api public */ async introspect(token, hint, { introspectBody, clientAssertionPayload } = {}) { assertIssuerConfiguration(this.issuer, 'introspection_endpoint'); if (hint !== undefined && typeof hint !== 'string') { throw new TypeError('hint must be a string'); } const form = { ...introspectBody, token }; if (hint) { form.token_type_hint = hint; } const response = await authenticatedPost.call( this, 'introspection', { form, responseType: 'json' }, { clientAssertionPayload }, ); const responseBody = processResponse(response); return responseBody; } /** * @name fetchDistributedClaims * @api public */ async fetchDistributedClaims(claims, tokens = {}) { if (!isPlainObject(claims)) { throw new TypeError('claims argument must be a plain object'); } if (!isPlainObject(claims._claim_sources)) { return claims; } if (!isPlainObject(claims._claim_names)) { return claims; } const distributedSources = Object.entries(claims._claim_sources) .filter(([, value]) => value && value.endpoint); await Promise.all(distributedSources.map(async ([sourceName, def]) => { try { const requestOpts = { headers: { Accept: 'application/jwt', Authorization: authorizationHeaderValue(def.access_token || tokens[sourceName]), }, }; const response = await request.call(this, { ...requestOpts, method: 'GET', url: def.endpoint, }); const body = processResponse(response, { bearer: true }); const decoded = await claimJWT.call(this, 'distributed', body); delete claims._claim_sources[sourceName]; Object.entries(claims._claim_names).forEach( assignClaim(claims, decoded, sourceName, false), ); } catch (err) { err.src = sourceName; throw err; } })); cleanUpClaims(claims); return claims; } /** * @name unpackAggregatedClaims * @api public */ async unpackAggregatedClaims(claims) { if (!isPlainObject(claims)) { throw new TypeError('claims argument must be a plain object'); } if (!isPlainObject(claims._claim_sources)) { return claims; } if (!isPlainObject(claims._claim_names)) { return claims; } const aggregatedSources = Object.entries(claims._claim_sources) .filter(([, value]) => value && value.JWT); await Promise.all(aggregatedSources.map(async ([sourceName, def]) => { try { const decoded = await claimJWT.call(this, 'aggregated', def.JWT); delete claims._claim_sources[sourceName]; Object.entries(claims._claim_names).forEach(assignClaim(claims, decoded, sourceName)); } catch (err) { err.src = sourceName; throw err; } })); cleanUpClaims(claims); return claims; } /** * @name register * @api public */ static async register(metadata, options = {}) { const { initialAccessToken, jwks, ...clientOptions } = options; assertIssuerConfiguration(this.issuer, 'registration_endpoint'); if (jwks !== undefined && !(metadata.jwks || metadata.jwks_uri)) { const keystore = getKeystore.call(this, jwks); metadata.jwks = keystore.toJWKS(false); } const response = await request.call(this, { headers: initialAccessToken ? { Authorization: authorizationHeaderValue(initialAccessToken), } : undefined, responseType: 'json', json: metadata, url: this.issuer.registration_endpoint, method: 'POST', }); const responseBody = processResponse(response, { statusCode: 201, bearer: true }); return new this(responseBody, jwks, clientOptions); } /** * @name metadata * @api public */ get metadata() { const copy = {}; instance(this).get('metadata').forEach((value, key) => { copy[key] = value; }); return copy; } /** * @name fromUri * @api public */ static async fromUri(registrationClientUri, registrationAccessToken, jwks, clientOptions) { const response = await request.call(this, { method: 'GET', url: registrationClientUri, responseType: 'json', headers: { Authorization: authorizationHeaderValue(registrationAccessToken) }, }); const responseBody = processResponse(response, { bearer: true }); return new this(responseBody, jwks, clientOptions); } /** * @name requestObject * @api public */ async requestObject(requestObject = {}, { sign: signingAlgorithm = this.request_object_signing_alg || 'none', encrypt: { alg: eKeyManagement = this.request_object_encryption_alg, enc: eContentEncryption = this.request_object_encryption_enc || 'A128CBC-HS256', } = {}, } = {}) { if (!isPlainObject(requestObject)) { throw new TypeError('requestObject must be a plain object'); } let signed; let key; const fapi = this.constructor.name === 'FAPIClient'; const unix = now(); const header = { alg: signingAlgorithm, typ: 'oauth-authz-req+jwt' }; const payload = JSON.stringify(defaults({}, requestObject, { iss: this.client_id, aud: this.issuer.issuer, client_id: this.client_id, jti: random(), iat: unix, exp: unix + 300, ...(fapi ? { nbf: unix } : undefined), })); if (signingAlgorithm === 'none') { signed = [ base64url.encode(JSON.stringify(header)), base64url.encode(payload), '', ].join('.'); } else { const symmetric = signingAlgorithm.startsWith('HS'); if (symmetric) { key = await this.joseSecret(); } else { const keystore = instance(this).get('keystore'); if (!keystore) { throw new TypeError(`no keystore present for client, cannot sign using alg ${signingAlgorithm}`); } key = keystore.get({ alg: signingAlgorithm, use: 'sig' }); if (!key) { throw new TypeError(`no key to sign with found for alg ${signingAlgorithm}`); } } signed = jose.JWS.sign(payload, key, { ...header, kid: symmetric ? undefined : key.kid, }); } if (!eKeyManagement) { return signed; } const fields = { alg: eKeyManagement, enc: eContentEncryption, cty: 'oauth-authz-req+jwt' }; if (fields.alg.match(/^(RSA|ECDH)/)) { [key] = await this.issuer.queryKeyStore({ alg: fields.alg, enc: fields.enc, use: 'enc', }, { allowMulti: true }); } else { key = await this.joseSecret(fields.alg === 'dir' ? fields.enc : fields.alg); } return jose.JWE.encrypt(signed, key, { ...fields, kid: key.kty === 'oct' ? undefined : key.kid, }); } /** * @name issuer * @api public */ static get issuer() { return issuer; } /** * @name issuer * @api public */ get issuer() { // eslint-disable-line class-methods-use-this return issuer; } /* istanbul ignore next */ [inspect.custom]() { return `${this.constructor.name} ${inspect(this.metadata, { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true, })}`; } }; /** * @name validateJARM * @api private */ async function validateJARM(response) { const expectedAlg = this.authorization_signed_response_alg; const { payload } = await this.validateJWT(response, expectedAlg, ['iss', 'exp', 'aud']); return pickCb(payload); } Object.defineProperty(BaseClient.prototype, 'validateJARM', { enumerable: true, configurable: true, value(...args) { process.emitWarning( "The JARM API implements an OIDF implementer's draft. Breaking draft implementations are included as minor versions of the openid-client library, therefore, the ~ semver operator should be used and close attention be payed to library changelog as well as the drafts themselves.", 'DraftWarning', ); Object.defineProperty(BaseClient.prototype, 'validateJARM', { enumerable: true, configurable: true, value: validateJARM, }); return this.validateJARM(...args); }, }); /** * @name dpopProof * @api private */ function dpopProof(payload, jwk) { if (!isPlainObject(payload)) { throw new TypeError('payload must be a plain object'); } let key; try { key = jose.JWK.asKey(jwk); assert(key.type === 'private'); } catch (err) { throw new TypeError('"DPoP" option must be an asymmetric private key to sign the DPoP Proof JWT with'); } let { alg } = key; if (!alg && this.issuer.dpop_signing_alg_values_supported) { const algs = key.algorithms('sign'); alg = this.issuer.dpop_signing_alg_values_supported.find((a) => algs.has(a)); } if (!alg) { [alg] = key.algorithms('sign'); } return jose.JWS.sign({ iat: now(), jti: random(), ...payload, }, jwk, { alg, typ: 'dpop+jwt', jwk: pick(key, 'kty', 'crv', 'x', 'y', 'e', 'n'), }); } Object.defineProperty(BaseClient.prototype, 'dpopProof', { enumerable: true, configurable: true, value(...args) { process.emitWarning( 'The DPoP APIs implements an IETF draft. Breaking draft implementations are included as minor versions of the openid-client library, therefore, the ~ semver operator should be used and close attention be payed to library changelog as well as the drafts themselves.', 'DraftWarning', ); Object.defineProperty(BaseClient.prototype, 'dpopProof', { enumerable: true, configurable: true, value: dpopProof, }); return this.dpopProof(...args); }, }); /** * @name pushedAuthorizationRequest * @api public */ async function pushedAuthorizationRequest(params = {}, { clientAssertionPayload } = {}) { assertIssuerConfiguration(this.issuer, 'pushed_authorization_request_endpoint'); const body = { ...('request' in params ? params : authorizationParams.call(this, params)), client_id: this.client_id, }; const response = await authenticatedPost.call( this, 'pushed_authorization_request', { responseType: 'json', form: body, }, { clientAssertionPayload, endpointAuthMethod: 'token' }, ); const responseBody = processResponse(response, { statusCode: 201 }); if (!('expires_in' in responseBody)) { throw new RPError({ message: 'expected expires_in in Pushed Authorization Successful Response', response, }); } if (typeof responseBody.expires_in !== 'number') { throw new RPError({ message: 'invalid expires_in value in Pushed Authorization Successful Response', response, }); } if (!('request_uri' in responseBody)) { throw new RPError({ message: 'expected request_uri in Pushed Authorization Successful Response', response, }); } if (typeof responseBody.request_uri !== 'string') { throw new RPError({ message: 'invalid request_uri value in Pushed Authorization Successful Response', response, }); } return responseBody; } Object.defineProperty(BaseClient.prototype, 'pushedAuthorizationRequest', { enumerable: true, configurable: true, value(...args) { process.emitWarning( 'The Pushed Authorization Requests APIs implements an IETF draft. Breaking draft implementations are included as minor versions of the openid-client library, therefore, the ~ semver operator should be used and close attention be payed to library changelog as well as the drafts themselves.', 'DraftWarning', ); Object.defineProperty(BaseClient.prototype, 'pushedAuthorizationRequest', { enumerable: true, configurable: true, value: pushedAuthorizationRequest, }); return this.pushedAuthorizationRequest(...args); }, }); module.exports.BaseClient = BaseClient; /***/ }), /***/ 60679: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable camelcase */ const { inspect } = __webpack_require__(31669); const { RPError, OPError } = __webpack_require__(31151); const instance = __webpack_require__(69020); const now = __webpack_require__(24393); const { authenticatedPost } = __webpack_require__(26633); const processResponse = __webpack_require__(59980); const TokenSet = __webpack_require__(14974); class DeviceFlowHandle { constructor({ client, exchangeBody, clientAssertionPayload, response, maxAge, DPoP, }) { ['verification_uri', 'user_code', 'device_code'].forEach((prop) => { if (typeof response[prop] !== 'string' || !response[prop]) { throw new RPError(`expected ${prop} string to be returned by Device Authorization Response, got %j`, response[prop]); } }); if (!Number.isSafeInteger(response.expires_in)) { throw new RPError('expected expires_in number to be returned by Device Authorization Response, got %j', response.expires_in); } instance(this).expires_at = now() + response.expires_in; instance(this).client = client; instance(this).DPoP = DPoP; instance(this).maxAge = maxAge; instance(this).exchangeBody = exchangeBody; instance(this).clientAssertionPayload = clientAssertionPayload; instance(this).response = response; instance(this).interval = response.interval * 1000 || 5000; } abort() { instance(this).aborted = true; } async poll({ signal } = {}) { if ((signal && signal.aborted) || instance(this).aborted) { throw new RPError('polling aborted'); } if (this.expired()) { throw new RPError('the device code %j has expired and the device authorization session has concluded', this.device_code); } await new Promise((resolve) => setTimeout(resolve, instance(this).interval)); const response = await authenticatedPost.call( instance(this).client, 'token', { form: { ...instance(this).exchangeBody, grant_type: 'urn:ietf:params:oauth:grant-type:device_code', device_code: this.device_code, }, responseType: 'json', }, { clientAssertionPayload: instance(this).clientAssertionPayload, DPoP: instance(this).DPoP }, ); let responseBody; try { responseBody = processResponse(response); } catch (err) { switch (err instanceof OPError && err.error) { case 'slow_down': instance(this).interval += 5000; case 'authorization_pending': // eslint-disable-line no-fallthrough return this.poll({ signal }); default: throw err; } } const tokenset = new TokenSet(responseBody); if ('id_token' in tokenset) { await instance(this).client.decryptIdToken(tokenset); await instance(this).client.validateIdToken(tokenset, undefined, 'token', instance(this).maxAge); } return tokenset; } get device_code() { return instance(this).response.device_code; } get user_code() { return instance(this).response.user_code; } get verification_uri() { return instance(this).response.verification_uri; } get verification_uri_complete() { return instance(this).response.verification_uri_complete; } get expires_in() { return Math.max.apply(null, [instance(this).expires_at - now(), 0]); } expired() { return this.expires_in === 0; } /* istanbul ignore next */ [inspect.custom]() { return `${this.constructor.name} ${inspect(instance(this).response, { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true, })}`; } } module.exports = DeviceFlowHandle; /***/ }), /***/ 31151: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable camelcase */ const { format } = __webpack_require__(31669); const makeError = __webpack_require__(21381); function OPError({ error_description, error, error_uri, session_state, state, scope, }, response) { OPError.super.call(this, !error_description ? error : `${error} (${error_description})`); Object.assign( this, { error }, (error_description && { error_description }), (error_uri && { error_uri }), (state && { state }), (scope && { scope }), (session_state && { session_state }), ); if (response) { Object.defineProperty(this, 'response', { value: response, }); } } makeError(OPError); function RPError(...args) { if (typeof args[0] === 'string') { RPError.super.call(this, format(...args)); } else { const { message, printf, response, ...rest } = args[0]; if (printf) { RPError.super.call(this, format(...printf)); } else { RPError.super.call(this, message); } Object.assign(this, rest); if (response) { Object.defineProperty(this, 'response', { value: response, }); } } } makeError(RPError); module.exports = { OPError, RPError, }; /***/ }), /***/ 68973: /***/ ((module) => { function assertSigningAlgValuesSupport(endpoint, issuer, properties) { if (!issuer[`${endpoint}_endpoint`]) return; const eam = `${endpoint}_endpoint_auth_method`; const easa = `${endpoint}_endpoint_auth_signing_alg`; const easavs = `${endpoint}_endpoint_auth_signing_alg_values_supported`; if (properties[eam] && properties[eam].endsWith('_jwt') && !properties[easa] && !issuer[easavs]) { throw new TypeError(`${easavs} must be configured on the issuer if ${easa} is not defined on a client`); } } function assertIssuerConfiguration(issuer, endpoint) { if (!issuer[endpoint]) { throw new TypeError(`${endpoint} must be configured on the issuer`); } } module.exports = { assertSigningAlgValuesSupport, assertIssuerConfiguration, }; /***/ }), /***/ 23570: /***/ ((module) => { let encode; if (Buffer.isEncoding('base64url')) { encode = (input, encoding = 'utf8') => Buffer.from(input, encoding).toString('base64url'); } else { const fromBase64 = (base64) => base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); encode = (input, encoding = 'utf8') => fromBase64(Buffer.from(input, encoding).toString('base64')); } const decode = (input) => Buffer.from(input, 'base64'); module.exports.decode = decode; module.exports.encode = encode; /***/ }), /***/ 26633: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const jose = __webpack_require__(87115); const { assertIssuerConfiguration } = __webpack_require__(68973); const { random } = __webpack_require__(65894); const now = __webpack_require__(24393); const request = __webpack_require__(8048); const instance = __webpack_require__(69020); const merge = __webpack_require__(71839); const formUrlEncode = (value) => encodeURIComponent(value).replace(/%20/g, '+'); async function clientAssertion(endpoint, payload) { let alg = this[`${endpoint}_endpoint_auth_signing_alg`]; if (!alg) { assertIssuerConfiguration(this.issuer, `${endpoint}_endpoint_auth_signing_alg_values_supported`); } if (this[`${endpoint}_endpoint_auth_method`] === 'client_secret_jwt') { const key = await this.joseSecret(); if (!alg) { const supported = this.issuer[`${endpoint}_endpoint_auth_signing_alg_values_supported`]; alg = Array.isArray(supported) && supported.find((signAlg) => key.algorithms('sign').has(signAlg)); } return jose.JWS.sign(payload, key, { alg, typ: 'JWT' }); } const keystore = instance(this).get('keystore'); if (!keystore) { throw new TypeError('no client jwks provided for signing a client assertion with'); } if (!alg) { const algs = new Set(); keystore.all().forEach((key) => { key.algorithms('sign').forEach(Set.prototype.add.bind(algs)); }); const supported = this.issuer[`${endpoint}_endpoint_auth_signing_alg_values_supported`]; alg = Array.isArray(supported) && supported.find((signAlg) => algs.has(signAlg)); } const key = keystore.get({ alg, use: 'sig' }); if (!key) { throw new TypeError(`no key found in client jwks to sign a client assertion with using alg ${alg}`); } return jose.JWS.sign(payload, key, { alg, typ: 'JWT', kid: key.kid }); } async function authFor(endpoint, { clientAssertionPayload } = {}) { const authMethod = this[`${endpoint}_endpoint_auth_method`]; switch (authMethod) { case 'self_signed_tls_client_auth': case 'tls_client_auth': case 'none': return { form: { client_id: this.client_id } }; case 'client_secret_post': if (!this.client_secret) { throw new TypeError('client_secret_post client authentication method requires a client_secret'); } return { form: { client_id: this.client_id, client_secret: this.client_secret } }; case 'private_key_jwt': case 'client_secret_jwt': { const timestamp = now(); const mTLS = endpoint === 'token' && this.tls_client_certificate_bound_access_tokens; const audience = [...new Set([ this.issuer.issuer, this.issuer.token_endpoint, this.issuer[`${endpoint}_endpoint`], mTLS && this.issuer.mtls_endpoint_aliases ? this.issuer.mtls_endpoint_aliases.token_endpoint : undefined, ].filter(Boolean))]; const assertion = await clientAssertion.call(this, endpoint, { iat: timestamp, exp: timestamp + 60, jti: random(), iss: this.client_id, sub: this.client_id, aud: audience, ...clientAssertionPayload, }); return { form: { client_id: this.client_id, client_assertion: assertion, client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', }, }; } default: { // client_secret_basic // This is correct behaviour, see https://tools.ietf.org/html/rfc6749#section-2.3.1 and the // related appendix. (also https://github.com/panva/node-openid-client/pull/91) // > The client identifier is encoded using the // > "application/x-www-form-urlencoded" encoding algorithm per // > Appendix B, and the encoded value is used as the username; the client // > password is encoded using the same algorithm and used as the // > password. if (!this.client_secret) { throw new TypeError('client_secret_basic client authentication method requires a client_secret'); } const encoded = `${formUrlEncode(this.client_id)}:${formUrlEncode(this.client_secret)}`; const value = Buffer.from(encoded).toString('base64'); return { headers: { Authorization: `Basic ${value}` } }; } } } function resolveResponseType() { const { length, 0: value } = this.response_types; if (length === 1) { return value; } return undefined; } function resolveRedirectUri() { const { length, 0: value } = this.redirect_uris || []; if (length === 1) { return value; } return undefined; } async function authenticatedPost(endpoint, opts, { clientAssertionPayload, endpointAuthMethod = endpoint, DPoP, } = {}) { const auth = await authFor.call(this, endpointAuthMethod, { clientAssertionPayload }); const requestOpts = merge(opts, auth); const mTLS = this[`${endpointAuthMethod}_endpoint_auth_method`].includes('tls_client_auth') || (endpoint === 'token' && this.tls_client_certificate_bound_access_tokens); let targetUrl; if (mTLS && this.issuer.mtls_endpoint_aliases) { targetUrl = this.issuer.mtls_endpoint_aliases[`${endpoint}_endpoint`]; } targetUrl = targetUrl || this.issuer[`${endpoint}_endpoint`]; if ('form' in requestOpts) { for (const [key, value] of Object.entries(requestOpts.form)) { // eslint-disable-line no-restricted-syntax, max-len if (typeof value === 'undefined') { delete requestOpts.form[key]; } } } return request.call(this, { ...requestOpts, method: 'POST', url: targetUrl, }, { mTLS, DPoP }); } module.exports = { resolveResponseType, resolveRedirectUri, authFor, authenticatedPost, }; /***/ }), /***/ 6144: /***/ ((module) => { const OIDC_DISCOVERY = '/.well-known/openid-configuration'; const OAUTH2_DISCOVERY = '/.well-known/oauth-authorization-server'; const WEBFINGER = '/.well-known/webfinger'; const REL = 'http://openid.net/specs/connect/1.0/issuer'; const AAD_MULTITENANT_DISCOVERY = [ `https://login.microsoftonline.com/common${OIDC_DISCOVERY}`, `https://login.microsoftonline.com/common/v2.0${OIDC_DISCOVERY}`, `https://login.microsoftonline.com/organizations/v2.0${OIDC_DISCOVERY}`, `https://login.microsoftonline.com/consumers/v2.0${OIDC_DISCOVERY}`, ]; const CLIENT_DEFAULTS = { grant_types: ['authorization_code'], id_token_signed_response_alg: 'RS256', authorization_signed_response_alg: 'RS256', response_types: ['code'], token_endpoint_auth_method: 'client_secret_basic', }; const ISSUER_DEFAULTS = { claim_types_supported: ['normal'], claims_parameter_supported: false, grant_types_supported: ['authorization_code', 'implicit'], request_parameter_supported: false, request_uri_parameter_supported: true, require_request_uri_registration: false, response_modes_supported: ['query', 'fragment'], token_endpoint_auth_methods_supported: ['client_secret_basic'], }; const CALLBACK_PROPERTIES = [ 'access_token', // 6749 'code', // 6749 'error', // 6749 'error_description', // 6749 'error_uri', // 6749 'expires_in', // 6749 'id_token', // Core 1.0 'state', // 6749 'token_type', // 6749 'session_state', // Session Management 'response', // JARM ]; const JWT_CONTENT = /^application\/jwt/; const HTTP_OPTIONS = Symbol('openid-client.custom.http-options'); const CLOCK_TOLERANCE = Symbol('openid-client.custom.clock-tolerance'); module.exports = { AAD_MULTITENANT_DISCOVERY, CALLBACK_PROPERTIES, CLIENT_DEFAULTS, CLOCK_TOLERANCE, HTTP_OPTIONS, ISSUER_DEFAULTS, JWT_CONTENT, OAUTH2_DISCOVERY, OIDC_DISCOVERY, REL, WEBFINGER, }; /***/ }), /***/ 85618: /***/ ((module) => { module.exports = (obj) => JSON.parse(JSON.stringify(obj)); /***/ }), /***/ 44129: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-restricted-syntax, no-continue */ const isPlainObject = __webpack_require__(89717); function defaults(deep, target, ...sources) { for (const source of sources) { if (!isPlainObject(source)) { continue; } for (const [key, value] of Object.entries(source)) { /* istanbul ignore if */ if (key === '__proto__' || key === 'constructor') { continue; } if (typeof target[key] === 'undefined' && typeof value !== 'undefined') { target[key] = value; } if (deep && isPlainObject(target[key]) && isPlainObject(value)) { defaults(true, target[key], value); } } } return target; } module.exports = defaults.bind(undefined, false); module.exports.deep = defaults.bind(undefined, true); /***/ }), /***/ 65894: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { createHash, randomBytes } = __webpack_require__(76417); const base64url = __webpack_require__(23570); const random = (bytes = 32) => base64url.encode(randomBytes(bytes)); module.exports = { random, state: random, nonce: random, codeVerifier: random, codeChallenge: (codeVerifier) => base64url.encode(createHash('sha256').update(codeVerifier).digest()), }; /***/ }), /***/ 61758: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const url = __webpack_require__(78835); const { strict: assert } = __webpack_require__(42357); module.exports = (target) => { try { const { protocol } = new url.URL(target); assert(protocol.match(/^(https?:)$/)); return true; } catch (err) { throw new TypeError('only valid absolute URLs can be requested'); } }; /***/ }), /***/ 89717: /***/ ((module) => { module.exports = (a) => !!a && a.constructor === Object; /***/ }), /***/ 71839: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-restricted-syntax, no-param-reassign, no-continue */ const isPlainObject = __webpack_require__(89717); function merge(target, ...sources) { for (const source of sources) { if (!isPlainObject(source)) { continue; } for (const [key, value] of Object.entries(source)) { /* istanbul ignore if */ if (key === '__proto__' || key === 'constructor') { continue; } if (isPlainObject(target[key]) && isPlainObject(value)) { target[key] = merge(target[key], value); } else if (typeof value !== 'undefined') { target[key] = value; } } } return target; } module.exports = merge; /***/ }), /***/ 70260: /***/ ((module) => { module.exports = function pick(object, ...paths) { const obj = {}; for (const path of paths) { // eslint-disable-line no-restricted-syntax if (object[path]) { obj[path] = object[path]; } } return obj; }; /***/ }), /***/ 59980: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { STATUS_CODES } = __webpack_require__(98605); const { format } = __webpack_require__(31669); const { OPError } = __webpack_require__(31151); const REGEXP = /(\w+)=("[^"]*")/g; const throwAuthenticateErrors = (response) => { const params = {}; try { while ((REGEXP.exec(response.headers['www-authenticate'])) !== null) { if (RegExp.$1 && RegExp.$2) { params[RegExp.$1] = RegExp.$2.slice(1, -1); } } } catch (err) {} if (params.error) { throw new OPError(params, response); } }; const isStandardBodyError = (response) => { let result = false; try { let jsonbody; if (typeof response.body !== 'object' || Buffer.isBuffer(response.body)) { jsonbody = JSON.parse(response.body); } else { jsonbody = response.body; } result = typeof jsonbody.error === 'string' && jsonbody.error.length; if (result) response.body = jsonbody; } catch (err) {} return result; }; function processResponse(response, { statusCode = 200, body = true, bearer = false } = {}) { if (response.statusCode !== statusCode) { if (bearer) { throwAuthenticateErrors(response); } if (isStandardBodyError(response)) { throw new OPError(response.body, response); } throw new OPError({ error: format('expected %i %s, got: %i %s', statusCode, STATUS_CODES[statusCode], response.statusCode, STATUS_CODES[response.statusCode]), }, response); } if (body && !response.body) { throw new OPError({ error: format('expected %i %s with body but no body was returned', statusCode, STATUS_CODES[statusCode]), }, response); } return response.body; } module.exports = processResponse; /***/ }), /***/ 8048: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Got = __webpack_require__(93061); const pkg = __webpack_require__(87932); const { deep: defaultsDeep } = __webpack_require__(44129); const isAbsoluteUrl = __webpack_require__(61758); const { HTTP_OPTIONS } = __webpack_require__(6144); let DEFAULT_HTTP_OPTIONS; let got; const setDefaults = (options) => { DEFAULT_HTTP_OPTIONS = defaultsDeep({}, options, DEFAULT_HTTP_OPTIONS); got = Got.extend(DEFAULT_HTTP_OPTIONS); }; setDefaults({ followRedirect: false, headers: { 'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})` }, retry: 0, timeout: 3500, throwHttpErrors: false, }); module.exports = async function request(options, { mTLS = false, DPoP } = {}) { const { url } = options; isAbsoluteUrl(url); const optsFn = this[HTTP_OPTIONS]; let opts = options; if (DPoP && 'dpopProof' in this) { opts.headers = opts.headers || {}; opts.headers.DPoP = this.dpopProof({ htu: url, htm: options.method, }, DPoP); } if (optsFn) { opts = optsFn.call(this, defaultsDeep({}, opts, DEFAULT_HTTP_OPTIONS)); } if ( mTLS && ( (!opts.key || !opts.cert) && (!opts.https || !((opts.https.key && opts.https.certificate) || opts.https.pfx)) ) ) { throw new TypeError('mutual-TLS certificate and key not set'); } return got(opts); }; module.exports.setDefaults = setDefaults; /***/ }), /***/ 24393: /***/ ((module) => { module.exports = () => Math.floor(Date.now() / 1000); /***/ }), /***/ 69020: /***/ ((module) => { const privateProps = new WeakMap(); module.exports = (ctx) => { if (!privateProps.has(ctx)) { privateProps.set(ctx, new Map([['metadata', new Map()]])); } return privateProps.get(ctx); }; /***/ }), /***/ 10304: /***/ ((module) => { // Credit: https://github.com/rohe/pyoidc/blob/master/src/oic/utils/webfinger.py // -- Normalization -- // A string of any other type is interpreted as a URI either the form of scheme // "://" authority path-abempty [ "?" query ] [ "#" fragment ] or authority // path-abempty [ "?" query ] [ "#" fragment ] per RFC 3986 [RFC3986] and is // normalized according to the following rules: // // If the user input Identifier does not have an RFC 3986 [RFC3986] scheme // portion, the string is interpreted as [userinfo "@"] host [":" port] // path-abempty [ "?" query ] [ "#" fragment ] per RFC 3986 [RFC3986]. // If the userinfo component is present and all of the path component, query // component, and port component are empty, the acct scheme is assumed. In this // case, the normalized URI is formed by prefixing acct: to the string as the // scheme. Per the 'acct' URI Scheme [I‑D.ietf‑appsawg‑acct‑uri], if there is an // at-sign character ('@') in the userinfo component, it needs to be // percent-encoded as described in RFC 3986 [RFC3986]. // For all other inputs without a scheme portion, the https scheme is assumed, // and the normalized URI is formed by prefixing https:// to the string as the // scheme. // If the resulting URI contains a fragment portion, it MUST be stripped off // together with the fragment delimiter character "#". // The WebFinger [I‑D.ietf‑appsawg‑webfinger] Resource in this case is the // resulting URI, and the WebFinger Host is the authority component. // // Note: Since the definition of authority in RFC 3986 [RFC3986] is // [ userinfo "@" ] host [ ":" port ], it is legal to have a user input // identifier like userinfo@host:port, e.g., alice@example.com:8080. const PORT = /^\d+$/; function hasScheme(input) { if (input.includes('://')) return true; const authority = input.replace(/(\/|\?)/g, '#').split('#')[0]; if (authority.includes(':')) { const index = authority.indexOf(':'); const hostOrPort = authority.slice(index + 1); if (!PORT.test(hostOrPort)) { return true; } } return false; } function acctSchemeAssumed(input) { if (!input.includes('@')) return false; const parts = input.split('@'); const host = parts[parts.length - 1]; return !(host.includes(':') || host.includes('/') || host.includes('?')); } function normalize(input) { if (typeof input !== 'string') { throw new TypeError('input must be a string'); } let output; if (hasScheme(input)) { output = input; } else if (acctSchemeAssumed(input)) { output = `acct:${input}`; } else { output = `https://${input}`; } return output.split('#')[0]; } module.exports = normalize; /***/ }), /***/ 22881: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Issuer = __webpack_require__(14470); const { OPError, RPError } = __webpack_require__(31151); const Registry = __webpack_require__(70011); const Strategy = __webpack_require__(84114); const TokenSet = __webpack_require__(14974); const { CLOCK_TOLERANCE, HTTP_OPTIONS } = __webpack_require__(6144); const generators = __webpack_require__(65894); const { setDefaults } = __webpack_require__(8048); module.exports = { Issuer, Registry, Strategy, TokenSet, errors: { OPError, RPError, }, custom: { setHttpOptionsDefaults: setDefaults, http_options: HTTP_OPTIONS, clock_tolerance: CLOCK_TOLERANCE, }, generators, }; /***/ }), /***/ 14470: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable max-classes-per-file */ const { inspect } = __webpack_require__(31669); const url = __webpack_require__(78835); const AggregateError = __webpack_require__(61231); const jose = __webpack_require__(87115); const LRU = __webpack_require__(7129); const objectHash = __webpack_require__(24856); const { RPError } = __webpack_require__(31151); const getClient = __webpack_require__(49609); const registry = __webpack_require__(70011); const processResponse = __webpack_require__(59980); const webfingerNormalize = __webpack_require__(10304); const instance = __webpack_require__(69020); const request = __webpack_require__(8048); const { assertIssuerConfiguration } = __webpack_require__(68973); const { ISSUER_DEFAULTS, OIDC_DISCOVERY, OAUTH2_DISCOVERY, WEBFINGER, REL, AAD_MULTITENANT_DISCOVERY, } = __webpack_require__(6144); const AAD_MULTITENANT = Symbol('AAD_MULTITENANT'); class Issuer { /** * @name constructor * @api public */ constructor(meta = {}) { const aadIssValidation = meta[AAD_MULTITENANT]; delete meta[AAD_MULTITENANT]; ['introspection', 'revocation'].forEach((endpoint) => { // if intro/revocation endpoint auth specific meta is missing use the token ones if they // are defined if ( meta[`${endpoint}_endpoint`] && meta[`${endpoint}_endpoint_auth_methods_supported`] === undefined && meta[`${endpoint}_endpoint_auth_signing_alg_values_supported`] === undefined ) { if (meta.token_endpoint_auth_methods_supported) { meta[`${endpoint}_endpoint_auth_methods_supported`] = meta.token_endpoint_auth_methods_supported; } if (meta.token_endpoint_auth_signing_alg_values_supported) { meta[`${endpoint}_endpoint_auth_signing_alg_values_supported`] = meta.token_endpoint_auth_signing_alg_values_supported; } } }); Object.entries(meta).forEach(([key, value]) => { instance(this).get('metadata').set(key, value); if (!this[key]) { Object.defineProperty(this, key, { get() { return instance(this).get('metadata').get(key); }, enumerable: true, }); } }); instance(this).set('cache', new LRU({ max: 100 })); registry.set(this.issuer, this); const Client = getClient(this, aadIssValidation); Object.defineProperties(this, { Client: { value: Client }, FAPIClient: { value: class FAPIClient extends Client {} }, }); } /** * @name keystore * @api public */ async keystore(reload = false) { assertIssuerConfiguration(this, 'jwks_uri'); const keystore = instance(this).get('keystore'); const cache = instance(this).get('cache'); if (reload || !keystore) { cache.reset(); const response = await request.call(this, { method: 'GET', responseType: 'json', url: this.jwks_uri, }); const jwks = processResponse(response); const joseKeyStore = jose.JWKS.asKeyStore(jwks, { ignoreErrors: true }); cache.set('throttle', true, 60 * 1000); instance(this).set('keystore', joseKeyStore); return joseKeyStore; } return keystore; } /** * @name queryKeyStore * @api private */ async queryKeyStore({ kid, kty, alg, use, key_ops: ops, }, { allowMulti = false } = {}) { const cache = instance(this).get('cache'); const def = { kid, kty, alg, use, key_ops: ops, }; const defHash = objectHash(def, { algorithm: 'sha256', ignoreUnknown: true, unorderedArrays: true, unorderedSets: true, }); // refresh keystore on every unknown key but also only upto once every minute const freshJwksUri = cache.get(defHash) || cache.get('throttle'); const keystore = await this.keystore(!freshJwksUri); const keys = keystore.all(def); if (keys.length === 0) { throw new RPError({ printf: ["no valid key found in issuer's jwks_uri for key parameters %j", def], jwks: keystore, }); } if (!allowMulti && keys.length > 1 && !kid) { throw new RPError({ printf: ["multiple matching keys found in issuer's jwks_uri for key parameters %j, kid must be provided in this case", def], jwks: keystore, }); } cache.set(defHash, true); return new jose.JWKS.KeyStore(keys); } /** * @name metadata * @api public */ get metadata() { const copy = {}; instance(this).get('metadata').forEach((value, key) => { copy[key] = value; }); return copy; } /** * @name webfinger * @api public */ static async webfinger(input) { const resource = webfingerNormalize(input); const { host } = url.parse(resource); const webfingerUrl = `https://${host}${WEBFINGER}`; const response = await request.call(this, { method: 'GET', url: webfingerUrl, responseType: 'json', searchParams: { resource, rel: REL }, followRedirect: true, }); const body = processResponse(response); const location = Array.isArray(body.links) && body.links.find((link) => typeof link === 'object' && link.rel === REL && link.href); if (!location) { throw new RPError({ message: 'no issuer found in webfinger response', body, }); } if (typeof location.href !== 'string' || !location.href.startsWith('https://')) { throw new RPError({ printf: ['invalid issuer location %s', location.href], body, }); } const expectedIssuer = location.href; if (registry.has(expectedIssuer)) { return registry.get(expectedIssuer); } const issuer = await this.discover(expectedIssuer); if (issuer.issuer !== expectedIssuer) { registry.delete(issuer.issuer); throw new RPError('discovered issuer mismatch, expected %s, got: %s', expectedIssuer, issuer.issuer); } return issuer; } /** * @name discover * @api public */ static async discover(uri) { const parsed = url.parse(uri); if (parsed.pathname.includes('/.well-known/')) { const response = await request.call(this, { method: 'GET', responseType: 'json', url: uri, }); const body = processResponse(response); return new Issuer({ ...ISSUER_DEFAULTS, ...body, [AAD_MULTITENANT]: !!AAD_MULTITENANT_DISCOVERY.find( (discoveryURL) => uri.startsWith(discoveryURL), ), }); } const pathnames = []; if (parsed.pathname.endsWith('/')) { pathnames.push(`${parsed.pathname}${OIDC_DISCOVERY.substring(1)}`); } else { pathnames.push(`${parsed.pathname}${OIDC_DISCOVERY}`); } if (parsed.pathname === '/') { pathnames.push(`${OAUTH2_DISCOVERY}`); } else { pathnames.push(`${OAUTH2_DISCOVERY}${parsed.pathname}`); } const errors = []; // eslint-disable-next-line no-restricted-syntax for (const pathname of pathnames) { try { const wellKnownUri = url.format({ ...parsed, pathname }); // eslint-disable-next-line no-await-in-loop const response = await request.call(this, { method: 'GET', responseType: 'json', url: wellKnownUri, }); const body = processResponse(response); return new Issuer({ ...ISSUER_DEFAULTS, ...body, [AAD_MULTITENANT]: !!AAD_MULTITENANT_DISCOVERY.find( (discoveryURL) => wellKnownUri.startsWith(discoveryURL), ), }); } catch (err) { errors.push(err); } } const err = new AggregateError(errors); err.message = `Issuer.discover() failed.${err.message.split('\n') .filter((line) => !line.startsWith(' at')).join('\n')}`; throw err; } /* istanbul ignore next */ [inspect.custom]() { return `${this.constructor.name} ${inspect(this.metadata, { depth: Infinity, colors: process.stdout.isTTY, compact: false, sorted: true, })}`; } } module.exports = Issuer; /***/ }), /***/ 70011: /***/ ((module) => { const REGISTRY = new Map(); module.exports = REGISTRY; /***/ }), /***/ 84114: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-underscore-dangle */ const url = __webpack_require__(78835); const { format } = __webpack_require__(31669); const cloneDeep = __webpack_require__(85618); const { RPError, OPError } = __webpack_require__(31151); const { BaseClient } = __webpack_require__(49609); const { random, codeChallenge } = __webpack_require__(65894); const pick = __webpack_require__(70260); const { resolveResponseType, resolveRedirectUri } = __webpack_require__(26633); function verified(err, user, info = {}) { if (err) { this.error(err); } else if (!user) { this.fail(info); } else { this.success(user, info); } } /** * @name constructor * @api public */ function OpenIDConnectStrategy({ client, params = {}, passReqToCallback = false, sessionKey, usePKCE = true, extras = {}, } = {}, verify) { if (!(client instanceof BaseClient)) { throw new TypeError('client must be an instance of openid-client Client'); } if (typeof verify !== 'function') { throw new TypeError('verify callback must be a function'); } if (!client.issuer || !client.issuer.issuer) { throw new TypeError('client must have an issuer with an identifier'); } this._client = client; this._issuer = client.issuer; this._verify = verify; this._passReqToCallback = passReqToCallback; this._usePKCE = usePKCE; this._key = sessionKey || `oidc:${url.parse(this._issuer.issuer).hostname}`; this._params = cloneDeep(params); this._extras = cloneDeep(extras); if (!this._params.response_type) this._params.response_type = resolveResponseType.call(client); if (!this._params.redirect_uri) this._params.redirect_uri = resolveRedirectUri.call(client); if (!this._params.scope) this._params.scope = 'openid'; if (this._usePKCE === true) { const supportedMethods = Array.isArray(this._issuer.code_challenge_methods_supported) ? this._issuer.code_challenge_methods_supported : false; if (supportedMethods && supportedMethods.includes('S256')) { this._usePKCE = 'S256'; } else if (supportedMethods && supportedMethods.includes('plain')) { this._usePKCE = 'plain'; } else if (supportedMethods) { throw new TypeError('neither code_challenge_method supported by the client is supported by the issuer'); } else { this._usePKCE = 'S256'; } } else if (typeof this._usePKCE === 'string' && !['plain', 'S256'].includes(this._usePKCE)) { throw new TypeError(`${this._usePKCE} is not valid/implemented PKCE code_challenge_method`); } this.name = url.parse(client.issuer.issuer).hostname; } OpenIDConnectStrategy.prototype.authenticate = function authenticate(req, options) { (async () => { const client = this._client; if (!req.session) { throw new TypeError('authentication requires session support'); } const reqParams = client.callbackParams(req); const sessionKey = this._key; /* start authentication request */ if (Object.keys(reqParams).length === 0) { // provide options object with extra authentication parameters const params = { state: random(), ...this._params, ...options, }; if (!params.nonce && params.response_type.includes('id_token')) { params.nonce = random(); } req.session[sessionKey] = pick(params, 'nonce', 'state', 'max_age', 'response_type'); if (this._usePKCE && params.response_type.includes('code')) { const verifier = random(); req.session[sessionKey].code_verifier = verifier; switch (this._usePKCE) { // eslint-disable-line default-case case 'S256': params.code_challenge = codeChallenge(verifier); params.code_challenge_method = 'S256'; break; case 'plain': params.code_challenge = verifier; break; } } this.redirect(client.authorizationUrl(params)); return; } /* end authentication request */ /* start authentication response */ const session = req.session[sessionKey]; if (Object.keys(session || {}).length === 0) { throw new Error(format('did not find expected authorization request details in session, req.session["%s"] is %j', sessionKey, session)); } const { state, nonce, max_age: maxAge, code_verifier: codeVerifier, response_type: responseType, } = session; try { delete req.session[sessionKey]; } catch (err) {} const opts = { redirect_uri: this._params.redirect_uri, ...options, }; const checks = { state, nonce, max_age: maxAge, code_verifier: codeVerifier, response_type: responseType, }; const tokenset = await client.callback(opts.redirect_uri, reqParams, checks, this._extras); const passReq = this._passReqToCallback; const loadUserinfo = this._verify.length > (passReq ? 3 : 2) && client.issuer.userinfo_endpoint; const args = [tokenset, verified.bind(this)]; if (loadUserinfo) { if (!tokenset.access_token) { throw new RPError({ message: 'expected access_token to be returned when asking for userinfo in verify callback', tokenset, }); } const userinfo = await client.userinfo(tokenset); args.splice(1, 0, userinfo); } if (passReq) { args.unshift(req); } this._verify(...args); /* end authentication response */ })().catch((error) => { if ( (error instanceof OPError && error.error !== 'server_error' && !error.error.startsWith('invalid')) || error instanceof RPError ) { this.fail(error); } else { this.error(error); } }); }; module.exports = OpenIDConnectStrategy; /***/ }), /***/ 14974: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const base64url = __webpack_require__(23570); const now = __webpack_require__(24393); class TokenSet { /** * @name constructor * @api public */ constructor(values) { Object.assign(this, values); } /** * @name expires_in= * @api public */ set expires_in(value) { // eslint-disable-line camelcase this.expires_at = now() + Number(value); } /** * @name expires_in * @api public */ get expires_in() { // eslint-disable-line camelcase return Math.max.apply(null, [this.expires_at - now(), 0]); } /** * @name expired * @api public */ expired() { return this.expires_in === 0; } /** * @name claims * @api public */ claims() { if (!this.id_token) { throw new TypeError('id_token not present in TokenSet'); } return JSON.parse(base64url.decode(this.id_token.split('.')[1])); } } module.exports = TokenSet; /***/ }), /***/ 39436: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { define } = __webpack_require__(93998) const base = __webpack_require__(33318) const constants = __webpack_require__(90998) const decoders = __webpack_require__(5017) const encoders = __webpack_require__(2246) module.exports = { base, constants, decoders, define, encoders } /***/ }), /***/ 93998: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) const encoders = __webpack_require__(2246) const decoders = __webpack_require__(5017) module.exports.define = function define (name, body) { return new Entity(name, body) } function Entity (name, body) { this.name = name this.body = body this.decoders = {} this.encoders = {} } Entity.prototype._createNamed = function createNamed (Base) { const name = this.name function Generated (entity) { this._initNamed(entity, name) } inherits(Generated, Base) Generated.prototype._initNamed = function _initNamed (entity, name) { Base.call(this, entity, name) } return new Generated(this) } Entity.prototype._getDecoder = function _getDecoder (enc) { enc = enc || 'der' // Lazily create decoder if (!Object.prototype.hasOwnProperty.call(this.decoders, enc)) { this.decoders[enc] = this._createNamed(decoders[enc]) } return this.decoders[enc] } Entity.prototype.decode = function decode (data, enc, options) { return this._getDecoder(enc).decode(data, options) } Entity.prototype._getEncoder = function _getEncoder (enc) { enc = enc || 'der' // Lazily create encoder if (!Object.prototype.hasOwnProperty.call(this.encoders, enc)) { this.encoders[enc] = this._createNamed(encoders[enc]) } return this.encoders[enc] } Entity.prototype.encode = function encode (data, enc, /* internal */ reporter) { return this._getEncoder(enc).encode(data, reporter) } /***/ }), /***/ 28424: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) const { Reporter } = __webpack_require__(93026) function DecoderBuffer (base, options) { Reporter.call(this, options) if (!Buffer.isBuffer(base)) { this.error('Input not Buffer') return } this.base = base this.offset = 0 this.length = base.length } inherits(DecoderBuffer, Reporter) DecoderBuffer.isDecoderBuffer = function isDecoderBuffer (data) { if (data instanceof DecoderBuffer) { return true } // Or accept compatible API const isCompatible = typeof data === 'object' && Buffer.isBuffer(data.base) && data.constructor.name === 'DecoderBuffer' && typeof data.offset === 'number' && typeof data.length === 'number' && typeof data.save === 'function' && typeof data.restore === 'function' && typeof data.isEmpty === 'function' && typeof data.readUInt8 === 'function' && typeof data.skip === 'function' && typeof data.raw === 'function' return isCompatible } DecoderBuffer.prototype.save = function save () { return { offset: this.offset, reporter: Reporter.prototype.save.call(this) } } DecoderBuffer.prototype.restore = function restore (save) { // Return skipped data const res = new DecoderBuffer(this.base) res.offset = save.offset res.length = this.offset this.offset = save.offset Reporter.prototype.restore.call(this, save.reporter) return res } DecoderBuffer.prototype.isEmpty = function isEmpty () { return this.offset === this.length } DecoderBuffer.prototype.readUInt8 = function readUInt8 (fail) { if (this.offset + 1 <= this.length) { return this.base.readUInt8(this.offset++, true) } else { return this.error(fail || 'DecoderBuffer overrun') } } DecoderBuffer.prototype.skip = function skip (bytes, fail) { if (!(this.offset + bytes <= this.length)) { return this.error(fail || 'DecoderBuffer overrun') } const res = new DecoderBuffer(this.base) // Share reporter state res._reporterState = this._reporterState res.offset = this.offset res.length = this.offset + bytes this.offset += bytes return res } DecoderBuffer.prototype.raw = function raw (save) { return this.base.slice(save ? save.offset : this.offset, this.length) } function EncoderBuffer (value, reporter) { if (Array.isArray(value)) { this.length = 0 this.value = value.map(function (item) { if (!EncoderBuffer.isEncoderBuffer(item)) { item = new EncoderBuffer(item, reporter) } this.length += item.length return item }, this) } else if (typeof value === 'number') { if (!(value >= 0 && value <= 0xff)) { return reporter.error('non-byte EncoderBuffer value') } this.value = value this.length = 1 } else if (typeof value === 'string') { this.value = value this.length = Buffer.byteLength(value) } else if (Buffer.isBuffer(value)) { this.value = value this.length = value.length } else { return reporter.error(`Unsupported type: ${typeof value}`) } } EncoderBuffer.isEncoderBuffer = function isEncoderBuffer (data) { if (data instanceof EncoderBuffer) { return true } // Or accept compatible API const isCompatible = typeof data === 'object' && data.constructor.name === 'EncoderBuffer' && typeof data.length === 'number' && typeof data.join === 'function' return isCompatible } EncoderBuffer.prototype.join = function join (out, offset) { if (!out) { out = Buffer.alloc(this.length) } if (!offset) { offset = 0 } if (this.length === 0) { return out } if (Array.isArray(this.value)) { this.value.forEach(function (item) { item.join(out, offset) offset += item.length }) } else { if (typeof this.value === 'number') { out[offset] = this.value } else if (typeof this.value === 'string') { out.write(this.value, offset) } else if (Buffer.isBuffer(this.value)) { this.value.copy(out, offset) } offset += this.length } return out } module.exports = { DecoderBuffer, EncoderBuffer } /***/ }), /***/ 33318: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { Reporter } = __webpack_require__(93026) const { DecoderBuffer, EncoderBuffer } = __webpack_require__(28424) const Node = __webpack_require__(48674) module.exports = { DecoderBuffer, EncoderBuffer, Node, Reporter } /***/ }), /***/ 48674: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { strict: assert } = __webpack_require__(42357) const { Reporter } = __webpack_require__(93026) const { DecoderBuffer, EncoderBuffer } = __webpack_require__(28424) // Supported tags const tags = [ 'seq', 'seqof', 'set', 'setof', 'objid', 'bool', 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc', 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str', 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr' ] // Public methods list const methods = [ 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice', 'any', 'contains' ].concat(tags) // Overrided methods list const overrided = [ '_peekTag', '_decodeTag', '_use', '_decodeStr', '_decodeObjid', '_decodeTime', '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList', '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime', '_encodeNull', '_encodeInt', '_encodeBool' ] function Node (enc, parent, name) { const state = {} this._baseState = state state.name = name state.enc = enc state.parent = parent || null state.children = null // State state.tag = null state.args = null state.reverseArgs = null state.choice = null state.optional = false state.any = false state.obj = false state.use = null state.useDecoder = null state.key = null state.default = null state.explicit = null state.implicit = null state.contains = null // Should create new instance on each method if (!state.parent) { state.children = [] this._wrap() } } const stateProps = [ 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice', 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit', 'implicit', 'contains' ] Node.prototype.clone = function clone () { const state = this._baseState const cstate = {} stateProps.forEach(function (prop) { cstate[prop] = state[prop] }) const res = new this.constructor(cstate.parent) res._baseState = cstate return res } Node.prototype._wrap = function wrap () { const state = this._baseState methods.forEach(function (method) { this[method] = function _wrappedMethod () { const clone = new this.constructor(this) state.children.push(clone) return clone[method].apply(clone, arguments) } }, this) } Node.prototype._init = function init (body) { const state = this._baseState assert(state.parent === null) body.call(this) // Filter children state.children = state.children.filter(function (child) { return child._baseState.parent === this }, this) assert.equal(state.children.length, 1, 'Root node can have only one child') } Node.prototype._useArgs = function useArgs (args) { const state = this._baseState // Filter children and args const children = args.filter(function (arg) { return arg instanceof this.constructor }, this) args = args.filter(function (arg) { return !(arg instanceof this.constructor) }, this) if (children.length !== 0) { assert(state.children === null) state.children = children // Replace parent to maintain backward link children.forEach(function (child) { child._baseState.parent = this }, this) } if (args.length !== 0) { assert(state.args === null) state.args = args state.reverseArgs = args.map(function (arg) { if (typeof arg !== 'object' || arg.constructor !== Object) { return arg } const res = {} Object.keys(arg).forEach(function (key) { if (key == (key | 0)) { key |= 0 } // eslint-disable-line eqeqeq const value = arg[key] res[value] = key }) return res }) } } // // Overrided methods // overrided.forEach(function (method) { Node.prototype[method] = function _overrided () { const state = this._baseState throw new Error(`${method} not implemented for encoding: ${state.enc}`) } }) // // Public methods // tags.forEach(function (tag) { Node.prototype[tag] = function _tagMethod () { const state = this._baseState const args = Array.prototype.slice.call(arguments) assert(state.tag === null) state.tag = tag this._useArgs(args) return this } }) Node.prototype.use = function use (item) { assert(item) const state = this._baseState assert(state.use === null) state.use = item return this } Node.prototype.optional = function optional () { const state = this._baseState state.optional = true return this } Node.prototype.def = function def (val) { const state = this._baseState assert(state.default === null) state.default = val state.optional = true return this } Node.prototype.explicit = function explicit (num) { const state = this._baseState assert(state.explicit === null && state.implicit === null) state.explicit = num return this } Node.prototype.implicit = function implicit (num) { const state = this._baseState assert(state.explicit === null && state.implicit === null) state.implicit = num return this } Node.prototype.obj = function obj () { const state = this._baseState const args = Array.prototype.slice.call(arguments) state.obj = true if (args.length !== 0) { this._useArgs(args) } return this } Node.prototype.key = function key (newKey) { const state = this._baseState assert(state.key === null) state.key = newKey return this } Node.prototype.any = function any () { const state = this._baseState state.any = true return this } Node.prototype.choice = function choice (obj) { const state = this._baseState assert(state.choice === null) state.choice = obj this._useArgs(Object.keys(obj).map(function (key) { return obj[key] })) return this } Node.prototype.contains = function contains (item) { const state = this._baseState assert(state.use === null) state.contains = item return this } // // Decoding // Node.prototype._decode = function decode (input, options) { const state = this._baseState // Decode root node if (state.parent === null) { return input.wrapResult(state.children[0]._decode(input, options)) } let result = state.default let present = true let prevKey = null if (state.key !== null) { prevKey = input.enterKey(state.key) } // Check if tag is there if (state.optional) { let tag = null if (state.explicit !== null) { tag = state.explicit } else if (state.implicit !== null) { tag = state.implicit } else if (state.tag !== null) { tag = state.tag } if (tag === null && !state.any) { // Trial and Error const save = input.save() try { if (state.choice === null) { this._decodeGeneric(state.tag, input, options) } else { this._decodeChoice(input, options) } present = true } catch (e) { present = false } input.restore(save) } else { present = this._peekTag(input, tag, state.any) if (input.isError(present)) { return present } } } // Push object on stack let prevObj if (state.obj && present) { prevObj = input.enterObject() } if (present) { // Unwrap explicit values if (state.explicit !== null) { const explicit = this._decodeTag(input, state.explicit) if (input.isError(explicit)) { return explicit } input = explicit } const start = input.offset // Unwrap implicit and normal values if (state.use === null && state.choice === null) { let save if (state.any) { save = input.save() } const body = this._decodeTag( input, state.implicit !== null ? state.implicit : state.tag, state.any ) if (input.isError(body)) { return body } if (state.any) { result = input.raw(save) } else { input = body } } if (options && options.track && state.tag !== null) { options.track(input.path(), start, input.length, 'tagged') } if (options && options.track && state.tag !== null) { options.track(input.path(), input.offset, input.length, 'content') } // Select proper method for tag if (state.any) { // no-op } else if (state.choice === null) { result = this._decodeGeneric(state.tag, input, options) } else { result = this._decodeChoice(input, options) } if (input.isError(result)) { return result } // Decode children if (!state.any && state.choice === null && state.children !== null) { state.children.forEach(function decodeChildren (child) { // NOTE: We are ignoring errors here, to let parser continue with other // parts of encoded data child._decode(input, options) }) } // Decode contained/encoded by schema, only in bit or octet strings if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) { const data = new DecoderBuffer(result) result = this._getUse(state.contains, input._reporterState.obj) ._decode(data, options) } } // Pop object if (state.obj && present) { result = input.leaveObject(prevObj) } // Set key if (state.key !== null && (result !== null || present === true)) { input.leaveKey(prevKey, state.key, result) } else if (prevKey !== null) { input.exitKey(prevKey) } return result } Node.prototype._decodeGeneric = function decodeGeneric (tag, input, options) { const state = this._baseState if (tag === 'seq' || tag === 'set') { return null } if (tag === 'seqof' || tag === 'setof') { return this._decodeList(input, tag, state.args[0], options) } else if (/str$/.test(tag)) { return this._decodeStr(input, tag, options) } else if (tag === 'objid' && state.args) { return this._decodeObjid(input, state.args[0], state.args[1], options) } else if (tag === 'objid') { return this._decodeObjid(input, null, null, options) } else if (tag === 'gentime' || tag === 'utctime') { return this._decodeTime(input, tag, options) } else if (tag === 'null_') { return this._decodeNull(input, options) } else if (tag === 'bool') { return this._decodeBool(input, options) } else if (tag === 'objDesc') { return this._decodeStr(input, tag, options) } else if (tag === 'int' || tag === 'enum') { return this._decodeInt(input, state.args && state.args[0], options) } if (state.use !== null) { return this._getUse(state.use, input._reporterState.obj) ._decode(input, options) } else { return input.error(`unknown tag: ${tag}`) } } Node.prototype._getUse = function _getUse (entity, obj) { const state = this._baseState // Create altered use decoder if implicit is set state.useDecoder = this._use(entity, obj) assert(state.useDecoder._baseState.parent === null) state.useDecoder = state.useDecoder._baseState.children[0] if (state.implicit !== state.useDecoder._baseState.implicit) { state.useDecoder = state.useDecoder.clone() state.useDecoder._baseState.implicit = state.implicit } return state.useDecoder } Node.prototype._decodeChoice = function decodeChoice (input, options) { const state = this._baseState let result = null let match = false Object.keys(state.choice).some(function (key) { const save = input.save() const node = state.choice[key] try { const value = node._decode(input, options) if (input.isError(value)) { return false } result = { type: key, value: value } match = true } catch (e) { input.restore(save) return false } return true }, this) if (!match) { return input.error('Choice not matched') } return result } // // Encoding // Node.prototype._createEncoderBuffer = function createEncoderBuffer (data) { return new EncoderBuffer(data, this.reporter) } Node.prototype._encode = function encode (data, reporter, parent) { const state = this._baseState if (state.default !== null && state.default === data) { return } const result = this._encodeValue(data, reporter, parent) if (result === undefined) { return } if (this._skipDefault(result, reporter, parent)) { return } return result } Node.prototype._encodeValue = function encode (data, reporter, parent) { const state = this._baseState // Decode root node if (state.parent === null) { return state.children[0]._encode(data, reporter || new Reporter()) } let result = null // Set reporter to share it with a child class this.reporter = reporter // Check if data is there if (state.optional && data === undefined) { if (state.default !== null) { data = state.default } else { return } } // Encode children first let content = null let primitive = false if (state.any) { // Anything that was given is translated to buffer result = this._createEncoderBuffer(data) } else if (state.choice) { result = this._encodeChoice(data, reporter) } else if (state.contains) { content = this._getUse(state.contains, parent)._encode(data, reporter) primitive = true } else if (state.children) { content = state.children.map(function (child) { if (child._baseState.tag === 'null_') { return child._encode(null, reporter, data) } if (child._baseState.key === null) { return reporter.error('Child should have a key') } const prevKey = reporter.enterKey(child._baseState.key) if (typeof data !== 'object') { return reporter.error('Child expected, but input is not object') } const res = child._encode(data[child._baseState.key], reporter, data) reporter.leaveKey(prevKey) return res }, this).filter(function (child) { return child }) content = this._createEncoderBuffer(content) } else { if (state.tag === 'seqof' || state.tag === 'setof') { if (!(state.args && state.args.length === 1)) { return reporter.error(`Too many args for: ${state.tag}`) } if (!Array.isArray(data)) { return reporter.error('seqof/setof, but data is not Array') } const child = this.clone() child._baseState.implicit = null content = this._createEncoderBuffer(data.map(function (item) { const state = this._baseState return this._getUse(state.args[0], data)._encode(item, reporter) }, child)) } else if (state.use !== null) { result = this._getUse(state.use, parent)._encode(data, reporter) } else { content = this._encodePrimitive(state.tag, data) primitive = true } } // Encode data itself if (!state.any && state.choice === null) { const tag = state.implicit !== null ? state.implicit : state.tag const cls = state.implicit === null ? 'universal' : 'context' if (tag === null) { if (state.use === null) { reporter.error('Tag could be omitted only for .use()') } } else { if (state.use === null) { result = this._encodeComposite(tag, primitive, cls, content) } } } // Wrap in explicit if (state.explicit !== null) { result = this._encodeComposite(state.explicit, false, 'context', result) } return result } Node.prototype._encodeChoice = function encodeChoice (data, reporter) { const state = this._baseState const node = state.choice[data.type] if (!node) { assert( false, `${data.type} not found in ${JSON.stringify(Object.keys(state.choice))}` ) } return node._encode(data.value, reporter) } Node.prototype._encodePrimitive = function encodePrimitive (tag, data) { const state = this._baseState if (/str$/.test(tag)) { return this._encodeStr(data, tag) } else if (tag === 'objid' && state.args) { return this._encodeObjid(data, state.reverseArgs[0], state.args[1]) } else if (tag === 'objid') { return this._encodeObjid(data, null, null) } else if (tag === 'gentime' || tag === 'utctime') { return this._encodeTime(data, tag) } else if (tag === 'null_') { return this._encodeNull() } else if (tag === 'int' || tag === 'enum') { return this._encodeInt(data, state.args && state.reverseArgs[0]) } else if (tag === 'bool') { return this._encodeBool(data) } else if (tag === 'objDesc') { return this._encodeStr(data, tag) } else { throw new Error(`Unsupported tag: ${tag}`) } } Node.prototype._isNumstr = function isNumstr (str) { return /^[0-9 ]*$/.test(str) } Node.prototype._isPrintstr = function isPrintstr (str) { return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str) } module.exports = Node /***/ }), /***/ 93026: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) function Reporter (options) { this._reporterState = { obj: null, path: [], options: options || {}, errors: [] } } Reporter.prototype.isError = function isError (obj) { return obj instanceof ReporterError } Reporter.prototype.save = function save () { const state = this._reporterState return { obj: state.obj, pathLen: state.path.length } } Reporter.prototype.restore = function restore (data) { const state = this._reporterState state.obj = data.obj state.path = state.path.slice(0, data.pathLen) } Reporter.prototype.enterKey = function enterKey (key) { return this._reporterState.path.push(key) } Reporter.prototype.exitKey = function exitKey (index) { const state = this._reporterState state.path = state.path.slice(0, index - 1) } Reporter.prototype.leaveKey = function leaveKey (index, key, value) { const state = this._reporterState this.exitKey(index) if (state.obj !== null) { state.obj[key] = value } } Reporter.prototype.path = function path () { return this._reporterState.path.join('/') } Reporter.prototype.enterObject = function enterObject () { const state = this._reporterState const prev = state.obj state.obj = {} return prev } Reporter.prototype.leaveObject = function leaveObject (prev) { const state = this._reporterState const now = state.obj state.obj = prev return now } Reporter.prototype.error = function error (msg) { let err const state = this._reporterState const inherited = msg instanceof ReporterError if (inherited) { err = msg } else { err = new ReporterError(state.path.map(function (elem) { return `[${JSON.stringify(elem)}]` }).join(''), msg.message || msg, msg.stack) } if (!state.options.partial) { throw err } if (!inherited) { state.errors.push(err) } return err } Reporter.prototype.wrapResult = function wrapResult (result) { const state = this._reporterState if (!state.options.partial) { return result } return { result: this.isError(result) ? null : result, errors: state.errors } } function ReporterError (path, msg) { this.path = path this.rethrow(msg) } inherits(ReporterError, Error) ReporterError.prototype.rethrow = function rethrow (msg) { this.message = `${msg} at: ${this.path || '(shallow)'}` if (Error.captureStackTrace) { Error.captureStackTrace(this, ReporterError) } if (!this.stack) { try { // IE only adds stack when thrown throw new Error(this.message) } catch (e) { this.stack = e.stack } } return this } exports.Reporter = Reporter /***/ }), /***/ 96018: /***/ ((__unused_webpack_module, exports) => { // Helper function reverse (map) { const res = {} Object.keys(map).forEach(function (key) { // Convert key to integer if it is stringified if ((key | 0) == key) { key = key | 0 } // eslint-disable-line eqeqeq const value = map[key] res[value] = key }) return res } exports.tagClass = { 0: 'universal', 1: 'application', 2: 'context', 3: 'private' } exports.tagClassByName = reverse(exports.tagClass) exports.tag = { 0x00: 'end', 0x01: 'bool', 0x02: 'int', 0x03: 'bitstr', 0x04: 'octstr', 0x05: 'null_', 0x06: 'objid', 0x07: 'objDesc', 0x08: 'external', 0x09: 'real', 0x0a: 'enum', 0x0b: 'embed', 0x0c: 'utf8str', 0x0d: 'relativeOid', 0x10: 'seq', 0x11: 'set', 0x12: 'numstr', 0x13: 'printstr', 0x14: 't61str', 0x15: 'videostr', 0x16: 'ia5str', 0x17: 'utctime', 0x18: 'gentime', 0x19: 'graphstr', 0x1a: 'iso646str', 0x1b: 'genstr', 0x1c: 'unistr', 0x1d: 'charstr', 0x1e: 'bmpstr' } exports.tagByName = reverse(exports.tag) /***/ }), /***/ 90998: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { der: __webpack_require__(96018) } /***/ }), /***/ 44798: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global BigInt */ const { inherits } = __webpack_require__(31669) const { DecoderBuffer } = __webpack_require__(28424) const Node = __webpack_require__(48674) // Import DER constants const der = __webpack_require__(96018) function DERDecoder (entity) { this.enc = 'der' this.name = entity.name this.entity = entity // Construct base tree this.tree = new DERNode() this.tree._init(entity.body) } DERDecoder.prototype.decode = function decode (data, options) { if (!DecoderBuffer.isDecoderBuffer(data)) { data = new DecoderBuffer(data, options) } return this.tree._decode(data, options) } // Tree methods function DERNode (parent) { Node.call(this, 'der', parent) } inherits(DERNode, Node) DERNode.prototype._peekTag = function peekTag (buffer, tag, any) { if (buffer.isEmpty()) { return false } const state = buffer.save() const decodedTag = derDecodeTag(buffer, `Failed to peek tag: "${tag}"`) if (buffer.isError(decodedTag)) { return decodedTag } buffer.restore(state) return decodedTag.tag === tag || decodedTag.tagStr === tag || (decodedTag.tagStr + 'of') === tag || any } DERNode.prototype._decodeTag = function decodeTag (buffer, tag, any) { const decodedTag = derDecodeTag(buffer, `Failed to decode tag of "${tag}"`) if (buffer.isError(decodedTag)) { return decodedTag } let len = derDecodeLen(buffer, decodedTag.primitive, `Failed to get length of "${tag}"`) // Failure if (buffer.isError(len)) { return len } if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + 'of' !== tag) { return buffer.error(`Failed to match tag: "${tag}"`) } if (decodedTag.primitive || len !== null) { return buffer.skip(len, `Failed to match body of: "${tag}"`) } // Indefinite length... find END tag const state = buffer.save() const res = this._skipUntilEnd( buffer, `Failed to skip indefinite length body: "${this.tag}"`) if (buffer.isError(res)) { return res } len = buffer.offset - state.offset buffer.restore(state) return buffer.skip(len, `Failed to match body of: "${tag}"`) } DERNode.prototype._skipUntilEnd = function skipUntilEnd (buffer, fail) { for (;;) { const tag = derDecodeTag(buffer, fail) if (buffer.isError(tag)) { return tag } const len = derDecodeLen(buffer, tag.primitive, fail) if (buffer.isError(len)) { return len } let res if (tag.primitive || len !== null) { res = buffer.skip(len) } else { res = this._skipUntilEnd(buffer, fail) } // Failure if (buffer.isError(res)) { return res } if (tag.tagStr === 'end') { break } } } DERNode.prototype._decodeList = function decodeList (buffer, tag, decoder, options) { const result = [] while (!buffer.isEmpty()) { const possibleEnd = this._peekTag(buffer, 'end') if (buffer.isError(possibleEnd)) { return possibleEnd } const res = decoder.decode(buffer, 'der', options) if (buffer.isError(res) && possibleEnd) { break } result.push(res) } return result } DERNode.prototype._decodeStr = function decodeStr (buffer, tag) { if (tag === 'bitstr') { const unused = buffer.readUInt8() if (buffer.isError(unused)) { return unused } return { unused: unused, data: buffer.raw() } } else if (tag === 'bmpstr') { const raw = buffer.raw() if (raw.length % 2 === 1) { return buffer.error('Decoding of string type: bmpstr length mismatch') } let str = '' for (let i = 0; i < raw.length / 2; i++) { str += String.fromCharCode(raw.readUInt16BE(i * 2)) } return str } else if (tag === 'numstr') { const numstr = buffer.raw().toString('ascii') if (!this._isNumstr(numstr)) { return buffer.error('Decoding of string type: numstr unsupported characters') } return numstr } else if (tag === 'octstr') { return buffer.raw() } else if (tag === 'objDesc') { return buffer.raw() } else if (tag === 'printstr') { const printstr = buffer.raw().toString('ascii') if (!this._isPrintstr(printstr)) { return buffer.error('Decoding of string type: printstr unsupported characters') } return printstr } else if (/str$/.test(tag)) { return buffer.raw().toString() } else { return buffer.error(`Decoding of string type: ${tag} unsupported`) } } DERNode.prototype._decodeObjid = function decodeObjid (buffer, values, relative) { let result const identifiers = [] let ident = 0 let subident = 0 while (!buffer.isEmpty()) { subident = buffer.readUInt8() ident <<= 7 ident |= subident & 0x7f if ((subident & 0x80) === 0) { identifiers.push(ident) ident = 0 } } if (subident & 0x80) { identifiers.push(ident) } const first = (identifiers[0] / 40) | 0 const second = identifiers[0] % 40 if (relative) { result = identifiers } else { result = [first, second].concat(identifiers.slice(1)) } if (values) { let tmp = values[result.join(' ')] if (tmp === undefined) { tmp = values[result.join('.')] } if (tmp !== undefined) { result = tmp } } return result } DERNode.prototype._decodeTime = function decodeTime (buffer, tag) { const str = buffer.raw().toString() let year let mon let day let hour let min let sec if (tag === 'gentime') { year = str.slice(0, 4) | 0 mon = str.slice(4, 6) | 0 day = str.slice(6, 8) | 0 hour = str.slice(8, 10) | 0 min = str.slice(10, 12) | 0 sec = str.slice(12, 14) | 0 } else if (tag === 'utctime') { year = str.slice(0, 2) | 0 mon = str.slice(2, 4) | 0 day = str.slice(4, 6) | 0 hour = str.slice(6, 8) | 0 min = str.slice(8, 10) | 0 sec = str.slice(10, 12) | 0 if (year < 70) { year = 2000 + year } else { year = 1900 + year } } else { return buffer.error(`Decoding ${tag} time is not supported yet`) } return Date.UTC(year, mon - 1, day, hour, min, sec, 0) } DERNode.prototype._decodeNull = function decodeNull () { return null } DERNode.prototype._decodeBool = function decodeBool (buffer) { const res = buffer.readUInt8() if (buffer.isError(res)) { return res } else { return res !== 0 } } DERNode.prototype._decodeInt = function decodeInt (buffer, values) { // Bigint, return as it is (assume big endian) const raw = buffer.raw() let res = BigInt(`0x${raw.toString('hex')}`) if (values) { res = values[res.toString(10)] || res } return res } DERNode.prototype._use = function use (entity, obj) { if (typeof entity === 'function') { entity = entity(obj) } return entity._getDecoder('der').tree } // Utility methods function derDecodeTag (buf, fail) { let tag = buf.readUInt8(fail) if (buf.isError(tag)) { return tag } const cls = der.tagClass[tag >> 6] const primitive = (tag & 0x20) === 0 // Multi-octet tag - load if ((tag & 0x1f) === 0x1f) { let oct = tag tag = 0 while ((oct & 0x80) === 0x80) { oct = buf.readUInt8(fail) if (buf.isError(oct)) { return oct } tag <<= 7 tag |= oct & 0x7f } } else { tag &= 0x1f } const tagStr = der.tag[tag] return { cls: cls, primitive: primitive, tag: tag, tagStr: tagStr } } function derDecodeLen (buf, primitive, fail) { let len = buf.readUInt8(fail) if (buf.isError(len)) { return len } // Indefinite form if (!primitive && len === 0x80) { return null } // Definite form if ((len & 0x80) === 0) { // Short form return len } // Long form const num = len & 0x7f if (num > 4) { return buf.error('length octect is too long') } len = 0 for (let i = 0; i < num; i++) { len <<= 8 const j = buf.readUInt8(fail) if (buf.isError(j)) { return j } len |= j } return len } module.exports = DERDecoder /***/ }), /***/ 5017: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { der: __webpack_require__(44798), pem: __webpack_require__(33956) } /***/ }), /***/ 33956: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) const DERDecoder = __webpack_require__(44798) function PEMDecoder (entity) { DERDecoder.call(this, entity) this.enc = 'pem' } inherits(PEMDecoder, DERDecoder) PEMDecoder.prototype.decode = function decode (data, options) { const lines = data.toString().split(/[\r\n]+/g) const label = options.label.toUpperCase() const re = /^-----(BEGIN|END) ([^-]+)-----$/ let start = -1 let end = -1 for (let i = 0; i < lines.length; i++) { const match = lines[i].match(re) if (match === null) { continue } if (match[2] !== label) { continue } if (start === -1) { if (match[1] !== 'BEGIN') { break } start = i } else { if (match[1] !== 'END') { break } end = i break } } if (start === -1 || end === -1) { throw new Error(`PEM section not found for: ${label}`) } const base64 = lines.slice(start + 1, end).join('') // Remove excessive symbols base64.replace(/[^a-z0-9+/=]+/gi, '') const input = Buffer.from(base64, 'base64') return DERDecoder.prototype.decode.call(this, input, options) } module.exports = PEMDecoder /***/ }), /***/ 20846: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global BigInt */ const { inherits } = __webpack_require__(31669) const Node = __webpack_require__(48674) const der = __webpack_require__(96018) function DEREncoder (entity) { this.enc = 'der' this.name = entity.name this.entity = entity // Construct base tree this.tree = new DERNode() this.tree._init(entity.body) } DEREncoder.prototype.encode = function encode (data, reporter) { return this.tree._encode(data, reporter).join() } // Tree methods function DERNode (parent) { Node.call(this, 'der', parent) } inherits(DERNode, Node) DERNode.prototype._encodeComposite = function encodeComposite (tag, primitive, cls, content) { const encodedTag = encodeTag(tag, primitive, cls, this.reporter) // Short form if (content.length < 0x80) { const header = Buffer.alloc(2) header[0] = encodedTag header[1] = content.length return this._createEncoderBuffer([header, content]) } // Long form // Count octets required to store length let lenOctets = 1 for (let i = content.length; i >= 0x100; i >>= 8) { lenOctets++ } const header = Buffer.alloc(1 + 1 + lenOctets) header[0] = encodedTag header[1] = 0x80 | lenOctets for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) { header[i] = j & 0xff } return this._createEncoderBuffer([header, content]) } DERNode.prototype._encodeStr = function encodeStr (str, tag) { if (tag === 'bitstr') { return this._createEncoderBuffer([str.unused | 0, str.data]) } else if (tag === 'bmpstr') { const buf = Buffer.alloc(str.length * 2) for (let i = 0; i < str.length; i++) { buf.writeUInt16BE(str.charCodeAt(i), i * 2) } return this._createEncoderBuffer(buf) } else if (tag === 'numstr') { if (!this._isNumstr(str)) { return this.reporter.error('Encoding of string type: numstr supports only digits and space') } return this._createEncoderBuffer(str) } else if (tag === 'printstr') { if (!this._isPrintstr(str)) { return this.reporter.error('Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark') } return this._createEncoderBuffer(str) } else if (/str$/.test(tag)) { return this._createEncoderBuffer(str) } else if (tag === 'objDesc') { return this._createEncoderBuffer(str) } else { return this.reporter.error(`Encoding of string type: ${tag} unsupported`) } } DERNode.prototype._encodeObjid = function encodeObjid (id, values, relative) { if (typeof id === 'string') { if (!values) { return this.reporter.error('string objid given, but no values map found') } if (!Object.prototype.hasOwnProperty.call(values, id)) { return this.reporter.error('objid not found in values map') } id = values[id].split(/[\s.]+/g) for (let i = 0; i < id.length; i++) { id[i] |= 0 } } else if (Array.isArray(id)) { id = id.slice() for (let i = 0; i < id.length; i++) { id[i] |= 0 } } if (!Array.isArray(id)) { return this.reporter.error(`objid() should be either array or string, got: ${JSON.stringify(id)}`) } if (!relative) { if (id[1] >= 40) { return this.reporter.error('Second objid identifier OOB') } id.splice(0, 2, id[0] * 40 + id[1]) } // Count number of octets let size = 0 for (let i = 0; i < id.length; i++) { let ident = id[i] for (size++; ident >= 0x80; ident >>= 7) { size++ } } const objid = Buffer.alloc(size) let offset = objid.length - 1 for (let i = id.length - 1; i >= 0; i--) { let ident = id[i] objid[offset--] = ident & 0x7f while ((ident >>= 7) > 0) { objid[offset--] = 0x80 | (ident & 0x7f) } } return this._createEncoderBuffer(objid) } function two (num) { if (num < 10) { return `0${num}` } else { return num } } DERNode.prototype._encodeTime = function encodeTime (time, tag) { let str const date = new Date(time) if (tag === 'gentime') { str = [ two(date.getUTCFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), 'Z' ].join('') } else if (tag === 'utctime') { str = [ two(date.getUTCFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), 'Z' ].join('') } else { this.reporter.error(`Encoding ${tag} time is not supported yet`) } return this._encodeStr(str, 'octstr') } DERNode.prototype._encodeNull = function encodeNull () { return this._createEncoderBuffer('') } function bnToBuf (bn) { var hex = BigInt(bn).toString(16) if (hex.length % 2) { hex = '0' + hex } var len = hex.length / 2 var u8 = new Uint8Array(len) var i = 0 var j = 0 while (i < len) { u8[i] = parseInt(hex.slice(j, j + 2), 16) i += 1 j += 2 } return u8 } DERNode.prototype._encodeInt = function encodeInt (num, values) { if (typeof num === 'string') { if (!values) { return this.reporter.error('String int or enum given, but no values map') } if (!Object.prototype.hasOwnProperty.call(values, num)) { return this.reporter.error(`Values map doesn't contain: ${JSON.stringify(num)}`) } num = values[num] } if (typeof num === 'bigint') { const numArray = [...bnToBuf(num)] if (numArray[0] & 0x80) { numArray.unshift(0) } num = Buffer.from(numArray) } if (Buffer.isBuffer(num)) { let size = num.length if (num.length === 0) { size++ } const out = Buffer.alloc(size) num.copy(out) if (num.length === 0) { out[0] = 0 } return this._createEncoderBuffer(out) } if (num < 0x80) { return this._createEncoderBuffer(num) } if (num < 0x100) { return this._createEncoderBuffer([0, num]) } let size = 1 for (let i = num; i >= 0x100; i >>= 8) { size++ } const out = new Array(size) for (let i = out.length - 1; i >= 0; i--) { out[i] = num & 0xff num >>= 8 } if (out[0] & 0x80) { out.unshift(0) } return this._createEncoderBuffer(Buffer.from(out)) } DERNode.prototype._encodeBool = function encodeBool (value) { return this._createEncoderBuffer(value ? 0xff : 0) } DERNode.prototype._use = function use (entity, obj) { if (typeof entity === 'function') { entity = entity(obj) } return entity._getEncoder('der').tree } DERNode.prototype._skipDefault = function skipDefault (dataBuffer, reporter, parent) { const state = this._baseState let i if (state.default === null) { return false } const data = dataBuffer.join() if (state.defaultBuffer === undefined) { state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join() } if (data.length !== state.defaultBuffer.length) { return false } for (i = 0; i < data.length; i++) { if (data[i] !== state.defaultBuffer[i]) { return false } } return true } // Utility methods function encodeTag (tag, primitive, cls, reporter) { let res if (tag === 'seqof') { tag = 'seq' } else if (tag === 'setof') { tag = 'set' } if (Object.prototype.hasOwnProperty.call(der.tagByName, tag)) { res = der.tagByName[tag] } else if (typeof tag === 'number' && (tag | 0) === tag) { res = tag } else { return reporter.error(`Unknown tag: ${tag}`) } if (res >= 0x1f) { return reporter.error('Multi-octet tag encoding unsupported') } if (!primitive) { res |= 0x20 } res |= (der.tagClassByName[cls || 'universal'] << 6) return res } module.exports = DEREncoder /***/ }), /***/ 2246: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { der: __webpack_require__(20846), pem: __webpack_require__(26217) } /***/ }), /***/ 26217: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { inherits } = __webpack_require__(31669) const DEREncoder = __webpack_require__(20846) function PEMEncoder (entity) { DEREncoder.call(this, entity) this.enc = 'pem' } inherits(PEMEncoder, DEREncoder) PEMEncoder.prototype.encode = function encode (data, options) { const buf = DEREncoder.prototype.encode.call(this, data) const p = buf.toString('base64') const out = [`-----BEGIN ${options.label}-----`] for (let i = 0; i < p.length; i += 64) { out.push(p.slice(i, i + 64)) } out.push(`-----END ${options.label}-----`) return out.join('\n') } module.exports = PEMEncoder /***/ }), /***/ 252: /***/ ((module) => { "use strict"; module.exports = asPromise; /** * Callback as used by {@link util.asPromise}. * @typedef asPromiseCallback * @type {function} * @param {Error|null} error Error, if any * @param {...*} params Additional arguments * @returns {undefined} */ /** * Returns a promise from a node-style callback function. * @memberof util * @param {asPromiseCallback} fn Function to call * @param {*} ctx Function context * @param {...*} params Function arguments * @returns {Promise<*>} Promisified function */ function asPromise(fn, ctx/*, varargs */) { var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true; while (index < arguments.length) params[offset++] = arguments[index++]; return new Promise(function executor(resolve, reject) { params[offset] = function callback(err/*, varargs */) { if (pending) { pending = false; if (err) reject(err); else { var params = new Array(arguments.length - 1), offset = 0; while (offset < params.length) params[offset++] = arguments[offset]; resolve.apply(null, params); } } }; try { fn.apply(ctx || null, params); } catch (err) { if (pending) { pending = false; reject(err); } } }); } /***/ }), /***/ 26718: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * A minimal base64 implementation for number arrays. * @memberof util * @namespace */ var base64 = exports; /** * Calculates the byte length of a base64 encoded string. * @param {string} string Base64 encoded string * @returns {number} Byte length */ base64.length = function length(string) { var p = string.length; if (!p) return 0; var n = 0; while (--p % 4 > 1 && string.charAt(p) === "=") ++n; return Math.ceil(string.length * 3) / 4 - n; }; // Base64 encoding table var b64 = new Array(64); // Base64 decoding table var s64 = new Array(123); // 65..90, 97..122, 48..57, 43, 47 for (var i = 0; i < 64;) s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; /** * Encodes a buffer to a base64 encoded string. * @param {Uint8Array} buffer Source buffer * @param {number} start Source start * @param {number} end Source end * @returns {string} Base64 encoded string */ base64.encode = function encode(buffer, start, end) { var parts = null, chunk = []; var i = 0, // output index j = 0, // goto index t; // temporary while (start < end) { var b = buffer[start++]; switch (j) { case 0: chunk[i++] = b64[b >> 2]; t = (b & 3) << 4; j = 1; break; case 1: chunk[i++] = b64[t | b >> 4]; t = (b & 15) << 2; j = 2; break; case 2: chunk[i++] = b64[t | b >> 6]; chunk[i++] = b64[b & 63]; j = 0; break; } if (i > 8191) { (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); i = 0; } } if (j) { chunk[i++] = b64[t]; chunk[i++] = 61; if (j === 1) chunk[i++] = 61; } if (parts) { if (i) parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); return parts.join(""); } return String.fromCharCode.apply(String, chunk.slice(0, i)); }; var invalidEncoding = "invalid encoding"; /** * Decodes a base64 encoded string to a buffer. * @param {string} string Source string * @param {Uint8Array} buffer Destination buffer * @param {number} offset Destination offset * @returns {number} Number of bytes written * @throws {Error} If encoding is invalid */ base64.decode = function decode(string, buffer, offset) { var start = offset; var j = 0, // goto index t; // temporary for (var i = 0; i < string.length;) { var c = string.charCodeAt(i++); if (c === 61 && j > 1) break; if ((c = s64[c]) === undefined) throw Error(invalidEncoding); switch (j) { case 0: t = c; j = 1; break; case 1: buffer[offset++] = t << 2 | (c & 48) >> 4; t = c; j = 2; break; case 2: buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; t = c; j = 3; break; case 3: buffer[offset++] = (t & 3) << 6 | c; j = 0; break; } } if (j === 1) throw Error(invalidEncoding); return offset - start; }; /** * Tests if the specified string appears to be base64 encoded. * @param {string} string String to test * @returns {boolean} `true` if probably base64 encoded, otherwise false */ base64.test = function test(string) { return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); }; /***/ }), /***/ 58882: /***/ ((module) => { "use strict"; module.exports = codegen; /** * Begins generating a function. * @memberof util * @param {string[]} functionParams Function parameter names * @param {string} [functionName] Function name if not anonymous * @returns {Codegen} Appender that appends code to the function's body */ function codegen(functionParams, functionName) { /* istanbul ignore if */ if (typeof functionParams === "string") { functionName = functionParams; functionParams = undefined; } var body = []; /** * Appends code to the function's body or finishes generation. * @typedef Codegen * @type {function} * @param {string|Object.} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any * @param {...*} [formatParams] Format parameters * @returns {Codegen|Function} Itself or the generated function if finished * @throws {Error} If format parameter counts do not match */ function Codegen(formatStringOrScope) { // note that explicit array handling below makes this ~50% faster // finish the function if (typeof formatStringOrScope !== "string") { var source = toString(); if (codegen.verbose) console.log("codegen: " + source); // eslint-disable-line no-console source = "return " + source; if (formatStringOrScope) { var scopeKeys = Object.keys(formatStringOrScope), scopeParams = new Array(scopeKeys.length + 1), scopeValues = new Array(scopeKeys.length), scopeOffset = 0; while (scopeOffset < scopeKeys.length) { scopeParams[scopeOffset] = scopeKeys[scopeOffset]; scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; } scopeParams[scopeOffset] = source; return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func } return Function(source)(); // eslint-disable-line no-new-func } // otherwise append to body var formatParams = new Array(arguments.length - 1), formatOffset = 0; while (formatOffset < formatParams.length) formatParams[formatOffset] = arguments[++formatOffset]; formatOffset = 0; formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) { var value = formatParams[formatOffset++]; switch ($1) { case "d": case "f": return String(Number(value)); case "i": return String(Math.floor(value)); case "j": return JSON.stringify(value); case "s": return String(value); } return "%"; }); if (formatOffset !== formatParams.length) throw Error("parameter count mismatch"); body.push(formatStringOrScope); return Codegen; } function toString(functionNameOverride) { return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; } Codegen.toString = toString; return Codegen; } /** * Begins generating a function. * @memberof util * @function codegen * @param {string} [functionName] Function name if not anonymous * @returns {Codegen} Appender that appends code to the function's body * @variation 2 */ /** * When set to `true`, codegen will log generated code to console. Useful for debugging. * @name util.codegen.verbose * @type {boolean} */ codegen.verbose = false; /***/ }), /***/ 86850: /***/ ((module) => { "use strict"; module.exports = EventEmitter; /** * Constructs a new event emitter instance. * @classdesc A minimal event emitter. * @memberof util * @constructor */ function EventEmitter() { /** * Registered listeners. * @type {Object.} * @private */ this._listeners = {}; } /** * Registers an event listener. * @param {string} evt Event name * @param {function} fn Listener * @param {*} [ctx] Listener context * @returns {util.EventEmitter} `this` */ EventEmitter.prototype.on = function on(evt, fn, ctx) { (this._listeners[evt] || (this._listeners[evt] = [])).push({ fn : fn, ctx : ctx || this }); return this; }; /** * Removes an event listener or any matching listeners if arguments are omitted. * @param {string} [evt] Event name. Removes all listeners if omitted. * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted. * @returns {util.EventEmitter} `this` */ EventEmitter.prototype.off = function off(evt, fn) { if (evt === undefined) this._listeners = {}; else { if (fn === undefined) this._listeners[evt] = []; else { var listeners = this._listeners[evt]; for (var i = 0; i < listeners.length;) if (listeners[i].fn === fn) listeners.splice(i, 1); else ++i; } } return this; }; /** * Emits an event by calling its listeners with the specified arguments. * @param {string} evt Event name * @param {...*} args Arguments * @returns {util.EventEmitter} `this` */ EventEmitter.prototype.emit = function emit(evt) { var listeners = this._listeners[evt]; if (listeners) { var args = [], i = 1; for (; i < arguments.length;) args.push(arguments[i++]); for (i = 0; i < listeners.length;) listeners[i].fn.apply(listeners[i++].ctx, args); } return this; }; /***/ }), /***/ 50663: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = fetch; var asPromise = __webpack_require__(252), inquire = __webpack_require__(60094); var fs = inquire("fs"); /** * Node-style callback as used by {@link util.fetch}. * @typedef FetchCallback * @type {function} * @param {?Error} error Error, if any, otherwise `null` * @param {string} [contents] File contents, if there hasn't been an error * @returns {undefined} */ /** * Options as used by {@link util.fetch}. * @typedef FetchOptions * @type {Object} * @property {boolean} [binary=false] Whether expecting a binary response * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest */ /** * Fetches the contents of a file. * @memberof util * @param {string} filename File path or url * @param {FetchOptions} options Fetch options * @param {FetchCallback} callback Callback function * @returns {undefined} */ function fetch(filename, options, callback) { if (typeof options === "function") { callback = options; options = {}; } else if (!options) options = {}; if (!callback) return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found. if (!options.xhr && fs && fs.readFile) return fs.readFile(filename, function fetchReadFileCallback(err, contents) { return err && typeof XMLHttpRequest !== "undefined" ? fetch.xhr(filename, options, callback) : err ? callback(err) : callback(null, options.binary ? contents : contents.toString("utf8")); }); // use the XHR version otherwise. return fetch.xhr(filename, options, callback); } /** * Fetches the contents of a file. * @name util.fetch * @function * @param {string} path File path or url * @param {FetchCallback} callback Callback function * @returns {undefined} * @variation 2 */ /** * Fetches the contents of a file. * @name util.fetch * @function * @param {string} path File path or url * @param {FetchOptions} [options] Fetch options * @returns {Promise} Promise * @variation 3 */ /**/ fetch.xhr = function fetch_xhr(filename, options, callback) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() { if (xhr.readyState !== 4) return undefined; // local cors security errors return status 0 / empty string, too. afaik this cannot be // reliably distinguished from an actually empty file for security reasons. feel free // to send a pull request if you are aware of a solution. if (xhr.status !== 0 && xhr.status !== 200) return callback(Error("status " + xhr.status)); // if binary data is expected, make sure that some sort of array is returned, even if // ArrayBuffers are not supported. the binary string fallback, however, is unsafe. if (options.binary) { var buffer = xhr.response; if (!buffer) { buffer = []; for (var i = 0; i < xhr.responseText.length; ++i) buffer.push(xhr.responseText.charCodeAt(i) & 255); } return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer); } return callback(null, xhr.responseText); }; if (options.binary) { // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers if ("overrideMimeType" in xhr) xhr.overrideMimeType("text/plain; charset=x-user-defined"); xhr.responseType = "arraybuffer"; } xhr.open("GET", filename); xhr.send(); }; /***/ }), /***/ 33182: /***/ ((module) => { "use strict"; module.exports = factory(factory); /** * Reads / writes floats / doubles from / to buffers. * @name util.float * @namespace */ /** * Writes a 32 bit float to a buffer using little endian byte order. * @name util.float.writeFloatLE * @function * @param {number} val Value to write * @param {Uint8Array} buf Target buffer * @param {number} pos Target buffer offset * @returns {undefined} */ /** * Writes a 32 bit float to a buffer using big endian byte order. * @name util.float.writeFloatBE * @function * @param {number} val Value to write * @param {Uint8Array} buf Target buffer * @param {number} pos Target buffer offset * @returns {undefined} */ /** * Reads a 32 bit float from a buffer using little endian byte order. * @name util.float.readFloatLE * @function * @param {Uint8Array} buf Source buffer * @param {number} pos Source buffer offset * @returns {number} Value read */ /** * Reads a 32 bit float from a buffer using big endian byte order. * @name util.float.readFloatBE * @function * @param {Uint8Array} buf Source buffer * @param {number} pos Source buffer offset * @returns {number} Value read */ /** * Writes a 64 bit double to a buffer using little endian byte order. * @name util.float.writeDoubleLE * @function * @param {number} val Value to write * @param {Uint8Array} buf Target buffer * @param {number} pos Target buffer offset * @returns {undefined} */ /** * Writes a 64 bit double to a buffer using big endian byte order. * @name util.float.writeDoubleBE * @function * @param {number} val Value to write * @param {Uint8Array} buf Target buffer * @param {number} pos Target buffer offset * @returns {undefined} */ /** * Reads a 64 bit double from a buffer using little endian byte order. * @name util.float.readDoubleLE * @function * @param {Uint8Array} buf Source buffer * @param {number} pos Source buffer offset * @returns {number} Value read */ /** * Reads a 64 bit double from a buffer using big endian byte order. * @name util.float.readDoubleBE * @function * @param {Uint8Array} buf Source buffer * @param {number} pos Source buffer offset * @returns {number} Value read */ // Factory function for the purpose of node-based testing in modified global environments function factory(exports) { // float: typed array if (typeof Float32Array !== "undefined") (function() { var f32 = new Float32Array([ -0 ]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128; function writeFloat_f32_cpy(val, buf, pos) { f32[0] = val; buf[pos ] = f8b[0]; buf[pos + 1] = f8b[1]; buf[pos + 2] = f8b[2]; buf[pos + 3] = f8b[3]; } function writeFloat_f32_rev(val, buf, pos) { f32[0] = val; buf[pos ] = f8b[3]; buf[pos + 1] = f8b[2]; buf[pos + 2] = f8b[1]; buf[pos + 3] = f8b[0]; } /* istanbul ignore next */ exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; /* istanbul ignore next */ exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; function readFloat_f32_cpy(buf, pos) { f8b[0] = buf[pos ]; f8b[1] = buf[pos + 1]; f8b[2] = buf[pos + 2]; f8b[3] = buf[pos + 3]; return f32[0]; } function readFloat_f32_rev(buf, pos) { f8b[3] = buf[pos ]; f8b[2] = buf[pos + 1]; f8b[1] = buf[pos + 2]; f8b[0] = buf[pos + 3]; return f32[0]; } /* istanbul ignore next */ exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; /* istanbul ignore next */ exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; // float: ieee754 })(); else (function() { function writeFloat_ieee754(writeUint, val, buf, pos) { var sign = val < 0 ? 1 : 0; if (sign) val = -val; if (val === 0) writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos); else if (isNaN(val)) writeUint(2143289344, buf, pos); else if (val > 3.4028234663852886e+38) // +-Infinity writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); else if (val < 1.1754943508222875e-38) // denormal writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos); else { var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); } } exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); function readFloat_ieee754(readUint, buf, pos) { var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 // denormal ? sign * 1.401298464324817e-45 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); } exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE); exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE); })(); // double: typed array if (typeof Float64Array !== "undefined") (function() { var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128; function writeDouble_f64_cpy(val, buf, pos) { f64[0] = val; buf[pos ] = f8b[0]; buf[pos + 1] = f8b[1]; buf[pos + 2] = f8b[2]; buf[pos + 3] = f8b[3]; buf[pos + 4] = f8b[4]; buf[pos + 5] = f8b[5]; buf[pos + 6] = f8b[6]; buf[pos + 7] = f8b[7]; } function writeDouble_f64_rev(val, buf, pos) { f64[0] = val; buf[pos ] = f8b[7]; buf[pos + 1] = f8b[6]; buf[pos + 2] = f8b[5]; buf[pos + 3] = f8b[4]; buf[pos + 4] = f8b[3]; buf[pos + 5] = f8b[2]; buf[pos + 6] = f8b[1]; buf[pos + 7] = f8b[0]; } /* istanbul ignore next */ exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; /* istanbul ignore next */ exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; function readDouble_f64_cpy(buf, pos) { f8b[0] = buf[pos ]; f8b[1] = buf[pos + 1]; f8b[2] = buf[pos + 2]; f8b[3] = buf[pos + 3]; f8b[4] = buf[pos + 4]; f8b[5] = buf[pos + 5]; f8b[6] = buf[pos + 6]; f8b[7] = buf[pos + 7]; return f64[0]; } function readDouble_f64_rev(buf, pos) { f8b[7] = buf[pos ]; f8b[6] = buf[pos + 1]; f8b[5] = buf[pos + 2]; f8b[4] = buf[pos + 3]; f8b[3] = buf[pos + 4]; f8b[2] = buf[pos + 5]; f8b[1] = buf[pos + 6]; f8b[0] = buf[pos + 7]; return f64[0]; } /* istanbul ignore next */ exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; /* istanbul ignore next */ exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; // double: ieee754 })(); else (function() { function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { var sign = val < 0 ? 1 : 0; if (sign) val = -val; if (val === 0) { writeUint(0, buf, pos + off0); writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1); } else if (isNaN(val)) { writeUint(0, buf, pos + off0); writeUint(2146959360, buf, pos + off1); } else if (val > 1.7976931348623157e+308) { // +-Infinity writeUint(0, buf, pos + off0); writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); } else { var mantissa; if (val < 2.2250738585072014e-308) { // denormal mantissa = val / 5e-324; writeUint(mantissa >>> 0, buf, pos + off0); writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); } else { var exponent = Math.floor(Math.log(val) / Math.LN2); if (exponent === 1024) exponent = 1023; mantissa = val * Math.pow(2, -exponent); writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); } } } exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); function readDouble_ieee754(readUint, off0, off1, buf, pos) { var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1); var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 // denormal ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); } exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); })(); return exports; } // uint helpers function writeUintLE(val, buf, pos) { buf[pos ] = val & 255; buf[pos + 1] = val >>> 8 & 255; buf[pos + 2] = val >>> 16 & 255; buf[pos + 3] = val >>> 24; } function writeUintBE(val, buf, pos) { buf[pos ] = val >>> 24; buf[pos + 1] = val >>> 16 & 255; buf[pos + 2] = val >>> 8 & 255; buf[pos + 3] = val & 255; } function readUintLE(buf, pos) { return (buf[pos ] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0; } function readUintBE(buf, pos) { return (buf[pos ] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; } /***/ }), /***/ 60094: /***/ ((module) => { "use strict"; module.exports = inquire; /** * Requires a module only if available. * @memberof util * @param {string} moduleName Module to require * @returns {?Object} Required module if available and not empty, otherwise `null` */ function inquire(moduleName) { try { var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval if (mod && (mod.length || Object.keys(mod).length)) return mod; } catch (e) {} // eslint-disable-line no-empty return null; } /***/ }), /***/ 24761: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * A minimal path module to resolve Unix, Windows and URL paths alike. * @memberof util * @namespace */ var path = exports; var isAbsolute = /** * Tests if the specified path is absolute. * @param {string} path Path to test * @returns {boolean} `true` if path is absolute */ path.isAbsolute = function isAbsolute(path) { return /^(?:\/|\w+:)/.test(path); }; var normalize = /** * Normalizes the specified path. * @param {string} path Path to normalize * @returns {string} Normalized path */ path.normalize = function normalize(path) { path = path.replace(/\\/g, "/") .replace(/\/{2,}/g, "/"); var parts = path.split("/"), absolute = isAbsolute(path), prefix = ""; if (absolute) prefix = parts.shift() + "/"; for (var i = 0; i < parts.length;) { if (parts[i] === "..") { if (i > 0 && parts[i - 1] !== "..") parts.splice(--i, 2); else if (absolute) parts.splice(i, 1); else ++i; } else if (parts[i] === ".") parts.splice(i, 1); else ++i; } return prefix + parts.join("/"); }; /** * Resolves the specified include path against the specified origin path. * @param {string} originPath Path to the origin file * @param {string} includePath Include path relative to origin path * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized * @returns {string} Path to the include file */ path.resolve = function resolve(originPath, includePath, alreadyNormalized) { if (!alreadyNormalized) includePath = normalize(includePath); if (isAbsolute(includePath)) return includePath; if (!alreadyNormalized) originPath = normalize(originPath); return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath; }; /***/ }), /***/ 47743: /***/ ((module) => { "use strict"; module.exports = pool; /** * An allocator as used by {@link util.pool}. * @typedef PoolAllocator * @type {function} * @param {number} size Buffer size * @returns {Uint8Array} Buffer */ /** * A slicer as used by {@link util.pool}. * @typedef PoolSlicer * @type {function} * @param {number} start Start offset * @param {number} end End offset * @returns {Uint8Array} Buffer slice * @this {Uint8Array} */ /** * A general purpose buffer pool. * @memberof util * @function * @param {PoolAllocator} alloc Allocator * @param {PoolSlicer} slice Slicer * @param {number} [size=8192] Slab size * @returns {PoolAllocator} Pooled allocator */ function pool(alloc, slice, size) { var SIZE = size || 8192; var MAX = SIZE >>> 1; var slab = null; var offset = SIZE; return function pool_alloc(size) { if (size < 1 || size > MAX) return alloc(size); if (offset + size > SIZE) { slab = alloc(SIZE); offset = 0; } var buf = slice.call(slab, offset, offset += size); if (offset & 7) // align to 32 bit offset = (offset | 7) + 1; return buf; }; } /***/ }), /***/ 99049: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * A minimal UTF8 implementation for number arrays. * @memberof util * @namespace */ var utf8 = exports; /** * Calculates the UTF8 byte length of a string. * @param {string} string String * @returns {number} Byte length */ utf8.length = function utf8_length(string) { var len = 0, c = 0; for (var i = 0; i < string.length; ++i) { c = string.charCodeAt(i); if (c < 128) len += 1; else if (c < 2048) len += 2; else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) { ++i; len += 4; } else len += 3; } return len; }; /** * Reads UTF8 bytes as a string. * @param {Uint8Array} buffer Source buffer * @param {number} start Source start * @param {number} end Source end * @returns {string} String read */ utf8.read = function utf8_read(buffer, start, end) { var len = end - start; if (len < 1) return ""; var parts = null, chunk = [], i = 0, // char offset t; // temporary while (start < end) { t = buffer[start++]; if (t < 128) chunk[i++] = t; else if (t > 191 && t < 224) chunk[i++] = (t & 31) << 6 | buffer[start++] & 63; else if (t > 239 && t < 365) { t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000; chunk[i++] = 0xD800 + (t >> 10); chunk[i++] = 0xDC00 + (t & 1023); } else chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63; if (i > 8191) { (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); i = 0; } } if (parts) { if (i) parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); return parts.join(""); } return String.fromCharCode.apply(String, chunk.slice(0, i)); }; /** * Writes a string as UTF8 bytes. * @param {string} string Source string * @param {Uint8Array} buffer Destination buffer * @param {number} offset Destination offset * @returns {number} Bytes written */ utf8.write = function utf8_write(string, buffer, offset) { var start = offset, c1, // character 1 c2; // character 2 for (var i = 0; i < string.length; ++i) { c1 = string.charCodeAt(i); if (c1 < 128) { buffer[offset++] = c1; } else if (c1 < 2048) { buffer[offset++] = c1 >> 6 | 192; buffer[offset++] = c1 & 63 | 128; } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) { c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF); ++i; buffer[offset++] = c1 >> 18 | 240; buffer[offset++] = c1 >> 12 & 63 | 128; buffer[offset++] = c1 >> 6 & 63 | 128; buffer[offset++] = c1 & 63 | 128; } else { buffer[offset++] = c1 >> 12 | 224; buffer[offset++] = c1 >> 6 & 63 | 128; buffer[offset++] = c1 & 63 | 128; } } return offset - start; }; /***/ }), /***/ 81040: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function once(emitter, name, { signal } = {}) { return new Promise((resolve, reject) => { function cleanup() { signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', cleanup); emitter.removeListener(name, onEvent); emitter.removeListener('error', onError); } function onEvent(...args) { cleanup(); resolve(args); } function onError(err) { cleanup(); reject(err); } signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', cleanup); emitter.on(name, onEvent); emitter.on('error', onError); }); } exports.default = once; //# sourceMappingURL=index.js.map /***/ }), /***/ 61659: /***/ ((module, exports, __webpack_require__) => { "use strict"; /** * @author Toru Nagashima * See LICENSE file in root directory for full license. */ Object.defineProperty(exports, "__esModule", ({ value: true })); var eventTargetShim = __webpack_require__(84697); /** * The signal class. * @see https://dom.spec.whatwg.org/#abortsignal */ class AbortSignal extends eventTargetShim.EventTarget { /** * AbortSignal cannot be constructed directly. */ constructor() { super(); throw new TypeError("AbortSignal cannot be constructed directly"); } /** * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise. */ get aborted() { const aborted = abortedFlags.get(this); if (typeof aborted !== "boolean") { throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); } return aborted; } } eventTargetShim.defineEventAttribute(AbortSignal.prototype, "abort"); /** * Create an AbortSignal object. */ function createAbortSignal() { const signal = Object.create(AbortSignal.prototype); eventTargetShim.EventTarget.call(signal); abortedFlags.set(signal, false); return signal; } /** * Abort a given signal. */ function abortSignal(signal) { if (abortedFlags.get(signal) !== false) { return; } abortedFlags.set(signal, true); signal.dispatchEvent({ type: "abort" }); } /** * Aborted flag for each instances. */ const abortedFlags = new WeakMap(); // Properties should be enumerable. Object.defineProperties(AbortSignal.prototype, { aborted: { enumerable: true }, }); // `toString()` should return `"[object AbortSignal]"` if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, { configurable: true, value: "AbortSignal", }); } /** * The AbortController. * @see https://dom.spec.whatwg.org/#abortcontroller */ class AbortController { /** * Initialize this controller. */ constructor() { signals.set(this, createAbortSignal()); } /** * Returns the `AbortSignal` object associated with this object. */ get signal() { return getSignal(this); } /** * Abort and signal to any observers that the associated activity is to be aborted. */ abort() { abortSignal(getSignal(this)); } } /** * Associated signals. */ const signals = new WeakMap(); /** * Get the associated signal of a given controller. */ function getSignal(controller) { const signal = signals.get(controller); if (signal == null) { throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); } return signal; } // Properties should be enumerable. Object.defineProperties(AbortController.prototype, { signal: { enumerable: true }, abort: { enumerable: true }, }); if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { configurable: true, value: "AbortController", }); } exports.AbortController = AbortController; exports.AbortSignal = AbortSignal; exports.default = AbortController; module.exports = AbortController module.exports.AbortController = module.exports.default = AbortController module.exports.AbortSignal = AbortSignal //# sourceMappingURL=abort-controller.js.map /***/ }), /***/ 49690: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const events_1 = __webpack_require__(28614); const debug_1 = __importDefault(__webpack_require__(38237)); const promisify_1 = __importDefault(__webpack_require__(66570)); const debug = debug_1.default('agent-base'); function isAgent(v) { return Boolean(v) && typeof v.addRequest === 'function'; } function isSecureEndpoint() { const { stack } = new Error(); if (typeof stack !== 'string') return false; return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); } function createAgent(callback, opts) { return new createAgent.Agent(callback, opts); } (function (createAgent) { /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends events_1.EventEmitter { constructor(callback, _opts) { super(); let opts = _opts; if (typeof callback === 'function') { this.callback = callback; } else if (callback) { opts = callback; } // Timeout for the socket to be returned from the callback this.timeout = null; if (opts && typeof opts.timeout === 'number') { this.timeout = opts.timeout; } // These aren't actually used by `agent-base`, but are required // for the TypeScript definition files in `@types/node` :/ this.maxFreeSockets = 1; this.maxSockets = 1; this.maxTotalSockets = Infinity; this.sockets = {}; this.freeSockets = {}; this.requests = {}; this.options = {}; } get defaultPort() { if (typeof this.explicitDefaultPort === 'number') { return this.explicitDefaultPort; } return isSecureEndpoint() ? 443 : 80; } set defaultPort(v) { this.explicitDefaultPort = v; } get protocol() { if (typeof this.explicitProtocol === 'string') { return this.explicitProtocol; } return isSecureEndpoint() ? 'https:' : 'http:'; } set protocol(v) { this.explicitProtocol = v; } callback(req, opts, fn) { throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); } /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req, _opts) { const opts = Object.assign({}, _opts); if (typeof opts.secureEndpoint !== 'boolean') { opts.secureEndpoint = isSecureEndpoint(); } if (opts.host == null) { opts.host = 'localhost'; } if (opts.port == null) { opts.port = opts.secureEndpoint ? 443 : 80; } if (opts.protocol == null) { opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; } if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most // likely the result of a `url.parse()` call... we need to // remove the `path` portion so that `net.connect()` doesn't // attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; let timedOut = false; let timeoutId = null; const timeoutMs = opts.timeout || this.timeout; const onerror = (err) => { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; }; const ontimeout = () => { timeoutId = null; timedOut = true; const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); err.code = 'ETIMEOUT'; onerror(err); }; const callbackError = (err) => { if (timedOut) return; if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } onerror(err); }; const onsocket = (socket) => { if (timedOut) return; if (timeoutId != null) { clearTimeout(timeoutId); timeoutId = null; } if (isAgent(socket)) { // `socket` is actually an `http.Agent` instance, so // relinquish responsibility for this `req` to the Agent // from here on debug('Callback returned another Agent instance %o', socket.constructor.name); socket.addRequest(req, opts); return; } if (socket) { socket.once('free', () => { this.freeSocket(socket, opts); }); req.onSocket(socket); return; } const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); }; if (typeof this.callback !== 'function') { onerror(new Error('`callback` is not defined')); return; } if (!this.promisifiedCallback) { if (this.callback.length >= 3) { debug('Converting legacy callback function to promise'); this.promisifiedCallback = promisify_1.default(this.callback); } else { this.promisifiedCallback = this.callback; } } if (typeof timeoutMs === 'number' && timeoutMs > 0) { timeoutId = setTimeout(ontimeout, timeoutMs); } if ('port' in opts && typeof opts.port !== 'number') { opts.port = Number(opts.port); } try { debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } } freeSocket(socket, opts) { debug('Freeing socket %o %o', socket.constructor.name, opts); socket.destroy(); } destroy() { debug('Destroying agent %o', this.constructor.name); } } createAgent.Agent = Agent; // So that `instanceof` works correctly createAgent.prototype = createAgent.Agent.prototype; })(createAgent || (createAgent = {})); module.exports = createAgent; //# sourceMappingURL=index.js.map /***/ }), /***/ 66570: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function promisify(fn) { return function (req, opts) { return new Promise((resolve, reject) => { fn.call(this, req, opts, (err, rtn) => { if (err) { reject(err); } else { resolve(rtn); } }); }); }; } exports.default = promisify; //# sourceMappingURL=promisify.js.map /***/ }), /***/ 61231: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const indentString = __webpack_require__(98043); const cleanStack = __webpack_require__(27972); const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); class AggregateError extends Error { constructor(errors) { if (!Array.isArray(errors)) { throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); } errors = [...errors].map(error => { if (error instanceof Error) { return error; } if (error !== null && typeof error === 'object') { // Handle plain error objects with message property and/or possibly other metadata return Object.assign(new Error(error.message), error); } return new Error(error); }); let message = errors .map(error => { // The `stack` property is not standardized, so we can't assume it exists return typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error); }) .join('\n'); message = '\n' + indentString(message, 4); super(message); this.name = 'AggregateError'; Object.defineProperty(this, '_errors', {value: errors}); } * [Symbol.iterator]() { for (const error of this._errors) { yield error; } } } module.exports = AggregateError; /***/ }), /***/ 64941: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var compileSchema = __webpack_require__(875) , resolve = __webpack_require__(63896) , Cache = __webpack_require__(93679) , SchemaObject = __webpack_require__(37605) , stableStringify = __webpack_require__(30969) , formats = __webpack_require__(66627) , rules = __webpack_require__(68561) , $dataMetaSchema = __webpack_require__(21412) , util = __webpack_require__(76578); module.exports = Ajv; Ajv.prototype.validate = validate; Ajv.prototype.compile = compile; Ajv.prototype.addSchema = addSchema; Ajv.prototype.addMetaSchema = addMetaSchema; Ajv.prototype.validateSchema = validateSchema; Ajv.prototype.getSchema = getSchema; Ajv.prototype.removeSchema = removeSchema; Ajv.prototype.addFormat = addFormat; Ajv.prototype.errorsText = errorsText; Ajv.prototype._addSchema = _addSchema; Ajv.prototype._compile = _compile; Ajv.prototype.compileAsync = __webpack_require__(80890); var customKeyword = __webpack_require__(53297); Ajv.prototype.addKeyword = customKeyword.add; Ajv.prototype.getKeyword = customKeyword.get; Ajv.prototype.removeKeyword = customKeyword.remove; Ajv.prototype.validateKeyword = customKeyword.validate; var errorClasses = __webpack_require__(25726); Ajv.ValidationError = errorClasses.Validation; Ajv.MissingRefError = errorClasses.MissingRef; Ajv.$dataMetaSchema = $dataMetaSchema; var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; var META_SUPPORT_DATA = ['/properties']; /** * Creates validator instance. * Usage: `Ajv(opts)` * @param {Object} opts optional options * @return {Object} ajv instance */ function Ajv(opts) { if (!(this instanceof Ajv)) return new Ajv(opts); opts = this._opts = util.copy(opts) || {}; setLogger(this); this._schemas = {}; this._refs = {}; this._fragments = {}; this._formats = formats(opts.format); this._cache = opts.cache || new Cache; this._loadingSchemas = {}; this._compilations = []; this.RULES = rules(); this._getId = chooseGetId(opts); opts.loopRequired = opts.loopRequired || Infinity; if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; if (opts.serialize === undefined) opts.serialize = stableStringify; this._metaOpts = getMetaSchemaOptions(this); if (opts.formats) addInitialFormats(this); if (opts.keywords) addInitialKeywords(this); addDefaultMetaSchema(this); if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); addInitialSchemas(this); } /** * Validate data using schema * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. * @this Ajv * @param {String|Object} schemaKeyRef key, ref or schema object * @param {Any} data to be validated * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). */ function validate(schemaKeyRef, data) { var v; if (typeof schemaKeyRef == 'string') { v = this.getSchema(schemaKeyRef); if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); } else { var schemaObj = this._addSchema(schemaKeyRef); v = schemaObj.validate || this._compile(schemaObj); } var valid = v(data); if (v.$async !== true) this.errors = v.errors; return valid; } /** * Create validating function for passed schema. * @this Ajv * @param {Object} schema schema object * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. * @return {Function} validating function */ function compile(schema, _meta) { var schemaObj = this._addSchema(schema, undefined, _meta); return schemaObj.validate || this._compile(schemaObj); } /** * Adds schema to the instance. * @this Ajv * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. * @return {Ajv} this for method chaining */ function addSchema(schema, key, _skipValidation, _meta) { if (Array.isArray(schema)){ for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. * @param {Object} options optional options with properties `separator` and `dataVar`. * @return {String} human readable string with all errors descriptions */ function errorsText(errors, options) { errors = errors || this.errors; if (!errors) return 'No errors'; options = options || {}; var separator = options.separator === undefined ? ', ' : options.separator; var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; var text = ''; for (var i=0; i { "use strict"; var Cache = module.exports = function Cache() { this._cache = {}; }; Cache.prototype.put = function Cache_put(key, value) { this._cache[key] = value; }; Cache.prototype.get = function Cache_get(key) { return this._cache[key]; }; Cache.prototype.del = function Cache_del(key) { delete this._cache[key]; }; Cache.prototype.clear = function Cache_clear() { this._cache = {}; }; /***/ }), /***/ 80890: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var MissingRefError = __webpack_require__(25726).MissingRef; module.exports = compileAsync; /** * Creates validating function for passed schema with asynchronous loading of missing schemas. * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. * @this Ajv * @param {Object} schema schema object * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function. * @return {Promise} promise that resolves with a validating function. */ function compileAsync(schema, meta, callback) { /* eslint no-shadow: 0 */ /* global Promise */ /* jshint validthis: true */ var self = this; if (typeof this._opts.loadSchema != 'function') throw new Error('options.loadSchema should be a function'); if (typeof meta == 'function') { callback = meta; meta = undefined; } var p = loadMetaSchemaOf(schema).then(function () { var schemaObj = self._addSchema(schema, undefined, meta); return schemaObj.validate || _compileAsync(schemaObj); }); if (callback) { p.then( function(v) { callback(null, v); }, callback ); } return p; function loadMetaSchemaOf(sch) { var $schema = sch.$schema; return $schema && !self.getSchema($schema) ? compileAsync.call(self, { $ref: $schema }, true) : Promise.resolve(); } function _compileAsync(schemaObj) { try { return self._compile(schemaObj); } catch(e) { if (e instanceof MissingRefError) return loadMissingSchema(e); throw e; } function loadMissingSchema(e) { var ref = e.missingSchema; if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved'); var schemaPromise = self._loadingSchemas[ref]; if (!schemaPromise) { schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref); schemaPromise.then(removePromise, removePromise); } return schemaPromise.then(function (sch) { if (!added(ref)) { return loadMetaSchemaOf(sch).then(function () { if (!added(ref)) self.addSchema(sch, ref, undefined, meta); }); } }).then(function() { return _compileAsync(schemaObj); }); function removePromise() { delete self._loadingSchemas[ref]; } function added(ref) { return self._refs[ref] || self._schemas[ref]; } } } } /***/ }), /***/ 25726: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var resolve = __webpack_require__(63896); module.exports = { Validation: errorSubclass(ValidationError), MissingRef: errorSubclass(MissingRefError) }; function ValidationError(errors) { this.message = 'validation failed'; this.errors = errors; this.ajv = this.validation = true; } MissingRefError.message = function (baseId, ref) { return 'can\'t resolve reference ' + ref + ' from id ' + baseId; }; function MissingRefError(baseId, ref, message) { this.message = message || MissingRefError.message(baseId, ref); this.missingRef = resolve.url(baseId, ref); this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); } function errorSubclass(Subclass) { Subclass.prototype = Object.create(Error.prototype); Subclass.prototype.constructor = Subclass; return Subclass; } /***/ }), /***/ 66627: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var util = __webpack_require__(76578); var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31]; var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i; var HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i; var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; // uri-template: https://tools.ietf.org/html/rfc6570 var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; // For the source: https://gist.github.com/dperini/729294 // For test cases: https://mathiasbynens.be/demo/url-regex // @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. // var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; module.exports = formats; function formats(mode) { mode = mode == 'full' ? 'full' : 'fast'; return util.copy(formats[mode]); } formats.fast = { // date: http://tools.ietf.org/html/rfc3339#section-5.6 date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, 'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, 'uri-template': URITEMPLATE, url: URL, // email (sources from jsen validator): // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, hostname: HOSTNAME, // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, // uuid: http://tools.ietf.org/html/rfc4122 uuid: UUID, // JSON-pointer: https://tools.ietf.org/html/rfc6901 // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A 'json-pointer': JSON_POINTER, 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 'relative-json-pointer': RELATIVE_JSON_POINTER }; formats.full = { date: date, time: time, 'date-time': date_time, uri: uri, 'uri-reference': URIREF, 'uri-template': URITEMPLATE, url: URL, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: HOSTNAME, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, uuid: UUID, 'json-pointer': JSON_POINTER, 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, 'relative-json-pointer': RELATIVE_JSON_POINTER }; function isLeapYear(year) { // https://tools.ietf.org/html/rfc3339#appendix-C return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); } function date(str) { // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 var matches = str.match(DATE); if (!matches) return false; var year = +matches[1]; var month = +matches[2]; var day = +matches[3]; return month >= 1 && month <= 12 && day >= 1 && day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); } function time(str, full) { var matches = str.match(TIME); if (!matches) return false; var hour = matches[1]; var minute = matches[2]; var second = matches[3]; var timeZone = matches[5]; return ((hour <= 23 && minute <= 59 && second <= 59) || (hour == 23 && minute == 59 && second == 60)) && (!full || timeZone); } var DATE_TIME_SEPARATOR = /t|\s/i; function date_time(str) { // http://tools.ietf.org/html/rfc3339#section-5.6 var dateTime = str.split(DATE_TIME_SEPARATOR); return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); } var NOT_URI_FRAGMENT = /\/|:/; function uri(str) { // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." return NOT_URI_FRAGMENT.test(str) && URI.test(str); } var Z_ANCHOR = /[^\\]\\Z/; function regex(str) { if (Z_ANCHOR.test(str)) return false; try { new RegExp(str); return true; } catch(e) { return false; } } /***/ }), /***/ 875: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var resolve = __webpack_require__(63896) , util = __webpack_require__(76578) , errorClasses = __webpack_require__(25726) , stableStringify = __webpack_require__(30969); var validateGenerator = __webpack_require__(49585); /** * Functions below are used inside compiled validations function */ var ucs2length = util.ucs2length; var equal = __webpack_require__(28206); // this error is thrown by async schemas to return validation errors via exception var ValidationError = errorClasses.Validation; module.exports = compile; /** * Compiles schema to validation function * @this Ajv * @param {Object} schema schema object * @param {Object} root object with information about the root schema for this schema * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution * @param {String} baseId base ID for IDs in the schema * @return {Function} validation function */ function compile(schema, root, localRefs, baseId) { /* jshint validthis: true, evil: true */ /* eslint no-shadow: 0 */ var self = this , opts = this._opts , refVal = [ undefined ] , refs = {} , patterns = [] , patternsHash = {} , defaults = [] , defaultsHash = {} , customRules = []; root = root || { schema: schema, refVal: refVal, refs: refs }; var c = checkCompiling.call(this, schema, root, baseId); var compilation = this._compilations[c.index]; if (c.compiling) return (compilation.callValidate = callValidate); var formats = this._formats; var RULES = this.RULES; try { var v = localCompile(schema, root, localRefs, baseId); compilation.validate = v; var cv = compilation.callValidate; if (cv) { cv.schema = v.schema; cv.errors = null; cv.refs = v.refs; cv.refVal = v.refVal; cv.root = v.root; cv.$async = v.$async; if (opts.sourceCode) cv.source = v.source; } return v; } finally { endCompiling.call(this, schema, root, baseId); } /* @this {*} - custom context, see passContext option */ function callValidate() { /* jshint validthis: true */ var validate = compilation.validate; var result = validate.apply(this, arguments); callValidate.errors = validate.errors; return result; } function localCompile(_schema, _root, localRefs, baseId) { var isRoot = !_root || (_root && _root.schema == _schema); if (_root.schema != root.schema) return compile.call(self, _schema, _root, localRefs, baseId); var $async = _schema.$async === true; var sourceCode = validateGenerator({ isTop: true, schema: _schema, isRoot: isRoot, baseId: baseId, root: _root, schemaPath: '', errSchemaPath: '#', errorPath: '""', MissingRefError: errorClasses.MissingRef, RULES: RULES, validate: validateGenerator, util: util, resolve: resolve, resolveRef: resolveRef, usePattern: usePattern, useDefault: useDefault, useCustomRule: useCustomRule, opts: opts, formats: formats, logger: self.logger, self: self }); sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + sourceCode; if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema); // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); var validate; try { var makeValidate = new Function( 'self', 'RULES', 'formats', 'root', 'refVal', 'defaults', 'customRules', 'equal', 'ucs2length', 'ValidationError', sourceCode ); validate = makeValidate( self, RULES, formats, root, refVal, defaults, customRules, equal, ucs2length, ValidationError ); refVal[0] = validate; } catch(e) { self.logger.error('Error compiling schema, function code:', sourceCode); throw e; } validate.schema = _schema; validate.errors = null; validate.refs = refs; validate.refVal = refVal; validate.root = isRoot ? validate : _root; if ($async) validate.$async = true; if (opts.sourceCode === true) { validate.source = { code: sourceCode, patterns: patterns, defaults: defaults }; } return validate; } function resolveRef(baseId, ref, isRoot) { ref = resolve.url(baseId, ref); var refIndex = refs[ref]; var _refVal, refCode; if (refIndex !== undefined) { _refVal = refVal[refIndex]; refCode = 'refVal[' + refIndex + ']'; return resolvedRef(_refVal, refCode); } if (!isRoot && root.refs) { var rootRefId = root.refs[ref]; if (rootRefId !== undefined) { _refVal = root.refVal[rootRefId]; refCode = addLocalRef(ref, _refVal); return resolvedRef(_refVal, refCode); } } refCode = addLocalRef(ref); var v = resolve.call(self, localCompile, root, ref); if (v === undefined) { var localSchema = localRefs && localRefs[ref]; if (localSchema) { v = resolve.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId); } } if (v === undefined) { removeLocalRef(ref); } else { replaceLocalRef(ref, v); return resolvedRef(v, refCode); } } function addLocalRef(ref, v) { var refId = refVal.length; refVal[refId] = v; refs[ref] = refId; return 'refVal' + refId; } function removeLocalRef(ref) { delete refs[ref]; } function replaceLocalRef(ref, v) { var refId = refs[ref]; refVal[refId] = v; } function resolvedRef(refVal, code) { return typeof refVal == 'object' || typeof refVal == 'boolean' ? { code: code, schema: refVal, inline: true } : { code: code, $async: refVal && !!refVal.$async }; } function usePattern(regexStr) { var index = patternsHash[regexStr]; if (index === undefined) { index = patternsHash[regexStr] = patterns.length; patterns[index] = regexStr; } return 'pattern' + index; } function useDefault(value) { switch (typeof value) { case 'boolean': case 'number': return '' + value; case 'string': return util.toQuotedString(value); case 'object': if (value === null) return 'null'; var valueStr = stableStringify(value); var index = defaultsHash[valueStr]; if (index === undefined) { index = defaultsHash[valueStr] = defaults.length; defaults[index] = value; } return 'default' + index; } } function useCustomRule(rule, schema, parentSchema, it) { if (self._opts.validateSchema !== false) { var deps = rule.definition.dependencies; if (deps && !deps.every(function(keyword) { return Object.prototype.hasOwnProperty.call(parentSchema, keyword); })) throw new Error('parent schema must have all required keywords: ' + deps.join(',')); var validateSchema = rule.definition.validateSchema; if (validateSchema) { var valid = validateSchema(schema); if (!valid) { var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); if (self._opts.validateSchema == 'log') self.logger.error(message); else throw new Error(message); } } } var compile = rule.definition.compile , inline = rule.definition.inline , macro = rule.definition.macro; var validate; if (compile) { validate = compile.call(self, schema, parentSchema, it); } else if (macro) { validate = macro.call(self, schema, parentSchema, it); if (opts.validateSchema !== false) self.validateSchema(validate, true); } else if (inline) { validate = inline.call(self, it, rule.keyword, schema, parentSchema); } else { validate = rule.definition.validate; if (!validate) return; } if (validate === undefined) throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); var index = customRules.length; customRules[index] = validate; return { code: 'customRule' + index, validate: validate }; } } /** * Checks if the schema is currently compiled * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) */ function checkCompiling(schema, root, baseId) { /* jshint validthis: true */ var index = compIndex.call(this, schema, root, baseId); if (index >= 0) return { index: index, compiling: true }; index = this._compilations.length; this._compilations[index] = { schema: schema, root: root, baseId: baseId }; return { index: index, compiling: false }; } /** * Removes the schema from the currently compiled list * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID */ function endCompiling(schema, root, baseId) { /* jshint validthis: true */ var i = compIndex.call(this, schema, root, baseId); if (i >= 0) this._compilations.splice(i, 1); } /** * Index of schema compilation in the currently compiled list * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID * @return {Integer} compilation index */ function compIndex(schema, root, baseId) { /* jshint validthis: true */ for (var i=0; i { "use strict"; var URI = __webpack_require__(70020) , equal = __webpack_require__(28206) , util = __webpack_require__(76578) , SchemaObject = __webpack_require__(37605) , traverse = __webpack_require__(52533); module.exports = resolve; resolve.normalizeId = normalizeId; resolve.fullPath = getFullPath; resolve.url = resolveUrl; resolve.ids = resolveIds; resolve.inlineRef = inlineRef; resolve.schema = resolveSchema; /** * [resolve and compile the references ($ref)] * @this Ajv * @param {Function} compile reference to schema compilation funciton (localCompile) * @param {Object} root object with information about the root schema for the current schema * @param {String} ref reference to resolve * @return {Object|Function} schema object (if the schema can be inlined) or validation function */ function resolve(compile, root, ref) { /* jshint validthis: true */ var refVal = this._refs[ref]; if (typeof refVal == 'string') { if (this._refs[refVal]) refVal = this._refs[refVal]; else return resolve.call(this, compile, root, refVal); } refVal = refVal || this._schemas[ref]; if (refVal instanceof SchemaObject) { return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal); } var res = resolveSchema.call(this, root, ref); var schema, v, baseId; if (res) { schema = res.schema; root = res.root; baseId = res.baseId; } if (schema instanceof SchemaObject) { v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); } else if (schema !== undefined) { v = inlineRef(schema, this._opts.inlineRefs) ? schema : compile.call(this, schema, root, undefined, baseId); } return v; } /** * Resolve schema, its root and baseId * @this Ajv * @param {Object} root root object with properties schema, refVal, refs * @param {String} ref reference to resolve * @return {Object} object with properties schema, root, baseId */ function resolveSchema(root, ref) { /* jshint validthis: true */ var p = URI.parse(ref) , refPath = _getFullPath(p) , baseId = getFullPath(this._getId(root.schema)); if (Object.keys(root.schema).length === 0 || refPath !== baseId) { var id = normalizeId(refPath); var refVal = this._refs[id]; if (typeof refVal == 'string') { return resolveRecursive.call(this, root, refVal, p); } else if (refVal instanceof SchemaObject) { if (!refVal.validate) this._compile(refVal); root = refVal; } else { refVal = this._schemas[id]; if (refVal instanceof SchemaObject) { if (!refVal.validate) this._compile(refVal); if (id == normalizeId(ref)) return { schema: refVal, root: root, baseId: baseId }; root = refVal; } else { return; } } if (!root.schema) return; baseId = getFullPath(this._getId(root.schema)); } return getJsonPointer.call(this, p, baseId, root.schema, root); } /* @this Ajv */ function resolveRecursive(root, ref, parsedRef) { /* jshint validthis: true */ var res = resolveSchema.call(this, root, ref); if (res) { var schema = res.schema; var baseId = res.baseId; root = res.root; var id = this._getId(schema); if (id) baseId = resolveUrl(baseId, id); return getJsonPointer.call(this, parsedRef, baseId, schema, root); } } var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); /* @this Ajv */ function getJsonPointer(parsedRef, baseId, schema, root) { /* jshint validthis: true */ parsedRef.fragment = parsedRef.fragment || ''; if (parsedRef.fragment.slice(0,1) != '/') return; var parts = parsedRef.fragment.split('/'); for (var i = 1; i < parts.length; i++) { var part = parts[i]; if (part) { part = util.unescapeFragment(part); schema = schema[part]; if (schema === undefined) break; var id; if (!PREVENT_SCOPE_CHANGE[part]) { id = this._getId(schema); if (id) baseId = resolveUrl(baseId, id); if (schema.$ref) { var $ref = resolveUrl(baseId, schema.$ref); var res = resolveSchema.call(this, root, $ref); if (res) { schema = res.schema; root = res.root; baseId = res.baseId; } } } } } if (schema !== undefined && schema !== root.schema) return { schema: schema, root: root, baseId: baseId }; } var SIMPLE_INLINED = util.toHash([ 'type', 'format', 'pattern', 'maxLength', 'minLength', 'maxProperties', 'minProperties', 'maxItems', 'minItems', 'maximum', 'minimum', 'uniqueItems', 'multipleOf', 'required', 'enum' ]); function inlineRef(schema, limit) { if (limit === false) return false; if (limit === undefined || limit === true) return checkNoRef(schema); else if (limit) return countKeys(schema) <= limit; } function checkNoRef(schema) { var item; if (Array.isArray(schema)) { for (var i=0; i { "use strict"; var ruleModules = __webpack_require__(85810) , toHash = __webpack_require__(76578).toHash; module.exports = function rules() { var RULES = [ { type: 'number', rules: [ { 'maximum': ['exclusiveMaximum'] }, { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] }, { type: 'string', rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] }, { type: 'array', rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] }, { type: 'object', rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames', { 'properties': ['additionalProperties', 'patternProperties'] } ] }, { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] } ]; var ALL = [ 'type', '$comment' ]; var KEYWORDS = [ '$schema', '$id', 'id', '$data', '$async', 'title', 'description', 'default', 'definitions', 'examples', 'readOnly', 'writeOnly', 'contentMediaType', 'contentEncoding', 'additionalItems', 'then', 'else' ]; var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ]; RULES.all = toHash(ALL); RULES.types = toHash(TYPES); RULES.forEach(function (group) { group.rules = group.rules.map(function (keyword) { var implKeywords; if (typeof keyword == 'object') { var key = Object.keys(keyword)[0]; implKeywords = keyword[key]; keyword = key; implKeywords.forEach(function (k) { ALL.push(k); RULES.all[k] = true; }); } ALL.push(keyword); var rule = RULES.all[keyword] = { keyword: keyword, code: ruleModules[keyword], implements: implKeywords }; return rule; }); RULES.all.$comment = { keyword: '$comment', code: ruleModules.$comment }; if (group.type) RULES.types[group.type] = group; }); RULES.keywords = toHash(ALL.concat(KEYWORDS)); RULES.custom = {}; return RULES; }; /***/ }), /***/ 37605: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var util = __webpack_require__(76578); module.exports = SchemaObject; function SchemaObject(obj) { util.copy(obj, this); } /***/ }), /***/ 64580: /***/ ((module) => { "use strict"; // https://mathiasbynens.be/notes/javascript-encoding // https://github.com/bestiejs/punycode.js - punycode.ucs2.decode module.exports = function ucs2length(str) { var length = 0 , len = str.length , pos = 0 , value; while (pos < len) { length++; value = str.charCodeAt(pos++); if (value >= 0xD800 && value <= 0xDBFF && pos < len) { // high surrogate, and there is a next character value = str.charCodeAt(pos); if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate } } return length; }; /***/ }), /***/ 76578: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = { copy: copy, checkDataType: checkDataType, checkDataTypes: checkDataTypes, coerceToTypes: coerceToTypes, toHash: toHash, getProperty: getProperty, escapeQuotes: escapeQuotes, equal: __webpack_require__(28206), ucs2length: __webpack_require__(64580), varOccurences: varOccurences, varReplace: varReplace, schemaHasRules: schemaHasRules, schemaHasRulesExcept: schemaHasRulesExcept, schemaUnknownRules: schemaUnknownRules, toQuotedString: toQuotedString, getPathExpr: getPathExpr, getPath: getPath, getData: getData, unescapeFragment: unescapeFragment, unescapeJsonPointer: unescapeJsonPointer, escapeFragment: escapeFragment, escapeJsonPointer: escapeJsonPointer }; function copy(o, to) { to = to || {}; for (var key in o) to[key] = o[key]; return to; } function checkDataType(dataType, data, strictNumbers, negate) { var EQUAL = negate ? ' !== ' : ' === ' , AND = negate ? ' || ' : ' && ' , OK = negate ? '!' : '' , NOT = negate ? '' : '!'; switch (dataType) { case 'null': return data + EQUAL + 'null'; case 'array': return OK + 'Array.isArray(' + data + ')'; case 'object': return '(' + OK + data + AND + 'typeof ' + data + EQUAL + '"object"' + AND + NOT + 'Array.isArray(' + data + '))'; case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + NOT + '(' + data + ' % 1)' + AND + data + EQUAL + data + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; } } function checkDataTypes(dataTypes, data, strictNumbers) { switch (dataTypes.length) { case 1: return checkDataType(dataTypes[0], data, strictNumbers, true); default: var code = ''; var types = toHash(dataTypes); if (types.array && types.object) { code = types.null ? '(': '(!' + data + ' || '; code += 'typeof ' + data + ' !== "object")'; delete types.null; delete types.array; delete types.object; } if (types.number) delete types.integer; for (var t in types) code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true); return code; } } var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); function coerceToTypes(optionCoerceTypes, dataTypes) { if (Array.isArray(dataTypes)) { var types = []; for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); return paths[lvl - up]; } if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); data = 'data' + ((lvl - up) || ''); if (!jsonPointer) return data; } var expr = data; var segments = jsonPointer.split('/'); for (var i=0; i { "use strict"; var KEYWORDS = [ 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern', 'additionalItems', 'maxItems', 'minItems', 'uniqueItems', 'maxProperties', 'minProperties', 'required', 'additionalProperties', 'enum', 'format', 'const' ]; module.exports = function (metaSchema, keywordsJsonPointers) { for (var i=0; i { "use strict"; var metaSchema = __webpack_require__(40038); module.exports = { $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js', definitions: { simpleTypes: metaSchema.definitions.simpleTypes }, type: 'object', dependencies: { schema: ['validate'], $data: ['validate'], statements: ['inline'], valid: {not: {required: ['macro']}} }, properties: { type: metaSchema.properties.type, schema: {type: 'boolean'}, statements: {type: 'boolean'}, dependencies: { type: 'array', items: {type: 'string'} }, metaSchema: {type: 'object'}, modifying: {type: 'boolean'}, valid: {type: 'boolean'}, $data: {type: 'boolean'}, async: {type: 'boolean'}, errors: { anyOf: [ {type: 'boolean'}, {const: 'full'} ] } } }; /***/ }), /***/ 7404: /***/ ((module) => { "use strict"; module.exports = function generate__limit(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $isMax = $keyword == 'maximum', $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', $schemaExcl = it.schema[$exclusiveKeyword], $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, $op = $isMax ? '<' : '>', $notOp = $isMax ? '>' : '<', $errorKeyword = undefined; if (!($isData || typeof $schema == 'number' || $schema === undefined)) { throw new Error($keyword + ' must be number'); } if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) { throw new Error($exclusiveKeyword + ' must be number or boolean'); } if ($isDataExcl) { var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), $exclusive = 'exclusive' + $lvl, $exclType = 'exclType' + $lvl, $exclIsNumber = 'exclIsNumber' + $lvl, $opExpr = 'op' + $lvl, $opStr = '\' + ' + $opExpr + ' + \''; out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; $schemaValueExcl = 'schemaExcl' + $lvl; out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; var $errorKeyword = $exclusiveKeyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; if ($schema === undefined) { $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $schemaValue = $schemaValueExcl; $isData = $isDataExcl; } } else { var $exclIsNumber = typeof $schemaExcl == 'number', $opStr = $op; if ($exclIsNumber && $isData) { var $opExpr = '\'' + $opStr + '\''; out += ' if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; } else { if ($exclIsNumber && $schema === undefined) { $exclusive = true; $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $schemaValue = $schemaExcl; $notOp += '='; } else { if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { $exclusive = true; $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $notOp += '='; } else { $exclusive = false; $opStr += '='; } } var $opExpr = '\'' + $opStr + '\''; out += ' if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; } } $errorKeyword = $errorKeyword || $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be ' + ($opStr) + ' '; if ($isData) { out += '\' + ' + ($schemaValue); } else { out += '' + ($schemaValue) + '\''; } } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 64683: /***/ ((module) => { "use strict"; module.exports = function generate__limitItems(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!($isData || typeof $schema == 'number')) { throw new Error($keyword + ' must be number'); } var $op = $keyword == 'maxItems' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have '; if ($keyword == 'maxItems') { out += 'more'; } else { out += 'fewer'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' items\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 52114: /***/ ((module) => { "use strict"; module.exports = function generate__limitLength(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!($isData || typeof $schema == 'number')) { throw new Error($keyword + ' must be number'); } var $op = $keyword == 'maxLength' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } if (it.opts.unicode === false) { out += ' ' + ($data) + '.length '; } else { out += ' ucs2length(' + ($data) + ') '; } out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be '; if ($keyword == 'maxLength') { out += 'longer'; } else { out += 'shorter'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' characters\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 71142: /***/ ((module) => { "use strict"; module.exports = function generate__limitProperties(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!($isData || typeof $schema == 'number')) { throw new Error($keyword + ' must be number'); } var $op = $keyword == 'maxProperties' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have '; if ($keyword == 'maxProperties') { out += 'more'; } else { out += 'fewer'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' properties\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 89443: /***/ ((module) => { "use strict"; module.exports = function generate_allOf(it, $keyword, $ruleType) { var out = ' '; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $currentBaseId = $it.baseId, $allSchemasEmpty = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $allSchemasEmpty = false; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if ($breakOnError) { if ($allSchemasEmpty) { out += ' if (true) { '; } else { out += ' ' + ($closingBraces.slice(0, -1)) + ' '; } } return out; } /***/ }), /***/ 63093: /***/ ((module) => { "use strict"; module.exports = function generate_anyOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $noEmptySchema = $schema.every(function($sch) { return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); }); if ($noEmptySchema) { var $currentBaseId = $it.baseId; out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; $closingBraces += '}'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should match some schema in anyOf\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; if (it.opts.allErrors) { out += ' } '; } } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /***/ 30134: /***/ ((module) => { "use strict"; module.exports = function generate_comment(it, $keyword, $ruleType) { var out = ' '; var $schema = it.schema[$keyword]; var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $comment = it.util.toQuotedString($schema); if (it.opts.$comment === true) { out += ' console.log(' + ($comment) + ');'; } else if (typeof it.opts.$comment == 'function') { out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; } return out; } /***/ }), /***/ 1661: /***/ ((module) => { "use strict"; module.exports = function generate_const(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!$isData) { out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; } out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to constant\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' }'; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 55964: /***/ ((module) => { "use strict"; module.exports = function generate_contains(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $idx = 'i' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId, $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($nonEmptySchema) { var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' if (' + ($nextValid) + ') break; } '; it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; } else { out += ' if (' + ($data) + '.length == 0) {'; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should contain a valid item\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; if ($nonEmptySchema) { out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; } if (it.opts.allErrors) { out += ' } '; } return out; } /***/ }), /***/ 5912: /***/ ((module) => { "use strict"; module.exports = function generate_custom(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $rule = this, $definition = 'definition' + $lvl, $rDef = $rule.definition, $closingBraces = ''; var $compile, $inline, $macro, $ruleValidate, $validateCode; if ($isData && $rDef.$data) { $validateCode = 'keywordValidate' + $lvl; var $validateSchema = $rDef.validateSchema; out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; } else { $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); if (!$ruleValidate) return; $schemaValue = 'validate.schema' + $schemaPath; $validateCode = $ruleValidate.code; $compile = $rDef.compile; $inline = $rDef.inline; $macro = $rDef.macro; } var $ruleErrs = $validateCode + '.errors', $i = 'i' + $lvl, $ruleErr = 'ruleErr' + $lvl, $asyncKeyword = $rDef.async; if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); if (!($inline || $macro)) { out += '' + ($ruleErrs) + ' = null;'; } out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($isData && $rDef.$data) { $closingBraces += '}'; out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; if ($validateSchema) { $closingBraces += '}'; out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; } } if ($inline) { if ($rDef.statements) { out += ' ' + ($ruleValidate.validate) + ' '; } else { out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; } } else if ($macro) { var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; $it.schema = $ruleValidate.validate; $it.schemaPath = ''; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($code); } else { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; out += ' ' + ($validateCode) + '.call( '; if (it.opts.passContext) { out += 'this'; } else { out += 'self'; } if ($compile || $rDef.schema === false) { out += ' , ' + ($data) + ' '; } else { out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; } out += ' , (dataPath || \'\')'; if (it.errorPath != '""') { out += ' + ' + (it.errorPath); } var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; var def_callRuleValidate = out; out = $$outStack.pop(); if ($rDef.errors === false) { out += ' ' + ($valid) + ' = '; if ($asyncKeyword) { out += 'await '; } out += '' + (def_callRuleValidate) + '; '; } else { if ($asyncKeyword) { $ruleErrs = 'customErrors' + $lvl; out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; } else { out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; } } } if ($rDef.modifying) { out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; } out += '' + ($closingBraces); if ($rDef.valid) { if ($breakOnError) { out += ' if (true) { '; } } else { out += ' if ( '; if ($rDef.valid === undefined) { out += ' !'; if ($macro) { out += '' + ($nextValid); } else { out += '' + ($valid); } } else { out += ' ' + (!$rDef.valid) + ' '; } out += ') { '; $errorKeyword = $rule.keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } var def_customError = out; out = $$outStack.pop(); if ($inline) { if ($rDef.errors) { if ($rDef.errors != 'full') { out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' { "use strict"; module.exports = function generate_dependencies(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $schemaDeps = {}, $propertyDeps = {}, $ownProperties = it.opts.ownProperties; for ($property in $schema) { if ($property == '__proto__') continue; var $sch = $schema[$property]; var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; $deps[$property] = $sch; } out += 'var ' + ($errs) + ' = errors;'; var $currentErrorPath = it.errorPath; out += 'var missing' + ($lvl) + ';'; for (var $property in $propertyDeps) { $deps = $propertyDeps[$property]; if ($deps.length) { out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; } if ($breakOnError) { out += ' && ( '; var arr1 = $deps; if (arr1) { var $propertyKey, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $propertyKey = arr1[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ')) { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should have '; if ($deps.length == 1) { out += 'property ' + (it.util.escapeQuotes($deps[0])); } else { out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); } out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } else { out += ' ) { '; var arr2 = $deps; if (arr2) { var $propertyKey, i2 = -1, l2 = arr2.length - 1; while (i2 < l2) { $propertyKey = arr2[i2 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should have '; if ($deps.length == 1) { out += 'property ' + (it.util.escapeQuotes($deps[0])); } else { out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); } out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } out += ' } '; if ($breakOnError) { $closingBraces += '}'; out += ' else { '; } } } it.errorPath = $currentErrorPath; var $currentBaseId = $it.baseId; for (var $property in $schemaDeps) { var $sch = $schemaDeps[$property]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; } out += ') { '; $it.schema = $sch; $it.schemaPath = $schemaPath + it.util.getProperty($property); $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } return out; } /***/ }), /***/ 10163: /***/ ((module) => { "use strict"; module.exports = function generate_enum(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $i = 'i' + $lvl, $vSchema = 'schema' + $lvl; if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; } out += 'var ' + ($valid) + ';'; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to one of the allowed values\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' }'; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 63847: /***/ ((module) => { "use strict"; module.exports = function generate_format(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); if (it.opts.format === false) { if ($breakOnError) { out += ' if (true) { '; } return out; } var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $unknownFormats = it.opts.unknownFormats, $allowUnknown = Array.isArray($unknownFormats); if ($isData) { var $format = 'format' + $lvl, $isObject = 'isObject' + $lvl, $formatType = 'formatType' + $lvl; out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; if (it.async) { out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; } out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; } out += ' ('; if ($unknownFormats != 'ignore') { out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; if ($allowUnknown) { out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; } out += ') || '; } out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; if (it.async) { out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; } else { out += ' ' + ($format) + '(' + ($data) + ') '; } out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; } else { var $format = it.formats[$schema]; if (!$format) { if ($unknownFormats == 'ignore') { it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); if ($breakOnError) { out += ' if (true) { '; } return out; } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { if ($breakOnError) { out += ' if (true) { '; } return out; } else { throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); } } var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; var $formatType = $isObject && $format.type || 'string'; if ($isObject) { var $async = $format.async === true; $format = $format.validate; } if ($formatType != $ruleType) { if ($breakOnError) { out += ' if (true) { '; } return out; } if ($async) { if (!it.async) throw new Error('async format in sync schema'); var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; } else { out += ' if (! '; var $formatRef = 'formats' + it.util.getProperty($schema); if ($isObject) $formatRef += '.validate'; if (typeof $format == 'function') { out += ' ' + ($formatRef) + '(' + ($data) + ') '; } else { out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; } out += ') { '; } } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match format "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + (it.util.escapeQuotes($schema)); } out += '"\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 80862: /***/ ((module) => { "use strict"; module.exports = function generate_if(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; var $thenSch = it.schema['then'], $elseSch = it.schema['else'], $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), $currentBaseId = $it.baseId; if ($thenPresent || $elsePresent) { var $ifClause; $it.createErrors = false; $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; $it.createErrors = true; out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; it.compositeRule = $it.compositeRule = $wasComposite; if ($thenPresent) { out += ' if (' + ($nextValid) + ') { '; $it.schema = it.schema['then']; $it.schemaPath = it.schemaPath + '.then'; $it.errSchemaPath = it.errSchemaPath + '/then'; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; if ($thenPresent && $elsePresent) { $ifClause = 'ifClause' + $lvl; out += ' var ' + ($ifClause) + ' = \'then\'; '; } else { $ifClause = '\'then\''; } out += ' } '; if ($elsePresent) { out += ' else { '; } } else { out += ' if (!' + ($nextValid) + ') { '; } if ($elsePresent) { $it.schema = it.schema['else']; $it.schemaPath = it.schemaPath + '.else'; $it.errSchemaPath = it.errSchemaPath + '/else'; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; if ($thenPresent && $elsePresent) { $ifClause = 'ifClause' + $lvl; out += ' var ' + ($ifClause) + ' = \'else\'; '; } else { $ifClause = '\'else\''; } out += ' } '; } out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += ' } '; if ($breakOnError) { out += ' else { '; } } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /***/ 85810: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; //all requires must be explicit because browserify won't work with dynamic requires module.exports = { '$ref': __webpack_require__(42393), allOf: __webpack_require__(89443), anyOf: __webpack_require__(63093), '$comment': __webpack_require__(30134), const: __webpack_require__(1661), contains: __webpack_require__(55964), dependencies: __webpack_require__(2591), 'enum': __webpack_require__(10163), format: __webpack_require__(63847), 'if': __webpack_require__(80862), items: __webpack_require__(54408), maximum: __webpack_require__(7404), minimum: __webpack_require__(7404), maxItems: __webpack_require__(64683), minItems: __webpack_require__(64683), maxLength: __webpack_require__(52114), minLength: __webpack_require__(52114), maxProperties: __webpack_require__(71142), minProperties: __webpack_require__(71142), multipleOf: __webpack_require__(39772), not: __webpack_require__(60750), oneOf: __webpack_require__(6106), pattern: __webpack_require__(13912), properties: __webpack_require__(52924), propertyNames: __webpack_require__(19195), required: __webpack_require__(8420), uniqueItems: __webpack_require__(24995), validate: __webpack_require__(49585) }; /***/ }), /***/ 54408: /***/ ((module) => { "use strict"; module.exports = function generate_items(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $idx = 'i' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId; out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if (Array.isArray($schema)) { var $additionalItems = it.schema.additionalItems; if ($additionalItems === false) { out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + '/additionalItems'; out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { $closingBraces += '}'; out += ' else { '; } } var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; var $passData = $data + '[' + $i + ']'; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); $it.dataPathArr[$dataNxt] = $i; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { $it.schema = $additionalItems; $it.schemaPath = it.schemaPath + '.additionalItems'; $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' }'; } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } return out; } /***/ }), /***/ 39772: /***/ ((module) => { "use strict"; module.exports = function generate_multipleOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!($isData || typeof $schema == 'number')) { throw new Error($keyword + ' must be number'); } out += 'var division' + ($lvl) + ';if ('; if ($isData) { out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; } out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; if (it.opts.multipleOfPrecision) { out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; } else { out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; } out += ' ) '; if ($isData) { out += ' ) '; } out += ' ) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be multiple of '; if ($isData) { out += '\' + ' + ($schemaValue); } else { out += '' + ($schemaValue) + '\''; } } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 60750: /***/ ((module) => { "use strict"; module.exports = function generate_not(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($errs) + ' = errors; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.createErrors = false; var $allErrorsOption; if ($it.opts.allErrors) { $allErrorsOption = $it.opts.allErrors; $it.opts.allErrors = false; } out += ' ' + (it.validate($it)) + ' '; $it.createErrors = true; if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; it.compositeRule = $it.compositeRule = $wasComposite; out += ' if (' + ($nextValid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be valid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; if (it.opts.allErrors) { out += ' } '; } } else { out += ' var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be valid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if ($breakOnError) { out += ' if (false) { '; } } return out; } /***/ }), /***/ 6106: /***/ ((module) => { "use strict"; module.exports = function generate_oneOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $currentBaseId = $it.baseId, $prevValid = 'prevValid' + $lvl, $passingSchemas = 'passingSchemas' + $lvl; out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; } else { out += ' var ' + ($nextValid) + ' = true; '; } if ($i) { out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; $closingBraces += '}'; } out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match exactly one schema in oneOf\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; if (it.opts.allErrors) { out += ' } '; } return out; } /***/ }), /***/ 13912: /***/ ((module) => { "use strict"; module.exports = function generate_pattern(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; } out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match pattern "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + (it.util.escapeQuotes($schema)); } out += '"\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } /***/ }), /***/ 52924: /***/ ((module) => { "use strict"; module.exports = function generate_properties(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $key = 'key' + $lvl, $idx = 'idx' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl; var $schemaKeys = Object.keys($schema || {}).filter(notProto), $pProperties = it.schema.patternProperties || {}, $pPropertyKeys = Object.keys($pProperties).filter(notProto), $aProperties = it.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = $aProperties === false, $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, $removeAdditional = it.opts.removeAdditional, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; var $required = it.schema.required; if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { var $requiredHash = it.util.toHash($required); } function notProto(p) { return p !== '__proto__'; } out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined;'; } if ($checkAdditional) { if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } if ($someProperties) { out += ' var isAdditional' + ($lvl) + ' = !(false '; if ($schemaKeys.length) { if ($schemaKeys.length > 8) { out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; } else { var arr1 = $schemaKeys; if (arr1) { var $propertyKey, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $propertyKey = arr1[i1 += 1]; out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; } } } } if ($pPropertyKeys.length) { var arr2 = $pPropertyKeys; if (arr2) { var $pProperty, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $pProperty = arr2[$i += 1]; out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; } } } out += ' ); if (isAdditional' + ($lvl) + ') { '; } if ($removeAdditional == 'all') { out += ' delete ' + ($data) + '[' + ($key) + ']; '; } else { var $currentErrorPath = it.errorPath; var $additionalProperty = '\' + ' + $key + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); } if ($noAdditional) { if ($removeAdditional) { out += ' delete ' + ($data) + '[' + ($key) + ']; '; } else { out += ' ' + ($nextValid) + ' = false; '; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + '/additionalProperties'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is an invalid additional property'; } else { out += 'should NOT have additional properties'; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { out += ' break; '; } } } else if ($additionalIsSchema) { if ($removeAdditional == 'failing') { out += ' var ' + ($errs) + ' = errors; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.schema = $aProperties; $it.schemaPath = it.schemaPath + '.additionalProperties'; $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; it.compositeRule = $it.compositeRule = $wasComposite; } else { $it.schema = $aProperties; $it.schemaPath = it.schemaPath + '.additionalProperties'; $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } } } it.errorPath = $currentErrorPath; } if ($someProperties) { out += ' } '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } var $useDefaults = it.opts.useDefaults && !it.compositeRule; if ($schemaKeys.length) { var arr3 = $schemaKeys; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { var $prop = it.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== undefined; $it.schema = $sch; $it.schemaPath = $schemaPath + $prop; $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { $code = it.util.varReplace($code, $nextData, $passData); var $useData = $passData; } else { var $useData = $nextData; out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; } if ($hasDefault) { out += ' ' + ($code) + ' '; } else { if ($requiredHash && $requiredHash[$propertyKey]) { out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { ' + ($nextValid) + ' = false; '; var $currentErrorPath = it.errorPath, $currErrSchemaPath = $errSchemaPath, $missingProperty = it.util.escapeQuotes($propertyKey); if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } $errSchemaPath = it.errSchemaPath + '/required'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } $errSchemaPath = $currErrSchemaPath; it.errorPath = $currentErrorPath; out += ' } else { '; } else { if ($breakOnError) { out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { ' + ($nextValid) + ' = true; } else { '; } else { out += ' if (' + ($useData) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ' ) { '; } } out += ' ' + ($code) + ' } '; } } if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if ($pPropertyKeys.length) { var arr4 = $pPropertyKeys; if (arr4) { var $pProperty, i4 = -1, l4 = arr4.length - 1; while (i4 < l4) { $pProperty = arr4[i4 += 1]; var $sch = $pProperties[$pProperty]; if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } '; if ($breakOnError) { out += ' else ' + ($nextValid) + ' = true; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } return out; } /***/ }), /***/ 19195: /***/ ((module) => { "use strict"; module.exports = function generate_propertyNames(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; out += 'var ' + ($errs) + ' = errors;'; if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; var $key = 'key' + $lvl, $idx = 'idx' + $lvl, $i = 'i' + $lvl, $invalidName = '\' + ' + $key + ' + \'', $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined; '; } if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' var startErrs' + ($lvl) + ' = errors; '; var $passData = $key; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } it.compositeRule = $it.compositeRule = $wasComposite; out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' { "use strict"; module.exports = function generate_ref(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $async, $refCode; if ($schema == '#' || $schema == '#/') { if (it.isRoot) { $async = it.async; $refCode = 'validate'; } else { $async = it.root.schema.$async === true; $refCode = 'root.refVal[0]'; } } else { var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); if ($refVal === undefined) { var $message = it.MissingRefError.message(it.baseId, $schema); if (it.opts.missingRefs == 'fail') { it.logger.error($message); var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; } if (it.opts.verbose) { out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } if ($breakOnError) { out += ' if (false) { '; } } else if (it.opts.missingRefs == 'ignore') { it.logger.warn($message); if ($breakOnError) { out += ' if (true) { '; } } else { throw new it.MissingRefError(it.baseId, $schema, $message); } } else if ($refVal.inline) { var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; $it.schema = $refVal.schema; $it.schemaPath = ''; $it.errSchemaPath = $schema; var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); out += ' ' + ($code) + ' '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; } } else { $async = $refVal.$async === true || (it.async && $refVal.$async !== false); $refCode = $refVal.code; } } if ($refCode) { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; if (it.opts.passContext) { out += ' ' + ($refCode) + '.call(this, '; } else { out += ' ' + ($refCode) + '( '; } out += ' ' + ($data) + ', (dataPath || \'\')'; if (it.errorPath != '""') { out += ' + ' + (it.errorPath); } var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; var __callValidate = out; out = $$outStack.pop(); if ($async) { if (!it.async) throw new Error('async schema referenced by sync schema'); if ($breakOnError) { out += ' var ' + ($valid) + '; '; } out += ' try { await ' + (__callValidate) + '; '; if ($breakOnError) { out += ' ' + ($valid) + ' = true; '; } out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; '; if ($breakOnError) { out += ' ' + ($valid) + ' = false; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($valid) + ') { '; } } else { out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; if ($breakOnError) { out += ' else { '; } } } return out; } /***/ }), /***/ 8420: /***/ ((module) => { "use strict"; module.exports = function generate_required(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $vSchema = 'schema' + $lvl; if (!$isData) { if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { var $required = []; var arr1 = $schema; if (arr1) { var $property, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $property = arr1[i1 += 1]; var $propertySch = it.schema.properties[$property]; if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { $required[$required.length] = $property; } } } } else { var $required = $schema; } } if ($isData || $required.length) { var $currentErrorPath = it.errorPath, $loopRequired = $isData || $required.length >= it.opts.loopRequired, $ownProperties = it.opts.ownProperties; if ($breakOnError) { out += ' var missing' + ($lvl) + '; '; if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } out += ' var ' + ($valid) + ' = true; '; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += '; if (!' + ($valid) + ') break; } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } else { out += ' if ( '; var arr2 = $required; if (arr2) { var $propertyKey, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $propertyKey = arr2[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ') { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } } else { if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } if ($isData) { out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; if ($isData) { out += ' } '; } } else { var arr3 = $required; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } } it.errorPath = $currentErrorPath; } else if ($breakOnError) { out += ' if (true) {'; } return out; } /***/ }), /***/ 24995: /***/ ((module) => { "use strict"; module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (($schema || $isData) && it.opts.uniqueItems !== false) { if ($isData) { out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; } out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; var $itemType = it.schema.items && it.schema.items.type, $typeIsArray = Array.isArray($itemType); if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; } else { out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; '; if ($typeIsArray) { out += ' if (typeof item == \'string\') item = \'"\' + item; '; } out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; } out += ' } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } /***/ }), /***/ 49585: /***/ ((module) => { "use strict"; module.exports = function generate_validate(it, $keyword, $ruleType) { var out = ''; var $async = it.schema.$async === true, $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), $id = it.self._getId(it.schema); if (it.opts.strictKeywords) { var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); if ($unknownKwd) { var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); else throw new Error($keywordsMsg); } } if (it.isTop) { out += ' var validate = '; if ($async) { it.async = true; out += 'async '; } out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; if ($id && (it.opts.sourceCode || it.opts.processCode)) { out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; } } if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { var $keyword = 'false schema'; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; if (it.schema === false) { if (it.isTop) { $breakOnError = true; } else { out += ' var ' + ($valid) + ' = false; '; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'boolean schema is false\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } else { if (it.isTop) { if ($async) { out += ' return data; '; } else { out += ' validate.errors = null; return true; '; } } else { out += ' var ' + ($valid) + ' = true; '; } } if (it.isTop) { out += ' }; return validate; '; } return out; } if (it.isTop) { var $top = it.isTop, $lvl = it.level = 0, $dataLvl = it.dataLevel = 0, $data = 'data'; it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); it.baseId = it.baseId || it.rootId; delete it.isTop; it.dataPathArr = [""]; if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { var $defaultMsg = 'default is ignored in the schema root'; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } out += ' var vErrors = null; '; out += ' var errors = 0; '; out += ' if (rootData === undefined) rootData = data; '; } else { var $lvl = it.level, $dataLvl = it.dataLevel, $data = 'data' + ($dataLvl || ''); if ($id) it.baseId = it.resolve.url(it.baseId, $id); if ($async && !it.async) throw new Error('async schema in sync schema'); out += ' var errs_' + ($lvl) + ' = errors;'; } var $valid = 'valid' + $lvl, $breakOnError = !it.opts.allErrors, $closingBraces1 = '', $closingBraces2 = ''; var $errorKeyword; var $typeSchema = it.schema.type, $typeIsArray = Array.isArray($typeSchema); if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { if ($typeIsArray) { if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); } else if ($typeSchema != 'null') { $typeSchema = [$typeSchema, 'null']; $typeIsArray = true; } } if ($typeIsArray && $typeSchema.length == 1) { $typeSchema = $typeSchema[0]; $typeIsArray = false; } if (it.schema.$ref && $refKeywords) { if (it.opts.extendRefs == 'fail') { throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); } else if (it.opts.extendRefs !== true) { $refKeywords = false; it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); } } if (it.schema.$comment && it.opts.$comment) { out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); } if ($typeSchema) { if (it.opts.coerceTypes) { var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); } var $rulesGroup = it.RULES.types[$typeSchema]; if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type'; var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type', $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { '; if ($coerceToTypes) { var $dataType = 'dataType' + $lvl, $coerced = 'coerced' + $lvl; out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; if (it.opts.coerceTypes == 'array') { out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } '; } out += ' if (' + ($coerced) + ' !== undefined) ; '; var arr1 = $coerceToTypes; if (arr1) { var $type, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $type = arr1[$i += 1]; if ($type == 'string') { out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; } else if ($type == 'number' || $type == 'integer') { out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; if ($type == 'integer') { out += ' && !(' + ($data) + ' % 1)'; } out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; } else if ($type == 'boolean') { out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; } else if ($type == 'null') { out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; } else if (it.opts.coerceTypes == 'array' && $type == 'array') { out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; } } } out += ' else { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } if (' + ($coerced) + ' !== undefined) { '; var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' ' + ($data) + ' = ' + ($coerced) + '; '; if (!$dataLvl) { out += 'if (' + ($parentData) + ' !== undefined)'; } out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; } else { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } out += ' } '; } } if (it.schema.$ref && !$refKeywords) { out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; if ($breakOnError) { out += ' } if (errors === '; if ($top) { out += '0'; } else { out += 'errs_' + ($lvl); } out += ') { '; $closingBraces2 += '}'; } } else { var arr2 = it.RULES; if (arr2) { var $rulesGroup, i2 = -1, l2 = arr2.length - 1; while (i2 < l2) { $rulesGroup = arr2[i2 += 1]; if ($shouldUseGroup($rulesGroup)) { if ($rulesGroup.type) { out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { '; } if (it.opts.useDefaults) { if ($rulesGroup.type == 'object' && it.schema.properties) { var $schema = it.schema.properties, $schemaKeys = Object.keys($schema); var arr3 = $schemaKeys; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; if ($sch.default !== undefined) { var $passData = $data + it.util.getProperty($propertyKey); if (it.compositeRule) { if (it.opts.strictDefaults) { var $defaultMsg = 'default is ignored for: ' + $passData; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } } else { out += ' if (' + ($passData) + ' === undefined '; if (it.opts.useDefaults == 'empty') { out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; } out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { out += ' ' + (JSON.stringify($sch.default)) + ' '; } out += '; '; } } } } } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { var arr4 = it.schema.items; if (arr4) { var $sch, $i = -1, l4 = arr4.length - 1; while ($i < l4) { $sch = arr4[$i += 1]; if ($sch.default !== undefined) { var $passData = $data + '[' + $i + ']'; if (it.compositeRule) { if (it.opts.strictDefaults) { var $defaultMsg = 'default is ignored for: ' + $passData; if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); else throw new Error($defaultMsg); } } else { out += ' if (' + ($passData) + ' === undefined '; if (it.opts.useDefaults == 'empty') { out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; } out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { out += ' ' + (JSON.stringify($sch.default)) + ' '; } out += '; '; } } } } } } var arr5 = $rulesGroup.rules; if (arr5) { var $rule, i5 = -1, l5 = arr5.length - 1; while (i5 < l5) { $rule = arr5[i5 += 1]; if ($shouldUseRule($rule)) { var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); if ($code) { out += ' ' + ($code) + ' '; if ($breakOnError) { $closingBraces1 += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces1) + ' '; $closingBraces1 = ''; } if ($rulesGroup.type) { out += ' } '; if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { out += ' else { '; var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; } } if ($breakOnError) { out += ' if (errors === '; if ($top) { out += '0'; } else { out += 'errs_' + ($lvl); } out += ') { '; $closingBraces2 += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces2) + ' '; } if ($top) { if ($async) { out += ' if (errors === 0) return data; '; out += ' else throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; '; out += ' return errors === 0; '; } out += ' }; return validate;'; } else { out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; } function $shouldUseGroup($rulesGroup) { var rules = $rulesGroup.rules; for (var i = 0; i < rules.length; i++) if ($shouldUseRule(rules[i])) return true; } function $shouldUseRule($rule) { return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); } function $ruleImplementsSomeKeyword($rule) { var impl = $rule.implements; for (var i = 0; i < impl.length; i++) if (it.schema[impl[i]] !== undefined) return true; } return out; } /***/ }), /***/ 53297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; var customRuleCode = __webpack_require__(5912); var definitionSchema = __webpack_require__(10458); module.exports = { add: addKeyword, get: getKeyword, remove: removeKeyword, validate: validateKeyword }; /** * Define custom keyword * @this Ajv * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. * @return {Ajv} this for method chaining */ function addKeyword(keyword, definition) { /* jshint validthis: true */ /* eslint no-shadow: 0 */ var RULES = this.RULES; if (RULES.keywords[keyword]) throw new Error('Keyword ' + keyword + ' is already defined'); if (!IDENTIFIER.test(keyword)) throw new Error('Keyword ' + keyword + ' is not a valid identifier'); if (definition) { this.validateKeyword(definition, true); var dataType = definition.type; if (Array.isArray(dataType)) { for (var i=0; i { "use strict"; const arrify = value => { if (value === null || value === undefined) { return []; } if (Array.isArray(value)) { return value; } if (typeof value === 'string') { return [value]; } if (typeof value[Symbol.iterator] === 'function') { return [...value]; } return [value]; }; module.exports = arrify; /***/ }), /***/ 99348: /***/ ((module) => { // Copyright 2011 Mark Cavage All rights reserved. module.exports = { newInvalidAsn1Error: function (msg) { var e = new Error(); e.name = 'InvalidAsn1Error'; e.message = msg || ''; return e; } }; /***/ }), /***/ 194: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2011 Mark Cavage All rights reserved. var errors = __webpack_require__(99348); var types = __webpack_require__(42473); var Reader = __webpack_require__(20290); var Writer = __webpack_require__(43200); // --- Exports module.exports = { Reader: Reader, Writer: Writer }; for (var t in types) { if (types.hasOwnProperty(t)) module.exports[t] = types[t]; } for (var e in errors) { if (errors.hasOwnProperty(e)) module.exports[e] = errors[e]; } /***/ }), /***/ 20290: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2011 Mark Cavage All rights reserved. var assert = __webpack_require__(42357); var Buffer = __webpack_require__(15118).Buffer; var ASN1 = __webpack_require__(42473); var errors = __webpack_require__(99348); // --- Globals var newInvalidAsn1Error = errors.newInvalidAsn1Error; // --- API function Reader(data) { if (!data || !Buffer.isBuffer(data)) throw new TypeError('data must be a node Buffer'); this._buf = data; this._size = data.length; // These hold the "current" state this._len = 0; this._offset = 0; } Object.defineProperty(Reader.prototype, 'length', { enumerable: true, get: function () { return (this._len); } }); Object.defineProperty(Reader.prototype, 'offset', { enumerable: true, get: function () { return (this._offset); } }); Object.defineProperty(Reader.prototype, 'remain', { get: function () { return (this._size - this._offset); } }); Object.defineProperty(Reader.prototype, 'buffer', { get: function () { return (this._buf.slice(this._offset)); } }); /** * Reads a single byte and advances offset; you can pass in `true` to make this * a "peek" operation (i.e., get the byte, but don't advance the offset). * * @param {Boolean} peek true means don't move offset. * @return {Number} the next byte, null if not enough data. */ Reader.prototype.readByte = function (peek) { if (this._size - this._offset < 1) return null; var b = this._buf[this._offset] & 0xff; if (!peek) this._offset += 1; return b; }; Reader.prototype.peek = function () { return this.readByte(true); }; /** * Reads a (potentially) variable length off the BER buffer. This call is * not really meant to be called directly, as callers have to manipulate * the internal buffer afterwards. * * As a result of this call, you can call `Reader.length`, until the * next thing called that does a readLength. * * @return {Number} the amount of offset to advance the buffer. * @throws {InvalidAsn1Error} on bad ASN.1 */ Reader.prototype.readLength = function (offset) { if (offset === undefined) offset = this._offset; if (offset >= this._size) return null; var lenB = this._buf[offset++] & 0xff; if (lenB === null) return null; if ((lenB & 0x80) === 0x80) { lenB &= 0x7f; if (lenB === 0) throw newInvalidAsn1Error('Indefinite length not supported'); if (lenB > 4) throw newInvalidAsn1Error('encoding too long'); if (this._size - offset < lenB) return null; this._len = 0; for (var i = 0; i < lenB; i++) this._len = (this._len << 8) + (this._buf[offset++] & 0xff); } else { // Wasn't a variable length this._len = lenB; } return offset; }; /** * Parses the next sequence in this BER buffer. * * To get the length of the sequence, call `Reader.length`. * * @return {Number} the sequence's tag. */ Reader.prototype.readSequence = function (tag) { var seq = this.peek(); if (seq === null) return null; if (tag !== undefined && tag !== seq) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + seq.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; this._offset = o; return seq; }; Reader.prototype.readInt = function () { return this._readTag(ASN1.Integer); }; Reader.prototype.readBoolean = function () { return (this._readTag(ASN1.Boolean) === 0 ? false : true); }; Reader.prototype.readEnumeration = function () { return this._readTag(ASN1.Enumeration); }; Reader.prototype.readString = function (tag, retbuf) { if (!tag) tag = ASN1.OctetString; var b = this.peek(); if (b === null) return null; if (b !== tag) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + b.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; if (this.length > this._size - o) return null; this._offset = o; if (this.length === 0) return retbuf ? Buffer.alloc(0) : ''; var str = this._buf.slice(this._offset, this._offset + this.length); this._offset += this.length; return retbuf ? str : str.toString('utf8'); }; Reader.prototype.readOID = function (tag) { if (!tag) tag = ASN1.OID; var b = this.readString(tag, true); if (b === null) return null; var values = []; var value = 0; for (var i = 0; i < b.length; i++) { var byte = b[i] & 0xff; value <<= 7; value += byte & 0x7f; if ((byte & 0x80) === 0) { values.push(value); value = 0; } } value = values.shift(); values.unshift(value % 40); values.unshift((value / 40) >> 0); return values.join('.'); }; Reader.prototype._readTag = function (tag) { assert.ok(tag !== undefined); var b = this.peek(); if (b === null) return null; if (b !== tag) throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + ': got 0x' + b.toString(16)); var o = this.readLength(this._offset + 1); // stored in `length` if (o === null) return null; if (this.length > 4) throw newInvalidAsn1Error('Integer too long: ' + this.length); if (this.length > this._size - o) return null; this._offset = o; var fb = this._buf[this._offset]; var value = 0; for (var i = 0; i < this.length; i++) { value <<= 8; value |= (this._buf[this._offset++] & 0xff); } if ((fb & 0x80) === 0x80 && i !== 4) value -= (1 << (i * 8)); return value >> 0; }; // --- Exported API module.exports = Reader; /***/ }), /***/ 42473: /***/ ((module) => { // Copyright 2011 Mark Cavage All rights reserved. module.exports = { EOC: 0, Boolean: 1, Integer: 2, BitString: 3, OctetString: 4, Null: 5, OID: 6, ObjectDescriptor: 7, External: 8, Real: 9, // float Enumeration: 10, PDV: 11, Utf8String: 12, RelativeOID: 13, Sequence: 16, Set: 17, NumericString: 18, PrintableString: 19, T61String: 20, VideotexString: 21, IA5String: 22, UTCTime: 23, GeneralizedTime: 24, GraphicString: 25, VisibleString: 26, GeneralString: 28, UniversalString: 29, CharacterString: 30, BMPString: 31, Constructor: 32, Context: 128 }; /***/ }), /***/ 43200: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2011 Mark Cavage All rights reserved. var assert = __webpack_require__(42357); var Buffer = __webpack_require__(15118).Buffer; var ASN1 = __webpack_require__(42473); var errors = __webpack_require__(99348); // --- Globals var newInvalidAsn1Error = errors.newInvalidAsn1Error; var DEFAULT_OPTS = { size: 1024, growthFactor: 8 }; // --- Helpers function merge(from, to) { assert.ok(from); assert.equal(typeof (from), 'object'); assert.ok(to); assert.equal(typeof (to), 'object'); var keys = Object.getOwnPropertyNames(from); keys.forEach(function (key) { if (to[key]) return; var value = Object.getOwnPropertyDescriptor(from, key); Object.defineProperty(to, key, value); }); return to; } // --- API function Writer(options) { options = merge(DEFAULT_OPTS, options || {}); this._buf = Buffer.alloc(options.size || 1024); this._size = this._buf.length; this._offset = 0; this._options = options; // A list of offsets in the buffer where we need to insert // sequence tag/len pairs. this._seq = []; } Object.defineProperty(Writer.prototype, 'buffer', { get: function () { if (this._seq.length) throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); return (this._buf.slice(0, this._offset)); } }); Writer.prototype.writeByte = function (b) { if (typeof (b) !== 'number') throw new TypeError('argument must be a Number'); this._ensure(1); this._buf[this._offset++] = b; }; Writer.prototype.writeInt = function (i, tag) { if (typeof (i) !== 'number') throw new TypeError('argument must be a Number'); if (typeof (tag) !== 'number') tag = ASN1.Integer; var sz = 4; while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && (sz > 1)) { sz--; i <<= 8; } if (sz > 4) throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); this._ensure(2 + sz); this._buf[this._offset++] = tag; this._buf[this._offset++] = sz; while (sz-- > 0) { this._buf[this._offset++] = ((i & 0xff000000) >>> 24); i <<= 8; } }; Writer.prototype.writeNull = function () { this.writeByte(ASN1.Null); this.writeByte(0x00); }; Writer.prototype.writeEnumeration = function (i, tag) { if (typeof (i) !== 'number') throw new TypeError('argument must be a Number'); if (typeof (tag) !== 'number') tag = ASN1.Enumeration; return this.writeInt(i, tag); }; Writer.prototype.writeBoolean = function (b, tag) { if (typeof (b) !== 'boolean') throw new TypeError('argument must be a Boolean'); if (typeof (tag) !== 'number') tag = ASN1.Boolean; this._ensure(3); this._buf[this._offset++] = tag; this._buf[this._offset++] = 0x01; this._buf[this._offset++] = b ? 0xff : 0x00; }; Writer.prototype.writeString = function (s, tag) { if (typeof (s) !== 'string') throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); if (typeof (tag) !== 'number') tag = ASN1.OctetString; var len = Buffer.byteLength(s); this.writeByte(tag); this.writeLength(len); if (len) { this._ensure(len); this._buf.write(s, this._offset); this._offset += len; } }; Writer.prototype.writeBuffer = function (buf, tag) { if (typeof (tag) !== 'number') throw new TypeError('tag must be a number'); if (!Buffer.isBuffer(buf)) throw new TypeError('argument must be a buffer'); this.writeByte(tag); this.writeLength(buf.length); this._ensure(buf.length); buf.copy(this._buf, this._offset, 0, buf.length); this._offset += buf.length; }; Writer.prototype.writeStringArray = function (strings) { if ((!strings instanceof Array)) throw new TypeError('argument must be an Array[String]'); var self = this; strings.forEach(function (s) { self.writeString(s); }); }; // This is really to solve DER cases, but whatever for now Writer.prototype.writeOID = function (s, tag) { if (typeof (s) !== 'string') throw new TypeError('argument must be a string'); if (typeof (tag) !== 'number') tag = ASN1.OID; if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) throw new Error('argument is not a valid OID string'); function encodeOctet(bytes, octet) { if (octet < 128) { bytes.push(octet); } else if (octet < 16384) { bytes.push((octet >>> 7) | 0x80); bytes.push(octet & 0x7F); } else if (octet < 2097152) { bytes.push((octet >>> 14) | 0x80); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } else if (octet < 268435456) { bytes.push((octet >>> 21) | 0x80); bytes.push(((octet >>> 14) | 0x80) & 0xFF); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } else { bytes.push(((octet >>> 28) | 0x80) & 0xFF); bytes.push(((octet >>> 21) | 0x80) & 0xFF); bytes.push(((octet >>> 14) | 0x80) & 0xFF); bytes.push(((octet >>> 7) | 0x80) & 0xFF); bytes.push(octet & 0x7F); } } var tmp = s.split('.'); var bytes = []; bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); tmp.slice(2).forEach(function (b) { encodeOctet(bytes, parseInt(b, 10)); }); var self = this; this._ensure(2 + bytes.length); this.writeByte(tag); this.writeLength(bytes.length); bytes.forEach(function (b) { self.writeByte(b); }); }; Writer.prototype.writeLength = function (len) { if (typeof (len) !== 'number') throw new TypeError('argument must be a Number'); this._ensure(4); if (len <= 0x7f) { this._buf[this._offset++] = len; } else if (len <= 0xff) { this._buf[this._offset++] = 0x81; this._buf[this._offset++] = len; } else if (len <= 0xffff) { this._buf[this._offset++] = 0x82; this._buf[this._offset++] = len >> 8; this._buf[this._offset++] = len; } else if (len <= 0xffffff) { this._buf[this._offset++] = 0x83; this._buf[this._offset++] = len >> 16; this._buf[this._offset++] = len >> 8; this._buf[this._offset++] = len; } else { throw newInvalidAsn1Error('Length too long (> 4 bytes)'); } }; Writer.prototype.startSequence = function (tag) { if (typeof (tag) !== 'number') tag = ASN1.Sequence | ASN1.Constructor; this.writeByte(tag); this._seq.push(this._offset); this._ensure(3); this._offset += 3; }; Writer.prototype.endSequence = function () { var seq = this._seq.pop(); var start = seq + 3; var len = this._offset - start; if (len <= 0x7f) { this._shift(start, len, -2); this._buf[seq] = len; } else if (len <= 0xff) { this._shift(start, len, -1); this._buf[seq] = 0x81; this._buf[seq + 1] = len; } else if (len <= 0xffff) { this._buf[seq] = 0x82; this._buf[seq + 1] = len >> 8; this._buf[seq + 2] = len; } else if (len <= 0xffffff) { this._shift(start, len, 1); this._buf[seq] = 0x83; this._buf[seq + 1] = len >> 16; this._buf[seq + 2] = len >> 8; this._buf[seq + 3] = len; } else { throw newInvalidAsn1Error('Sequence too long'); } }; Writer.prototype._shift = function (start, len, shift) { assert.ok(start !== undefined); assert.ok(len !== undefined); assert.ok(shift); this._buf.copy(this._buf, start + shift, start, start + len); this._offset += shift; }; Writer.prototype._ensure = function (len) { assert.ok(len); if (this._size - this._offset < len) { var sz = this._size * this._options.growthFactor; if (sz - this._offset < len) sz += len; var buf = Buffer.alloc(sz); this._buf.copy(buf, 0, 0, this._offset); this._buf = buf; this._size = sz; } }; // --- Exported API module.exports = Writer; /***/ }), /***/ 80970: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2011 Mark Cavage All rights reserved. // If you have no idea what ASN.1 or BER is, see this: // ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc var Ber = __webpack_require__(194); // --- Exported API module.exports = { Ber: Ber, BerReader: Ber.Reader, BerWriter: Ber.Writer }; /***/ }), /***/ 66631: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright (c) 2012, Mark Cavage. All rights reserved. // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(42357); var Stream = __webpack_require__(92413).Stream; var util = __webpack_require__(31669); ///--- Globals /* JSSTYLED */ var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; ///--- Internal function _capitalize(str) { return (str.charAt(0).toUpperCase() + str.slice(1)); } function _toss(name, expected, oper, arg, actual) { throw new assert.AssertionError({ message: util.format('%s (%s) is required', name, expected), actual: (actual === undefined) ? typeof (arg) : actual(arg), expected: expected, operator: oper || '===', stackStartFunction: _toss.caller }); } function _getClass(arg) { return (Object.prototype.toString.call(arg).slice(8, -1)); } function noop() { // Why even bother with asserts? } ///--- Exports var types = { bool: { check: function (arg) { return typeof (arg) === 'boolean'; } }, func: { check: function (arg) { return typeof (arg) === 'function'; } }, string: { check: function (arg) { return typeof (arg) === 'string'; } }, object: { check: function (arg) { return typeof (arg) === 'object' && arg !== null; } }, number: { check: function (arg) { return typeof (arg) === 'number' && !isNaN(arg); } }, finite: { check: function (arg) { return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); } }, buffer: { check: function (arg) { return Buffer.isBuffer(arg); }, operator: 'Buffer.isBuffer' }, array: { check: function (arg) { return Array.isArray(arg); }, operator: 'Array.isArray' }, stream: { check: function (arg) { return arg instanceof Stream; }, operator: 'instanceof', actual: _getClass }, date: { check: function (arg) { return arg instanceof Date; }, operator: 'instanceof', actual: _getClass }, regexp: { check: function (arg) { return arg instanceof RegExp; }, operator: 'instanceof', actual: _getClass }, uuid: { check: function (arg) { return typeof (arg) === 'string' && UUID_REGEXP.test(arg); }, operator: 'isUUID' } }; function _setExports(ndebug) { var keys = Object.keys(types); var out; /* re-export standard assert */ if (process.env.NODE_NDEBUG) { out = noop; } else { out = function (arg, msg) { if (!arg) { _toss(msg, 'true', arg); } }; } /* standard checks */ keys.forEach(function (k) { if (ndebug) { out[k] = noop; return; } var type = types[k]; out[k] = function (arg, msg) { if (!type.check(arg)) { _toss(msg, k, type.operator, arg, type.actual); } }; }); /* optional checks */ keys.forEach(function (k) { var name = 'optional' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } if (!type.check(arg)) { _toss(msg, k, type.operator, arg, type.actual); } }; }); /* arrayOf checks */ keys.forEach(function (k) { var name = 'arrayOf' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; var expected = '[' + k + ']'; out[name] = function (arg, msg) { if (!Array.isArray(arg)) { _toss(msg, expected, type.operator, arg, type.actual); } var i; for (i = 0; i < arg.length; i++) { if (!type.check(arg[i])) { _toss(msg, expected, type.operator, arg, type.actual); } } }; }); /* optionalArrayOf checks */ keys.forEach(function (k) { var name = 'optionalArrayOf' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; var expected = '[' + k + ']'; out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } if (!Array.isArray(arg)) { _toss(msg, expected, type.operator, arg, type.actual); } var i; for (i = 0; i < arg.length; i++) { if (!type.check(arg[i])) { _toss(msg, expected, type.operator, arg, type.actual); } } }; }); /* re-export built-in assertions */ Object.keys(assert).forEach(function (k) { if (k === 'AssertionError') { out[k] = assert[k]; return; } if (ndebug) { out[k] = noop; return; } out[k] = assert[k]; }); /* export ourselves (for unit tests _only_) */ out._setExports = _setExports; return out; } module.exports = _setExports(process.env.NODE_NDEBUG); /***/ }), /***/ 41299: /***/ (function(__unused_webpack_module, exports) { !function(e,t){ true?t(exports):0}(this,(function(e){"use strict";class t extends Error{constructor(e){super(null!=e?`Timed out after waiting for ${e} ms`:"Timed out"),Object.setPrototypeOf(this,t.prototype)}}const o=(e,t)=>new Promise(((o,n)=>{try{e.schedule(o,t)}catch(e){n(e)}})),n={schedule:(e,t)=>{let o;const n=e=>{null!=e&&clearTimeout(e),o=void 0};return o=setTimeout((()=>{n(o),e()}),t),{cancel:()=>n(o)}}},i=Number.POSITIVE_INFINITY,r=(e,r,l)=>{var u,s;const c=null!==(u="number"==typeof r?r:null==r?void 0:r.timeout)&&void 0!==u?u:5e3,d=null!==(s="number"==typeof r?l:null==r?void 0:r.intervalBetweenAttempts)&&void 0!==s?s:50;let a=!1;const f=()=>new Promise(((t,i)=>{const r=()=>{a||new Promise(((t,o)=>{try{t(e())}catch(e){o(e)}})).then((e=>{e?t(e):o(n,d).then(r).catch(i)})).catch(i)};r()})),T=c!==i?()=>o(n,c).then((()=>{throw a=!0,new t(c)})):void 0;return null!=T?Promise.race([f(),T()]):f()};e.DEFAULT_INTERVAL_BETWEEN_ATTEMPTS_IN_MS=50,e.DEFAULT_TIMEOUT_IN_MS=5e3,e.TimeoutError=t,e.WAIT_FOREVER=i,e.default=r,e.waitUntil=r,Object.defineProperty(e,"__esModule",{value:!0})}));//# sourceMappingURL=index.js.map /***/ }), /***/ 14812: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = { parallel : __webpack_require__(8210), serial : __webpack_require__(50445), serialOrdered : __webpack_require__(3578) }; /***/ }), /***/ 1700: /***/ ((module) => { // API module.exports = abort; /** * Aborts leftover active jobs * * @param {object} state - current state object */ function abort(state) { Object.keys(state.jobs).forEach(clean.bind(state)); // reset leftover jobs state.jobs = {}; } /** * Cleans up leftover job by invoking abort function for the provided job id * * @this state * @param {string|number} key - job id to abort */ function clean(key) { if (typeof this.jobs[key] == 'function') { this.jobs[key](); } } /***/ }), /***/ 72794: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var defer = __webpack_require__(15295); // API module.exports = async; /** * Runs provided callback asynchronously * even if callback itself is not * * @param {function} callback - callback to invoke * @returns {function} - augmented callback */ function async(callback) { var isAsync = false; // check if async happened defer(function() { isAsync = true; }); return function async_callback(err, result) { if (isAsync) { callback(err, result); } else { defer(function nextTick_callback() { callback(err, result); }); } }; } /***/ }), /***/ 15295: /***/ ((module) => { module.exports = defer; /** * Runs provided function on next iteration of the event loop * * @param {function} fn - function to run */ function defer(fn) { var nextTick = typeof setImmediate == 'function' ? setImmediate : ( typeof process == 'object' && typeof process.nextTick == 'function' ? process.nextTick : null ); if (nextTick) { nextTick(fn); } else { setTimeout(fn, 0); } } /***/ }), /***/ 9023: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var async = __webpack_require__(72794) , abort = __webpack_require__(1700) ; // API module.exports = iterate; /** * Iterates over each job object * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {object} state - current job status * @param {function} callback - invoked when all elements processed */ function iterate(list, iterator, state, callback) { // store current index var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; state.jobs[key] = runJob(iterator, key, list[key], function(error, output) { // don't repeat yourself // skip secondary callbacks if (!(key in state.jobs)) { return; } // clean up jobs delete state.jobs[key]; if (error) { // don't process rest of the results // stop still active jobs // and reset the list abort(state); } else { state.results[key] = output; } // return salvaged results callback(error, state.results); }); } /** * Runs iterator over provided job element * * @param {function} iterator - iterator to invoke * @param {string|number} key - key/index of the element in the list of jobs * @param {mixed} item - job description * @param {function} callback - invoked after iterator is done with the job * @returns {function|mixed} - job abort function or something else */ function runJob(iterator, key, item, callback) { var aborter; // allow shortcut if iterator expects only two arguments if (iterator.length == 2) { aborter = iterator(item, async(callback)); } // otherwise go with full three arguments else { aborter = iterator(item, key, async(callback)); } return aborter; } /***/ }), /***/ 42474: /***/ ((module) => { // API module.exports = state; /** * Creates initial state object * for iteration over list * * @param {array|object} list - list to iterate over * @param {function|null} sortMethod - function to use for keys sort, * or `null` to keep them as is * @returns {object} - initial state object */ function state(list, sortMethod) { var isNamedList = !Array.isArray(list) , initState = { index : 0, keyedList: isNamedList || sortMethod ? Object.keys(list) : null, jobs : {}, results : isNamedList ? {} : [], size : isNamedList ? Object.keys(list).length : list.length } ; if (sortMethod) { // sort array keys based on it's values // sort object's keys just on own merit initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) { return sortMethod(list[a], list[b]); }); } return initState; } /***/ }), /***/ 37942: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var abort = __webpack_require__(1700) , async = __webpack_require__(72794) ; // API module.exports = terminator; /** * Terminates jobs in the attached state context * * @this AsyncKitState# * @param {function} callback - final callback to invoke after termination */ function terminator(callback) { if (!Object.keys(this.jobs).length) { return; } // fast forward iteration index this.index = this.size; // abort jobs abort(this); // send back results we have so far async(callback)(null, this.results); } /***/ }), /***/ 8210: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var iterate = __webpack_require__(9023) , initState = __webpack_require__(42474) , terminator = __webpack_require__(37942) ; // Public API module.exports = parallel; /** * Runs iterator over provided array elements in parallel * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function parallel(list, iterator, callback) { var state = initState(list); while (state.index < (state['keyedList'] || list).length) { iterate(list, iterator, state, function(error, result) { if (error) { callback(error, result); return; } // looks like it's the last one if (Object.keys(state.jobs).length === 0) { callback(null, state.results); return; } }); state.index++; } return terminator.bind(state, callback); } /***/ }), /***/ 50445: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var serialOrdered = __webpack_require__(3578); // Public API module.exports = serial; /** * Runs iterator over provided array elements in series * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function serial(list, iterator, callback) { return serialOrdered(list, iterator, null, callback); } /***/ }), /***/ 3578: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var iterate = __webpack_require__(9023) , initState = __webpack_require__(42474) , terminator = __webpack_require__(37942) ; // Public API module.exports = serialOrdered; // sorting helpers module.exports.ascending = ascending; module.exports.descending = descending; /** * Runs iterator over provided sorted array elements in series * * @param {array|object} list - array or object (named list) to iterate over * @param {function} iterator - iterator to run * @param {function} sortMethod - custom sort function * @param {function} callback - invoked when all elements processed * @returns {function} - jobs terminator */ function serialOrdered(list, iterator, sortMethod, callback) { var state = initState(list, sortMethod); iterate(list, iterator, state, function iteratorHandler(error, result) { if (error) { callback(error, result); return; } state.index++; // are we there yet? if (state.index < (state['keyedList'] || list).length) { iterate(list, iterator, state, iteratorHandler); return; } // done here callback(null, state.results); }); return terminator.bind(state, callback); } /* * -- Sort methods */ /** * sort helper to sort array elements in ascending order * * @param {mixed} a - an item to compare * @param {mixed} b - an item to compare * @returns {number} - comparison result */ function ascending(a, b) { return a < b ? -1 : a > b ? 1 : 0; } /** * sort helper to sort array elements in descending order * * @param {mixed} a - an item to compare * @param {mixed} b - an item to compare * @returns {number} - comparison result */ function descending(a, b) { return -1 * ascending(a, b); } /***/ }), /***/ 20940: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['accessanalyzer'] = {}; AWS.AccessAnalyzer = Service.defineService('accessanalyzer', ['2019-11-01']); Object.defineProperty(apiLoader.services['accessanalyzer'], '2019-11-01', { get: function get() { var model = __webpack_require__(24955); model.paginators = __webpack_require__(7997)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AccessAnalyzer; /***/ }), /***/ 30838: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['acm'] = {}; AWS.ACM = Service.defineService('acm', ['2015-12-08']); Object.defineProperty(apiLoader.services['acm'], '2015-12-08', { get: function get() { var model = __webpack_require__(22335); model.paginators = __webpack_require__(63763)/* .pagination */ .o; model.waiters = __webpack_require__(12336)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ACM; /***/ }), /***/ 18450: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['acmpca'] = {}; AWS.ACMPCA = Service.defineService('acmpca', ['2017-08-22']); Object.defineProperty(apiLoader.services['acmpca'], '2017-08-22', { get: function get() { var model = __webpack_require__(2794); model.paginators = __webpack_require__(92031)/* .pagination */ .o; model.waiters = __webpack_require__(50728)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ACMPCA; /***/ }), /***/ 14578: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['alexaforbusiness'] = {}; AWS.AlexaForBusiness = Service.defineService('alexaforbusiness', ['2017-11-09']); Object.defineProperty(apiLoader.services['alexaforbusiness'], '2017-11-09', { get: function get() { var model = __webpack_require__(4946); model.paginators = __webpack_require__(74967)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AlexaForBusiness; /***/ }), /***/ 26296: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); module.exports = { ACM: __webpack_require__(30838), APIGateway: __webpack_require__(91759), ApplicationAutoScaling: __webpack_require__(25598), AppStream: __webpack_require__(21730), AutoScaling: __webpack_require__(31652), Batch: __webpack_require__(10000), Budgets: __webpack_require__(43923), CloudDirectory: __webpack_require__(56231), CloudFormation: __webpack_require__(74643), CloudFront: __webpack_require__(48058), CloudHSM: __webpack_require__(10569), CloudSearch: __webpack_require__(72321), CloudSearchDomain: __webpack_require__(64072), CloudTrail: __webpack_require__(65512), CloudWatch: __webpack_require__(6763), CloudWatchEvents: __webpack_require__(38124), CloudWatchLogs: __webpack_require__(96693), CodeBuild: __webpack_require__(60450), CodeCommit: __webpack_require__(71323), CodeDeploy: __webpack_require__(54599), CodePipeline: __webpack_require__(22938), CognitoIdentity: __webpack_require__(58291), CognitoIdentityServiceProvider: __webpack_require__(31379), CognitoSync: __webpack_require__(74770), ConfigService: __webpack_require__(34061), CUR: __webpack_require__(5026), DataPipeline: __webpack_require__(65688), DeviceFarm: __webpack_require__(26272), DirectConnect: __webpack_require__(73783), DirectoryService: __webpack_require__(83908), Discovery: __webpack_require__(81690), DMS: __webpack_require__(69868), DynamoDB: __webpack_require__(14347), DynamoDBStreams: __webpack_require__(88090), EC2: __webpack_require__(7778), ECR: __webpack_require__(15211), ECS: __webpack_require__(16615), EFS: __webpack_require__(34375), ElastiCache: __webpack_require__(81065), ElasticBeanstalk: __webpack_require__(14897), ELB: __webpack_require__(10907), ELBv2: __webpack_require__(44311), EMR: __webpack_require__(50470), ES: __webpack_require__(84462), ElasticTranscoder: __webpack_require__(40745), Firehose: __webpack_require__(92831), GameLift: __webpack_require__(8085), Glacier: __webpack_require__(63249), Health: __webpack_require__(21834), IAM: __webpack_require__(50058), ImportExport: __webpack_require__(6769), Inspector: __webpack_require__(89439), Iot: __webpack_require__(98392), IotData: __webpack_require__(6564), Kinesis: __webpack_require__(49876), KinesisAnalytics: __webpack_require__(90042), KMS: __webpack_require__(56782), Lambda: __webpack_require__(13321), LexRuntime: __webpack_require__(62716), Lightsail: __webpack_require__(22718), MachineLearning: __webpack_require__(82907), MarketplaceCommerceAnalytics: __webpack_require__(4540), MarketplaceMetering: __webpack_require__(39297), MTurk: __webpack_require__(79954), MobileAnalytics: __webpack_require__(66690), OpsWorks: __webpack_require__(75691), OpsWorksCM: __webpack_require__(80388), Organizations: __webpack_require__(44670), Pinpoint: __webpack_require__(18388), Polly: __webpack_require__(97332), RDS: __webpack_require__(71578), Redshift: __webpack_require__(84853), Rekognition: __webpack_require__(65470), ResourceGroupsTaggingAPI: __webpack_require__(7385), Route53: __webpack_require__(44968), Route53Domains: __webpack_require__(51994), S3: __webpack_require__(83256), S3Control: __webpack_require__(99817), ServiceCatalog: __webpack_require__(822), SES: __webpack_require__(46816), Shield: __webpack_require__(20271), SimpleDB: __webpack_require__(10120), SMS: __webpack_require__(57719), Snowball: __webpack_require__(510), SNS: __webpack_require__(28581), SQS: __webpack_require__(63172), SSM: __webpack_require__(83380), StorageGateway: __webpack_require__(89190), StepFunctions: __webpack_require__(8136), STS: __webpack_require__(57513), Support: __webpack_require__(1099), SWF: __webpack_require__(32327), XRay: __webpack_require__(41548), WAF: __webpack_require__(72742), WAFRegional: __webpack_require__(23153), WorkDocs: __webpack_require__(38835), WorkSpaces: __webpack_require__(25513), CodeStar: __webpack_require__(98336), LexModelBuildingService: __webpack_require__(37397), MarketplaceEntitlementService: __webpack_require__(53707), Athena: __webpack_require__(29434), Greengrass: __webpack_require__(20690), DAX: __webpack_require__(71398), MigrationHub: __webpack_require__(14688), CloudHSMV2: __webpack_require__(70889), Glue: __webpack_require__(31658), Mobile: __webpack_require__(39782), Pricing: __webpack_require__(92765), CostExplorer: __webpack_require__(79523), MediaConvert: __webpack_require__(57220), MediaLive: __webpack_require__(7509), MediaPackage: __webpack_require__(91620), MediaStore: __webpack_require__(83748), MediaStoreData: __webpack_require__(98703), AppSync: __webpack_require__(12402), GuardDuty: __webpack_require__(40755), MQ: __webpack_require__(23093), Comprehend: __webpack_require__(62878), IoTJobsDataPlane: __webpack_require__(42332), KinesisVideoArchivedMedia: __webpack_require__(5580), KinesisVideoMedia: __webpack_require__(81308), KinesisVideo: __webpack_require__(89927), SageMakerRuntime: __webpack_require__(85044), SageMaker: __webpack_require__(77657), Translate: __webpack_require__(72544), ResourceGroups: __webpack_require__(58756), AlexaForBusiness: __webpack_require__(14578), Cloud9: __webpack_require__(85473), ServerlessApplicationRepository: __webpack_require__(62402), ServiceDiscovery: __webpack_require__(91569), WorkMail: __webpack_require__(38374), AutoScalingPlans: __webpack_require__(2554), TranscribeService: __webpack_require__(75811), Connect: __webpack_require__(13879), ACMPCA: __webpack_require__(18450), FMS: __webpack_require__(11316), SecretsManager: __webpack_require__(85131), IoTAnalytics: __webpack_require__(67409), IoT1ClickDevicesService: __webpack_require__(39474), IoT1ClickProjects: __webpack_require__(4686), PI: __webpack_require__(15505), Neptune: __webpack_require__(30047), MediaTailor: __webpack_require__(99658), EKS: __webpack_require__(23337), Macie: __webpack_require__(86427), DLM: __webpack_require__(24958), Signer: __webpack_require__(71596), Chime: __webpack_require__(84646), PinpointEmail: __webpack_require__(83060), RAM: __webpack_require__(94394), Route53Resolver: __webpack_require__(25894), PinpointSMSVoice: __webpack_require__(46605), QuickSight: __webpack_require__(29898), RDSDataService: __webpack_require__(30147), Amplify: __webpack_require__(38090), DataSync: __webpack_require__(15472), RoboMaker: __webpack_require__(18068), Transfer: __webpack_require__(51585), GlobalAccelerator: __webpack_require__(19306), ComprehendMedical: __webpack_require__(32349), KinesisAnalyticsV2: __webpack_require__(74631), MediaConnect: __webpack_require__(67639), FSx: __webpack_require__(60642), SecurityHub: __webpack_require__(21550), AppMesh: __webpack_require__(69226), LicenseManager: __webpack_require__(34693), Kafka: __webpack_require__(56775), ApiGatewayManagementApi: __webpack_require__(31762), ApiGatewayV2: __webpack_require__(44987), DocDB: __webpack_require__(55129), Backup: __webpack_require__(82455), WorkLink: __webpack_require__(48579), Textract: __webpack_require__(58523), ManagedBlockchain: __webpack_require__(85143), MediaPackageVod: __webpack_require__(14962), GroundStation: __webpack_require__(80494), IoTThingsGraph: __webpack_require__(58905), IoTEvents: __webpack_require__(88065), IoTEventsData: __webpack_require__(56973), Personalize: __webpack_require__(33696), PersonalizeEvents: __webpack_require__(88170), PersonalizeRuntime: __webpack_require__(66184), ApplicationInsights: __webpack_require__(83972), ServiceQuotas: __webpack_require__(57800), EC2InstanceConnect: __webpack_require__(92209), EventBridge: __webpack_require__(898), LakeFormation: __webpack_require__(6726), ForecastService: __webpack_require__(12942), ForecastQueryService: __webpack_require__(36822), QLDB: __webpack_require__(71266), QLDBSession: __webpack_require__(55423), WorkMailMessageFlow: __webpack_require__(67025), CodeStarNotifications: __webpack_require__(15141), SavingsPlans: __webpack_require__(62825), SSO: __webpack_require__(71096), SSOOIDC: __webpack_require__(49870), MarketplaceCatalog: __webpack_require__(2609), DataExchange: __webpack_require__(11024), SESV2: __webpack_require__(20142), MigrationHubConfig: __webpack_require__(62658), ConnectParticipant: __webpack_require__(94198), AppConfig: __webpack_require__(78606), IoTSecureTunneling: __webpack_require__(98562), WAFV2: __webpack_require__(50353), ElasticInference: __webpack_require__(37708), Imagebuilder: __webpack_require__(57511), Schemas: __webpack_require__(55713), AccessAnalyzer: __webpack_require__(20940), CodeGuruReviewer: __webpack_require__(60070), CodeGuruProfiler: __webpack_require__(65704), ComputeOptimizer: __webpack_require__(64459), FraudDetector: __webpack_require__(99830), Kendra: __webpack_require__(66122), NetworkManager: __webpack_require__(37610), Outposts: __webpack_require__(27551), AugmentedAIRuntime: __webpack_require__(33960), EBS: __webpack_require__(62837), KinesisVideoSignalingChannels: __webpack_require__(12710), Detective: __webpack_require__(60674), CodeStarconnections: __webpack_require__(78270), Synthetics: __webpack_require__(25910), IoTSiteWise: __webpack_require__(89690), Macie2: __webpack_require__(57330), CodeArtifact: __webpack_require__(91983), Honeycode: __webpack_require__(38889), IVS: __webpack_require__(67701), Braket: __webpack_require__(35429), IdentityStore: __webpack_require__(60222), Appflow: __webpack_require__(60844), RedshiftData: __webpack_require__(203), SSOAdmin: __webpack_require__(66644), TimestreamQuery: __webpack_require__(24529), TimestreamWrite: __webpack_require__(1573), S3Outposts: __webpack_require__(90493), DataBrew: __webpack_require__(35846), ServiceCatalogAppRegistry: __webpack_require__(79068), NetworkFirewall: __webpack_require__(84626), MWAA: __webpack_require__(32712), AmplifyBackend: __webpack_require__(2806), AppIntegrations: __webpack_require__(85479), ConnectContactLens: __webpack_require__(41847), DevOpsGuru: __webpack_require__(90673), ECRPUBLIC: __webpack_require__(90244), LookoutVision: __webpack_require__(65046), SageMakerFeatureStoreRuntime: __webpack_require__(67644), CustomerProfiles: __webpack_require__(28379), AuditManager: __webpack_require__(20472), EMRcontainers: __webpack_require__(49984), HealthLake: __webpack_require__(64254), SagemakerEdge: __webpack_require__(38966), Amp: __webpack_require__(96881), GreengrassV2: __webpack_require__(45126), IotDeviceAdvisor: __webpack_require__(97569), IoTFleetHub: __webpack_require__(42513), IoTWireless: __webpack_require__(8226), Location: __webpack_require__(44594), WellArchitected: __webpack_require__(86263), LexModelsV2: __webpack_require__(27254), LexRuntimeV2: __webpack_require__(33855), Fis: __webpack_require__(73003), LookoutMetrics: __webpack_require__(78708), Mgn: __webpack_require__(41339), LookoutEquipment: __webpack_require__(21843) }; /***/ }), /***/ 96881: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['amp'] = {}; AWS.Amp = Service.defineService('amp', ['2020-08-01']); Object.defineProperty(apiLoader.services['amp'], '2020-08-01', { get: function get() { var model = __webpack_require__(36184); model.paginators = __webpack_require__(7850)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Amp; /***/ }), /***/ 38090: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['amplify'] = {}; AWS.Amplify = Service.defineService('amplify', ['2017-07-25']); Object.defineProperty(apiLoader.services['amplify'], '2017-07-25', { get: function get() { var model = __webpack_require__(59237); model.paginators = __webpack_require__(89594)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Amplify; /***/ }), /***/ 2806: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['amplifybackend'] = {}; AWS.AmplifyBackend = Service.defineService('amplifybackend', ['2020-08-11']); Object.defineProperty(apiLoader.services['amplifybackend'], '2020-08-11', { get: function get() { var model = __webpack_require__(70211); model.paginators = __webpack_require__(72426)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AmplifyBackend; /***/ }), /***/ 91759: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['apigateway'] = {}; AWS.APIGateway = Service.defineService('apigateway', ['2015-07-09']); __webpack_require__(4338); Object.defineProperty(apiLoader.services['apigateway'], '2015-07-09', { get: function get() { var model = __webpack_require__(33895); model.paginators = __webpack_require__(61271)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.APIGateway; /***/ }), /***/ 31762: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['apigatewaymanagementapi'] = {}; AWS.ApiGatewayManagementApi = Service.defineService('apigatewaymanagementapi', ['2018-11-29']); Object.defineProperty(apiLoader.services['apigatewaymanagementapi'], '2018-11-29', { get: function get() { var model = __webpack_require__(31775); model.paginators = __webpack_require__(19890)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ApiGatewayManagementApi; /***/ }), /***/ 44987: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['apigatewayv2'] = {}; AWS.ApiGatewayV2 = Service.defineService('apigatewayv2', ['2018-11-29']); Object.defineProperty(apiLoader.services['apigatewayv2'], '2018-11-29', { get: function get() { var model = __webpack_require__(18767); model.paginators = __webpack_require__(96828)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ApiGatewayV2; /***/ }), /***/ 78606: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appconfig'] = {}; AWS.AppConfig = Service.defineService('appconfig', ['2019-10-09']); Object.defineProperty(apiLoader.services['appconfig'], '2019-10-09', { get: function get() { var model = __webpack_require__(5832); model.paginators = __webpack_require__(38388)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppConfig; /***/ }), /***/ 60844: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appflow'] = {}; AWS.Appflow = Service.defineService('appflow', ['2020-08-23']); Object.defineProperty(apiLoader.services['appflow'], '2020-08-23', { get: function get() { var model = __webpack_require__(63769); model.paginators = __webpack_require__(3505)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Appflow; /***/ }), /***/ 85479: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appintegrations'] = {}; AWS.AppIntegrations = Service.defineService('appintegrations', ['2020-07-29']); Object.defineProperty(apiLoader.services['appintegrations'], '2020-07-29', { get: function get() { var model = __webpack_require__(26469); model.paginators = __webpack_require__(74824)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppIntegrations; /***/ }), /***/ 25598: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['applicationautoscaling'] = {}; AWS.ApplicationAutoScaling = Service.defineService('applicationautoscaling', ['2016-02-06']); Object.defineProperty(apiLoader.services['applicationautoscaling'], '2016-02-06', { get: function get() { var model = __webpack_require__(14452); model.paginators = __webpack_require__(11157)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ApplicationAutoScaling; /***/ }), /***/ 83972: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['applicationinsights'] = {}; AWS.ApplicationInsights = Service.defineService('applicationinsights', ['2018-11-25']); Object.defineProperty(apiLoader.services['applicationinsights'], '2018-11-25', { get: function get() { var model = __webpack_require__(48728); model.paginators = __webpack_require__(9986)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ApplicationInsights; /***/ }), /***/ 69226: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appmesh'] = {}; AWS.AppMesh = Service.defineService('appmesh', ['2018-10-01', '2018-10-01*', '2019-01-25']); Object.defineProperty(apiLoader.services['appmesh'], '2018-10-01', { get: function get() { var model = __webpack_require__(4710); model.paginators = __webpack_require__(74196)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['appmesh'], '2019-01-25', { get: function get() { var model = __webpack_require__(99818); model.paginators = __webpack_require__(9865)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppMesh; /***/ }), /***/ 21730: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appstream'] = {}; AWS.AppStream = Service.defineService('appstream', ['2016-12-01']); Object.defineProperty(apiLoader.services['appstream'], '2016-12-01', { get: function get() { var model = __webpack_require__(12513); model.paginators = __webpack_require__(81915)/* .pagination */ .o; model.waiters = __webpack_require__(98407)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppStream; /***/ }), /***/ 12402: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['appsync'] = {}; AWS.AppSync = Service.defineService('appsync', ['2017-07-25']); Object.defineProperty(apiLoader.services['appsync'], '2017-07-25', { get: function get() { var model = __webpack_require__(3651); model.paginators = __webpack_require__(93930)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AppSync; /***/ }), /***/ 29434: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['athena'] = {}; AWS.Athena = Service.defineService('athena', ['2017-05-18']); Object.defineProperty(apiLoader.services['athena'], '2017-05-18', { get: function get() { var model = __webpack_require__(19898); model.paginators = __webpack_require__(23135)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Athena; /***/ }), /***/ 20472: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['auditmanager'] = {}; AWS.AuditManager = Service.defineService('auditmanager', ['2017-07-25']); Object.defineProperty(apiLoader.services['auditmanager'], '2017-07-25', { get: function get() { var model = __webpack_require__(66702); model.paginators = __webpack_require__(99387)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AuditManager; /***/ }), /***/ 33960: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['augmentedairuntime'] = {}; AWS.AugmentedAIRuntime = Service.defineService('augmentedairuntime', ['2019-11-07']); Object.defineProperty(apiLoader.services['augmentedairuntime'], '2019-11-07', { get: function get() { var model = __webpack_require__(60302); model.paginators = __webpack_require__(58181)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AugmentedAIRuntime; /***/ }), /***/ 31652: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['autoscaling'] = {}; AWS.AutoScaling = Service.defineService('autoscaling', ['2011-01-01']); Object.defineProperty(apiLoader.services['autoscaling'], '2011-01-01', { get: function get() { var model = __webpack_require__(68489); model.paginators = __webpack_require__(38676)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AutoScaling; /***/ }), /***/ 2554: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['autoscalingplans'] = {}; AWS.AutoScalingPlans = Service.defineService('autoscalingplans', ['2018-01-06']); Object.defineProperty(apiLoader.services['autoscalingplans'], '2018-01-06', { get: function get() { var model = __webpack_require__(95300); model.paginators = __webpack_require__(4511)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.AutoScalingPlans; /***/ }), /***/ 82455: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['backup'] = {}; AWS.Backup = Service.defineService('backup', ['2018-11-15']); Object.defineProperty(apiLoader.services['backup'], '2018-11-15', { get: function get() { var model = __webpack_require__(65918); model.paginators = __webpack_require__(61080)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Backup; /***/ }), /***/ 10000: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['batch'] = {}; AWS.Batch = Service.defineService('batch', ['2016-08-10']); Object.defineProperty(apiLoader.services['batch'], '2016-08-10', { get: function get() { var model = __webpack_require__(97171); model.paginators = __webpack_require__(27755)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Batch; /***/ }), /***/ 35429: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['braket'] = {}; AWS.Braket = Service.defineService('braket', ['2019-09-01']); Object.defineProperty(apiLoader.services['braket'], '2019-09-01', { get: function get() { var model = __webpack_require__(44714); model.paginators = __webpack_require__(60058)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Braket; /***/ }), /***/ 43923: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['budgets'] = {}; AWS.Budgets = Service.defineService('budgets', ['2016-10-20']); Object.defineProperty(apiLoader.services['budgets'], '2016-10-20', { get: function get() { var model = __webpack_require__(47942); model.paginators = __webpack_require__(64219)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Budgets; /***/ }), /***/ 84646: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['chime'] = {}; AWS.Chime = Service.defineService('chime', ['2018-05-01']); Object.defineProperty(apiLoader.services['chime'], '2018-05-01', { get: function get() { var model = __webpack_require__(55823); model.paginators = __webpack_require__(6307)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Chime; /***/ }), /***/ 85473: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloud9'] = {}; AWS.Cloud9 = Service.defineService('cloud9', ['2017-09-23']); Object.defineProperty(apiLoader.services['cloud9'], '2017-09-23', { get: function get() { var model = __webpack_require__(90697); model.paginators = __webpack_require__(79426)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Cloud9; /***/ }), /***/ 56231: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['clouddirectory'] = {}; AWS.CloudDirectory = Service.defineService('clouddirectory', ['2016-05-10', '2016-05-10*', '2017-01-11']); Object.defineProperty(apiLoader.services['clouddirectory'], '2016-05-10', { get: function get() { var model = __webpack_require__(87301); model.paginators = __webpack_require__(72446)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['clouddirectory'], '2017-01-11', { get: function get() { var model = __webpack_require__(79943); model.paginators = __webpack_require__(20410)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudDirectory; /***/ }), /***/ 74643: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudformation'] = {}; AWS.CloudFormation = Service.defineService('cloudformation', ['2010-05-15']); Object.defineProperty(apiLoader.services['cloudformation'], '2010-05-15', { get: function get() { var model = __webpack_require__(50980); model.paginators = __webpack_require__(43078)/* .pagination */ .o; model.waiters = __webpack_require__(11714)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudFormation; /***/ }), /***/ 48058: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudfront'] = {}; AWS.CloudFront = Service.defineService('cloudfront', ['2013-05-12*', '2013-11-11*', '2014-05-31*', '2014-10-21*', '2014-11-06*', '2015-04-17*', '2015-07-27*', '2015-09-17*', '2016-01-13*', '2016-01-28*', '2016-08-01*', '2016-08-20*', '2016-09-07*', '2016-09-29*', '2016-11-25', '2016-11-25*', '2017-03-25', '2017-03-25*', '2017-10-30', '2017-10-30*', '2018-06-18', '2018-06-18*', '2018-11-05', '2018-11-05*', '2019-03-26', '2019-03-26*', '2020-05-31']); __webpack_require__(95483); Object.defineProperty(apiLoader.services['cloudfront'], '2016-11-25', { get: function get() { var model = __webpack_require__(81977); model.paginators = __webpack_require__(12819)/* .pagination */ .o; model.waiters = __webpack_require__(52832)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2017-03-25', { get: function get() { var model = __webpack_require__(38288); model.paginators = __webpack_require__(19896)/* .pagination */ .o; model.waiters = __webpack_require__(43589)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2017-10-30', { get: function get() { var model = __webpack_require__(62352); model.paginators = __webpack_require__(94430)/* .pagination */ .o; model.waiters = __webpack_require__(36502)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2018-06-18', { get: function get() { var model = __webpack_require__(59976); model.paginators = __webpack_require__(43510)/* .pagination */ .o; model.waiters = __webpack_require__(67512)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2018-11-05', { get: function get() { var model = __webpack_require__(2861); model.paginators = __webpack_require__(94484)/* .pagination */ .o; model.waiters = __webpack_require__(94992)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2019-03-26', { get: function get() { var model = __webpack_require__(22621); model.paginators = __webpack_require__(49289)/* .pagination */ .o; model.waiters = __webpack_require__(89078)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudfront'], '2020-05-31', { get: function get() { var model = __webpack_require__(44946); model.paginators = __webpack_require__(92022)/* .pagination */ .o; model.waiters = __webpack_require__(83035)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudFront; /***/ }), /***/ 10569: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudhsm'] = {}; AWS.CloudHSM = Service.defineService('cloudhsm', ['2014-05-30']); Object.defineProperty(apiLoader.services['cloudhsm'], '2014-05-30', { get: function get() { var model = __webpack_require__(59717); model.paginators = __webpack_require__(26512)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudHSM; /***/ }), /***/ 70889: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudhsmv2'] = {}; AWS.CloudHSMV2 = Service.defineService('cloudhsmv2', ['2017-04-28']); Object.defineProperty(apiLoader.services['cloudhsmv2'], '2017-04-28', { get: function get() { var model = __webpack_require__(19362); model.paginators = __webpack_require__(96674)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudHSMV2; /***/ }), /***/ 72321: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudsearch'] = {}; AWS.CloudSearch = Service.defineService('cloudsearch', ['2011-02-01', '2013-01-01']); Object.defineProperty(apiLoader.services['cloudsearch'], '2011-02-01', { get: function get() { var model = __webpack_require__(4999); model.paginators = __webpack_require__(74483)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['cloudsearch'], '2013-01-01', { get: function get() { var model = __webpack_require__(93200); model.paginators = __webpack_require__(82352)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudSearch; /***/ }), /***/ 64072: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudsearchdomain'] = {}; AWS.CloudSearchDomain = Service.defineService('cloudsearchdomain', ['2013-01-01']); __webpack_require__(48571); Object.defineProperty(apiLoader.services['cloudsearchdomain'], '2013-01-01', { get: function get() { var model = __webpack_require__(56588); return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudSearchDomain; /***/ }), /***/ 65512: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudtrail'] = {}; AWS.CloudTrail = Service.defineService('cloudtrail', ['2013-11-01']); Object.defineProperty(apiLoader.services['cloudtrail'], '2013-11-01', { get: function get() { var model = __webpack_require__(90967); model.paginators = __webpack_require__(78414)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudTrail; /***/ }), /***/ 6763: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudwatch'] = {}; AWS.CloudWatch = Service.defineService('cloudwatch', ['2010-08-01']); Object.defineProperty(apiLoader.services['cloudwatch'], '2010-08-01', { get: function get() { var model = __webpack_require__(12505); model.paginators = __webpack_require__(16758)/* .pagination */ .o; model.waiters = __webpack_require__(4112)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudWatch; /***/ }), /***/ 38124: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudwatchevents'] = {}; AWS.CloudWatchEvents = Service.defineService('cloudwatchevents', ['2014-02-03*', '2015-10-07']); Object.defineProperty(apiLoader.services['cloudwatchevents'], '2015-10-07', { get: function get() { var model = __webpack_require__(2845); model.paginators = __webpack_require__(96939)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudWatchEvents; /***/ }), /***/ 96693: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cloudwatchlogs'] = {}; AWS.CloudWatchLogs = Service.defineService('cloudwatchlogs', ['2014-03-28']); Object.defineProperty(apiLoader.services['cloudwatchlogs'], '2014-03-28', { get: function get() { var model = __webpack_require__(69022); model.paginators = __webpack_require__(26273)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CloudWatchLogs; /***/ }), /***/ 91983: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codeartifact'] = {}; AWS.CodeArtifact = Service.defineService('codeartifact', ['2018-09-22']); Object.defineProperty(apiLoader.services['codeartifact'], '2018-09-22', { get: function get() { var model = __webpack_require__(26175); model.paginators = __webpack_require__(21307)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeArtifact; /***/ }), /***/ 60450: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codebuild'] = {}; AWS.CodeBuild = Service.defineService('codebuild', ['2016-10-06']); Object.defineProperty(apiLoader.services['codebuild'], '2016-10-06', { get: function get() { var model = __webpack_require__(32310); model.paginators = __webpack_require__(10589)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeBuild; /***/ }), /***/ 71323: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codecommit'] = {}; AWS.CodeCommit = Service.defineService('codecommit', ['2015-04-13']); Object.defineProperty(apiLoader.services['codecommit'], '2015-04-13', { get: function get() { var model = __webpack_require__(2091); model.paginators = __webpack_require__(11742)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeCommit; /***/ }), /***/ 54599: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codedeploy'] = {}; AWS.CodeDeploy = Service.defineService('codedeploy', ['2014-10-06']); Object.defineProperty(apiLoader.services['codedeploy'], '2014-10-06', { get: function get() { var model = __webpack_require__(33531); model.paginators = __webpack_require__(63203)/* .pagination */ .o; model.waiters = __webpack_require__(56338)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeDeploy; /***/ }), /***/ 65704: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codeguruprofiler'] = {}; AWS.CodeGuruProfiler = Service.defineService('codeguruprofiler', ['2019-07-18']); Object.defineProperty(apiLoader.services['codeguruprofiler'], '2019-07-18', { get: function get() { var model = __webpack_require__(55790); model.paginators = __webpack_require__(14789)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeGuruProfiler; /***/ }), /***/ 60070: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codegurureviewer'] = {}; AWS.CodeGuruReviewer = Service.defineService('codegurureviewer', ['2019-09-19']); Object.defineProperty(apiLoader.services['codegurureviewer'], '2019-09-19', { get: function get() { var model = __webpack_require__(16420); model.paginators = __webpack_require__(89571)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeGuruReviewer; /***/ }), /***/ 22938: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codepipeline'] = {}; AWS.CodePipeline = Service.defineService('codepipeline', ['2015-07-09']); Object.defineProperty(apiLoader.services['codepipeline'], '2015-07-09', { get: function get() { var model = __webpack_require__(92486); model.paginators = __webpack_require__(38160)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodePipeline; /***/ }), /***/ 98336: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codestar'] = {}; AWS.CodeStar = Service.defineService('codestar', ['2017-04-19']); Object.defineProperty(apiLoader.services['codestar'], '2017-04-19', { get: function get() { var model = __webpack_require__(71626); model.paginators = __webpack_require__(78653)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeStar; /***/ }), /***/ 78270: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codestarconnections'] = {}; AWS.CodeStarconnections = Service.defineService('codestarconnections', ['2019-12-01']); Object.defineProperty(apiLoader.services['codestarconnections'], '2019-12-01', { get: function get() { var model = __webpack_require__(81568); model.paginators = __webpack_require__(7656)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeStarconnections; /***/ }), /***/ 15141: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['codestarnotifications'] = {}; AWS.CodeStarNotifications = Service.defineService('codestarnotifications', ['2019-10-15']); Object.defineProperty(apiLoader.services['codestarnotifications'], '2019-10-15', { get: function get() { var model = __webpack_require__(41964); model.paginators = __webpack_require__(5741)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CodeStarNotifications; /***/ }), /***/ 58291: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cognitoidentity'] = {}; AWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']); Object.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', { get: function get() { var model = __webpack_require__(26102); model.paginators = __webpack_require__(80796)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CognitoIdentity; /***/ }), /***/ 31379: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cognitoidentityserviceprovider'] = {}; AWS.CognitoIdentityServiceProvider = Service.defineService('cognitoidentityserviceprovider', ['2016-04-18']); Object.defineProperty(apiLoader.services['cognitoidentityserviceprovider'], '2016-04-18', { get: function get() { var model = __webpack_require__(60923); model.paginators = __webpack_require__(32568)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CognitoIdentityServiceProvider; /***/ }), /***/ 74770: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cognitosync'] = {}; AWS.CognitoSync = Service.defineService('cognitosync', ['2014-06-30']); Object.defineProperty(apiLoader.services['cognitosync'], '2014-06-30', { get: function get() { var model = __webpack_require__(91406); model.paginators = __webpack_require__(23418)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CognitoSync; /***/ }), /***/ 62878: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['comprehend'] = {}; AWS.Comprehend = Service.defineService('comprehend', ['2017-11-27']); Object.defineProperty(apiLoader.services['comprehend'], '2017-11-27', { get: function get() { var model = __webpack_require__(71004); model.paginators = __webpack_require__(70341)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Comprehend; /***/ }), /***/ 32349: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['comprehendmedical'] = {}; AWS.ComprehendMedical = Service.defineService('comprehendmedical', ['2018-10-30']); Object.defineProperty(apiLoader.services['comprehendmedical'], '2018-10-30', { get: function get() { var model = __webpack_require__(65085); model.paginators = __webpack_require__(89772)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ComprehendMedical; /***/ }), /***/ 64459: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['computeoptimizer'] = {}; AWS.ComputeOptimizer = Service.defineService('computeoptimizer', ['2019-11-01']); Object.defineProperty(apiLoader.services['computeoptimizer'], '2019-11-01', { get: function get() { var model = __webpack_require__(559); model.paginators = __webpack_require__(16060)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ComputeOptimizer; /***/ }), /***/ 34061: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['configservice'] = {}; AWS.ConfigService = Service.defineService('configservice', ['2014-11-12']); Object.defineProperty(apiLoader.services['configservice'], '2014-11-12', { get: function get() { var model = __webpack_require__(85031); model.paginators = __webpack_require__(55050)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ConfigService; /***/ }), /***/ 13879: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['connect'] = {}; AWS.Connect = Service.defineService('connect', ['2017-08-08']); Object.defineProperty(apiLoader.services['connect'], '2017-08-08', { get: function get() { var model = __webpack_require__(13649); model.paginators = __webpack_require__(35649)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Connect; /***/ }), /***/ 41847: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['connectcontactlens'] = {}; AWS.ConnectContactLens = Service.defineService('connectcontactlens', ['2020-08-21']); Object.defineProperty(apiLoader.services['connectcontactlens'], '2020-08-21', { get: function get() { var model = __webpack_require__(86739); model.paginators = __webpack_require__(49692)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ConnectContactLens; /***/ }), /***/ 94198: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['connectparticipant'] = {}; AWS.ConnectParticipant = Service.defineService('connectparticipant', ['2018-09-07']); Object.defineProperty(apiLoader.services['connectparticipant'], '2018-09-07', { get: function get() { var model = __webpack_require__(46788); model.paginators = __webpack_require__(2813)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ConnectParticipant; /***/ }), /***/ 79523: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['costexplorer'] = {}; AWS.CostExplorer = Service.defineService('costexplorer', ['2017-10-25']); Object.defineProperty(apiLoader.services['costexplorer'], '2017-10-25', { get: function get() { var model = __webpack_require__(86565); model.paginators = __webpack_require__(94382)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CostExplorer; /***/ }), /***/ 5026: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['cur'] = {}; AWS.CUR = Service.defineService('cur', ['2017-01-06']); Object.defineProperty(apiLoader.services['cur'], '2017-01-06', { get: function get() { var model = __webpack_require__(4138); model.paginators = __webpack_require__(29271)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CUR; /***/ }), /***/ 28379: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['customerprofiles'] = {}; AWS.CustomerProfiles = Service.defineService('customerprofiles', ['2020-08-15']); Object.defineProperty(apiLoader.services['customerprofiles'], '2020-08-15', { get: function get() { var model = __webpack_require__(39734); model.paginators = __webpack_require__(35003)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.CustomerProfiles; /***/ }), /***/ 35846: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['databrew'] = {}; AWS.DataBrew = Service.defineService('databrew', ['2017-07-25']); Object.defineProperty(apiLoader.services['databrew'], '2017-07-25', { get: function get() { var model = __webpack_require__(42529); model.paginators = __webpack_require__(91224)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DataBrew; /***/ }), /***/ 11024: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dataexchange'] = {}; AWS.DataExchange = Service.defineService('dataexchange', ['2017-07-25']); Object.defineProperty(apiLoader.services['dataexchange'], '2017-07-25', { get: function get() { var model = __webpack_require__(25676); model.paginators = __webpack_require__(44399)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DataExchange; /***/ }), /***/ 65688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['datapipeline'] = {}; AWS.DataPipeline = Service.defineService('datapipeline', ['2012-10-29']); Object.defineProperty(apiLoader.services['datapipeline'], '2012-10-29', { get: function get() { var model = __webpack_require__(9547); model.paginators = __webpack_require__(48471)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DataPipeline; /***/ }), /***/ 15472: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['datasync'] = {}; AWS.DataSync = Service.defineService('datasync', ['2018-11-09']); Object.defineProperty(apiLoader.services['datasync'], '2018-11-09', { get: function get() { var model = __webpack_require__(37374); model.paginators = __webpack_require__(18448)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DataSync; /***/ }), /***/ 71398: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dax'] = {}; AWS.DAX = Service.defineService('dax', ['2017-04-19']); Object.defineProperty(apiLoader.services['dax'], '2017-04-19', { get: function get() { var model = __webpack_require__(97287); model.paginators = __webpack_require__(15791)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DAX; /***/ }), /***/ 60674: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['detective'] = {}; AWS.Detective = Service.defineService('detective', ['2018-10-26']); Object.defineProperty(apiLoader.services['detective'], '2018-10-26', { get: function get() { var model = __webpack_require__(38107); model.paginators = __webpack_require__(26554)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Detective; /***/ }), /***/ 26272: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['devicefarm'] = {}; AWS.DeviceFarm = Service.defineService('devicefarm', ['2015-06-23']); Object.defineProperty(apiLoader.services['devicefarm'], '2015-06-23', { get: function get() { var model = __webpack_require__(87206); model.paginators = __webpack_require__(85524)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DeviceFarm; /***/ }), /***/ 90673: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['devopsguru'] = {}; AWS.DevOpsGuru = Service.defineService('devopsguru', ['2020-12-01']); Object.defineProperty(apiLoader.services['devopsguru'], '2020-12-01', { get: function get() { var model = __webpack_require__(82176); model.paginators = __webpack_require__(91556)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DevOpsGuru; /***/ }), /***/ 73783: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['directconnect'] = {}; AWS.DirectConnect = Service.defineService('directconnect', ['2012-10-25']); Object.defineProperty(apiLoader.services['directconnect'], '2012-10-25', { get: function get() { var model = __webpack_require__(49177); model.paginators = __webpack_require__(57373)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DirectConnect; /***/ }), /***/ 83908: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['directoryservice'] = {}; AWS.DirectoryService = Service.defineService('directoryservice', ['2015-04-16']); Object.defineProperty(apiLoader.services['directoryservice'], '2015-04-16', { get: function get() { var model = __webpack_require__(3174); model.paginators = __webpack_require__(1714)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DirectoryService; /***/ }), /***/ 81690: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['discovery'] = {}; AWS.Discovery = Service.defineService('discovery', ['2015-11-01']); Object.defineProperty(apiLoader.services['discovery'], '2015-11-01', { get: function get() { var model = __webpack_require__(32400); model.paginators = __webpack_require__(54052)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Discovery; /***/ }), /***/ 24958: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dlm'] = {}; AWS.DLM = Service.defineService('dlm', ['2018-01-12']); Object.defineProperty(apiLoader.services['dlm'], '2018-01-12', { get: function get() { var model = __webpack_require__(19210); model.paginators = __webpack_require__(69943)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DLM; /***/ }), /***/ 69868: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dms'] = {}; AWS.DMS = Service.defineService('dms', ['2016-01-01']); Object.defineProperty(apiLoader.services['dms'], '2016-01-01', { get: function get() { var model = __webpack_require__(85765); model.paginators = __webpack_require__(170)/* .pagination */ .o; model.waiters = __webpack_require__(31491)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DMS; /***/ }), /***/ 55129: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['docdb'] = {}; AWS.DocDB = Service.defineService('docdb', ['2014-10-31']); __webpack_require__(59050); Object.defineProperty(apiLoader.services['docdb'], '2014-10-31', { get: function get() { var model = __webpack_require__(78804); model.paginators = __webpack_require__(97929)/* .pagination */ .o; model.waiters = __webpack_require__(61159)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DocDB; /***/ }), /***/ 14347: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dynamodb'] = {}; AWS.DynamoDB = Service.defineService('dynamodb', ['2011-12-05', '2012-08-10']); __webpack_require__(17101); Object.defineProperty(apiLoader.services['dynamodb'], '2011-12-05', { get: function get() { var model = __webpack_require__(59225); model.paginators = __webpack_require__(30867)/* .pagination */ .o; model.waiters = __webpack_require__(15606)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['dynamodb'], '2012-08-10', { get: function get() { var model = __webpack_require__(10198); model.paginators = __webpack_require__(79199)/* .pagination */ .o; model.waiters = __webpack_require__(13814)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DynamoDB; /***/ }), /***/ 88090: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['dynamodbstreams'] = {}; AWS.DynamoDBStreams = Service.defineService('dynamodbstreams', ['2012-08-10']); Object.defineProperty(apiLoader.services['dynamodbstreams'], '2012-08-10', { get: function get() { var model = __webpack_require__(69705); model.paginators = __webpack_require__(18467)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.DynamoDBStreams; /***/ }), /***/ 62837: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ebs'] = {}; AWS.EBS = Service.defineService('ebs', ['2019-11-02']); Object.defineProperty(apiLoader.services['ebs'], '2019-11-02', { get: function get() { var model = __webpack_require__(67263); model.paginators = __webpack_require__(94934)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EBS; /***/ }), /***/ 7778: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ec2'] = {}; AWS.EC2 = Service.defineService('ec2', ['2013-06-15*', '2013-10-15*', '2014-02-01*', '2014-05-01*', '2014-06-15*', '2014-09-01*', '2014-10-01*', '2015-03-01*', '2015-04-15*', '2015-10-01*', '2016-04-01*', '2016-09-15*', '2016-11-15']); __webpack_require__(92501); Object.defineProperty(apiLoader.services['ec2'], '2016-11-15', { get: function get() { var model = __webpack_require__(8893); model.paginators = __webpack_require__(32127)/* .pagination */ .o; model.waiters = __webpack_require__(90157)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EC2; /***/ }), /***/ 92209: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ec2instanceconnect'] = {}; AWS.EC2InstanceConnect = Service.defineService('ec2instanceconnect', ['2018-04-02']); Object.defineProperty(apiLoader.services['ec2instanceconnect'], '2018-04-02', { get: function get() { var model = __webpack_require__(14703); model.paginators = __webpack_require__(73353)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EC2InstanceConnect; /***/ }), /***/ 15211: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ecr'] = {}; AWS.ECR = Service.defineService('ecr', ['2015-09-21']); Object.defineProperty(apiLoader.services['ecr'], '2015-09-21', { get: function get() { var model = __webpack_require__(80948); model.paginators = __webpack_require__(66855)/* .pagination */ .o; model.waiters = __webpack_require__(69800)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ECR; /***/ }), /***/ 90244: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ecrpublic'] = {}; AWS.ECRPUBLIC = Service.defineService('ecrpublic', ['2020-10-30']); Object.defineProperty(apiLoader.services['ecrpublic'], '2020-10-30', { get: function get() { var model = __webpack_require__(82416); model.paginators = __webpack_require__(41518)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ECRPUBLIC; /***/ }), /***/ 16615: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ecs'] = {}; AWS.ECS = Service.defineService('ecs', ['2014-11-13']); Object.defineProperty(apiLoader.services['ecs'], '2014-11-13', { get: function get() { var model = __webpack_require__(68155); model.paginators = __webpack_require__(33629)/* .pagination */ .o; model.waiters = __webpack_require__(54199)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ECS; /***/ }), /***/ 34375: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['efs'] = {}; AWS.EFS = Service.defineService('efs', ['2015-02-01']); Object.defineProperty(apiLoader.services['efs'], '2015-02-01', { get: function get() { var model = __webpack_require__(54989); model.paginators = __webpack_require__(73750)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EFS; /***/ }), /***/ 23337: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['eks'] = {}; AWS.EKS = Service.defineService('eks', ['2017-11-01']); Object.defineProperty(apiLoader.services['eks'], '2017-11-01', { get: function get() { var model = __webpack_require__(7766); model.paginators = __webpack_require__(17233)/* .pagination */ .o; model.waiters = __webpack_require__(11545)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EKS; /***/ }), /***/ 81065: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elasticache'] = {}; AWS.ElastiCache = Service.defineService('elasticache', ['2012-11-15*', '2014-03-24*', '2014-07-15*', '2014-09-30*', '2015-02-02']); Object.defineProperty(apiLoader.services['elasticache'], '2015-02-02', { get: function get() { var model = __webpack_require__(78248); model.paginators = __webpack_require__(47954)/* .pagination */ .o; model.waiters = __webpack_require__(35402)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ElastiCache; /***/ }), /***/ 14897: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elasticbeanstalk'] = {}; AWS.ElasticBeanstalk = Service.defineService('elasticbeanstalk', ['2010-12-01']); Object.defineProperty(apiLoader.services['elasticbeanstalk'], '2010-12-01', { get: function get() { var model = __webpack_require__(26770); model.paginators = __webpack_require__(14282)/* .pagination */ .o; model.waiters = __webpack_require__(125)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ElasticBeanstalk; /***/ }), /***/ 37708: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elasticinference'] = {}; AWS.ElasticInference = Service.defineService('elasticinference', ['2017-07-25']); Object.defineProperty(apiLoader.services['elasticinference'], '2017-07-25', { get: function get() { var model = __webpack_require__(76263); model.paginators = __webpack_require__(73815)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ElasticInference; /***/ }), /***/ 40745: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elastictranscoder'] = {}; AWS.ElasticTranscoder = Service.defineService('elastictranscoder', ['2012-09-25']); Object.defineProperty(apiLoader.services['elastictranscoder'], '2012-09-25', { get: function get() { var model = __webpack_require__(45610); model.paginators = __webpack_require__(35370)/* .pagination */ .o; model.waiters = __webpack_require__(13314)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ElasticTranscoder; /***/ }), /***/ 10907: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elb'] = {}; AWS.ELB = Service.defineService('elb', ['2012-06-01']); Object.defineProperty(apiLoader.services['elb'], '2012-06-01', { get: function get() { var model = __webpack_require__(16234); model.paginators = __webpack_require__(87921)/* .pagination */ .o; model.waiters = __webpack_require__(41073)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ELB; /***/ }), /***/ 44311: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['elbv2'] = {}; AWS.ELBv2 = Service.defineService('elbv2', ['2015-12-01']); Object.defineProperty(apiLoader.services['elbv2'], '2015-12-01', { get: function get() { var model = __webpack_require__(95067); model.paginators = __webpack_require__(49154)/* .pagination */ .o; model.waiters = __webpack_require__(14244)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ELBv2; /***/ }), /***/ 50470: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['emr'] = {}; AWS.EMR = Service.defineService('emr', ['2009-03-31']); Object.defineProperty(apiLoader.services['emr'], '2009-03-31', { get: function get() { var model = __webpack_require__(61812); model.paginators = __webpack_require__(45852)/* .pagination */ .o; model.waiters = __webpack_require__(70234)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EMR; /***/ }), /***/ 49984: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['emrcontainers'] = {}; AWS.EMRcontainers = Service.defineService('emrcontainers', ['2020-10-01']); Object.defineProperty(apiLoader.services['emrcontainers'], '2020-10-01', { get: function get() { var model = __webpack_require__(96210); model.paginators = __webpack_require__(83173)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EMRcontainers; /***/ }), /***/ 84462: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['es'] = {}; AWS.ES = Service.defineService('es', ['2015-01-01']); Object.defineProperty(apiLoader.services['es'], '2015-01-01', { get: function get() { var model = __webpack_require__(69235); model.paginators = __webpack_require__(5589)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ES; /***/ }), /***/ 898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['eventbridge'] = {}; AWS.EventBridge = Service.defineService('eventbridge', ['2015-10-07']); Object.defineProperty(apiLoader.services['eventbridge'], '2015-10-07', { get: function get() { var model = __webpack_require__(16181); model.paginators = __webpack_require__(41745)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.EventBridge; /***/ }), /***/ 92831: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['firehose'] = {}; AWS.Firehose = Service.defineService('firehose', ['2015-08-04']); Object.defineProperty(apiLoader.services['firehose'], '2015-08-04', { get: function get() { var model = __webpack_require__(53370); model.paginators = __webpack_require__(16459)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Firehose; /***/ }), /***/ 73003: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['fis'] = {}; AWS.Fis = Service.defineService('fis', ['2020-12-01']); Object.defineProperty(apiLoader.services['fis'], '2020-12-01', { get: function get() { var model = __webpack_require__(75416); model.paginators = __webpack_require__(703)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Fis; /***/ }), /***/ 11316: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['fms'] = {}; AWS.FMS = Service.defineService('fms', ['2018-01-01']); Object.defineProperty(apiLoader.services['fms'], '2018-01-01', { get: function get() { var model = __webpack_require__(86359); model.paginators = __webpack_require__(47569)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.FMS; /***/ }), /***/ 36822: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['forecastqueryservice'] = {}; AWS.ForecastQueryService = Service.defineService('forecastqueryservice', ['2018-06-26']); Object.defineProperty(apiLoader.services['forecastqueryservice'], '2018-06-26', { get: function get() { var model = __webpack_require__(6430); model.paginators = __webpack_require__(30372)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ForecastQueryService; /***/ }), /***/ 12942: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['forecastservice'] = {}; AWS.ForecastService = Service.defineService('forecastservice', ['2018-06-26']); Object.defineProperty(apiLoader.services['forecastservice'], '2018-06-26', { get: function get() { var model = __webpack_require__(55586); model.paginators = __webpack_require__(83052)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ForecastService; /***/ }), /***/ 99830: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['frauddetector'] = {}; AWS.FraudDetector = Service.defineService('frauddetector', ['2019-11-15']); Object.defineProperty(apiLoader.services['frauddetector'], '2019-11-15', { get: function get() { var model = __webpack_require__(93807); model.paginators = __webpack_require__(32681)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.FraudDetector; /***/ }), /***/ 60642: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['fsx'] = {}; AWS.FSx = Service.defineService('fsx', ['2018-03-01']); Object.defineProperty(apiLoader.services['fsx'], '2018-03-01', { get: function get() { var model = __webpack_require__(85233); model.paginators = __webpack_require__(8719)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.FSx; /***/ }), /***/ 8085: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['gamelift'] = {}; AWS.GameLift = Service.defineService('gamelift', ['2015-10-01']); Object.defineProperty(apiLoader.services['gamelift'], '2015-10-01', { get: function get() { var model = __webpack_require__(71658); model.paginators = __webpack_require__(32274)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GameLift; /***/ }), /***/ 63249: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['glacier'] = {}; AWS.Glacier = Service.defineService('glacier', ['2012-06-01']); __webpack_require__(14472); Object.defineProperty(apiLoader.services['glacier'], '2012-06-01', { get: function get() { var model = __webpack_require__(47563); model.paginators = __webpack_require__(77100)/* .pagination */ .o; model.waiters = __webpack_require__(81219)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Glacier; /***/ }), /***/ 19306: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['globalaccelerator'] = {}; AWS.GlobalAccelerator = Service.defineService('globalaccelerator', ['2018-08-08']); Object.defineProperty(apiLoader.services['globalaccelerator'], '2018-08-08', { get: function get() { var model = __webpack_require__(5157); model.paginators = __webpack_require__(9696)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GlobalAccelerator; /***/ }), /***/ 31658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['glue'] = {}; AWS.Glue = Service.defineService('glue', ['2017-03-31']); Object.defineProperty(apiLoader.services['glue'], '2017-03-31', { get: function get() { var model = __webpack_require__(91789); model.paginators = __webpack_require__(14005)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Glue; /***/ }), /***/ 20690: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['greengrass'] = {}; AWS.Greengrass = Service.defineService('greengrass', ['2017-06-07']); Object.defineProperty(apiLoader.services['greengrass'], '2017-06-07', { get: function get() { var model = __webpack_require__(25031); return model; }, enumerable: true, configurable: true }); module.exports = AWS.Greengrass; /***/ }), /***/ 45126: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['greengrassv2'] = {}; AWS.GreengrassV2 = Service.defineService('greengrassv2', ['2020-11-30']); Object.defineProperty(apiLoader.services['greengrassv2'], '2020-11-30', { get: function get() { var model = __webpack_require__(22710); model.paginators = __webpack_require__(94180)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GreengrassV2; /***/ }), /***/ 80494: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['groundstation'] = {}; AWS.GroundStation = Service.defineService('groundstation', ['2019-05-23']); Object.defineProperty(apiLoader.services['groundstation'], '2019-05-23', { get: function get() { var model = __webpack_require__(78309); model.paginators = __webpack_require__(76938)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GroundStation; /***/ }), /***/ 40755: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['guardduty'] = {}; AWS.GuardDuty = Service.defineService('guardduty', ['2017-11-28']); Object.defineProperty(apiLoader.services['guardduty'], '2017-11-28', { get: function get() { var model = __webpack_require__(89297); model.paginators = __webpack_require__(69484)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.GuardDuty; /***/ }), /***/ 21834: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['health'] = {}; AWS.Health = Service.defineService('health', ['2016-08-04']); Object.defineProperty(apiLoader.services['health'], '2016-08-04', { get: function get() { var model = __webpack_require__(48698); model.paginators = __webpack_require__(87844)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Health; /***/ }), /***/ 64254: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['healthlake'] = {}; AWS.HealthLake = Service.defineService('healthlake', ['2017-07-01']); Object.defineProperty(apiLoader.services['healthlake'], '2017-07-01', { get: function get() { var model = __webpack_require__(78700); model.paginators = __webpack_require__(31590)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.HealthLake; /***/ }), /***/ 38889: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['honeycode'] = {}; AWS.Honeycode = Service.defineService('honeycode', ['2020-03-01']); Object.defineProperty(apiLoader.services['honeycode'], '2020-03-01', { get: function get() { var model = __webpack_require__(77536); model.paginators = __webpack_require__(83349)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Honeycode; /***/ }), /***/ 50058: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iam'] = {}; AWS.IAM = Service.defineService('iam', ['2010-05-08']); Object.defineProperty(apiLoader.services['iam'], '2010-05-08', { get: function get() { var model = __webpack_require__(46818); model.paginators = __webpack_require__(49015)/* .pagination */ .o; model.waiters = __webpack_require__(48986)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IAM; /***/ }), /***/ 60222: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['identitystore'] = {}; AWS.IdentityStore = Service.defineService('identitystore', ['2020-06-15']); Object.defineProperty(apiLoader.services['identitystore'], '2020-06-15', { get: function get() { var model = __webpack_require__(14536); model.paginators = __webpack_require__(96554)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IdentityStore; /***/ }), /***/ 57511: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['imagebuilder'] = {}; AWS.Imagebuilder = Service.defineService('imagebuilder', ['2019-12-02']); Object.defineProperty(apiLoader.services['imagebuilder'], '2019-12-02', { get: function get() { var model = __webpack_require__(79595); model.paginators = __webpack_require__(57060)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Imagebuilder; /***/ }), /***/ 6769: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['importexport'] = {}; AWS.ImportExport = Service.defineService('importexport', ['2010-06-01']); Object.defineProperty(apiLoader.services['importexport'], '2010-06-01', { get: function get() { var model = __webpack_require__(85415); model.paginators = __webpack_require__(60069)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ImportExport; /***/ }), /***/ 89439: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['inspector'] = {}; AWS.Inspector = Service.defineService('inspector', ['2015-08-18*', '2016-02-16']); Object.defineProperty(apiLoader.services['inspector'], '2016-02-16', { get: function get() { var model = __webpack_require__(92652); model.paginators = __webpack_require__(98432)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Inspector; /***/ }), /***/ 98392: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iot'] = {}; AWS.Iot = Service.defineService('iot', ['2015-05-28']); Object.defineProperty(apiLoader.services['iot'], '2015-05-28', { get: function get() { var model = __webpack_require__(47091); model.paginators = __webpack_require__(39946)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Iot; /***/ }), /***/ 39474: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iot1clickdevicesservice'] = {}; AWS.IoT1ClickDevicesService = Service.defineService('iot1clickdevicesservice', ['2018-05-14']); Object.defineProperty(apiLoader.services['iot1clickdevicesservice'], '2018-05-14', { get: function get() { var model = __webpack_require__(69668); return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoT1ClickDevicesService; /***/ }), /***/ 4686: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iot1clickprojects'] = {}; AWS.IoT1ClickProjects = Service.defineService('iot1clickprojects', ['2018-05-14']); Object.defineProperty(apiLoader.services['iot1clickprojects'], '2018-05-14', { get: function get() { var model = __webpack_require__(66389); model.paginators = __webpack_require__(42078)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoT1ClickProjects; /***/ }), /***/ 67409: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotanalytics'] = {}; AWS.IoTAnalytics = Service.defineService('iotanalytics', ['2017-11-27']); Object.defineProperty(apiLoader.services['iotanalytics'], '2017-11-27', { get: function get() { var model = __webpack_require__(87696); model.paginators = __webpack_require__(58536)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTAnalytics; /***/ }), /***/ 6564: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotdata'] = {}; AWS.IotData = Service.defineService('iotdata', ['2015-05-28']); __webpack_require__(27062); Object.defineProperty(apiLoader.services['iotdata'], '2015-05-28', { get: function get() { var model = __webpack_require__(94126); model.paginators = __webpack_require__(6435)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IotData; /***/ }), /***/ 97569: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotdeviceadvisor'] = {}; AWS.IotDeviceAdvisor = Service.defineService('iotdeviceadvisor', ['2020-09-18']); Object.defineProperty(apiLoader.services['iotdeviceadvisor'], '2020-09-18', { get: function get() { var model = __webpack_require__(19317); model.paginators = __webpack_require__(9465)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IotDeviceAdvisor; /***/ }), /***/ 88065: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotevents'] = {}; AWS.IoTEvents = Service.defineService('iotevents', ['2018-07-27']); Object.defineProperty(apiLoader.services['iotevents'], '2018-07-27', { get: function get() { var model = __webpack_require__(55666); model.paginators = __webpack_require__(13523)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTEvents; /***/ }), /***/ 56973: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ioteventsdata'] = {}; AWS.IoTEventsData = Service.defineService('ioteventsdata', ['2018-10-23']); Object.defineProperty(apiLoader.services['ioteventsdata'], '2018-10-23', { get: function get() { var model = __webpack_require__(14647); model.paginators = __webpack_require__(12541)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTEventsData; /***/ }), /***/ 42513: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotfleethub'] = {}; AWS.IoTFleetHub = Service.defineService('iotfleethub', ['2020-11-03']); Object.defineProperty(apiLoader.services['iotfleethub'], '2020-11-03', { get: function get() { var model = __webpack_require__(53518); model.paginators = __webpack_require__(90350)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTFleetHub; /***/ }), /***/ 42332: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotjobsdataplane'] = {}; AWS.IoTJobsDataPlane = Service.defineService('iotjobsdataplane', ['2017-09-29']); Object.defineProperty(apiLoader.services['iotjobsdataplane'], '2017-09-29', { get: function get() { var model = __webpack_require__(27052); model.paginators = __webpack_require__(87653)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTJobsDataPlane; /***/ }), /***/ 98562: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotsecuretunneling'] = {}; AWS.IoTSecureTunneling = Service.defineService('iotsecuretunneling', ['2018-10-05']); Object.defineProperty(apiLoader.services['iotsecuretunneling'], '2018-10-05', { get: function get() { var model = __webpack_require__(47810); model.paginators = __webpack_require__(16978)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTSecureTunneling; /***/ }), /***/ 89690: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotsitewise'] = {}; AWS.IoTSiteWise = Service.defineService('iotsitewise', ['2019-12-02']); Object.defineProperty(apiLoader.services['iotsitewise'], '2019-12-02', { get: function get() { var model = __webpack_require__(94166); model.paginators = __webpack_require__(81755)/* .pagination */ .o; model.waiters = __webpack_require__(4197)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTSiteWise; /***/ }), /***/ 58905: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotthingsgraph'] = {}; AWS.IoTThingsGraph = Service.defineService('iotthingsgraph', ['2018-09-06']); Object.defineProperty(apiLoader.services['iotthingsgraph'], '2018-09-06', { get: function get() { var model = __webpack_require__(6038); model.paginators = __webpack_require__(91296)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTThingsGraph; /***/ }), /***/ 8226: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['iotwireless'] = {}; AWS.IoTWireless = Service.defineService('iotwireless', ['2020-11-22']); Object.defineProperty(apiLoader.services['iotwireless'], '2020-11-22', { get: function get() { var model = __webpack_require__(44396); model.paginators = __webpack_require__(31164)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IoTWireless; /***/ }), /***/ 67701: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ivs'] = {}; AWS.IVS = Service.defineService('ivs', ['2020-07-14']); Object.defineProperty(apiLoader.services['ivs'], '2020-07-14', { get: function get() { var model = __webpack_require__(41816); model.paginators = __webpack_require__(38184)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.IVS; /***/ }), /***/ 56775: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kafka'] = {}; AWS.Kafka = Service.defineService('kafka', ['2018-11-14']); Object.defineProperty(apiLoader.services['kafka'], '2018-11-14', { get: function get() { var model = __webpack_require__(52315); model.paginators = __webpack_require__(71066)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Kafka; /***/ }), /***/ 66122: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kendra'] = {}; AWS.Kendra = Service.defineService('kendra', ['2019-02-03']); Object.defineProperty(apiLoader.services['kendra'], '2019-02-03', { get: function get() { var model = __webpack_require__(61785); model.paginators = __webpack_require__(31633)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Kendra; /***/ }), /***/ 49876: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesis'] = {}; AWS.Kinesis = Service.defineService('kinesis', ['2013-12-02']); Object.defineProperty(apiLoader.services['kinesis'], '2013-12-02', { get: function get() { var model = __webpack_require__(74556); model.paginators = __webpack_require__(38540)/* .pagination */ .o; model.waiters = __webpack_require__(80745)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Kinesis; /***/ }), /***/ 90042: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisanalytics'] = {}; AWS.KinesisAnalytics = Service.defineService('kinesisanalytics', ['2015-08-14']); Object.defineProperty(apiLoader.services['kinesisanalytics'], '2015-08-14', { get: function get() { var model = __webpack_require__(91105); model.paginators = __webpack_require__(18363)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisAnalytics; /***/ }), /***/ 74631: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisanalyticsv2'] = {}; AWS.KinesisAnalyticsV2 = Service.defineService('kinesisanalyticsv2', ['2018-05-23']); Object.defineProperty(apiLoader.services['kinesisanalyticsv2'], '2018-05-23', { get: function get() { var model = __webpack_require__(70128); model.paginators = __webpack_require__(6842)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisAnalyticsV2; /***/ }), /***/ 89927: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisvideo'] = {}; AWS.KinesisVideo = Service.defineService('kinesisvideo', ['2017-09-30']); Object.defineProperty(apiLoader.services['kinesisvideo'], '2017-09-30', { get: function get() { var model = __webpack_require__(28189); model.paginators = __webpack_require__(15191)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisVideo; /***/ }), /***/ 5580: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisvideoarchivedmedia'] = {}; AWS.KinesisVideoArchivedMedia = Service.defineService('kinesisvideoarchivedmedia', ['2017-09-30']); Object.defineProperty(apiLoader.services['kinesisvideoarchivedmedia'], '2017-09-30', { get: function get() { var model = __webpack_require__(64288); model.paginators = __webpack_require__(78514)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisVideoArchivedMedia; /***/ }), /***/ 81308: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisvideomedia'] = {}; AWS.KinesisVideoMedia = Service.defineService('kinesisvideomedia', ['2017-09-30']); Object.defineProperty(apiLoader.services['kinesisvideomedia'], '2017-09-30', { get: function get() { var model = __webpack_require__(97818); model.paginators = __webpack_require__(16923)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisVideoMedia; /***/ }), /***/ 12710: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kinesisvideosignalingchannels'] = {}; AWS.KinesisVideoSignalingChannels = Service.defineService('kinesisvideosignalingchannels', ['2019-12-04']); Object.defineProperty(apiLoader.services['kinesisvideosignalingchannels'], '2019-12-04', { get: function get() { var model = __webpack_require__(58849); model.paginators = __webpack_require__(10473)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KinesisVideoSignalingChannels; /***/ }), /***/ 56782: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['kms'] = {}; AWS.KMS = Service.defineService('kms', ['2014-11-01']); Object.defineProperty(apiLoader.services['kms'], '2014-11-01', { get: function get() { var model = __webpack_require__(60611); model.paginators = __webpack_require__(97690)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.KMS; /***/ }), /***/ 6726: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lakeformation'] = {}; AWS.LakeFormation = Service.defineService('lakeformation', ['2017-03-31']); Object.defineProperty(apiLoader.services['lakeformation'], '2017-03-31', { get: function get() { var model = __webpack_require__(65408); model.paginators = __webpack_require__(89923)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LakeFormation; /***/ }), /***/ 13321: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lambda'] = {}; AWS.Lambda = Service.defineService('lambda', ['2014-11-11', '2015-03-31']); __webpack_require__(8452); Object.defineProperty(apiLoader.services['lambda'], '2014-11-11', { get: function get() { var model = __webpack_require__(63935); model.paginators = __webpack_require__(86208)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['lambda'], '2015-03-31', { get: function get() { var model = __webpack_require__(50409); model.paginators = __webpack_require__(98920)/* .pagination */ .o; model.waiters = __webpack_require__(37582)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Lambda; /***/ }), /***/ 37397: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lexmodelbuildingservice'] = {}; AWS.LexModelBuildingService = Service.defineService('lexmodelbuildingservice', ['2017-04-19']); Object.defineProperty(apiLoader.services['lexmodelbuildingservice'], '2017-04-19', { get: function get() { var model = __webpack_require__(57942); model.paginators = __webpack_require__(34148)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LexModelBuildingService; /***/ }), /***/ 27254: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lexmodelsv2'] = {}; AWS.LexModelsV2 = Service.defineService('lexmodelsv2', ['2020-08-07']); __webpack_require__(22922); Object.defineProperty(apiLoader.services['lexmodelsv2'], '2020-08-07', { get: function get() { var model = __webpack_require__(28033); model.paginators = __webpack_require__(20751)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LexModelsV2; /***/ }), /***/ 62716: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lexruntime'] = {}; AWS.LexRuntime = Service.defineService('lexruntime', ['2016-11-28']); Object.defineProperty(apiLoader.services['lexruntime'], '2016-11-28', { get: function get() { var model = __webpack_require__(28098); model.paginators = __webpack_require__(17108)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LexRuntime; /***/ }), /***/ 33855: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lexruntimev2'] = {}; AWS.LexRuntimeV2 = Service.defineService('lexruntimev2', ['2020-08-07']); Object.defineProperty(apiLoader.services['lexruntimev2'], '2020-08-07', { get: function get() { var model = __webpack_require__(72007); model.paginators = __webpack_require__(88199)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LexRuntimeV2; /***/ }), /***/ 34693: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['licensemanager'] = {}; AWS.LicenseManager = Service.defineService('licensemanager', ['2018-08-01']); Object.defineProperty(apiLoader.services['licensemanager'], '2018-08-01', { get: function get() { var model = __webpack_require__(58445); model.paginators = __webpack_require__(73736)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LicenseManager; /***/ }), /***/ 22718: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lightsail'] = {}; AWS.Lightsail = Service.defineService('lightsail', ['2016-11-28']); Object.defineProperty(apiLoader.services['lightsail'], '2016-11-28', { get: function get() { var model = __webpack_require__(59034); model.paginators = __webpack_require__(96768)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Lightsail; /***/ }), /***/ 44594: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['location'] = {}; AWS.Location = Service.defineService('location', ['2020-11-19']); Object.defineProperty(apiLoader.services['location'], '2020-11-19', { get: function get() { var model = __webpack_require__(77371); model.paginators = __webpack_require__(23890)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Location; /***/ }), /***/ 21843: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lookoutequipment'] = {}; AWS.LookoutEquipment = Service.defineService('lookoutequipment', ['2020-12-15']); Object.defineProperty(apiLoader.services['lookoutequipment'], '2020-12-15', { get: function get() { var model = __webpack_require__(31015); model.paginators = __webpack_require__(93065)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LookoutEquipment; /***/ }), /***/ 78708: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lookoutmetrics'] = {}; AWS.LookoutMetrics = Service.defineService('lookoutmetrics', ['2017-07-25']); __webpack_require__(64605); Object.defineProperty(apiLoader.services['lookoutmetrics'], '2017-07-25', { get: function get() { var model = __webpack_require__(99604); model.paginators = __webpack_require__(86272)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LookoutMetrics; /***/ }), /***/ 65046: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['lookoutvision'] = {}; AWS.LookoutVision = Service.defineService('lookoutvision', ['2020-11-20']); Object.defineProperty(apiLoader.services['lookoutvision'], '2020-11-20', { get: function get() { var model = __webpack_require__(43317); model.paginators = __webpack_require__(34273)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.LookoutVision; /***/ }), /***/ 82907: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['machinelearning'] = {}; AWS.MachineLearning = Service.defineService('machinelearning', ['2014-12-12']); __webpack_require__(19174); Object.defineProperty(apiLoader.services['machinelearning'], '2014-12-12', { get: function get() { var model = __webpack_require__(41946); model.paginators = __webpack_require__(11688)/* .pagination */ .o; model.waiters = __webpack_require__(92349)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MachineLearning; /***/ }), /***/ 86427: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['macie'] = {}; AWS.Macie = Service.defineService('macie', ['2017-12-19']); Object.defineProperty(apiLoader.services['macie'], '2017-12-19', { get: function get() { var model = __webpack_require__(27101); model.paginators = __webpack_require__(9057)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Macie; /***/ }), /***/ 57330: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['macie2'] = {}; AWS.Macie2 = Service.defineService('macie2', ['2020-01-01']); Object.defineProperty(apiLoader.services['macie2'], '2020-01-01', { get: function get() { var model = __webpack_require__(27105); model.paginators = __webpack_require__(93284)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Macie2; /***/ }), /***/ 85143: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['managedblockchain'] = {}; AWS.ManagedBlockchain = Service.defineService('managedblockchain', ['2018-09-24']); Object.defineProperty(apiLoader.services['managedblockchain'], '2018-09-24', { get: function get() { var model = __webpack_require__(70690); model.paginators = __webpack_require__(45932)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ManagedBlockchain; /***/ }), /***/ 2609: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['marketplacecatalog'] = {}; AWS.MarketplaceCatalog = Service.defineService('marketplacecatalog', ['2018-09-17']); Object.defineProperty(apiLoader.services['marketplacecatalog'], '2018-09-17', { get: function get() { var model = __webpack_require__(15560); model.paginators = __webpack_require__(23129)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MarketplaceCatalog; /***/ }), /***/ 4540: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['marketplacecommerceanalytics'] = {}; AWS.MarketplaceCommerceAnalytics = Service.defineService('marketplacecommerceanalytics', ['2015-07-01']); Object.defineProperty(apiLoader.services['marketplacecommerceanalytics'], '2015-07-01', { get: function get() { var model = __webpack_require__(30768); model.paginators = __webpack_require__(88266)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MarketplaceCommerceAnalytics; /***/ }), /***/ 53707: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['marketplaceentitlementservice'] = {}; AWS.MarketplaceEntitlementService = Service.defineService('marketplaceentitlementservice', ['2017-01-11']); Object.defineProperty(apiLoader.services['marketplaceentitlementservice'], '2017-01-11', { get: function get() { var model = __webpack_require__(23864); model.paginators = __webpack_require__(98218)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MarketplaceEntitlementService; /***/ }), /***/ 39297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['marketplacemetering'] = {}; AWS.MarketplaceMetering = Service.defineService('marketplacemetering', ['2016-01-14']); Object.defineProperty(apiLoader.services['marketplacemetering'], '2016-01-14', { get: function get() { var model = __webpack_require__(150); model.paginators = __webpack_require__(34742)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MarketplaceMetering; /***/ }), /***/ 67639: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediaconnect'] = {}; AWS.MediaConnect = Service.defineService('mediaconnect', ['2018-11-14']); Object.defineProperty(apiLoader.services['mediaconnect'], '2018-11-14', { get: function get() { var model = __webpack_require__(38828); model.paginators = __webpack_require__(52701)/* .pagination */ .o; model.waiters = __webpack_require__(69547)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaConnect; /***/ }), /***/ 57220: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediaconvert'] = {}; AWS.MediaConvert = Service.defineService('mediaconvert', ['2017-08-29']); Object.defineProperty(apiLoader.services['mediaconvert'], '2017-08-29', { get: function get() { var model = __webpack_require__(95103); model.paginators = __webpack_require__(12236)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaConvert; /***/ }), /***/ 7509: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['medialive'] = {}; AWS.MediaLive = Service.defineService('medialive', ['2017-10-14']); Object.defineProperty(apiLoader.services['medialive'], '2017-10-14', { get: function get() { var model = __webpack_require__(71020); model.paginators = __webpack_require__(45939)/* .pagination */ .o; model.waiters = __webpack_require__(77702)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaLive; /***/ }), /***/ 91620: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediapackage'] = {}; AWS.MediaPackage = Service.defineService('mediapackage', ['2017-10-12']); Object.defineProperty(apiLoader.services['mediapackage'], '2017-10-12', { get: function get() { var model = __webpack_require__(3524); model.paginators = __webpack_require__(28168)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaPackage; /***/ }), /***/ 14962: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediapackagevod'] = {}; AWS.MediaPackageVod = Service.defineService('mediapackagevod', ['2018-11-07']); Object.defineProperty(apiLoader.services['mediapackagevod'], '2018-11-07', { get: function get() { var model = __webpack_require__(62182); model.paginators = __webpack_require__(9108)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaPackageVod; /***/ }), /***/ 83748: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediastore'] = {}; AWS.MediaStore = Service.defineService('mediastore', ['2017-09-01']); Object.defineProperty(apiLoader.services['mediastore'], '2017-09-01', { get: function get() { var model = __webpack_require__(86331); model.paginators = __webpack_require__(85011)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaStore; /***/ }), /***/ 98703: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediastoredata'] = {}; AWS.MediaStoreData = Service.defineService('mediastoredata', ['2017-09-01']); Object.defineProperty(apiLoader.services['mediastoredata'], '2017-09-01', { get: function get() { var model = __webpack_require__(78855); model.paginators = __webpack_require__(12340)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaStoreData; /***/ }), /***/ 99658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mediatailor'] = {}; AWS.MediaTailor = Service.defineService('mediatailor', ['2018-04-23']); Object.defineProperty(apiLoader.services['mediatailor'], '2018-04-23', { get: function get() { var model = __webpack_require__(32863); model.paginators = __webpack_require__(76134)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MediaTailor; /***/ }), /***/ 41339: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mgn'] = {}; AWS.Mgn = Service.defineService('mgn', ['2020-02-26']); Object.defineProperty(apiLoader.services['mgn'], '2020-02-26', { get: function get() { var model = __webpack_require__(96297); model.paginators = __webpack_require__(36566)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Mgn; /***/ }), /***/ 14688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['migrationhub'] = {}; AWS.MigrationHub = Service.defineService('migrationhub', ['2017-05-31']); Object.defineProperty(apiLoader.services['migrationhub'], '2017-05-31', { get: function get() { var model = __webpack_require__(51639); model.paginators = __webpack_require__(63013)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MigrationHub; /***/ }), /***/ 62658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['migrationhubconfig'] = {}; AWS.MigrationHubConfig = Service.defineService('migrationhubconfig', ['2019-06-30']); Object.defineProperty(apiLoader.services['migrationhubconfig'], '2019-06-30', { get: function get() { var model = __webpack_require__(89101); model.paginators = __webpack_require__(59977)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MigrationHubConfig; /***/ }), /***/ 39782: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mobile'] = {}; AWS.Mobile = Service.defineService('mobile', ['2017-07-01']); Object.defineProperty(apiLoader.services['mobile'], '2017-07-01', { get: function get() { var model = __webpack_require__(44027); model.paginators = __webpack_require__(81940)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Mobile; /***/ }), /***/ 66690: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mobileanalytics'] = {}; AWS.MobileAnalytics = Service.defineService('mobileanalytics', ['2014-06-05']); Object.defineProperty(apiLoader.services['mobileanalytics'], '2014-06-05', { get: function get() { var model = __webpack_require__(40634); return model; }, enumerable: true, configurable: true }); module.exports = AWS.MobileAnalytics; /***/ }), /***/ 23093: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mq'] = {}; AWS.MQ = Service.defineService('mq', ['2017-11-27']); Object.defineProperty(apiLoader.services['mq'], '2017-11-27', { get: function get() { var model = __webpack_require__(73219); model.paginators = __webpack_require__(59835)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MQ; /***/ }), /***/ 79954: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mturk'] = {}; AWS.MTurk = Service.defineService('mturk', ['2017-01-17']); Object.defineProperty(apiLoader.services['mturk'], '2017-01-17', { get: function get() { var model = __webpack_require__(55676); model.paginators = __webpack_require__(51396)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MTurk; /***/ }), /***/ 32712: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['mwaa'] = {}; AWS.MWAA = Service.defineService('mwaa', ['2020-07-01']); Object.defineProperty(apiLoader.services['mwaa'], '2020-07-01', { get: function get() { var model = __webpack_require__(3499); model.paginators = __webpack_require__(30606)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.MWAA; /***/ }), /***/ 30047: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['neptune'] = {}; AWS.Neptune = Service.defineService('neptune', ['2014-10-31']); __webpack_require__(73090); Object.defineProperty(apiLoader.services['neptune'], '2014-10-31', { get: function get() { var model = __webpack_require__(44749); model.paginators = __webpack_require__(36058)/* .pagination */ .o; model.waiters = __webpack_require__(83629)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Neptune; /***/ }), /***/ 84626: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['networkfirewall'] = {}; AWS.NetworkFirewall = Service.defineService('networkfirewall', ['2020-11-12']); Object.defineProperty(apiLoader.services['networkfirewall'], '2020-11-12', { get: function get() { var model = __webpack_require__(71930); model.paginators = __webpack_require__(50334)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.NetworkFirewall; /***/ }), /***/ 37610: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['networkmanager'] = {}; AWS.NetworkManager = Service.defineService('networkmanager', ['2019-07-05']); Object.defineProperty(apiLoader.services['networkmanager'], '2019-07-05', { get: function get() { var model = __webpack_require__(11902); model.paginators = __webpack_require__(91477)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.NetworkManager; /***/ }), /***/ 75691: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['opsworks'] = {}; AWS.OpsWorks = Service.defineService('opsworks', ['2013-02-18']); Object.defineProperty(apiLoader.services['opsworks'], '2013-02-18', { get: function get() { var model = __webpack_require__(95315); model.paginators = __webpack_require__(63589)/* .pagination */ .o; model.waiters = __webpack_require__(8700)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.OpsWorks; /***/ }), /***/ 80388: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['opsworkscm'] = {}; AWS.OpsWorksCM = Service.defineService('opsworkscm', ['2016-11-01']); Object.defineProperty(apiLoader.services['opsworkscm'], '2016-11-01', { get: function get() { var model = __webpack_require__(25033); model.paginators = __webpack_require__(68422)/* .pagination */ .o; model.waiters = __webpack_require__(89353)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.OpsWorksCM; /***/ }), /***/ 44670: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['organizations'] = {}; AWS.Organizations = Service.defineService('organizations', ['2016-11-28']); Object.defineProperty(apiLoader.services['organizations'], '2016-11-28', { get: function get() { var model = __webpack_require__(28258); model.paginators = __webpack_require__(70916)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Organizations; /***/ }), /***/ 27551: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['outposts'] = {}; AWS.Outposts = Service.defineService('outposts', ['2019-12-03']); Object.defineProperty(apiLoader.services['outposts'], '2019-12-03', { get: function get() { var model = __webpack_require__(79304); model.paginators = __webpack_require__(91740)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Outposts; /***/ }), /***/ 33696: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['personalize'] = {}; AWS.Personalize = Service.defineService('personalize', ['2018-05-22']); Object.defineProperty(apiLoader.services['personalize'], '2018-05-22', { get: function get() { var model = __webpack_require__(16402); model.paginators = __webpack_require__(76828)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Personalize; /***/ }), /***/ 88170: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['personalizeevents'] = {}; AWS.PersonalizeEvents = Service.defineService('personalizeevents', ['2018-03-22']); Object.defineProperty(apiLoader.services['personalizeevents'], '2018-03-22', { get: function get() { var model = __webpack_require__(8792); model.paginators = __webpack_require__(52110)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.PersonalizeEvents; /***/ }), /***/ 66184: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['personalizeruntime'] = {}; AWS.PersonalizeRuntime = Service.defineService('personalizeruntime', ['2018-05-22']); Object.defineProperty(apiLoader.services['personalizeruntime'], '2018-05-22', { get: function get() { var model = __webpack_require__(86682); model.paginators = __webpack_require__(32049)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.PersonalizeRuntime; /***/ }), /***/ 15505: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pi'] = {}; AWS.PI = Service.defineService('pi', ['2018-02-27']); Object.defineProperty(apiLoader.services['pi'], '2018-02-27', { get: function get() { var model = __webpack_require__(38006); model.paginators = __webpack_require__(75147)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.PI; /***/ }), /***/ 18388: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pinpoint'] = {}; AWS.Pinpoint = Service.defineService('pinpoint', ['2016-12-01']); Object.defineProperty(apiLoader.services['pinpoint'], '2016-12-01', { get: function get() { var model = __webpack_require__(73536); return model; }, enumerable: true, configurable: true }); module.exports = AWS.Pinpoint; /***/ }), /***/ 83060: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pinpointemail'] = {}; AWS.PinpointEmail = Service.defineService('pinpointemail', ['2018-07-26']); Object.defineProperty(apiLoader.services['pinpointemail'], '2018-07-26', { get: function get() { var model = __webpack_require__(42680); model.paginators = __webpack_require__(58107)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.PinpointEmail; /***/ }), /***/ 46605: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pinpointsmsvoice'] = {}; AWS.PinpointSMSVoice = Service.defineService('pinpointsmsvoice', ['2018-09-05']); Object.defineProperty(apiLoader.services['pinpointsmsvoice'], '2018-09-05', { get: function get() { var model = __webpack_require__(6641); return model; }, enumerable: true, configurable: true }); module.exports = AWS.PinpointSMSVoice; /***/ }), /***/ 97332: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['polly'] = {}; AWS.Polly = Service.defineService('polly', ['2016-06-10']); __webpack_require__(53199); Object.defineProperty(apiLoader.services['polly'], '2016-06-10', { get: function get() { var model = __webpack_require__(58020); model.paginators = __webpack_require__(28573)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Polly; /***/ }), /***/ 92765: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['pricing'] = {}; AWS.Pricing = Service.defineService('pricing', ['2017-10-15']); Object.defineProperty(apiLoader.services['pricing'], '2017-10-15', { get: function get() { var model = __webpack_require__(19792); model.paginators = __webpack_require__(45992)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Pricing; /***/ }), /***/ 71266: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['qldb'] = {}; AWS.QLDB = Service.defineService('qldb', ['2019-01-02']); Object.defineProperty(apiLoader.services['qldb'], '2019-01-02', { get: function get() { var model = __webpack_require__(52675); model.paginators = __webpack_require__(4367)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.QLDB; /***/ }), /***/ 55423: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['qldbsession'] = {}; AWS.QLDBSession = Service.defineService('qldbsession', ['2019-07-11']); Object.defineProperty(apiLoader.services['qldbsession'], '2019-07-11', { get: function get() { var model = __webpack_require__(67426); model.paginators = __webpack_require__(96527)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.QLDBSession; /***/ }), /***/ 29898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['quicksight'] = {}; AWS.QuickSight = Service.defineService('quicksight', ['2018-04-01']); Object.defineProperty(apiLoader.services['quicksight'], '2018-04-01', { get: function get() { var model = __webpack_require__(6807); model.paginators = __webpack_require__(81489)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.QuickSight; /***/ }), /***/ 94394: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ram'] = {}; AWS.RAM = Service.defineService('ram', ['2018-01-04']); Object.defineProperty(apiLoader.services['ram'], '2018-01-04', { get: function get() { var model = __webpack_require__(83728); model.paginators = __webpack_require__(83147)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RAM; /***/ }), /***/ 71578: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['rds'] = {}; AWS.RDS = Service.defineService('rds', ['2013-01-10', '2013-02-12', '2013-09-09', '2014-09-01', '2014-09-01*', '2014-10-31']); __webpack_require__(71928); Object.defineProperty(apiLoader.services['rds'], '2013-01-10', { get: function get() { var model = __webpack_require__(56144); model.paginators = __webpack_require__(76660)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['rds'], '2013-02-12', { get: function get() { var model = __webpack_require__(15633); model.paginators = __webpack_require__(37654)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['rds'], '2013-09-09', { get: function get() { var model = __webpack_require__(53439); model.paginators = __webpack_require__(17223)/* .pagination */ .o; model.waiters = __webpack_require__(60967)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['rds'], '2014-09-01', { get: function get() { var model = __webpack_require__(72333); model.paginators = __webpack_require__(86022)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); Object.defineProperty(apiLoader.services['rds'], '2014-10-31', { get: function get() { var model = __webpack_require__(6210); model.paginators = __webpack_require__(60972)/* .pagination */ .o; model.waiters = __webpack_require__(6606)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RDS; /***/ }), /***/ 30147: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['rdsdataservice'] = {}; AWS.RDSDataService = Service.defineService('rdsdataservice', ['2018-08-01']); __webpack_require__(64070); Object.defineProperty(apiLoader.services['rdsdataservice'], '2018-08-01', { get: function get() { var model = __webpack_require__(4983); model.paginators = __webpack_require__(1270)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RDSDataService; /***/ }), /***/ 84853: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['redshift'] = {}; AWS.Redshift = Service.defineService('redshift', ['2012-12-01']); Object.defineProperty(apiLoader.services['redshift'], '2012-12-01', { get: function get() { var model = __webpack_require__(17066); model.paginators = __webpack_require__(7755)/* .pagination */ .o; model.waiters = __webpack_require__(91400)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Redshift; /***/ }), /***/ 203: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['redshiftdata'] = {}; AWS.RedshiftData = Service.defineService('redshiftdata', ['2019-12-20']); Object.defineProperty(apiLoader.services['redshiftdata'], '2019-12-20', { get: function get() { var model = __webpack_require__(34805); model.paginators = __webpack_require__(28484)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RedshiftData; /***/ }), /***/ 65470: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['rekognition'] = {}; AWS.Rekognition = Service.defineService('rekognition', ['2016-06-27']); Object.defineProperty(apiLoader.services['rekognition'], '2016-06-27', { get: function get() { var model = __webpack_require__(65852); model.paginators = __webpack_require__(49860)/* .pagination */ .o; model.waiters = __webpack_require__(19491)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Rekognition; /***/ }), /***/ 58756: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['resourcegroups'] = {}; AWS.ResourceGroups = Service.defineService('resourcegroups', ['2017-11-27']); Object.defineProperty(apiLoader.services['resourcegroups'], '2017-11-27', { get: function get() { var model = __webpack_require__(28629); model.paginators = __webpack_require__(71378)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ResourceGroups; /***/ }), /***/ 7385: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['resourcegroupstaggingapi'] = {}; AWS.ResourceGroupsTaggingAPI = Service.defineService('resourcegroupstaggingapi', ['2017-01-26']); Object.defineProperty(apiLoader.services['resourcegroupstaggingapi'], '2017-01-26', { get: function get() { var model = __webpack_require__(83914); model.paginators = __webpack_require__(64865)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ResourceGroupsTaggingAPI; /***/ }), /***/ 18068: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['robomaker'] = {}; AWS.RoboMaker = Service.defineService('robomaker', ['2018-06-29']); Object.defineProperty(apiLoader.services['robomaker'], '2018-06-29', { get: function get() { var model = __webpack_require__(36854); model.paginators = __webpack_require__(52592)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.RoboMaker; /***/ }), /***/ 44968: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['route53'] = {}; AWS.Route53 = Service.defineService('route53', ['2013-04-01']); __webpack_require__(69627); Object.defineProperty(apiLoader.services['route53'], '2013-04-01', { get: function get() { var model = __webpack_require__(91499); model.paginators = __webpack_require__(54519)/* .pagination */ .o; model.waiters = __webpack_require__(4628)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Route53; /***/ }), /***/ 51994: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['route53domains'] = {}; AWS.Route53Domains = Service.defineService('route53domains', ['2014-05-15']); Object.defineProperty(apiLoader.services['route53domains'], '2014-05-15', { get: function get() { var model = __webpack_require__(6535); model.paginators = __webpack_require__(26777)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Route53Domains; /***/ }), /***/ 25894: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['route53resolver'] = {}; AWS.Route53Resolver = Service.defineService('route53resolver', ['2018-04-01']); Object.defineProperty(apiLoader.services['route53resolver'], '2018-04-01', { get: function get() { var model = __webpack_require__(99309); model.paginators = __webpack_require__(21261)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Route53Resolver; /***/ }), /***/ 83256: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['s3'] = {}; AWS.S3 = Service.defineService('s3', ['2006-03-01']); __webpack_require__(26543); Object.defineProperty(apiLoader.services['s3'], '2006-03-01', { get: function get() { var model = __webpack_require__(32581); model.paginators = __webpack_require__(53175)/* .pagination */ .o; model.waiters = __webpack_require__(44494)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.S3; /***/ }), /***/ 99817: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['s3control'] = {}; AWS.S3Control = Service.defineService('s3control', ['2018-08-20']); __webpack_require__(71207); Object.defineProperty(apiLoader.services['s3control'], '2018-08-20', { get: function get() { var model = __webpack_require__(52092); model.paginators = __webpack_require__(62498)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.S3Control; /***/ }), /***/ 90493: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['s3outposts'] = {}; AWS.S3Outposts = Service.defineService('s3outposts', ['2017-07-25']); Object.defineProperty(apiLoader.services['s3outposts'], '2017-07-25', { get: function get() { var model = __webpack_require__(90331); model.paginators = __webpack_require__(8746)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.S3Outposts; /***/ }), /***/ 77657: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sagemaker'] = {}; AWS.SageMaker = Service.defineService('sagemaker', ['2017-07-24']); Object.defineProperty(apiLoader.services['sagemaker'], '2017-07-24', { get: function get() { var model = __webpack_require__(20227); model.paginators = __webpack_require__(44955)/* .pagination */ .o; model.waiters = __webpack_require__(50026)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SageMaker; /***/ }), /***/ 38966: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sagemakeredge'] = {}; AWS.SagemakerEdge = Service.defineService('sagemakeredge', ['2020-09-23']); Object.defineProperty(apiLoader.services['sagemakeredge'], '2020-09-23', { get: function get() { var model = __webpack_require__(48750); model.paginators = __webpack_require__(2769)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SagemakerEdge; /***/ }), /***/ 67644: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sagemakerfeaturestoreruntime'] = {}; AWS.SageMakerFeatureStoreRuntime = Service.defineService('sagemakerfeaturestoreruntime', ['2020-07-01']); Object.defineProperty(apiLoader.services['sagemakerfeaturestoreruntime'], '2020-07-01', { get: function get() { var model = __webpack_require__(98420); model.paginators = __webpack_require__(45590)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SageMakerFeatureStoreRuntime; /***/ }), /***/ 85044: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sagemakerruntime'] = {}; AWS.SageMakerRuntime = Service.defineService('sagemakerruntime', ['2017-05-13']); Object.defineProperty(apiLoader.services['sagemakerruntime'], '2017-05-13', { get: function get() { var model = __webpack_require__(82783); model.paginators = __webpack_require__(17272)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SageMakerRuntime; /***/ }), /***/ 62825: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['savingsplans'] = {}; AWS.SavingsPlans = Service.defineService('savingsplans', ['2019-06-28']); Object.defineProperty(apiLoader.services['savingsplans'], '2019-06-28', { get: function get() { var model = __webpack_require__(2810); model.paginators = __webpack_require__(56794)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SavingsPlans; /***/ }), /***/ 55713: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['schemas'] = {}; AWS.Schemas = Service.defineService('schemas', ['2019-12-02']); Object.defineProperty(apiLoader.services['schemas'], '2019-12-02', { get: function get() { var model = __webpack_require__(85225); model.paginators = __webpack_require__(50738)/* .pagination */ .o; model.waiters = __webpack_require__(34671)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Schemas; /***/ }), /***/ 85131: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['secretsmanager'] = {}; AWS.SecretsManager = Service.defineService('secretsmanager', ['2017-10-17']); Object.defineProperty(apiLoader.services['secretsmanager'], '2017-10-17', { get: function get() { var model = __webpack_require__(97209); model.paginators = __webpack_require__(38503)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SecretsManager; /***/ }), /***/ 21550: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['securityhub'] = {}; AWS.SecurityHub = Service.defineService('securityhub', ['2018-10-26']); Object.defineProperty(apiLoader.services['securityhub'], '2018-10-26', { get: function get() { var model = __webpack_require__(40359); model.paginators = __webpack_require__(27612)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SecurityHub; /***/ }), /***/ 62402: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['serverlessapplicationrepository'] = {}; AWS.ServerlessApplicationRepository = Service.defineService('serverlessapplicationrepository', ['2017-09-08']); Object.defineProperty(apiLoader.services['serverlessapplicationrepository'], '2017-09-08', { get: function get() { var model = __webpack_require__(8591); model.paginators = __webpack_require__(96164)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServerlessApplicationRepository; /***/ }), /***/ 822: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['servicecatalog'] = {}; AWS.ServiceCatalog = Service.defineService('servicecatalog', ['2015-12-10']); Object.defineProperty(apiLoader.services['servicecatalog'], '2015-12-10', { get: function get() { var model = __webpack_require__(80503); model.paginators = __webpack_require__(71855)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServiceCatalog; /***/ }), /***/ 79068: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['servicecatalogappregistry'] = {}; AWS.ServiceCatalogAppRegistry = Service.defineService('servicecatalogappregistry', ['2020-06-24']); Object.defineProperty(apiLoader.services['servicecatalogappregistry'], '2020-06-24', { get: function get() { var model = __webpack_require__(47635); model.paginators = __webpack_require__(67278)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServiceCatalogAppRegistry; /***/ }), /***/ 91569: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['servicediscovery'] = {}; AWS.ServiceDiscovery = Service.defineService('servicediscovery', ['2017-03-14']); Object.defineProperty(apiLoader.services['servicediscovery'], '2017-03-14', { get: function get() { var model = __webpack_require__(20459); model.paginators = __webpack_require__(19834)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServiceDiscovery; /***/ }), /***/ 57800: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['servicequotas'] = {}; AWS.ServiceQuotas = Service.defineService('servicequotas', ['2019-06-24']); Object.defineProperty(apiLoader.services['servicequotas'], '2019-06-24', { get: function get() { var model = __webpack_require__(14304); model.paginators = __webpack_require__(90635)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.ServiceQuotas; /***/ }), /***/ 46816: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ses'] = {}; AWS.SES = Service.defineService('ses', ['2010-12-01']); Object.defineProperty(apiLoader.services['ses'], '2010-12-01', { get: function get() { var model = __webpack_require__(87825); model.paginators = __webpack_require__(61348)/* .pagination */ .o; model.waiters = __webpack_require__(84476)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SES; /***/ }), /***/ 20142: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sesv2'] = {}; AWS.SESV2 = Service.defineService('sesv2', ['2019-09-27']); Object.defineProperty(apiLoader.services['sesv2'], '2019-09-27', { get: function get() { var model = __webpack_require__(32530); model.paginators = __webpack_require__(39567)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SESV2; /***/ }), /***/ 20271: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['shield'] = {}; AWS.Shield = Service.defineService('shield', ['2016-06-02']); Object.defineProperty(apiLoader.services['shield'], '2016-06-02', { get: function get() { var model = __webpack_require__(78621); model.paginators = __webpack_require__(75743)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Shield; /***/ }), /***/ 71596: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['signer'] = {}; AWS.Signer = Service.defineService('signer', ['2017-08-25']); Object.defineProperty(apiLoader.services['signer'], '2017-08-25', { get: function get() { var model = __webpack_require__(21884); model.paginators = __webpack_require__(69839)/* .pagination */ .o; model.waiters = __webpack_require__(61331)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Signer; /***/ }), /***/ 10120: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['simpledb'] = {}; AWS.SimpleDB = Service.defineService('simpledb', ['2009-04-15']); Object.defineProperty(apiLoader.services['simpledb'], '2009-04-15', { get: function get() { var model = __webpack_require__(96016); model.paginators = __webpack_require__(73820)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SimpleDB; /***/ }), /***/ 57719: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sms'] = {}; AWS.SMS = Service.defineService('sms', ['2016-10-24']); Object.defineProperty(apiLoader.services['sms'], '2016-10-24', { get: function get() { var model = __webpack_require__(51530); model.paginators = __webpack_require__(72874)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SMS; /***/ }), /***/ 510: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['snowball'] = {}; AWS.Snowball = Service.defineService('snowball', ['2016-06-30']); Object.defineProperty(apiLoader.services['snowball'], '2016-06-30', { get: function get() { var model = __webpack_require__(41624); model.paginators = __webpack_require__(14147)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Snowball; /***/ }), /***/ 28581: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sns'] = {}; AWS.SNS = Service.defineService('sns', ['2010-03-31']); Object.defineProperty(apiLoader.services['sns'], '2010-03-31', { get: function get() { var model = __webpack_require__(22671); model.paginators = __webpack_require__(92788)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SNS; /***/ }), /***/ 63172: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sqs'] = {}; AWS.SQS = Service.defineService('sqs', ['2012-11-05']); __webpack_require__(94571); Object.defineProperty(apiLoader.services['sqs'], '2012-11-05', { get: function get() { var model = __webpack_require__(31635); model.paginators = __webpack_require__(48324)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SQS; /***/ }), /***/ 83380: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ssm'] = {}; AWS.SSM = Service.defineService('ssm', ['2014-11-06']); Object.defineProperty(apiLoader.services['ssm'], '2014-11-06', { get: function get() { var model = __webpack_require__(7667); model.paginators = __webpack_require__(84951)/* .pagination */ .o; model.waiters = __webpack_require__(80315)/* .waiters */ .V; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SSM; /***/ }), /***/ 71096: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sso'] = {}; AWS.SSO = Service.defineService('sso', ['2019-06-10']); Object.defineProperty(apiLoader.services['sso'], '2019-06-10', { get: function get() { var model = __webpack_require__(77888); model.paginators = __webpack_require__(18046)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SSO; /***/ }), /***/ 66644: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ssoadmin'] = {}; AWS.SSOAdmin = Service.defineService('ssoadmin', ['2020-07-20']); Object.defineProperty(apiLoader.services['ssoadmin'], '2020-07-20', { get: function get() { var model = __webpack_require__(93165); model.paginators = __webpack_require__(61022)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SSOAdmin; /***/ }), /***/ 49870: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['ssooidc'] = {}; AWS.SSOOIDC = Service.defineService('ssooidc', ['2019-06-10']); Object.defineProperty(apiLoader.services['ssooidc'], '2019-06-10', { get: function get() { var model = __webpack_require__(43979); model.paginators = __webpack_require__(16125)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SSOOIDC; /***/ }), /***/ 8136: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['stepfunctions'] = {}; AWS.StepFunctions = Service.defineService('stepfunctions', ['2016-11-23']); Object.defineProperty(apiLoader.services['stepfunctions'], '2016-11-23', { get: function get() { var model = __webpack_require__(58492); model.paginators = __webpack_require__(95424)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.StepFunctions; /***/ }), /***/ 89190: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['storagegateway'] = {}; AWS.StorageGateway = Service.defineService('storagegateway', ['2013-06-30']); Object.defineProperty(apiLoader.services['storagegateway'], '2013-06-30', { get: function get() { var model = __webpack_require__(33480); model.paginators = __webpack_require__(6062)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.StorageGateway; /***/ }), /***/ 57513: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['sts'] = {}; AWS.STS = Service.defineService('sts', ['2011-06-15']); __webpack_require__(91055); Object.defineProperty(apiLoader.services['sts'], '2011-06-15', { get: function get() { var model = __webpack_require__(18976); model.paginators = __webpack_require__(82952)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.STS; /***/ }), /***/ 1099: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['support'] = {}; AWS.Support = Service.defineService('support', ['2013-04-15']); Object.defineProperty(apiLoader.services['support'], '2013-04-15', { get: function get() { var model = __webpack_require__(77180); model.paginators = __webpack_require__(83878)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Support; /***/ }), /***/ 32327: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['swf'] = {}; AWS.SWF = Service.defineService('swf', ['2012-01-25']); __webpack_require__(31987); Object.defineProperty(apiLoader.services['swf'], '2012-01-25', { get: function get() { var model = __webpack_require__(4974); model.paginators = __webpack_require__(65798)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.SWF; /***/ }), /***/ 25910: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['synthetics'] = {}; AWS.Synthetics = Service.defineService('synthetics', ['2017-10-11']); Object.defineProperty(apiLoader.services['synthetics'], '2017-10-11', { get: function get() { var model = __webpack_require__(82853); model.paginators = __webpack_require__(27742)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Synthetics; /***/ }), /***/ 58523: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['textract'] = {}; AWS.Textract = Service.defineService('textract', ['2018-06-27']); Object.defineProperty(apiLoader.services['textract'], '2018-06-27', { get: function get() { var model = __webpack_require__(66368); model.paginators = __webpack_require__(75909)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Textract; /***/ }), /***/ 24529: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['timestreamquery'] = {}; AWS.TimestreamQuery = Service.defineService('timestreamquery', ['2018-11-01']); Object.defineProperty(apiLoader.services['timestreamquery'], '2018-11-01', { get: function get() { var model = __webpack_require__(27578); model.paginators = __webpack_require__(99094)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.TimestreamQuery; /***/ }), /***/ 1573: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['timestreamwrite'] = {}; AWS.TimestreamWrite = Service.defineService('timestreamwrite', ['2018-11-01']); Object.defineProperty(apiLoader.services['timestreamwrite'], '2018-11-01', { get: function get() { var model = __webpack_require__(79095); model.paginators = __webpack_require__(50262)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.TimestreamWrite; /***/ }), /***/ 75811: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['transcribeservice'] = {}; AWS.TranscribeService = Service.defineService('transcribeservice', ['2017-10-26']); Object.defineProperty(apiLoader.services['transcribeservice'], '2017-10-26', { get: function get() { var model = __webpack_require__(10903); model.paginators = __webpack_require__(92036)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.TranscribeService; /***/ }), /***/ 51585: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['transfer'] = {}; AWS.Transfer = Service.defineService('transfer', ['2018-11-05']); Object.defineProperty(apiLoader.services['transfer'], '2018-11-05', { get: function get() { var model = __webpack_require__(42419); model.paginators = __webpack_require__(70586)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Transfer; /***/ }), /***/ 72544: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['translate'] = {}; AWS.Translate = Service.defineService('translate', ['2017-07-01']); Object.defineProperty(apiLoader.services['translate'], '2017-07-01', { get: function get() { var model = __webpack_require__(12983); model.paginators = __webpack_require__(85886)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.Translate; /***/ }), /***/ 72742: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['waf'] = {}; AWS.WAF = Service.defineService('waf', ['2015-08-24']); Object.defineProperty(apiLoader.services['waf'], '2015-08-24', { get: function get() { var model = __webpack_require__(93997); model.paginators = __webpack_require__(45770)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WAF; /***/ }), /***/ 23153: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['wafregional'] = {}; AWS.WAFRegional = Service.defineService('wafregional', ['2016-11-28']); Object.defineProperty(apiLoader.services['wafregional'], '2016-11-28', { get: function get() { var model = __webpack_require__(72867); model.paginators = __webpack_require__(68917)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WAFRegional; /***/ }), /***/ 50353: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['wafv2'] = {}; AWS.WAFV2 = Service.defineService('wafv2', ['2019-07-29']); Object.defineProperty(apiLoader.services['wafv2'], '2019-07-29', { get: function get() { var model = __webpack_require__(27916); model.paginators = __webpack_require__(51265)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WAFV2; /***/ }), /***/ 86263: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['wellarchitected'] = {}; AWS.WellArchitected = Service.defineService('wellarchitected', ['2020-03-31']); Object.defineProperty(apiLoader.services['wellarchitected'], '2020-03-31', { get: function get() { var model = __webpack_require__(5684); model.paginators = __webpack_require__(47645)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WellArchitected; /***/ }), /***/ 38835: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['workdocs'] = {}; AWS.WorkDocs = Service.defineService('workdocs', ['2016-05-01']); Object.defineProperty(apiLoader.services['workdocs'], '2016-05-01', { get: function get() { var model = __webpack_require__(12789); model.paginators = __webpack_require__(20074)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkDocs; /***/ }), /***/ 48579: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['worklink'] = {}; AWS.WorkLink = Service.defineService('worklink', ['2018-09-25']); Object.defineProperty(apiLoader.services['worklink'], '2018-09-25', { get: function get() { var model = __webpack_require__(44786); model.paginators = __webpack_require__(88012)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkLink; /***/ }), /***/ 38374: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['workmail'] = {}; AWS.WorkMail = Service.defineService('workmail', ['2017-10-01']); Object.defineProperty(apiLoader.services['workmail'], '2017-10-01', { get: function get() { var model = __webpack_require__(31611); model.paginators = __webpack_require__(64931)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkMail; /***/ }), /***/ 67025: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['workmailmessageflow'] = {}; AWS.WorkMailMessageFlow = Service.defineService('workmailmessageflow', ['2019-05-01']); Object.defineProperty(apiLoader.services['workmailmessageflow'], '2019-05-01', { get: function get() { var model = __webpack_require__(15648); model.paginators = __webpack_require__(88532)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkMailMessageFlow; /***/ }), /***/ 25513: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['workspaces'] = {}; AWS.WorkSpaces = Service.defineService('workspaces', ['2015-04-08']); Object.defineProperty(apiLoader.services['workspaces'], '2015-04-08', { get: function get() { var model = __webpack_require__(66372); model.paginators = __webpack_require__(37567)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.WorkSpaces; /***/ }), /***/ 41548: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); var Service = AWS.Service; var apiLoader = AWS.apiLoader; apiLoader.services['xray'] = {}; AWS.XRay = Service.defineService('xray', ['2016-04-12']); Object.defineProperty(apiLoader.services['xray'], '2016-04-12', { get: function get() { var model = __webpack_require__(37289); model.paginators = __webpack_require__(83127)/* .pagination */ .o; return model; }, enumerable: true, configurable: true }); module.exports = AWS.XRay; /***/ }), /***/ 52793: /***/ ((module) => { function apiLoader(svc, version) { if (!apiLoader.services.hasOwnProperty(svc)) { throw new Error('InvalidService: Failed to load api for ' + svc); } return apiLoader.services[svc][version]; } /** * @api private * * This member of AWS.apiLoader is private, but changing it will necessitate a * change to ../scripts/services-table-generator.ts */ apiLoader.services = {}; /** * @api private */ module.exports = apiLoader; /***/ }), /***/ 71786: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(73639); var AWS = __webpack_require__(28437); // Load all service classes __webpack_require__(26296); /** * @api private */ module.exports = AWS; /***/ }), /***/ 93260: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437), url = AWS.util.url, crypto = AWS.util.crypto.lib, base64Encode = AWS.util.base64.encode, inherit = AWS.util.inherit; var queryEncode = function (string) { var replacements = { '+': '-', '=': '_', '/': '~' }; return string.replace(/[\+=\/]/g, function (match) { return replacements[match]; }); }; var signPolicy = function (policy, privateKey) { var sign = crypto.createSign('RSA-SHA1'); sign.write(policy); return queryEncode(sign.sign(privateKey, 'base64')); }; var signWithCannedPolicy = function (url, expires, keyPairId, privateKey) { var policy = JSON.stringify({ Statement: [ { Resource: url, Condition: { DateLessThan: { 'AWS:EpochTime': expires } } } ] }); return { Expires: expires, 'Key-Pair-Id': keyPairId, Signature: signPolicy(policy.toString(), privateKey) }; }; var signWithCustomPolicy = function (policy, keyPairId, privateKey) { policy = policy.replace(/\s/mg, ''); return { Policy: queryEncode(base64Encode(policy)), 'Key-Pair-Id': keyPairId, Signature: signPolicy(policy, privateKey) }; }; var determineScheme = function (url) { var parts = url.split('://'); if (parts.length < 2) { throw new Error('Invalid URL.'); } return parts[0].replace('*', ''); }; var getRtmpUrl = function (rtmpUrl) { var parsed = url.parse(rtmpUrl); return parsed.path.replace(/^\//, '') + (parsed.hash || ''); }; var getResource = function (url) { switch (determineScheme(url)) { case 'http': case 'https': return url; case 'rtmp': return getRtmpUrl(url); default: throw new Error('Invalid URI scheme. Scheme must be one of' + ' http, https, or rtmp'); } }; var handleError = function (err, callback) { if (!callback || typeof callback !== 'function') { throw err; } callback(err); }; var handleSuccess = function (result, callback) { if (!callback || typeof callback !== 'function') { return result; } callback(null, result); }; AWS.CloudFront.Signer = inherit({ /** * A signer object can be used to generate signed URLs and cookies for granting * access to content on restricted CloudFront distributions. * * @see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html * * @param keyPairId [String] (Required) The ID of the CloudFront key pair * being used. * @param privateKey [String] (Required) A private key in RSA format. */ constructor: function Signer(keyPairId, privateKey) { if (keyPairId === void 0 || privateKey === void 0) { throw new Error('A key pair ID and private key are required'); } this.keyPairId = keyPairId; this.privateKey = privateKey; }, /** * Create a signed Amazon CloudFront Cookie. * * @param options [Object] The options to create a signed cookie. * @option options url [String] The URL to which the signature will grant * access. Required unless you pass in a full * policy. * @option options expires [Number] A Unix UTC timestamp indicating when the * signature should expire. Required unless you * pass in a full policy. * @option options policy [String] A CloudFront JSON policy. Required unless * you pass in a url and an expiry time. * * @param cb [Function] if a callback is provided, this function will * pass the hash as the second parameter (after the error parameter) to * the callback function. * * @return [Object] if called synchronously (with no callback), returns the * signed cookie parameters. * @return [null] nothing is returned if a callback is provided. */ getSignedCookie: function (options, cb) { var signatureHash = 'policy' in options ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) : signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey); var cookieHash = {}; for (var key in signatureHash) { if (Object.prototype.hasOwnProperty.call(signatureHash, key)) { cookieHash['CloudFront-' + key] = signatureHash[key]; } } return handleSuccess(cookieHash, cb); }, /** * Create a signed Amazon CloudFront URL. * * Keep in mind that URLs meant for use in media/flash players may have * different requirements for URL formats (e.g. some require that the * extension be removed, some require the file name to be prefixed * - mp4:, some require you to add "/cfx/st" into your URL). * * @param options [Object] The options to create a signed URL. * @option options url [String] The URL to which the signature will grant * access. Any query params included with * the URL should be encoded. Required. * @option options expires [Number] A Unix UTC timestamp indicating when the * signature should expire. Required unless you * pass in a full policy. * @option options policy [String] A CloudFront JSON policy. Required unless * you pass in a url and an expiry time. * * @param cb [Function] if a callback is provided, this function will * pass the URL as the second parameter (after the error parameter) to * the callback function. * * @return [String] if called synchronously (with no callback), returns the * signed URL. * @return [null] nothing is returned if a callback is provided. */ getSignedUrl: function (options, cb) { try { var resource = getResource(options.url); } catch (err) { return handleError(err, cb); } var parsedUrl = url.parse(options.url, true), signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy') ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) : signWithCannedPolicy(resource, options.expires, this.keyPairId, this.privateKey); parsedUrl.search = null; for (var key in signatureHash) { if (Object.prototype.hasOwnProperty.call(signatureHash, key)) { parsedUrl.query[key] = signatureHash[key]; } } try { var signedUrl = determineScheme(options.url) === 'rtmp' ? getRtmpUrl(url.format(parsedUrl)) : url.format(parsedUrl); } catch (err) { return handleError(err, cb); } return handleSuccess(signedUrl, cb); } }); /** * @api private */ module.exports = AWS.CloudFront.Signer; /***/ }), /***/ 38110: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); __webpack_require__(53819); __webpack_require__(36965); var PromisesDependency; /** * The main configuration class used by all service objects to set * the region, credentials, and other options for requests. * * By default, credentials and region settings are left unconfigured. * This should be configured by the application before using any * AWS service APIs. * * In order to set global configuration options, properties should * be assigned to the global {AWS.config} object. * * @see AWS.config * * @!group General Configuration Options * * @!attribute credentials * @return [AWS.Credentials] the AWS credentials to sign requests with. * * @!attribute region * @example Set the global region setting to us-west-2 * AWS.config.update({region: 'us-west-2'}); * @return [AWS.Credentials] The region to send service requests to. * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html * A list of available endpoints for each AWS service * * @!attribute maxRetries * @return [Integer] the maximum amount of retries to perform for a * service request. By default this value is calculated by the specific * service object that the request is being made to. * * @!attribute maxRedirects * @return [Integer] the maximum amount of redirects to follow for a * service request. Defaults to 10. * * @!attribute paramValidation * @return [Boolean|map] whether input parameters should be validated against * the operation description before sending the request. Defaults to true. * Pass a map to enable any of the following specific validation features: * * * **min** [Boolean] — Validates that a value meets the min * constraint. This is enabled by default when paramValidation is set * to `true`. * * **max** [Boolean] — Validates that a value meets the max * constraint. * * **pattern** [Boolean] — Validates that a string value matches a * regular expression. * * **enum** [Boolean] — Validates that a string value matches one * of the allowable enum values. * * @!attribute computeChecksums * @return [Boolean] whether to compute checksums for payload bodies when * the service accepts it (currently supported in S3 only). * * @!attribute convertResponseTypes * @return [Boolean] whether types are converted when parsing response data. * Currently only supported for JSON based services. Turning this off may * improve performance on large response payloads. Defaults to `true`. * * @!attribute correctClockSkew * @return [Boolean] whether to apply a clock skew correction and retry * requests that fail because of an skewed client clock. Defaults to * `false`. * * @!attribute sslEnabled * @return [Boolean] whether SSL is enabled for requests * * @!attribute s3ForcePathStyle * @return [Boolean] whether to force path style URLs for S3 objects * * @!attribute s3BucketEndpoint * @note Setting this configuration option requires an `endpoint` to be * provided explicitly to the service constructor. * @return [Boolean] whether the provided endpoint addresses an individual * bucket (false if it addresses the root API endpoint). * * @!attribute s3DisableBodySigning * @return [Boolean] whether to disable S3 body signing when using signature version `v4`. * Body signing can only be disabled when using https. Defaults to `true`. * * @!attribute s3UsEast1RegionalEndpoint * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3 * request to global endpoints or 'us-east-1' regional endpoints. This config is only * applicable to S3 client; * Defaults to 'legacy' * @!attribute s3UseArnRegion * @return [Boolean] whether to override the request region with the region inferred * from requested resource's ARN. Only available for S3 buckets * Defaults to `true` * * @!attribute useAccelerateEndpoint * @note This configuration option is only compatible with S3 while accessing * dns-compatible buckets. * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service. * Defaults to `false`. * * @!attribute retryDelayOptions * @example Set the base retry delay for all services to 300 ms * AWS.config.update({retryDelayOptions: {base: 300}}); * // Delays with maxRetries = 3: 300, 600, 1200 * @example Set a custom backoff function to provide delay values on retries * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) { * // returns delay in ms * }}}); * @return [map] A set of options to configure the retry delay on retryable errors. * Currently supported options are: * * * **base** [Integer] — The base number of milliseconds to use in the * exponential backoff for operation retries. Defaults to 100 ms for all services except * DynamoDB, where it defaults to 50ms. * * * **customBackoff ** [function] — A custom function that accepts a * retry count and error and returns the amount of time to delay in * milliseconds. If the result is a non-zero negative value, no further * retry attempts will be made. The `base` option will be ignored if this * option is supplied. The function is only called for retryable errors. * * @!attribute httpOptions * @return [map] A set of options to pass to the low-level HTTP request. * Currently supported options are: * * * **proxy** [String] — the URL to proxy requests through * * **agent** [http.Agent, https.Agent] — the Agent object to perform * HTTP requests with. Used for connection pooling. Note that for * SSL connections, a special Agent object is used in order to enable * peer certificate verification. This feature is only supported in the * Node.js environment. * * **connectTimeout** [Integer] — Sets the socket to timeout after * failing to establish a connection with the server after * `connectTimeout` milliseconds. This timeout has no effect once a socket * connection has been established. * * **timeout** [Integer] — The number of milliseconds a request can * take before automatically being terminated. * Defaults to two minutes (120000). * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous * HTTP requests. Used in the browser environment only. Set to false to * send requests synchronously. Defaults to true (async on). * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" * property of an XMLHttpRequest object. Used in the browser environment * only. Defaults to false. * @!attribute logger * @return [#write,#log] an object that responds to .write() (like a stream) * or .log() (like the console object) in order to log information about * requests * * @!attribute systemClockOffset * @return [Number] an offset value in milliseconds to apply to all signing * times. Use this to compensate for clock skew when your system may be * out of sync with the service time. Note that this configuration option * can only be applied to the global `AWS.config` object and cannot be * overridden in service-specific configuration. Defaults to 0 milliseconds. * * @!attribute signatureVersion * @return [String] the signature version to sign requests with (overriding * the API configuration). Possible values are: 'v2', 'v3', 'v4'. * * @!attribute signatureCache * @return [Boolean] whether the signature to sign requests with (overriding * the API configuration) is cached. Only applies to the signature version 'v4'. * Defaults to `true`. * * @!attribute endpointDiscoveryEnabled * @return [Boolean|undefined] whether to call operations with endpoints * given by service dynamically. Setting this config to `true` will enable * endpoint discovery for all applicable operations. Setting it to `false` * will explicitly disable endpoint discovery even though operations that * require endpoint discovery will presumably fail. Leaving it to * `undefined` means SDK only do endpoint discovery when it's required. * Defaults to `undefined` * * @!attribute endpointCacheSize * @return [Number] the size of the global cache storing endpoints from endpoint * discovery operations. Once endpoint cache is created, updating this setting * cannot change existing cache size. * Defaults to 1000 * * @!attribute hostPrefixEnabled * @return [Boolean] whether to marshal request parameters to the prefix of * hostname. Defaults to `true`. * * @!attribute stsRegionalEndpoints * @return ['legacy'|'regional'] whether to send sts request to global endpoints or * regional endpoints. * Defaults to 'legacy' */ AWS.Config = AWS.util.inherit({ /** * @!endgroup */ /** * Creates a new configuration object. This is the object that passes * option data along to service requests, including credentials, security, * region information, and some service specific settings. * * @example Creating a new configuration object with credentials and region * var config = new AWS.Config({ * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2' * }); * @option options accessKeyId [String] your AWS access key ID. * @option options secretAccessKey [String] your AWS secret access key. * @option options sessionToken [AWS.Credentials] the optional AWS * session token to sign requests with. * @option options credentials [AWS.Credentials] the AWS credentials * to sign requests with. You can either specify this object, or * specify the accessKeyId and secretAccessKey options directly. * @option options credentialProvider [AWS.CredentialProviderChain] the * provider chain used to resolve credentials if no static `credentials` * property is set. * @option options region [String] the region to send service requests to. * See {region} for more information. * @option options maxRetries [Integer] the maximum amount of retries to * attempt with a request. See {maxRetries} for more information. * @option options maxRedirects [Integer] the maximum amount of redirects to * follow with a request. See {maxRedirects} for more information. * @option options sslEnabled [Boolean] whether to enable SSL for * requests. * @option options paramValidation [Boolean|map] whether input parameters * should be validated against the operation description before sending * the request. Defaults to true. Pass a map to enable any of the * following specific validation features: * * * **min** [Boolean] — Validates that a value meets the min * constraint. This is enabled by default when paramValidation is set * to `true`. * * **max** [Boolean] — Validates that a value meets the max * constraint. * * **pattern** [Boolean] — Validates that a string value matches a * regular expression. * * **enum** [Boolean] — Validates that a string value matches one * of the allowable enum values. * @option options computeChecksums [Boolean] whether to compute checksums * for payload bodies when the service accepts it (currently supported * in S3 only) * @option options convertResponseTypes [Boolean] whether types are converted * when parsing response data. Currently only supported for JSON based * services. Turning this off may improve performance on large response * payloads. Defaults to `true`. * @option options correctClockSkew [Boolean] whether to apply a clock skew * correction and retry requests that fail because of an skewed client * clock. Defaults to `false`. * @option options s3ForcePathStyle [Boolean] whether to force path * style URLs for S3 objects. * @option options s3BucketEndpoint [Boolean] whether the provided endpoint * addresses an individual bucket (false if it addresses the root API * endpoint). Note that setting this configuration option requires an * `endpoint` to be provided explicitly to the service constructor. * @option options s3DisableBodySigning [Boolean] whether S3 body signing * should be disabled when using signature version `v4`. Body signing * can only be disabled when using https. Defaults to `true`. * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region * is set to 'us-east-1', whether to send s3 request to global endpoints or * 'us-east-1' regional endpoints. This config is only applicable to S3 client. * Defaults to `legacy` * @option options s3UseArnRegion [Boolean] whether to override the request region * with the region inferred from requested resource's ARN. Only available for S3 buckets * Defaults to `true` * * @option options retryDelayOptions [map] A set of options to configure * the retry delay on retryable errors. Currently supported options are: * * * **base** [Integer] — The base number of milliseconds to use in the * exponential backoff for operation retries. Defaults to 100 ms for all * services except DynamoDB, where it defaults to 50ms. * * **customBackoff ** [function] — A custom function that accepts a * retry count and error and returns the amount of time to delay in * milliseconds. If the result is a non-zero negative value, no further * retry attempts will be made. The `base` option will be ignored if this * option is supplied. The function is only called for retryable errors. * @option options httpOptions [map] A set of options to pass to the low-level * HTTP request. Currently supported options are: * * * **proxy** [String] — the URL to proxy requests through * * **agent** [http.Agent, https.Agent] — the Agent object to perform * HTTP requests with. Used for connection pooling. Defaults to the global * agent (`http.globalAgent`) for non-SSL connections. Note that for * SSL connections, a special Agent object is used in order to enable * peer certificate verification. This feature is only available in the * Node.js environment. * * **connectTimeout** [Integer] — Sets the socket to timeout after * failing to establish a connection with the server after * `connectTimeout` milliseconds. This timeout has no effect once a socket * connection has been established. * * **timeout** [Integer] — Sets the socket to timeout after timeout * milliseconds of inactivity on the socket. Defaults to two minutes * (120000). * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous * HTTP requests. Used in the browser environment only. Set to false to * send requests synchronously. Defaults to true (async on). * * **xhrWithCredentials** [Boolean] — Sets the "withCredentials" * property of an XMLHttpRequest object. Used in the browser environment * only. Defaults to false. * @option options apiVersion [String, Date] a String in YYYY-MM-DD format * (or a date) that represents the latest possible API version that can be * used in all services (unless overridden by `apiVersions`). Specify * 'latest' to use the latest possible version. * @option options apiVersions [map] a map of service * identifiers (the lowercase service class name) with the API version to * use when instantiating a service. Specify 'latest' for each individual * that can use the latest available version. * @option options logger [#write,#log] an object that responds to .write() * (like a stream) or .log() (like the console object) in order to log * information about requests * @option options systemClockOffset [Number] an offset value in milliseconds * to apply to all signing times. Use this to compensate for clock skew * when your system may be out of sync with the service time. Note that * this configuration option can only be applied to the global `AWS.config` * object and cannot be overridden in service-specific configuration. * Defaults to 0 milliseconds. * @option options signatureVersion [String] the signature version to sign * requests with (overriding the API configuration). Possible values are: * 'v2', 'v3', 'v4'. * @option options signatureCache [Boolean] whether the signature to sign * requests with (overriding the API configuration) is cached. Only applies * to the signature version 'v4'. Defaults to `true`. * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32 * checksum of HTTP response bodies returned by DynamoDB. Default: `true`. * @option options useAccelerateEndpoint [Boolean] Whether to use the * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`. * @option options clientSideMonitoring [Boolean] whether to collect and * publish this client's performance metrics of all its API requests. * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to * call operations with endpoints given by service dynamically. Setting this * config to `true` will enable endpoint discovery for all applicable operations. * Setting it to `false` will explicitly disable endpoint discovery even though * operations that require endpoint discovery will presumably fail. Leaving it * to `undefined` means SDK will only do endpoint discovery when it's required. * Defaults to `undefined` * @option options endpointCacheSize [Number] the size of the global cache storing * endpoints from endpoint discovery operations. Once endpoint cache is created, * updating this setting cannot change existing cache size. * Defaults to 1000 * @option options hostPrefixEnabled [Boolean] whether to marshal request * parameters to the prefix of hostname. * Defaults to `true`. * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request * to global endpoints or regional endpoints. * Defaults to 'legacy'. */ constructor: function Config(options) { if (options === undefined) options = {}; options = this.extractCredentials(options); AWS.util.each.call(this, this.keys, function (key, value) { this.set(key, options[key], value); }); }, /** * @!group Managing Credentials */ /** * Loads credentials from the configuration object. This is used internally * by the SDK to ensure that refreshable {Credentials} objects are properly * refreshed and loaded when sending a request. If you want to ensure that * your credentials are loaded prior to a request, you can use this method * directly to provide accurate credential data stored in the object. * * @note If you configure the SDK with static or environment credentials, * the credential data should already be present in {credentials} attribute. * This method is primarily necessary to load credentials from asynchronous * sources, or sources that can refresh credentials periodically. * @example Getting your access key * AWS.config.getCredentials(function(err) { * if (err) console.log(err.stack); // credentials not loaded * else console.log("Access Key:", AWS.config.credentials.accessKeyId); * }) * @callback callback function(err) * Called when the {credentials} have been properly set on the configuration * object. * * @param err [Error] if this is set, credentials were not successfully * loaded and this error provides information why. * @see credentials * @see Credentials */ getCredentials: function getCredentials(callback) { var self = this; function finish(err) { callback(err, err ? null : self.credentials); } function credError(msg, err) { return new AWS.util.error(err || new Error(), { code: 'CredentialsError', message: msg, name: 'CredentialsError' }); } function getAsyncCredentials() { self.credentials.get(function(err) { if (err) { var msg = 'Could not load credentials from ' + self.credentials.constructor.name; err = credError(msg, err); } finish(err); }); } function getStaticCredentials() { var err = null; if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) { err = credError('Missing credentials'); } finish(err); } if (self.credentials) { if (typeof self.credentials.get === 'function') { getAsyncCredentials(); } else { // static credentials getStaticCredentials(); } } else if (self.credentialProvider) { self.credentialProvider.resolve(function(err, creds) { if (err) { err = credError('Could not load credentials from any providers', err); } self.credentials = creds; finish(err); }); } else { finish(credError('No credentials to load')); } }, /** * @!group Loading and Setting Configuration Options */ /** * @overload update(options, allowUnknownKeys = false) * Updates the current configuration object with new options. * * @example Update maxRetries property of a configuration object * config.update({maxRetries: 10}); * @param [Object] options a map of option keys and values. * @param [Boolean] allowUnknownKeys whether unknown keys can be set on * the configuration object. Defaults to `false`. * @see constructor */ update: function update(options, allowUnknownKeys) { allowUnknownKeys = allowUnknownKeys || false; options = this.extractCredentials(options); AWS.util.each.call(this, options, function (key, value) { if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) || AWS.Service.hasService(key)) { this.set(key, value); } }); }, /** * Loads configuration data from a JSON file into this config object. * @note Loading configuration will reset all existing configuration * on the object. * @!macro nobrowser * @param path [String] the path relative to your process's current * working directory to load configuration from. * @return [AWS.Config] the same configuration object */ loadFromPath: function loadFromPath(path) { this.clear(); var options = JSON.parse(AWS.util.readFileSync(path)); var fileSystemCreds = new AWS.FileSystemCredentials(path); var chain = new AWS.CredentialProviderChain(); chain.providers.unshift(fileSystemCreds); chain.resolve(function (err, creds) { if (err) throw err; else options.credentials = creds; }); this.constructor(options); return this; }, /** * Clears configuration data on this object * * @api private */ clear: function clear() { /*jshint forin:false */ AWS.util.each.call(this, this.keys, function (key) { delete this[key]; }); // reset credential provider this.set('credentials', undefined); this.set('credentialProvider', undefined); }, /** * Sets a property on the configuration object, allowing for a * default value * @api private */ set: function set(property, value, defaultValue) { if (value === undefined) { if (defaultValue === undefined) { defaultValue = this.keys[property]; } if (typeof defaultValue === 'function') { this[property] = defaultValue.call(this); } else { this[property] = defaultValue; } } else if (property === 'httpOptions' && this[property]) { // deep merge httpOptions this[property] = AWS.util.merge(this[property], value); } else { this[property] = value; } }, /** * All of the keys with their default values. * * @constant * @api private */ keys: { credentials: null, credentialProvider: null, region: null, logger: null, apiVersions: {}, apiVersion: null, endpoint: undefined, httpOptions: { timeout: 120000 }, maxRetries: undefined, maxRedirects: 10, paramValidation: true, sslEnabled: true, s3ForcePathStyle: false, s3BucketEndpoint: false, s3DisableBodySigning: true, s3UsEast1RegionalEndpoint: 'legacy', s3UseArnRegion: undefined, computeChecksums: true, convertResponseTypes: true, correctClockSkew: false, customUserAgent: null, dynamoDbCrc32: true, systemClockOffset: 0, signatureVersion: null, signatureCache: true, retryDelayOptions: {}, useAccelerateEndpoint: false, clientSideMonitoring: false, endpointDiscoveryEnabled: undefined, endpointCacheSize: 1000, hostPrefixEnabled: true, stsRegionalEndpoints: 'legacy' }, /** * Extracts accessKeyId, secretAccessKey and sessionToken * from a configuration hash. * * @api private */ extractCredentials: function extractCredentials(options) { if (options.accessKeyId && options.secretAccessKey) { options = AWS.util.copy(options); options.credentials = new AWS.Credentials(options); } return options; }, /** * Sets the promise dependency the SDK will use wherever Promises are returned. * Passing `null` will force the SDK to use native Promises if they are available. * If native Promises are not available, passing `null` will have no effect. * @param [Constructor] dep A reference to a Promise constructor */ setPromisesDependency: function setPromisesDependency(dep) { PromisesDependency = dep; // if null was passed in, we should try to use native promises if (dep === null && typeof Promise === 'function') { PromisesDependency = Promise; } var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain]; if (AWS.S3) { constructors.push(AWS.S3); if (AWS.S3.ManagedUpload) { constructors.push(AWS.S3.ManagedUpload); } } AWS.util.addPromises(constructors, PromisesDependency); }, /** * Gets the promise dependency set by `AWS.config.setPromisesDependency`. */ getPromisesDependency: function getPromisesDependency() { return PromisesDependency; } }); /** * @return [AWS.Config] The global configuration object singleton instance * @readonly * @see AWS.Config */ AWS.config = new AWS.Config(); /***/ }), /***/ 85566: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ function validateRegionalEndpointsFlagValue(configValue, errorOptions) { if (typeof configValue !== 'string') return undefined; else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) { return configValue.toLowerCase(); } else { throw AWS.util.error(new Error(), errorOptions); } } /** * Resolve the configuration value for regional endpoint from difference sources: client * config, environmental variable, shared config file. Value can be case-insensitive * 'legacy' or 'reginal'. * @param originalConfig user-supplied config object to resolve * @param options a map of config property names from individual configuration source * - env: name of environmental variable that refers to the config * - sharedConfig: name of shared configuration file property that refers to the config * - clientConfig: name of client configuration property that refers to the config * * @api private */ function resolveRegionalEndpointsFlag(originalConfig, options) { originalConfig = originalConfig || {}; //validate config value var resolved; if (originalConfig[options.clientConfig]) { resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], { code: 'InvalidConfiguration', message: 'invalid "' + options.clientConfig + '" configuration. Expect "legacy" ' + ' or "regional". Got "' + originalConfig[options.clientConfig] + '".' }); if (resolved) return resolved; } if (!AWS.util.isNode()) return resolved; //validate environmental variable if (Object.prototype.hasOwnProperty.call(process.env, options.env)) { var envFlag = process.env[options.env]; resolved = validateRegionalEndpointsFlagValue(envFlag, { code: 'InvalidEnvironmentalVariable', message: 'invalid ' + options.env + ' environmental variable. Expect "legacy" ' + ' or "regional". Got "' + process.env[options.env] + '".' }); if (resolved) return resolved; } //validate shared config file var profile = {}; try { var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; } catch (e) {}; if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) { var fileFlag = profile[options.sharedConfig]; resolved = validateRegionalEndpointsFlagValue(fileFlag, { code: 'InvalidConfiguration', message: 'invalid ' + options.sharedConfig + ' profile config. Expect "legacy" ' + ' or "regional". Got "' + profile[options.sharedConfig] + '".' }); if (resolved) return resolved; } return resolved; } module.exports = resolveRegionalEndpointsFlag; /***/ }), /***/ 28437: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * The main AWS namespace */ var AWS = { util: __webpack_require__(77985) }; /** * @api private * @!macro [new] nobrowser * @note This feature is not supported in the browser environment of the SDK. */ var _hidden = {}; _hidden.toString(); // hack to parse macro /** * @api private */ module.exports = AWS; AWS.util.update(AWS, { /** * @constant */ VERSION: '2.889.0', /** * @api private */ Signers: {}, /** * @api private */ Protocol: { Json: __webpack_require__(30083), Query: __webpack_require__(90761), Rest: __webpack_require__(98200), RestJson: __webpack_require__(5883), RestXml: __webpack_require__(15143) }, /** * @api private */ XML: { Builder: __webpack_require__(23546), Parser: null // conditionally set based on environment }, /** * @api private */ JSON: { Builder: __webpack_require__(47495), Parser: __webpack_require__(5474) }, /** * @api private */ Model: { Api: __webpack_require__(17657), Operation: __webpack_require__(28083), Shape: __webpack_require__(71349), Paginator: __webpack_require__(45938), ResourceWaiter: __webpack_require__(41368) }, /** * @api private */ apiLoader: __webpack_require__(52793), /** * @api private */ EndpointCache: __webpack_require__(96323)/* .EndpointCache */ .$ }); __webpack_require__(55948); __webpack_require__(68903); __webpack_require__(38110); __webpack_require__(1556); __webpack_require__(54995); __webpack_require__(78652); __webpack_require__(58743); __webpack_require__(39925); __webpack_require__(9897); __webpack_require__(99127); /** * @readonly * @return [AWS.SequentialExecutor] a collection of global event listeners that * are attached to every sent request. * @see AWS.Request AWS.Request for a list of events to listen for * @example Logging the time taken to send a request * AWS.events.on('send', function startSend(resp) { * resp.startTime = new Date().getTime(); * }).on('complete', function calculateTime(resp) { * var time = (new Date().getTime() - resp.startTime) / 1000; * console.log('Request took ' + time + ' seconds'); * }); * * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds' */ AWS.events = new AWS.SequentialExecutor(); //create endpoint cache lazily AWS.util.memoizedProperty(AWS, 'endpointCache', function() { return new AWS.EndpointCache(AWS.config.endpointCacheSize); }, true); /***/ }), /***/ 53819: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Represents your AWS security credentials, specifically the * {accessKeyId}, {secretAccessKey}, and optional {sessionToken}. * Creating a `Credentials` object allows you to pass around your * security information to configuration and service objects. * * Note that this class typically does not need to be constructed manually, * as the {AWS.Config} and {AWS.Service} classes both accept simple * options hashes with the three keys. These structures will be converted * into Credentials objects automatically. * * ## Expiring and Refreshing Credentials * * Occasionally credentials can expire in the middle of a long-running * application. In this case, the SDK will automatically attempt to * refresh the credentials from the storage location if the Credentials * class implements the {refresh} method. * * If you are implementing a credential storage location, you * will want to create a subclass of the `Credentials` class and * override the {refresh} method. This method allows credentials to be * retrieved from the backing store, be it a file system, database, or * some network storage. The method should reset the credential attributes * on the object. * * @!attribute expired * @return [Boolean] whether the credentials have been expired and * require a refresh. Used in conjunction with {expireTime}. * @!attribute expireTime * @return [Date] a time when credentials should be considered expired. Used * in conjunction with {expired}. * @!attribute accessKeyId * @return [String] the AWS access key ID * @!attribute secretAccessKey * @return [String] the AWS secret access key * @!attribute sessionToken * @return [String] an optional AWS session token */ AWS.Credentials = AWS.util.inherit({ /** * A credentials object can be created using positional arguments or an options * hash. * * @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null) * Creates a Credentials object with a given set of credential information * as positional arguments. * @param accessKeyId [String] the AWS access key ID * @param secretAccessKey [String] the AWS secret access key * @param sessionToken [String] the optional AWS session token * @example Create a credentials object with AWS credentials * var creds = new AWS.Credentials('akid', 'secret', 'session'); * @overload AWS.Credentials(options) * Creates a Credentials object with a given set of credential information * as an options hash. * @option options accessKeyId [String] the AWS access key ID * @option options secretAccessKey [String] the AWS secret access key * @option options sessionToken [String] the optional AWS session token * @example Create a credentials object with AWS credentials * var creds = new AWS.Credentials({ * accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session' * }); */ constructor: function Credentials() { // hide secretAccessKey from being displayed with util.inspect AWS.util.hideProperties(this, ['secretAccessKey']); this.expired = false; this.expireTime = null; this.refreshCallbacks = []; if (arguments.length === 1 && typeof arguments[0] === 'object') { var creds = arguments[0].credentials || arguments[0]; this.accessKeyId = creds.accessKeyId; this.secretAccessKey = creds.secretAccessKey; this.sessionToken = creds.sessionToken; } else { this.accessKeyId = arguments[0]; this.secretAccessKey = arguments[1]; this.sessionToken = arguments[2]; } }, /** * @return [Integer] the number of seconds before {expireTime} during which * the credentials will be considered expired. */ expiryWindow: 15, /** * @return [Boolean] whether the credentials object should call {refresh} * @note Subclasses should override this method to provide custom refresh * logic. */ needsRefresh: function needsRefresh() { var currentTime = AWS.util.date.getDate().getTime(); var adjustedTime = new Date(currentTime + this.expiryWindow * 1000); if (this.expireTime && adjustedTime > this.expireTime) { return true; } else { return this.expired || !this.accessKeyId || !this.secretAccessKey; } }, /** * Gets the existing credentials, refreshing them if they are not yet loaded * or have expired. Users should call this method before using {refresh}, * as this will not attempt to reload credentials when they are already * loaded into the object. * * @callback callback function(err) * When this callback is called with no error, it means either credentials * do not need to be refreshed or refreshed credentials information has * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, * and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled */ get: function get(callback) { var self = this; if (this.needsRefresh()) { this.refresh(function(err) { if (!err) self.expired = false; // reset expired flag if (callback) callback(err); }); } else if (callback) { callback(); } }, /** * @!method getPromise() * Returns a 'thenable' promise. * Gets the existing credentials, refreshing them if they are not yet loaded * or have expired. Users should call this method before using {refresh}, * as this will not attempt to reload credentials when they are already * loaded into the object. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function() * Called if the promise is fulfilled. When this callback is called, it * means either credentials do not need to be refreshed or refreshed * credentials information has been loaded into the object (as the * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). * @callback rejectedCallback function(err) * Called if the promise is rejected. * @param err [Error] if an error occurred, this value will be filled * @return [Promise] A promise that represents the state of the `get` call. * @example Calling the `getPromise` method. * var promise = credProvider.getPromise(); * promise.then(function() { ... }, function(err) { ... }); */ /** * @!method refreshPromise() * Returns a 'thenable' promise. * Refreshes the credentials. Users should call {get} before attempting * to forcibly refresh credentials. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function() * Called if the promise is fulfilled. When this callback is called, it * means refreshed credentials information has been loaded into the object * (as the `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). * @callback rejectedCallback function(err) * Called if the promise is rejected. * @param err [Error] if an error occurred, this value will be filled * @return [Promise] A promise that represents the state of the `refresh` call. * @example Calling the `refreshPromise` method. * var promise = credProvider.refreshPromise(); * promise.then(function() { ... }, function(err) { ... }); */ /** * Refreshes the credentials. Users should call {get} before attempting * to forcibly refresh credentials. * * @callback callback function(err) * When this callback is called with no error, it means refreshed * credentials information has been loaded into the object (as the * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @note Subclasses should override this class to reset the * {accessKeyId}, {secretAccessKey} and optional {sessionToken} * on the credentials object and then call the callback with * any error information. * @see get */ refresh: function refresh(callback) { this.expired = false; callback(); }, /** * @api private * @param callback */ coalesceRefresh: function coalesceRefresh(callback, sync) { var self = this; if (self.refreshCallbacks.push(callback) === 1) { self.load(function onLoad(err) { AWS.util.arrayEach(self.refreshCallbacks, function(callback) { if (sync) { callback(err); } else { // callback could throw, so defer to ensure all callbacks are notified AWS.util.defer(function () { callback(err); }); } }); self.refreshCallbacks.length = 0; }); } }, /** * @api private * @param callback */ load: function load(callback) { callback(); } }); /** * @api private */ AWS.Credentials.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency); this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency); }; /** * @api private */ AWS.Credentials.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.getPromise; delete this.prototype.refreshPromise; }; AWS.util.addPromises(AWS.Credentials); /***/ }), /***/ 57083: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); /** * Represents temporary credentials retrieved from {AWS.STS}. Without any * extra parameters, credentials will be fetched from the * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the * {AWS.STS.assumeRole} operation will be used to fetch credentials for the * role instead. * * AWS.ChainableTemporaryCredentials differs from AWS.TemporaryCredentials in * the way masterCredentials and refreshes are handled. * AWS.ChainableTemporaryCredentials refreshes expired credentials using the * masterCredentials passed by the user to support chaining of STS credentials. * However, AWS.TemporaryCredentials recursively collapses the masterCredentials * during instantiation, precluding the ability to refresh credentials which * require intermediate, temporary credentials. * * For example, if the application should use RoleA, which must be assumed from * RoleB, and the environment provides credentials which can assume RoleB, then * AWS.ChainableTemporaryCredentials must be used to support refreshing the * temporary credentials for RoleA: * * ```javascript * var roleACreds = new AWS.ChainableTemporaryCredentials({ * params: {RoleArn: 'RoleA'}, * masterCredentials: new AWS.ChainableTemporaryCredentials({ * params: {RoleArn: 'RoleB'}, * masterCredentials: new AWS.EnvironmentCredentials('AWS') * }) * }); * ``` * * If AWS.TemporaryCredentials had been used in the previous example, * `roleACreds` would fail to refresh because `roleACreds` would * use the environment credentials for the AssumeRole request. * * Another difference is that AWS.ChainableTemporaryCredentials creates the STS * service instance during instantiation while AWS.TemporaryCredentials creates * the STS service instance during the first refresh. Creating the service * instance during instantiation effectively captures the master credentials * from the global config, so that subsequent changes to the global config do * not affect the master credentials used to refresh the temporary credentials. * * This allows an instance of AWS.ChainableTemporaryCredentials to be assigned * to AWS.config.credentials: * * ```javascript * var envCreds = new AWS.EnvironmentCredentials('AWS'); * AWS.config.credentials = envCreds; * // masterCredentials will be envCreds * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ * params: {RoleArn: '...'} * }); * ``` * * Similarly, to use the CredentialProviderChain's default providers as the * master credentials, simply create a new instance of * AWS.ChainableTemporaryCredentials: * * ```javascript * AWS.config.credentials = new ChainableTemporaryCredentials({ * params: {RoleArn: '...'} * }); * ``` * * @!attribute service * @return [AWS.STS] the STS service instance used to * get and refresh temporary credentials from AWS STS. * @note (see constructor) */ AWS.ChainableTemporaryCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new temporary credentials object. * * @param options [map] a set of options * @option options params [map] ({}) a map of options that are passed to the * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. * If a `RoleArn` parameter is passed in, credentials will be based on the * IAM role. If a `SerialNumber` parameter is passed in, {tokenCodeFn} must * also be passed in or an error will be thrown. * @option options masterCredentials [AWS.Credentials] the master credentials * used to get and refresh temporary credentials from AWS STS. By default, * AWS.config.credentials or AWS.config.credentialProvider will be used. * @option options tokenCodeFn [Function] (null) Function to provide * `TokenCode`, if `SerialNumber` is provided for profile in {params}. Function * is called with value of `SerialNumber` and `callback`, and should provide * the `TokenCode` or an error to the callback in the format * `callback(err, token)`. * @example Creating a new credentials object for generic temporary credentials * AWS.config.credentials = new AWS.ChainableTemporaryCredentials(); * @example Creating a new credentials object for an IAM role * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({ * params: { * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials' * } * }); * @see AWS.STS.assumeRole * @see AWS.STS.getSessionToken */ constructor: function ChainableTemporaryCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.errorCode = 'ChainableTemporaryCredentialsProviderFailure'; this.expired = true; this.tokenCodeFn = null; var params = AWS.util.copy(options.params) || {}; if (params.RoleArn) { params.RoleSessionName = params.RoleSessionName || 'temporary-credentials'; } if (params.SerialNumber) { if (!options.tokenCodeFn || (typeof options.tokenCodeFn !== 'function')) { throw new AWS.util.error( new Error('tokenCodeFn must be a function when params.SerialNumber is given'), {code: this.errorCode} ); } else { this.tokenCodeFn = options.tokenCodeFn; } } var config = AWS.util.merge( { params: params, credentials: options.masterCredentials || AWS.config.credentials }, options.stsConfig || {} ); this.service = new STS(config); }, /** * Refreshes credentials using {AWS.STS.assumeRole} or * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed * to the credentials {constructor}. * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see AWS.Credentials.get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private * @param callback */ load: function load(callback) { var self = this; var operation = self.service.config.params.RoleArn ? 'assumeRole' : 'getSessionToken'; this.getTokenCode(function (err, tokenCode) { var params = {}; if (err) { callback(err); return; } if (tokenCode) { params.TokenCode = tokenCode; } self.service[operation](params, function (err, data) { if (!err) { self.service.credentialsFrom(data, self); } callback(err); }); }); }, /** * @api private */ getTokenCode: function getTokenCode(callback) { var self = this; if (this.tokenCodeFn) { this.tokenCodeFn(this.service.config.params.SerialNumber, function (err, token) { if (err) { var message = err; if (err instanceof Error) { message = err.message; } callback( AWS.util.error( new Error('Error fetching MFA token: ' + message), { code: self.errorCode} ) ); return; } callback(null, token); }); } else { callback(null); } } }); /***/ }), /***/ 3498: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var CognitoIdentity = __webpack_require__(58291); var STS = __webpack_require__(57513); /** * Represents credentials retrieved from STS Web Identity Federation using * the Amazon Cognito Identity service. * * By default this provider gets credentials using the * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to * obtain an `IdentityId`. If the identity or identity pool is not configured in * the Amazon Cognito Console to use IAM roles with the appropriate permissions, * then additionally a `RoleArn` is required containing the ARN of the IAM trust * policy for the Amazon Cognito role that the user will log into. If a `RoleArn` * is provided, then this provider gets credentials using the * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}. * * In addition, if this credential provider is used to provide authenticated * login, the `Logins` map may be set to the tokens provided by the respective * identity providers. See {constructor} for an example on creating a credentials * object with proper property values. * * ## Refreshing Credentials from Identity Service * * In addition to AWS credentials expiring after a given amount of time, the * login token from the identity provider will also expire. Once this token * expires, it will not be usable to refresh AWS credentials, and another * token will be needed. The SDK does not manage refreshing of the token value, * but this can be done through a "refresh token" supported by most identity * providers. Consult the documentation for the identity provider for refreshing * tokens. Once the refreshed token is acquired, you should make sure to update * this new token in the credentials object's {params} property. The following * code will update the WebIdentityToken, assuming you have retrieved an updated * token from the identity provider: * * ```javascript * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken; * ``` * * Future calls to `credentials.refresh()` will now use the new token. * * @!attribute params * @return [map] the map of params passed to * {AWS.CognitoIdentity.getId}, * {AWS.CognitoIdentity.getOpenIdToken}, and * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the * `params.WebIdentityToken` property. * @!attribute data * @return [map] the raw data response from the call to * {AWS.CognitoIdentity.getCredentialsForIdentity}, or * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get * access to other properties from the response. * @!attribute identityId * @return [String] the Cognito ID returned by the last call to * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual * final resolved identity ID from Amazon Cognito. */ AWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, { /** * @api private */ localStorageKey: { id: 'aws.cognito.identity-id.', providers: 'aws.cognito.identity-providers.' }, /** * Creates a new credentials object. * @example Creating a new credentials object * AWS.config.credentials = new AWS.CognitoIdentityCredentials({ * * // either IdentityPoolId or IdentityId is required * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below) * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity * // or AWS.CognitoIdentity.getOpenIdToken (linked below) * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030', * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f' * * // optional, only necessary when the identity pool is not configured * // to use IAM roles in the Amazon Cognito Console * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below) * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity', * * // optional tokens, used for authenticated login * // See the Logins param for AWS.CognitoIdentity.getID (linked below) * Logins: { * 'graph.facebook.com': 'FBTOKEN', * 'www.amazon.com': 'AMAZONTOKEN', * 'accounts.google.com': 'GOOGLETOKEN', * 'api.twitter.com': 'TWITTERTOKEN', * 'www.digits.com': 'DIGITSTOKEN' * }, * * // optional name, defaults to web-identity * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below) * RoleSessionName: 'web', * * // optional, only necessary when application runs in a browser * // and multiple users are signed in at once, used for caching * LoginId: 'example@gmail.com' * * }, { * // optionally provide configuration to apply to the underlying service clients * // if configuration is not provided, then configuration will be pulled from AWS.config * * // region should match the region your identity pool is located in * region: 'us-east-1', * * // specify timeout options * httpOptions: { * timeout: 100 * } * }); * @see AWS.CognitoIdentity.getId * @see AWS.CognitoIdentity.getCredentialsForIdentity * @see AWS.STS.assumeRoleWithWebIdentity * @see AWS.CognitoIdentity.getOpenIdToken * @see AWS.Config * @note If a region is not provided in the global AWS.config, or * specified in the `clientConfig` to the CognitoIdentityCredentials * constructor, you may encounter a 'Missing credentials in config' error * when calling making a service call. */ constructor: function CognitoIdentityCredentials(params, clientConfig) { AWS.Credentials.call(this); this.expired = true; this.params = params; this.data = null; this._identityId = null; this._clientConfig = AWS.util.copy(clientConfig || {}); this.loadCachedId(); var self = this; Object.defineProperty(this, 'identityId', { get: function() { self.loadCachedId(); return self._identityId || self.params.IdentityId; }, set: function(identityId) { self._identityId = identityId; } }); }, /** * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity}, * or {AWS.STS.assumeRoleWithWebIdentity}. * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see AWS.Credentials.get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private * @param callback */ load: function load(callback) { var self = this; self.createClients(); self.data = null; self._identityId = null; self.getId(function(err) { if (!err) { if (!self.params.RoleArn) { self.getCredentialsForIdentity(callback); } else { self.getCredentialsFromSTS(callback); } } else { self.clearIdOnNotAuthorized(err); callback(err); } }); }, /** * Clears the cached Cognito ID associated with the currently configured * identity pool ID. Use this to manually invalidate your cache if * the identity pool ID was deleted. */ clearCachedId: function clearCache() { this._identityId = null; delete this.params.IdentityId; var poolId = this.params.IdentityPoolId; var loginId = this.params.LoginId || ''; delete this.storage[this.localStorageKey.id + poolId + loginId]; delete this.storage[this.localStorageKey.providers + poolId + loginId]; }, /** * @api private */ clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) { var self = this; if (err.code == 'NotAuthorizedException') { self.clearCachedId(); } }, /** * Retrieves a Cognito ID, loading from cache if it was already retrieved * on this device. * * @callback callback function(err, identityId) * @param err [Error, null] an error object if the call failed or null if * it succeeded. * @param identityId [String, null] if successful, the callback will return * the Cognito ID. * @note If not loaded explicitly, the Cognito ID is loaded and stored in * localStorage in the browser environment of a device. * @api private */ getId: function getId(callback) { var self = this; if (typeof self.params.IdentityId === 'string') { return callback(null, self.params.IdentityId); } self.cognito.getId(function(err, data) { if (!err && data.IdentityId) { self.params.IdentityId = data.IdentityId; callback(null, data.IdentityId); } else { callback(err); } }); }, /** * @api private */ loadCredentials: function loadCredentials(data, credentials) { if (!data || !credentials) return; credentials.expired = false; credentials.accessKeyId = data.Credentials.AccessKeyId; credentials.secretAccessKey = data.Credentials.SecretKey; credentials.sessionToken = data.Credentials.SessionToken; credentials.expireTime = data.Credentials.Expiration; }, /** * @api private */ getCredentialsForIdentity: function getCredentialsForIdentity(callback) { var self = this; self.cognito.getCredentialsForIdentity(function(err, data) { if (!err) { self.cacheId(data); self.data = data; self.loadCredentials(self.data, self); } else { self.clearIdOnNotAuthorized(err); } callback(err); }); }, /** * @api private */ getCredentialsFromSTS: function getCredentialsFromSTS(callback) { var self = this; self.cognito.getOpenIdToken(function(err, data) { if (!err) { self.cacheId(data); self.params.WebIdentityToken = data.Token; self.webIdentityCredentials.refresh(function(webErr) { if (!webErr) { self.data = self.webIdentityCredentials.data; self.sts.credentialsFrom(self.data, self); } callback(webErr); }); } else { self.clearIdOnNotAuthorized(err); callback(err); } }); }, /** * @api private */ loadCachedId: function loadCachedId() { var self = this; // in the browser we source default IdentityId from localStorage if (AWS.util.isBrowser() && !self.params.IdentityId) { var id = self.getStorage('id'); if (id && self.params.Logins) { var actualProviders = Object.keys(self.params.Logins); var cachedProviders = (self.getStorage('providers') || '').split(','); // only load ID if at least one provider used this ID before var intersect = cachedProviders.filter(function(n) { return actualProviders.indexOf(n) !== -1; }); if (intersect.length !== 0) { self.params.IdentityId = id; } } else if (id) { self.params.IdentityId = id; } } }, /** * @api private */ createClients: function() { var clientConfig = this._clientConfig; this.webIdentityCredentials = this.webIdentityCredentials || new AWS.WebIdentityCredentials(this.params, clientConfig); if (!this.cognito) { var cognitoConfig = AWS.util.merge({}, clientConfig); cognitoConfig.params = this.params; this.cognito = new CognitoIdentity(cognitoConfig); } this.sts = this.sts || new STS(clientConfig); }, /** * @api private */ cacheId: function cacheId(data) { this._identityId = data.IdentityId; this.params.IdentityId = this._identityId; // cache this IdentityId in browser localStorage if possible if (AWS.util.isBrowser()) { this.setStorage('id', data.IdentityId); if (this.params.Logins) { this.setStorage('providers', Object.keys(this.params.Logins).join(',')); } } }, /** * @api private */ getStorage: function getStorage(key) { return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')]; }, /** * @api private */ setStorage: function setStorage(key, val) { try { this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val; } catch (_) {} }, /** * @api private */ storage: (function() { try { var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ? window.localStorage : {}; // Test set/remove which would throw an error in Safari's private browsing storage['aws.test-storage'] = 'foobar'; delete storage['aws.test-storage']; return storage; } catch (_) { return {}; } })() }); /***/ }), /***/ 36965: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Creates a credential provider chain that searches for AWS credentials * in a list of credential providers specified by the {providers} property. * * By default, the chain will use the {defaultProviders} to resolve credentials. * These providers will look in the environment using the * {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes. * * ## Setting Providers * * Each provider in the {providers} list should be a function that returns * a {AWS.Credentials} object, or a hardcoded credentials object. The function * form allows for delayed execution of the credential construction. * * ## Resolving Credentials from a Chain * * Call {resolve} to return the first valid credential object that can be * loaded by the provider chain. * * For example, to resolve a chain with a custom provider that checks a file * on disk after the set of {defaultProviders}: * * ```javascript * var diskProvider = new AWS.FileSystemCredentials('./creds.json'); * var chain = new AWS.CredentialProviderChain(); * chain.providers.push(diskProvider); * chain.resolve(); * ``` * * The above code will return the `diskProvider` object if the * file contains credentials and the `defaultProviders` do not contain * any credential settings. * * @!attribute providers * @return [Array] * a list of credentials objects or functions that return credentials * objects. If the provider is a function, the function will be * executed lazily when the provider needs to be checked for valid * credentials. By default, this object will be set to the * {defaultProviders}. * @see defaultProviders */ AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, { /** * Creates a new CredentialProviderChain with a default set of providers * specified by {defaultProviders}. */ constructor: function CredentialProviderChain(providers) { if (providers) { this.providers = providers; } else { this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0); } this.resolveCallbacks = []; }, /** * @!method resolvePromise() * Returns a 'thenable' promise. * Resolves the provider chain by searching for the first set of * credentials in {providers}. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function(credentials) * Called if the promise is fulfilled and the provider resolves the chain * to a credentials object * @param credentials [AWS.Credentials] the credentials object resolved * by the provider chain. * @callback rejectedCallback function(error) * Called if the promise is rejected. * @param err [Error] the error object returned if no credentials are found. * @return [Promise] A promise that represents the state of the `resolve` method call. * @example Calling the `resolvePromise` method. * var promise = chain.resolvePromise(); * promise.then(function(credentials) { ... }, function(err) { ... }); */ /** * Resolves the provider chain by searching for the first set of * credentials in {providers}. * * @callback callback function(err, credentials) * Called when the provider resolves the chain to a credentials object * or null if no credentials can be found. * * @param err [Error] the error object returned if no credentials are * found. * @param credentials [AWS.Credentials] the credentials object resolved * by the provider chain. * @return [AWS.CredentialProviderChain] the provider, for chaining. */ resolve: function resolve(callback) { var self = this; if (self.providers.length === 0) { callback(new Error('No providers')); return self; } if (self.resolveCallbacks.push(callback) === 1) { var index = 0; var providers = self.providers.slice(0); function resolveNext(err, creds) { if ((!err && creds) || index === providers.length) { AWS.util.arrayEach(self.resolveCallbacks, function (callback) { callback(err, creds); }); self.resolveCallbacks.length = 0; return; } var provider = providers[index++]; if (typeof provider === 'function') { creds = provider.call(); } else { creds = provider; } if (creds.get) { creds.get(function (getErr) { resolveNext(getErr, getErr ? null : creds); }); } else { resolveNext(null, creds); } } resolveNext(); } return self; } }); /** * The default set of providers used by a vanilla CredentialProviderChain. * * In the browser: * * ```javascript * AWS.CredentialProviderChain.defaultProviders = [] * ``` * * In Node.js: * * ```javascript * AWS.CredentialProviderChain.defaultProviders = [ * function () { return new AWS.EnvironmentCredentials('AWS'); }, * function () { return new AWS.EnvironmentCredentials('AMAZON'); }, * function () { return new AWS.SharedIniFileCredentials(); }, * function () { return new AWS.ECSCredentials(); }, * function () { return new AWS.ProcessCredentials(); }, * function () { return new AWS.TokenFileWebIdentityCredentials(); }, * function () { return new AWS.EC2MetadataCredentials() } * ] * ``` */ AWS.CredentialProviderChain.defaultProviders = []; /** * @api private */ AWS.CredentialProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency); }; /** * @api private */ AWS.CredentialProviderChain.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.resolvePromise; }; AWS.util.addPromises(AWS.CredentialProviderChain); /***/ }), /***/ 73379: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); __webpack_require__(25768); /** * Represents credentials received from the metadata service on an EC2 instance. * * By default, this class will connect to the metadata service using * {AWS.MetadataService} and attempt to load any available credentials. If it * can connect, and credentials are available, these will be used with zero * configuration. * * This credentials class will by default timeout after 1 second of inactivity * and retry 3 times. * If your requests to the EC2 metadata service are timing out, you can increase * these values by configuring them directly: * * ```javascript * AWS.config.credentials = new AWS.EC2MetadataCredentials({ * httpOptions: { timeout: 5000 }, // 5 second timeout * maxRetries: 10, // retry 10 times * retryDelayOptions: { base: 200 } // see AWS.Config for information * }); * * If your requests are timing out in connecting to the metadata service, such * as when testing on a development machine, you can use the connectTimeout * option, specified in milliseconds, which also defaults to 1 second. * ``` * * @see AWS.Config.retryDelayOptions * * @!macro nobrowser */ AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, { constructor: function EC2MetadataCredentials(options) { AWS.Credentials.call(this); options = options ? AWS.util.copy(options) : {}; options = AWS.util.merge( {maxRetries: this.defaultMaxRetries}, options); if (!options.httpOptions) options.httpOptions = {}; options.httpOptions = AWS.util.merge( {timeout: this.defaultTimeout, connectTimeout: this.defaultConnectTimeout}, options.httpOptions); this.metadataService = new AWS.MetadataService(options); this.metadata = {}; }, /** * @api private */ defaultTimeout: 1000, /** * @api private */ defaultConnectTimeout: 1000, /** * @api private */ defaultMaxRetries: 3, /** * Loads the credentials from the instance metadata service * * @callback callback function(err) * Called when the instance metadata service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private * @param callback */ load: function load(callback) { var self = this; self.metadataService.loadCredentials(function(err, creds) { if (!err) { var currentTime = AWS.util.date.getDate(); var expireTime = new Date(creds.Expiration); if (expireTime < currentTime) { err = AWS.util.error( new Error('EC2 Instance Metadata Serivce provided expired credentials'), { code: 'EC2MetadataCredentialsProviderFailure' } ); } else { self.expired = false; self.metadata = creds; self.accessKeyId = creds.AccessKeyId; self.secretAccessKey = creds.SecretAccessKey; self.sessionToken = creds.Token; self.expireTime = expireTime; } } callback(err); }); } }); /***/ }), /***/ 10645: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Represents credentials received from relative URI specified in the ECS container. * * This class will request refreshable credentials from the relative URI * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials * are returned in the response, these will be used with zero configuration. * * This credentials class will by default timeout after 1 second of inactivity * and retry 3 times. * If your requests to the relative URI are timing out, you can increase * the value by configuring them directly: * * ```javascript * AWS.config.credentials = new AWS.ECSCredentials({ * httpOptions: { timeout: 5000 }, // 5 second timeout * maxRetries: 10, // retry 10 times * retryDelayOptions: { base: 200 } // see AWS.Config for information * }); * ``` * * @see AWS.Config.retryDelayOptions * * @!macro nobrowser */ AWS.ECSCredentials = AWS.RemoteCredentials; /***/ }), /***/ 57714: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Represents credentials from the environment. * * By default, this class will look for the matching environment variables * prefixed by a given {envPrefix}. The un-prefixed environment variable names * for each credential value is listed below: * * ```javascript * accessKeyId: ACCESS_KEY_ID * secretAccessKey: SECRET_ACCESS_KEY * sessionToken: SESSION_TOKEN * ``` * * With the default prefix of 'AWS', the environment variables would be: * * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN * * @!attribute envPrefix * @readonly * @return [String] the prefix for the environment variable names excluding * the separating underscore ('_'). */ AWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new EnvironmentCredentials class with a given variable * prefix {envPrefix}. For example, to load credentials using the 'AWS' * prefix: * * ```javascript * var creds = new AWS.EnvironmentCredentials('AWS'); * creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var * ``` * * @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment * variables. Do not include the separating underscore. */ constructor: function EnvironmentCredentials(envPrefix) { AWS.Credentials.call(this); this.envPrefix = envPrefix; this.get(function() {}); }, /** * Loads credentials from the environment using the prefixed * environment variables. * * @callback callback function(err) * Called after the (prefixed) ACCESS_KEY_ID, SECRET_ACCESS_KEY, and * SESSION_TOKEN environment variables are read. When this callback is * called with no error, it means that the credentials information has * been loaded into the object (as the `accessKeyId`, `secretAccessKey`, * and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { if (!callback) callback = AWS.util.fn.callback; if (!process || !process.env) { callback(AWS.util.error( new Error('No process info or environment variables available'), { code: 'EnvironmentCredentialsProviderFailure' } )); return; } var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN']; var values = []; for (var i = 0; i < keys.length; i++) { var prefix = ''; if (this.envPrefix) prefix = this.envPrefix + '_'; values[i] = process.env[prefix + keys[i]]; if (!values[i] && keys[i] !== 'SESSION_TOKEN') { callback(AWS.util.error( new Error('Variable ' + prefix + keys[i] + ' not set.'), { code: 'EnvironmentCredentialsProviderFailure' } )); return; } } this.expired = false; AWS.Credentials.apply(this, values); callback(); } }); /***/ }), /***/ 27454: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Represents credentials from a JSON file on disk. * If the credentials expire, the SDK can {refresh} the credentials * from the file. * * The format of the file should be similar to the options passed to * {AWS.Config}: * * ```javascript * {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'} * ``` * * @example Loading credentials from disk * var creds = new AWS.FileSystemCredentials('./configuration.json'); * creds.accessKeyId == 'AKID' * * @!attribute filename * @readonly * @return [String] the path to the JSON file on disk containing the * credentials. * @!macro nobrowser */ AWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, { /** * @overload AWS.FileSystemCredentials(filename) * Creates a new FileSystemCredentials object from a filename * * @param filename [String] the path on disk to the JSON file to load. */ constructor: function FileSystemCredentials(filename) { AWS.Credentials.call(this); this.filename = filename; this.get(function() {}); }, /** * Loads the credentials from the {filename} on disk. * * @callback callback function(err) * Called after the JSON file on disk is read and parsed. When this callback * is called with no error, it means that the credentials information * has been loaded into the object (as the `accessKeyId`, `secretAccessKey`, * and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { if (!callback) callback = AWS.util.fn.callback; try { var creds = JSON.parse(AWS.util.readFileSync(this.filename)); AWS.Credentials.call(this, creds); if (!this.accessKeyId || !this.secretAccessKey) { throw AWS.util.error( new Error('Credentials not set in ' + this.filename), { code: 'FileSystemCredentialsProviderFailure' } ); } this.expired = false; callback(); } catch (err) { callback(err); } } }); /***/ }), /***/ 80371: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var proc = __webpack_require__(63129); var iniLoader = AWS.util.iniLoader; /** * Represents credentials loaded from shared credentials file * (defaulting to ~/.aws/credentials or defined by the * `AWS_SHARED_CREDENTIALS_FILE` environment variable). * * ## Using process credentials * * The credentials file can specify a credential provider that executes * a given process and attempts to read its stdout to recieve a JSON payload * containing the credentials: * * [default] * credential_process = /usr/bin/credential_proc * * Automatically handles refreshing credentials if an Expiration time is * provided in the credentials payload. Credentials supplied in the same profile * will take precedence over the credential_process. * * Sourcing credentials from an external process can potentially be dangerous, * so proceed with caution. Other credential providers should be preferred if * at all possible. If using this option, you should make sure that the shared * credentials file is as locked down as possible using security best practices * for your operating system. * * ## Using custom profiles * * The SDK supports loading credentials for separate profiles. This can be done * in two ways: * * 1. Set the `AWS_PROFILE` environment variable in your process prior to * loading the SDK. * 2. Directly load the AWS.ProcessCredentials provider: * * ```javascript * var creds = new AWS.ProcessCredentials({profile: 'myprofile'}); * AWS.config.credentials = creds; * ``` * * @!macro nobrowser */ AWS.ProcessCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new ProcessCredentials object. * * @param options [map] a set of options * @option options profile [String] (AWS_PROFILE env var or 'default') * the name of the profile to load. * @option options filename [String] ('~/.aws/credentials' or defined by * AWS_SHARED_CREDENTIALS_FILE process env var) * the filename to use when loading credentials. * @option options callback [Function] (err) Credentials are eagerly loaded * by the constructor. When the callback is called with no error, the * credentials have been loaded successfully. */ constructor: function ProcessCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.filename = options.filename; this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; this.get(options.callback || AWS.util.fn.noop); }, /** * @api private */ load: function load(callback) { var self = this; try { var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); var profile = profiles[this.profile] || {}; if (Object.keys(profile).length === 0) { throw AWS.util.error( new Error('Profile ' + this.profile + ' not found'), { code: 'ProcessCredentialsProviderFailure' } ); } if (profile['credential_process']) { this.loadViaCredentialProcess(profile, function(err, data) { if (err) { callback(err, null); } else { self.expired = false; self.accessKeyId = data.AccessKeyId; self.secretAccessKey = data.SecretAccessKey; self.sessionToken = data.SessionToken; if (data.Expiration) { self.expireTime = new Date(data.Expiration); } callback(null); } }); } else { throw AWS.util.error( new Error('Profile ' + this.profile + ' did not include credential process'), { code: 'ProcessCredentialsProviderFailure' } ); } } catch (err) { callback(err); } }, /** * Executes the credential_process and retrieves * credentials from the output * @api private * @param profile [map] credentials profile * @throws ProcessCredentialsProviderFailure */ loadViaCredentialProcess: function loadViaCredentialProcess(profile, callback) { proc.exec(profile['credential_process'], function(err, stdOut, stdErr) { if (err) { callback(AWS.util.error( new Error('credential_process returned error'), { code: 'ProcessCredentialsProviderFailure'} ), null); } else { try { var credData = JSON.parse(stdOut); if (credData.Expiration) { var currentTime = AWS.util.date.getDate(); var expireTime = new Date(credData.Expiration); if (expireTime < currentTime) { throw Error('credential_process returned expired credentials'); } } if (credData.Version !== 1) { throw Error('credential_process does not return Version == 1'); } callback(null, credData); } catch (err) { callback(AWS.util.error( new Error(err.message), { code: 'ProcessCredentialsProviderFailure'} ), null); } } }); }, /** * Loads the credentials from the credential process * * @callback callback function(err) * Called after the credential process has been executed. When this * callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { iniLoader.clearCachedFiles(); this.coalesceRefresh(callback || AWS.util.fn.callback); } }); /***/ }), /***/ 88764: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437), ENV_RELATIVE_URI = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI', ENV_FULL_URI = 'AWS_CONTAINER_CREDENTIALS_FULL_URI', ENV_AUTH_TOKEN = 'AWS_CONTAINER_AUTHORIZATION_TOKEN', FULL_URI_UNRESTRICTED_PROTOCOLS = ['https:'], FULL_URI_ALLOWED_PROTOCOLS = ['http:', 'https:'], FULL_URI_ALLOWED_HOSTNAMES = ['localhost', '127.0.0.1'], RELATIVE_URI_HOST = '169.254.170.2'; /** * Represents credentials received from specified URI. * * This class will request refreshable credentials from the relative URI * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials * are returned in the response, these will be used with zero configuration. * * This credentials class will by default timeout after 1 second of inactivity * and retry 3 times. * If your requests to the relative URI are timing out, you can increase * the value by configuring them directly: * * ```javascript * AWS.config.credentials = new AWS.RemoteCredentials({ * httpOptions: { timeout: 5000 }, // 5 second timeout * maxRetries: 10, // retry 10 times * retryDelayOptions: { base: 200 } // see AWS.Config for information * }); * ``` * * @see AWS.Config.retryDelayOptions * * @!macro nobrowser */ AWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, { constructor: function RemoteCredentials(options) { AWS.Credentials.call(this); options = options ? AWS.util.copy(options) : {}; if (!options.httpOptions) options.httpOptions = {}; options.httpOptions = AWS.util.merge( this.httpOptions, options.httpOptions); AWS.util.update(this, options); }, /** * @api private */ httpOptions: { timeout: 1000 }, /** * @api private */ maxRetries: 3, /** * @api private */ isConfiguredForEcsCredentials: function isConfiguredForEcsCredentials() { return Boolean( process && process.env && (process.env[ENV_RELATIVE_URI] || process.env[ENV_FULL_URI]) ); }, /** * @api private */ getECSFullUri: function getECSFullUri() { if (process && process.env) { var relative = process.env[ENV_RELATIVE_URI], full = process.env[ENV_FULL_URI]; if (relative) { return 'http://' + RELATIVE_URI_HOST + relative; } else if (full) { var parsed = AWS.util.urlParse(full); if (FULL_URI_ALLOWED_PROTOCOLS.indexOf(parsed.protocol) < 0) { throw AWS.util.error( new Error('Unsupported protocol: AWS.RemoteCredentials supports ' + FULL_URI_ALLOWED_PROTOCOLS.join(',') + ' only; ' + parsed.protocol + ' requested.'), { code: 'ECSCredentialsProviderFailure' } ); } if (FULL_URI_UNRESTRICTED_PROTOCOLS.indexOf(parsed.protocol) < 0 && FULL_URI_ALLOWED_HOSTNAMES.indexOf(parsed.hostname) < 0) { throw AWS.util.error( new Error('Unsupported hostname: AWS.RemoteCredentials only supports ' + FULL_URI_ALLOWED_HOSTNAMES.join(',') + ' for ' + parsed.protocol + '; ' + parsed.protocol + '//' + parsed.hostname + ' requested.'), { code: 'ECSCredentialsProviderFailure' } ); } return full; } else { throw AWS.util.error( new Error('Variable ' + ENV_RELATIVE_URI + ' or ' + ENV_FULL_URI + ' must be set to use AWS.RemoteCredentials.'), { code: 'ECSCredentialsProviderFailure' } ); } } else { throw AWS.util.error( new Error('No process info available'), { code: 'ECSCredentialsProviderFailure' } ); } }, /** * @api private */ getECSAuthToken: function getECSAuthToken() { if (process && process.env && process.env[ENV_FULL_URI]) { return process.env[ENV_AUTH_TOKEN]; } }, /** * @api private */ credsFormatIsValid: function credsFormatIsValid(credData) { return (!!credData.accessKeyId && !!credData.secretAccessKey && !!credData.sessionToken && !!credData.expireTime); }, /** * @api private */ formatCreds: function formatCreds(credData) { if (!!credData.credentials) { credData = credData.credentials; } return { expired: false, accessKeyId: credData.accessKeyId || credData.AccessKeyId, secretAccessKey: credData.secretAccessKey || credData.SecretAccessKey, sessionToken: credData.sessionToken || credData.Token, expireTime: new Date(credData.expiration || credData.Expiration) }; }, /** * @api private */ request: function request(url, callback) { var httpRequest = new AWS.HttpRequest(url); httpRequest.method = 'GET'; httpRequest.headers.Accept = 'application/json'; var token = this.getECSAuthToken(); if (token) { httpRequest.headers.Authorization = token; } AWS.util.handleRequestWithRetries(httpRequest, this, callback); }, /** * Loads the credentials from the relative URI specified by container * * @callback callback function(err) * Called when the request to the relative URI responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, `sessionToken`, and `expireTime` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ load: function load(callback) { var self = this; var fullUri; try { fullUri = this.getECSFullUri(); } catch (err) { callback(err); return; } this.request(fullUri, function(err, data) { if (!err) { try { data = JSON.parse(data); var creds = self.formatCreds(data); if (!self.credsFormatIsValid(creds)) { throw AWS.util.error( new Error('Response data is not in valid format'), { code: 'ECSCredentialsProviderFailure' } ); } AWS.util.update(self, creds); } catch (dataError) { err = dataError; } } callback(err, creds); }); } }); /***/ }), /***/ 15037: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); /** * Represents credentials retrieved from STS SAML support. * * By default this provider gets credentials using the * {AWS.STS.assumeRoleWithSAML} service operation. This operation * requires a `RoleArn` containing the ARN of the IAM trust policy for the * application for which credentials will be given, as well as a `PrincipalArn` * representing the ARN for the SAML identity provider. In addition, the * `SAMLAssertion` must be set to the token provided by the identity * provider. See {constructor} for an example on creating a credentials * object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values. * * ## Refreshing Credentials from Identity Service * * In addition to AWS credentials expiring after a given amount of time, the * login token from the identity provider will also expire. Once this token * expires, it will not be usable to refresh AWS credentials, and another * token will be needed. The SDK does not manage refreshing of the token value, * but this can be done through a "refresh token" supported by most identity * providers. Consult the documentation for the identity provider for refreshing * tokens. Once the refreshed token is acquired, you should make sure to update * this new token in the credentials object's {params} property. The following * code will update the SAMLAssertion, assuming you have retrieved an updated * token from the identity provider: * * ```javascript * AWS.config.credentials.params.SAMLAssertion = updatedToken; * ``` * * Future calls to `credentials.refresh()` will now use the new token. * * @!attribute params * @return [map] the map of params passed to * {AWS.STS.assumeRoleWithSAML}. To update the token, set the * `params.SAMLAssertion` property. */ AWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new credentials object. * @param (see AWS.STS.assumeRoleWithSAML) * @example Creating a new credentials object * AWS.config.credentials = new AWS.SAMLCredentials({ * RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole', * PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal', * SAMLAssertion: 'base64-token', // base64-encoded token from IdP * }); * @see AWS.STS.assumeRoleWithSAML */ constructor: function SAMLCredentials(params) { AWS.Credentials.call(this); this.expired = true; this.params = params; }, /** * Refreshes credentials using {AWS.STS.assumeRoleWithSAML} * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ load: function load(callback) { var self = this; self.createClients(); self.service.assumeRoleWithSAML(function (err, data) { if (!err) { self.service.credentialsFrom(data, self); } callback(err); }); }, /** * @api private */ createClients: function() { this.service = this.service || new STS({params: this.params}); } }); /***/ }), /***/ 13754: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); var iniLoader = AWS.util.iniLoader; var ASSUME_ROLE_DEFAULT_REGION = 'us-east-1'; /** * Represents credentials loaded from shared credentials file * (defaulting to ~/.aws/credentials or defined by the * `AWS_SHARED_CREDENTIALS_FILE` environment variable). * * ## Using the shared credentials file * * This provider is checked by default in the Node.js environment. To use the * credentials file provider, simply add your access and secret keys to the * ~/.aws/credentials file in the following format: * * [default] * aws_access_key_id = AKID... * aws_secret_access_key = YOUR_SECRET_KEY * * ## Using custom profiles * * The SDK supports loading credentials for separate profiles. This can be done * in two ways: * * 1. Set the `AWS_PROFILE` environment variable in your process prior to * loading the SDK. * 2. Directly load the AWS.SharedIniFileCredentials provider: * * ```javascript * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'}); * AWS.config.credentials = creds; * ``` * * @!macro nobrowser */ AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new SharedIniFileCredentials object. * * @param options [map] a set of options * @option options profile [String] (AWS_PROFILE env var or 'default') * the name of the profile to load. * @option options filename [String] ('~/.aws/credentials' or defined by * AWS_SHARED_CREDENTIALS_FILE process env var) * the filename to use when loading credentials. * @option options disableAssumeRole [Boolean] (false) True to disable * support for profiles that assume an IAM role. If true, and an assume * role profile is selected, an error is raised. * @option options preferStaticCredentials [Boolean] (false) True to * prefer static credentials to role_arn if both are present. * @option options tokenCodeFn [Function] (null) Function to provide * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini * file. Function is called with value of mfa_serial and callback, and * should provide the TokenCode or an error to the callback in the format * callback(err, token) * @option options callback [Function] (err) Credentials are eagerly loaded * by the constructor. When the callback is called with no error, the * credentials have been loaded successfully. * @option options httpOptions [map] A set of options to pass to the low-level * HTTP request. Currently supported options are: * * **proxy** [String] — the URL to proxy requests through * * **agent** [http.Agent, https.Agent] — the Agent object to perform * HTTP requests with. Used for connection pooling. Defaults to the global * agent (`http.globalAgent`) for non-SSL connections. Note that for * SSL connections, a special Agent object is used in order to enable * peer certificate verification. This feature is only available in the * Node.js environment. * * **connectTimeout** [Integer] — Sets the socket to timeout after * failing to establish a connection with the server after * `connectTimeout` milliseconds. This timeout has no effect once a socket * connection has been established. * * **timeout** [Integer] — The number of milliseconds a request can * take before automatically being terminated. * Defaults to two minutes (120000). */ constructor: function SharedIniFileCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.filename = options.filename; this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; this.disableAssumeRole = Boolean(options.disableAssumeRole); this.preferStaticCredentials = Boolean(options.preferStaticCredentials); this.tokenCodeFn = options.tokenCodeFn || null; this.httpOptions = options.httpOptions || null; this.get(options.callback || AWS.util.fn.noop); }, /** * @api private */ load: function load(callback) { var self = this; try { var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename); var profile = profiles[this.profile] || {}; if (Object.keys(profile).length === 0) { throw AWS.util.error( new Error('Profile ' + this.profile + ' not found'), { code: 'SharedIniFileCredentialsProviderFailure' } ); } /* In the CLI, the presence of both a role_arn and static credentials have different meanings depending on how many profiles have been visited. For the first profile processed, role_arn takes precedence over any static credentials, but for all subsequent profiles, static credentials are used if present, and only in their absence will the profile's source_profile and role_arn keys be used to load another set of credentials. This var is intended to yield compatible behaviour in this sdk. */ var preferStaticCredentialsToRoleArn = Boolean( this.preferStaticCredentials && profile['aws_access_key_id'] && profile['aws_secret_access_key'] ); if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) { this.loadRoleProfile(profiles, profile, function(err, data) { if (err) { callback(err); } else { self.expired = false; self.accessKeyId = data.Credentials.AccessKeyId; self.secretAccessKey = data.Credentials.SecretAccessKey; self.sessionToken = data.Credentials.SessionToken; self.expireTime = data.Credentials.Expiration; callback(null); } }); return; } this.accessKeyId = profile['aws_access_key_id']; this.secretAccessKey = profile['aws_secret_access_key']; this.sessionToken = profile['aws_session_token']; if (!this.accessKeyId || !this.secretAccessKey) { throw AWS.util.error( new Error('Credentials not set for profile ' + this.profile), { code: 'SharedIniFileCredentialsProviderFailure' } ); } this.expired = false; callback(null); } catch (err) { callback(err); } }, /** * Loads the credentials from the shared credentials file * * @callback callback function(err) * Called after the shared INI file on disk is read and parsed. When this * callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { iniLoader.clearCachedFiles(); this.coalesceRefresh( callback || AWS.util.fn.callback, this.disableAssumeRole ); }, /** * @api private */ loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) { if (this.disableAssumeRole) { throw AWS.util.error( new Error('Role assumption profiles are disabled. ' + 'Failed to load profile ' + this.profile + ' from ' + creds.filename), { code: 'SharedIniFileCredentialsProviderFailure' } ); } var self = this; var roleArn = roleProfile['role_arn']; var roleSessionName = roleProfile['role_session_name']; var externalId = roleProfile['external_id']; var mfaSerial = roleProfile['mfa_serial']; var sourceProfileName = roleProfile['source_profile']; // From experimentation, the following behavior mimics the AWS CLI: // // 1. Use region from the profile if present. // 2. Otherwise fall back to N. Virginia (global endpoint). // // It is necessary to do the fallback explicitly, because if // 'AWS_STS_REGIONAL_ENDPOINTS=regional', the underlying STS client will // otherwise throw an error if region is left 'undefined'. // // Experimentation shows that the AWS CLI (tested at version 1.18.136) // ignores the following potential sources of a region for the purposes of // this AssumeRole call: // // - The [default] profile // - The AWS_REGION environment variable // // Ignoring the [default] profile for the purposes of AssumeRole is arguably // a bug in the CLI since it does use the [default] region for service // calls... but right now we're matching behavior of the other tool. var profileRegion = roleProfile['region'] || ASSUME_ROLE_DEFAULT_REGION; if (!sourceProfileName) { throw AWS.util.error( new Error('source_profile is not set using profile ' + this.profile), { code: 'SharedIniFileCredentialsProviderFailure' } ); } var sourceProfileExistanceTest = creds[sourceProfileName]; if (typeof sourceProfileExistanceTest !== 'object') { throw AWS.util.error( new Error('source_profile ' + sourceProfileName + ' using profile ' + this.profile + ' does not exist'), { code: 'SharedIniFileCredentialsProviderFailure' } ); } var sourceCredentials = new AWS.SharedIniFileCredentials( AWS.util.merge(this.options || {}, { profile: sourceProfileName, preferStaticCredentials: true }) ); this.roleArn = roleArn; var sts = new STS({ credentials: sourceCredentials, region: profileRegion, httpOptions: this.httpOptions }); var roleParams = { RoleArn: roleArn, RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now() }; if (externalId) { roleParams.ExternalId = externalId; } if (mfaSerial && self.tokenCodeFn) { roleParams.SerialNumber = mfaSerial; self.tokenCodeFn(mfaSerial, function(err, token) { if (err) { var message; if (err instanceof Error) { message = err.message; } else { message = err; } callback( AWS.util.error( new Error('Error fetching MFA token: ' + message), { code: 'SharedIniFileCredentialsProviderFailure' } )); return; } roleParams.TokenCode = token; sts.assumeRole(roleParams, callback); }); return; } sts.assumeRole(roleParams, callback); } }); /***/ }), /***/ 77360: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); /** * Represents temporary credentials retrieved from {AWS.STS}. Without any * extra parameters, credentials will be fetched from the * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the * {AWS.STS.assumeRole} operation will be used to fetch credentials for the * role instead. * * @note AWS.TemporaryCredentials is deprecated, but remains available for * backwards compatibility. {AWS.ChainableTemporaryCredentials} is the * preferred class for temporary credentials. * * To setup temporary credentials, configure a set of master credentials * using the standard credentials providers (environment, EC2 instance metadata, * or from the filesystem), then set the global credentials to a new * temporary credentials object: * * ```javascript * // Note that environment credentials are loaded by default, * // the following line is shown for clarity: * AWS.config.credentials = new AWS.EnvironmentCredentials('AWS'); * * // Now set temporary credentials seeded from the master credentials * AWS.config.credentials = new AWS.TemporaryCredentials(); * * // subsequent requests will now use temporary credentials from AWS STS. * new AWS.S3().listBucket(function(err, data) { ... }); * ``` * * @!attribute masterCredentials * @return [AWS.Credentials] the master (non-temporary) credentials used to * get and refresh temporary credentials from AWS STS. * @note (see constructor) */ AWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new temporary credentials object. * * @note In order to create temporary credentials, you first need to have * "master" credentials configured in {AWS.Config.credentials}. These * master credentials are necessary to retrieve the temporary credentials, * as well as refresh the credentials when they expire. * @param params [map] a map of options that are passed to the * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. * If a `RoleArn` parameter is passed in, credentials will be based on the * IAM role. * @param masterCredentials [AWS.Credentials] the master (non-temporary) credentials * used to get and refresh temporary credentials from AWS STS. * @example Creating a new credentials object for generic temporary credentials * AWS.config.credentials = new AWS.TemporaryCredentials(); * @example Creating a new credentials object for an IAM role * AWS.config.credentials = new AWS.TemporaryCredentials({ * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials', * }); * @see AWS.STS.assumeRole * @see AWS.STS.getSessionToken */ constructor: function TemporaryCredentials(params, masterCredentials) { AWS.Credentials.call(this); this.loadMasterCredentials(masterCredentials); this.expired = true; this.params = params || {}; if (this.params.RoleArn) { this.params.RoleSessionName = this.params.RoleSessionName || 'temporary-credentials'; } }, /** * Refreshes credentials using {AWS.STS.assumeRole} or * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed * to the credentials {constructor}. * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh (callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ load: function load (callback) { var self = this; self.createClients(); self.masterCredentials.get(function () { self.service.config.credentials = self.masterCredentials; var operation = self.params.RoleArn ? self.service.assumeRole : self.service.getSessionToken; operation.call(self.service, function (err, data) { if (!err) { self.service.credentialsFrom(data, self); } callback(err); }); }); }, /** * @api private */ loadMasterCredentials: function loadMasterCredentials (masterCredentials) { this.masterCredentials = masterCredentials || AWS.config.credentials; while (this.masterCredentials.masterCredentials) { this.masterCredentials = this.masterCredentials.masterCredentials; } if (typeof this.masterCredentials.get !== 'function') { this.masterCredentials = new AWS.Credentials(this.masterCredentials); } }, /** * @api private */ createClients: function () { this.service = this.service || new STS({params: this.params}); } }); /***/ }), /***/ 11017: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var fs = __webpack_require__(35747); var STS = __webpack_require__(57513); var iniLoader = AWS.util.iniLoader; /** * Represents OIDC credentials from a file on disk * If the credentials expire, the SDK can {refresh} the credentials * from the file. * * ## Using the web identity token file * * This provider is checked by default in the Node.js environment. To use * the provider simply add your OIDC token to a file (ASCII encoding) and * share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment * variable or web_identity_token_file shared config variable * * The file contains encoded OIDC token and the characters are * ASCII encoded. OIDC tokens are JSON Web Tokens (JWT). * JWT's are 3 base64 encoded strings joined by the '.' character. * * This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE * environment variable or web_identity_token_file shared config variable, * and get the OIDC token from filename. * It will also read IAM role to be assumed from AWS_ROLE_ARN * environment variable or role_arn shared config variable. * This provider gets credetials using the {AWS.STS.assumeRoleWithWebIdentity} * service operation * * @!macro nobrowser */ AWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { /** * @example Creating a new credentials object * AWS.config.credentials = new AWS.TokenFileWebIdentityCredentials( * // optionally provide configuration to apply to the underlying AWS.STS service client * // if configuration is not provided, then configuration will be pulled from AWS.config * { * // specify timeout options * httpOptions: { * timeout: 100 * } * }); * @see AWS.Config */ constructor: function TokenFileWebIdentityCredentials(clientConfig) { AWS.Credentials.call(this); this.data = null; this.clientConfig = AWS.util.copy(clientConfig || {}); }, /** * Returns params from environment variables * * @api private */ getParamsFromEnv: function getParamsFromEnv() { var ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE', ENV_ROLE_ARN = 'AWS_ROLE_ARN'; if (process.env[ENV_TOKEN_FILE] && process.env[ENV_ROLE_ARN]) { return [{ envTokenFile: process.env[ENV_TOKEN_FILE], roleArn: process.env[ENV_ROLE_ARN], roleSessionName: process.env['AWS_ROLE_SESSION_NAME'] }]; } }, /** * Returns params from shared config variables * * @api private */ getParamsFromSharedConfig: function getParamsFromSharedConfig() { var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader); var profileName = process.env.AWS_PROFILE || AWS.util.defaultProfile; var profile = profiles[profileName] || {}; if (Object.keys(profile).length === 0) { throw AWS.util.error( new Error('Profile ' + profileName + ' not found'), { code: 'TokenFileWebIdentityCredentialsProviderFailure' } ); } var paramsArray = []; while (!profile['web_identity_token_file'] && profile['source_profile']) { paramsArray.unshift({ roleArn: profile['role_arn'], roleSessionName: profile['role_session_name'] }); var sourceProfile = profile['source_profile']; profile = profiles[sourceProfile]; } paramsArray.unshift({ envTokenFile: profile['web_identity_token_file'], roleArn: profile['role_arn'], roleSessionName: profile['role_session_name'] }); return paramsArray; }, /** * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see AWS.Credentials.get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ assumeRoleChaining: function assumeRoleChaining(paramsArray, callback) { var self = this; if (paramsArray.length === 0) { self.service.credentialsFrom(self.data, self); callback(); } else { var params = paramsArray.shift(); self.service.config.credentials = self.service.credentialsFrom(self.data, self); self.service.assumeRole( { RoleArn: params.roleArn, RoleSessionName: params.roleSessionName || 'token-file-web-identity' }, function (err, data) { self.data = null; if (err) { callback(err); } else { self.data = data; self.assumeRoleChaining(paramsArray, callback); } } ); } }, /** * @api private */ load: function load(callback) { var self = this; try { var paramsArray = self.getParamsFromEnv(); if (!paramsArray) { paramsArray = self.getParamsFromSharedConfig(); } if (paramsArray) { var params = paramsArray.shift(); var oidcToken = fs.readFileSync(params.envTokenFile, {encoding: 'ascii'}); if (!self.service) { self.createClients(); } self.service.assumeRoleWithWebIdentity( { WebIdentityToken: oidcToken, RoleArn: params.roleArn, RoleSessionName: params.roleSessionName || 'token-file-web-identity' }, function (err, data) { self.data = null; if (err) { callback(err); } else { self.data = data; self.assumeRoleChaining(paramsArray, callback); } } ); } } catch (err) { callback(err); } }, /** * @api private */ createClients: function() { if (!this.service) { var stsConfig = AWS.util.merge({}, this.clientConfig); this.service = new STS(stsConfig); // Retry in case of IDPCommunicationErrorException or InvalidIdentityToken this.service.retryableError = function(error) { if (error.code === 'IDPCommunicationErrorException' || error.code === 'InvalidIdentityToken') { return true; } else { return AWS.Service.prototype.retryableError.call(this, error); } }; } } }); /***/ }), /***/ 74998: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var STS = __webpack_require__(57513); /** * Represents credentials retrieved from STS Web Identity Federation support. * * By default this provider gets credentials using the * {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation * requires a `RoleArn` containing the ARN of the IAM trust policy for the * application for which credentials will be given. In addition, the * `WebIdentityToken` must be set to the token provided by the identity * provider. See {constructor} for an example on creating a credentials * object with proper `RoleArn` and `WebIdentityToken` values. * * ## Refreshing Credentials from Identity Service * * In addition to AWS credentials expiring after a given amount of time, the * login token from the identity provider will also expire. Once this token * expires, it will not be usable to refresh AWS credentials, and another * token will be needed. The SDK does not manage refreshing of the token value, * but this can be done through a "refresh token" supported by most identity * providers. Consult the documentation for the identity provider for refreshing * tokens. Once the refreshed token is acquired, you should make sure to update * this new token in the credentials object's {params} property. The following * code will update the WebIdentityToken, assuming you have retrieved an updated * token from the identity provider: * * ```javascript * AWS.config.credentials.params.WebIdentityToken = updatedToken; * ``` * * Future calls to `credentials.refresh()` will now use the new token. * * @!attribute params * @return [map] the map of params passed to * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the * `params.WebIdentityToken` property. * @!attribute data * @return [map] the raw data response from the call to * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get * access to other properties from the response. */ AWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, { /** * Creates a new credentials object. * @param (see AWS.STS.assumeRoleWithWebIdentity) * @example Creating a new credentials object * AWS.config.credentials = new AWS.WebIdentityCredentials({ * RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity', * WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service * RoleSessionName: 'web' // optional name, defaults to web-identity * }, { * // optionally provide configuration to apply to the underlying AWS.STS service client * // if configuration is not provided, then configuration will be pulled from AWS.config * * // specify timeout options * httpOptions: { * timeout: 100 * } * }); * @see AWS.STS.assumeRoleWithWebIdentity * @see AWS.Config */ constructor: function WebIdentityCredentials(params, clientConfig) { AWS.Credentials.call(this); this.expired = true; this.params = params; this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity'; this.data = null; this._clientConfig = AWS.util.copy(clientConfig || {}); }, /** * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity} * * @callback callback function(err) * Called when the STS service responds (or fails). When * this callback is called with no error, it means that the credentials * information has been loaded into the object (as the `accessKeyId`, * `secretAccessKey`, and `sessionToken` properties). * @param err [Error] if an error occurred, this value will be filled * @see get */ refresh: function refresh(callback) { this.coalesceRefresh(callback || AWS.util.fn.callback); }, /** * @api private */ load: function load(callback) { var self = this; self.createClients(); self.service.assumeRoleWithWebIdentity(function (err, data) { self.data = null; if (!err) { self.data = data; self.service.credentialsFrom(data, self); } callback(err); }); }, /** * @api private */ createClients: function() { if (!this.service) { var stsConfig = AWS.util.merge({}, this._clientConfig); stsConfig.params = this.params; this.service = new STS(stsConfig); } } }); /***/ }), /***/ 45313: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = __webpack_require__(77985); var endpointDiscoveryEnabledEnvs = ['AWS_ENABLE_ENDPOINT_DISCOVERY', 'AWS_ENDPOINT_DISCOVERY_ENABLED']; /** * Generate key (except resources and operation part) to index the endpoints in the cache * If input shape has endpointdiscoveryid trait then use * accessKey + operation + resources + region + service as cache key * If input shape doesn't have endpointdiscoveryid trait then use * accessKey + region + service as cache key * @return [map] object with keys to index endpoints. * @api private */ function getCacheKey(request) { var service = request.service; var api = service.api || {}; var operations = api.operations; var identifiers = {}; if (service.config.region) { identifiers.region = service.config.region; } if (api.serviceId) { identifiers.serviceId = api.serviceId; } if (service.config.credentials.accessKeyId) { identifiers.accessKeyId = service.config.credentials.accessKeyId; } return identifiers; } /** * Recursive helper for marshallCustomIdentifiers(). * Looks for required string input members that have 'endpointdiscoveryid' trait. * @api private */ function marshallCustomIdentifiersHelper(result, params, shape) { if (!shape || params === undefined || params === null) return; if (shape.type === 'structure' && shape.required && shape.required.length > 0) { util.arrayEach(shape.required, function(name) { var memberShape = shape.members[name]; if (memberShape.endpointDiscoveryId === true) { var locationName = memberShape.isLocationName ? memberShape.name : name; result[locationName] = String(params[name]); } else { marshallCustomIdentifiersHelper(result, params[name], memberShape); } }); } } /** * Get custom identifiers for cache key. * Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait. * @param [object] request object * @param [object] input shape of the given operation's api * @api private */ function marshallCustomIdentifiers(request, shape) { var identifiers = {}; marshallCustomIdentifiersHelper(identifiers, request.params, shape); return identifiers; } /** * Call endpoint discovery operation when it's optional. * When endpoint is available in cache then use the cached endpoints. If endpoints * are unavailable then use regional endpoints and call endpoint discovery operation * asynchronously. This is turned off by default. * @param [object] request object * @api private */ function optionalDiscoverEndpoint(request) { var service = request.service; var api = service.api; var operationModel = api.operations ? api.operations[request.operation] : undefined; var inputShape = operationModel ? operationModel.input : undefined; var identifiers = marshallCustomIdentifiers(request, inputShape); var cacheKey = getCacheKey(request); if (Object.keys(identifiers).length > 0) { cacheKey = util.update(cacheKey, identifiers); if (operationModel) cacheKey.operation = operationModel.name; } var endpoints = AWS.endpointCache.get(cacheKey); if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { //endpoint operation is being made but response not yet received //or endpoint operation just failed in 1 minute return; } else if (endpoints && endpoints.length > 0) { //found endpoint record from cache request.httpRequest.updateEndpoint(endpoints[0].Address); } else { //endpoint record not in cache or outdated. make discovery operation var endpointRequest = service.makeRequest(api.endpointOperation, { Operation: operationModel.name, Identifiers: identifiers, }); addApiVersionHeader(endpointRequest); endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); endpointRequest.removeListener('retry', AWS.EventListeners.Core.RETRY_CHECK); //put in a placeholder for endpoints already requested, prevent //too much in-flight calls AWS.endpointCache.put(cacheKey, [{ Address: '', CachePeriodInMinutes: 1 }]); endpointRequest.send(function(err, data) { if (data && data.Endpoints) { AWS.endpointCache.put(cacheKey, data.Endpoints); } else if (err) { AWS.endpointCache.put(cacheKey, [{ Address: '', CachePeriodInMinutes: 1 //not to make more endpoint operation in next 1 minute }]); } }); } } var requestQueue = {}; /** * Call endpoint discovery operation when it's required. * When endpoint is available in cache then use cached ones. If endpoints are * unavailable then SDK should call endpoint operation then use returned new * endpoint for the api call. SDK will automatically attempt to do endpoint * discovery. This is turned off by default * @param [object] request object * @api private */ function requiredDiscoverEndpoint(request, done) { var service = request.service; var api = service.api; var operationModel = api.operations ? api.operations[request.operation] : undefined; var inputShape = operationModel ? operationModel.input : undefined; var identifiers = marshallCustomIdentifiers(request, inputShape); var cacheKey = getCacheKey(request); if (Object.keys(identifiers).length > 0) { cacheKey = util.update(cacheKey, identifiers); if (operationModel) cacheKey.operation = operationModel.name; } var cacheKeyStr = AWS.EndpointCache.getKeyString(cacheKey); var endpoints = AWS.endpointCache.get(cacheKeyStr); //endpoint cache also accepts string keys if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') { //endpoint operation is being made but response not yet received //push request object to a pending queue if (!requestQueue[cacheKeyStr]) requestQueue[cacheKeyStr] = []; requestQueue[cacheKeyStr].push({request: request, callback: done}); return; } else if (endpoints && endpoints.length > 0) { request.httpRequest.updateEndpoint(endpoints[0].Address); done(); } else { var endpointRequest = service.makeRequest(api.endpointOperation, { Operation: operationModel.name, Identifiers: identifiers, }); endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); addApiVersionHeader(endpointRequest); //put in a placeholder for endpoints already requested, prevent //too much in-flight calls AWS.endpointCache.put(cacheKeyStr, [{ Address: '', CachePeriodInMinutes: 60 //long-live cache }]); endpointRequest.send(function(err, data) { if (err) { request.response.error = util.error(err, { retryable: false }); AWS.endpointCache.remove(cacheKey); //fail all the pending requests in batch if (requestQueue[cacheKeyStr]) { var pendingRequests = requestQueue[cacheKeyStr]; util.arrayEach(pendingRequests, function(requestContext) { requestContext.request.response.error = util.error(err, { retryable: false }); requestContext.callback(); }); delete requestQueue[cacheKeyStr]; } } else if (data) { AWS.endpointCache.put(cacheKeyStr, data.Endpoints); request.httpRequest.updateEndpoint(data.Endpoints[0].Address); //update the endpoint for all the pending requests in batch if (requestQueue[cacheKeyStr]) { var pendingRequests = requestQueue[cacheKeyStr]; util.arrayEach(pendingRequests, function(requestContext) { requestContext.request.httpRequest.updateEndpoint(data.Endpoints[0].Address); requestContext.callback(); }); delete requestQueue[cacheKeyStr]; } } done(); }); } } /** * add api version header to endpoint operation * @api private */ function addApiVersionHeader(endpointRequest) { var api = endpointRequest.service.api; var apiVersion = api.apiVersion; if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) { endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion; } } /** * If api call gets invalid endpoint exception, SDK should attempt to remove the invalid * endpoint from cache. * @api private */ function invalidateCachedEndpoints(response) { var error = response.error; var httpResponse = response.httpResponse; if (error && (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) ) { var request = response.request; var operations = request.service.api.operations || {}; var inputShape = operations[request.operation] ? operations[request.operation].input : undefined; var identifiers = marshallCustomIdentifiers(request, inputShape); var cacheKey = getCacheKey(request); if (Object.keys(identifiers).length > 0) { cacheKey = util.update(cacheKey, identifiers); if (operations[request.operation]) cacheKey.operation = operations[request.operation].name; } AWS.endpointCache.remove(cacheKey); } } /** * If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime. * @param [object] client Service client object. * @api private */ function hasCustomEndpoint(client) { //if set endpoint is set for specific client, enable endpoint discovery will raise an error. if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.' }); }; var svcConfig = AWS.config[client.serviceIdentifier] || {}; return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint)); } /** * @api private */ function isFalsy(value) { return ['false', '0'].indexOf(value) >= 0; } /** * If endpoint discovery should perform for this request when no operation requires endpoint * discovery for the given service. * SDK performs config resolution in order like below: * 1. If set in client configuration. * 2. If set in env AWS_ENABLE_ENDPOINT_DISCOVERY. * 3. If set in shared ini config file with key 'endpoint_discovery_enabled'. * @param [object] request request object. * @returns [boolean|undefined] if endpoint discovery config is not set in any source, this * function returns undefined * @api private */ function resolveEndpointDiscoveryConfig(request) { var service = request.service || {}; if (service.config.endpointDiscoveryEnabled !== undefined) { return service.config.endpointDiscoveryEnabled; } //shared ini file is only available in Node //not to check env in browser if (util.isBrowser()) return undefined; // If any of recognized endpoint discovery config env is set for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) { var env = endpointDiscoveryEnabledEnvs[i]; if (Object.prototype.hasOwnProperty.call(process.env, env)) { if (process.env[env] === '' || process.env[env] === undefined) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'environmental variable ' + env + ' cannot be set to nothing' }); } return !isFalsy(process.env[env]); } } var configFile = {}; try { configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({ isConfig: true, filename: process.env[AWS.util.sharedConfigFileEnv] }) : {}; } catch (e) {} var sharedFileConfig = configFile[ process.env.AWS_PROFILE || AWS.util.defaultProfile ] || {}; if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) { if (sharedFileConfig.endpoint_discovery_enabled === undefined) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing' }); } return !isFalsy(sharedFileConfig.endpoint_discovery_enabled); } return undefined; } /** * attach endpoint discovery logic to request object * @param [object] request * @api private */ function discoverEndpoint(request, done) { var service = request.service || {}; if (hasCustomEndpoint(service) || request.isPresigned()) return done(); var operations = service.api.operations || {}; var operationModel = operations[request.operation]; var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL'; var isEnabled = resolveEndpointDiscoveryConfig(request); var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery; if (isEnabled || hasRequiredEndpointDiscovery) { // Once a customer enables endpoint discovery, the SDK should start appending // the string endpoint-discovery to the user-agent on all requests. request.httpRequest.appendToUserAgent('endpoint-discovery'); } switch (isEndpointDiscoveryRequired) { case 'OPTIONAL': if (isEnabled || hasRequiredEndpointDiscovery) { // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery // by default for all operations of that service, including operations where endpoint discovery is optional. optionalDiscoverEndpoint(request); request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); } done(); break; case 'REQUIRED': if (isEnabled === false) { // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client, // then the SDK must return a clear and actionable exception. request.response.error = util.error(new Error(), { code: 'ConfigurationException', message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation + '() requires it. Please check your configurations.' }); done(); break; } request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints); requiredDiscoverEndpoint(request, done); break; case 'NULL': default: done(); break; } } module.exports = { discoverEndpoint: discoverEndpoint, requiredDiscoverEndpoint: requiredDiscoverEndpoint, optionalDiscoverEndpoint: optionalDiscoverEndpoint, marshallCustomIdentifiers: marshallCustomIdentifiers, getCacheKey: getCacheKey, invalidateCachedEndpoint: invalidateCachedEndpoints, }; /***/ }), /***/ 76663: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = AWS.util; var typeOf = __webpack_require__(48084).typeOf; var DynamoDBSet = __webpack_require__(20304); var NumberValue = __webpack_require__(91593); AWS.DynamoDB.Converter = { /** * Convert a JavaScript value to its equivalent DynamoDB AttributeValue type * * @param data [any] The data to convert to a DynamoDB AttributeValue * @param options [map] * @option options convertEmptyValues [Boolean] Whether to automatically * convert empty strings, blobs, * and sets to `null` * @option options wrapNumbers [Boolean] Whether to return numbers as a * NumberValue object instead of * converting them to native JavaScript * numbers. This allows for the safe * round-trip transport of numbers of * arbitrary size. * @return [map] An object in the Amazon DynamoDB AttributeValue format * * @see AWS.DynamoDB.Converter.marshall AWS.DynamoDB.Converter.marshall to * convert entire records (rather than individual attributes) */ input: function convertInput(data, options) { options = options || {}; var type = typeOf(data); if (type === 'Object') { return formatMap(data, options); } else if (type === 'Array') { return formatList(data, options); } else if (type === 'Set') { return formatSet(data, options); } else if (type === 'String') { if (data.length === 0 && options.convertEmptyValues) { return convertInput(null); } return { S: data }; } else if (type === 'Number' || type === 'NumberValue') { return { N: data.toString() }; } else if (type === 'Binary') { if (data.length === 0 && options.convertEmptyValues) { return convertInput(null); } return { B: data }; } else if (type === 'Boolean') { return { BOOL: data }; } else if (type === 'null') { return { NULL: true }; } else if (type !== 'undefined' && type !== 'Function') { // this value has a custom constructor return formatMap(data, options); } }, /** * Convert a JavaScript object into a DynamoDB record. * * @param data [any] The data to convert to a DynamoDB record * @param options [map] * @option options convertEmptyValues [Boolean] Whether to automatically * convert empty strings, blobs, * and sets to `null` * @option options wrapNumbers [Boolean] Whether to return numbers as a * NumberValue object instead of * converting them to native JavaScript * numbers. This allows for the safe * round-trip transport of numbers of * arbitrary size. * * @return [map] An object in the DynamoDB record format. * * @example Convert a JavaScript object into a DynamoDB record * var marshalled = AWS.DynamoDB.Converter.marshall({ * string: 'foo', * list: ['fizz', 'buzz', 'pop'], * map: { * nestedMap: { * key: 'value', * } * }, * number: 123, * nullValue: null, * boolValue: true, * stringSet: new DynamoDBSet(['foo', 'bar', 'baz']) * }); */ marshall: function marshallItem(data, options) { return AWS.DynamoDB.Converter.input(data, options).M; }, /** * Convert a DynamoDB AttributeValue object to its equivalent JavaScript type. * * @param data [map] An object in the Amazon DynamoDB AttributeValue format * @param options [map] * @option options convertEmptyValues [Boolean] Whether to automatically * convert empty strings, blobs, * and sets to `null` * @option options wrapNumbers [Boolean] Whether to return numbers as a * NumberValue object instead of * converting them to native JavaScript * numbers. This allows for the safe * round-trip transport of numbers of * arbitrary size. * * @return [Object|Array|String|Number|Boolean|null] * * @see AWS.DynamoDB.Converter.unmarshall AWS.DynamoDB.Converter.unmarshall to * convert entire records (rather than individual attributes) */ output: function convertOutput(data, options) { options = options || {}; var list, map, i; for (var type in data) { var values = data[type]; if (type === 'M') { map = {}; for (var key in values) { map[key] = convertOutput(values[key], options); } return map; } else if (type === 'L') { list = []; for (i = 0; i < values.length; i++) { list.push(convertOutput(values[i], options)); } return list; } else if (type === 'SS') { list = []; for (i = 0; i < values.length; i++) { list.push(values[i] + ''); } return new DynamoDBSet(list); } else if (type === 'NS') { list = []; for (i = 0; i < values.length; i++) { list.push(convertNumber(values[i], options.wrapNumbers)); } return new DynamoDBSet(list); } else if (type === 'BS') { list = []; for (i = 0; i < values.length; i++) { list.push(AWS.util.buffer.toBuffer(values[i])); } return new DynamoDBSet(list); } else if (type === 'S') { return values + ''; } else if (type === 'N') { return convertNumber(values, options.wrapNumbers); } else if (type === 'B') { return util.buffer.toBuffer(values); } else if (type === 'BOOL') { return (values === 'true' || values === 'TRUE' || values === true); } else if (type === 'NULL') { return null; } } }, /** * Convert a DynamoDB record into a JavaScript object. * * @param data [any] The DynamoDB record * @param options [map] * @option options convertEmptyValues [Boolean] Whether to automatically * convert empty strings, blobs, * and sets to `null` * @option options wrapNumbers [Boolean] Whether to return numbers as a * NumberValue object instead of * converting them to native JavaScript * numbers. This allows for the safe * round-trip transport of numbers of * arbitrary size. * * @return [map] An object whose properties have been converted from * DynamoDB's AttributeValue format into their corresponding native * JavaScript types. * * @example Convert a record received from a DynamoDB stream * var unmarshalled = AWS.DynamoDB.Converter.unmarshall({ * string: {S: 'foo'}, * list: {L: [{S: 'fizz'}, {S: 'buzz'}, {S: 'pop'}]}, * map: { * M: { * nestedMap: { * M: { * key: {S: 'value'} * } * } * } * }, * number: {N: '123'}, * nullValue: {NULL: true}, * boolValue: {BOOL: true} * }); */ unmarshall: function unmarshall(data, options) { return AWS.DynamoDB.Converter.output({M: data}, options); } }; /** * @api private * @param data [Array] * @param options [map] */ function formatList(data, options) { var list = {L: []}; for (var i = 0; i < data.length; i++) { list['L'].push(AWS.DynamoDB.Converter.input(data[i], options)); } return list; } /** * @api private * @param value [String] * @param wrapNumbers [Boolean] */ function convertNumber(value, wrapNumbers) { return wrapNumbers ? new NumberValue(value) : Number(value); } /** * @api private * @param data [map] * @param options [map] */ function formatMap(data, options) { var map = {M: {}}; for (var key in data) { var formatted = AWS.DynamoDB.Converter.input(data[key], options); if (formatted !== void 0) { map['M'][key] = formatted; } } return map; } /** * @api private */ function formatSet(data, options) { options = options || {}; var values = data.values; if (options.convertEmptyValues) { values = filterEmptySetValues(data); if (values.length === 0) { return AWS.DynamoDB.Converter.input(null); } } var map = {}; switch (data.type) { case 'String': map['SS'] = values; break; case 'Binary': map['BS'] = values; break; case 'Number': map['NS'] = values.map(function (value) { return value.toString(); }); } return map; } /** * @api private */ function filterEmptySetValues(set) { var nonEmptyValues = []; var potentiallyEmptyTypes = { String: true, Binary: true, Number: false }; if (potentiallyEmptyTypes[set.type]) { for (var i = 0; i < set.values.length; i++) { if (set.values[i].length === 0) { continue; } nonEmptyValues.push(set.values[i]); } return nonEmptyValues; } return set.values; } /** * @api private */ module.exports = AWS.DynamoDB.Converter; /***/ }), /***/ 90030: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var Translator = __webpack_require__(34222); var DynamoDBSet = __webpack_require__(20304); /** * The document client simplifies working with items in Amazon DynamoDB * by abstracting away the notion of attribute values. This abstraction * annotates native JavaScript types supplied as input parameters, as well * as converts annotated response data to native JavaScript types. * * ## Marshalling Input and Unmarshalling Response Data * * The document client affords developers the use of native JavaScript types * instead of `AttributeValue`s to simplify the JavaScript development * experience with Amazon DynamoDB. JavaScript objects passed in as parameters * are marshalled into `AttributeValue` shapes required by Amazon DynamoDB. * Responses from DynamoDB are unmarshalled into plain JavaScript objects * by the `DocumentClient`. The `DocumentClient`, does not accept * `AttributeValue`s in favor of native JavaScript types. * * | JavaScript Type | DynamoDB AttributeValue | * |:----------------------------------------------------------------------:|-------------------------| * | String | S | * | Number | N | * | Boolean | BOOL | * | null | NULL | * | Array | L | * | Object | M | * | Buffer, File, Blob, ArrayBuffer, DataView, and JavaScript typed arrays | B | * * ## Support for Sets * * The `DocumentClient` offers a convenient way to create sets from * JavaScript Arrays. The type of set is inferred from the first element * in the array. DynamoDB supports string, number, and binary sets. To * learn more about supported types see the * [Amazon DynamoDB Data Model Documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html) * For more information see {AWS.DynamoDB.DocumentClient.createSet} * */ AWS.DynamoDB.DocumentClient = AWS.util.inherit({ /** * Creates a DynamoDB document client with a set of configuration options. * * @option options params [map] An optional map of parameters to bind to every * request sent by this service object. * @option options service [AWS.DynamoDB] An optional pre-configured instance * of the AWS.DynamoDB service object to use for requests. The object may * bound parameters used by the document client. * @option options convertEmptyValues [Boolean] set to true if you would like * the document client to convert empty values (0-length strings, binary * buffers, and sets) to be converted to NULL types when persisting to * DynamoDB. * @option options wrapNumbers [Boolean] Set to true to return numbers as a * NumberValue object instead of converting them to native JavaScript numbers. * This allows for the safe round-trip transport of numbers of arbitrary size. * @see AWS.DynamoDB.constructor * */ constructor: function DocumentClient(options) { var self = this; self.options = options || {}; self.configure(self.options); }, /** * @api private */ configure: function configure(options) { var self = this; self.service = options.service; self.bindServiceObject(options); self.attrValue = options.attrValue = self.service.api.operations.putItem.input.members.Item.value.shape; }, /** * @api private */ bindServiceObject: function bindServiceObject(options) { var self = this; options = options || {}; if (!self.service) { self.service = new AWS.DynamoDB(options); } else { var config = AWS.util.copy(self.service.config); self.service = new self.service.constructor.__super__(config); self.service.config.params = AWS.util.merge(self.service.config.params || {}, options.params); } }, /** * @api private */ makeServiceRequest: function(operation, params, callback) { var self = this; var request = self.service[operation](params); self.setupRequest(request); self.setupResponse(request); if (typeof callback === 'function') { request.send(callback); } return request; }, /** * @api private */ serviceClientOperationsMap: { batchGet: 'batchGetItem', batchWrite: 'batchWriteItem', delete: 'deleteItem', get: 'getItem', put: 'putItem', query: 'query', scan: 'scan', update: 'updateItem', transactGet: 'transactGetItems', transactWrite: 'transactWriteItems' }, /** * Returns the attributes of one or more items from one or more tables * by delegating to `AWS.DynamoDB.batchGetItem()`. * * Supply the same parameters as {AWS.DynamoDB.batchGetItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.batchGetItem * @example Get items from multiple tables * var params = { * RequestItems: { * 'Table-1': { * Keys: [ * { * HashKey: 'haskey', * NumberRangeKey: 1 * } * ] * }, * 'Table-2': { * Keys: [ * { foo: 'bar' }, * ] * } * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.batchGet(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ batchGet: function(params, callback) { var operation = this.serviceClientOperationsMap['batchGet']; return this.makeServiceRequest(operation, params, callback); }, /** * Puts or deletes multiple items in one or more tables by delegating * to `AWS.DynamoDB.batchWriteItem()`. * * Supply the same parameters as {AWS.DynamoDB.batchWriteItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.batchWriteItem * @example Write to and delete from a table * var params = { * RequestItems: { * 'Table-1': [ * { * DeleteRequest: { * Key: { HashKey: 'someKey' } * } * }, * { * PutRequest: { * Item: { * HashKey: 'anotherKey', * NumAttribute: 1, * BoolAttribute: true, * ListAttribute: [1, 'two', false], * MapAttribute: { foo: 'bar' } * } * } * } * ] * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.batchWrite(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ batchWrite: function(params, callback) { var operation = this.serviceClientOperationsMap['batchWrite']; return this.makeServiceRequest(operation, params, callback); }, /** * Deletes a single item in a table by primary key by delegating to * `AWS.DynamoDB.deleteItem()` * * Supply the same parameters as {AWS.DynamoDB.deleteItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.deleteItem * @example Delete an item from a table * var params = { * TableName : 'Table', * Key: { * HashKey: 'hashkey', * NumberRangeKey: 1 * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.delete(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ delete: function(params, callback) { var operation = this.serviceClientOperationsMap['delete']; return this.makeServiceRequest(operation, params, callback); }, /** * Returns a set of attributes for the item with the given primary key * by delegating to `AWS.DynamoDB.getItem()`. * * Supply the same parameters as {AWS.DynamoDB.getItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.getItem * @example Get an item from a table * var params = { * TableName : 'Table', * Key: { * HashKey: 'hashkey' * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.get(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ get: function(params, callback) { var operation = this.serviceClientOperationsMap['get']; return this.makeServiceRequest(operation, params, callback); }, /** * Creates a new item, or replaces an old item with a new item by * delegating to `AWS.DynamoDB.putItem()`. * * Supply the same parameters as {AWS.DynamoDB.putItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.putItem * @example Create a new item in a table * var params = { * TableName : 'Table', * Item: { * HashKey: 'haskey', * NumAttribute: 1, * BoolAttribute: true, * ListAttribute: [1, 'two', false], * MapAttribute: { foo: 'bar'}, * NullAttribute: null * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.put(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ put: function(params, callback) { var operation = this.serviceClientOperationsMap['put']; return this.makeServiceRequest(operation, params, callback); }, /** * Edits an existing item's attributes, or adds a new item to the table if * it does not already exist by delegating to `AWS.DynamoDB.updateItem()`. * * Supply the same parameters as {AWS.DynamoDB.updateItem} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.updateItem * @example Update an item with expressions * var params = { * TableName: 'Table', * Key: { HashKey : 'hashkey' }, * UpdateExpression: 'set #a = :x + :y', * ConditionExpression: '#a < :MAX', * ExpressionAttributeNames: {'#a' : 'Sum'}, * ExpressionAttributeValues: { * ':x' : 20, * ':y' : 45, * ':MAX' : 100, * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.update(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ update: function(params, callback) { var operation = this.serviceClientOperationsMap['update']; return this.makeServiceRequest(operation, params, callback); }, /** * Returns one or more items and item attributes by accessing every item * in a table or a secondary index. * * Supply the same parameters as {AWS.DynamoDB.scan} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.scan * @example Scan the table with a filter expression * var params = { * TableName : 'Table', * FilterExpression : 'Year = :this_year', * ExpressionAttributeValues : {':this_year' : 2015} * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.scan(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ scan: function(params, callback) { var operation = this.serviceClientOperationsMap['scan']; return this.makeServiceRequest(operation, params, callback); }, /** * Directly access items from a table by primary key or a secondary index. * * Supply the same parameters as {AWS.DynamoDB.query} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.query * @example Query an index * var params = { * TableName: 'Table', * IndexName: 'Index', * KeyConditionExpression: 'HashKey = :hkey and RangeKey > :rkey', * ExpressionAttributeValues: { * ':hkey': 'key', * ':rkey': 2015 * } * }; * * var documentClient = new AWS.DynamoDB.DocumentClient(); * * documentClient.query(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ query: function(params, callback) { var operation = this.serviceClientOperationsMap['query']; return this.makeServiceRequest(operation, params, callback); }, /** * Synchronous write operation that groups up to 10 action requests * * Supply the same parameters as {AWS.DynamoDB.transactWriteItems} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.transactWriteItems * @example Get items from multiple tables * var params = { * TransactItems: [{ * Put: { * TableName : 'Table0', * Item: { * HashKey: 'haskey', * NumAttribute: 1, * BoolAttribute: true, * ListAttribute: [1, 'two', false], * MapAttribute: { foo: 'bar'}, * NullAttribute: null * } * } * }, { * Update: { * TableName: 'Table1', * Key: { HashKey : 'hashkey' }, * UpdateExpression: 'set #a = :x + :y', * ConditionExpression: '#a < :MAX', * ExpressionAttributeNames: {'#a' : 'Sum'}, * ExpressionAttributeValues: { * ':x' : 20, * ':y' : 45, * ':MAX' : 100, * } * } * }] * }; * * documentClient.transactWrite(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); */ transactWrite: function(params, callback) { var operation = this.serviceClientOperationsMap['transactWrite']; return this.makeServiceRequest(operation, params, callback); }, /** * Atomically retrieves multiple items from one or more tables (but not from indexes) * in a single account and region. * * Supply the same parameters as {AWS.DynamoDB.transactGetItems} with * `AttributeValue`s substituted by native JavaScript types. * * @see AWS.DynamoDB.transactGetItems * @example Get items from multiple tables * var params = { * TransactItems: [{ * Get: { * TableName : 'Table0', * Key: { * HashKey: 'hashkey0' * } * } * }, { * Get: { * TableName : 'Table1', * Key: { * HashKey: 'hashkey1' * } * } * }] * }; * * documentClient.transactGet(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); */ transactGet: function(params, callback) { var operation = this.serviceClientOperationsMap['transactGet']; return this.makeServiceRequest(operation, params, callback); }, /** * Creates a set of elements inferring the type of set from * the type of the first element. Amazon DynamoDB currently supports * the number sets, string sets, and binary sets. For more information * about DynamoDB data types see the documentation on the * [Amazon DynamoDB Data Model](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModel.DataTypes). * * @param list [Array] Collection to represent your DynamoDB Set * @param options [map] * * **validate** [Boolean] set to true if you want to validate the type * of each element in the set. Defaults to `false`. * @example Creating a number set * var documentClient = new AWS.DynamoDB.DocumentClient(); * * var params = { * Item: { * hashkey: 'hashkey' * numbers: documentClient.createSet([1, 2, 3]); * } * }; * * documentClient.put(params, function(err, data) { * if (err) console.log(err); * else console.log(data); * }); * */ createSet: function(list, options) { options = options || {}; return new DynamoDBSet(list, options); }, /** * @api private */ getTranslator: function() { return new Translator(this.options); }, /** * @api private */ setupRequest: function setupRequest(request) { var self = this; var translator = self.getTranslator(); var operation = request.operation; var inputShape = request.service.api.operations[operation].input; request._events.validate.unshift(function(req) { req.rawParams = AWS.util.copy(req.params); req.params = translator.translateInput(req.rawParams, inputShape); }); }, /** * @api private */ setupResponse: function setupResponse(request) { var self = this; var translator = self.getTranslator(); var outputShape = self.service.api.operations[request.operation].output; request.on('extractData', function(response) { response.data = translator.translateOutput(response.data, outputShape); }); var response = request.response; response.nextPage = function(cb) { var resp = this; var req = resp.request; var config; var service = req.service; var operation = req.operation; try { config = service.paginationConfig(operation, true); } catch (e) { resp.error = e; } if (!resp.hasNextPage()) { if (cb) cb(resp.error, null); else if (resp.error) throw resp.error; return null; } var params = AWS.util.copy(req.rawParams); if (!resp.nextPageTokens) { return cb ? cb(null, null) : null; } else { var inputTokens = config.inputToken; if (typeof inputTokens === 'string') inputTokens = [inputTokens]; for (var i = 0; i < inputTokens.length; i++) { params[inputTokens[i]] = resp.nextPageTokens[i]; } return self[operation](params, cb); } }; } }); /** * @api private */ module.exports = AWS.DynamoDB.DocumentClient; /***/ }), /***/ 91593: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; /** * An object recognizable as a numeric value that stores the underlying number * as a string. * * Intended to be a deserialization target for the DynamoDB Document Client when * the `wrapNumbers` flag is set. This allows for numeric values that lose * precision when converted to JavaScript's `number` type. */ var DynamoDBNumberValue = util.inherit({ constructor: function NumberValue(value) { this.wrapperName = 'NumberValue'; this.value = value.toString(); }, /** * Render the underlying value as a number when converting to JSON. */ toJSON: function () { return this.toNumber(); }, /** * Convert the underlying value to a JavaScript number. */ toNumber: function () { return Number(this.value); }, /** * Return a string representing the unaltered value provided to the * constructor. */ toString: function () { return this.value; } }); /** * @api private */ module.exports = DynamoDBNumberValue; /***/ }), /***/ 20304: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var typeOf = __webpack_require__(48084).typeOf; /** * @api private */ var memberTypeToSetType = { 'String': 'String', 'Number': 'Number', 'NumberValue': 'Number', 'Binary': 'Binary' }; /** * @api private */ var DynamoDBSet = util.inherit({ constructor: function Set(list, options) { options = options || {}; this.wrapperName = 'Set'; this.initialize(list, options.validate); }, initialize: function(list, validate) { var self = this; self.values = [].concat(list); self.detectType(); if (validate) { self.validate(); } }, detectType: function() { this.type = memberTypeToSetType[typeOf(this.values[0])]; if (!this.type) { throw util.error(new Error(), { code: 'InvalidSetType', message: 'Sets can contain string, number, or binary values' }); } }, validate: function() { var self = this; var length = self.values.length; var values = self.values; for (var i = 0; i < length; i++) { if (memberTypeToSetType[typeOf(values[i])] !== self.type) { throw util.error(new Error(), { code: 'InvalidType', message: self.type + ' Set contains ' + typeOf(values[i]) + ' value' }); } } }, /** * Render the underlying values only when converting to JSON. */ toJSON: function() { var self = this; return self.values; } }); /** * @api private */ module.exports = DynamoDBSet; /***/ }), /***/ 34222: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var convert = __webpack_require__(76663); var Translator = function(options) { options = options || {}; this.attrValue = options.attrValue; this.convertEmptyValues = Boolean(options.convertEmptyValues); this.wrapNumbers = Boolean(options.wrapNumbers); }; Translator.prototype.translateInput = function(value, shape) { this.mode = 'input'; return this.translate(value, shape); }; Translator.prototype.translateOutput = function(value, shape) { this.mode = 'output'; return this.translate(value, shape); }; Translator.prototype.translate = function(value, shape) { var self = this; if (!shape || value === undefined) return undefined; if (shape.shape === self.attrValue) { return convert[self.mode](value, { convertEmptyValues: self.convertEmptyValues, wrapNumbers: self.wrapNumbers, }); } switch (shape.type) { case 'structure': return self.translateStructure(value, shape); case 'map': return self.translateMap(value, shape); case 'list': return self.translateList(value, shape); default: return self.translateScalar(value, shape); } }; Translator.prototype.translateStructure = function(structure, shape) { var self = this; if (structure == null) return undefined; var struct = {}; util.each(structure, function(name, value) { var memberShape = shape.members[name]; if (memberShape) { var result = self.translate(value, memberShape); if (result !== undefined) struct[name] = result; } }); return struct; }; Translator.prototype.translateList = function(list, shape) { var self = this; if (list == null) return undefined; var out = []; util.arrayEach(list, function(value) { var result = self.translate(value, shape.member); if (result === undefined) out.push(null); else out.push(result); }); return out; }; Translator.prototype.translateMap = function(map, shape) { var self = this; if (map == null) return undefined; var out = {}; util.each(map, function(key, value) { var result = self.translate(value, shape.value); if (result === undefined) out[key] = null; else out[key] = result; }); return out; }; Translator.prototype.translateScalar = function(value, shape) { return shape.toType(value); }; /** * @api private */ module.exports = Translator; /***/ }), /***/ 48084: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; function typeOf(data) { if (data === null && typeof data === 'object') { return 'null'; } else if (data !== undefined && isBinary(data)) { return 'Binary'; } else if (data !== undefined && data.constructor) { return data.wrapperName || util.typeName(data.constructor); } else if (data !== undefined && typeof data === 'object') { // this object is the result of Object.create(null), hence the absence of a // defined constructor return 'Object'; } else { return 'undefined'; } } function isBinary(data) { var types = [ 'Buffer', 'File', 'Blob', 'ArrayBuffer', 'DataView', 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array' ]; if (util.isNode()) { var Stream = util.stream.Stream; if (util.Buffer.isBuffer(data) || data instanceof Stream) { return true; } } for (var i = 0; i < types.length; i++) { if (data !== undefined && data.constructor) { if (util.isType(data, types[i])) return true; if (util.typeName(data.constructor) === types[i]) return true; } } return false; } /** * @api private */ module.exports = { typeOf: typeOf, isBinary: isBinary }; /***/ }), /***/ 63727: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var eventMessageChunker = __webpack_require__(73630).eventMessageChunker; var parseEvent = __webpack_require__(52123).parseEvent; function createEventStream(body, parser, model) { var eventMessages = eventMessageChunker(body); var events = []; for (var i = 0; i < eventMessages.length; i++) { events.push(parseEvent(parser, eventMessages[i], model)); } return events; } /** * @api private */ module.exports = { createEventStream: createEventStream }; /***/ }), /***/ 18518: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var Transform = __webpack_require__(92413).Transform; var allocBuffer = util.buffer.alloc; /** @type {Transform} */ function EventMessageChunkerStream(options) { Transform.call(this, options); this.currentMessageTotalLength = 0; this.currentMessagePendingLength = 0; /** @type {Buffer} */ this.currentMessage = null; /** @type {Buffer} */ this.messageLengthBuffer = null; } EventMessageChunkerStream.prototype = Object.create(Transform.prototype); /** * * @param {Buffer} chunk * @param {string} encoding * @param {*} callback */ EventMessageChunkerStream.prototype._transform = function(chunk, encoding, callback) { var chunkLength = chunk.length; var currentOffset = 0; while (currentOffset < chunkLength) { // create new message if necessary if (!this.currentMessage) { // working on a new message, determine total length var bytesRemaining = chunkLength - currentOffset; // prevent edge case where total length spans 2 chunks if (!this.messageLengthBuffer) { this.messageLengthBuffer = allocBuffer(4); } var numBytesForTotal = Math.min( 4 - this.currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer bytesRemaining // bytes left in chunk ); chunk.copy( this.messageLengthBuffer, this.currentMessagePendingLength, currentOffset, currentOffset + numBytesForTotal ); this.currentMessagePendingLength += numBytesForTotal; currentOffset += numBytesForTotal; if (this.currentMessagePendingLength < 4) { // not enough information to create the current message break; } this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0)); this.messageLengthBuffer = null; } // write data into current message var numBytesToWrite = Math.min( this.currentMessageTotalLength - this.currentMessagePendingLength, // number of bytes left to complete message chunkLength - currentOffset // number of bytes left in the original chunk ); chunk.copy( this.currentMessage, // target buffer this.currentMessagePendingLength, // target offset currentOffset, // chunk offset currentOffset + numBytesToWrite // chunk end to write ); this.currentMessagePendingLength += numBytesToWrite; currentOffset += numBytesToWrite; // check if a message is ready to be pushed if (this.currentMessageTotalLength && this.currentMessageTotalLength === this.currentMessagePendingLength) { // push out the message this.push(this.currentMessage); // cleanup this.currentMessage = null; this.currentMessageTotalLength = 0; this.currentMessagePendingLength = 0; } } callback(); }; EventMessageChunkerStream.prototype._flush = function(callback) { if (this.currentMessageTotalLength) { if (this.currentMessageTotalLength === this.currentMessagePendingLength) { callback(null, this.currentMessage); } else { callback(new Error('Truncated event message received.')); } } else { callback(); } }; /** * @param {number} size Size of the message to be allocated. * @api private */ EventMessageChunkerStream.prototype.allocateMessage = function(size) { if (typeof size !== 'number') { throw new Error('Attempted to allocate an event message where size was not a number: ' + size); } this.currentMessageTotalLength = size; this.currentMessagePendingLength = 4; this.currentMessage = allocBuffer(size); this.currentMessage.writeUInt32BE(size, 0); }; /** * @api private */ module.exports = { EventMessageChunkerStream: EventMessageChunkerStream }; /***/ }), /***/ 73630: /***/ ((module) => { /** * Takes in a buffer of event messages and splits them into individual messages. * @param {Buffer} buffer * @api private */ function eventMessageChunker(buffer) { /** @type Buffer[] */ var messages = []; var offset = 0; while (offset < buffer.length) { var totalLength = buffer.readInt32BE(offset); // create new buffer for individual message (shares memory with original) var message = buffer.slice(offset, totalLength + offset); // increment offset to it starts at the next message offset += totalLength; messages.push(message); } return messages; } /** * @api private */ module.exports = { eventMessageChunker: eventMessageChunker }; /***/ }), /***/ 93773: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Transform = __webpack_require__(92413).Transform; var parseEvent = __webpack_require__(52123).parseEvent; /** @type {Transform} */ function EventUnmarshallerStream(options) { options = options || {}; // set output to object mode options.readableObjectMode = true; Transform.call(this, options); this._readableState.objectMode = true; this.parser = options.parser; this.eventStreamModel = options.eventStreamModel; } EventUnmarshallerStream.prototype = Object.create(Transform.prototype); /** * * @param {Buffer} chunk * @param {string} encoding * @param {*} callback */ EventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) { try { var event = parseEvent(this.parser, chunk, this.eventStreamModel); this.push(event); return callback(); } catch (err) { callback(err); } }; /** * @api private */ module.exports = { EventUnmarshallerStream: EventUnmarshallerStream }; /***/ }), /***/ 48583: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var toBuffer = util.buffer.toBuffer; /** * A lossless representation of a signed, 64-bit integer. Instances of this * class may be used in arithmetic expressions as if they were numeric * primitives, but the binary representation will be preserved unchanged as the * `bytes` property of the object. The bytes should be encoded as big-endian, * two's complement integers. * @param {Buffer} bytes * * @api private */ function Int64(bytes) { if (bytes.length !== 8) { throw new Error('Int64 buffers must be exactly 8 bytes'); } if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes); this.bytes = bytes; } /** * @param {number} number * @returns {Int64} * * @api private */ Int64.fromNumber = function(number) { if (number > 9223372036854775807 || number < -9223372036854775808) { throw new Error( number + ' is too large (or, if negative, too small) to represent as an Int64' ); } var bytes = new Uint8Array(8); for ( var i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256 ) { bytes[i] = remaining; } if (number < 0) { negate(bytes); } return new Int64(bytes); }; /** * @returns {number} * * @api private */ Int64.prototype.valueOf = function() { var bytes = this.bytes.slice(0); var negative = bytes[0] & 128; if (negative) { negate(bytes); } return parseInt(bytes.toString('hex'), 16) * (negative ? -1 : 1); }; Int64.prototype.toString = function() { return String(this.valueOf()); }; /** * @param {Buffer} bytes * * @api private */ function negate(bytes) { for (var i = 0; i < 8; i++) { bytes[i] ^= 0xFF; } for (var i = 7; i > -1; i--) { bytes[i]++; if (bytes[i] !== 0) { break; } } } /** * @api private */ module.exports = { Int64: Int64 }; /***/ }), /***/ 52123: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var parseMessage = __webpack_require__(30866).parseMessage; /** * * @param {*} parser * @param {Buffer} message * @param {*} shape * @api private */ function parseEvent(parser, message, shape) { var parsedMessage = parseMessage(message); // check if message is an event or error var messageType = parsedMessage.headers[':message-type']; if (messageType) { if (messageType.value === 'error') { throw parseError(parsedMessage); } else if (messageType.value !== 'event') { // not sure how to parse non-events/non-errors, ignore for now return; } } // determine event type var eventType = parsedMessage.headers[':event-type']; // check that the event type is modeled var eventModel = shape.members[eventType.value]; if (!eventModel) { return; } var result = {}; // check if an event payload exists var eventPayloadMemberName = eventModel.eventPayloadMemberName; if (eventPayloadMemberName) { var payloadShape = eventModel.members[eventPayloadMemberName]; // if the shape is binary, return the byte array if (payloadShape.type === 'binary') { result[eventPayloadMemberName] = parsedMessage.body; } else { result[eventPayloadMemberName] = parser.parse(parsedMessage.body.toString(), payloadShape); } } // read event headers var eventHeaderNames = eventModel.eventHeaderMemberNames; for (var i = 0; i < eventHeaderNames.length; i++) { var name = eventHeaderNames[i]; if (parsedMessage.headers[name]) { // parse the header! result[name] = eventModel.members[name].toType(parsedMessage.headers[name].value); } } var output = {}; output[eventType.value] = result; return output; } function parseError(message) { var errorCode = message.headers[':error-code']; var errorMessage = message.headers[':error-message']; var error = new Error(errorMessage.value || errorMessage); error.code = error.name = errorCode.value || errorCode; return error; } /** * @api private */ module.exports = { parseEvent: parseEvent }; /***/ }), /***/ 30866: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Int64 = __webpack_require__(48583).Int64; var splitMessage = __webpack_require__(71765).splitMessage; var BOOLEAN_TAG = 'boolean'; var BYTE_TAG = 'byte'; var SHORT_TAG = 'short'; var INT_TAG = 'integer'; var LONG_TAG = 'long'; var BINARY_TAG = 'binary'; var STRING_TAG = 'string'; var TIMESTAMP_TAG = 'timestamp'; var UUID_TAG = 'uuid'; /** * @api private * * @param {Buffer} headers */ function parseHeaders(headers) { var out = {}; var position = 0; while (position < headers.length) { var nameLength = headers.readUInt8(position++); var name = headers.slice(position, position + nameLength).toString(); position += nameLength; switch (headers.readUInt8(position++)) { case 0 /* boolTrue */: out[name] = { type: BOOLEAN_TAG, value: true }; break; case 1 /* boolFalse */: out[name] = { type: BOOLEAN_TAG, value: false }; break; case 2 /* byte */: out[name] = { type: BYTE_TAG, value: headers.readInt8(position++) }; break; case 3 /* short */: out[name] = { type: SHORT_TAG, value: headers.readInt16BE(position) }; position += 2; break; case 4 /* integer */: out[name] = { type: INT_TAG, value: headers.readInt32BE(position) }; position += 4; break; case 5 /* long */: out[name] = { type: LONG_TAG, value: new Int64(headers.slice(position, position + 8)) }; position += 8; break; case 6 /* byteArray */: var binaryLength = headers.readUInt16BE(position); position += 2; out[name] = { type: BINARY_TAG, value: headers.slice(position, position + binaryLength) }; position += binaryLength; break; case 7 /* string */: var stringLength = headers.readUInt16BE(position); position += 2; out[name] = { type: STRING_TAG, value: headers.slice( position, position + stringLength ).toString() }; position += stringLength; break; case 8 /* timestamp */: out[name] = { type: TIMESTAMP_TAG, value: new Date( new Int64(headers.slice(position, position + 8)) .valueOf() ) }; position += 8; break; case 9 /* uuid */: var uuidChars = headers.slice(position, position + 16) .toString('hex'); position += 16; out[name] = { type: UUID_TAG, value: uuidChars.substr(0, 8) + '-' + uuidChars.substr(8, 4) + '-' + uuidChars.substr(12, 4) + '-' + uuidChars.substr(16, 4) + '-' + uuidChars.substr(20) }; break; default: throw new Error('Unrecognized header type tag'); } } return out; } function parseMessage(message) { var parsed = splitMessage(message); return { headers: parseHeaders(parsed.headers), body: parsed.body }; } /** * @api private */ module.exports = { parseMessage: parseMessage }; /***/ }), /***/ 71765: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var toBuffer = util.buffer.toBuffer; // All prelude components are unsigned, 32-bit integers var PRELUDE_MEMBER_LENGTH = 4; // The prelude consists of two components var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; // Checksums are always CRC32 hashes. var CHECKSUM_LENGTH = 4; // Messages must include a full prelude, a prelude checksum, and a message checksum var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; /** * @api private * * @param {Buffer} message */ function splitMessage(message) { if (!util.Buffer.isBuffer(message)) message = toBuffer(message); if (message.length < MINIMUM_MESSAGE_LENGTH) { throw new Error('Provided message too short to accommodate event stream message overhead'); } if (message.length !== message.readUInt32BE(0)) { throw new Error('Reported message length does not match received message length'); } var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH); if ( expectedPreludeChecksum !== util.crypto.crc32( message.slice(0, PRELUDE_LENGTH) ) ) { throw new Error( 'The prelude checksum specified in the message (' + expectedPreludeChecksum + ') does not match the calculated CRC32 checksum.' ); } var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH); if ( expectedMessageChecksum !== util.crypto.crc32( message.slice(0, message.length - CHECKSUM_LENGTH) ) ) { throw new Error( 'The message checksum did not match the expected value of ' + expectedMessageChecksum ); } var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH; var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH); return { headers: message.slice(headersStart, headersEnd), body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH), }; } /** * @api private */ module.exports = { splitMessage: splitMessage }; /***/ }), /***/ 69643: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * What is necessary to create an event stream in node? * - http response stream * - parser * - event stream model */ var EventMessageChunkerStream = __webpack_require__(18518).EventMessageChunkerStream; var EventUnmarshallerStream = __webpack_require__(93773).EventUnmarshallerStream; function createEventStream(stream, parser, model) { var eventStream = new EventUnmarshallerStream({ parser: parser, eventStreamModel: model }); var eventMessageChunker = new EventMessageChunkerStream(); stream.pipe( eventMessageChunker ).pipe(eventStream); stream.on('error', function(err) { eventMessageChunker.emit('error', err); }); eventMessageChunker.on('error', function(err) { eventStream.emit('error', err); }); return eventStream; } /** * @api private */ module.exports = { createEventStream: createEventStream }; /***/ }), /***/ 54995: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var SequentialExecutor = __webpack_require__(55948); var DISCOVER_ENDPOINT = __webpack_require__(45313).discoverEndpoint; /** * The namespace used to register global event listeners for request building * and sending. */ AWS.EventListeners = { /** * @!attribute VALIDATE_CREDENTIALS * A request listener that validates whether the request is being * sent with credentials. * Handles the {AWS.Request~validate 'validate' Request event} * @example Sending a request without validating credentials * var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS; * request.removeListener('validate', listener); * @readonly * @return [Function] * @!attribute VALIDATE_REGION * A request listener that validates whether the region is set * for a request. * Handles the {AWS.Request~validate 'validate' Request event} * @example Sending a request without validating region configuration * var listener = AWS.EventListeners.Core.VALIDATE_REGION; * request.removeListener('validate', listener); * @readonly * @return [Function] * @!attribute VALIDATE_PARAMETERS * A request listener that validates input parameters in a request. * Handles the {AWS.Request~validate 'validate' Request event} * @example Sending a request without validating parameters * var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS; * request.removeListener('validate', listener); * @example Disable parameter validation globally * AWS.EventListeners.Core.removeListener('validate', * AWS.EventListeners.Core.VALIDATE_REGION); * @readonly * @return [Function] * @!attribute SEND * A request listener that initiates the HTTP connection for a * request being sent. Handles the {AWS.Request~send 'send' Request event} * @example Replacing the HTTP handler * var listener = AWS.EventListeners.Core.SEND; * request.removeListener('send', listener); * request.on('send', function(response) { * customHandler.send(response); * }); * @return [Function] * @readonly * @!attribute HTTP_DATA * A request listener that reads data from the HTTP connection in order * to build the response data. * Handles the {AWS.Request~httpData 'httpData' Request event}. * Remove this handler if you are overriding the 'httpData' event and * do not want extra data processing and buffering overhead. * @example Disabling default data processing * var listener = AWS.EventListeners.Core.HTTP_DATA; * request.removeListener('httpData', listener); * @return [Function] * @readonly */ Core: {} /* doc hack */ }; /** * @api private */ function getOperationAuthtype(req) { if (!req.service.api.operations) { return ''; } var operation = req.service.api.operations[req.operation]; return operation ? operation.authtype : ''; } AWS.EventListeners = { Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) { addAsync('VALIDATE_CREDENTIALS', 'validate', function VALIDATE_CREDENTIALS(req, done) { if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none req.service.config.getCredentials(function(err) { if (err) { req.response.error = AWS.util.error(err, {code: 'CredentialsError', message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1'}); } done(); }); }); add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) { if (!req.service.isGlobalEndpoint) { var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); if (!req.service.config.region) { req.response.error = AWS.util.error(new Error(), {code: 'ConfigError', message: 'Missing region in config'}); } else if (!dnsHostRegex.test(req.service.config.region)) { req.response.error = AWS.util.error(new Error(), {code: 'ConfigError', message: 'Invalid region in config'}); } } }); add('BUILD_IDEMPOTENCY_TOKENS', 'validate', function BUILD_IDEMPOTENCY_TOKENS(req) { if (!req.service.api.operations) { return; } var operation = req.service.api.operations[req.operation]; if (!operation) { return; } var idempotentMembers = operation.idempotentMembers; if (!idempotentMembers.length) { return; } // creates a copy of params so user's param object isn't mutated var params = AWS.util.copy(req.params); for (var i = 0, iLen = idempotentMembers.length; i < iLen; i++) { if (!params[idempotentMembers[i]]) { // add the member params[idempotentMembers[i]] = AWS.util.uuid.v4(); } } req.params = params; }); add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) { if (!req.service.api.operations) { return; } var rules = req.service.api.operations[req.operation].input; var validation = req.service.config.paramValidation; new AWS.ParamValidator(validation).validate(rules, req.params); }); addAsync('COMPUTE_SHA256', 'afterBuild', function COMPUTE_SHA256(req, done) { req.haltHandlersOnError(); if (!req.service.api.operations) { return; } var operation = req.service.api.operations[req.operation]; var authtype = operation ? operation.authtype : ''; if (!req.service.api.signatureVersion && !authtype && !req.service.config.signatureVersion) return done(); // none if (req.service.getSignerClass(req) === AWS.Signers.V4) { var body = req.httpRequest.body || ''; if (authtype.indexOf('unsigned-body') >= 0) { req.httpRequest.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; return done(); } AWS.util.computeSha256(body, function(err, sha) { if (err) { done(err); } else { req.httpRequest.headers['X-Amz-Content-Sha256'] = sha; done(); } }); } else { done(); } }); add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) { var authtype = getOperationAuthtype(req); var payloadMember = AWS.util.getRequestPayloadShape(req); if (req.httpRequest.headers['Content-Length'] === undefined) { try { var length = AWS.util.string.byteLength(req.httpRequest.body); req.httpRequest.headers['Content-Length'] = length; } catch (err) { if (payloadMember && payloadMember.isStreaming) { if (payloadMember.requiresLength) { //streaming payload requires length(s3, glacier) throw err; } else if (authtype.indexOf('unsigned-body') >= 0) { //unbounded streaming payload(lex, mediastore) req.httpRequest.headers['Transfer-Encoding'] = 'chunked'; return; } else { throw err; } } throw err; } } }); add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) { req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host; }); add('RESTART', 'restart', function RESTART() { var err = this.response.error; if (!err || !err.retryable) return; this.httpRequest = new AWS.HttpRequest( this.service.endpoint, this.service.region ); if (this.response.retryCount < this.service.config.maxRetries) { this.response.retryCount++; } else { this.response.error = null; } }); var addToHead = true; addAsync('DISCOVER_ENDPOINT', 'sign', DISCOVER_ENDPOINT, addToHead); addAsync('SIGN', 'sign', function SIGN(req, done) { var service = req.service; var operations = req.service.api.operations || {}; var operation = operations[req.operation]; var authtype = operation ? operation.authtype : ''; if (!service.api.signatureVersion && !authtype && !service.config.signatureVersion) return done(); // none service.config.getCredentials(function (err, credentials) { if (err) { req.response.error = err; return done(); } try { var date = service.getSkewCorrectedDate(); var SignerClass = service.getSignerClass(req); var signer = new SignerClass(req.httpRequest, service.getSigningName(req), { signatureCache: service.config.signatureCache, operation: operation, signatureVersion: service.api.signatureVersion }); signer.setServiceClientId(service._clientId); // clear old authorization headers delete req.httpRequest.headers['Authorization']; delete req.httpRequest.headers['Date']; delete req.httpRequest.headers['X-Amz-Date']; // add new authorization signer.addAuthorization(credentials, date); req.signedAt = date; } catch (e) { req.response.error = e; } done(); }); }); add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) { if (this.service.successfulResponse(resp, this)) { resp.data = {}; resp.error = null; } else { resp.data = null; resp.error = AWS.util.error(new Error(), {code: 'UnknownError', message: 'An unknown error occurred.'}); } }); addAsync('SEND', 'send', function SEND(resp, done) { resp.httpResponse._abortCallback = done; resp.error = null; resp.data = null; function callback(httpResp) { resp.httpResponse.stream = httpResp; var stream = resp.request.httpRequest.stream; var service = resp.request.service; var api = service.api; var operationName = resp.request.operation; var operation = api.operations[operationName] || {}; httpResp.on('headers', function onHeaders(statusCode, headers, statusMessage) { resp.request.emit( 'httpHeaders', [statusCode, headers, resp, statusMessage] ); if (!resp.httpResponse.streaming) { if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check // if we detect event streams, we're going to have to // return the stream immediately if (operation.hasEventOutput && service.successfulResponse(resp)) { // skip reading the IncomingStream resp.request.emit('httpDone'); done(); return; } httpResp.on('readable', function onReadable() { var data = httpResp.read(); if (data !== null) { resp.request.emit('httpData', [data, resp]); } }); } else { // legacy streams API httpResp.on('data', function onData(data) { resp.request.emit('httpData', [data, resp]); }); } } }); httpResp.on('end', function onEnd() { if (!stream || !stream.didCallback) { if (AWS.HttpClient.streamsApiVersion === 2 && (operation.hasEventOutput && service.successfulResponse(resp))) { // don't concatenate response chunks when streaming event stream data when response is successful return; } resp.request.emit('httpDone'); done(); } }); } function progress(httpResp) { httpResp.on('sendProgress', function onSendProgress(value) { resp.request.emit('httpUploadProgress', [value, resp]); }); httpResp.on('receiveProgress', function onReceiveProgress(value) { resp.request.emit('httpDownloadProgress', [value, resp]); }); } function error(err) { if (err.code !== 'RequestAbortedError') { var errCode = err.code === 'TimeoutError' ? err.code : 'NetworkingError'; err = AWS.util.error(err, { code: errCode, region: resp.request.httpRequest.region, hostname: resp.request.httpRequest.endpoint.hostname, retryable: true }); } resp.error = err; resp.request.emit('httpError', [resp.error, resp], function() { done(); }); } function executeSend() { var http = AWS.HttpClient.getInstance(); var httpOptions = resp.request.service.config.httpOptions || {}; try { var stream = http.handleRequest(resp.request.httpRequest, httpOptions, callback, error); progress(stream); } catch (err) { error(err); } } var timeDiff = (resp.request.service.getSkewCorrectedDate() - this.signedAt) / 1000; if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign this.emit('sign', [this], function(err) { if (err) done(err); else executeSend(); }); } else { executeSend(); } }); add('HTTP_HEADERS', 'httpHeaders', function HTTP_HEADERS(statusCode, headers, resp, statusMessage) { resp.httpResponse.statusCode = statusCode; resp.httpResponse.statusMessage = statusMessage; resp.httpResponse.headers = headers; resp.httpResponse.body = AWS.util.buffer.toBuffer(''); resp.httpResponse.buffers = []; resp.httpResponse.numBytes = 0; var dateHeader = headers.date || headers.Date; var service = resp.request.service; if (dateHeader) { var serverTime = Date.parse(dateHeader); if (service.config.correctClockSkew && service.isClockSkewed(serverTime)) { service.applyClockOffset(serverTime); } } }); add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) { if (chunk) { if (AWS.util.isNode()) { resp.httpResponse.numBytes += chunk.length; var total = resp.httpResponse.headers['content-length']; var progress = { loaded: resp.httpResponse.numBytes, total: total }; resp.request.emit('httpDownloadProgress', [progress, resp]); } resp.httpResponse.buffers.push(AWS.util.buffer.toBuffer(chunk)); } }); add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) { // convert buffers array into single buffer if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) { var body = AWS.util.buffer.concat(resp.httpResponse.buffers); resp.httpResponse.body = body; } delete resp.httpResponse.numBytes; delete resp.httpResponse.buffers; }); add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) { if (resp.httpResponse.statusCode) { resp.error.statusCode = resp.httpResponse.statusCode; if (resp.error.retryable === undefined) { resp.error.retryable = this.service.retryableError(resp.error, this); } } }); add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) { if (!resp.error) return; switch (resp.error.code) { case 'RequestExpired': // EC2 only case 'ExpiredTokenException': case 'ExpiredToken': resp.error.retryable = true; resp.request.service.config.credentials.expired = true; } }); add('EXPIRED_SIGNATURE', 'retry', function EXPIRED_SIGNATURE(resp) { var err = resp.error; if (!err) return; if (typeof err.code === 'string' && typeof err.message === 'string') { if (err.code.match(/Signature/) && err.message.match(/expired/)) { resp.error.retryable = true; } } }); add('CLOCK_SKEWED', 'retry', function CLOCK_SKEWED(resp) { if (!resp.error) return; if (this.service.clockSkewError(resp.error) && this.service.config.correctClockSkew) { resp.error.retryable = true; } }); add('REDIRECT', 'retry', function REDIRECT(resp) { if (resp.error && resp.error.statusCode >= 300 && resp.error.statusCode < 400 && resp.httpResponse.headers['location']) { this.httpRequest.endpoint = new AWS.Endpoint(resp.httpResponse.headers['location']); this.httpRequest.headers['Host'] = this.httpRequest.endpoint.host; resp.error.redirect = true; resp.error.retryable = true; } }); add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) { if (resp.error) { if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { resp.error.retryDelay = 0; } else if (resp.retryCount < resp.maxRetries) { resp.error.retryDelay = this.service.retryDelays(resp.retryCount, resp.error) || 0; } } }); addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) { var delay, willRetry = false; if (resp.error) { delay = resp.error.retryDelay || 0; if (resp.error.retryable && resp.retryCount < resp.maxRetries) { resp.retryCount++; willRetry = true; } else if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) { resp.redirectCount++; willRetry = true; } } // delay < 0 is a signal from customBackoff to skip retries if (willRetry && delay >= 0) { resp.error = null; setTimeout(done, delay); } else { done(); } }); }), CorePost: new SequentialExecutor().addNamedListeners(function(add) { add('EXTRACT_REQUEST_ID', 'extractData', AWS.util.extractRequestId); add('EXTRACT_REQUEST_ID', 'extractError', AWS.util.extractRequestId); add('ENOTFOUND_ERROR', 'httpError', function ENOTFOUND_ERROR(err) { function isDNSError(err) { return err.errno === 'ENOTFOUND' || typeof err.errno === 'number' && typeof AWS.util.getSystemErrorName === 'function' && ['EAI_NONAME', 'EAI_NODATA'].indexOf(AWS.util.getSystemErrorName(err.errno) >= 0); } if (err.code === 'NetworkingError' && isDNSError(err)) { var message = 'Inaccessible host: `' + err.hostname + '\'. This service may not be available in the `' + err.region + '\' region.'; this.response.error = AWS.util.error(new Error(message), { code: 'UnknownEndpoint', region: err.region, hostname: err.hostname, retryable: true, originalError: err }); } }); }), Logger: new SequentialExecutor().addNamedListeners(function(add) { add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) { var req = resp.request; var logger = req.service.config.logger; if (!logger) return; function filterSensitiveLog(inputShape, shape) { if (!shape) { return shape; } if (inputShape.isSensitive) { return '***SensitiveInformation***'; } switch (inputShape.type) { case 'structure': var struct = {}; AWS.util.each(shape, function(subShapeName, subShape) { if (Object.prototype.hasOwnProperty.call(inputShape.members, subShapeName)) { struct[subShapeName] = filterSensitiveLog(inputShape.members[subShapeName], subShape); } else { struct[subShapeName] = subShape; } }); return struct; case 'list': var list = []; AWS.util.arrayEach(shape, function(subShape, index) { list.push(filterSensitiveLog(inputShape.member, subShape)); }); return list; case 'map': var map = {}; AWS.util.each(shape, function(key, value) { map[key] = filterSensitiveLog(inputShape.value, value); }); return map; default: return shape; } } function buildMessage() { var time = resp.request.service.getSkewCorrectedDate().getTime(); var delta = (time - req.startTime.getTime()) / 1000; var ansi = logger.isTTY ? true : false; var status = resp.httpResponse.statusCode; var censoredParams = req.params; if ( req.service.api.operations && req.service.api.operations[req.operation] && req.service.api.operations[req.operation].input ) { var inputShape = req.service.api.operations[req.operation].input; censoredParams = filterSensitiveLog(inputShape, req.params); } var params = __webpack_require__(31669).inspect(censoredParams, true, null); var message = ''; if (ansi) message += '\x1B[33m'; message += '[AWS ' + req.service.serviceIdentifier + ' ' + status; message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]'; if (ansi) message += '\x1B[0;1m'; message += ' ' + AWS.util.string.lowerFirst(req.operation); message += '(' + params + ')'; if (ansi) message += '\x1B[0m'; return message; } var line = buildMessage(); if (typeof logger.log === 'function') { logger.log(line); } else if (typeof logger.write === 'function') { logger.write(line + '\n'); } }); }), Json: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(30083); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }), Rest: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(98200); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }), RestJson: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(5883); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }), RestXml: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(15143); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }), Query: new SequentialExecutor().addNamedListeners(function(add) { var svc = __webpack_require__(90761); add('BUILD', 'build', svc.buildRequest); add('EXTRACT_DATA', 'extractData', svc.extractData); add('EXTRACT_ERROR', 'extractError', svc.extractError); }) }; /***/ }), /***/ 1556: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * The endpoint that a service will talk to, for example, * `'https://ec2.ap-southeast-1.amazonaws.com'`. If * you need to override an endpoint for a service, you can * set the endpoint on a service by passing the endpoint * object with the `endpoint` option key: * * ```javascript * var ep = new AWS.Endpoint('awsproxy.example.com'); * var s3 = new AWS.S3({endpoint: ep}); * s3.service.endpoint.hostname == 'awsproxy.example.com' * ``` * * Note that if you do not specify a protocol, the protocol will * be selected based on your current {AWS.config} configuration. * * @!attribute protocol * @return [String] the protocol (http or https) of the endpoint * URL * @!attribute hostname * @return [String] the host portion of the endpoint, e.g., * example.com * @!attribute host * @return [String] the host portion of the endpoint including * the port, e.g., example.com:80 * @!attribute port * @return [Integer] the port of the endpoint * @!attribute href * @return [String] the full URL of the endpoint */ AWS.Endpoint = inherit({ /** * @overload Endpoint(endpoint) * Constructs a new endpoint given an endpoint URL. If the * URL omits a protocol (http or https), the default protocol * set in the global {AWS.config} will be used. * @param endpoint [String] the URL to construct an endpoint from */ constructor: function Endpoint(endpoint, config) { AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']); if (typeof endpoint === 'undefined' || endpoint === null) { throw new Error('Invalid endpoint: ' + endpoint); } else if (typeof endpoint !== 'string') { return AWS.util.copy(endpoint); } if (!endpoint.match(/^http/)) { var useSSL = config && config.sslEnabled !== undefined ? config.sslEnabled : AWS.config.sslEnabled; endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint; } AWS.util.update(this, AWS.util.urlParse(endpoint)); // Ensure the port property is set as an integer if (this.port) { this.port = parseInt(this.port, 10); } else { this.port = this.protocol === 'https:' ? 443 : 80; } } }); /** * The low level HTTP request object, encapsulating all HTTP header * and body data sent by a service request. * * @!attribute method * @return [String] the HTTP method of the request * @!attribute path * @return [String] the path portion of the URI, e.g., * "/list/?start=5&num=10" * @!attribute headers * @return [map] * a map of header keys and their respective values * @!attribute body * @return [String] the request body payload * @!attribute endpoint * @return [AWS.Endpoint] the endpoint for the request * @!attribute region * @api private * @return [String] the region, for signing purposes only. */ AWS.HttpRequest = inherit({ /** * @api private */ constructor: function HttpRequest(endpoint, region) { endpoint = new AWS.Endpoint(endpoint); this.method = 'POST'; this.path = endpoint.path || '/'; this.headers = {}; this.body = ''; this.endpoint = endpoint; this.region = region; this._userAgent = ''; this.setUserAgent(); }, /** * @api private */ setUserAgent: function setUserAgent() { this._userAgent = this.headers[this.getUserAgentHeaderName()] = AWS.util.userAgent(); }, getUserAgentHeaderName: function getUserAgentHeaderName() { var prefix = AWS.util.isBrowser() ? 'X-Amz-' : ''; return prefix + 'User-Agent'; }, /** * @api private */ appendToUserAgent: function appendToUserAgent(agentPartial) { if (typeof agentPartial === 'string' && agentPartial) { this._userAgent += ' ' + agentPartial; } this.headers[this.getUserAgentHeaderName()] = this._userAgent; }, /** * @api private */ getUserAgent: function getUserAgent() { return this._userAgent; }, /** * @return [String] the part of the {path} excluding the * query string */ pathname: function pathname() { return this.path.split('?', 1)[0]; }, /** * @return [String] the query string portion of the {path} */ search: function search() { var query = this.path.split('?', 2)[1]; if (query) { query = AWS.util.queryStringParse(query); return AWS.util.queryParamsToString(query); } return ''; }, /** * @api private * update httpRequest endpoint with endpoint string */ updateEndpoint: function updateEndpoint(endpointStr) { var newEndpoint = new AWS.Endpoint(endpointStr); this.endpoint = newEndpoint; this.path = newEndpoint.path || '/'; if (this.headers['Host']) { this.headers['Host'] = newEndpoint.host; } } }); /** * The low level HTTP response object, encapsulating all HTTP header * and body data returned from the request. * * @!attribute statusCode * @return [Integer] the HTTP status code of the response (e.g., 200, 404) * @!attribute headers * @return [map] * a map of response header keys and their respective values * @!attribute body * @return [String] the response body payload * @!attribute [r] streaming * @return [Boolean] whether this response is being streamed at a low-level. * Defaults to `false` (buffered reads). Do not modify this manually, use * {createUnbufferedStream} to convert the stream to unbuffered mode * instead. */ AWS.HttpResponse = inherit({ /** * @api private */ constructor: function HttpResponse() { this.statusCode = undefined; this.headers = {}; this.body = undefined; this.streaming = false; this.stream = null; }, /** * Disables buffering on the HTTP response and returns the stream for reading. * @return [Stream, XMLHttpRequest, null] the underlying stream object. * Use this object to directly read data off of the stream. * @note This object is only available after the {AWS.Request~httpHeaders} * event has fired. This method must be called prior to * {AWS.Request~httpData}. * @example Taking control of a stream * request.on('httpHeaders', function(statusCode, headers) { * if (statusCode < 300) { * if (headers.etag === 'xyz') { * // pipe the stream, disabling buffering * var stream = this.response.httpResponse.createUnbufferedStream(); * stream.pipe(process.stdout); * } else { // abort this request and set a better error message * this.abort(); * this.response.error = new Error('Invalid ETag'); * } * } * }).send(console.log); */ createUnbufferedStream: function createUnbufferedStream() { this.streaming = true; return this.stream; } }); AWS.HttpClient = inherit({}); /** * @api private */ AWS.HttpClient.getInstance = function getInstance() { if (this.singleton === undefined) { this.singleton = new this(); } return this.singleton; }; /***/ }), /***/ 2310: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var Stream = AWS.util.stream.Stream; var TransformStream = AWS.util.stream.Transform; var ReadableStream = AWS.util.stream.Readable; __webpack_require__(1556); var CONNECTION_REUSE_ENV_NAME = 'AWS_NODEJS_CONNECTION_REUSE_ENABLED'; /** * @api private */ AWS.NodeHttpClient = AWS.util.inherit({ handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) { var self = this; var endpoint = httpRequest.endpoint; var pathPrefix = ''; if (!httpOptions) httpOptions = {}; if (httpOptions.proxy) { pathPrefix = endpoint.protocol + '//' + endpoint.hostname; if (endpoint.port !== 80 && endpoint.port !== 443) { pathPrefix += ':' + endpoint.port; } endpoint = new AWS.Endpoint(httpOptions.proxy); } var useSSL = endpoint.protocol === 'https:'; var http = useSSL ? __webpack_require__(57211) : __webpack_require__(98605); var options = { host: endpoint.hostname, port: endpoint.port, method: httpRequest.method, headers: httpRequest.headers, path: pathPrefix + httpRequest.path }; if (!httpOptions.agent) { options.agent = this.getAgent(useSSL, { keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false }); } AWS.util.update(options, httpOptions); delete options.proxy; // proxy isn't an HTTP option delete options.timeout; // timeout isn't an HTTP option var stream = http.request(options, function (httpResp) { if (stream.didCallback) return; callback(httpResp); httpResp.emit( 'headers', httpResp.statusCode, httpResp.headers, httpResp.statusMessage ); }); httpRequest.stream = stream; // attach stream to httpRequest stream.didCallback = false; // connection timeout support if (httpOptions.connectTimeout) { var connectTimeoutId; stream.on('socket', function(socket) { if (socket.connecting) { connectTimeoutId = setTimeout(function connectTimeout() { if (stream.didCallback) return; stream.didCallback = true; stream.abort(); errCallback(AWS.util.error( new Error('Socket timed out without establishing a connection'), {code: 'TimeoutError'} )); }, httpOptions.connectTimeout); socket.on('connect', function() { clearTimeout(connectTimeoutId); connectTimeoutId = null; }); } }); } // timeout support stream.setTimeout(httpOptions.timeout || 0, function() { if (stream.didCallback) return; stream.didCallback = true; var msg = 'Connection timed out after ' + httpOptions.timeout + 'ms'; errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'})); stream.abort(); }); stream.on('error', function() { if (connectTimeoutId) { clearTimeout(connectTimeoutId); connectTimeoutId = null; } if (stream.didCallback) return; stream.didCallback = true; errCallback.apply(stream, arguments); }); var expect = httpRequest.headers.Expect || httpRequest.headers.expect; if (expect === '100-continue') { stream.once('continue', function() { self.writeBody(stream, httpRequest); }); } else { this.writeBody(stream, httpRequest); } return stream; }, writeBody: function writeBody(stream, httpRequest) { var body = httpRequest.body; var totalBytes = parseInt(httpRequest.headers['Content-Length'], 10); if (body instanceof Stream) { // For progress support of streaming content - // pipe the data through a transform stream to emit 'sendProgress' events var progressStream = this.progressStream(stream, totalBytes); if (progressStream) { body.pipe(progressStream).pipe(stream); } else { body.pipe(stream); } } else if (body) { // The provided body is a buffer/string and is already fully available in memory - // For performance it's best to send it as a whole by calling stream.end(body), // Callers expect a 'sendProgress' event which is best emitted once // the http request stream has been fully written and all data flushed. // The use of totalBytes is important over body.length for strings where // length is char length and not byte length. stream.once('finish', function() { stream.emit('sendProgress', { loaded: totalBytes, total: totalBytes }); }); stream.end(body); } else { // no request body stream.end(); } }, /** * Create the https.Agent or http.Agent according to the request schema. */ getAgent: function getAgent(useSSL, agentOptions) { var http = useSSL ? __webpack_require__(57211) : __webpack_require__(98605); if (useSSL) { if (!AWS.NodeHttpClient.sslAgent) { AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({ rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true }, agentOptions || {})); AWS.NodeHttpClient.sslAgent.setMaxListeners(0); // delegate maxSockets to globalAgent, set a default limit of 50 if current value is Infinity. // Users can bypass this default by supplying their own Agent as part of SDK configuration. Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', { enumerable: true, get: function() { var defaultMaxSockets = 50; var globalAgent = http.globalAgent; if (globalAgent && globalAgent.maxSockets !== Infinity && typeof globalAgent.maxSockets === 'number') { return globalAgent.maxSockets; } return defaultMaxSockets; } }); } return AWS.NodeHttpClient.sslAgent; } else { if (!AWS.NodeHttpClient.agent) { AWS.NodeHttpClient.agent = new http.Agent(agentOptions); } return AWS.NodeHttpClient.agent; } }, progressStream: function progressStream(stream, totalBytes) { if (typeof TransformStream === 'undefined') { // for node 0.8 there is no streaming progress return; } var loadedBytes = 0; var reporter = new TransformStream(); reporter._transform = function(chunk, encoding, callback) { if (chunk) { loadedBytes += chunk.length; stream.emit('sendProgress', { loaded: loadedBytes, total: totalBytes }); } callback(null, chunk); }; return reporter; }, emitter: null }); /** * @!ignore */ /** * @api private */ AWS.HttpClient.prototype = AWS.NodeHttpClient.prototype; /** * @api private */ AWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1; /***/ }), /***/ 47495: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); function JsonBuilder() { } JsonBuilder.prototype.build = function(value, shape) { return JSON.stringify(translate(value, shape)); }; function translate(value, shape) { if (!shape || value === undefined || value === null) return undefined; switch (shape.type) { case 'structure': return translateStructure(value, shape); case 'map': return translateMap(value, shape); case 'list': return translateList(value, shape); default: return translateScalar(value, shape); } } function translateStructure(structure, shape) { var struct = {}; util.each(structure, function(name, value) { var memberShape = shape.members[name]; if (memberShape) { if (memberShape.location !== 'body') return; var locationName = memberShape.isLocationName ? memberShape.name : name; var result = translate(value, memberShape); if (result !== undefined) struct[locationName] = result; } }); return struct; } function translateList(list, shape) { var out = []; util.arrayEach(list, function(value) { var result = translate(value, shape.member); if (result !== undefined) out.push(result); }); return out; } function translateMap(map, shape) { var out = {}; util.each(map, function(key, value) { var result = translate(value, shape.value); if (result !== undefined) out[key] = result; }); return out; } function translateScalar(value, shape) { return shape.toWireFormat(value); } /** * @api private */ module.exports = JsonBuilder; /***/ }), /***/ 5474: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); function JsonParser() { } JsonParser.prototype.parse = function(value, shape) { return translate(JSON.parse(value), shape); }; function translate(value, shape) { if (!shape || value === undefined) return undefined; switch (shape.type) { case 'structure': return translateStructure(value, shape); case 'map': return translateMap(value, shape); case 'list': return translateList(value, shape); default: return translateScalar(value, shape); } } function translateStructure(structure, shape) { if (structure == null) return undefined; var struct = {}; var shapeMembers = shape.members; util.each(shapeMembers, function(name, memberShape) { var locationName = memberShape.isLocationName ? memberShape.name : name; if (Object.prototype.hasOwnProperty.call(structure, locationName)) { var value = structure[locationName]; var result = translate(value, memberShape); if (result !== undefined) struct[name] = result; } }); return struct; } function translateList(list, shape) { if (list == null) return undefined; var out = []; util.arrayEach(list, function(value) { var result = translate(value, shape.member); if (result === undefined) out.push(null); else out.push(result); }); return out; } function translateMap(map, shape) { if (map == null) return undefined; var out = {}; util.each(map, function(key, value) { var result = translate(value, shape.value); if (result === undefined) out[key] = null; else out[key] = result; }); return out; } function translateScalar(value, shape) { return shape.toType(value); } /** * @api private */ module.exports = JsonParser; /***/ }), /***/ 25768: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); __webpack_require__(1556); var inherit = AWS.util.inherit; /** * Represents a metadata service available on EC2 instances. Using the * {request} method, you can receieve metadata about any available resource * on the metadata service. * * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED * environment variable to a truthy value. * * @!attribute [r] httpOptions * @return [map] a map of options to pass to the underlying HTTP request: * * * **timeout** (Number) — a timeout value in milliseconds to wait * before aborting the connection. Set to 0 for no timeout. * * @!macro nobrowser */ AWS.MetadataService = inherit({ /** * @return [String] the hostname of the instance metadata service */ host: '169.254.169.254', /** * @!ignore */ /** * Default HTTP options. By default, the metadata service is set to not * timeout on long requests. This means that on non-EC2 machines, this * request will never return. If you are calling this operation from an * environment that may not always run on EC2, set a `timeout` value so * the SDK will abort the request after a given number of milliseconds. */ httpOptions: { timeout: 0 }, /** * when enabled, metadata service will not fetch token */ disableFetchToken: false, /** * Creates a new MetadataService object with a given set of options. * * @option options host [String] the hostname of the instance metadata * service * @option options httpOptions [map] a map of options to pass to the * underlying HTTP request: * * * **timeout** (Number) — a timeout value in milliseconds to wait * before aborting the connection. Set to 0 for no timeout. * @option options maxRetries [Integer] the maximum number of retries to * perform for timeout errors * @option options retryDelayOptions [map] A set of options to configure the * retry delay on retryable errors. See AWS.Config for details. */ constructor: function MetadataService(options) { AWS.util.update(this, options); }, /** * Sends a request to the instance metadata service for a given resource. * * @param path [String] the path of the resource to get * * @param options [map] an optional map used to make request * * * **method** (String) — HTTP request method * * * **headers** (map) — a map of response header keys and their respective values * * @callback callback function(err, data) * Called when a response is available from the service. * @param err [Error, null] if an error occurred, this value will be set * @param data [String, null] if the request was successful, the body of * the response */ request: function request(path, options, callback) { if (arguments.length === 2) { callback = options; options = {}; } if (process.env[AWS.util.imdsDisabledEnv]) { callback(new Error('EC2 Instance Metadata Service access disabled')); return; } path = path || '/'; var httpRequest = new AWS.HttpRequest('http://' + this.host + path); httpRequest.method = options.method || 'GET'; if (options.headers) { httpRequest.headers = options.headers; } AWS.util.handleRequestWithRetries(httpRequest, this, callback); }, /** * @api private */ loadCredentialsCallbacks: [], /** * Fetches metadata token used for getting credentials * * @api private * @callback callback function(err, token) * Called when token is loaded from the resource */ fetchMetadataToken: function fetchMetadataToken(callback) { var self = this; var tokenFetchPath = '/latest/api/token'; self.request( tokenFetchPath, { 'method': 'PUT', 'headers': { 'x-aws-ec2-metadata-token-ttl-seconds': '21600' } }, callback ); }, /** * Fetches credentials * * @api private * @callback cb function(err, creds) * Called when credentials are loaded from the resource */ fetchCredentials: function fetchCredentials(options, cb) { var self = this; var basePath = '/latest/meta-data/iam/security-credentials/'; self.request(basePath, options, function (err, roleName) { if (err) { self.disableFetchToken = !(err.statusCode === 401); cb(AWS.util.error( err, { message: 'EC2 Metadata roleName request returned error' } )); return; } roleName = roleName.split('\n')[0]; // grab first (and only) role self.request(basePath + roleName, options, function (credErr, credData) { if (credErr) { self.disableFetchToken = !(credErr.statusCode === 401); cb(AWS.util.error( credErr, { message: 'EC2 Metadata creds request returned error' } )); return; } try { var credentials = JSON.parse(credData); cb(null, credentials); } catch (parseError) { cb(parseError); } }); }); }, /** * Loads a set of credentials stored in the instance metadata service * * @api private * @callback callback function(err, credentials) * Called when credentials are loaded from the resource * @param err [Error] if an error occurred, this value will be set * @param credentials [Object] the raw JSON object containing all * metadata from the credentials resource */ loadCredentials: function loadCredentials(callback) { var self = this; self.loadCredentialsCallbacks.push(callback); if (self.loadCredentialsCallbacks.length > 1) { return; } function callbacks(err, creds) { var cb; while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) { cb(err, creds); } } if (self.disableFetchToken) { self.fetchCredentials({}, callbacks); } else { self.fetchMetadataToken(function(tokenError, token) { if (tokenError) { if (tokenError.code === 'TimeoutError') { self.disableFetchToken = true; } else if (tokenError.retryable === true) { callbacks(AWS.util.error( tokenError, { message: 'EC2 Metadata token request returned error' } )); return; } else if (tokenError.statusCode === 400) { callbacks(AWS.util.error( tokenError, { message: 'EC2 Metadata token request returned 400' } )); return; } } var options = {}; if (token) { options.headers = { 'x-aws-ec2-metadata-token': token }; } self.fetchCredentials(options, callbacks); }); } } }); /** * @api private */ module.exports = AWS.MetadataService; /***/ }), /***/ 17657: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Collection = __webpack_require__(71965); var Operation = __webpack_require__(28083); var Shape = __webpack_require__(71349); var Paginator = __webpack_require__(45938); var ResourceWaiter = __webpack_require__(41368); var metadata = __webpack_require__(49497); var util = __webpack_require__(77985); var property = util.property; var memoizedProperty = util.memoizedProperty; function Api(api, options) { var self = this; api = api || {}; options = options || {}; options.api = this; api.metadata = api.metadata || {}; var serviceIdentifier = options.serviceIdentifier; delete options.serviceIdentifier; property(this, 'isApi', true, false); property(this, 'apiVersion', api.metadata.apiVersion); property(this, 'endpointPrefix', api.metadata.endpointPrefix); property(this, 'signingName', api.metadata.signingName); property(this, 'globalEndpoint', api.metadata.globalEndpoint); property(this, 'signatureVersion', api.metadata.signatureVersion); property(this, 'jsonVersion', api.metadata.jsonVersion); property(this, 'targetPrefix', api.metadata.targetPrefix); property(this, 'protocol', api.metadata.protocol); property(this, 'timestampFormat', api.metadata.timestampFormat); property(this, 'xmlNamespaceUri', api.metadata.xmlNamespace); property(this, 'abbreviation', api.metadata.serviceAbbreviation); property(this, 'fullName', api.metadata.serviceFullName); property(this, 'serviceId', api.metadata.serviceId); if (serviceIdentifier && metadata[serviceIdentifier]) { property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false); } memoizedProperty(this, 'className', function() { var name = api.metadata.serviceAbbreviation || api.metadata.serviceFullName; if (!name) return null; name = name.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g, ''); if (name === 'ElasticLoadBalancing') name = 'ELB'; return name; }); function addEndpointOperation(name, operation) { if (operation.endpointoperation === true) { property(self, 'endpointOperation', util.string.lowerFirst(name)); } if (operation.endpointdiscovery && !self.hasRequiredEndpointDiscovery) { property( self, 'hasRequiredEndpointDiscovery', operation.endpointdiscovery.required === true ); } } property(this, 'operations', new Collection(api.operations, options, function(name, operation) { return new Operation(name, operation, options); }, util.string.lowerFirst, addEndpointOperation)); property(this, 'shapes', new Collection(api.shapes, options, function(name, shape) { return Shape.create(shape, options); })); property(this, 'paginators', new Collection(api.paginators, options, function(name, paginator) { return new Paginator(name, paginator, options); })); property(this, 'waiters', new Collection(api.waiters, options, function(name, waiter) { return new ResourceWaiter(name, waiter, options); }, util.string.lowerFirst)); if (options.documentation) { property(this, 'documentation', api.documentation); property(this, 'documentationUrl', api.documentationUrl); } } /** * @api private */ module.exports = Api; /***/ }), /***/ 71965: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var memoizedProperty = __webpack_require__(77985).memoizedProperty; function memoize(name, value, factory, nameTr) { memoizedProperty(this, nameTr(name), function() { return factory(name, value); }); } function Collection(iterable, options, factory, nameTr, callback) { nameTr = nameTr || String; var self = this; for (var id in iterable) { if (Object.prototype.hasOwnProperty.call(iterable, id)) { memoize.call(self, id, iterable[id], factory, nameTr); if (callback) callback(id, iterable[id]); } } } /** * @api private */ module.exports = Collection; /***/ }), /***/ 28083: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Shape = __webpack_require__(71349); var util = __webpack_require__(77985); var property = util.property; var memoizedProperty = util.memoizedProperty; function Operation(name, operation, options) { var self = this; options = options || {}; property(this, 'name', operation.name || name); property(this, 'api', options.api, false); operation.http = operation.http || {}; property(this, 'endpoint', operation.endpoint); property(this, 'httpMethod', operation.http.method || 'POST'); property(this, 'httpPath', operation.http.requestUri || '/'); property(this, 'authtype', operation.authtype || ''); property( this, 'endpointDiscoveryRequired', operation.endpointdiscovery ? (operation.endpointdiscovery.required ? 'REQUIRED' : 'OPTIONAL') : 'NULL' ); memoizedProperty(this, 'input', function() { if (!operation.input) { return new Shape.create({type: 'structure'}, options); } return Shape.create(operation.input, options); }); memoizedProperty(this, 'output', function() { if (!operation.output) { return new Shape.create({type: 'structure'}, options); } return Shape.create(operation.output, options); }); memoizedProperty(this, 'errors', function() { var list = []; if (!operation.errors) return null; for (var i = 0; i < operation.errors.length; i++) { list.push(Shape.create(operation.errors[i], options)); } return list; }); memoizedProperty(this, 'paginator', function() { return options.api.paginators[name]; }); if (options.documentation) { property(this, 'documentation', operation.documentation); property(this, 'documentationUrl', operation.documentationUrl); } // idempotentMembers only tracks top-level input shapes memoizedProperty(this, 'idempotentMembers', function() { var idempotentMembers = []; var input = self.input; var members = input.members; if (!input.members) { return idempotentMembers; } for (var name in members) { if (!members.hasOwnProperty(name)) { continue; } if (members[name].isIdempotent === true) { idempotentMembers.push(name); } } return idempotentMembers; }); memoizedProperty(this, 'hasEventOutput', function() { var output = self.output; return hasEventStream(output); }); } function hasEventStream(topLevelShape) { var members = topLevelShape.members; var payload = topLevelShape.payload; if (!topLevelShape.members) { return false; } if (payload) { var payloadMember = members[payload]; return payloadMember.isEventStream; } // check if any member is an event stream for (var name in members) { if (!members.hasOwnProperty(name)) { if (members[name].isEventStream === true) { return true; } } } return false; } /** * @api private */ module.exports = Operation; /***/ }), /***/ 45938: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var property = __webpack_require__(77985).property; function Paginator(name, paginator) { property(this, 'inputToken', paginator.input_token); property(this, 'limitKey', paginator.limit_key); property(this, 'moreResults', paginator.more_results); property(this, 'outputToken', paginator.output_token); property(this, 'resultKey', paginator.result_key); } /** * @api private */ module.exports = Paginator; /***/ }), /***/ 41368: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var property = util.property; function ResourceWaiter(name, waiter, options) { options = options || {}; property(this, 'name', name); property(this, 'api', options.api, false); if (waiter.operation) { property(this, 'operation', util.string.lowerFirst(waiter.operation)); } var self = this; var keys = [ 'type', 'description', 'delay', 'maxAttempts', 'acceptors' ]; keys.forEach(function(key) { var value = waiter[key]; if (value) { property(self, key, value); } }); } /** * @api private */ module.exports = ResourceWaiter; /***/ }), /***/ 71349: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Collection = __webpack_require__(71965); var util = __webpack_require__(77985); function property(obj, name, value) { if (value !== null && value !== undefined) { util.property.apply(this, arguments); } } function memoizedProperty(obj, name) { if (!obj.constructor.prototype[name]) { util.memoizedProperty.apply(this, arguments); } } function Shape(shape, options, memberName) { options = options || {}; property(this, 'shape', shape.shape); property(this, 'api', options.api, false); property(this, 'type', shape.type); property(this, 'enum', shape.enum); property(this, 'min', shape.min); property(this, 'max', shape.max); property(this, 'pattern', shape.pattern); property(this, 'location', shape.location || this.location || 'body'); property(this, 'name', this.name || shape.xmlName || shape.queryName || shape.locationName || memberName); property(this, 'isStreaming', shape.streaming || this.isStreaming || false); property(this, 'requiresLength', shape.requiresLength, false); property(this, 'isComposite', shape.isComposite || false); property(this, 'isShape', true, false); property(this, 'isQueryName', Boolean(shape.queryName), false); property(this, 'isLocationName', Boolean(shape.locationName), false); property(this, 'isIdempotent', shape.idempotencyToken === true); property(this, 'isJsonValue', shape.jsonvalue === true); property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true); property(this, 'isEventStream', Boolean(shape.eventstream), false); property(this, 'isEvent', Boolean(shape.event), false); property(this, 'isEventPayload', Boolean(shape.eventpayload), false); property(this, 'isEventHeader', Boolean(shape.eventheader), false); property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false); property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false); property(this, 'hostLabel', Boolean(shape.hostLabel), false); if (options.documentation) { property(this, 'documentation', shape.documentation); property(this, 'documentationUrl', shape.documentationUrl); } if (shape.xmlAttribute) { property(this, 'isXmlAttribute', shape.xmlAttribute || false); } // type conversion and parsing property(this, 'defaultValue', null); this.toWireFormat = function(value) { if (value === null || value === undefined) return ''; return value; }; this.toType = function(value) { return value; }; } /** * @api private */ Shape.normalizedTypes = { character: 'string', double: 'float', long: 'integer', short: 'integer', biginteger: 'integer', bigdecimal: 'float', blob: 'binary' }; /** * @api private */ Shape.types = { 'structure': StructureShape, 'list': ListShape, 'map': MapShape, 'boolean': BooleanShape, 'timestamp': TimestampShape, 'float': FloatShape, 'integer': IntegerShape, 'string': StringShape, 'base64': Base64Shape, 'binary': BinaryShape }; Shape.resolve = function resolve(shape, options) { if (shape.shape) { var refShape = options.api.shapes[shape.shape]; if (!refShape) { throw new Error('Cannot find shape reference: ' + shape.shape); } return refShape; } else { return null; } }; Shape.create = function create(shape, options, memberName) { if (shape.isShape) return shape; var refShape = Shape.resolve(shape, options); if (refShape) { var filteredKeys = Object.keys(shape); if (!options.documentation) { filteredKeys = filteredKeys.filter(function(name) { return !name.match(/documentation/); }); } // create an inline shape with extra members var InlineShape = function() { refShape.constructor.call(this, shape, options, memberName); }; InlineShape.prototype = refShape; return new InlineShape(); } else { // set type if not set if (!shape.type) { if (shape.members) shape.type = 'structure'; else if (shape.member) shape.type = 'list'; else if (shape.key) shape.type = 'map'; else shape.type = 'string'; } // normalize types var origType = shape.type; if (Shape.normalizedTypes[shape.type]) { shape.type = Shape.normalizedTypes[shape.type]; } if (Shape.types[shape.type]) { return new Shape.types[shape.type](shape, options, memberName); } else { throw new Error('Unrecognized shape type: ' + origType); } } }; function CompositeShape(shape) { Shape.apply(this, arguments); property(this, 'isComposite', true); if (shape.flattened) { property(this, 'flattened', shape.flattened || false); } } function StructureShape(shape, options) { var self = this; var requiredMap = null, firstInit = !this.isShape; CompositeShape.apply(this, arguments); if (firstInit) { property(this, 'defaultValue', function() { return {}; }); property(this, 'members', {}); property(this, 'memberNames', []); property(this, 'required', []); property(this, 'isRequired', function() { return false; }); } if (shape.members) { property(this, 'members', new Collection(shape.members, options, function(name, member) { return Shape.create(member, options, name); })); memoizedProperty(this, 'memberNames', function() { return shape.xmlOrder || Object.keys(shape.members); }); if (shape.event) { memoizedProperty(this, 'eventPayloadMemberName', function() { var members = self.members; var memberNames = self.memberNames; // iterate over members to find ones that are event payloads for (var i = 0, iLen = memberNames.length; i < iLen; i++) { if (members[memberNames[i]].isEventPayload) { return memberNames[i]; } } }); memoizedProperty(this, 'eventHeaderMemberNames', function() { var members = self.members; var memberNames = self.memberNames; var eventHeaderMemberNames = []; // iterate over members to find ones that are event headers for (var i = 0, iLen = memberNames.length; i < iLen; i++) { if (members[memberNames[i]].isEventHeader) { eventHeaderMemberNames.push(memberNames[i]); } } return eventHeaderMemberNames; }); } } if (shape.required) { property(this, 'required', shape.required); property(this, 'isRequired', function(name) { if (!requiredMap) { requiredMap = {}; for (var i = 0; i < shape.required.length; i++) { requiredMap[shape.required[i]] = true; } } return requiredMap[name]; }, false, true); } property(this, 'resultWrapper', shape.resultWrapper || null); if (shape.payload) { property(this, 'payload', shape.payload); } if (typeof shape.xmlNamespace === 'string') { property(this, 'xmlNamespaceUri', shape.xmlNamespace); } else if (typeof shape.xmlNamespace === 'object') { property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix); property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri); } } function ListShape(shape, options) { var self = this, firstInit = !this.isShape; CompositeShape.apply(this, arguments); if (firstInit) { property(this, 'defaultValue', function() { return []; }); } if (shape.member) { memoizedProperty(this, 'member', function() { return Shape.create(shape.member, options); }); } if (this.flattened) { var oldName = this.name; memoizedProperty(this, 'name', function() { return self.member.name || oldName; }); } } function MapShape(shape, options) { var firstInit = !this.isShape; CompositeShape.apply(this, arguments); if (firstInit) { property(this, 'defaultValue', function() { return {}; }); property(this, 'key', Shape.create({type: 'string'}, options)); property(this, 'value', Shape.create({type: 'string'}, options)); } if (shape.key) { memoizedProperty(this, 'key', function() { return Shape.create(shape.key, options); }); } if (shape.value) { memoizedProperty(this, 'value', function() { return Shape.create(shape.value, options); }); } } function TimestampShape(shape) { var self = this; Shape.apply(this, arguments); if (shape.timestampFormat) { property(this, 'timestampFormat', shape.timestampFormat); } else if (self.isTimestampFormatSet && this.timestampFormat) { property(this, 'timestampFormat', this.timestampFormat); } else if (this.location === 'header') { property(this, 'timestampFormat', 'rfc822'); } else if (this.location === 'querystring') { property(this, 'timestampFormat', 'iso8601'); } else if (this.api) { switch (this.api.protocol) { case 'json': case 'rest-json': property(this, 'timestampFormat', 'unixTimestamp'); break; case 'rest-xml': case 'query': case 'ec2': property(this, 'timestampFormat', 'iso8601'); break; } } this.toType = function(value) { if (value === null || value === undefined) return null; if (typeof value.toUTCString === 'function') return value; return typeof value === 'string' || typeof value === 'number' ? util.date.parseTimestamp(value) : null; }; this.toWireFormat = function(value) { return util.date.format(value, self.timestampFormat); }; } function StringShape() { Shape.apply(this, arguments); var nullLessProtocols = ['rest-xml', 'query', 'ec2']; this.toType = function(value) { value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ? value || '' : value; if (this.isJsonValue) { return JSON.parse(value); } return value && typeof value.toString === 'function' ? value.toString() : value; }; this.toWireFormat = function(value) { return this.isJsonValue ? JSON.stringify(value) : value; }; } function FloatShape() { Shape.apply(this, arguments); this.toType = function(value) { if (value === null || value === undefined) return null; return parseFloat(value); }; this.toWireFormat = this.toType; } function IntegerShape() { Shape.apply(this, arguments); this.toType = function(value) { if (value === null || value === undefined) return null; return parseInt(value, 10); }; this.toWireFormat = this.toType; } function BinaryShape() { Shape.apply(this, arguments); this.toType = function(value) { var buf = util.base64.decode(value); if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') { /* Node.js can create a Buffer that is not isolated. * i.e. buf.byteLength !== buf.buffer.byteLength * This means that the sensitive data is accessible to anyone with access to buf.buffer. * If this is the node shared Buffer, then other code within this process _could_ find this secret. * Copy sensitive data to an isolated Buffer and zero the sensitive data. * While this is safe to do here, copying this code somewhere else may produce unexpected results. */ var secureBuf = util.Buffer.alloc(buf.length, buf); buf.fill(0); buf = secureBuf; } return buf; }; this.toWireFormat = util.base64.encode; } function Base64Shape() { BinaryShape.apply(this, arguments); } function BooleanShape() { Shape.apply(this, arguments); this.toType = function(value) { if (typeof value === 'boolean') return value; if (value === null || value === undefined) return null; return value === 'true'; }; } /** * @api private */ Shape.shapes = { StructureShape: StructureShape, ListShape: ListShape, MapShape: MapShape, StringShape: StringShape, BooleanShape: BooleanShape, Base64Shape: Base64Shape }; /** * @api private */ module.exports = Shape; /***/ }), /***/ 73639: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); util.isBrowser = function() { return false; }; util.isNode = function() { return true; }; // node.js specific modules util.crypto.lib = __webpack_require__(76417); util.Buffer = __webpack_require__(64293).Buffer; util.domain = __webpack_require__(85229); util.stream = __webpack_require__(92413); util.url = __webpack_require__(78835); util.querystring = __webpack_require__(71191); util.environment = 'nodejs'; util.createEventStream = util.stream.Readable ? __webpack_require__(69643).createEventStream : __webpack_require__(63727).createEventStream; util.realClock = __webpack_require__(81370); util.clientSideMonitoring = { Publisher: __webpack_require__(66807).Publisher, configProvider: __webpack_require__(91822), }; util.iniLoader = __webpack_require__(29697)/* .iniLoader */ .b; util.getSystemErrorName = __webpack_require__(31669).getSystemErrorName; var AWS; /** * @api private */ module.exports = AWS = __webpack_require__(28437); __webpack_require__(53819); __webpack_require__(36965); __webpack_require__(77360); __webpack_require__(57083); __webpack_require__(74998); __webpack_require__(3498); __webpack_require__(15037); __webpack_require__(80371); // Load the xml2js XML parser AWS.XML.Parser = __webpack_require__(96752); // Load Node HTTP client __webpack_require__(2310); __webpack_require__(95417); // Load custom credential providers __webpack_require__(11017); __webpack_require__(73379); __webpack_require__(88764); __webpack_require__(10645); __webpack_require__(57714); __webpack_require__(27454); __webpack_require__(13754); __webpack_require__(80371); // Setup default chain providers // If this changes, please update documentation for // AWS.CredentialProviderChain.defaultProviders in // credentials/credential_provider_chain.js AWS.CredentialProviderChain.defaultProviders = [ function () { return new AWS.EnvironmentCredentials('AWS'); }, function () { return new AWS.EnvironmentCredentials('AMAZON'); }, function () { return new AWS.SharedIniFileCredentials(); }, function () { return new AWS.ECSCredentials(); }, function () { return new AWS.ProcessCredentials(); }, function () { return new AWS.TokenFileWebIdentityCredentials(); }, function () { return new AWS.EC2MetadataCredentials(); } ]; // Update configuration keys AWS.util.update(AWS.Config.prototype.keys, { credentials: function () { var credentials = null; new AWS.CredentialProviderChain([ function () { return new AWS.EnvironmentCredentials('AWS'); }, function () { return new AWS.EnvironmentCredentials('AMAZON'); }, function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); } ]).resolve(function(err, creds) { if (!err) credentials = creds; }); return credentials; }, credentialProvider: function() { return new AWS.CredentialProviderChain(); }, logger: function () { return process.env.AWSJS_DEBUG ? console : null; }, region: function() { var env = process.env; var region = env.AWS_REGION || env.AMAZON_REGION; if (env[AWS.util.configOptInEnv]) { var toCheck = [ {filename: env[AWS.util.sharedCredentialsFileEnv]}, {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]} ]; var iniLoader = AWS.util.iniLoader; while (!region && toCheck.length) { var configFile = {}; var fileInfo = toCheck.shift(); try { configFile = iniLoader.loadFrom(fileInfo); } catch (err) { if (fileInfo.isConfig) throw err; } var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile]; region = profile && profile.region; } } return region; } }); // Reset configuration AWS.config = new AWS.Config(); /***/ }), /***/ 99127: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ AWS.ParamValidator = AWS.util.inherit({ /** * Create a new validator object. * * @param validation [Boolean|map] whether input parameters should be * validated against the operation description before sending the * request. Pass a map to enable any of the following specific * validation features: * * * **min** [Boolean] — Validates that a value meets the min * constraint. This is enabled by default when paramValidation is set * to `true`. * * **max** [Boolean] — Validates that a value meets the max * constraint. * * **pattern** [Boolean] — Validates that a string value matches a * regular expression. * * **enum** [Boolean] — Validates that a string value matches one * of the allowable enum values. */ constructor: function ParamValidator(validation) { if (validation === true || validation === undefined) { validation = {'min': true}; } this.validation = validation; }, validate: function validate(shape, params, context) { this.errors = []; this.validateMember(shape, params || {}, context || 'params'); if (this.errors.length > 1) { var msg = this.errors.join('\n* '); msg = 'There were ' + this.errors.length + ' validation errors:\n* ' + msg; throw AWS.util.error(new Error(msg), {code: 'MultipleValidationErrors', errors: this.errors}); } else if (this.errors.length === 1) { throw this.errors[0]; } else { return true; } }, fail: function fail(code, message) { this.errors.push(AWS.util.error(new Error(message), {code: code})); }, validateStructure: function validateStructure(shape, params, context) { this.validateType(params, context, ['object'], 'structure'); var paramName; for (var i = 0; shape.required && i < shape.required.length; i++) { paramName = shape.required[i]; var value = params[paramName]; if (value === undefined || value === null) { this.fail('MissingRequiredParameter', 'Missing required key \'' + paramName + '\' in ' + context); } } // validate hash members for (paramName in params) { if (!Object.prototype.hasOwnProperty.call(params, paramName)) continue; var paramValue = params[paramName], memberShape = shape.members[paramName]; if (memberShape !== undefined) { var memberContext = [context, paramName].join('.'); this.validateMember(memberShape, paramValue, memberContext); } else if (paramValue !== undefined && paramValue !== null) { this.fail('UnexpectedParameter', 'Unexpected key \'' + paramName + '\' found in ' + context); } } return true; }, validateMember: function validateMember(shape, param, context) { switch (shape.type) { case 'structure': return this.validateStructure(shape, param, context); case 'list': return this.validateList(shape, param, context); case 'map': return this.validateMap(shape, param, context); default: return this.validateScalar(shape, param, context); } }, validateList: function validateList(shape, params, context) { if (this.validateType(params, context, [Array])) { this.validateRange(shape, params.length, context, 'list member count'); // validate array members for (var i = 0; i < params.length; i++) { this.validateMember(shape.member, params[i], context + '[' + i + ']'); } } }, validateMap: function validateMap(shape, params, context) { if (this.validateType(params, context, ['object'], 'map')) { // Build up a count of map members to validate range traits. var mapCount = 0; for (var param in params) { if (!Object.prototype.hasOwnProperty.call(params, param)) continue; // Validate any map key trait constraints this.validateMember(shape.key, param, context + '[key=\'' + param + '\']'); this.validateMember(shape.value, params[param], context + '[\'' + param + '\']'); mapCount++; } this.validateRange(shape, mapCount, context, 'map member count'); } }, validateScalar: function validateScalar(shape, value, context) { switch (shape.type) { case null: case undefined: case 'string': return this.validateString(shape, value, context); case 'base64': case 'binary': return this.validatePayload(value, context); case 'integer': case 'float': return this.validateNumber(shape, value, context); case 'boolean': return this.validateType(value, context, ['boolean']); case 'timestamp': return this.validateType(value, context, [Date, /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/, 'number'], 'Date object, ISO-8601 string, or a UNIX timestamp'); default: return this.fail('UnkownType', 'Unhandled type ' + shape.type + ' for ' + context); } }, validateString: function validateString(shape, value, context) { var validTypes = ['string']; if (shape.isJsonValue) { validTypes = validTypes.concat(['number', 'object', 'boolean']); } if (value !== null && this.validateType(value, context, validTypes)) { this.validateEnum(shape, value, context); this.validateRange(shape, value.length, context, 'string length'); this.validatePattern(shape, value, context); this.validateUri(shape, value, context); } }, validateUri: function validateUri(shape, value, context) { if (shape['location'] === 'uri') { if (value.length === 0) { this.fail('UriParameterError', 'Expected uri parameter to have length >= 1,' + ' but found "' + value +'" for ' + context); } } }, validatePattern: function validatePattern(shape, value, context) { if (this.validation['pattern'] && shape['pattern'] !== undefined) { if (!(new RegExp(shape['pattern'])).test(value)) { this.fail('PatternMatchError', 'Provided value "' + value + '" ' + 'does not match regex pattern /' + shape['pattern'] + '/ for ' + context); } } }, validateRange: function validateRange(shape, value, context, descriptor) { if (this.validation['min']) { if (shape['min'] !== undefined && value < shape['min']) { this.fail('MinRangeError', 'Expected ' + descriptor + ' >= ' + shape['min'] + ', but found ' + value + ' for ' + context); } } if (this.validation['max']) { if (shape['max'] !== undefined && value > shape['max']) { this.fail('MaxRangeError', 'Expected ' + descriptor + ' <= ' + shape['max'] + ', but found ' + value + ' for ' + context); } } }, validateEnum: function validateRange(shape, value, context) { if (this.validation['enum'] && shape['enum'] !== undefined) { // Fail if the string value is not present in the enum list if (shape['enum'].indexOf(value) === -1) { this.fail('EnumError', 'Found string value of ' + value + ', but ' + 'expected ' + shape['enum'].join('|') + ' for ' + context); } } }, validateType: function validateType(value, context, acceptedTypes, type) { // We will not log an error for null or undefined, but we will return // false so that callers know that the expected type was not strictly met. if (value === null || value === undefined) return false; var foundInvalidType = false; for (var i = 0; i < acceptedTypes.length; i++) { if (typeof acceptedTypes[i] === 'string') { if (typeof value === acceptedTypes[i]) return true; } else if (acceptedTypes[i] instanceof RegExp) { if ((value || '').toString().match(acceptedTypes[i])) return true; } else { if (value instanceof acceptedTypes[i]) return true; if (AWS.util.isType(value, acceptedTypes[i])) return true; if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice(); acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]); } foundInvalidType = true; } var acceptedType = type; if (!acceptedType) { acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1'); } var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : ''; this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' + vowel + ' ' + acceptedType); return false; }, validateNumber: function validateNumber(shape, value, context) { if (value === null || value === undefined) return; if (typeof value === 'string') { var castedValue = parseFloat(value); if (castedValue.toString() === value) value = castedValue; } if (this.validateType(value, context, ['number'])) { this.validateRange(shape, value, context, 'numeric value'); } }, validatePayload: function validatePayload(value, context) { if (value === null || value === undefined) return; if (typeof value === 'string') return; if (value && typeof value.byteLength === 'number') return; // typed arrays if (AWS.util.isNode()) { // special check for buffer/stream in Node.js var Stream = AWS.util.stream.Stream; if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return; } else { if (typeof Blob !== void 0 && value instanceof Blob) return; } var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView']; if (value) { for (var i = 0; i < types.length; i++) { if (AWS.util.isType(value, types[i])) return; if (AWS.util.typeName(value.constructor) === types[i]) return; } } this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' + 'string, Buffer, Stream, Blob, or typed array object'); } }); /***/ }), /***/ 44086: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rest = AWS.Protocol.Rest; /** * A presigner object can be used to generate presigned urls for the Polly service. */ AWS.Polly.Presigner = AWS.util.inherit({ /** * Creates a presigner object with a set of configuration options. * * @option options params [map] An optional map of parameters to bind to every * request sent by this service object. * @option options service [AWS.Polly] An optional pre-configured instance * of the AWS.Polly service object to use for requests. The object may * bound parameters used by the presigner. * @see AWS.Polly.constructor */ constructor: function Signer(options) { options = options || {}; this.options = options; this.service = options.service; this.bindServiceObject(options); this._operations = {}; }, /** * @api private */ bindServiceObject: function bindServiceObject(options) { options = options || {}; if (!this.service) { this.service = new AWS.Polly(options); } else { var config = AWS.util.copy(this.service.config); this.service = new this.service.constructor.__super__(config); this.service.config.params = AWS.util.merge(this.service.config.params || {}, options.params); } }, /** * @api private */ modifyInputMembers: function modifyInputMembers(input) { // make copies of the input so we don't overwrite the api // need to be careful to copy anything we access/modify var modifiedInput = AWS.util.copy(input); modifiedInput.members = AWS.util.copy(input.members); AWS.util.each(input.members, function(name, member) { modifiedInput.members[name] = AWS.util.copy(member); // update location and locationName if (!member.location || member.location === 'body') { modifiedInput.members[name].location = 'querystring'; modifiedInput.members[name].locationName = name; } }); return modifiedInput; }, /** * @api private */ convertPostToGet: function convertPostToGet(req) { // convert method req.httpRequest.method = 'GET'; var operation = req.service.api.operations[req.operation]; // get cached operation input first var input = this._operations[req.operation]; if (!input) { // modify the original input this._operations[req.operation] = input = this.modifyInputMembers(operation.input); } var uri = rest.generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params); req.httpRequest.path = uri; req.httpRequest.body = ''; // don't need these headers on a GET request delete req.httpRequest.headers['Content-Length']; delete req.httpRequest.headers['Content-Type']; }, /** * @overload getSynthesizeSpeechUrl(params = {}, [expires = 3600], [callback]) * Generate a presigned url for {AWS.Polly.synthesizeSpeech}. * @note You must ensure that you have static or previously resolved * credentials if you call this method synchronously (with no callback), * otherwise it may not properly sign the request. If you cannot guarantee * this (you are using an asynchronous credential provider, i.e., EC2 * IAM roles), you should always call this method with an asynchronous * callback. * @param params [map] parameters to pass to the operation. See the {AWS.Polly.synthesizeSpeech} * operation for the expected operation parameters. * @param expires [Integer] (3600) the number of seconds to expire the pre-signed URL operation in. * Defaults to 1 hour. * @return [string] if called synchronously (with no callback), returns the signed URL. * @return [null] nothing is returned if a callback is provided. * @callback callback function (err, url) * If a callback is supplied, it is called when a signed URL has been generated. * @param err [Error] the error object returned from the presigner. * @param url [String] the signed URL. * @see AWS.Polly.synthesizeSpeech */ getSynthesizeSpeechUrl: function getSynthesizeSpeechUrl(params, expires, callback) { var self = this; var request = this.service.makeRequest('synthesizeSpeech', params); // remove existing build listeners request.removeAllListeners('build'); request.on('build', function(req) { self.convertPostToGet(req); }); return request.presign(expires, callback); } }); /***/ }), /***/ 97969: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var AWS = __webpack_require__(28437); /** * Prepend prefix defined by API model to endpoint that's already * constructed. This feature does not apply to operations using * endpoint discovery and can be disabled. * @api private */ function populateHostPrefix(request) { var enabled = request.service.config.hostPrefixEnabled; if (!enabled) return request; var operationModel = request.service.api.operations[request.operation]; //don't marshal host prefix when operation has endpoint discovery traits if (hasEndpointDiscover(request)) return request; if (operationModel.endpoint && operationModel.endpoint.hostPrefix) { var hostPrefixNotation = operationModel.endpoint.hostPrefix; var hostPrefix = expandHostPrefix(hostPrefixNotation, request.params, operationModel.input); prependEndpointPrefix(request.httpRequest.endpoint, hostPrefix); validateHostname(request.httpRequest.endpoint.hostname); } return request; } /** * @api private */ function hasEndpointDiscover(request) { var api = request.service.api; var operationModel = api.operations[request.operation]; var isEndpointOperation = api.endpointOperation && (api.endpointOperation === util.string.lowerFirst(operationModel.name)); return (operationModel.endpointDiscoveryRequired !== 'NULL' || isEndpointOperation === true); } /** * @api private */ function expandHostPrefix(hostPrefixNotation, params, shape) { util.each(shape.members, function(name, member) { if (member.hostLabel === true) { if (typeof params[name] !== 'string' || params[name] === '') { throw util.error(new Error(), { message: 'Parameter ' + name + ' should be a non-empty string.', code: 'InvalidParameter' }); } var regex = new RegExp('\\{' + name + '\\}', 'g'); hostPrefixNotation = hostPrefixNotation.replace(regex, params[name]); } }); return hostPrefixNotation; } /** * @api private */ function prependEndpointPrefix(endpoint, prefix) { if (endpoint.host) { endpoint.host = prefix + endpoint.host; } if (endpoint.hostname) { endpoint.hostname = prefix + endpoint.hostname; } } /** * @api private */ function validateHostname(hostname) { var labels = hostname.split('.'); //Reference: https://tools.ietf.org/html/rfc1123#section-2 var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/; util.arrayEach(labels, function(label) { if (!label.length || label.length < 1 || label.length > 63) { throw util.error(new Error(), { code: 'ValidationError', message: 'Hostname label length should be between 1 to 63 characters, inclusive.' }); } if (!hostPattern.test(label)) { throw AWS.util.error(new Error(), {code: 'ValidationError', message: label + ' is not hostname compatible.'}); } }); } module.exports = { populateHostPrefix: populateHostPrefix }; /***/ }), /***/ 30083: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var JsonBuilder = __webpack_require__(47495); var JsonParser = __webpack_require__(5474); var populateHostPrefix = __webpack_require__(97969).populateHostPrefix; function buildRequest(req) { var httpRequest = req.httpRequest; var api = req.service.api; var target = api.targetPrefix + '.' + api.operations[req.operation].name; var version = api.jsonVersion || '1.0'; var input = api.operations[req.operation].input; var builder = new JsonBuilder(); if (version === 1) version = '1.0'; httpRequest.body = builder.build(req.params || {}, input); httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version; httpRequest.headers['X-Amz-Target'] = target; populateHostPrefix(req); } function extractError(resp) { var error = {}; var httpResponse = resp.httpResponse; error.code = httpResponse.headers['x-amzn-errortype'] || 'UnknownError'; if (typeof error.code === 'string') { error.code = error.code.split(':')[0]; } if (httpResponse.body.length > 0) { try { var e = JSON.parse(httpResponse.body.toString()); var code = e.__type || e.code || e.Code; if (code) { error.code = code.split('#').pop(); } if (error.code === 'RequestEntityTooLarge') { error.message = 'Request body must be less than 1 MB'; } else { error.message = (e.message || e.Message || null); } } catch (e) { error.statusCode = httpResponse.statusCode; error.message = httpResponse.statusMessage; } } else { error.statusCode = httpResponse.statusCode; error.message = httpResponse.statusCode.toString(); } resp.error = util.error(new Error(), error); } function extractData(resp) { var body = resp.httpResponse.body.toString() || '{}'; if (resp.request.service.config.convertResponseTypes === false) { resp.data = JSON.parse(body); } else { var operation = resp.request.service.api.operations[resp.request.operation]; var shape = operation.output || {}; var parser = new JsonParser(); resp.data = parser.parse(body, shape); } } /** * @api private */ module.exports = { buildRequest: buildRequest, extractError: extractError, extractData: extractData }; /***/ }), /***/ 90761: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = __webpack_require__(77985); var QueryParamSerializer = __webpack_require__(45175); var Shape = __webpack_require__(71349); var populateHostPrefix = __webpack_require__(97969).populateHostPrefix; function buildRequest(req) { var operation = req.service.api.operations[req.operation]; var httpRequest = req.httpRequest; httpRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'; httpRequest.params = { Version: req.service.api.apiVersion, Action: operation.name }; // convert the request parameters into a list of query params, // e.g. Deeply.NestedParam.0.Name=value var builder = new QueryParamSerializer(); builder.serialize(req.params, operation.input, function(name, value) { httpRequest.params[name] = value; }); httpRequest.body = util.queryParamsToString(httpRequest.params); populateHostPrefix(req); } function extractError(resp) { var data, body = resp.httpResponse.body.toString(); if (body.match(' { var util = __webpack_require__(77985); var populateHostPrefix = __webpack_require__(97969).populateHostPrefix; function populateMethod(req) { req.httpRequest.method = req.service.api.operations[req.operation].httpMethod; } function generateURI(endpointPath, operationPath, input, params) { var uri = [endpointPath, operationPath].join('/'); uri = uri.replace(/\/+/g, '/'); var queryString = {}, queryStringSet = false; util.each(input.members, function (name, member) { var paramValue = params[name]; if (paramValue === null || paramValue === undefined) return; if (member.location === 'uri') { var regex = new RegExp('\\{' + member.name + '(\\+)?\\}'); uri = uri.replace(regex, function(_, plus) { var fn = plus ? util.uriEscapePath : util.uriEscape; return fn(String(paramValue)); }); } else if (member.location === 'querystring') { queryStringSet = true; if (member.type === 'list') { queryString[member.name] = paramValue.map(function(val) { return util.uriEscape(member.member.toWireFormat(val).toString()); }); } else if (member.type === 'map') { util.each(paramValue, function(key, value) { if (Array.isArray(value)) { queryString[key] = value.map(function(val) { return util.uriEscape(String(val)); }); } else { queryString[key] = util.uriEscape(String(value)); } }); } else { queryString[member.name] = util.uriEscape(member.toWireFormat(paramValue).toString()); } } }); if (queryStringSet) { uri += (uri.indexOf('?') >= 0 ? '&' : '?'); var parts = []; util.arrayEach(Object.keys(queryString).sort(), function(key) { if (!Array.isArray(queryString[key])) { queryString[key] = [queryString[key]]; } for (var i = 0; i < queryString[key].length; i++) { parts.push(util.uriEscape(String(key)) + '=' + queryString[key][i]); } }); uri += parts.join('&'); } return uri; } function populateURI(req) { var operation = req.service.api.operations[req.operation]; var input = operation.input; var uri = generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params); req.httpRequest.path = uri; } function populateHeaders(req) { var operation = req.service.api.operations[req.operation]; util.each(operation.input.members, function (name, member) { var value = req.params[name]; if (value === null || value === undefined) return; if (member.location === 'headers' && member.type === 'map') { util.each(value, function(key, memberValue) { req.httpRequest.headers[member.name + key] = memberValue; }); } else if (member.location === 'header') { value = member.toWireFormat(value).toString(); if (member.isJsonValue) { value = util.base64.encode(value); } req.httpRequest.headers[member.name] = value; } }); } function buildRequest(req) { populateMethod(req); populateURI(req); populateHeaders(req); populateHostPrefix(req); } function extractError() { } function extractData(resp) { var req = resp.request; var data = {}; var r = resp.httpResponse; var operation = req.service.api.operations[req.operation]; var output = operation.output; // normalize headers names to lower-cased keys for matching var headers = {}; util.each(r.headers, function (k, v) { headers[k.toLowerCase()] = v; }); util.each(output.members, function(name, member) { var header = (member.name || name).toLowerCase(); if (member.location === 'headers' && member.type === 'map') { data[name] = {}; var location = member.isLocationName ? member.name : ''; var pattern = new RegExp('^' + location + '(.+)', 'i'); util.each(r.headers, function (k, v) { var result = k.match(pattern); if (result !== null) { data[name][result[1]] = v; } }); } else if (member.location === 'header') { if (headers[header] !== undefined) { var value = member.isJsonValue ? util.base64.decode(headers[header]) : headers[header]; data[name] = member.toType(value); } } else if (member.location === 'statusCode') { data[name] = parseInt(r.statusCode, 10); } }); resp.data = data; } /** * @api private */ module.exports = { buildRequest: buildRequest, extractError: extractError, extractData: extractData, generateURI: generateURI }; /***/ }), /***/ 5883: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var Rest = __webpack_require__(98200); var Json = __webpack_require__(30083); var JsonBuilder = __webpack_require__(47495); var JsonParser = __webpack_require__(5474); function populateBody(req) { var builder = new JsonBuilder(); var input = req.service.api.operations[req.operation].input; if (input.payload) { var params = {}; var payloadShape = input.members[input.payload]; params = req.params[input.payload]; if (params === undefined) return; if (payloadShape.type === 'structure') { req.httpRequest.body = builder.build(params, payloadShape); applyContentTypeHeader(req); } else { // non-JSON payload req.httpRequest.body = params; if (payloadShape.type === 'binary' || payloadShape.isStreaming) { applyContentTypeHeader(req, true); } } } else { var body = builder.build(req.params, input); if (body !== '{}' || req.httpRequest.method !== 'GET') { //don't send empty body for GET method req.httpRequest.body = body; } applyContentTypeHeader(req); } } function applyContentTypeHeader(req, isBinary) { var operation = req.service.api.operations[req.operation]; var input = operation.input; if (!req.httpRequest.headers['Content-Type']) { var type = isBinary ? 'binary/octet-stream' : 'application/json'; req.httpRequest.headers['Content-Type'] = type; } } function buildRequest(req) { Rest.buildRequest(req); // never send body payload on HEAD/DELETE if (['HEAD', 'DELETE'].indexOf(req.httpRequest.method) < 0) { populateBody(req); } } function extractError(resp) { Json.extractError(resp); } function extractData(resp) { Rest.extractData(resp); var req = resp.request; var operation = req.service.api.operations[req.operation]; var rules = req.service.api.operations[req.operation].output || {}; var parser; var hasEventOutput = operation.hasEventOutput; if (rules.payload) { var payloadMember = rules.members[rules.payload]; var body = resp.httpResponse.body; if (payloadMember.isEventStream) { parser = new JsonParser(); resp.data[payload] = util.createEventStream( AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : body, parser, payloadMember ); } else if (payloadMember.type === 'structure' || payloadMember.type === 'list') { var parser = new JsonParser(); resp.data[rules.payload] = parser.parse(body, payloadMember); } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) { resp.data[rules.payload] = body; } else { resp.data[rules.payload] = payloadMember.toType(body); } } else { var data = resp.data; Json.extractData(resp); resp.data = util.merge(data, resp.data); } } /** * @api private */ module.exports = { buildRequest: buildRequest, extractError: extractError, extractData: extractData }; /***/ }), /***/ 15143: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = __webpack_require__(77985); var Rest = __webpack_require__(98200); function populateBody(req) { var input = req.service.api.operations[req.operation].input; var builder = new AWS.XML.Builder(); var params = req.params; var payload = input.payload; if (payload) { var payloadMember = input.members[payload]; params = params[payload]; if (params === undefined) return; if (payloadMember.type === 'structure') { var rootElement = payloadMember.name; req.httpRequest.body = builder.toXML(params, payloadMember, rootElement, true); } else { // non-xml payload req.httpRequest.body = params; } } else { req.httpRequest.body = builder.toXML(params, input, input.name || input.shape || util.string.upperFirst(req.operation) + 'Request'); } } function buildRequest(req) { Rest.buildRequest(req); // never send body payload on GET/HEAD if (['GET', 'HEAD'].indexOf(req.httpRequest.method) < 0) { populateBody(req); } } function extractError(resp) { Rest.extractError(resp); var data; try { data = new AWS.XML.Parser().parse(resp.httpResponse.body.toString()); } catch (e) { data = { Code: resp.httpResponse.statusCode, Message: resp.httpResponse.statusMessage }; } if (data.Errors) data = data.Errors; if (data.Error) data = data.Error; if (data.Code) { resp.error = util.error(new Error(), { code: data.Code, message: data.Message }); } else { resp.error = util.error(new Error(), { code: resp.httpResponse.statusCode, message: null }); } } function extractData(resp) { Rest.extractData(resp); var parser; var req = resp.request; var body = resp.httpResponse.body; var operation = req.service.api.operations[req.operation]; var output = operation.output; var hasEventOutput = operation.hasEventOutput; var payload = output.payload; if (payload) { var payloadMember = output.members[payload]; if (payloadMember.isEventStream) { parser = new AWS.XML.Parser(); resp.data[payload] = util.createEventStream( AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : resp.httpResponse.body, parser, payloadMember ); } else if (payloadMember.type === 'structure') { parser = new AWS.XML.Parser(); resp.data[payload] = parser.parse(body.toString(), payloadMember); } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) { resp.data[payload] = body; } else { resp.data[payload] = payloadMember.toType(body); } } else if (body.length > 0) { parser = new AWS.XML.Parser(); var data = parser.parse(body.toString(), output); util.update(resp.data, data); } } /** * @api private */ module.exports = { buildRequest: buildRequest, extractError: extractError, extractData: extractData }; /***/ }), /***/ 91822: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Resolve client-side monitoring configuration from either environmental variables * or shared config file. Configurations from environmental variables have higher priority * than those from shared config file. The resolver will try to read the shared config file * no matter whether the AWS_SDK_LOAD_CONFIG variable is set. * @api private */ function resolveMonitoringConfig() { var config = { port: undefined, clientId: undefined, enabled: undefined, host: undefined }; if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config); return toJSType(config); } /** * Resolve configurations from environmental variables. * @param {object} client side monitoring config object needs to be resolved * @returns {boolean} whether resolving configurations is done * @api private */ function fromEnvironment(config) { config.port = config.port || process.env.AWS_CSM_PORT; config.enabled = config.enabled || process.env.AWS_CSM_ENABLED; config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID; config.host = config.host || process.env.AWS_CSM_HOST; return config.port && config.enabled && config.clientId && config.host || ['false', '0'].indexOf(config.enabled) >= 0; //no need to read shared config file if explicitely disabled } /** * Resolve cofigurations from shared config file with specified role name * @param {object} client side monitoring config object needs to be resolved * @returns {boolean} whether resolving configurations is done * @api private */ function fromConfigFile(config) { var sharedFileConfig; try { var configFile = AWS.util.iniLoader.loadFrom({ isConfig: true, filename: process.env[AWS.util.sharedConfigFileEnv] }); var sharedFileConfig = configFile[ process.env.AWS_PROFILE || AWS.util.defaultProfile ]; } catch (err) { return false; } if (!sharedFileConfig) return config; config.port = config.port || sharedFileConfig.csm_port; config.enabled = config.enabled || sharedFileConfig.csm_enabled; config.clientId = config.clientId || sharedFileConfig.csm_client_id; config.host = config.host || sharedFileConfig.csm_host; return config.port && config.enabled && config.clientId && config.host; } /** * Transfer the resolved configuration value to proper types: port as number, enabled * as boolean and clientId as string. The 'enabled' flag is valued to false when set * to 'false' or '0'. * @param {object} resolved client side monitoring config * @api private */ function toJSType(config) { //config.XXX is either undefined or string var falsyNotations = ['false', '0', undefined]; if (!config.enabled || falsyNotations.indexOf(config.enabled.toLowerCase()) >= 0) { config.enabled = false; } else { config.enabled = true; } config.port = config.port ? parseInt(config.port, 10) : undefined; return config; } module.exports = resolveMonitoringConfig; /***/ }), /***/ 66807: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(28437).util; var dgram = __webpack_require__(76200); var stringToBuffer = util.buffer.toBuffer; var MAX_MESSAGE_SIZE = 1024 * 8; // 8 KB /** * Publishes metrics via udp. * @param {object} options Paramters for Publisher constructor * @param {number} [options.port = 31000] Port number * @param {string} [options.clientId = ''] Client Identifier * @param {boolean} [options.enabled = false] enable sending metrics datagram * @api private */ function Publisher(options) { // handle configuration options = options || {}; this.enabled = options.enabled || false; this.port = options.port || 31000; this.clientId = options.clientId || ''; this.address = options.host || '127.0.0.1'; if (this.clientId.length > 255) { // ClientId has a max length of 255 this.clientId = this.clientId.substr(0, 255); } this.messagesInFlight = 0; } Publisher.prototype.fieldsToTrim = { UserAgent: 256, SdkException: 128, SdkExceptionMessage: 512, AwsException: 128, AwsExceptionMessage: 512, FinalSdkException: 128, FinalSdkExceptionMessage: 512, FinalAwsException: 128, FinalAwsExceptionMessage: 512 }; /** * Trims fields that have a specified max length. * @param {object} event ApiCall or ApiCallAttempt event. * @returns {object} * @api private */ Publisher.prototype.trimFields = function(event) { var trimmableFields = Object.keys(this.fieldsToTrim); for (var i = 0, iLen = trimmableFields.length; i < iLen; i++) { var field = trimmableFields[i]; if (event.hasOwnProperty(field)) { var maxLength = this.fieldsToTrim[field]; var value = event[field]; if (value && value.length > maxLength) { event[field] = value.substr(0, maxLength); } } } return event; }; /** * Handles ApiCall and ApiCallAttempt events. * @param {Object} event apiCall or apiCallAttempt event. * @api private */ Publisher.prototype.eventHandler = function(event) { // set the clientId event.ClientId = this.clientId; this.trimFields(event); var message = stringToBuffer(JSON.stringify(event)); if (!this.enabled || message.length > MAX_MESSAGE_SIZE) { // drop the message if publisher not enabled or it is too large return; } this.publishDatagram(message); }; /** * Publishes message to an agent. * @param {Buffer} message JSON message to send to agent. * @api private */ Publisher.prototype.publishDatagram = function(message) { var self = this; var client = this.getClient(); this.messagesInFlight++; this.client.send(message, 0, message.length, this.port, this.address, function(err, bytes) { if (--self.messagesInFlight <= 0) { // destroy existing client so the event loop isn't kept open self.destroyClient(); } }); }; /** * Returns an existing udp socket, or creates one if it doesn't already exist. * @api private */ Publisher.prototype.getClient = function() { if (!this.client) { this.client = dgram.createSocket('udp4'); } return this.client; }; /** * Destroys the udp socket. * @api private */ Publisher.prototype.destroyClient = function() { if (this.client) { this.client.close(); this.client = void 0; } }; module.exports = { Publisher: Publisher }; /***/ }), /***/ 45175: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); function QueryParamSerializer() { } QueryParamSerializer.prototype.serialize = function(params, shape, fn) { serializeStructure('', params, shape, fn); }; function ucfirst(shape) { if (shape.isQueryName || shape.api.protocol !== 'ec2') { return shape.name; } else { return shape.name[0].toUpperCase() + shape.name.substr(1); } } function serializeStructure(prefix, struct, rules, fn) { util.each(rules.members, function(name, member) { var value = struct[name]; if (value === null || value === undefined) return; var memberName = ucfirst(member); memberName = prefix ? prefix + '.' + memberName : memberName; serializeMember(memberName, value, member, fn); }); } function serializeMap(name, map, rules, fn) { var i = 1; util.each(map, function (key, value) { var prefix = rules.flattened ? '.' : '.entry.'; var position = prefix + (i++) + '.'; var keyName = position + (rules.key.name || 'key'); var valueName = position + (rules.value.name || 'value'); serializeMember(name + keyName, key, rules.key, fn); serializeMember(name + valueName, value, rules.value, fn); }); } function serializeList(name, list, rules, fn) { var memberRules = rules.member || {}; if (list.length === 0) { fn.call(this, name, null); return; } util.arrayEach(list, function (v, n) { var suffix = '.' + (n + 1); if (rules.api.protocol === 'ec2') { // Do nothing for EC2 suffix = suffix + ''; // make linter happy } else if (rules.flattened) { if (memberRules.name) { var parts = name.split('.'); parts.pop(); parts.push(ucfirst(memberRules)); name = parts.join('.'); } } else { suffix = '.' + (memberRules.name ? memberRules.name : 'member') + suffix; } serializeMember(name + suffix, v, memberRules, fn); }); } function serializeMember(name, value, rules, fn) { if (value === null || value === undefined) return; if (rules.type === 'structure') { serializeStructure(name, value, rules, fn); } else if (rules.type === 'list') { serializeList(name, value, rules, fn); } else if (rules.type === 'map') { serializeMap(name, value, rules, fn); } else { fn(name, rules.toWireFormat(value).toString()); } } /** * @api private */ module.exports = QueryParamSerializer; /***/ }), /***/ 16612: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ var service = null; /** * @api private */ var api = { signatureVersion: 'v4', signingName: 'rds-db', operations: {} }; /** * @api private */ var requiredAuthTokenOptions = { region: 'string', hostname: 'string', port: 'number', username: 'string' }; /** * A signer object can be used to generate an auth token to a database. */ AWS.RDS.Signer = AWS.util.inherit({ /** * Creates a signer object can be used to generate an auth token. * * @option options credentials [AWS.Credentials] the AWS credentials * to sign requests with. Uses the default credential provider chain * if not specified. * @option options hostname [String] the hostname of the database to connect to. * @option options port [Number] the port number the database is listening on. * @option options region [String] the region the database is located in. * @option options username [String] the username to login as. * @example Passing in options to constructor * var signer = new AWS.RDS.Signer({ * credentials: new AWS.SharedIniFileCredentials({profile: 'default'}), * region: 'us-east-1', * hostname: 'db.us-east-1.rds.amazonaws.com', * port: 8000, * username: 'name' * }); */ constructor: function Signer(options) { this.options = options || {}; }, /** * @api private * Strips the protocol from a url. */ convertUrlToAuthToken: function convertUrlToAuthToken(url) { // we are always using https as the protocol var protocol = 'https://'; if (url.indexOf(protocol) === 0) { return url.substring(protocol.length); } }, /** * @overload getAuthToken(options = {}, [callback]) * Generate an auth token to a database. * @note You must ensure that you have static or previously resolved * credentials if you call this method synchronously (with no callback), * otherwise it may not properly sign the request. If you cannot guarantee * this (you are using an asynchronous credential provider, i.e., EC2 * IAM roles), you should always call this method with an asynchronous * callback. * * @param options [map] The fields to use when generating an auth token. * Any options specified here will be merged on top of any options passed * to AWS.RDS.Signer: * * * **credentials** (AWS.Credentials) — the AWS credentials * to sign requests with. Uses the default credential provider chain * if not specified. * * **hostname** (String) — the hostname of the database to connect to. * * **port** (Number) — the port number the database is listening on. * * **region** (String) — the region the database is located in. * * **username** (String) — the username to login as. * @return [String] if called synchronously (with no callback), returns the * auth token. * @return [null] nothing is returned if a callback is provided. * @callback callback function (err, token) * If a callback is supplied, it is called when an auth token has been generated. * @param err [Error] the error object returned from the signer. * @param token [String] the auth token. * * @example Generating an auth token synchronously * var signer = new AWS.RDS.Signer({ * // configure options * region: 'us-east-1', * username: 'default', * hostname: 'db.us-east-1.amazonaws.com', * port: 8000 * }); * var token = signer.getAuthToken({ * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option * // credentials are not specified here or when creating the signer, so default credential provider will be used * username: 'test' // overriding username * }); * @example Generating an auth token asynchronously * var signer = new AWS.RDS.Signer({ * // configure options * region: 'us-east-1', * username: 'default', * hostname: 'db.us-east-1.amazonaws.com', * port: 8000 * }); * signer.getAuthToken({ * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option * // credentials are not specified here or when creating the signer, so default credential provider will be used * username: 'test' // overriding username * }, function(err, token) { * if (err) { * // handle error * } else { * // use token * } * }); * */ getAuthToken: function getAuthToken(options, callback) { if (typeof options === 'function' && callback === undefined) { callback = options; options = {}; } var self = this; var hasCallback = typeof callback === 'function'; // merge options with existing options options = AWS.util.merge(this.options, options); // validate options var optionsValidation = this.validateAuthTokenOptions(options); if (optionsValidation !== true) { if (hasCallback) { return callback(optionsValidation, null); } throw optionsValidation; } // 15 minutes var expires = 900; // create service to generate a request from var serviceOptions = { region: options.region, endpoint: new AWS.Endpoint(options.hostname + ':' + options.port), paramValidation: false, signatureVersion: 'v4' }; if (options.credentials) { serviceOptions.credentials = options.credentials; } service = new AWS.Service(serviceOptions); // ensure the SDK is using sigv4 signing (config is not enough) service.api = api; var request = service.makeRequest(); // add listeners to request to properly build auth token this.modifyRequestForAuthToken(request, options); if (hasCallback) { request.presign(expires, function(err, url) { if (url) { url = self.convertUrlToAuthToken(url); } callback(err, url); }); } else { var url = request.presign(expires); return this.convertUrlToAuthToken(url); } }, /** * @api private * Modifies a request to allow the presigner to generate an auth token. */ modifyRequestForAuthToken: function modifyRequestForAuthToken(request, options) { request.on('build', request.buildAsGet); var httpRequest = request.httpRequest; httpRequest.body = AWS.util.queryParamsToString({ Action: 'connect', DBUser: options.username }); }, /** * @api private * Validates that the options passed in contain all the keys with values of the correct type that * are needed to generate an auth token. */ validateAuthTokenOptions: function validateAuthTokenOptions(options) { // iterate over all keys in options var message = ''; options = options || {}; for (var key in requiredAuthTokenOptions) { if (!Object.prototype.hasOwnProperty.call(requiredAuthTokenOptions, key)) { continue; } if (typeof options[key] !== requiredAuthTokenOptions[key]) { message += 'option \'' + key + '\' should have been type \'' + requiredAuthTokenOptions[key] + '\', was \'' + typeof options[key] + '\'.\n'; } } if (message.length) { return AWS.util.error(new Error(), { code: 'InvalidParameter', message: message }); } return true; } }); /***/ }), /***/ 81370: /***/ ((module) => { module.exports = { //provide realtime clock for performance measurement now: function now() { var second = process.hrtime(); return second[0] * 1000 + (second[1] / 1000000); } }; /***/ }), /***/ 18262: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var regionConfig = __webpack_require__(51765); function generateRegionPrefix(region) { if (!region) return null; var parts = region.split('-'); if (parts.length < 3) return null; return parts.slice(0, parts.length - 2).join('-') + '-*'; } function derivedKeys(service) { var region = service.config.region; var regionPrefix = generateRegionPrefix(region); var endpointPrefix = service.api.endpointPrefix; return [ [region, endpointPrefix], [regionPrefix, endpointPrefix], [region, '*'], [regionPrefix, '*'], ['*', endpointPrefix], ['*', '*'] ].map(function(item) { return item[0] && item[1] ? item.join('/') : null; }); } function applyConfig(service, config) { util.each(config, function(key, value) { if (key === 'globalEndpoint') return; if (service.config[key] === undefined || service.config[key] === null) { service.config[key] = value; } }); } function configureEndpoint(service) { var keys = derivedKeys(service); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!key) continue; if (Object.prototype.hasOwnProperty.call(regionConfig.rules, key)) { var config = regionConfig.rules[key]; if (typeof config === 'string') { config = regionConfig.patterns[config]; } // set dualstack endpoint if (service.config.useDualstack && util.isDualstackAvailable(service)) { config = util.copy(config); config.endpoint = config.endpoint.replace( /{service}\.({region}\.)?/, '{service}.dualstack.{region}.' ); } // set global endpoint service.isGlobalEndpoint = !!config.globalEndpoint; if (config.signingRegion) { service.signingRegion = config.signingRegion; } // signature version if (!config.signatureVersion) config.signatureVersion = 'v4'; // merge config applyConfig(service, config); return; } } } function getEndpointSuffix(region) { var regionRegexes = { '^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$': 'amazonaws.com', '^cn\\-\\w+\\-\\d+$': 'amazonaws.com.cn', '^us\\-gov\\-\\w+\\-\\d+$': 'amazonaws.com', '^us\\-iso\\-\\w+\\-\\d+$': 'c2s.ic.gov', '^us\\-isob\\-\\w+\\-\\d+$': 'sc2s.sgov.gov' }; var defaultSuffix = 'amazonaws.com'; var regexes = Object.keys(regionRegexes); for (var i = 0; i < regexes.length; i++) { var regionPattern = RegExp(regexes[i]); var dnsSuffix = regionRegexes[regexes[i]]; if (regionPattern.test(region)) return dnsSuffix; } return defaultSuffix; } /** * @api private */ module.exports = { configureEndpoint: configureEndpoint, getEndpointSuffix: getEndpointSuffix }; /***/ }), /***/ 78652: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var AcceptorStateMachine = __webpack_require__(68118); var inherit = AWS.util.inherit; var domain = AWS.util.domain; var jmespath = __webpack_require__(87783); /** * @api private */ var hardErrorStates = {success: 1, error: 1, complete: 1}; function isTerminalState(machine) { return Object.prototype.hasOwnProperty.call(hardErrorStates, machine._asm.currentState); } var fsm = new AcceptorStateMachine(); fsm.setupStates = function() { var transition = function(_, done) { var self = this; self._haltHandlersOnError = false; self.emit(self._asm.currentState, function(err) { if (err) { if (isTerminalState(self)) { if (domain && self.domain instanceof domain.Domain) { err.domainEmitter = self; err.domain = self.domain; err.domainThrown = false; self.domain.emit('error', err); } else { throw err; } } else { self.response.error = err; done(err); } } else { done(self.response.error); } }); }; this.addState('validate', 'build', 'error', transition); this.addState('build', 'afterBuild', 'restart', transition); this.addState('afterBuild', 'sign', 'restart', transition); this.addState('sign', 'send', 'retry', transition); this.addState('retry', 'afterRetry', 'afterRetry', transition); this.addState('afterRetry', 'sign', 'error', transition); this.addState('send', 'validateResponse', 'retry', transition); this.addState('validateResponse', 'extractData', 'extractError', transition); this.addState('extractError', 'extractData', 'retry', transition); this.addState('extractData', 'success', 'retry', transition); this.addState('restart', 'build', 'error', transition); this.addState('success', 'complete', 'complete', transition); this.addState('error', 'complete', 'complete', transition); this.addState('complete', null, null, transition); }; fsm.setupStates(); /** * ## Asynchronous Requests * * All requests made through the SDK are asynchronous and use a * callback interface. Each service method that kicks off a request * returns an `AWS.Request` object that you can use to register * callbacks. * * For example, the following service method returns the request * object as "request", which can be used to register callbacks: * * ```javascript * // request is an AWS.Request object * var request = ec2.describeInstances(); * * // register callbacks on request to retrieve response data * request.on('success', function(response) { * console.log(response.data); * }); * ``` * * When a request is ready to be sent, the {send} method should * be called: * * ```javascript * request.send(); * ``` * * Since registered callbacks may or may not be idempotent, requests should only * be sent once. To perform the same operation multiple times, you will need to * create multiple request objects, each with its own registered callbacks. * * ## Removing Default Listeners for Events * * Request objects are built with default listeners for the various events, * depending on the service type. In some cases, you may want to remove * some built-in listeners to customize behaviour. Doing this requires * access to the built-in listener functions, which are exposed through * the {AWS.EventListeners.Core} namespace. For instance, you may * want to customize the HTTP handler used when sending a request. In this * case, you can remove the built-in listener associated with the 'send' * event, the {AWS.EventListeners.Core.SEND} listener and add your own. * * ## Multiple Callbacks and Chaining * * You can register multiple callbacks on any request object. The * callbacks can be registered for different events, or all for the * same event. In addition, you can chain callback registration, for * example: * * ```javascript * request. * on('success', function(response) { * console.log("Success!"); * }). * on('error', function(error, response) { * console.log("Error!"); * }). * on('complete', function(response) { * console.log("Always!"); * }). * send(); * ``` * * The above example will print either "Success! Always!", or "Error! Always!", * depending on whether the request succeeded or not. * * @!attribute httpRequest * @readonly * @!group HTTP Properties * @return [AWS.HttpRequest] the raw HTTP request object * containing request headers and body information * sent by the service. * * @!attribute startTime * @readonly * @!group Operation Properties * @return [Date] the time that the request started * * @!group Request Building Events * * @!event validate(request) * Triggered when a request is being validated. Listeners * should throw an error if the request should not be sent. * @param request [Request] the request object being sent * @see AWS.EventListeners.Core.VALIDATE_CREDENTIALS * @see AWS.EventListeners.Core.VALIDATE_REGION * @example Ensuring that a certain parameter is set before sending a request * var req = s3.putObject(params); * req.on('validate', function() { * if (!req.params.Body.match(/^Hello\s/)) { * throw new Error('Body must start with "Hello "'); * } * }); * req.send(function(err, data) { ... }); * * @!event build(request) * Triggered when the request payload is being built. Listeners * should fill the necessary information to send the request * over HTTP. * @param (see AWS.Request~validate) * @example Add a custom HTTP header to a request * var req = s3.putObject(params); * req.on('build', function() { * req.httpRequest.headers['Custom-Header'] = 'value'; * }); * req.send(function(err, data) { ... }); * * @!event sign(request) * Triggered when the request is being signed. Listeners should * add the correct authentication headers and/or adjust the body, * depending on the authentication mechanism being used. * @param (see AWS.Request~validate) * * @!group Request Sending Events * * @!event send(response) * Triggered when the request is ready to be sent. Listeners * should call the underlying transport layer to initiate * the sending of the request. * @param response [Response] the response object * @context [Request] the request object that was sent * @see AWS.EventListeners.Core.SEND * * @!event retry(response) * Triggered when a request failed and might need to be retried or redirected. * If the response is retryable, the listener should set the * `response.error.retryable` property to `true`, and optionally set * `response.error.retryDelay` to the millisecond delay for the next attempt. * In the case of a redirect, `response.error.redirect` should be set to * `true` with `retryDelay` set to an optional delay on the next request. * * If a listener decides that a request should not be retried, * it should set both `retryable` and `redirect` to false. * * Note that a retryable error will be retried at most * {AWS.Config.maxRetries} times (based on the service object's config). * Similarly, a request that is redirected will only redirect at most * {AWS.Config.maxRedirects} times. * * @param (see AWS.Request~send) * @context (see AWS.Request~send) * @example Adding a custom retry for a 404 response * request.on('retry', function(response) { * // this resource is not yet available, wait 10 seconds to get it again * if (response.httpResponse.statusCode === 404 && response.error) { * response.error.retryable = true; // retry this error * response.error.retryDelay = 10000; // wait 10 seconds * } * }); * * @!group Data Parsing Events * * @!event extractError(response) * Triggered on all non-2xx requests so that listeners can extract * error details from the response body. Listeners to this event * should set the `response.error` property. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!event extractData(response) * Triggered in successful requests to allow listeners to * de-serialize the response body into `response.data`. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!group Completion Events * * @!event success(response) * Triggered when the request completed successfully. * `response.data` will contain the response data and * `response.error` will be null. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!event error(error, response) * Triggered when an error occurs at any point during the * request. `response.error` will contain details about the error * that occurred. `response.data` will be null. * @param error [Error] the error object containing details about * the error that occurred. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!event complete(response) * Triggered whenever a request cycle completes. `response.error` * should be checked, since the request may have failed. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!group HTTP Events * * @!event httpHeaders(statusCode, headers, response, statusMessage) * Triggered when headers are sent by the remote server * @param statusCode [Integer] the HTTP response code * @param headers [map] the response headers * @param (see AWS.Request~send) * @param statusMessage [String] A status message corresponding to the HTTP * response code * @context (see AWS.Request~send) * * @!event httpData(chunk, response) * Triggered when data is sent by the remote server * @param chunk [Buffer] the buffer data containing the next data chunk * from the server * @param (see AWS.Request~send) * @context (see AWS.Request~send) * @see AWS.EventListeners.Core.HTTP_DATA * * @!event httpUploadProgress(progress, response) * Triggered when the HTTP request has uploaded more data * @param progress [map] An object containing the `loaded` and `total` bytes * of the request. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * @note This event will not be emitted in Node.js 0.8.x. * * @!event httpDownloadProgress(progress, response) * Triggered when the HTTP request has downloaded more data * @param progress [map] An object containing the `loaded` and `total` bytes * of the request. * @param (see AWS.Request~send) * @context (see AWS.Request~send) * @note This event will not be emitted in Node.js 0.8.x. * * @!event httpError(error, response) * Triggered when the HTTP request failed * @param error [Error] the error object that was thrown * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @!event httpDone(response) * Triggered when the server is finished sending data * @param (see AWS.Request~send) * @context (see AWS.Request~send) * * @see AWS.Response */ AWS.Request = inherit({ /** * Creates a request for an operation on a given service with * a set of input parameters. * * @param service [AWS.Service] the service to perform the operation on * @param operation [String] the operation to perform on the service * @param params [Object] parameters to send to the operation. * See the operation's documentation for the format of the * parameters. */ constructor: function Request(service, operation, params) { var endpoint = service.endpoint; var region = service.config.region; var customUserAgent = service.config.customUserAgent; if (service.isGlobalEndpoint) { if (service.signingRegion) { region = service.signingRegion; } else { region = 'us-east-1'; } } this.domain = domain && domain.active; this.service = service; this.operation = operation; this.params = params || {}; this.httpRequest = new AWS.HttpRequest(endpoint, region); this.httpRequest.appendToUserAgent(customUserAgent); this.startTime = service.getSkewCorrectedDate(); this.response = new AWS.Response(this); this._asm = new AcceptorStateMachine(fsm.states, 'validate'); this._haltHandlersOnError = false; AWS.SequentialExecutor.call(this); this.emit = this.emitEvent; }, /** * @!group Sending a Request */ /** * @overload send(callback = null) * Sends the request object. * * @callback callback function(err, data) * If a callback is supplied, it is called when a response is returned * from the service. * @context [AWS.Request] the request object being sent. * @param err [Error] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. * @example Sending a request with a callback * request = s3.putObject({Bucket: 'bucket', Key: 'key'}); * request.send(function(err, data) { console.log(err, data); }); * @example Sending a request with no callback (using event handlers) * request = s3.putObject({Bucket: 'bucket', Key: 'key'}); * request.on('complete', function(response) { ... }); // register a callback * request.send(); */ send: function send(callback) { if (callback) { // append to user agent this.httpRequest.appendToUserAgent('callback'); this.on('complete', function (resp) { callback.call(resp, resp.error, resp.data); }); } this.runTo(); return this.response; }, /** * @!method promise() * Sends the request and returns a 'thenable' promise. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function(data) * Called if the promise is fulfilled. * @param data [Object] the de-serialized data returned from the request. * @callback rejectedCallback function(error) * Called if the promise is rejected. * @param error [Error] the error object returned from the request. * @return [Promise] A promise that represents the state of the request. * @example Sending a request using promises. * var request = s3.putObject({Bucket: 'bucket', Key: 'key'}); * var result = request.promise(); * result.then(function(data) { ... }, function(error) { ... }); */ /** * @api private */ build: function build(callback) { return this.runTo('send', callback); }, /** * @api private */ runTo: function runTo(state, done) { this._asm.runTo(state, done, this); return this; }, /** * Aborts a request, emitting the error and complete events. * * @!macro nobrowser * @example Aborting a request after sending * var params = { * Bucket: 'bucket', Key: 'key', * Body: Buffer.alloc(1024 * 1024 * 5) // 5MB payload * }; * var request = s3.putObject(params); * request.send(function (err, data) { * if (err) console.log("Error:", err.code, err.message); * else console.log(data); * }); * * // abort request in 1 second * setTimeout(request.abort.bind(request), 1000); * * // prints "Error: RequestAbortedError Request aborted by user" * @return [AWS.Request] the same request object, for chaining. * @since v1.4.0 */ abort: function abort() { this.removeAllListeners('validateResponse'); this.removeAllListeners('extractError'); this.on('validateResponse', function addAbortedError(resp) { resp.error = AWS.util.error(new Error('Request aborted by user'), { code: 'RequestAbortedError', retryable: false }); }); if (this.httpRequest.stream && !this.httpRequest.stream.didCallback) { // abort HTTP stream this.httpRequest.stream.abort(); if (this.httpRequest._abortCallback) { this.httpRequest._abortCallback(); } else { this.removeAllListeners('send'); // haven't sent yet, so let's not } } return this; }, /** * Iterates over each page of results given a pageable request, calling * the provided callback with each page of data. After all pages have been * retrieved, the callback is called with `null` data. * * @note This operation can generate multiple requests to a service. * @example Iterating over multiple pages of objects in an S3 bucket * var pages = 1; * s3.listObjects().eachPage(function(err, data) { * if (err) return; * console.log("Page", pages++); * console.log(data); * }); * @example Iterating over multiple pages with an asynchronous callback * s3.listObjects(params).eachPage(function(err, data, done) { * doSomethingAsyncAndOrExpensive(function() { * // The next page of results isn't fetched until done is called * done(); * }); * }); * @callback callback function(err, data, [doneCallback]) * Called with each page of resulting data from the request. If the * optional `doneCallback` is provided in the function, it must be called * when the callback is complete. * * @param err [Error] an error object, if an error occurred. * @param data [Object] a single page of response data. If there is no * more data, this object will be `null`. * @param doneCallback [Function] an optional done callback. If this * argument is defined in the function declaration, it should be called * when the next page is ready to be retrieved. This is useful for * controlling serial pagination across asynchronous operations. * @return [Boolean] if the callback returns `false`, pagination will * stop. * * @see AWS.Request.eachItem * @see AWS.Response.nextPage * @since v1.4.0 */ eachPage: function eachPage(callback) { // Make all callbacks async-ish callback = AWS.util.fn.makeAsync(callback, 3); function wrappedCallback(response) { callback.call(response, response.error, response.data, function (result) { if (result === false) return; if (response.hasNextPage()) { response.nextPage().on('complete', wrappedCallback).send(); } else { callback.call(response, null, null, AWS.util.fn.noop); } }); } this.on('complete', wrappedCallback).send(); }, /** * Enumerates over individual items of a request, paging the responses if * necessary. * * @api experimental * @since v1.4.0 */ eachItem: function eachItem(callback) { var self = this; function wrappedCallback(err, data) { if (err) return callback(err, null); if (data === null) return callback(null, null); var config = self.service.paginationConfig(self.operation); var resultKey = config.resultKey; if (Array.isArray(resultKey)) resultKey = resultKey[0]; var items = jmespath.search(data, resultKey); var continueIteration = true; AWS.util.arrayEach(items, function(item) { continueIteration = callback(null, item); if (continueIteration === false) { return AWS.util.abort; } }); return continueIteration; } this.eachPage(wrappedCallback); }, /** * @return [Boolean] whether the operation can return multiple pages of * response data. * @see AWS.Response.eachPage * @since v1.4.0 */ isPageable: function isPageable() { return this.service.paginationConfig(this.operation) ? true : false; }, /** * Sends the request and converts the request object into a readable stream * that can be read from or piped into a writable stream. * * @note The data read from a readable stream contains only * the raw HTTP body contents. * @example Manually reading from a stream * request.createReadStream().on('data', function(data) { * console.log("Got data:", data.toString()); * }); * @example Piping a request body into a file * var out = fs.createWriteStream('/path/to/outfile.jpg'); * s3.service.getObject(params).createReadStream().pipe(out); * @return [Stream] the readable stream object that can be piped * or read from (by registering 'data' event listeners). * @!macro nobrowser */ createReadStream: function createReadStream() { var streams = AWS.util.stream; var req = this; var stream = null; if (AWS.HttpClient.streamsApiVersion === 2) { stream = new streams.PassThrough(); process.nextTick(function() { req.send(); }); } else { stream = new streams.Stream(); stream.readable = true; stream.sent = false; stream.on('newListener', function(event) { if (!stream.sent && event === 'data') { stream.sent = true; process.nextTick(function() { req.send(); }); } }); } this.on('error', function(err) { stream.emit('error', err); }); this.on('httpHeaders', function streamHeaders(statusCode, headers, resp) { if (statusCode < 300) { req.removeListener('httpData', AWS.EventListeners.Core.HTTP_DATA); req.removeListener('httpError', AWS.EventListeners.Core.HTTP_ERROR); req.on('httpError', function streamHttpError(error) { resp.error = error; resp.error.retryable = false; }); var shouldCheckContentLength = false; var expectedLen; if (req.httpRequest.method !== 'HEAD') { expectedLen = parseInt(headers['content-length'], 10); } if (expectedLen !== undefined && !isNaN(expectedLen) && expectedLen >= 0) { shouldCheckContentLength = true; var receivedLen = 0; } var checkContentLengthAndEmit = function checkContentLengthAndEmit() { if (shouldCheckContentLength && receivedLen !== expectedLen) { stream.emit('error', AWS.util.error( new Error('Stream content length mismatch. Received ' + receivedLen + ' of ' + expectedLen + ' bytes.'), { code: 'StreamContentLengthMismatch' } )); } else if (AWS.HttpClient.streamsApiVersion === 2) { stream.end(); } else { stream.emit('end'); } }; var httpStream = resp.httpResponse.createUnbufferedStream(); if (AWS.HttpClient.streamsApiVersion === 2) { if (shouldCheckContentLength) { var lengthAccumulator = new streams.PassThrough(); lengthAccumulator._write = function(chunk) { if (chunk && chunk.length) { receivedLen += chunk.length; } return streams.PassThrough.prototype._write.apply(this, arguments); }; lengthAccumulator.on('end', checkContentLengthAndEmit); stream.on('error', function(err) { shouldCheckContentLength = false; httpStream.unpipe(lengthAccumulator); lengthAccumulator.emit('end'); lengthAccumulator.end(); }); httpStream.pipe(lengthAccumulator).pipe(stream, { end: false }); } else { httpStream.pipe(stream); } } else { if (shouldCheckContentLength) { httpStream.on('data', function(arg) { if (arg && arg.length) { receivedLen += arg.length; } }); } httpStream.on('data', function(arg) { stream.emit('data', arg); }); httpStream.on('end', checkContentLengthAndEmit); } httpStream.on('error', function(err) { shouldCheckContentLength = false; stream.emit('error', err); }); } }); return stream; }, /** * @param [Array,Response] args This should be the response object, * or an array of args to send to the event. * @api private */ emitEvent: function emit(eventName, args, done) { if (typeof args === 'function') { done = args; args = null; } if (!done) done = function() { }; if (!args) args = this.eventParameters(eventName, this.response); var origEmit = AWS.SequentialExecutor.prototype.emit; origEmit.call(this, eventName, args, function (err) { if (err) this.response.error = err; done.call(this, err); }); }, /** * @api private */ eventParameters: function eventParameters(eventName) { switch (eventName) { case 'restart': case 'validate': case 'sign': case 'build': case 'afterValidate': case 'afterBuild': return [this]; case 'error': return [this.response.error, this.response]; default: return [this.response]; } }, /** * @api private */ presign: function presign(expires, callback) { if (!callback && typeof expires === 'function') { callback = expires; expires = null; } return new AWS.Signers.Presign().sign(this.toGet(), expires, callback); }, /** * @api private */ isPresigned: function isPresigned() { return Object.prototype.hasOwnProperty.call(this.httpRequest.headers, 'presigned-expires'); }, /** * @api private */ toUnauthenticated: function toUnauthenticated() { this._unAuthenticated = true; this.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS); this.removeListener('sign', AWS.EventListeners.Core.SIGN); return this; }, /** * @api private */ toGet: function toGet() { if (this.service.api.protocol === 'query' || this.service.api.protocol === 'ec2') { this.removeListener('build', this.buildAsGet); this.addListener('build', this.buildAsGet); } return this; }, /** * @api private */ buildAsGet: function buildAsGet(request) { request.httpRequest.method = 'GET'; request.httpRequest.path = request.service.endpoint.path + '?' + request.httpRequest.body; request.httpRequest.body = ''; // don't need these headers on a GET request delete request.httpRequest.headers['Content-Length']; delete request.httpRequest.headers['Content-Type']; }, /** * @api private */ haltHandlersOnError: function haltHandlersOnError() { this._haltHandlersOnError = true; } }); /** * @api private */ AWS.Request.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.promise = function promise() { var self = this; // append to user agent this.httpRequest.appendToUserAgent('promise'); return new PromiseDependency(function(resolve, reject) { self.on('complete', function(resp) { if (resp.error) { reject(resp.error); } else { // define $response property so that it is not enumerable // this prevents circular reference errors when stringifying the JSON object resolve(Object.defineProperty( resp.data || {}, '$response', {value: resp} )); } }); self.runTo(); }); }; }; /** * @api private */ AWS.Request.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.promise; }; AWS.util.addPromises(AWS.Request); AWS.util.mixin(AWS.Request, AWS.SequentialExecutor); /***/ }), /***/ 39925: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { /** * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not use this file except in compliance with the License. A copy of * the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF * ANY KIND, either express or implied. See the License for the specific * language governing permissions and limitations under the License. */ var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; var jmespath = __webpack_require__(87783); /** * @api private */ function CHECK_ACCEPTORS(resp) { var waiter = resp.request._waiter; var acceptors = waiter.config.acceptors; var acceptorMatched = false; var state = 'retry'; acceptors.forEach(function(acceptor) { if (!acceptorMatched) { var matcher = waiter.matchers[acceptor.matcher]; if (matcher && matcher(resp, acceptor.expected, acceptor.argument)) { acceptorMatched = true; state = acceptor.state; } } }); if (!acceptorMatched && resp.error) state = 'failure'; if (state === 'success') { waiter.setSuccess(resp); } else { waiter.setError(resp, state === 'retry'); } } /** * @api private */ AWS.ResourceWaiter = inherit({ /** * Waits for a given state on a service object * @param service [Service] the service object to wait on * @param state [String] the state (defined in waiter configuration) to wait * for. * @example Create a waiter for running EC2 instances * var ec2 = new AWS.EC2; * var waiter = new AWS.ResourceWaiter(ec2, 'instanceRunning'); */ constructor: function constructor(service, state) { this.service = service; this.state = state; this.loadWaiterConfig(this.state); }, service: null, state: null, config: null, matchers: { path: function(resp, expected, argument) { try { var result = jmespath.search(resp.data, argument); } catch (err) { return false; } return jmespath.strictDeepEqual(result,expected); }, pathAll: function(resp, expected, argument) { try { var results = jmespath.search(resp.data, argument); } catch (err) { return false; } if (!Array.isArray(results)) results = [results]; var numResults = results.length; if (!numResults) return false; for (var ind = 0 ; ind < numResults; ind++) { if (!jmespath.strictDeepEqual(results[ind], expected)) { return false; } } return true; }, pathAny: function(resp, expected, argument) { try { var results = jmespath.search(resp.data, argument); } catch (err) { return false; } if (!Array.isArray(results)) results = [results]; var numResults = results.length; for (var ind = 0 ; ind < numResults; ind++) { if (jmespath.strictDeepEqual(results[ind], expected)) { return true; } } return false; }, status: function(resp, expected) { var statusCode = resp.httpResponse.statusCode; return (typeof statusCode === 'number') && (statusCode === expected); }, error: function(resp, expected) { if (typeof expected === 'string' && resp.error) { return expected === resp.error.code; } // if expected is not string, can be boolean indicating presence of error return expected === !!resp.error; } }, listeners: new AWS.SequentialExecutor().addNamedListeners(function(add) { add('RETRY_CHECK', 'retry', function(resp) { var waiter = resp.request._waiter; if (resp.error && resp.error.code === 'ResourceNotReady') { resp.error.retryDelay = (waiter.config.delay || 0) * 1000; } }); add('CHECK_OUTPUT', 'extractData', CHECK_ACCEPTORS); add('CHECK_ERROR', 'extractError', CHECK_ACCEPTORS); }), /** * @return [AWS.Request] */ wait: function wait(params, callback) { if (typeof params === 'function') { callback = params; params = undefined; } if (params && params.$waiter) { params = AWS.util.copy(params); if (typeof params.$waiter.delay === 'number') { this.config.delay = params.$waiter.delay; } if (typeof params.$waiter.maxAttempts === 'number') { this.config.maxAttempts = params.$waiter.maxAttempts; } delete params.$waiter; } var request = this.service.makeRequest(this.config.operation, params); request._waiter = this; request.response.maxRetries = this.config.maxAttempts; request.addListeners(this.listeners); if (callback) request.send(callback); return request; }, setSuccess: function setSuccess(resp) { resp.error = null; resp.data = resp.data || {}; resp.request.removeAllListeners('extractData'); }, setError: function setError(resp, retryable) { resp.data = null; resp.error = AWS.util.error(resp.error || new Error(), { code: 'ResourceNotReady', message: 'Resource is not in the state ' + this.state, retryable: retryable }); }, /** * Loads waiter configuration from API configuration * * @api private */ loadWaiterConfig: function loadWaiterConfig(state) { if (!this.service.api.waiters[state]) { throw new AWS.util.error(new Error(), { code: 'StateNotFoundError', message: 'State ' + state + ' not found.' }); } this.config = AWS.util.copy(this.service.api.waiters[state]); } }); /***/ }), /***/ 58743: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; var jmespath = __webpack_require__(87783); /** * This class encapsulates the response information * from a service request operation sent through {AWS.Request}. * The response object has two main properties for getting information * back from a request: * * ## The `data` property * * The `response.data` property contains the serialized object data * retrieved from the service request. For instance, for an * Amazon DynamoDB `listTables` method call, the response data might * look like: * * ``` * > resp.data * { TableNames: * [ 'table1', 'table2', ... ] } * ``` * * The `data` property can be null if an error occurs (see below). * * ## The `error` property * * In the event of a service error (or transfer error), the * `response.error` property will be filled with the given * error data in the form: * * ``` * { code: 'SHORT_UNIQUE_ERROR_CODE', * message: 'Some human readable error message' } * ``` * * In the case of an error, the `data` property will be `null`. * Note that if you handle events that can be in a failure state, * you should always check whether `response.error` is set * before attempting to access the `response.data` property. * * @!attribute data * @readonly * @!group Data Properties * @note Inside of a {AWS.Request~httpData} event, this * property contains a single raw packet instead of the * full de-serialized service response. * @return [Object] the de-serialized response data * from the service. * * @!attribute error * An structure containing information about a service * or networking error. * @readonly * @!group Data Properties * @note This attribute is only filled if a service or * networking error occurs. * @return [Error] * * code [String] a unique short code representing the * error that was emitted. * * message [String] a longer human readable error message * * retryable [Boolean] whether the error message is * retryable. * * statusCode [Numeric] in the case of a request that reached the service, * this value contains the response status code. * * time [Date] the date time object when the error occurred. * * hostname [String] set when a networking error occurs to easily * identify the endpoint of the request. * * region [String] set when a networking error occurs to easily * identify the region of the request. * * @!attribute requestId * @readonly * @!group Data Properties * @return [String] the unique request ID associated with the response. * Log this value when debugging requests for AWS support. * * @!attribute retryCount * @readonly * @!group Operation Properties * @return [Integer] the number of retries that were * attempted before the request was completed. * * @!attribute redirectCount * @readonly * @!group Operation Properties * @return [Integer] the number of redirects that were * followed before the request was completed. * * @!attribute httpResponse * @readonly * @!group HTTP Properties * @return [AWS.HttpResponse] the raw HTTP response object * containing the response headers and body information * from the server. * * @see AWS.Request */ AWS.Response = inherit({ /** * @api private */ constructor: function Response(request) { this.request = request; this.data = null; this.error = null; this.retryCount = 0; this.redirectCount = 0; this.httpResponse = new AWS.HttpResponse(); if (request) { this.maxRetries = request.service.numRetries(); this.maxRedirects = request.service.config.maxRedirects; } }, /** * Creates a new request for the next page of response data, calling the * callback with the page data if a callback is provided. * * @callback callback function(err, data) * Called when a page of data is returned from the next request. * * @param err [Error] an error object, if an error occurred in the request * @param data [Object] the next page of data, or null, if there are no * more pages left. * @return [AWS.Request] the request object for the next page of data * @return [null] if no callback is provided and there are no pages left * to retrieve. * @since v1.4.0 */ nextPage: function nextPage(callback) { var config; var service = this.request.service; var operation = this.request.operation; try { config = service.paginationConfig(operation, true); } catch (e) { this.error = e; } if (!this.hasNextPage()) { if (callback) callback(this.error, null); else if (this.error) throw this.error; return null; } var params = AWS.util.copy(this.request.params); if (!this.nextPageTokens) { return callback ? callback(null, null) : null; } else { var inputTokens = config.inputToken; if (typeof inputTokens === 'string') inputTokens = [inputTokens]; for (var i = 0; i < inputTokens.length; i++) { params[inputTokens[i]] = this.nextPageTokens[i]; } return service.makeRequest(this.request.operation, params, callback); } }, /** * @return [Boolean] whether more pages of data can be returned by further * requests * @since v1.4.0 */ hasNextPage: function hasNextPage() { this.cacheNextPageTokens(); if (this.nextPageTokens) return true; if (this.nextPageTokens === undefined) return undefined; else return false; }, /** * @api private */ cacheNextPageTokens: function cacheNextPageTokens() { if (Object.prototype.hasOwnProperty.call(this, 'nextPageTokens')) return this.nextPageTokens; this.nextPageTokens = undefined; var config = this.request.service.paginationConfig(this.request.operation); if (!config) return this.nextPageTokens; this.nextPageTokens = null; if (config.moreResults) { if (!jmespath.search(this.data, config.moreResults)) { return this.nextPageTokens; } } var exprs = config.outputToken; if (typeof exprs === 'string') exprs = [exprs]; AWS.util.arrayEach.call(this, exprs, function (expr) { var output = jmespath.search(this.data, expr); if (output) { this.nextPageTokens = this.nextPageTokens || []; this.nextPageTokens.push(output); } }); return this.nextPageTokens; } }); /***/ }), /***/ 81600: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var byteLength = AWS.util.string.byteLength; var Buffer = AWS.util.Buffer; /** * The managed uploader allows for easy and efficient uploading of buffers, * blobs, or streams, using a configurable amount of concurrency to perform * multipart uploads where possible. This abstraction also enables uploading * streams of unknown size due to the use of multipart uploads. * * To construct a managed upload object, see the {constructor} function. * * ## Tracking upload progress * * The managed upload object can also track progress by attaching an * 'httpUploadProgress' listener to the upload manager. This event is similar * to {AWS.Request~httpUploadProgress} but groups all concurrent upload progress * into a single event. See {AWS.S3.ManagedUpload~httpUploadProgress} for more * information. * * ## Handling Multipart Cleanup * * By default, this class will automatically clean up any multipart uploads * when an individual part upload fails. This behavior can be disabled in order * to manually handle failures by setting the `leavePartsOnError` configuration * option to `true` when initializing the upload object. * * @!event httpUploadProgress(progress) * Triggered when the uploader has uploaded more data. * @note The `total` property may not be set if the stream being uploaded has * not yet finished chunking. In this case the `total` will be undefined * until the total stream size is known. * @note This event will not be emitted in Node.js 0.8.x. * @param progress [map] An object containing the `loaded` and `total` bytes * of the request and the `key` of the S3 object. Note that `total` may be undefined until the payload * size is known. * @context (see AWS.Request~send) */ AWS.S3.ManagedUpload = AWS.util.inherit({ /** * Creates a managed upload object with a set of configuration options. * * @note A "Body" parameter is required to be set prior to calling {send}. * @note In Node.js, sending "Body" as {https://nodejs.org/dist/latest/docs/api/stream.html#stream_object_mode object-mode stream} * may result in upload hangs. Using buffer stream is preferable. * @option options params [map] a map of parameters to pass to the upload * requests. The "Body" parameter is required to be specified either on * the service or in the params option. * @note ContentMD5 should not be provided when using the managed upload object. * Instead, setting "computeChecksums" to true will enable automatic ContentMD5 generation * by the managed upload object. * @option options queueSize [Number] (4) the size of the concurrent queue * manager to upload parts in parallel. Set to 1 for synchronous uploading * of parts. Note that the uploader will buffer at most queueSize * partSize * bytes into memory at any given time. * @option options partSize [Number] (5mb) the size in bytes for each * individual part to be uploaded. Adjust the part size to ensure the number * of parts does not exceed {maxTotalParts}. See {minPartSize} for the * minimum allowed part size. * @option options leavePartsOnError [Boolean] (false) whether to abort the * multipart upload if an error occurs. Set to true if you want to handle * failures manually. * @option options service [AWS.S3] an optional S3 service object to use for * requests. This object might have bound parameters used by the uploader. * @option options tags [Array] The tags to apply to the uploaded object. * Each tag should have a `Key` and `Value` keys. * @example Creating a default uploader for a stream object * var upload = new AWS.S3.ManagedUpload({ * params: {Bucket: 'bucket', Key: 'key', Body: stream} * }); * @example Creating an uploader with concurrency of 1 and partSize of 10mb * var upload = new AWS.S3.ManagedUpload({ * partSize: 10 * 1024 * 1024, queueSize: 1, * params: {Bucket: 'bucket', Key: 'key', Body: stream} * }); * @example Creating an uploader with tags * var upload = new AWS.S3.ManagedUpload({ * params: {Bucket: 'bucket', Key: 'key', Body: stream}, * tags: [{Key: 'tag1', Value: 'value1'}, {Key: 'tag2', Value: 'value2'}] * }); * @see send */ constructor: function ManagedUpload(options) { var self = this; AWS.SequentialExecutor.call(self); self.body = null; self.sliceFn = null; self.callback = null; self.parts = {}; self.completeInfo = []; self.fillQueue = function() { self.callback(new Error('Unsupported body payload ' + typeof self.body)); }; self.configure(options); }, /** * @api private */ configure: function configure(options) { options = options || {}; this.partSize = this.minPartSize; if (options.queueSize) this.queueSize = options.queueSize; if (options.partSize) this.partSize = options.partSize; if (options.leavePartsOnError) this.leavePartsOnError = true; if (options.tags) { if (!Array.isArray(options.tags)) { throw new Error('Tags must be specified as an array; ' + typeof options.tags + ' provided.'); } this.tags = options.tags; } if (this.partSize < this.minPartSize) { throw new Error('partSize must be greater than ' + this.minPartSize); } this.service = options.service; this.bindServiceObject(options.params); this.validateBody(); this.adjustTotalBytes(); }, /** * @api private */ leavePartsOnError: false, /** * @api private */ queueSize: 4, /** * @api private */ partSize: null, /** * @readonly * @return [Number] the minimum number of bytes for an individual part * upload. */ minPartSize: 1024 * 1024 * 5, /** * @readonly * @return [Number] the maximum allowed number of parts in a multipart upload. */ maxTotalParts: 10000, /** * Initiates the managed upload for the payload. * * @callback callback function(err, data) * @param err [Error] an error or null if no error occurred. * @param data [map] The response data from the successful upload: * * `Location` (String) the URL of the uploaded object * * `ETag` (String) the ETag of the uploaded object * * `Bucket` (String) the bucket to which the object was uploaded * * `Key` (String) the key to which the object was uploaded * @example Sending a managed upload object * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; * var upload = new AWS.S3.ManagedUpload({params: params}); * upload.send(function(err, data) { * console.log(err, data); * }); */ send: function(callback) { var self = this; self.failed = false; self.callback = callback || function(err) { if (err) throw err; }; var runFill = true; if (self.sliceFn) { self.fillQueue = self.fillBuffer; } else if (AWS.util.isNode()) { var Stream = AWS.util.stream.Stream; if (self.body instanceof Stream) { runFill = false; self.fillQueue = self.fillStream; self.partBuffers = []; self.body. on('error', function(err) { self.cleanup(err); }). on('readable', function() { self.fillQueue(); }). on('end', function() { self.isDoneChunking = true; self.numParts = self.totalPartNumbers; self.fillQueue.call(self); if (self.isDoneChunking && self.totalPartNumbers >= 1 && self.doneParts === self.numParts) { self.finishMultiPart(); } }); } } if (runFill) self.fillQueue.call(self); }, /** * @!method promise() * Returns a 'thenable' promise. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @callback fulfilledCallback function(data) * Called if the promise is fulfilled. * @param data [map] The response data from the successful upload: * `Location` (String) the URL of the uploaded object * `ETag` (String) the ETag of the uploaded object * `Bucket` (String) the bucket to which the object was uploaded * `Key` (String) the key to which the object was uploaded * @callback rejectedCallback function(err) * Called if the promise is rejected. * @param err [Error] an error or null if no error occurred. * @return [Promise] A promise that represents the state of the upload request. * @example Sending an upload request using promises. * var upload = s3.upload({Bucket: 'bucket', Key: 'key', Body: stream}); * var promise = upload.promise(); * promise.then(function(data) { ... }, function(err) { ... }); */ /** * Aborts a managed upload, including all concurrent upload requests. * @note By default, calling this function will cleanup a multipart upload * if one was created. To leave the multipart upload around after aborting * a request, configure `leavePartsOnError` to `true` in the {constructor}. * @note Calling {abort} in the browser environment will not abort any requests * that are already in flight. If a multipart upload was created, any parts * not yet uploaded will not be sent, and the multipart upload will be cleaned up. * @example Aborting an upload * var params = { * Bucket: 'bucket', Key: 'key', * Body: Buffer.alloc(1024 * 1024 * 25) // 25MB payload * }; * var upload = s3.upload(params); * upload.send(function (err, data) { * if (err) console.log("Error:", err.code, err.message); * else console.log(data); * }); * * // abort request in 1 second * setTimeout(upload.abort.bind(upload), 1000); */ abort: function() { var self = this; //abort putObject request if (self.isDoneChunking === true && self.totalPartNumbers === 1 && self.singlePart) { self.singlePart.abort(); } else { self.cleanup(AWS.util.error(new Error('Request aborted by user'), { code: 'RequestAbortedError', retryable: false })); } }, /** * @api private */ validateBody: function validateBody() { var self = this; self.body = self.service.config.params.Body; if (typeof self.body === 'string') { self.body = AWS.util.buffer.toBuffer(self.body); } else if (!self.body) { throw new Error('params.Body is required'); } self.sliceFn = AWS.util.arraySliceFn(self.body); }, /** * @api private */ bindServiceObject: function bindServiceObject(params) { params = params || {}; var self = this; // bind parameters to new service object if (!self.service) { self.service = new AWS.S3({params: params}); } else { // Create a new S3 client from the supplied client's constructor. var service = self.service; var config = AWS.util.copy(service.config); config.signatureVersion = service.getSignatureVersion(); self.service = new service.constructor.__super__(config); self.service.config.params = AWS.util.merge(self.service.config.params || {}, params); Object.defineProperty(self.service, '_originalConfig', { get: function() { return service._originalConfig; }, enumerable: false, configurable: true }); } }, /** * @api private */ adjustTotalBytes: function adjustTotalBytes() { var self = this; try { // try to get totalBytes self.totalBytes = byteLength(self.body); } catch (e) { } // try to adjust partSize if we know payload length if (self.totalBytes) { var newPartSize = Math.ceil(self.totalBytes / self.maxTotalParts); if (newPartSize > self.partSize) self.partSize = newPartSize; } else { self.totalBytes = undefined; } }, /** * @api private */ isDoneChunking: false, /** * @api private */ partPos: 0, /** * @api private */ totalChunkedBytes: 0, /** * @api private */ totalUploadedBytes: 0, /** * @api private */ totalBytes: undefined, /** * @api private */ numParts: 0, /** * @api private */ totalPartNumbers: 0, /** * @api private */ activeParts: 0, /** * @api private */ doneParts: 0, /** * @api private */ parts: null, /** * @api private */ completeInfo: null, /** * @api private */ failed: false, /** * @api private */ multipartReq: null, /** * @api private */ partBuffers: null, /** * @api private */ partBufferLength: 0, /** * @api private */ fillBuffer: function fillBuffer() { var self = this; var bodyLen = byteLength(self.body); if (bodyLen === 0) { self.isDoneChunking = true; self.numParts = 1; self.nextChunk(self.body); return; } while (self.activeParts < self.queueSize && self.partPos < bodyLen) { var endPos = Math.min(self.partPos + self.partSize, bodyLen); var buf = self.sliceFn.call(self.body, self.partPos, endPos); self.partPos += self.partSize; if (byteLength(buf) < self.partSize || self.partPos === bodyLen) { self.isDoneChunking = true; self.numParts = self.totalPartNumbers + 1; } self.nextChunk(buf); } }, /** * @api private */ fillStream: function fillStream() { var self = this; if (self.activeParts >= self.queueSize) return; var buf = self.body.read(self.partSize - self.partBufferLength) || self.body.read(); if (buf) { self.partBuffers.push(buf); self.partBufferLength += buf.length; self.totalChunkedBytes += buf.length; } if (self.partBufferLength >= self.partSize) { // if we have single buffer we avoid copyfull concat var pbuf = self.partBuffers.length === 1 ? self.partBuffers[0] : Buffer.concat(self.partBuffers); self.partBuffers = []; self.partBufferLength = 0; // if we have more than partSize, push the rest back on the queue if (pbuf.length > self.partSize) { var rest = pbuf.slice(self.partSize); self.partBuffers.push(rest); self.partBufferLength += rest.length; pbuf = pbuf.slice(0, self.partSize); } self.nextChunk(pbuf); } if (self.isDoneChunking && !self.isDoneSending) { // if we have single buffer we avoid copyfull concat pbuf = self.partBuffers.length === 1 ? self.partBuffers[0] : Buffer.concat(self.partBuffers); self.partBuffers = []; self.partBufferLength = 0; self.totalBytes = self.totalChunkedBytes; self.isDoneSending = true; if (self.numParts === 0 || pbuf.length > 0) { self.numParts++; self.nextChunk(pbuf); } } self.body.read(0); }, /** * @api private */ nextChunk: function nextChunk(chunk) { var self = this; if (self.failed) return null; var partNumber = ++self.totalPartNumbers; if (self.isDoneChunking && partNumber === 1) { var params = {Body: chunk}; if (this.tags) { params.Tagging = this.getTaggingHeader(); } var req = self.service.putObject(params); req._managedUpload = self; req.on('httpUploadProgress', self.progress).send(self.finishSinglePart); self.singlePart = req; //save the single part request return null; } else if (self.service.config.params.ContentMD5) { var err = AWS.util.error(new Error('The Content-MD5 you specified is invalid for multi-part uploads.'), { code: 'InvalidDigest', retryable: false }); self.cleanup(err); return null; } if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) { return null; // Already uploaded this part. } self.activeParts++; if (!self.service.config.params.UploadId) { if (!self.multipartReq) { // create multipart self.multipartReq = self.service.createMultipartUpload(); self.multipartReq.on('success', function(resp) { self.service.config.params.UploadId = resp.data.UploadId; self.multipartReq = null; }); self.queueChunks(chunk, partNumber); self.multipartReq.on('error', function(err) { self.cleanup(err); }); self.multipartReq.send(); } else { self.queueChunks(chunk, partNumber); } } else { // multipart is created, just send self.uploadPart(chunk, partNumber); } }, /** * @api private */ getTaggingHeader: function getTaggingHeader() { var kvPairStrings = []; for (var i = 0; i < this.tags.length; i++) { kvPairStrings.push(AWS.util.uriEscape(this.tags[i].Key) + '=' + AWS.util.uriEscape(this.tags[i].Value)); } return kvPairStrings.join('&'); }, /** * @api private */ uploadPart: function uploadPart(chunk, partNumber) { var self = this; var partParams = { Body: chunk, ContentLength: AWS.util.string.byteLength(chunk), PartNumber: partNumber }; var partInfo = {ETag: null, PartNumber: partNumber}; self.completeInfo[partNumber] = partInfo; var req = self.service.uploadPart(partParams); self.parts[partNumber] = req; req._lastUploadedBytes = 0; req._managedUpload = self; req.on('httpUploadProgress', self.progress); req.send(function(err, data) { delete self.parts[partParams.PartNumber]; self.activeParts--; if (!err && (!data || !data.ETag)) { var message = 'No access to ETag property on response.'; if (AWS.util.isBrowser()) { message += ' Check CORS configuration to expose ETag header.'; } err = AWS.util.error(new Error(message), { code: 'ETagMissing', retryable: false }); } if (err) return self.cleanup(err); //prevent sending part being returned twice (https://github.com/aws/aws-sdk-js/issues/2304) if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null; partInfo.ETag = data.ETag; self.doneParts++; if (self.isDoneChunking && self.doneParts === self.numParts) { self.finishMultiPart(); } else { self.fillQueue.call(self); } }); }, /** * @api private */ queueChunks: function queueChunks(chunk, partNumber) { var self = this; self.multipartReq.on('success', function() { self.uploadPart(chunk, partNumber); }); }, /** * @api private */ cleanup: function cleanup(err) { var self = this; if (self.failed) return; // clean up stream if (typeof self.body.removeAllListeners === 'function' && typeof self.body.resume === 'function') { self.body.removeAllListeners('readable'); self.body.removeAllListeners('end'); self.body.resume(); } // cleanup multipartReq listeners if (self.multipartReq) { self.multipartReq.removeAllListeners('success'); self.multipartReq.removeAllListeners('error'); self.multipartReq.removeAllListeners('complete'); delete self.multipartReq; } if (self.service.config.params.UploadId && !self.leavePartsOnError) { self.service.abortMultipartUpload().send(); } else if (self.leavePartsOnError) { self.isDoneChunking = false; } AWS.util.each(self.parts, function(partNumber, part) { part.removeAllListeners('complete'); part.abort(); }); self.activeParts = 0; self.partPos = 0; self.numParts = 0; self.totalPartNumbers = 0; self.parts = {}; self.failed = true; self.callback(err); }, /** * @api private */ finishMultiPart: function finishMultiPart() { var self = this; var completeParams = { MultipartUpload: { Parts: self.completeInfo.slice(1) } }; self.service.completeMultipartUpload(completeParams, function(err, data) { if (err) { return self.cleanup(err); } if (data && typeof data.Location === 'string') { data.Location = data.Location.replace(/%2F/g, '/'); } if (Array.isArray(self.tags)) { for (var i = 0; i < self.tags.length; i++) { self.tags[i].Value = String(self.tags[i].Value); } self.service.putObjectTagging( {Tagging: {TagSet: self.tags}}, function(e, d) { if (e) { self.callback(e); } else { self.callback(e, data); } } ); } else { self.callback(err, data); } }); }, /** * @api private */ finishSinglePart: function finishSinglePart(err, data) { var upload = this.request._managedUpload; var httpReq = this.request.httpRequest; var endpoint = httpReq.endpoint; if (err) return upload.callback(err); data.Location = [endpoint.protocol, '//', endpoint.host, httpReq.path].join(''); data.key = this.request.params.Key; // will stay undocumented data.Key = this.request.params.Key; data.Bucket = this.request.params.Bucket; upload.callback(err, data); }, /** * @api private */ progress: function progress(info) { var upload = this._managedUpload; if (this.operation === 'putObject') { info.part = 1; info.key = this.params.Key; } else { upload.totalUploadedBytes += info.loaded - this._lastUploadedBytes; this._lastUploadedBytes = info.loaded; info = { loaded: upload.totalUploadedBytes, total: upload.totalBytes, part: this.params.PartNumber, key: this.params.Key }; } upload.emit('httpUploadProgress', [info]); } }); AWS.util.mixin(AWS.S3.ManagedUpload, AWS.SequentialExecutor); /** * @api private */ AWS.S3.ManagedUpload.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.promise = AWS.util.promisifyMethod('send', PromiseDependency); }; /** * @api private */ AWS.S3.ManagedUpload.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.promise; }; AWS.util.addPromises(AWS.S3.ManagedUpload); /** * @api private */ module.exports = AWS.S3.ManagedUpload; /***/ }), /***/ 55948: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private * @!method on(eventName, callback) * Registers an event listener callback for the event given by `eventName`. * Parameters passed to the callback function depend on the individual event * being triggered. See the event documentation for those parameters. * * @param eventName [String] the event name to register the listener for * @param callback [Function] the listener callback function * @param toHead [Boolean] attach the listener callback to the head of callback array if set to true. * Default to be false. * @return [AWS.SequentialExecutor] the same object for chaining */ AWS.SequentialExecutor = AWS.util.inherit({ constructor: function SequentialExecutor() { this._events = {}; }, /** * @api private */ listeners: function listeners(eventName) { return this._events[eventName] ? this._events[eventName].slice(0) : []; }, on: function on(eventName, listener, toHead) { if (this._events[eventName]) { toHead ? this._events[eventName].unshift(listener) : this._events[eventName].push(listener); } else { this._events[eventName] = [listener]; } return this; }, onAsync: function onAsync(eventName, listener, toHead) { listener._isAsync = true; return this.on(eventName, listener, toHead); }, removeListener: function removeListener(eventName, listener) { var listeners = this._events[eventName]; if (listeners) { var length = listeners.length; var position = -1; for (var i = 0; i < length; ++i) { if (listeners[i] === listener) { position = i; } } if (position > -1) { listeners.splice(position, 1); } } return this; }, removeAllListeners: function removeAllListeners(eventName) { if (eventName) { delete this._events[eventName]; } else { this._events = {}; } return this; }, /** * @api private */ emit: function emit(eventName, eventArgs, doneCallback) { if (!doneCallback) doneCallback = function() { }; var listeners = this.listeners(eventName); var count = listeners.length; this.callListeners(listeners, eventArgs, doneCallback); return count > 0; }, /** * @api private */ callListeners: function callListeners(listeners, args, doneCallback, prevError) { var self = this; var error = prevError || null; function callNextListener(err) { if (err) { error = AWS.util.error(error || new Error(), err); if (self._haltHandlersOnError) { return doneCallback.call(self, error); } } self.callListeners(listeners, args, doneCallback, error); } while (listeners.length > 0) { var listener = listeners.shift(); if (listener._isAsync) { // asynchronous listener listener.apply(self, args.concat([callNextListener])); return; // stop here, callNextListener will continue } else { // synchronous listener try { listener.apply(self, args); } catch (err) { error = AWS.util.error(error || new Error(), err); } if (error && self._haltHandlersOnError) { doneCallback.call(self, error); return; } } } doneCallback.call(self, error); }, /** * Adds or copies a set of listeners from another list of * listeners or SequentialExecutor object. * * @param listeners [map>, AWS.SequentialExecutor] * a list of events and callbacks, or an event emitter object * containing listeners to add to this emitter object. * @return [AWS.SequentialExecutor] the emitter object, for chaining. * @example Adding listeners from a map of listeners * emitter.addListeners({ * event1: [function() { ... }, function() { ... }], * event2: [function() { ... }] * }); * emitter.emit('event1'); // emitter has event1 * emitter.emit('event2'); // emitter has event2 * @example Adding listeners from another emitter object * var emitter1 = new AWS.SequentialExecutor(); * emitter1.on('event1', function() { ... }); * emitter1.on('event2', function() { ... }); * var emitter2 = new AWS.SequentialExecutor(); * emitter2.addListeners(emitter1); * emitter2.emit('event1'); // emitter2 has event1 * emitter2.emit('event2'); // emitter2 has event2 */ addListeners: function addListeners(listeners) { var self = this; // extract listeners if parameter is an SequentialExecutor object if (listeners._events) listeners = listeners._events; AWS.util.each(listeners, function(event, callbacks) { if (typeof callbacks === 'function') callbacks = [callbacks]; AWS.util.arrayEach(callbacks, function(callback) { self.on(event, callback); }); }); return self; }, /** * Registers an event with {on} and saves the callback handle function * as a property on the emitter object using a given `name`. * * @param name [String] the property name to set on this object containing * the callback function handle so that the listener can be removed in * the future. * @param (see on) * @return (see on) * @example Adding a named listener DATA_CALLBACK * var listener = function() { doSomething(); }; * emitter.addNamedListener('DATA_CALLBACK', 'data', listener); * * // the following prints: true * console.log(emitter.DATA_CALLBACK == listener); */ addNamedListener: function addNamedListener(name, eventName, callback, toHead) { this[name] = callback; this.addListener(eventName, callback, toHead); return this; }, /** * @api private */ addNamedAsyncListener: function addNamedAsyncListener(name, eventName, callback, toHead) { callback._isAsync = true; return this.addNamedListener(name, eventName, callback, toHead); }, /** * Helper method to add a set of named listeners using * {addNamedListener}. The callback contains a parameter * with a handle to the `addNamedListener` method. * * @callback callback function(add) * The callback function is called immediately in order to provide * the `add` function to the block. This simplifies the addition of * a large group of named listeners. * @param add [Function] the {addNamedListener} function to call * when registering listeners. * @example Adding a set of named listeners * emitter.addNamedListeners(function(add) { * add('DATA_CALLBACK', 'data', function() { ... }); * add('OTHER', 'otherEvent', function() { ... }); * add('LAST', 'lastEvent', function() { ... }); * }); * * // these properties are now set: * emitter.DATA_CALLBACK; * emitter.OTHER; * emitter.LAST; */ addNamedListeners: function addNamedListeners(callback) { var self = this; callback( function() { self.addNamedListener.apply(self, arguments); }, function() { self.addNamedAsyncListener.apply(self, arguments); } ); return this; } }); /** * {on} is the prefered method. * @api private */ AWS.SequentialExecutor.prototype.addListener = AWS.SequentialExecutor.prototype.on; /** * @api private */ module.exports = AWS.SequentialExecutor; /***/ }), /***/ 68903: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var Api = __webpack_require__(17657); var regionConfig = __webpack_require__(18262); var inherit = AWS.util.inherit; var clientCount = 0; /** * The service class representing an AWS service. * * @class_abstract This class is an abstract class. * * @!attribute apiVersions * @return [Array] the list of API versions supported by this service. * @readonly */ AWS.Service = inherit({ /** * Create a new service object with a configuration object * * @param config [map] a map of configuration options */ constructor: function Service(config) { if (!this.loadServiceClass) { throw AWS.util.error(new Error(), 'Service must be constructed with `new\' operator'); } var ServiceClass = this.loadServiceClass(config || {}); if (ServiceClass) { var originalConfig = AWS.util.copy(config); var svc = new ServiceClass(config); Object.defineProperty(svc, '_originalConfig', { get: function() { return originalConfig; }, enumerable: false, configurable: true }); svc._clientId = ++clientCount; return svc; } this.initialize(config); }, /** * @api private */ initialize: function initialize(config) { var svcConfig = AWS.config[this.serviceIdentifier]; this.config = new AWS.Config(AWS.config); if (svcConfig) this.config.update(svcConfig, true); if (config) this.config.update(config, true); this.validateService(); if (!this.config.endpoint) regionConfig.configureEndpoint(this); this.config.endpoint = this.endpointFromTemplate(this.config.endpoint); this.setEndpoint(this.config.endpoint); //enable attaching listeners to service client AWS.SequentialExecutor.call(this); AWS.Service.addDefaultMonitoringListeners(this); if ((this.config.clientSideMonitoring || AWS.Service._clientSideMonitoring) && this.publisher) { var publisher = this.publisher; this.addNamedListener('PUBLISH_API_CALL', 'apiCall', function PUBLISH_API_CALL(event) { process.nextTick(function() {publisher.eventHandler(event);}); }); this.addNamedListener('PUBLISH_API_ATTEMPT', 'apiCallAttempt', function PUBLISH_API_ATTEMPT(event) { process.nextTick(function() {publisher.eventHandler(event);}); }); } }, /** * @api private */ validateService: function validateService() { }, /** * @api private */ loadServiceClass: function loadServiceClass(serviceConfig) { var config = serviceConfig; if (!AWS.util.isEmpty(this.api)) { return null; } else if (config.apiConfig) { return AWS.Service.defineServiceApi(this.constructor, config.apiConfig); } else if (!this.constructor.services) { return null; } else { config = new AWS.Config(AWS.config); config.update(serviceConfig, true); var version = config.apiVersions[this.constructor.serviceIdentifier]; version = version || config.apiVersion; return this.getLatestServiceClass(version); } }, /** * @api private */ getLatestServiceClass: function getLatestServiceClass(version) { version = this.getLatestServiceVersion(version); if (this.constructor.services[version] === null) { AWS.Service.defineServiceApi(this.constructor, version); } return this.constructor.services[version]; }, /** * @api private */ getLatestServiceVersion: function getLatestServiceVersion(version) { if (!this.constructor.services || this.constructor.services.length === 0) { throw new Error('No services defined on ' + this.constructor.serviceIdentifier); } if (!version) { version = 'latest'; } else if (AWS.util.isType(version, Date)) { version = AWS.util.date.iso8601(version).split('T')[0]; } if (Object.hasOwnProperty(this.constructor.services, version)) { return version; } var keys = Object.keys(this.constructor.services).sort(); var selectedVersion = null; for (var i = keys.length - 1; i >= 0; i--) { // versions that end in "*" are not available on disk and can be // skipped, so do not choose these as selectedVersions if (keys[i][keys[i].length - 1] !== '*') { selectedVersion = keys[i]; } if (keys[i].substr(0, 10) <= version) { return selectedVersion; } } throw new Error('Could not find ' + this.constructor.serviceIdentifier + ' API to satisfy version constraint `' + version + '\''); }, /** * @api private */ api: {}, /** * @api private */ defaultRetryCount: 3, /** * @api private */ customizeRequests: function customizeRequests(callback) { if (!callback) { this.customRequestHandler = null; } else if (typeof callback === 'function') { this.customRequestHandler = callback; } else { throw new Error('Invalid callback type \'' + typeof callback + '\' provided in customizeRequests'); } }, /** * Calls an operation on a service with the given input parameters. * * @param operation [String] the name of the operation to call on the service. * @param params [map] a map of input options for the operation * @callback callback function(err, data) * If a callback is supplied, it is called when a response is returned * from the service. * @param err [Error] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. */ makeRequest: function makeRequest(operation, params, callback) { if (typeof params === 'function') { callback = params; params = null; } params = params || {}; if (this.config.params) { // copy only toplevel bound params var rules = this.api.operations[operation]; if (rules) { params = AWS.util.copy(params); AWS.util.each(this.config.params, function(key, value) { if (rules.input.members[key]) { if (params[key] === undefined || params[key] === null) { params[key] = value; } } }); } } var request = new AWS.Request(this, operation, params); this.addAllRequestListeners(request); this.attachMonitoringEmitter(request); if (callback) request.send(callback); return request; }, /** * Calls an operation on a service with the given input parameters, without * any authentication data. This method is useful for "public" API operations. * * @param operation [String] the name of the operation to call on the service. * @param params [map] a map of input options for the operation * @callback callback function(err, data) * If a callback is supplied, it is called when a response is returned * from the service. * @param err [Error] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. */ makeUnauthenticatedRequest: function makeUnauthenticatedRequest(operation, params, callback) { if (typeof params === 'function') { callback = params; params = {}; } var request = this.makeRequest(operation, params).toUnauthenticated(); return callback ? request.send(callback) : request; }, /** * Waits for a given state * * @param state [String] the state on the service to wait for * @param params [map] a map of parameters to pass with each request * @option params $waiter [map] a map of configuration options for the waiter * @option params $waiter.delay [Number] The number of seconds to wait between * requests * @option params $waiter.maxAttempts [Number] The maximum number of requests * to send while waiting * @callback callback function(err, data) * If a callback is supplied, it is called when a response is returned * from the service. * @param err [Error] the error object returned from the request. * Set to `null` if the request is successful. * @param data [Object] the de-serialized data returned from * the request. Set to `null` if a request error occurs. */ waitFor: function waitFor(state, params, callback) { var waiter = new AWS.ResourceWaiter(this, state); return waiter.wait(params, callback); }, /** * @api private */ addAllRequestListeners: function addAllRequestListeners(request) { var list = [AWS.events, AWS.EventListeners.Core, this.serviceInterface(), AWS.EventListeners.CorePost]; for (var i = 0; i < list.length; i++) { if (list[i]) request.addListeners(list[i]); } // disable parameter validation if (!this.config.paramValidation) { request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); } if (this.config.logger) { // add logging events request.addListeners(AWS.EventListeners.Logger); } this.setupRequestListeners(request); // call prototype's customRequestHandler if (typeof this.constructor.prototype.customRequestHandler === 'function') { this.constructor.prototype.customRequestHandler(request); } // call instance's customRequestHandler if (Object.prototype.hasOwnProperty.call(this, 'customRequestHandler') && typeof this.customRequestHandler === 'function') { this.customRequestHandler(request); } }, /** * Event recording metrics for a whole API call. * @returns {object} a subset of api call metrics * @api private */ apiCallEvent: function apiCallEvent(request) { var api = request.service.api.operations[request.operation]; var monitoringEvent = { Type: 'ApiCall', Api: api ? api.name : request.operation, Version: 1, Service: request.service.api.serviceId || request.service.api.endpointPrefix, Region: request.httpRequest.region, MaxRetriesExceeded: 0, UserAgent: request.httpRequest.getUserAgent(), }; var response = request.response; if (response.httpResponse.statusCode) { monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode; } if (response.error) { var error = response.error; var statusCode = response.httpResponse.statusCode; if (statusCode > 299) { if (error.code) monitoringEvent.FinalAwsException = error.code; if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message; } else { if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name; if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message; } } return monitoringEvent; }, /** * Event recording metrics for an API call attempt. * @returns {object} a subset of api call attempt metrics * @api private */ apiAttemptEvent: function apiAttemptEvent(request) { var api = request.service.api.operations[request.operation]; var monitoringEvent = { Type: 'ApiCallAttempt', Api: api ? api.name : request.operation, Version: 1, Service: request.service.api.serviceId || request.service.api.endpointPrefix, Fqdn: request.httpRequest.endpoint.hostname, UserAgent: request.httpRequest.getUserAgent(), }; var response = request.response; if (response.httpResponse.statusCode) { monitoringEvent.HttpStatusCode = response.httpResponse.statusCode; } if ( !request._unAuthenticated && request.service.config.credentials && request.service.config.credentials.accessKeyId ) { monitoringEvent.AccessKey = request.service.config.credentials.accessKeyId; } if (!response.httpResponse.headers) return monitoringEvent; if (request.httpRequest.headers['x-amz-security-token']) { monitoringEvent.SessionToken = request.httpRequest.headers['x-amz-security-token']; } if (response.httpResponse.headers['x-amzn-requestid']) { monitoringEvent.XAmznRequestId = response.httpResponse.headers['x-amzn-requestid']; } if (response.httpResponse.headers['x-amz-request-id']) { monitoringEvent.XAmzRequestId = response.httpResponse.headers['x-amz-request-id']; } if (response.httpResponse.headers['x-amz-id-2']) { monitoringEvent.XAmzId2 = response.httpResponse.headers['x-amz-id-2']; } return monitoringEvent; }, /** * Add metrics of failed request. * @api private */ attemptFailEvent: function attemptFailEvent(request) { var monitoringEvent = this.apiAttemptEvent(request); var response = request.response; var error = response.error; if (response.httpResponse.statusCode > 299 ) { if (error.code) monitoringEvent.AwsException = error.code; if (error.message) monitoringEvent.AwsExceptionMessage = error.message; } else { if (error.code || error.name) monitoringEvent.SdkException = error.code || error.name; if (error.message) monitoringEvent.SdkExceptionMessage = error.message; } return monitoringEvent; }, /** * Attach listeners to request object to fetch metrics of each request * and emit data object through \'ApiCall\' and \'ApiCallAttempt\' events. * @api private */ attachMonitoringEmitter: function attachMonitoringEmitter(request) { var attemptTimestamp; //timestamp marking the beginning of a request attempt var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency var attemptLatency; //latency from request sent out to http response reaching SDK var callStartRealTime; //Start time of API call. Used to calculating API call latency var attemptCount = 0; //request.retryCount is not reliable here var region; //region cache region for each attempt since it can be updated in plase (e.g. s3) var callTimestamp; //timestamp when the request is created var self = this; var addToHead = true; request.on('validate', function () { callStartRealTime = AWS.util.realClock.now(); callTimestamp = Date.now(); }, addToHead); request.on('sign', function () { attemptStartRealTime = AWS.util.realClock.now(); attemptTimestamp = Date.now(); region = request.httpRequest.region; attemptCount++; }, addToHead); request.on('validateResponse', function() { attemptLatency = Math.round(AWS.util.realClock.now() - attemptStartRealTime); }); request.addNamedListener('API_CALL_ATTEMPT', 'success', function API_CALL_ATTEMPT() { var apiAttemptEvent = self.apiAttemptEvent(request); apiAttemptEvent.Timestamp = attemptTimestamp; apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0; apiAttemptEvent.Region = region; self.emit('apiCallAttempt', [apiAttemptEvent]); }); request.addNamedListener('API_CALL_ATTEMPT_RETRY', 'retry', function API_CALL_ATTEMPT_RETRY() { var apiAttemptEvent = self.attemptFailEvent(request); apiAttemptEvent.Timestamp = attemptTimestamp; //attemptLatency may not be available if fail before response attemptLatency = attemptLatency || Math.round(AWS.util.realClock.now() - attemptStartRealTime); apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0; apiAttemptEvent.Region = region; self.emit('apiCallAttempt', [apiAttemptEvent]); }); request.addNamedListener('API_CALL', 'complete', function API_CALL() { var apiCallEvent = self.apiCallEvent(request); apiCallEvent.AttemptCount = attemptCount; if (apiCallEvent.AttemptCount <= 0) return; apiCallEvent.Timestamp = callTimestamp; var latency = Math.round(AWS.util.realClock.now() - callStartRealTime); apiCallEvent.Latency = latency >= 0 ? latency : 0; var response = request.response; if ( response.error && response.error.retryable && typeof response.retryCount === 'number' && typeof response.maxRetries === 'number' && (response.retryCount >= response.maxRetries) ) { apiCallEvent.MaxRetriesExceeded = 1; } self.emit('apiCall', [apiCallEvent]); }); }, /** * Override this method to setup any custom request listeners for each * new request to the service. * * @method_abstract This is an abstract method. */ setupRequestListeners: function setupRequestListeners(request) { }, /** * Gets the signing name for a given request * @api private */ getSigningName: function getSigningName() { return this.api.signingName || this.api.endpointPrefix; }, /** * Gets the signer class for a given request * @api private */ getSignerClass: function getSignerClass(request) { var version; // get operation authtype if present var operation = null; var authtype = ''; if (request) { var operations = request.service.api.operations || {}; operation = operations[request.operation] || null; authtype = operation ? operation.authtype : ''; } if (this.config.signatureVersion) { version = this.config.signatureVersion; } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') { version = 'v4'; } else { version = this.api.signatureVersion; } return AWS.Signers.RequestSigner.getVersion(version); }, /** * @api private */ serviceInterface: function serviceInterface() { switch (this.api.protocol) { case 'ec2': return AWS.EventListeners.Query; case 'query': return AWS.EventListeners.Query; case 'json': return AWS.EventListeners.Json; case 'rest-json': return AWS.EventListeners.RestJson; case 'rest-xml': return AWS.EventListeners.RestXml; } if (this.api.protocol) { throw new Error('Invalid service `protocol\' ' + this.api.protocol + ' in API config'); } }, /** * @api private */ successfulResponse: function successfulResponse(resp) { return resp.httpResponse.statusCode < 300; }, /** * How many times a failed request should be retried before giving up. * the defaultRetryCount can be overriden by service classes. * * @api private */ numRetries: function numRetries() { if (this.config.maxRetries !== undefined) { return this.config.maxRetries; } else { return this.defaultRetryCount; } }, /** * @api private */ retryDelays: function retryDelays(retryCount, err) { return AWS.util.calculateRetryDelay(retryCount, this.config.retryDelayOptions, err); }, /** * @api private */ retryableError: function retryableError(error) { if (this.timeoutError(error)) return true; if (this.networkingError(error)) return true; if (this.expiredCredentialsError(error)) return true; if (this.throttledError(error)) return true; if (error.statusCode >= 500) return true; return false; }, /** * @api private */ networkingError: function networkingError(error) { return error.code === 'NetworkingError'; }, /** * @api private */ timeoutError: function timeoutError(error) { return error.code === 'TimeoutError'; }, /** * @api private */ expiredCredentialsError: function expiredCredentialsError(error) { // TODO : this only handles *one* of the expired credential codes return (error.code === 'ExpiredTokenException'); }, /** * @api private */ clockSkewError: function clockSkewError(error) { switch (error.code) { case 'RequestTimeTooSkewed': case 'RequestExpired': case 'InvalidSignatureException': case 'SignatureDoesNotMatch': case 'AuthFailure': case 'RequestInTheFuture': return true; default: return false; } }, /** * @api private */ getSkewCorrectedDate: function getSkewCorrectedDate() { return new Date(Date.now() + this.config.systemClockOffset); }, /** * @api private */ applyClockOffset: function applyClockOffset(newServerTime) { if (newServerTime) { this.config.systemClockOffset = newServerTime - Date.now(); } }, /** * @api private */ isClockSkewed: function isClockSkewed(newServerTime) { if (newServerTime) { return Math.abs(this.getSkewCorrectedDate().getTime() - newServerTime) >= 300000; } }, /** * @api private */ throttledError: function throttledError(error) { // this logic varies between services if (error.statusCode === 429) return true; switch (error.code) { case 'ProvisionedThroughputExceededException': case 'Throttling': case 'ThrottlingException': case 'RequestLimitExceeded': case 'RequestThrottled': case 'RequestThrottledException': case 'TooManyRequestsException': case 'TransactionInProgressException': //dynamodb case 'EC2ThrottledException': return true; default: return false; } }, /** * @api private */ endpointFromTemplate: function endpointFromTemplate(endpoint) { if (typeof endpoint !== 'string') return endpoint; var e = endpoint; e = e.replace(/\{service\}/g, this.api.endpointPrefix); e = e.replace(/\{region\}/g, this.config.region); e = e.replace(/\{scheme\}/g, this.config.sslEnabled ? 'https' : 'http'); return e; }, /** * @api private */ setEndpoint: function setEndpoint(endpoint) { this.endpoint = new AWS.Endpoint(endpoint, this.config); }, /** * @api private */ paginationConfig: function paginationConfig(operation, throwException) { var paginator = this.api.operations[operation].paginator; if (!paginator) { if (throwException) { var e = new Error(); throw AWS.util.error(e, 'No pagination configuration for ' + operation); } return null; } return paginator; } }); AWS.util.update(AWS.Service, { /** * Adds one method for each operation described in the api configuration * * @api private */ defineMethods: function defineMethods(svc) { AWS.util.each(svc.prototype.api.operations, function iterator(method) { if (svc.prototype[method]) return; var operation = svc.prototype.api.operations[method]; if (operation.authtype === 'none') { svc.prototype[method] = function (params, callback) { return this.makeUnauthenticatedRequest(method, params, callback); }; } else { svc.prototype[method] = function (params, callback) { return this.makeRequest(method, params, callback); }; } }); }, /** * Defines a new Service class using a service identifier and list of versions * including an optional set of features (functions) to apply to the class * prototype. * * @param serviceIdentifier [String] the identifier for the service * @param versions [Array] a list of versions that work with this * service * @param features [Object] an object to attach to the prototype * @return [Class] the service class defined by this function. */ defineService: function defineService(serviceIdentifier, versions, features) { AWS.Service._serviceMap[serviceIdentifier] = true; if (!Array.isArray(versions)) { features = versions; versions = []; } var svc = inherit(AWS.Service, features || {}); if (typeof serviceIdentifier === 'string') { AWS.Service.addVersions(svc, versions); var identifier = svc.serviceIdentifier || serviceIdentifier; svc.serviceIdentifier = identifier; } else { // defineService called with an API svc.prototype.api = serviceIdentifier; AWS.Service.defineMethods(svc); } AWS.SequentialExecutor.call(this.prototype); //util.clientSideMonitoring is only available in node if (!this.prototype.publisher && AWS.util.clientSideMonitoring) { var Publisher = AWS.util.clientSideMonitoring.Publisher; var configProvider = AWS.util.clientSideMonitoring.configProvider; var publisherConfig = configProvider(); this.prototype.publisher = new Publisher(publisherConfig); if (publisherConfig.enabled) { //if csm is enabled in environment, SDK should send all metrics AWS.Service._clientSideMonitoring = true; } } AWS.SequentialExecutor.call(svc.prototype); AWS.Service.addDefaultMonitoringListeners(svc.prototype); return svc; }, /** * @api private */ addVersions: function addVersions(svc, versions) { if (!Array.isArray(versions)) versions = [versions]; svc.services = svc.services || {}; for (var i = 0; i < versions.length; i++) { if (svc.services[versions[i]] === undefined) { svc.services[versions[i]] = null; } } svc.apiVersions = Object.keys(svc.services).sort(); }, /** * @api private */ defineServiceApi: function defineServiceApi(superclass, version, apiConfig) { var svc = inherit(superclass, { serviceIdentifier: superclass.serviceIdentifier }); function setApi(api) { if (api.isApi) { svc.prototype.api = api; } else { svc.prototype.api = new Api(api, { serviceIdentifier: superclass.serviceIdentifier }); } } if (typeof version === 'string') { if (apiConfig) { setApi(apiConfig); } else { try { setApi(AWS.apiLoader(superclass.serviceIdentifier, version)); } catch (err) { throw AWS.util.error(err, { message: 'Could not find API configuration ' + superclass.serviceIdentifier + '-' + version }); } } if (!Object.prototype.hasOwnProperty.call(superclass.services, version)) { superclass.apiVersions = superclass.apiVersions.concat(version).sort(); } superclass.services[version] = svc; } else { setApi(version); } AWS.Service.defineMethods(svc); return svc; }, /** * @api private */ hasService: function(identifier) { return Object.prototype.hasOwnProperty.call(AWS.Service._serviceMap, identifier); }, /** * @param attachOn attach default monitoring listeners to object * * Each monitoring event should be emitted from service client to service constructor prototype and then * to global service prototype like bubbling up. These default monitoring events listener will transfer * the monitoring events to the upper layer. * @api private */ addDefaultMonitoringListeners: function addDefaultMonitoringListeners(attachOn) { attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) { var baseClass = Object.getPrototypeOf(attachOn); if (baseClass._events) baseClass.emit('apiCallAttempt', [event]); }); attachOn.addNamedListener('CALL_EVENTS_BUBBLE', 'apiCall', function CALL_EVENTS_BUBBLE(event) { var baseClass = Object.getPrototypeOf(attachOn); if (baseClass._events) baseClass.emit('apiCall', [event]); }); }, /** * @api private */ _serviceMap: {} }); AWS.util.mixin(AWS.Service, AWS.SequentialExecutor); /** * @api private */ module.exports = AWS.Service; /***/ }), /***/ 4338: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.APIGateway.prototype, { /** * Sets the Accept header to application/json. * * @api private */ setAcceptHeader: function setAcceptHeader(req) { var httpRequest = req.httpRequest; if (!httpRequest.headers.Accept) { httpRequest.headers['Accept'] = 'application/json'; } }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('build', this.setAcceptHeader); if (request.operation === 'getExport') { var params = request.params || {}; if (params.exportType === 'swagger') { request.addListener('extractData', AWS.util.convertPayloadToString); } } } }); /***/ }), /***/ 95483: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); // pull in CloudFront signer __webpack_require__(93260); AWS.util.update(AWS.CloudFront.prototype, { setupRequestListeners: function setupRequestListeners(request) { request.addListener('extractData', AWS.util.hoistPayloadMember); } }); /***/ }), /***/ 48571: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * Constructs a service interface object. Each API operation is exposed as a * function on service. * * ### Sending a Request Using CloudSearchDomain * * ```javascript * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); * csd.search(params, function (err, data) { * if (err) console.log(err, err.stack); // an error occurred * else console.log(data); // successful response * }); * ``` * * ### Locking the API Version * * In order to ensure that the CloudSearchDomain object uses this specific API, * you can construct the object by passing the `apiVersion` option to the * constructor: * * ```javascript * var csd = new AWS.CloudSearchDomain({ * endpoint: 'my.host.tld', * apiVersion: '2013-01-01' * }); * ``` * * You can also set the API version globally in `AWS.config.apiVersions` using * the **cloudsearchdomain** service identifier: * * ```javascript * AWS.config.apiVersions = { * cloudsearchdomain: '2013-01-01', * // other service API versions * }; * * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); * ``` * * @note You *must* provide an `endpoint` configuration parameter when * constructing this service. See {constructor} for more information. * * @!method constructor(options = {}) * Constructs a service object. This object has one method for each * API operation. * * @example Constructing a CloudSearchDomain object * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'}); * @note You *must* provide an `endpoint` when constructing this service. * @option (see AWS.Config.constructor) * * @service cloudsearchdomain * @version 2013-01-01 */ AWS.util.update(AWS.CloudSearchDomain.prototype, { /** * @api private */ validateService: function validateService() { if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { var msg = 'AWS.CloudSearchDomain requires an explicit ' + '`endpoint\' configuration option.'; throw AWS.util.error(new Error(), {name: 'InvalidEndpoint', message: msg}); } }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS ); request.onAsync('validate', this.validateCredentials); request.addListener('validate', this.updateRegion); if (request.operation === 'search') { request.addListener('build', this.convertGetToPost); } }, /** * @api private */ validateCredentials: function(req, done) { if (!req.service.api.signatureVersion) return done(); // none req.service.config.getCredentials(function(err) { if (err) { req.removeListener('sign', AWS.EventListeners.Core.SIGN); } done(); }); }, /** * @api private */ convertGetToPost: function(request) { var httpRequest = request.httpRequest; // convert queries to POST to avoid length restrictions var path = httpRequest.path.split('?'); httpRequest.method = 'POST'; httpRequest.path = path[0]; httpRequest.body = path[1]; httpRequest.headers['Content-Length'] = httpRequest.body.length; httpRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded'; }, /** * @api private */ updateRegion: function updateRegion(request) { var endpoint = request.httpRequest.endpoint.hostname; var zones = endpoint.split('.'); request.httpRequest.region = zones[1] || request.httpRequest.region; } }); /***/ }), /***/ 59050: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rdsutil = __webpack_require__(30650); /** * @api private */ var crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot']; AWS.util.update(AWS.DocDB.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if ( crossRegionOperations.indexOf(request.operation) !== -1 && this.config.params && this.config.params.SourceRegion && request.params && !request.params.SourceRegion ) { request.params.SourceRegion = this.config.params.SourceRegion; } rdsutil.setupRequestListeners(this, request, crossRegionOperations); }, }); /***/ }), /***/ 17101: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); __webpack_require__(90030); AWS.util.update(AWS.DynamoDB.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if (request.service.config.dynamoDbCrc32) { request.removeListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA); request.addListener('extractData', this.checkCrc32); request.addListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA); } }, /** * @api private */ checkCrc32: function checkCrc32(resp) { if (!resp.httpResponse.streaming && !resp.request.service.crc32IsValid(resp)) { resp.data = null; resp.error = AWS.util.error(new Error(), { code: 'CRC32CheckFailed', message: 'CRC32 integrity check failed', retryable: true }); resp.request.haltHandlersOnError(); throw (resp.error); } }, /** * @api private */ crc32IsValid: function crc32IsValid(resp) { var crc = resp.httpResponse.headers['x-amz-crc32']; if (!crc) return true; // no (valid) CRC32 header return parseInt(crc, 10) === AWS.util.crypto.crc32(resp.httpResponse.body); }, /** * @api private */ defaultRetryCount: 10, /** * @api private */ retryDelays: function retryDelays(retryCount, err) { var retryDelayOptions = AWS.util.copy(this.config.retryDelayOptions); if (typeof retryDelayOptions.base !== 'number') { retryDelayOptions.base = 50; // default for dynamodb } var delay = AWS.util.calculateRetryDelay(retryCount, retryDelayOptions, err); return delay; } }); /***/ }), /***/ 92501: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.EC2.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.removeListener('extractError', AWS.EventListeners.Query.EXTRACT_ERROR); request.addListener('extractError', this.extractError); if (request.operation === 'copySnapshot') { request.onAsync('validate', this.buildCopySnapshotPresignedUrl); } }, /** * @api private */ buildCopySnapshotPresignedUrl: function buildCopySnapshotPresignedUrl(req, done) { if (req.params.PresignedUrl || req._subRequest) { return done(); } req.params = AWS.util.copy(req.params); req.params.DestinationRegion = req.service.config.region; var config = AWS.util.copy(req.service.config); delete config.endpoint; config.region = req.params.SourceRegion; var svc = new req.service.constructor(config); var newReq = svc[req.operation](req.params); newReq._subRequest = true; newReq.presign(function(err, url) { if (err) done(err); else { req.params.PresignedUrl = url; done(); } }); }, /** * @api private */ extractError: function extractError(resp) { // EC2 nests the error code and message deeper than other AWS Query services. var httpResponse = resp.httpResponse; var data = new AWS.XML.Parser().parse(httpResponse.body.toString() || ''); if (data.Errors) { resp.error = AWS.util.error(new Error(), { code: data.Errors.Error.Code, message: data.Errors.Error.Message }); } else { resp.error = AWS.util.error(new Error(), { code: httpResponse.statusCode, message: null }); } resp.error.requestId = data.RequestID || null; } }); /***/ }), /***/ 14472: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.Glacier.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if (Array.isArray(request._events.validate)) { request._events.validate.unshift(this.validateAccountId); } else { request.on('validate', this.validateAccountId); } request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); request.on('build', this.addGlacierApiVersion); request.on('build', this.addTreeHashHeaders); }, /** * @api private */ validateAccountId: function validateAccountId(request) { if (request.params.accountId !== undefined) return; request.params = AWS.util.copy(request.params); request.params.accountId = '-'; }, /** * @api private */ addGlacierApiVersion: function addGlacierApiVersion(request) { var version = request.service.api.apiVersion; request.httpRequest.headers['x-amz-glacier-version'] = version; }, /** * @api private */ addTreeHashHeaders: function addTreeHashHeaders(request) { if (request.params.body === undefined) return; var hashes = request.service.computeChecksums(request.params.body); request.httpRequest.headers['X-Amz-Content-Sha256'] = hashes.linearHash; if (!request.httpRequest.headers['x-amz-sha256-tree-hash']) { request.httpRequest.headers['x-amz-sha256-tree-hash'] = hashes.treeHash; } }, /** * @!group Computing Checksums */ /** * Computes the SHA-256 linear and tree hash checksums for a given * block of Buffer data. Pass the tree hash of the computed checksums * as the checksum input to the {completeMultipartUpload} when performing * a multi-part upload. * * @example Calculate checksum of 5.5MB data chunk * var glacier = new AWS.Glacier(); * var data = Buffer.alloc(5.5 * 1024 * 1024); * data.fill('0'); // fill with zeros * var results = glacier.computeChecksums(data); * // Result: { linearHash: '68aff0c5a9...', treeHash: '154e26c78f...' } * @param data [Buffer, String] data to calculate the checksum for * @return [map] a map containing * the linearHash and treeHash properties representing hex based digests * of the respective checksums. * @see completeMultipartUpload */ computeChecksums: function computeChecksums(data) { if (!AWS.util.Buffer.isBuffer(data)) data = AWS.util.buffer.toBuffer(data); var mb = 1024 * 1024; var hashes = []; var hash = AWS.util.crypto.createHash('sha256'); // build leaf nodes in 1mb chunks for (var i = 0; i < data.length; i += mb) { var chunk = data.slice(i, Math.min(i + mb, data.length)); hash.update(chunk); hashes.push(AWS.util.crypto.sha256(chunk)); } return { linearHash: hash.digest('hex'), treeHash: this.buildHashTree(hashes) }; }, /** * @api private */ buildHashTree: function buildHashTree(hashes) { // merge leaf nodes while (hashes.length > 1) { var tmpHashes = []; for (var i = 0; i < hashes.length; i += 2) { if (hashes[i + 1]) { var tmpHash = AWS.util.buffer.alloc(64); tmpHash.write(hashes[i], 0, 32, 'binary'); tmpHash.write(hashes[i + 1], 32, 32, 'binary'); tmpHashes.push(AWS.util.crypto.sha256(tmpHash)); } else { tmpHashes.push(hashes[i]); } } hashes = tmpHashes; } return AWS.util.crypto.toHex(hashes[0]); } }); /***/ }), /***/ 27062: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ var blobPayloadOutputOps = [ 'deleteThingShadow', 'getThingShadow', 'updateThingShadow' ]; /** * Constructs a service interface object. Each API operation is exposed as a * function on service. * * ### Sending a Request Using IotData * * ```javascript * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); * iotdata.getThingShadow(params, function (err, data) { * if (err) console.log(err, err.stack); // an error occurred * else console.log(data); // successful response * }); * ``` * * ### Locking the API Version * * In order to ensure that the IotData object uses this specific API, * you can construct the object by passing the `apiVersion` option to the * constructor: * * ```javascript * var iotdata = new AWS.IotData({ * endpoint: 'my.host.tld', * apiVersion: '2015-05-28' * }); * ``` * * You can also set the API version globally in `AWS.config.apiVersions` using * the **iotdata** service identifier: * * ```javascript * AWS.config.apiVersions = { * iotdata: '2015-05-28', * // other service API versions * }; * * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); * ``` * * @note You *must* provide an `endpoint` configuration parameter when * constructing this service. See {constructor} for more information. * * @!method constructor(options = {}) * Constructs a service object. This object has one method for each * API operation. * * @example Constructing a IotData object * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'}); * @note You *must* provide an `endpoint` when constructing this service. * @option (see AWS.Config.constructor) * * @service iotdata * @version 2015-05-28 */ AWS.util.update(AWS.IotData.prototype, { /** * @api private */ validateService: function validateService() { if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) { var msg = 'AWS.IotData requires an explicit ' + '`endpoint\' configuration option.'; throw AWS.util.error(new Error(), {name: 'InvalidEndpoint', message: msg}); } }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('validateResponse', this.validateResponseBody); if (blobPayloadOutputOps.indexOf(request.operation) > -1) { request.addListener('extractData', AWS.util.convertPayloadToString); } }, /** * @api private */ validateResponseBody: function validateResponseBody(resp) { var body = resp.httpResponse.body.toString() || '{}'; var bodyCheck = body.trim(); if (!bodyCheck || bodyCheck.charAt(0) !== '{') { resp.httpResponse.body = ''; } } }); /***/ }), /***/ 8452: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.Lambda.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if (request.operation === 'invoke') { request.addListener('extractData', AWS.util.convertPayloadToString); } } }); /***/ }), /***/ 22922: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.LexModelsV2.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('build', this.modifyContentType); }, /** * Normally rest-json services require `Content-Type` header to be 'application/json', * However Lex Model V2 services requires the header to be 'application/x-amz-json-1.1'. * * @api private */ modifyContentType: function modifyContentType(request) { if (request.httpRequest.headers['Content-Type'] === 'application/json') { request.httpRequest.headers['Content-Type'] = 'application/x-amz-json-1.1'; } } }); /***/ }), /***/ 64605: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.LookoutMetrics.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('build', this.modifyContentType); }, /** * Normally rest-json services require `Content-Type` header to be 'application/json', * However lookout metrics services requires the header to be 'application/x-amz-json-1.1'. * * @api private */ modifyContentType: function modifyContentType(request) { if (request.httpRequest.headers['Content-Type'] === 'application/json') { request.httpRequest.headers['Content-Type'] = 'application/x-amz-json-1.1'; } } }); /***/ }), /***/ 19174: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.MachineLearning.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if (request.operation === 'predict') { request.addListener('build', this.buildEndpoint); } }, /** * Updates request endpoint from PredictEndpoint * @api private */ buildEndpoint: function buildEndpoint(request) { var url = request.params.PredictEndpoint; if (url) { request.httpRequest.endpoint = new AWS.Endpoint(url); } } }); /***/ }), /***/ 73090: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rdsutil = __webpack_require__(30650); /** * @api private */ var crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot']; AWS.util.update(AWS.Neptune.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { if ( crossRegionOperations.indexOf(request.operation) !== -1 && this.config.params && this.config.params.SourceRegion && request.params && !request.params.SourceRegion ) { request.params.SourceRegion = this.config.params.SourceRegion; } rdsutil.setupRequestListeners(this, request, crossRegionOperations); }, }); /***/ }), /***/ 53199: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(44086); /***/ }), /***/ 71928: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rdsutil = __webpack_require__(30650); __webpack_require__(16612); /** * @api private */ var crossRegionOperations = ['copyDBSnapshot', 'createDBInstanceReadReplica', 'createDBCluster', 'copyDBClusterSnapshot', 'startDBInstanceAutomatedBackupsReplication']; AWS.util.update(AWS.RDS.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { rdsutil.setupRequestListeners(this, request, crossRegionOperations); }, }); /***/ }), /***/ 64070: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.RDSDataService.prototype, { /** * @return [Boolean] whether the error can be retried * @api private */ retryableError: function retryableError(error) { if (error.code === 'BadRequestException' && error.message && error.message.match(/^Communications link failure/) && error.statusCode === 400) { return true; } else { var _super = AWS.Service.prototype.retryableError; return _super.call(this, error); } } }); /***/ }), /***/ 30650: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var rdsutil = { /** * @api private */ setupRequestListeners: function setupRequestListeners(service, request, crossRegionOperations) { if (crossRegionOperations.indexOf(request.operation) !== -1 && request.params.SourceRegion) { request.params = AWS.util.copy(request.params); if (request.params.PreSignedUrl || request.params.SourceRegion === service.config.region) { delete request.params.SourceRegion; } else { var doesParamValidation = !!service.config.paramValidation; // remove the validate parameters listener so we can re-add it after we build the URL if (doesParamValidation) { request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); } request.onAsync('validate', rdsutil.buildCrossRegionPresignedUrl); if (doesParamValidation) { request.addListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS); } } } }, /** * @api private */ buildCrossRegionPresignedUrl: function buildCrossRegionPresignedUrl(req, done) { var config = AWS.util.copy(req.service.config); config.region = req.params.SourceRegion; delete req.params.SourceRegion; delete config.endpoint; // relevant params for the operation will already be in req.params delete config.params; config.signatureVersion = 'v4'; var destinationRegion = req.service.config.region; var svc = new req.service.constructor(config); var newReq = svc[req.operation](AWS.util.copy(req.params)); newReq.on('build', function addDestinationRegionParam(request) { var httpRequest = request.httpRequest; httpRequest.params.DestinationRegion = destinationRegion; httpRequest.body = AWS.util.queryParamsToString(httpRequest.params); }); newReq.presign(function(err, url) { if (err) done(err); else { req.params.PreSignedUrl = url; done(); } }); } }; /** * @api private */ module.exports = rdsutil; /***/ }), /***/ 69627: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.Route53.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.on('build', this.sanitizeUrl); }, /** * @api private */ sanitizeUrl: function sanitizeUrl(request) { var path = request.httpRequest.path; request.httpRequest.path = path.replace(/\/%2F\w+%2F/, '/'); }, /** * @return [Boolean] whether the error can be retried * @api private */ retryableError: function retryableError(error) { if (error.code === 'PriorRequestNotComplete' && error.statusCode === 400) { return true; } else { var _super = AWS.Service.prototype.retryableError; return _super.call(this, error); } } }); /***/ }), /***/ 26543: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var v4Credentials = __webpack_require__(62660); var resolveRegionalEndpointsFlag = __webpack_require__(85566); var s3util = __webpack_require__(35895); var regionUtil = __webpack_require__(18262); // Pull in managed upload extension __webpack_require__(81600); /** * @api private */ var operationsWith200StatusCodeError = { 'completeMultipartUpload': true, 'copyObject': true, 'uploadPartCopy': true }; /** * @api private */ var regionRedirectErrorCodes = [ 'AuthorizationHeaderMalformed', // non-head operations on virtual-hosted global bucket endpoints 'BadRequest', // head operations on virtual-hosted global bucket endpoints 'PermanentRedirect', // non-head operations on path-style or regional endpoints 301 // head operations on path-style or regional endpoints ]; var OBJECT_LAMBDA_SERVICE = 's3-object-lambda'; AWS.util.update(AWS.S3.prototype, { /** * @api private */ getSignatureVersion: function getSignatureVersion(request) { var defaultApiVersion = this.api.signatureVersion; var userDefinedVersion = this._originalConfig ? this._originalConfig.signatureVersion : null; var regionDefinedVersion = this.config.signatureVersion; var isPresigned = request ? request.isPresigned() : false; /* 1) User defined version specified: a) always return user defined version 2) No user defined version specified: a) If not using presigned urls, default to V4 b) If using presigned urls, default to lowest version the region supports */ if (userDefinedVersion) { userDefinedVersion = userDefinedVersion === 'v2' ? 's3' : userDefinedVersion; return userDefinedVersion; } if (isPresigned !== true) { defaultApiVersion = 'v4'; } else if (regionDefinedVersion) { defaultApiVersion = regionDefinedVersion; } return defaultApiVersion; }, /** * @api private */ getSigningName: function getSigningName(req) { if (req && req.operation === 'writeGetObjectResponse') { return OBJECT_LAMBDA_SERVICE; } var _super = AWS.Service.prototype.getSigningName; return (req && req._parsedArn && req._parsedArn.service) ? req._parsedArn.service : _super.call(this); }, /** * @api private */ getSignerClass: function getSignerClass(request) { var signatureVersion = this.getSignatureVersion(request); return AWS.Signers.RequestSigner.getVersion(signatureVersion); }, /** * @api private */ validateService: function validateService() { var msg; var messages = []; // default to us-east-1 when no region is provided if (!this.config.region) this.config.region = 'us-east-1'; if (!this.config.endpoint && this.config.s3BucketEndpoint) { messages.push('An endpoint must be provided when configuring ' + '`s3BucketEndpoint` to true.'); } if (messages.length === 1) { msg = messages[0]; } else if (messages.length > 1) { msg = 'Multiple configuration errors:\n' + messages.join('\n'); } if (msg) { throw AWS.util.error(new Error(), {name: 'InvalidEndpoint', message: msg}); } }, /** * @api private */ shouldDisableBodySigning: function shouldDisableBodySigning(request) { var signerClass = this.getSignerClass(); if (this.config.s3DisableBodySigning === true && signerClass === AWS.Signers.V4 && request.httpRequest.endpoint.protocol === 'https:') { return true; } return false; }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { var prependListener = true; request.addListener('validate', this.validateScheme); request.addListener('validate', this.validateBucketName, prependListener); request.addListener('validate', this.optInUsEast1RegionalEndpoint, prependListener); request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_REGION); request.addListener('build', this.addContentType); request.addListener('build', this.computeContentMd5); request.addListener('build', this.computeSseCustomerKeyMd5); request.addListener('build', this.populateURI); request.addListener('afterBuild', this.addExpect100Continue); request.addListener('extractError', this.extractError); request.addListener('extractData', AWS.util.hoistPayloadMember); request.addListener('extractData', this.extractData); request.addListener('extractData', this.extractErrorFrom200Response); request.addListener('beforePresign', this.prepareSignedUrl); if (this.shouldDisableBodySigning(request)) { request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); request.addListener('afterBuild', this.disableBodySigning); } //deal with ARNs supplied to Bucket if (request.operation !== 'createBucket' && s3util.isArnInParam(request, 'Bucket')) { // avoid duplicate parsing in the future request._parsedArn = AWS.util.ARN.parse(request.params.Bucket); request.removeListener('validate', this.validateBucketName); request.removeListener('build', this.populateURI); if (request._parsedArn.service === 's3') { request.addListener('validate', s3util.validateS3AccessPointArn); request.addListener('validate', this.validateArnResourceType); } else if (request._parsedArn.service === 's3-outposts') { request.addListener('validate', s3util.validateOutpostsAccessPointArn); request.addListener('validate', s3util.validateOutpostsArn); } request.addListener('validate', s3util.validateArnRegion); request.addListener('validate', s3util.validateArnAccount); request.addListener('validate', s3util.validateArnService); request.addListener('build', this.populateUriFromAccessPointArn); request.addListener('build', s3util.validatePopulateUriFromArn); return; } //listeners regarding region inference request.addListener('validate', this.validateBucketEndpoint); request.addListener('validate', this.correctBucketRegionFromCache); request.onAsync('extractError', this.requestBucketRegion); if (AWS.util.isBrowser()) { request.onAsync('retry', this.reqRegionForNetworkingError); } }, /** * @api private */ validateScheme: function(req) { var params = req.params, scheme = req.httpRequest.endpoint.protocol, sensitive = params.SSECustomerKey || params.CopySourceSSECustomerKey; if (sensitive && scheme !== 'https:') { var msg = 'Cannot send SSE keys over HTTP. Set \'sslEnabled\'' + 'to \'true\' in your configuration'; throw AWS.util.error(new Error(), { code: 'ConfigError', message: msg }); } }, /** * @api private */ validateBucketEndpoint: function(req) { if (!req.params.Bucket && req.service.config.s3BucketEndpoint) { var msg = 'Cannot send requests to root API with `s3BucketEndpoint` set.'; throw AWS.util.error(new Error(), { code: 'ConfigError', message: msg }); } }, /** * Validate resource-type supplied in S3 ARN */ validateArnResourceType: function validateArnResourceType(req) { var resource = req._parsedArn.resource; if ( resource.indexOf('accesspoint:') !== 0 && resource.indexOf('accesspoint/') !== 0 ) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'ARN resource should begin with \'accesspoint/\'' }); } }, /** * @api private */ validateBucketName: function validateBucketName(req) { var service = req.service; var signatureVersion = service.getSignatureVersion(req); var bucket = req.params && req.params.Bucket; var key = req.params && req.params.Key; var slashIndex = bucket && bucket.indexOf('/'); if (bucket && slashIndex >= 0) { if (typeof key === 'string' && slashIndex > 0) { req.params = AWS.util.copy(req.params); // Need to include trailing slash to match sigv2 behavior var prefix = bucket.substr(slashIndex + 1) || ''; req.params.Key = prefix + '/' + key; req.params.Bucket = bucket.substr(0, slashIndex); } else if (signatureVersion === 'v4') { var msg = 'Bucket names cannot contain forward slashes. Bucket: ' + bucket; throw AWS.util.error(new Error(), { code: 'InvalidBucket', message: msg }); } } }, /** * @api private */ isValidAccelerateOperation: function isValidAccelerateOperation(operation) { var invalidOperations = [ 'createBucket', 'deleteBucket', 'listBuckets' ]; return invalidOperations.indexOf(operation) === -1; }, /** * When us-east-1 region endpoint configuration is set, in stead of sending request to * global endpoint(e.g. 's3.amazonaws.com'), we will send request to * 's3.us-east-1.amazonaws.com'. * @api private */ optInUsEast1RegionalEndpoint: function optInUsEast1RegionalEndpoint(req) { var service = req.service; var config = service.config; config.s3UsEast1RegionalEndpoint = resolveRegionalEndpointsFlag(service._originalConfig, { env: 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT', sharedConfig: 's3_us_east_1_regional_endpoint', clientConfig: 's3UsEast1RegionalEndpoint' }); if ( !(service._originalConfig || {}).endpoint && req.httpRequest.region === 'us-east-1' && config.s3UsEast1RegionalEndpoint === 'regional' && req.httpRequest.endpoint.hostname.indexOf('s3.amazonaws.com') >= 0 ) { var insertPoint = config.endpoint.indexOf('.amazonaws.com'); regionalEndpoint = config.endpoint.substring(0, insertPoint) + '.us-east-1' + config.endpoint.substring(insertPoint); req.httpRequest.updateEndpoint(regionalEndpoint); } }, /** * S3 prefers dns-compatible bucket names to be moved from the uri path * to the hostname as a sub-domain. This is not possible, even for dns-compat * buckets when using SSL and the bucket name contains a dot ('.'). The * ssl wildcard certificate is only 1-level deep. * * @api private */ populateURI: function populateURI(req) { var httpRequest = req.httpRequest; var b = req.params.Bucket; var service = req.service; var endpoint = httpRequest.endpoint; if (b) { if (!service.pathStyleBucketName(b)) { if (service.config.useAccelerateEndpoint && service.isValidAccelerateOperation(req.operation)) { if (service.config.useDualstack) { endpoint.hostname = b + '.s3-accelerate.dualstack.amazonaws.com'; } else { endpoint.hostname = b + '.s3-accelerate.amazonaws.com'; } } else if (!service.config.s3BucketEndpoint) { endpoint.hostname = b + '.' + endpoint.hostname; } var port = endpoint.port; if (port !== 80 && port !== 443) { endpoint.host = endpoint.hostname + ':' + endpoint.port; } else { endpoint.host = endpoint.hostname; } httpRequest.virtualHostedBucket = b; // needed for signing the request service.removeVirtualHostedBucketFromPath(req); } } }, /** * Takes the bucket name out of the path if bucket is virtual-hosted * * @api private */ removeVirtualHostedBucketFromPath: function removeVirtualHostedBucketFromPath(req) { var httpRequest = req.httpRequest; var bucket = httpRequest.virtualHostedBucket; if (bucket && httpRequest.path) { if (req.params && req.params.Key) { var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key); if (httpRequest.path.indexOf(encodedS3Key) === 0 && (httpRequest.path.length === encodedS3Key.length || httpRequest.path[encodedS3Key.length] === '?')) { //path only contains key or path contains only key and querystring return; } } httpRequest.path = httpRequest.path.replace(new RegExp('/' + bucket), ''); if (httpRequest.path[0] !== '/') { httpRequest.path = '/' + httpRequest.path; } } }, /** * When user supply an access point ARN in the Bucket parameter, we need to * populate the URI according to the ARN. */ populateUriFromAccessPointArn: function populateUriFromAccessPointArn(req) { var accessPointArn = req._parsedArn; var isOutpostArn = accessPointArn.service === 's3-outposts'; var isObjectLambdaArn = accessPointArn.service === 's3-object-lambda'; var outpostsSuffix = isOutpostArn ? '.' + accessPointArn.outpostId: ''; var serviceName = isOutpostArn ? 's3-outposts': 's3-accesspoint'; var dualStackSuffix = !isOutpostArn && req.service.config.useDualstack ? '.dualstack' : ''; var endpoint = req.httpRequest.endpoint; var dnsSuffix = regionUtil.getEndpointSuffix(accessPointArn.region); var useArnRegion = req.service.config.s3UseArnRegion; endpoint.hostname = [ accessPointArn.accessPoint + '-' + accessPointArn.accountId + outpostsSuffix, serviceName + dualStackSuffix, useArnRegion ? accessPointArn.region : req.service.config.region, dnsSuffix ].join('.'); if (isObjectLambdaArn) { // should be in the format: "accesspoint/${accesspointName}" var serviceName = 's3-object-lambda'; var accesspointName = accessPointArn.resource.split('/')[1]; endpoint.hostname = [ accesspointName + '-' + accessPointArn.accountId, serviceName, useArnRegion ? accessPointArn.region : req.service.config.region, dnsSuffix ].join('.'); } endpoint.host = endpoint.hostname; var encodedArn = AWS.util.uriEscape(req.params.Bucket); var path = req.httpRequest.path; //remove the Bucket value from path req.httpRequest.path = path.replace(new RegExp('/' + encodedArn), ''); if (req.httpRequest.path[0] !== '/') { req.httpRequest.path = '/' + req.httpRequest.path; } req.httpRequest.region = accessPointArn.region; //region used to sign }, /** * Adds Expect: 100-continue header if payload is greater-or-equal 1MB * @api private */ addExpect100Continue: function addExpect100Continue(req) { var len = req.httpRequest.headers['Content-Length']; if (AWS.util.isNode() && (len >= 1024 * 1024 || req.params.Body instanceof AWS.util.stream.Stream)) { req.httpRequest.headers['Expect'] = '100-continue'; } }, /** * Adds a default content type if none is supplied. * * @api private */ addContentType: function addContentType(req) { var httpRequest = req.httpRequest; if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') { // Content-Type is not set in GET/HEAD requests delete httpRequest.headers['Content-Type']; return; } if (!httpRequest.headers['Content-Type']) { // always have a Content-Type httpRequest.headers['Content-Type'] = 'application/octet-stream'; } var contentType = httpRequest.headers['Content-Type']; if (AWS.util.isBrowser()) { if (typeof httpRequest.body === 'string' && !contentType.match(/;\s*charset=/)) { var charset = '; charset=UTF-8'; httpRequest.headers['Content-Type'] += charset; } else { var replaceFn = function(_, prefix, charsetName) { return prefix + charsetName.toUpperCase(); }; httpRequest.headers['Content-Type'] = contentType.replace(/(;\s*charset=)(.+)$/, replaceFn); } } }, /** * @api private */ computableChecksumOperations: { putBucketCors: true, putBucketLifecycle: true, putBucketLifecycleConfiguration: true, putBucketTagging: true, deleteObjects: true, putBucketReplication: true, putObjectLegalHold: true, putObjectRetention: true, putObjectLockConfiguration: true }, /** * Checks whether checksums should be computed for the request. * If the request requires checksums to be computed, this will always * return true, otherwise it depends on whether {AWS.Config.computeChecksums} * is set. * * @param req [AWS.Request] the request to check against * @return [Boolean] whether to compute checksums for a request. * @api private */ willComputeChecksums: function willComputeChecksums(req) { if (this.computableChecksumOperations[req.operation]) return true; if (!this.config.computeChecksums) return false; // TODO: compute checksums for Stream objects if (!AWS.util.Buffer.isBuffer(req.httpRequest.body) && typeof req.httpRequest.body !== 'string') { return false; } var rules = req.service.api.operations[req.operation].input.members; // Sha256 signing disabled, and not a presigned url if (req.service.shouldDisableBodySigning(req) && !Object.prototype.hasOwnProperty.call(req.httpRequest.headers, 'presigned-expires')) { if (rules.ContentMD5 && !req.params.ContentMD5) { return true; } } // V4 signer uses SHA256 signatures so only compute MD5 if it is required if (req.service.getSignerClass(req) === AWS.Signers.V4) { if (rules.ContentMD5 && !rules.ContentMD5.required) return false; } if (rules.ContentMD5 && !req.params.ContentMD5) return true; }, /** * A listener that computes the Content-MD5 and sets it in the header. * @see AWS.S3.willComputeChecksums * @api private */ computeContentMd5: function computeContentMd5(req) { if (req.service.willComputeChecksums(req)) { var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64'); req.httpRequest.headers['Content-MD5'] = md5; } }, /** * @api private */ computeSseCustomerKeyMd5: function computeSseCustomerKeyMd5(req) { var keys = { SSECustomerKey: 'x-amz-server-side-encryption-customer-key-MD5', CopySourceSSECustomerKey: 'x-amz-copy-source-server-side-encryption-customer-key-MD5' }; AWS.util.each(keys, function(key, header) { if (req.params[key]) { var value = AWS.util.crypto.md5(req.params[key], 'base64'); req.httpRequest.headers[header] = value; } }); }, /** * Returns true if the bucket name should be left in the URI path for * a request to S3. This function takes into account the current * endpoint protocol (e.g. http or https). * * @api private */ pathStyleBucketName: function pathStyleBucketName(bucketName) { // user can force path style requests via the configuration if (this.config.s3ForcePathStyle) return true; if (this.config.s3BucketEndpoint) return false; if (s3util.dnsCompatibleBucketName(bucketName)) { return (this.config.sslEnabled && bucketName.match(/\./)) ? true : false; } else { return true; // not dns compatible names must always use path style } }, /** * For COPY operations, some can be error even with status code 200. * SDK treats the response as exception when response body indicates * an exception or body is empty. * * @api private */ extractErrorFrom200Response: function extractErrorFrom200Response(resp) { if (!operationsWith200StatusCodeError[resp.request.operation]) return; var httpResponse = resp.httpResponse; if (httpResponse.body && httpResponse.body.toString().match('')) { // Response body with '...' indicates an exception. // Get S3 client object. In ManagedUpload, this.service refers to // S3 client object. resp.data = null; var service = this.service ? this.service : this; service.extractError(resp); throw resp.error; } else if (!httpResponse.body || !httpResponse.body.toString().match(/<[\w_]/)) { // When body is empty or incomplete, S3 might stop the request on detecting client // side aborting the request. resp.data = null; throw AWS.util.error(new Error(), { code: 'InternalError', message: 'S3 aborted request' }); } }, /** * @return [Boolean] whether the error can be retried * @api private */ retryableError: function retryableError(error, request) { if (operationsWith200StatusCodeError[request.operation] && error.statusCode === 200) { return true; } else if (request._requestRegionForBucket && request.service.bucketRegionCache[request._requestRegionForBucket]) { return false; } else if (error && error.code === 'RequestTimeout') { return true; } else if (error && regionRedirectErrorCodes.indexOf(error.code) != -1 && error.region && error.region != request.httpRequest.region) { request.httpRequest.region = error.region; if (error.statusCode === 301) { request.service.updateReqBucketRegion(request); } return true; } else { var _super = AWS.Service.prototype.retryableError; return _super.call(this, error, request); } }, /** * Updates httpRequest with region. If region is not provided, then * the httpRequest will be updated based on httpRequest.region * * @api private */ updateReqBucketRegion: function updateReqBucketRegion(request, region) { var httpRequest = request.httpRequest; if (typeof region === 'string' && region.length) { httpRequest.region = region; } if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)) { return; } var service = request.service; var s3Config = service.config; var s3BucketEndpoint = s3Config.s3BucketEndpoint; if (s3BucketEndpoint) { delete s3Config.s3BucketEndpoint; } var newConfig = AWS.util.copy(s3Config); delete newConfig.endpoint; newConfig.region = httpRequest.region; httpRequest.endpoint = (new AWS.S3(newConfig)).endpoint; service.populateURI(request); s3Config.s3BucketEndpoint = s3BucketEndpoint; httpRequest.headers.Host = httpRequest.endpoint.host; if (request._asm.currentState === 'validate') { request.removeListener('build', service.populateURI); request.addListener('build', service.removeVirtualHostedBucketFromPath); } }, /** * Provides a specialized parser for getBucketLocation -- all other * operations are parsed by the super class. * * @api private */ extractData: function extractData(resp) { var req = resp.request; if (req.operation === 'getBucketLocation') { var match = resp.httpResponse.body.toString().match(/>(.+)<\/Location/); delete resp.data['_']; if (match) { resp.data.LocationConstraint = match[1]; } else { resp.data.LocationConstraint = ''; } } var bucket = req.params.Bucket || null; if (req.operation === 'deleteBucket' && typeof bucket === 'string' && !resp.error) { req.service.clearBucketRegionCache(bucket); } else { var headers = resp.httpResponse.headers || {}; var region = headers['x-amz-bucket-region'] || null; if (!region && req.operation === 'createBucket' && !resp.error) { var createBucketConfiguration = req.params.CreateBucketConfiguration; if (!createBucketConfiguration) { region = 'us-east-1'; } else if (createBucketConfiguration.LocationConstraint === 'EU') { region = 'eu-west-1'; } else { region = createBucketConfiguration.LocationConstraint; } } if (region) { if (bucket && region !== req.service.bucketRegionCache[bucket]) { req.service.bucketRegionCache[bucket] = region; } } } req.service.extractRequestIds(resp); }, /** * Extracts an error object from the http response. * * @api private */ extractError: function extractError(resp) { var codes = { 304: 'NotModified', 403: 'Forbidden', 400: 'BadRequest', 404: 'NotFound' }; var req = resp.request; var code = resp.httpResponse.statusCode; var body = resp.httpResponse.body || ''; var headers = resp.httpResponse.headers || {}; var region = headers['x-amz-bucket-region'] || null; var bucket = req.params.Bucket || null; var bucketRegionCache = req.service.bucketRegionCache; if (region && bucket && region !== bucketRegionCache[bucket]) { bucketRegionCache[bucket] = region; } var cachedRegion; if (codes[code] && body.length === 0) { if (bucket && !region) { cachedRegion = bucketRegionCache[bucket] || null; if (cachedRegion !== req.httpRequest.region) { region = cachedRegion; } } resp.error = AWS.util.error(new Error(), { code: codes[code], message: null, region: region }); } else { var data = new AWS.XML.Parser().parse(body.toString()); if (data.Region && !region) { region = data.Region; if (bucket && region !== bucketRegionCache[bucket]) { bucketRegionCache[bucket] = region; } } else if (bucket && !region && !data.Region) { cachedRegion = bucketRegionCache[bucket] || null; if (cachedRegion !== req.httpRequest.region) { region = cachedRegion; } } resp.error = AWS.util.error(new Error(), { code: data.Code || code, message: data.Message || null, region: region }); } req.service.extractRequestIds(resp); }, /** * If region was not obtained synchronously, then send async request * to get bucket region for errors resulting from wrong region. * * @api private */ requestBucketRegion: function requestBucketRegion(resp, done) { var error = resp.error; var req = resp.request; var bucket = req.params.Bucket || null; if (!error || !bucket || error.region || req.operation === 'listObjects' || (AWS.util.isNode() && req.operation === 'headBucket') || (error.statusCode === 400 && req.operation !== 'headObject') || regionRedirectErrorCodes.indexOf(error.code) === -1) { return done(); } var reqOperation = AWS.util.isNode() ? 'headBucket' : 'listObjects'; var reqParams = {Bucket: bucket}; if (reqOperation === 'listObjects') reqParams.MaxKeys = 0; var regionReq = req.service[reqOperation](reqParams); regionReq._requestRegionForBucket = bucket; regionReq.send(function() { var region = req.service.bucketRegionCache[bucket] || null; error.region = region; done(); }); }, /** * For browser only. If NetworkingError received, will attempt to obtain * the bucket region. * * @api private */ reqRegionForNetworkingError: function reqRegionForNetworkingError(resp, done) { if (!AWS.util.isBrowser()) { return done(); } var error = resp.error; var request = resp.request; var bucket = request.params.Bucket; if (!error || error.code !== 'NetworkingError' || !bucket || request.httpRequest.region === 'us-east-1') { return done(); } var service = request.service; var bucketRegionCache = service.bucketRegionCache; var cachedRegion = bucketRegionCache[bucket] || null; if (cachedRegion && cachedRegion !== request.httpRequest.region) { service.updateReqBucketRegion(request, cachedRegion); done(); } else if (!s3util.dnsCompatibleBucketName(bucket)) { service.updateReqBucketRegion(request, 'us-east-1'); if (bucketRegionCache[bucket] !== 'us-east-1') { bucketRegionCache[bucket] = 'us-east-1'; } done(); } else if (request.httpRequest.virtualHostedBucket) { var getRegionReq = service.listObjects({Bucket: bucket, MaxKeys: 0}); service.updateReqBucketRegion(getRegionReq, 'us-east-1'); getRegionReq._requestRegionForBucket = bucket; getRegionReq.send(function() { var region = service.bucketRegionCache[bucket] || null; if (region && region !== request.httpRequest.region) { service.updateReqBucketRegion(request, region); } done(); }); } else { // DNS-compatible path-style // (s3ForcePathStyle or bucket name with dot over https) // Cannot obtain region information for this case done(); } }, /** * Cache for bucket region. * * @api private */ bucketRegionCache: {}, /** * Clears bucket region cache. * * @api private */ clearBucketRegionCache: function(buckets) { var bucketRegionCache = this.bucketRegionCache; if (!buckets) { buckets = Object.keys(bucketRegionCache); } else if (typeof buckets === 'string') { buckets = [buckets]; } for (var i = 0; i < buckets.length; i++) { delete bucketRegionCache[buckets[i]]; } return bucketRegionCache; }, /** * Corrects request region if bucket's cached region is different * * @api private */ correctBucketRegionFromCache: function correctBucketRegionFromCache(req) { var bucket = req.params.Bucket || null; if (bucket) { var service = req.service; var requestRegion = req.httpRequest.region; var cachedRegion = service.bucketRegionCache[bucket]; if (cachedRegion && cachedRegion !== requestRegion) { service.updateReqBucketRegion(req, cachedRegion); } } }, /** * Extracts S3 specific request ids from the http response. * * @api private */ extractRequestIds: function extractRequestIds(resp) { var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null; var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null; resp.extendedRequestId = extendedRequestId; resp.cfId = cfId; if (resp.error) { resp.error.requestId = resp.requestId || null; resp.error.extendedRequestId = extendedRequestId; resp.error.cfId = cfId; } }, /** * Get a pre-signed URL for a given operation name. * * @note You must ensure that you have static or previously resolved * credentials if you call this method synchronously (with no callback), * otherwise it may not properly sign the request. If you cannot guarantee * this (you are using an asynchronous credential provider, i.e., EC2 * IAM roles), you should always call this method with an asynchronous * callback. * @note Not all operation parameters are supported when using pre-signed * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`, * `ContentLength`, or `Tagging` must be provided as headers when sending a * request. If you are using pre-signed URLs to upload from a browser and * need to use these fields, see {createPresignedPost}. * @note The default signer allows altering the request by adding corresponding * headers to set some parameters (e.g. Range) and these added parameters * won't be signed. You must use signatureVersion v4 to to include these * parameters in the signed portion of the URL and enforce exact matching * between headers and signed params in the URL. * @note This operation cannot be used with a promise. See note above regarding * asynchronous credentials and use with a callback. * @param operation [String] the name of the operation to call * @param params [map] parameters to pass to the operation. See the given * operation for the expected operation parameters. In addition, you can * also pass the "Expires" parameter to inform S3 how long the URL should * work for. * @option params Expires [Integer] (900) the number of seconds to expire * the pre-signed URL operation in. Defaults to 15 minutes. * @param callback [Function] if a callback is provided, this function will * pass the URL as the second parameter (after the error parameter) to * the callback function. * @return [String] if called synchronously (with no callback), returns the * signed URL. * @return [null] nothing is returned if a callback is provided. * @example Pre-signing a getObject operation (synchronously) * var params = {Bucket: 'bucket', Key: 'key'}; * var url = s3.getSignedUrl('getObject', params); * console.log('The URL is', url); * @example Pre-signing a putObject (asynchronously) * var params = {Bucket: 'bucket', Key: 'key'}; * s3.getSignedUrl('putObject', params, function (err, url) { * console.log('The URL is', url); * }); * @example Pre-signing a putObject operation with a specific payload * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'}; * var url = s3.getSignedUrl('putObject', params); * console.log('The URL is', url); * @example Passing in a 1-minute expiry time for a pre-signed URL * var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; * var url = s3.getSignedUrl('getObject', params); * console.log('The URL is', url); // expires in 60 seconds */ getSignedUrl: function getSignedUrl(operation, params, callback) { params = AWS.util.copy(params || {}); var expires = params.Expires || 900; if (typeof expires !== 'number') { throw AWS.util.error(new Error(), { code: 'InvalidParameterException', message: 'The expiration must be a number, received ' + typeof expires }); } delete params.Expires; // we can't validate this var request = this.makeRequest(operation, params); if (callback) { AWS.util.defer(function() { request.presign(expires, callback); }); } else { return request.presign(expires, callback); } }, /** * @!method getSignedUrlPromise() * Returns a 'thenable' promise that will be resolved with a pre-signed URL * for a given operation name. * * Two callbacks can be provided to the `then` method on the returned promise. * The first callback will be called if the promise is fulfilled, and the second * callback will be called if the promise is rejected. * @note Not all operation parameters are supported when using pre-signed * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`, * `ContentLength`, or `Tagging` must be provided as headers when sending a * request. If you are using pre-signed URLs to upload from a browser and * need to use these fields, see {createPresignedPost}. * @param operation [String] the name of the operation to call * @param params [map] parameters to pass to the operation. See the given * operation for the expected operation parameters. In addition, you can * also pass the "Expires" parameter to inform S3 how long the URL should * work for. * @option params Expires [Integer] (900) the number of seconds to expire * the pre-signed URL operation in. Defaults to 15 minutes. * @callback fulfilledCallback function(url) * Called if the promise is fulfilled. * @param url [String] the signed url * @callback rejectedCallback function(err) * Called if the promise is rejected. * @param err [Error] if an error occurred, this value will be filled * @return [Promise] A promise that represents the state of the `refresh` call. * @example Pre-signing a getObject operation * var params = {Bucket: 'bucket', Key: 'key'}; * var promise = s3.getSignedUrlPromise('getObject', params); * promise.then(function(url) { * console.log('The URL is', url); * }, function(err) { ... }); * @example Pre-signing a putObject operation with a specific payload * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'}; * var promise = s3.getSignedUrlPromise('putObject', params); * promise.then(function(url) { * console.log('The URL is', url); * }, function(err) { ... }); * @example Passing in a 1-minute expiry time for a pre-signed URL * var params = {Bucket: 'bucket', Key: 'key', Expires: 60}; * var promise = s3.getSignedUrlPromise('getObject', params); * promise.then(function(url) { * console.log('The URL is', url); * }, function(err) { ... }); */ /** * Get a pre-signed POST policy to support uploading to S3 directly from an * HTML form. * * @param params [map] * @option params Bucket [String] The bucket to which the post should be * uploaded * @option params Expires [Integer] (3600) The number of seconds for which * the presigned policy should be valid. * @option params Conditions [Array] An array of conditions that must be met * for the presigned policy to allow the * upload. This can include required tags, * the accepted range for content lengths, * etc. * @see http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html * @option params Fields [map] Fields to include in the form. All * values passed in as fields will be * signed as exact match conditions. * @param callback [Function] * * @note All fields passed in when creating presigned post data will be signed * as exact match conditions. Any fields that will be interpolated by S3 * must be added to the fields hash after signing, and an appropriate * condition for such fields must be explicitly added to the Conditions * array passed to this function before signing. * * @example Presiging post data with a known key * var params = { * Bucket: 'bucket', * Fields: { * key: 'key' * } * }; * s3.createPresignedPost(params, function(err, data) { * if (err) { * console.error('Presigning post data encountered an error', err); * } else { * console.log('The post data is', data); * } * }); * * @example Presigning post data with an interpolated key * var params = { * Bucket: 'bucket', * Conditions: [ * ['starts-with', '$key', 'path/to/uploads/'] * ] * }; * s3.createPresignedPost(params, function(err, data) { * if (err) { * console.error('Presigning post data encountered an error', err); * } else { * data.Fields.key = 'path/to/uploads/${filename}'; * console.log('The post data is', data); * } * }); * * @note You must ensure that you have static or previously resolved * credentials if you call this method synchronously (with no callback), * otherwise it may not properly sign the request. If you cannot guarantee * this (you are using an asynchronous credential provider, i.e., EC2 * IAM roles), you should always call this method with an asynchronous * callback. * * @return [map] If called synchronously (with no callback), returns a hash * with the url to set as the form action and a hash of fields * to include in the form. * @return [null] Nothing is returned if a callback is provided. * * @callback callback function (err, data) * @param err [Error] the error object returned from the policy signer * @param data [map] The data necessary to construct an HTML form * @param data.url [String] The URL to use as the action of the form * @param data.fields [map] A hash of fields that must be included in the * form for the upload to succeed. This hash will * include the signed POST policy, your access key * ID and security token (if present), etc. These * may be safely included as input elements of type * 'hidden.' */ createPresignedPost: function createPresignedPost(params, callback) { if (typeof params === 'function' && callback === undefined) { callback = params; params = null; } params = AWS.util.copy(params || {}); var boundParams = this.config.params || {}; var bucket = params.Bucket || boundParams.Bucket, self = this, config = this.config, endpoint = AWS.util.copy(this.endpoint); if (!config.s3BucketEndpoint) { endpoint.pathname = '/' + bucket; } function finalizePost() { return { url: AWS.util.urlFormat(endpoint), fields: self.preparePostFields( config.credentials, config.region, bucket, params.Fields, params.Conditions, params.Expires ) }; } if (callback) { config.getCredentials(function (err) { if (err) { callback(err); } else { try { callback(null, finalizePost()); } catch (err) { callback(err); } } }); } else { return finalizePost(); } }, /** * @api private */ preparePostFields: function preparePostFields( credentials, region, bucket, fields, conditions, expiresInSeconds ) { var now = this.getSkewCorrectedDate(); if (!credentials || !region || !bucket) { throw new Error('Unable to create a POST object policy without a bucket,' + ' region, and credentials'); } fields = AWS.util.copy(fields || {}); conditions = (conditions || []).slice(0); expiresInSeconds = expiresInSeconds || 3600; var signingDate = AWS.util.date.iso8601(now).replace(/[:\-]|\.\d{3}/g, ''); var shortDate = signingDate.substr(0, 8); var scope = v4Credentials.createScope(shortDate, region, 's3'); var credential = credentials.accessKeyId + '/' + scope; fields['bucket'] = bucket; fields['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'; fields['X-Amz-Credential'] = credential; fields['X-Amz-Date'] = signingDate; if (credentials.sessionToken) { fields['X-Amz-Security-Token'] = credentials.sessionToken; } for (var field in fields) { if (fields.hasOwnProperty(field)) { var condition = {}; condition[field] = fields[field]; conditions.push(condition); } } fields.Policy = this.preparePostPolicy( new Date(now.valueOf() + expiresInSeconds * 1000), conditions ); fields['X-Amz-Signature'] = AWS.util.crypto.hmac( v4Credentials.getSigningKey(credentials, shortDate, region, 's3', true), fields.Policy, 'hex' ); return fields; }, /** * @api private */ preparePostPolicy: function preparePostPolicy(expiration, conditions) { return AWS.util.base64.encode(JSON.stringify({ expiration: AWS.util.date.iso8601(expiration), conditions: conditions })); }, /** * @api private */ prepareSignedUrl: function prepareSignedUrl(request) { request.addListener('validate', request.service.noPresignedContentLength); request.removeListener('build', request.service.addContentType); if (!request.params.Body) { // no Content-MD5/SHA-256 if body is not provided request.removeListener('build', request.service.computeContentMd5); } else { request.addListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); } }, /** * @api private * @param request */ disableBodySigning: function disableBodySigning(request) { var headers = request.httpRequest.headers; // Add the header to anything that isn't a presigned url, unless that presigned url had a body defined if (!Object.prototype.hasOwnProperty.call(headers, 'presigned-expires')) { headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD'; } }, /** * @api private */ noPresignedContentLength: function noPresignedContentLength(request) { if (request.params.ContentLength !== undefined) { throw AWS.util.error(new Error(), {code: 'UnexpectedParameter', message: 'ContentLength is not supported in pre-signed URLs.'}); } }, createBucket: function createBucket(params, callback) { // When creating a bucket *outside* the classic region, the location // constraint must be set for the bucket and it must match the endpoint. // This chunk of code will set the location constraint param based // on the region (when possible), but it will not override a passed-in // location constraint. if (typeof params === 'function' || !params) { callback = callback || params; params = {}; } var hostname = this.endpoint.hostname; // copy params so that appending keys does not unintentioinallly // mutate params object argument passed in by user var copiedParams = AWS.util.copy(params); if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) { copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region }; } return this.makeRequest('createBucket', copiedParams, callback); }, writeGetObjectResponse: function writeGetObjectResponse(params, callback) { var request = this.makeRequest('writeGetObjectResponse', AWS.util.copy(params), callback); var hostname = this.endpoint.hostname; if (hostname.indexOf(this.config.region) !== -1) { // hostname specifies a region already hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.'); } else { // Hostname doesn't have a region. // Object Lambda requires an explicit region. hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.' + this.config.region + '.'); } request.httpRequest.endpoint = new AWS.Endpoint(hostname, this.config); return request; }, /** * @see AWS.S3.ManagedUpload * @overload upload(params = {}, [options], [callback]) * Uploads an arbitrarily sized buffer, blob, or stream, using intelligent * concurrent handling of parts if the payload is large enough. You can * configure the concurrent queue size by setting `options`. Note that this * is the only operation for which the SDK can retry requests with stream * bodies. * * @param (see AWS.S3.putObject) * @option (see AWS.S3.ManagedUpload.constructor) * @return [AWS.S3.ManagedUpload] the managed upload object that can call * `send()` or track progress. * @example Uploading a stream object * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; * s3.upload(params, function(err, data) { * console.log(err, data); * }); * @example Uploading a stream with concurrency of 1 and partSize of 10mb * var params = {Bucket: 'bucket', Key: 'key', Body: stream}; * var options = {partSize: 10 * 1024 * 1024, queueSize: 1}; * s3.upload(params, options, function(err, data) { * console.log(err, data); * }); * @callback callback function(err, data) * @param err [Error] an error or null if no error occurred. * @param data [map] The response data from the successful upload: * @param data.Location [String] the URL of the uploaded object * @param data.ETag [String] the ETag of the uploaded object * @param data.Bucket [String] the bucket to which the object was uploaded * @param data.Key [String] the key to which the object was uploaded */ upload: function upload(params, options, callback) { if (typeof options === 'function' && callback === undefined) { callback = options; options = null; } options = options || {}; options = AWS.util.merge(options || {}, {service: this, params: params}); var uploader = new AWS.S3.ManagedUpload(options); if (typeof callback === 'function') uploader.send(callback); return uploader; } }); /** * @api private */ AWS.S3.addPromisesToClass = function addPromisesToClass(PromiseDependency) { this.prototype.getSignedUrlPromise = AWS.util.promisifyMethod('getSignedUrl', PromiseDependency); }; /** * @api private */ AWS.S3.deletePromisesFromClass = function deletePromisesFromClass() { delete this.prototype.getSignedUrlPromise; }; AWS.util.addPromises(AWS.S3); /***/ }), /***/ 71207: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var s3util = __webpack_require__(35895); var regionUtil = __webpack_require__(18262); AWS.util.update(AWS.S3Control.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('extractError', this.extractHostId); request.addListener('extractData', this.extractHostId); request.addListener('validate', this.validateAccountId); var isArnInBucket = s3util.isArnInParam(request, 'Bucket'); var isArnInName = s3util.isArnInParam(request, 'Name'); if (isArnInBucket) { request._parsedArn = AWS.util.ARN.parse(request.params['Bucket']); request.addListener('validate', this.validateOutpostsBucketArn); request.addListener('validate', s3util.validateOutpostsArn); request.addListener('afterBuild', this.addOutpostIdHeader); } else if (isArnInName) { request._parsedArn = AWS.util.ARN.parse(request.params['Name']); request.addListener('validate', s3util.validateOutpostsAccessPointArn); request.addListener('validate', s3util.validateOutpostsArn); request.addListener('afterBuild', this.addOutpostIdHeader); } if (isArnInBucket || isArnInName) { request.addListener('validate', s3util.validateArnRegion); request.addListener('validate', this.validateArnAccountWithParams, true); request.addListener('validate', s3util.validateArnAccount); request.addListener('validate', s3util.validateArnService); request.addListener('build', this.populateParamFromArn, true); request.addListener('build', this.populateUriFromArn); request.addListener('build', s3util.validatePopulateUriFromArn); } if (request.params.OutpostId && (request.operation === 'createBucket' || request.operation === 'listRegionalBuckets')) { request.addListener('build', this.populateEndpointForOutpostId); } }, /** * Adds outpostId header */ addOutpostIdHeader: function addOutpostIdHeader(req) { req.httpRequest.headers['x-amz-outpost-id'] = req._parsedArn.outpostId; }, /** * Validate Outposts ARN supplied in Bucket parameter is a valid bucket name */ validateOutpostsBucketArn: function validateOutpostsBucketArn(req) { var parsedArn = req._parsedArn; //can be ':' or '/' var delimiter = parsedArn.resource['outpost'.length]; if (parsedArn.resource.split(delimiter).length !== 4) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Bucket ARN should have two resources outpost/{outpostId}/bucket/{accesspointName}' }); } var bucket = parsedArn.resource.split(delimiter)[3]; if (!s3util.dnsCompatibleBucketName(bucket) || bucket.match(/\./)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Bucket ARN is not DNS compatible. Got ' + bucket }); } //set parsed valid bucket req._parsedArn.bucket = bucket; }, /** * @api private */ populateParamFromArn: function populateParamFromArn(req) { var parsedArn = req._parsedArn; if (s3util.isArnInParam(req, 'Bucket')) { req.params.Bucket = parsedArn.bucket; } else if (s3util.isArnInParam(req, 'Name')) { req.params.Name = parsedArn.accessPoint; } }, /** * Populate URI according to the ARN */ populateUriFromArn: function populateUriFromArn(req) { var parsedArn = req._parsedArn; var endpoint = req.httpRequest.endpoint; var useArnRegion = req.service.config.s3UseArnRegion; endpoint.hostname = [ 's3-outposts', useArnRegion ? parsedArn.region : req.service.config.region, 'amazonaws.com' ].join('.'); endpoint.host = endpoint.hostname; }, /** * @api private */ populateEndpointForOutpostId: function populateEndpointForOutpostId(req) { var endpoint = req.httpRequest.endpoint; endpoint.hostname = [ 's3-outposts', req.service.config.region, 'amazonaws.com' ].join('.'); endpoint.host = endpoint.hostname; }, /** * @api private */ extractHostId: function(response) { var hostId = response.httpResponse.headers ? response.httpResponse.headers['x-amz-id-2'] : null; response.extendedRequestId = hostId; if (response.error) { response.error.extendedRequestId = hostId; } }, /** * @api private */ validateArnAccountWithParams: function validateArnAccountWithParams(req) { var params = req.params; var inputModel = req.service.api.operations[req.operation].input; if (inputModel.members.AccountId) { var parsedArn = req._parsedArn; if (parsedArn.accountId) { if (params.AccountId) { if (params.AccountId !== parsedArn.accountId) { throw AWS.util.error( new Error(), {code: 'ValidationError', message: 'AccountId in ARN and request params should be same.'} ); } } else { // Store accountId from ARN in params params.AccountId = parsedArn.accountId; } } } }, /** * @api private */ validateAccountId: function(request) { var params = request.params; if (!Object.prototype.hasOwnProperty.call(params, 'AccountId')) return; var accountId = params.AccountId; //validate type if (typeof accountId !== 'string') { throw AWS.util.error( new Error(), {code: 'ValidationError', message: 'AccountId must be a string.'} ); } //validate length if (accountId.length < 1 || accountId.length > 63) { throw AWS.util.error( new Error(), {code: 'ValidationError', message: 'AccountId length should be between 1 to 63 characters, inclusive.'} ); } //validate pattern var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/; if (!hostPattern.test(accountId)) { throw AWS.util.error(new Error(), {code: 'ValidationError', message: 'AccountId should be hostname compatible. AccountId: ' + accountId}); } }, /** * @api private */ getSigningName: function getSigningName(req) { var _super = AWS.Service.prototype.getSigningName; if (req && req._parsedArn && req._parsedArn.service) { return req._parsedArn.service; } else if (req.params.OutpostId && (req.operation === 'createBucket' || req.operation === 'listRegionalBuckets')) { return 's3-outposts'; } else { return _super.call(this, req); } }, }); /***/ }), /***/ 35895: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var regionUtil = __webpack_require__(18262); var s3util = { /** * @api private */ isArnInParam: function isArnInParam(req, paramName) { var inputShape = (req.service.api.operations[req.operation] || {}).input || {}; var inputMembers = inputShape.members || {}; if (!req.params[paramName] || !inputMembers[paramName]) return false; return AWS.util.ARN.validate(req.params[paramName]); }, /** * Validate service component from ARN supplied in Bucket parameter */ validateArnService: function validateArnService(req) { var parsedArn = req._parsedArn; if (parsedArn.service !== 's3' && parsedArn.service !== 's3-outposts' && parsedArn.service !== 's3-object-lambda') { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'expect \'s3\' or \'s3-outposts\' or \'s3-object-lambda\' in ARN service component' }); } }, /** * Validate account ID from ARN supplied in Bucket parameter is a valid account */ validateArnAccount: function validateArnAccount(req) { var parsedArn = req._parsedArn; if (!/[0-9]{12}/.exec(parsedArn.accountId)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'ARN accountID does not match regex "[0-9]{12}"' }); } }, /** * Validate ARN supplied in Bucket parameter is a valid access point ARN */ validateS3AccessPointArn: function validateS3AccessPointArn(req) { var parsedArn = req._parsedArn; //can be ':' or '/' var delimiter = parsedArn.resource['accesspoint'.length]; if (parsedArn.resource.split(delimiter).length !== 2) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Access Point ARN should have one resource accesspoint/{accesspointName}' }); } var accessPoint = parsedArn.resource.split(delimiter)[1]; var accessPointPrefix = accessPoint + '-' + parsedArn.accountId; if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint }); } //set parsed valid access point req._parsedArn.accessPoint = accessPoint; }, /** * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN */ validateOutpostsArn: function validateOutpostsArn(req) { var parsedArn = req._parsedArn; if ( parsedArn.resource.indexOf('outpost:') !== 0 && parsedArn.resource.indexOf('outpost/') !== 0 ) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'ARN resource should begin with \'outpost/\'' }); } //can be ':' or '/' var delimiter = parsedArn.resource['outpost'.length]; var outpostId = parsedArn.resource.split(delimiter)[1]; var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); if (!dnsHostRegex.test(outpostId)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Outpost resource in ARN is not DNS compatible. Got ' + outpostId }); } req._parsedArn.outpostId = outpostId; }, /** * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN */ validateOutpostsAccessPointArn: function validateOutpostsAccessPointArn(req) { var parsedArn = req._parsedArn; //can be ':' or '/' var delimiter = parsedArn.resource['outpost'.length]; if (parsedArn.resource.split(delimiter).length !== 4) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Outposts ARN should have two resources outpost/{outpostId}/accesspoint/{accesspointName}' }); } var accessPoint = parsedArn.resource.split(delimiter)[3]; var accessPointPrefix = accessPoint + '-' + parsedArn.accountId; if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint }); } //set parsed valid access point req._parsedArn.accessPoint = accessPoint; }, /** * Validate region field in ARN supplied in Bucket parameter is a valid region */ validateArnRegion: function validateArnRegion(req) { var useArnRegion = s3util.loadUseArnRegionConfig(req); var regionFromArn = req._parsedArn.region; var clientRegion = req.service.config.region; if (!regionFromArn) { throw AWS.util.error(new Error(), { code: 'InvalidARN', message: 'ARN region is empty' }); } if ( clientRegion.indexOf('fips') >= 0 || regionFromArn.indexOf('fips') >= 0 ) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'ARN endpoint is not compatible with FIPS region' }); } if (!useArnRegion && regionFromArn !== clientRegion) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'Configured region conflicts with access point region' }); } else if ( useArnRegion && regionUtil.getEndpointSuffix(regionFromArn) !== regionUtil.getEndpointSuffix(clientRegion) ) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'Configured region and access point region not in same partition' }); } if (req.service.config.useAccelerateEndpoint) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'useAccelerateEndpoint config is not supported with access point ARN' }); } if (req._parsedArn.service === 's3-outposts' && req.service.config.useDualstack) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'useDualstack config is not supported with outposts access point ARN' }); } }, loadUseArnRegionConfig: function loadUseArnRegionConfig(req) { var envName = 'AWS_S3_USE_ARN_REGION'; var configName = 's3_use_arn_region'; var useArnRegion = true; var originalConfig = req.service._originalConfig || {}; if (req.service.config.s3UseArnRegion !== undefined) { return req.service.config.s3UseArnRegion; } else if (originalConfig.s3UseArnRegion !== undefined) { useArnRegion = originalConfig.s3UseArnRegion === true; } else if (AWS.util.isNode()) { //load from environmental variable AWS_USE_ARN_REGION if (process.env[envName]) { var value = process.env[envName].trim().toLowerCase(); if (['false', 'true'].indexOf(value) < 0) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: envName + ' only accepts true or false. Got ' + process.env[envName], retryable: false }); } useArnRegion = value === 'true'; } else { //load from shared config property use_arn_region var profiles = {}; var profile = {}; try { profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader); profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile]; } catch (e) {} if (profile[configName]) { if (['false', 'true'].indexOf(profile[configName].trim().toLowerCase()) < 0) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: configName + ' only accepts true or false. Got ' + profile[configName], retryable: false }); } useArnRegion = profile[configName].trim().toLowerCase() === 'true'; } } } req.service.config.s3UseArnRegion = useArnRegion; return useArnRegion; }, /** * Validations before URI can be populated */ validatePopulateUriFromArn: function validatePopulateUriFromArn(req) { if (req.service._originalConfig && req.service._originalConfig.endpoint) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'Custom endpoint is not compatible with access point ARN' }); } if (req.service.config.s3ForcePathStyle) { throw AWS.util.error(new Error(), { code: 'InvalidConfiguration', message: 'Cannot construct path-style endpoint with access point' }); } }, /** * Returns true if the bucket name is DNS compatible. Buckets created * outside of the classic region MUST be DNS compatible. * * @api private */ dnsCompatibleBucketName: function dnsCompatibleBucketName(bucketName) { var b = bucketName; var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/); var ipAddress = new RegExp(/(\d+\.){3}\d+/); var dots = new RegExp(/\.\./); return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false; }, }; /** * @api private */ module.exports = s3util; /***/ }), /***/ 94571: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.update(AWS.SQS.prototype, { /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('build', this.buildEndpoint); if (request.service.config.computeChecksums) { if (request.operation === 'sendMessage') { request.addListener('extractData', this.verifySendMessageChecksum); } else if (request.operation === 'sendMessageBatch') { request.addListener('extractData', this.verifySendMessageBatchChecksum); } else if (request.operation === 'receiveMessage') { request.addListener('extractData', this.verifyReceiveMessageChecksum); } } }, /** * @api private */ verifySendMessageChecksum: function verifySendMessageChecksum(response) { if (!response.data) return; var md5 = response.data.MD5OfMessageBody; var body = this.params.MessageBody; var calculatedMd5 = this.service.calculateChecksum(body); if (calculatedMd5 !== md5) { var msg = 'Got "' + response.data.MD5OfMessageBody + '", expecting "' + calculatedMd5 + '".'; this.service.throwInvalidChecksumError(response, [response.data.MessageId], msg); } }, /** * @api private */ verifySendMessageBatchChecksum: function verifySendMessageBatchChecksum(response) { if (!response.data) return; var service = this.service; var entries = {}; var errors = []; var messageIds = []; AWS.util.arrayEach(response.data.Successful, function (entry) { entries[entry.Id] = entry; }); AWS.util.arrayEach(this.params.Entries, function (entry) { if (entries[entry.Id]) { var md5 = entries[entry.Id].MD5OfMessageBody; var body = entry.MessageBody; if (!service.isChecksumValid(md5, body)) { errors.push(entry.Id); messageIds.push(entries[entry.Id].MessageId); } } }); if (errors.length > 0) { service.throwInvalidChecksumError(response, messageIds, 'Invalid messages: ' + errors.join(', ')); } }, /** * @api private */ verifyReceiveMessageChecksum: function verifyReceiveMessageChecksum(response) { if (!response.data) return; var service = this.service; var messageIds = []; AWS.util.arrayEach(response.data.Messages, function(message) { var md5 = message.MD5OfBody; var body = message.Body; if (!service.isChecksumValid(md5, body)) { messageIds.push(message.MessageId); } }); if (messageIds.length > 0) { service.throwInvalidChecksumError(response, messageIds, 'Invalid messages: ' + messageIds.join(', ')); } }, /** * @api private */ throwInvalidChecksumError: function throwInvalidChecksumError(response, ids, message) { response.error = AWS.util.error(new Error(), { retryable: true, code: 'InvalidChecksum', messageIds: ids, message: response.request.operation + ' returned an invalid MD5 response. ' + message }); }, /** * @api private */ isChecksumValid: function isChecksumValid(checksum, data) { return this.calculateChecksum(data) === checksum; }, /** * @api private */ calculateChecksum: function calculateChecksum(data) { return AWS.util.crypto.md5(data, 'hex'); }, /** * @api private */ buildEndpoint: function buildEndpoint(request) { var url = request.httpRequest.params.QueueUrl; if (url) { request.httpRequest.endpoint = new AWS.Endpoint(url); // signature version 4 requires the region name to be set, // sqs queue urls contain the region name var matches = request.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./); if (matches) request.httpRequest.region = matches[1]; } } }); /***/ }), /***/ 91055: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var resolveRegionalEndpointsFlag = __webpack_require__(85566); var ENV_REGIONAL_ENDPOINT_ENABLED = 'AWS_STS_REGIONAL_ENDPOINTS'; var CONFIG_REGIONAL_ENDPOINT_ENABLED = 'sts_regional_endpoints'; AWS.util.update(AWS.STS.prototype, { /** * @overload credentialsFrom(data, credentials = null) * Creates a credentials object from STS response data containing * credentials information. Useful for quickly setting AWS credentials. * * @note This is a low-level utility function. If you want to load temporary * credentials into your process for subsequent requests to AWS resources, * you should use {AWS.TemporaryCredentials} instead. * @param data [map] data retrieved from a call to {getFederatedToken}, * {getSessionToken}, {assumeRole}, or {assumeRoleWithWebIdentity}. * @param credentials [AWS.Credentials] an optional credentials object to * fill instead of creating a new object. Useful when modifying an * existing credentials object from a refresh call. * @return [AWS.TemporaryCredentials] the set of temporary credentials * loaded from a raw STS operation response. * @example Using credentialsFrom to load global AWS credentials * var sts = new AWS.STS(); * sts.getSessionToken(function (err, data) { * if (err) console.log("Error getting credentials"); * else { * AWS.config.credentials = sts.credentialsFrom(data); * } * }); * @see AWS.TemporaryCredentials */ credentialsFrom: function credentialsFrom(data, credentials) { if (!data) return null; if (!credentials) credentials = new AWS.TemporaryCredentials(); credentials.expired = false; credentials.accessKeyId = data.Credentials.AccessKeyId; credentials.secretAccessKey = data.Credentials.SecretAccessKey; credentials.sessionToken = data.Credentials.SessionToken; credentials.expireTime = data.Credentials.Expiration; return credentials; }, assumeRoleWithWebIdentity: function assumeRoleWithWebIdentity(params, callback) { return this.makeUnauthenticatedRequest('assumeRoleWithWebIdentity', params, callback); }, assumeRoleWithSAML: function assumeRoleWithSAML(params, callback) { return this.makeUnauthenticatedRequest('assumeRoleWithSAML', params, callback); }, /** * @api private */ setupRequestListeners: function setupRequestListeners(request) { request.addListener('validate', this.optInRegionalEndpoint, true); }, /** * @api private */ optInRegionalEndpoint: function optInRegionalEndpoint(req) { var service = req.service; var config = service.config; config.stsRegionalEndpoints = resolveRegionalEndpointsFlag(service._originalConfig, { env: ENV_REGIONAL_ENDPOINT_ENABLED, sharedConfig: CONFIG_REGIONAL_ENDPOINT_ENABLED, clientConfig: 'stsRegionalEndpoints' }); if ( config.stsRegionalEndpoints === 'regional' && service.isGlobalEndpoint ) { //client will throw if region is not supplied; request will be signed with specified region if (!config.region) { throw AWS.util.error(new Error(), {code: 'ConfigError', message: 'Missing region in config'}); } var insertPoint = config.endpoint.indexOf('.amazonaws.com'); var regionalEndpoint = config.endpoint.substring(0, insertPoint) + '.' + config.region + config.endpoint.substring(insertPoint); req.httpRequest.updateEndpoint(regionalEndpoint); req.httpRequest.region = config.region; } } }); /***/ }), /***/ 31987: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); AWS.util.hideProperties(AWS, ['SimpleWorkflow']); /** * @constant * @readonly * Backwards compatibility for access to the {AWS.SWF} service class. */ AWS.SimpleWorkflow = AWS.SWF; /***/ }), /***/ 29697: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var IniLoader = __webpack_require__(95417).IniLoader; /** * Singleton object to load specified config/credentials files. * It will cache all the files ever loaded; */ module.exports.b = new IniLoader(); /***/ }), /***/ 95417: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var os = __webpack_require__(12087); var path = __webpack_require__(85622); function parseFile(filename, isConfig) { var content = AWS.util.ini.parse(AWS.util.readFileSync(filename)); var tmpContent = {}; Object.keys(content).forEach(function(profileName) { var profileContent = content[profileName]; profileName = isConfig ? profileName.replace(/^profile\s/, '') : profileName; Object.defineProperty(tmpContent, profileName, { value: profileContent, enumerable: true }); }); return tmpContent; } /** * Ini file loader class the same as that used in the SDK. It loads and * parses config and credentials files in .ini format and cache the content * to assure files are only read once. * Note that calling operations on the instance instantiated from this class * won't affect the behavior of SDK since SDK uses an internal singleton of * this class. * @!macro nobrowser */ AWS.IniLoader = AWS.util.inherit({ constructor: function IniLoader() { this.resolvedProfiles = {}; }, /** Remove all cached files. Used after config files are updated. */ clearCachedFiles: function clearCachedFiles() { this.resolvedProfiles = {}; }, /** * Load configurations from config/credentials files and cache them * for later use. If no file is specified it will try to load default * files. * @param options [map] information describing the file * @option options filename [String] ('~/.aws/credentials' or defined by * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if * isConfig is set to true) * path to the file to be read. * @option options isConfig [Boolean] (false) True to read config file. * @return [map] object containing contents from file in key-value * pairs. */ loadFrom: function loadFrom(options) { options = options || {}; var isConfig = options.isConfig === true; var filename = options.filename || this.getDefaultFilePath(isConfig); if (!this.resolvedProfiles[filename]) { var fileContent = this.parseFile(filename, isConfig); Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent }); } return this.resolvedProfiles[filename]; }, /** * @api private */ parseFile: parseFile, /** * @api private */ getDefaultFilePath: function getDefaultFilePath(isConfig) { return path.join( this.getHomeDir(), '.aws', isConfig ? 'config' : 'credentials' ); }, /** * @api private */ getHomeDir: function getHomeDir() { var env = process.env; var home = env.HOME || env.USERPROFILE || (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null); if (home) { return home; } if (typeof os.homedir === 'function') { return os.homedir(); } throw AWS.util.error( new Error('Cannot load credentials, HOME path not set') ); } }); var IniLoader = AWS.IniLoader; module.exports = { IniLoader: IniLoader, parseFile: parseFile, }; /***/ }), /***/ 60328: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ var expiresHeader = 'presigned-expires'; /** * @api private */ function signedUrlBuilder(request) { var expires = request.httpRequest.headers[expiresHeader]; var signerClass = request.service.getSignerClass(request); delete request.httpRequest.headers['User-Agent']; delete request.httpRequest.headers['X-Amz-User-Agent']; if (signerClass === AWS.Signers.V4) { if (expires > 604800) { // one week expiry is invalid var message = 'Presigning does not support expiry time greater ' + 'than a week with SigV4 signing.'; throw AWS.util.error(new Error(), { code: 'InvalidExpiryTime', message: message, retryable: false }); } request.httpRequest.headers[expiresHeader] = expires; } else if (signerClass === AWS.Signers.S3) { var now = request.service ? request.service.getSkewCorrectedDate() : AWS.util.date.getDate(); request.httpRequest.headers[expiresHeader] = parseInt( AWS.util.date.unixTimestamp(now) + expires, 10).toString(); } else { throw AWS.util.error(new Error(), { message: 'Presigning only supports S3 or SigV4 signing.', code: 'UnsupportedSigner', retryable: false }); } } /** * @api private */ function signedUrlSigner(request) { var endpoint = request.httpRequest.endpoint; var parsedUrl = AWS.util.urlParse(request.httpRequest.path); var queryParams = {}; if (parsedUrl.search) { queryParams = AWS.util.queryStringParse(parsedUrl.search.substr(1)); } var auth = request.httpRequest.headers['Authorization'].split(' '); if (auth[0] === 'AWS') { auth = auth[1].split(':'); queryParams['Signature'] = auth.pop(); queryParams['AWSAccessKeyId'] = auth.join(':'); AWS.util.each(request.httpRequest.headers, function (key, value) { if (key === expiresHeader) key = 'Expires'; if (key.indexOf('x-amz-meta-') === 0) { // Delete existing, potentially not normalized key delete queryParams[key]; key = key.toLowerCase(); } queryParams[key] = value; }); delete request.httpRequest.headers[expiresHeader]; delete queryParams['Authorization']; delete queryParams['Host']; } else if (auth[0] === 'AWS4-HMAC-SHA256') { // SigV4 signing auth.shift(); var rest = auth.join(' '); var signature = rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1]; queryParams['X-Amz-Signature'] = signature; delete queryParams['Expires']; } // build URL endpoint.pathname = parsedUrl.pathname; endpoint.search = AWS.util.queryParamsToString(queryParams); } /** * @api private */ AWS.Signers.Presign = inherit({ /** * @api private */ sign: function sign(request, expireTime, callback) { request.httpRequest.headers[expiresHeader] = expireTime || 3600; request.on('build', signedUrlBuilder); request.on('sign', signedUrlSigner); request.removeListener('afterBuild', AWS.EventListeners.Core.SET_CONTENT_LENGTH); request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256); request.emit('beforePresign', [request]); if (callback) { request.build(function() { if (this.response.error) callback(this.response.error); else { callback(null, AWS.util.urlFormat(request.httpRequest.endpoint)); } }); } else { request.build(); if (request.response.error) throw request.response.error; return AWS.util.urlFormat(request.httpRequest.endpoint); } } }); /** * @api private */ module.exports = AWS.Signers.Presign; /***/ }), /***/ 9897: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ AWS.Signers.RequestSigner = inherit({ constructor: function RequestSigner(request) { this.request = request; }, setServiceClientId: function setServiceClientId(id) { this.serviceClientId = id; }, getServiceClientId: function getServiceClientId() { return this.serviceClientId; } }); AWS.Signers.RequestSigner.getVersion = function getVersion(version) { switch (version) { case 'v2': return AWS.Signers.V2; case 'v3': return AWS.Signers.V3; case 's3v4': return AWS.Signers.V4; case 'v4': return AWS.Signers.V4; case 's3': return AWS.Signers.S3; case 'v3https': return AWS.Signers.V3Https; } throw new Error('Unknown signing version ' + version); }; __webpack_require__(28489); __webpack_require__(66458); __webpack_require__(24473); __webpack_require__(26529); __webpack_require__(58616); __webpack_require__(60328); /***/ }), /***/ 58616: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ AWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, { /** * When building the stringToSign, these sub resource params should be * part of the canonical resource string with their NON-decoded values */ subResources: { 'acl': 1, 'accelerate': 1, 'analytics': 1, 'cors': 1, 'lifecycle': 1, 'delete': 1, 'inventory': 1, 'location': 1, 'logging': 1, 'metrics': 1, 'notification': 1, 'partNumber': 1, 'policy': 1, 'requestPayment': 1, 'replication': 1, 'restore': 1, 'tagging': 1, 'torrent': 1, 'uploadId': 1, 'uploads': 1, 'versionId': 1, 'versioning': 1, 'versions': 1, 'website': 1 }, // when building the stringToSign, these querystring params should be // part of the canonical resource string with their NON-encoded values responseHeaders: { 'response-content-type': 1, 'response-content-language': 1, 'response-expires': 1, 'response-cache-control': 1, 'response-content-disposition': 1, 'response-content-encoding': 1 }, addAuthorization: function addAuthorization(credentials, date) { if (!this.request.headers['presigned-expires']) { this.request.headers['X-Amz-Date'] = AWS.util.date.rfc822(date); } if (credentials.sessionToken) { // presigned URLs require this header to be lowercased this.request.headers['x-amz-security-token'] = credentials.sessionToken; } var signature = this.sign(credentials.secretAccessKey, this.stringToSign()); var auth = 'AWS ' + credentials.accessKeyId + ':' + signature; this.request.headers['Authorization'] = auth; }, stringToSign: function stringToSign() { var r = this.request; var parts = []; parts.push(r.method); parts.push(r.headers['Content-MD5'] || ''); parts.push(r.headers['Content-Type'] || ''); // This is the "Date" header, but we use X-Amz-Date. // The S3 signing mechanism requires us to pass an empty // string for this Date header regardless. parts.push(r.headers['presigned-expires'] || ''); var headers = this.canonicalizedAmzHeaders(); if (headers) parts.push(headers); parts.push(this.canonicalizedResource()); return parts.join('\n'); }, canonicalizedAmzHeaders: function canonicalizedAmzHeaders() { var amzHeaders = []; AWS.util.each(this.request.headers, function (name) { if (name.match(/^x-amz-/i)) amzHeaders.push(name); }); amzHeaders.sort(function (a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1; }); var parts = []; AWS.util.arrayEach.call(this, amzHeaders, function (name) { parts.push(name.toLowerCase() + ':' + String(this.request.headers[name])); }); return parts.join('\n'); }, canonicalizedResource: function canonicalizedResource() { var r = this.request; var parts = r.path.split('?'); var path = parts[0]; var querystring = parts[1]; var resource = ''; if (r.virtualHostedBucket) resource += '/' + r.virtualHostedBucket; resource += path; if (querystring) { // collect a list of sub resources and query params that need to be signed var resources = []; AWS.util.arrayEach.call(this, querystring.split('&'), function (param) { var name = param.split('=')[0]; var value = param.split('=')[1]; if (this.subResources[name] || this.responseHeaders[name]) { var subresource = { name: name }; if (value !== undefined) { if (this.subResources[name]) { subresource.value = value; } else { subresource.value = decodeURIComponent(value); } } resources.push(subresource); } }); resources.sort(function (a, b) { return a.name < b.name ? -1 : 1; }); if (resources.length) { querystring = []; AWS.util.arrayEach(resources, function (res) { if (res.value === undefined) { querystring.push(res.name); } else { querystring.push(res.name + '=' + res.value); } }); resource += '?' + querystring.join('&'); } } return resource; }, sign: function sign(secret, string) { return AWS.util.crypto.hmac(secret, string, 'base64', 'sha1'); } }); /** * @api private */ module.exports = AWS.Signers.S3; /***/ }), /***/ 28489: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ AWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, { addAuthorization: function addAuthorization(credentials, date) { if (!date) date = AWS.util.date.getDate(); var r = this.request; r.params.Timestamp = AWS.util.date.iso8601(date); r.params.SignatureVersion = '2'; r.params.SignatureMethod = 'HmacSHA256'; r.params.AWSAccessKeyId = credentials.accessKeyId; if (credentials.sessionToken) { r.params.SecurityToken = credentials.sessionToken; } delete r.params.Signature; // delete old Signature for re-signing r.params.Signature = this.signature(credentials); r.body = AWS.util.queryParamsToString(r.params); r.headers['Content-Length'] = r.body.length; }, signature: function signature(credentials) { return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); }, stringToSign: function stringToSign() { var parts = []; parts.push(this.request.method); parts.push(this.request.endpoint.host.toLowerCase()); parts.push(this.request.pathname()); parts.push(AWS.util.queryParamsToString(this.request.params)); return parts.join('\n'); } }); /** * @api private */ module.exports = AWS.Signers.V2; /***/ }), /***/ 66458: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; /** * @api private */ AWS.Signers.V3 = inherit(AWS.Signers.RequestSigner, { addAuthorization: function addAuthorization(credentials, date) { var datetime = AWS.util.date.rfc822(date); this.request.headers['X-Amz-Date'] = datetime; if (credentials.sessionToken) { this.request.headers['x-amz-security-token'] = credentials.sessionToken; } this.request.headers['X-Amzn-Authorization'] = this.authorization(credentials, datetime); }, authorization: function authorization(credentials) { return 'AWS3 ' + 'AWSAccessKeyId=' + credentials.accessKeyId + ',' + 'Algorithm=HmacSHA256,' + 'SignedHeaders=' + this.signedHeaders() + ',' + 'Signature=' + this.signature(credentials); }, signedHeaders: function signedHeaders() { var headers = []; AWS.util.arrayEach(this.headersToSign(), function iterator(h) { headers.push(h.toLowerCase()); }); return headers.sort().join(';'); }, canonicalHeaders: function canonicalHeaders() { var headers = this.request.headers; var parts = []; AWS.util.arrayEach(this.headersToSign(), function iterator(h) { parts.push(h.toLowerCase().trim() + ':' + String(headers[h]).trim()); }); return parts.sort().join('\n') + '\n'; }, headersToSign: function headersToSign() { var headers = []; AWS.util.each(this.request.headers, function iterator(k) { if (k === 'Host' || k === 'Content-Encoding' || k.match(/^X-Amz/i)) { headers.push(k); } }); return headers; }, signature: function signature(credentials) { return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64'); }, stringToSign: function stringToSign() { var parts = []; parts.push(this.request.method); parts.push('/'); parts.push(''); parts.push(this.canonicalHeaders()); parts.push(this.request.body); return AWS.util.crypto.sha256(parts.join('\n')); } }); /** * @api private */ module.exports = AWS.Signers.V3; /***/ }), /***/ 24473: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var inherit = AWS.util.inherit; __webpack_require__(66458); /** * @api private */ AWS.Signers.V3Https = inherit(AWS.Signers.V3, { authorization: function authorization(credentials) { return 'AWS3-HTTPS ' + 'AWSAccessKeyId=' + credentials.accessKeyId + ',' + 'Algorithm=HmacSHA256,' + 'Signature=' + this.signature(credentials); }, stringToSign: function stringToSign() { return this.request.headers['X-Amz-Date']; } }); /** * @api private */ module.exports = AWS.Signers.V3Https; /***/ }), /***/ 26529: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var v4Credentials = __webpack_require__(62660); var inherit = AWS.util.inherit; /** * @api private */ var expiresHeader = 'presigned-expires'; /** * @api private */ AWS.Signers.V4 = inherit(AWS.Signers.RequestSigner, { constructor: function V4(request, serviceName, options) { AWS.Signers.RequestSigner.call(this, request); this.serviceName = serviceName; options = options || {}; this.signatureCache = typeof options.signatureCache === 'boolean' ? options.signatureCache : true; this.operation = options.operation; this.signatureVersion = options.signatureVersion; }, algorithm: 'AWS4-HMAC-SHA256', addAuthorization: function addAuthorization(credentials, date) { var datetime = AWS.util.date.iso8601(date).replace(/[:\-]|\.\d{3}/g, ''); if (this.isPresigned()) { this.updateForPresigned(credentials, datetime); } else { this.addHeaders(credentials, datetime); } this.request.headers['Authorization'] = this.authorization(credentials, datetime); }, addHeaders: function addHeaders(credentials, datetime) { this.request.headers['X-Amz-Date'] = datetime; if (credentials.sessionToken) { this.request.headers['x-amz-security-token'] = credentials.sessionToken; } }, updateForPresigned: function updateForPresigned(credentials, datetime) { var credString = this.credentialString(datetime); var qs = { 'X-Amz-Date': datetime, 'X-Amz-Algorithm': this.algorithm, 'X-Amz-Credential': credentials.accessKeyId + '/' + credString, 'X-Amz-Expires': this.request.headers[expiresHeader], 'X-Amz-SignedHeaders': this.signedHeaders() }; if (credentials.sessionToken) { qs['X-Amz-Security-Token'] = credentials.sessionToken; } if (this.request.headers['Content-Type']) { qs['Content-Type'] = this.request.headers['Content-Type']; } if (this.request.headers['Content-MD5']) { qs['Content-MD5'] = this.request.headers['Content-MD5']; } if (this.request.headers['Cache-Control']) { qs['Cache-Control'] = this.request.headers['Cache-Control']; } // need to pull in any other X-Amz-* headers AWS.util.each.call(this, this.request.headers, function(key, value) { if (key === expiresHeader) return; if (this.isSignableHeader(key)) { var lowerKey = key.toLowerCase(); // Metadata should be normalized if (lowerKey.indexOf('x-amz-meta-') === 0) { qs[lowerKey] = value; } else if (lowerKey.indexOf('x-amz-') === 0) { qs[key] = value; } } }); var sep = this.request.path.indexOf('?') >= 0 ? '&' : '?'; this.request.path += sep + AWS.util.queryParamsToString(qs); }, authorization: function authorization(credentials, datetime) { var parts = []; var credString = this.credentialString(datetime); parts.push(this.algorithm + ' Credential=' + credentials.accessKeyId + '/' + credString); parts.push('SignedHeaders=' + this.signedHeaders()); parts.push('Signature=' + this.signature(credentials, datetime)); return parts.join(', '); }, signature: function signature(credentials, datetime) { var signingKey = v4Credentials.getSigningKey( credentials, datetime.substr(0, 8), this.request.region, this.serviceName, this.signatureCache ); return AWS.util.crypto.hmac(signingKey, this.stringToSign(datetime), 'hex'); }, stringToSign: function stringToSign(datetime) { var parts = []; parts.push('AWS4-HMAC-SHA256'); parts.push(datetime); parts.push(this.credentialString(datetime)); parts.push(this.hexEncodedHash(this.canonicalString())); return parts.join('\n'); }, canonicalString: function canonicalString() { var parts = [], pathname = this.request.pathname(); if (this.serviceName !== 's3' && this.signatureVersion !== 's3v4') pathname = AWS.util.uriEscapePath(pathname); parts.push(this.request.method); parts.push(pathname); parts.push(this.request.search()); parts.push(this.canonicalHeaders() + '\n'); parts.push(this.signedHeaders()); parts.push(this.hexEncodedBodyHash()); return parts.join('\n'); }, canonicalHeaders: function canonicalHeaders() { var headers = []; AWS.util.each.call(this, this.request.headers, function (key, item) { headers.push([key, item]); }); headers.sort(function (a, b) { return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : 1; }); var parts = []; AWS.util.arrayEach.call(this, headers, function (item) { var key = item[0].toLowerCase(); if (this.isSignableHeader(key)) { var value = item[1]; if (typeof value === 'undefined' || value === null || typeof value.toString !== 'function') { throw AWS.util.error(new Error('Header ' + key + ' contains invalid value'), { code: 'InvalidHeader' }); } parts.push(key + ':' + this.canonicalHeaderValues(value.toString())); } }); return parts.join('\n'); }, canonicalHeaderValues: function canonicalHeaderValues(values) { return values.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, ''); }, signedHeaders: function signedHeaders() { var keys = []; AWS.util.each.call(this, this.request.headers, function (key) { key = key.toLowerCase(); if (this.isSignableHeader(key)) keys.push(key); }); return keys.sort().join(';'); }, credentialString: function credentialString(datetime) { return v4Credentials.createScope( datetime.substr(0, 8), this.request.region, this.serviceName ); }, hexEncodedHash: function hash(string) { return AWS.util.crypto.sha256(string, 'hex'); }, hexEncodedBodyHash: function hexEncodedBodyHash() { var request = this.request; if (this.isPresigned() && this.serviceName === 's3' && !request.body) { return 'UNSIGNED-PAYLOAD'; } else if (request.headers['X-Amz-Content-Sha256']) { return request.headers['X-Amz-Content-Sha256']; } else { return this.hexEncodedHash(this.request.body || ''); } }, unsignableHeaders: [ 'authorization', 'content-type', 'content-length', 'user-agent', expiresHeader, 'expect', 'x-amzn-trace-id' ], isSignableHeader: function isSignableHeader(key) { if (key.toLowerCase().indexOf('x-amz-') === 0) return true; return this.unsignableHeaders.indexOf(key) < 0; }, isPresigned: function isPresigned() { return this.request.headers[expiresHeader] ? true : false; } }); /** * @api private */ module.exports = AWS.Signers.V4; /***/ }), /***/ 62660: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); /** * @api private */ var cachedSecret = {}; /** * @api private */ var cacheQueue = []; /** * @api private */ var maxCacheEntries = 50; /** * @api private */ var v4Identifier = 'aws4_request'; /** * @api private */ module.exports = { /** * @api private * * @param date [String] * @param region [String] * @param serviceName [String] * @return [String] */ createScope: function createScope(date, region, serviceName) { return [ date.substr(0, 8), region, serviceName, v4Identifier ].join('/'); }, /** * @api private * * @param credentials [Credentials] * @param date [String] * @param region [String] * @param service [String] * @param shouldCache [Boolean] * @return [String] */ getSigningKey: function getSigningKey( credentials, date, region, service, shouldCache ) { var credsIdentifier = AWS.util.crypto .hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64'); var cacheKey = [credsIdentifier, date, region, service].join('_'); shouldCache = shouldCache !== false; if (shouldCache && (cacheKey in cachedSecret)) { return cachedSecret[cacheKey]; } var kDate = AWS.util.crypto.hmac( 'AWS4' + credentials.secretAccessKey, date, 'buffer' ); var kRegion = AWS.util.crypto.hmac(kDate, region, 'buffer'); var kService = AWS.util.crypto.hmac(kRegion, service, 'buffer'); var signingKey = AWS.util.crypto.hmac(kService, v4Identifier, 'buffer'); if (shouldCache) { cachedSecret[cacheKey] = signingKey; cacheQueue.push(cacheKey); if (cacheQueue.length > maxCacheEntries) { // remove the oldest entry (not the least recently used) delete cachedSecret[cacheQueue.shift()]; } } return signingKey; }, /** * @api private * * Empties the derived signing key cache. Made available for testing purposes * only. */ emptyCache: function emptyCache() { cachedSecret = {}; cacheQueue = []; } }; /***/ }), /***/ 68118: /***/ ((module) => { function AcceptorStateMachine(states, state) { this.currentState = state || null; this.states = states || {}; } AcceptorStateMachine.prototype.runTo = function runTo(finalState, done, bindObject, inputError) { if (typeof finalState === 'function') { inputError = bindObject; bindObject = done; done = finalState; finalState = null; } var self = this; var state = self.states[self.currentState]; state.fn.call(bindObject || self, inputError, function(err) { if (err) { if (state.fail) self.currentState = state.fail; else return done ? done.call(bindObject, err) : null; } else { if (state.accept) self.currentState = state.accept; else return done ? done.call(bindObject) : null; } if (self.currentState === finalState) { return done ? done.call(bindObject, err) : null; } self.runTo(finalState, done, bindObject, err); }); }; AcceptorStateMachine.prototype.addState = function addState(name, acceptState, failState, fn) { if (typeof acceptState === 'function') { fn = acceptState; acceptState = null; failState = null; } else if (typeof failState === 'function') { fn = failState; failState = null; } if (!this.currentState) this.currentState = name; this.states[name] = { accept: acceptState, fail: failState, fn: fn }; return this; }; /** * @api private */ module.exports = AcceptorStateMachine; /***/ }), /***/ 77985: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint guard-for-in:0 */ var AWS; /** * A set of utility methods for use with the AWS SDK. * * @!attribute abort * Return this value from an iterator function {each} or {arrayEach} * to break out of the iteration. * @example Breaking out of an iterator function * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) { * if (key == 'b') return AWS.util.abort; * }); * @see each * @see arrayEach * @api private */ var util = { environment: 'nodejs', engine: function engine() { if (util.isBrowser() && typeof navigator !== 'undefined') { return navigator.userAgent; } else { var engine = process.platform + '/' + process.version; if (process.env.AWS_EXECUTION_ENV) { engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV; } return engine; } }, userAgent: function userAgent() { var name = util.environment; var agent = 'aws-sdk-' + name + '/' + __webpack_require__(28437).VERSION; if (name === 'nodejs') agent += ' ' + util.engine(); return agent; }, uriEscape: function uriEscape(string) { var output = encodeURIComponent(string); output = output.replace(/[^A-Za-z0-9_.~\-%]+/g, escape); // AWS percent-encodes some extra non-standard characters in a URI output = output.replace(/[*]/g, function(ch) { return '%' + ch.charCodeAt(0).toString(16).toUpperCase(); }); return output; }, uriEscapePath: function uriEscapePath(string) { var parts = []; util.arrayEach(string.split('/'), function (part) { parts.push(util.uriEscape(part)); }); return parts.join('/'); }, urlParse: function urlParse(url) { return util.url.parse(url); }, urlFormat: function urlFormat(url) { return util.url.format(url); }, queryStringParse: function queryStringParse(qs) { return util.querystring.parse(qs); }, queryParamsToString: function queryParamsToString(params) { var items = []; var escape = util.uriEscape; var sortedKeys = Object.keys(params).sort(); util.arrayEach(sortedKeys, function(name) { var value = params[name]; var ename = escape(name); var result = ename + '='; if (Array.isArray(value)) { var vals = []; util.arrayEach(value, function(item) { vals.push(escape(item)); }); result = ename + '=' + vals.sort().join('&' + ename + '='); } else if (value !== undefined && value !== null) { result = ename + '=' + escape(value); } items.push(result); }); return items.join('&'); }, readFileSync: function readFileSync(path) { if (util.isBrowser()) return null; return __webpack_require__(35747).readFileSync(path, 'utf-8'); }, base64: { encode: function encode64(string) { if (typeof string === 'number') { throw util.error(new Error('Cannot base64 encode number ' + string)); } if (string === null || typeof string === 'undefined') { return string; } var buf = util.buffer.toBuffer(string); return buf.toString('base64'); }, decode: function decode64(string) { if (typeof string === 'number') { throw util.error(new Error('Cannot base64 decode number ' + string)); } if (string === null || typeof string === 'undefined') { return string; } return util.buffer.toBuffer(string, 'base64'); } }, buffer: { /** * Buffer constructor for Node buffer and buffer pollyfill */ toBuffer: function(data, encoding) { return (typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from) ? util.Buffer.from(data, encoding) : new util.Buffer(data, encoding); }, alloc: function(size, fill, encoding) { if (typeof size !== 'number') { throw new Error('size passed to alloc must be a number.'); } if (typeof util.Buffer.alloc === 'function') { return util.Buffer.alloc(size, fill, encoding); } else { var buf = new util.Buffer(size); if (fill !== undefined && typeof buf.fill === 'function') { buf.fill(fill, undefined, undefined, encoding); } return buf; } }, toStream: function toStream(buffer) { if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer); var readable = new (util.stream.Readable)(); var pos = 0; readable._read = function(size) { if (pos >= buffer.length) return readable.push(null); var end = pos + size; if (end > buffer.length) end = buffer.length; readable.push(buffer.slice(pos, end)); pos = end; }; return readable; }, /** * Concatenates a list of Buffer objects. */ concat: function(buffers) { var length = 0, offset = 0, buffer = null, i; for (i = 0; i < buffers.length; i++) { length += buffers[i].length; } buffer = util.buffer.alloc(length); for (i = 0; i < buffers.length; i++) { buffers[i].copy(buffer, offset); offset += buffers[i].length; } return buffer; } }, string: { byteLength: function byteLength(string) { if (string === null || string === undefined) return 0; if (typeof string === 'string') string = util.buffer.toBuffer(string); if (typeof string.byteLength === 'number') { return string.byteLength; } else if (typeof string.length === 'number') { return string.length; } else if (typeof string.size === 'number') { return string.size; } else if (typeof string.path === 'string') { return __webpack_require__(35747).lstatSync(string.path).size; } else { throw util.error(new Error('Cannot determine length of ' + string), { object: string }); } }, upperFirst: function upperFirst(string) { return string[0].toUpperCase() + string.substr(1); }, lowerFirst: function lowerFirst(string) { return string[0].toLowerCase() + string.substr(1); } }, ini: { parse: function string(ini) { var currentSection, map = {}; util.arrayEach(ini.split(/\r?\n/), function(line) { line = line.split(/(^|\s)[;#]/)[0]; // remove comments var section = line.match(/^\s*\[([^\[\]]+)\]\s*$/); if (section) { currentSection = section[1]; if (currentSection === '__proto__' || currentSection.split(/\s/)[1] === '__proto__') { throw util.error( new Error('Cannot load profile name \'' + currentSection + '\' from shared ini file.') ); } } else if (currentSection) { var item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/); if (item) { map[currentSection] = map[currentSection] || {}; map[currentSection][item[1]] = item[2]; } } }); return map; } }, fn: { noop: function() {}, callback: function (err) { if (err) throw err; }, /** * Turn a synchronous function into as "async" function by making it call * a callback. The underlying function is called with all but the last argument, * which is treated as the callback. The callback is passed passed a first argument * of null on success to mimick standard node callbacks. */ makeAsync: function makeAsync(fn, expectedArgs) { if (expectedArgs && expectedArgs <= fn.length) { return fn; } return function() { var args = Array.prototype.slice.call(arguments, 0); var callback = args.pop(); var result = fn.apply(null, args); callback(result); }; } }, /** * Date and time utility functions. */ date: { /** * @return [Date] the current JavaScript date object. Since all * AWS services rely on this date object, you can override * this function to provide a special time value to AWS service * requests. */ getDate: function getDate() { if (!AWS) AWS = __webpack_require__(28437); if (AWS.config.systemClockOffset) { // use offset when non-zero return new Date(new Date().getTime() + AWS.config.systemClockOffset); } else { return new Date(); } }, /** * @return [String] the date in ISO-8601 format */ iso8601: function iso8601(date) { if (date === undefined) { date = util.date.getDate(); } return date.toISOString().replace(/\.\d{3}Z$/, 'Z'); }, /** * @return [String] the date in RFC 822 format */ rfc822: function rfc822(date) { if (date === undefined) { date = util.date.getDate(); } return date.toUTCString(); }, /** * @return [Integer] the UNIX timestamp value for the current time */ unixTimestamp: function unixTimestamp(date) { if (date === undefined) { date = util.date.getDate(); } return date.getTime() / 1000; }, /** * @param [String,number,Date] date * @return [Date] */ from: function format(date) { if (typeof date === 'number') { return new Date(date * 1000); // unix timestamp } else { return new Date(date); } }, /** * Given a Date or date-like value, this function formats the * date into a string of the requested value. * @param [String,number,Date] date * @param [String] formatter Valid formats are: # * 'iso8601' # * 'rfc822' # * 'unixTimestamp' * @return [String] */ format: function format(date, formatter) { if (!formatter) formatter = 'iso8601'; return util.date[formatter](util.date.from(date)); }, parseTimestamp: function parseTimestamp(value) { if (typeof value === 'number') { // unix timestamp (number) return new Date(value * 1000); } else if (value.match(/^\d+$/)) { // unix timestamp return new Date(value * 1000); } else if (value.match(/^\d{4}/)) { // iso8601 return new Date(value); } else if (value.match(/^\w{3},/)) { // rfc822 return new Date(value); } else { throw util.error( new Error('unhandled timestamp format: ' + value), {code: 'TimestampParserError'}); } } }, crypto: { crc32Table: [ 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D], crc32: function crc32(data) { var tbl = util.crypto.crc32Table; var crc = 0 ^ -1; if (typeof data === 'string') { data = util.buffer.toBuffer(data); } for (var i = 0; i < data.length; i++) { var code = data.readUInt8(i); crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF]; } return (crc ^ -1) >>> 0; }, hmac: function hmac(key, string, digest, fn) { if (!digest) digest = 'binary'; if (digest === 'buffer') { digest = undefined; } if (!fn) fn = 'sha256'; if (typeof string === 'string') string = util.buffer.toBuffer(string); return util.crypto.lib.createHmac(fn, key).update(string).digest(digest); }, md5: function md5(data, digest, callback) { return util.crypto.hash('md5', data, digest, callback); }, sha256: function sha256(data, digest, callback) { return util.crypto.hash('sha256', data, digest, callback); }, hash: function(algorithm, data, digest, callback) { var hash = util.crypto.createHash(algorithm); if (!digest) { digest = 'binary'; } if (digest === 'buffer') { digest = undefined; } if (typeof data === 'string') data = util.buffer.toBuffer(data); var sliceFn = util.arraySliceFn(data); var isBuffer = util.Buffer.isBuffer(data); //Identifying objects with an ArrayBuffer as buffers if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true; if (callback && typeof data === 'object' && typeof data.on === 'function' && !isBuffer) { data.on('data', function(chunk) { hash.update(chunk); }); data.on('error', function(err) { callback(err); }); data.on('end', function() { callback(null, hash.digest(digest)); }); } else if (callback && sliceFn && !isBuffer && typeof FileReader !== 'undefined') { // this might be a File/Blob var index = 0, size = 1024 * 512; var reader = new FileReader(); reader.onerror = function() { callback(new Error('Failed to read data.')); }; reader.onload = function() { var buf = new util.Buffer(new Uint8Array(reader.result)); hash.update(buf); index += buf.length; reader._continueReading(); }; reader._continueReading = function() { if (index >= data.size) { callback(null, hash.digest(digest)); return; } var back = index + size; if (back > data.size) back = data.size; reader.readAsArrayBuffer(sliceFn.call(data, index, back)); }; reader._continueReading(); } else { if (util.isBrowser() && typeof data === 'object' && !isBuffer) { data = new util.Buffer(new Uint8Array(data)); } var out = hash.update(data).digest(digest); if (callback) callback(null, out); return out; } }, toHex: function toHex(data) { var out = []; for (var i = 0; i < data.length; i++) { out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2)); } return out.join(''); }, createHash: function createHash(algorithm) { return util.crypto.lib.createHash(algorithm); } }, /** @!ignore */ /* Abort constant */ abort: {}, each: function each(object, iterFunction) { for (var key in object) { if (Object.prototype.hasOwnProperty.call(object, key)) { var ret = iterFunction.call(this, key, object[key]); if (ret === util.abort) break; } } }, arrayEach: function arrayEach(array, iterFunction) { for (var idx in array) { if (Object.prototype.hasOwnProperty.call(array, idx)) { var ret = iterFunction.call(this, array[idx], parseInt(idx, 10)); if (ret === util.abort) break; } } }, update: function update(obj1, obj2) { util.each(obj2, function iterator(key, item) { obj1[key] = item; }); return obj1; }, merge: function merge(obj1, obj2) { return util.update(util.copy(obj1), obj2); }, copy: function copy(object) { if (object === null || object === undefined) return object; var dupe = {}; // jshint forin:false for (var key in object) { dupe[key] = object[key]; } return dupe; }, isEmpty: function isEmpty(obj) { for (var prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { return false; } } return true; }, arraySliceFn: function arraySliceFn(obj) { var fn = obj.slice || obj.webkitSlice || obj.mozSlice; return typeof fn === 'function' ? fn : null; }, isType: function isType(obj, type) { // handle cross-"frame" objects if (typeof type === 'function') type = util.typeName(type); return Object.prototype.toString.call(obj) === '[object ' + type + ']'; }, typeName: function typeName(type) { if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name; var str = type.toString(); var match = str.match(/^\s*function (.+)\(/); return match ? match[1] : str; }, error: function error(err, options) { var originalError = null; if (typeof err.message === 'string' && err.message !== '') { if (typeof options === 'string' || (options && options.message)) { originalError = util.copy(err); originalError.message = err.message; } } err.message = err.message || null; if (typeof options === 'string') { err.message = options; } else if (typeof options === 'object' && options !== null) { util.update(err, options); if (options.message) err.message = options.message; if (options.code || options.name) err.code = options.code || options.name; if (options.stack) err.stack = options.stack; } if (typeof Object.defineProperty === 'function') { Object.defineProperty(err, 'name', {writable: true, enumerable: false}); Object.defineProperty(err, 'message', {enumerable: true}); } err.name = String(options && options.name || err.name || err.code || 'Error'); err.time = new Date(); if (originalError) err.originalError = originalError; return err; }, /** * @api private */ inherit: function inherit(klass, features) { var newObject = null; if (features === undefined) { features = klass; klass = Object; newObject = {}; } else { var ctor = function ConstructorWrapper() {}; ctor.prototype = klass.prototype; newObject = new ctor(); } // constructor not supplied, create pass-through ctor if (features.constructor === Object) { features.constructor = function() { if (klass !== Object) { return klass.apply(this, arguments); } }; } features.constructor.prototype = newObject; util.update(features.constructor.prototype, features); features.constructor.__super__ = klass; return features.constructor; }, /** * @api private */ mixin: function mixin() { var klass = arguments[0]; for (var i = 1; i < arguments.length; i++) { // jshint forin:false for (var prop in arguments[i].prototype) { var fn = arguments[i].prototype[prop]; if (prop !== 'constructor') { klass.prototype[prop] = fn; } } } return klass; }, /** * @api private */ hideProperties: function hideProperties(obj, props) { if (typeof Object.defineProperty !== 'function') return; util.arrayEach(props, function (key) { Object.defineProperty(obj, key, { enumerable: false, writable: true, configurable: true }); }); }, /** * @api private */ property: function property(obj, name, value, enumerable, isValue) { var opts = { configurable: true, enumerable: enumerable !== undefined ? enumerable : true }; if (typeof value === 'function' && !isValue) { opts.get = value; } else { opts.value = value; opts.writable = true; } Object.defineProperty(obj, name, opts); }, /** * @api private */ memoizedProperty: function memoizedProperty(obj, name, get, enumerable) { var cachedValue = null; // build enumerable attribute for each value with lazy accessor. util.property(obj, name, function() { if (cachedValue === null) { cachedValue = get(); } return cachedValue; }, enumerable); }, /** * TODO Remove in major version revision * This backfill populates response data without the * top-level payload name. * * @api private */ hoistPayloadMember: function hoistPayloadMember(resp) { var req = resp.request; var operationName = req.operation; var operation = req.service.api.operations[operationName]; var output = operation.output; if (output.payload && !operation.hasEventOutput) { var payloadMember = output.members[output.payload]; var responsePayload = resp.data[output.payload]; if (payloadMember.type === 'structure') { util.each(responsePayload, function(key, value) { util.property(resp.data, key, value, false); }); } } }, /** * Compute SHA-256 checksums of streams * * @api private */ computeSha256: function computeSha256(body, done) { if (util.isNode()) { var Stream = util.stream.Stream; var fs = __webpack_require__(35747); if (typeof Stream === 'function' && body instanceof Stream) { if (typeof body.path === 'string') { // assume file object var settings = {}; if (typeof body.start === 'number') { settings.start = body.start; } if (typeof body.end === 'number') { settings.end = body.end; } body = fs.createReadStream(body.path, settings); } else { // TODO support other stream types return done(new Error('Non-file stream objects are ' + 'not supported with SigV4')); } } } util.crypto.sha256(body, 'hex', function(err, sha) { if (err) done(err); else done(null, sha); }); }, /** * @api private */ isClockSkewed: function isClockSkewed(serverTime) { if (serverTime) { util.property(AWS.config, 'isClockSkewed', Math.abs(new Date().getTime() - serverTime) >= 300000, false); return AWS.config.isClockSkewed; } }, applyClockOffset: function applyClockOffset(serverTime) { if (serverTime) AWS.config.systemClockOffset = serverTime - new Date().getTime(); }, /** * @api private */ extractRequestId: function extractRequestId(resp) { var requestId = resp.httpResponse.headers['x-amz-request-id'] || resp.httpResponse.headers['x-amzn-requestid']; if (!requestId && resp.data && resp.data.ResponseMetadata) { requestId = resp.data.ResponseMetadata.RequestId; } if (requestId) { resp.requestId = requestId; } if (resp.error) { resp.error.requestId = requestId; } }, /** * @api private */ addPromises: function addPromises(constructors, PromiseDependency) { var deletePromises = false; if (PromiseDependency === undefined && AWS && AWS.config) { PromiseDependency = AWS.config.getPromisesDependency(); } if (PromiseDependency === undefined && typeof Promise !== 'undefined') { PromiseDependency = Promise; } if (typeof PromiseDependency !== 'function') deletePromises = true; if (!Array.isArray(constructors)) constructors = [constructors]; for (var ind = 0; ind < constructors.length; ind++) { var constructor = constructors[ind]; if (deletePromises) { if (constructor.deletePromisesFromClass) { constructor.deletePromisesFromClass(); } } else if (constructor.addPromisesToClass) { constructor.addPromisesToClass(PromiseDependency); } } }, /** * @api private * Return a function that will return a promise whose fate is decided by the * callback behavior of the given method with `methodName`. The method to be * promisified should conform to node.js convention of accepting a callback as * last argument and calling that callback with error as the first argument * and success value on the second argument. */ promisifyMethod: function promisifyMethod(methodName, PromiseDependency) { return function promise() { var self = this; var args = Array.prototype.slice.call(arguments); return new PromiseDependency(function(resolve, reject) { args.push(function(err, data) { if (err) { reject(err); } else { resolve(data); } }); self[methodName].apply(self, args); }); }; }, /** * @api private */ isDualstackAvailable: function isDualstackAvailable(service) { if (!service) return false; var metadata = __webpack_require__(49497); if (typeof service !== 'string') service = service.serviceIdentifier; if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false; return !!metadata[service].dualstackAvailable; }, /** * @api private */ calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions, err) { if (!retryDelayOptions) retryDelayOptions = {}; var customBackoff = retryDelayOptions.customBackoff || null; if (typeof customBackoff === 'function') { return customBackoff(retryCount, err); } var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100; var delay = Math.random() * (Math.pow(2, retryCount) * base); return delay; }, /** * @api private */ handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) { if (!options) options = {}; var http = AWS.HttpClient.getInstance(); var httpOptions = options.httpOptions || {}; var retryCount = 0; var errCallback = function(err) { var maxRetries = options.maxRetries || 0; if (err && err.code === 'TimeoutError') err.retryable = true; // Call `calculateRetryDelay()` only when relevant, see #3401 if (err && err.retryable && retryCount < maxRetries) { var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions, err); if (delay >= 0) { retryCount++; setTimeout(sendRequest, delay + (err.retryAfter || 0)); return; } } cb(err); }; var sendRequest = function() { var data = ''; http.handleRequest(httpRequest, httpOptions, function(httpResponse) { httpResponse.on('data', function(chunk) { data += chunk.toString(); }); httpResponse.on('end', function() { var statusCode = httpResponse.statusCode; if (statusCode < 300) { cb(null, data); } else { var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0; var err = util.error(new Error(), { statusCode: statusCode, retryable: statusCode >= 500 || statusCode === 429 } ); if (retryAfter && err.retryable) err.retryAfter = retryAfter; errCallback(err); } }); }, errCallback); }; AWS.util.defer(sendRequest); }, /** * @api private */ uuid: { v4: function uuidV4() { return __webpack_require__(71062).v4(); } }, /** * @api private */ convertPayloadToString: function convertPayloadToString(resp) { var req = resp.request; var operation = req.operation; var rules = req.service.api.operations[operation].output || {}; if (rules.payload && resp.data[rules.payload]) { resp.data[rules.payload] = resp.data[rules.payload].toString(); } }, /** * @api private */ defer: function defer(callback) { if (typeof process === 'object' && typeof process.nextTick === 'function') { process.nextTick(callback); } else if (typeof setImmediate === 'function') { setImmediate(callback); } else { setTimeout(callback, 0); } }, /** * @api private */ getRequestPayloadShape: function getRequestPayloadShape(req) { var operations = req.service.api.operations; if (!operations) return undefined; var operation = (operations || {})[req.operation]; if (!operation || !operation.input || !operation.input.payload) return undefined; return operation.input.members[operation.input.payload]; }, getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) { var profiles = {}; var profilesFromConfig = {}; if (process.env[util.configOptInEnv]) { var profilesFromConfig = iniLoader.loadFrom({ isConfig: true, filename: process.env[util.sharedConfigFileEnv] }); } var profilesFromCreds= {}; try { var profilesFromCreds = iniLoader.loadFrom({ filename: filename || (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv]) }); } catch (error) { // if using config, assume it is fully descriptive without a credentials file: if (!process.env[util.configOptInEnv]) throw error; } for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) { profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromConfig[profileNames[i]]); } for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) { profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromCreds[profileNames[i]]); } return profiles; /** * Roughly the semantics of `Object.assign(target, source)` */ function objectAssign(target, source) { for (var i = 0, keys = Object.keys(source); i < keys.length; i++) { target[keys[i]] = source[keys[i]]; } return target; } }, /** * @api private */ ARN: { validate: function validateARN(str) { return str && str.indexOf('arn:') === 0 && str.split(':').length >= 6; }, parse: function parseARN(arn) { var matched = arn.split(':'); return { partition: matched[1], service: matched[2], region: matched[3], accountId: matched[4], resource: matched.slice(5).join(':') }; }, build: function buildARN(arnObject) { if ( arnObject.service === undefined || arnObject.region === undefined || arnObject.accountId === undefined || arnObject.resource === undefined ) throw util.error(new Error('Input ARN object is invalid')); return 'arn:'+ (arnObject.partition || 'aws') + ':' + arnObject.service + ':' + arnObject.region + ':' + arnObject.accountId + ':' + arnObject.resource; } }, /** * @api private */ defaultProfile: 'default', /** * @api private */ configOptInEnv: 'AWS_SDK_LOAD_CONFIG', /** * @api private */ sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE', /** * @api private */ sharedConfigFileEnv: 'AWS_CONFIG_FILE', /** * @api private */ imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED' }; /** * @api private */ module.exports = util; /***/ }), /***/ 23546: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(77985); var XmlNode = __webpack_require__(20397).XmlNode; var XmlText = __webpack_require__(90971).XmlText; function XmlBuilder() { } XmlBuilder.prototype.toXML = function(params, shape, rootElement, noEmpty) { var xml = new XmlNode(rootElement); applyNamespaces(xml, shape, true); serialize(xml, params, shape); return xml.children.length > 0 || noEmpty ? xml.toString() : ''; }; function serialize(xml, value, shape) { switch (shape.type) { case 'structure': return serializeStructure(xml, value, shape); case 'map': return serializeMap(xml, value, shape); case 'list': return serializeList(xml, value, shape); default: return serializeScalar(xml, value, shape); } } function serializeStructure(xml, params, shape) { util.arrayEach(shape.memberNames, function(memberName) { var memberShape = shape.members[memberName]; if (memberShape.location !== 'body') return; var value = params[memberName]; var name = memberShape.name; if (value !== undefined && value !== null) { if (memberShape.isXmlAttribute) { xml.addAttribute(name, value); } else if (memberShape.flattened) { serialize(xml, value, memberShape); } else { var element = new XmlNode(name); xml.addChildNode(element); applyNamespaces(element, memberShape); serialize(element, value, memberShape); } } }); } function serializeMap(xml, map, shape) { var xmlKey = shape.key.name || 'key'; var xmlValue = shape.value.name || 'value'; util.each(map, function(key, value) { var entry = new XmlNode(shape.flattened ? shape.name : 'entry'); xml.addChildNode(entry); var entryKey = new XmlNode(xmlKey); var entryValue = new XmlNode(xmlValue); entry.addChildNode(entryKey); entry.addChildNode(entryValue); serialize(entryKey, key, shape.key); serialize(entryValue, value, shape.value); }); } function serializeList(xml, list, shape) { if (shape.flattened) { util.arrayEach(list, function(value) { var name = shape.member.name || shape.name; var element = new XmlNode(name); xml.addChildNode(element); serialize(element, value, shape.member); }); } else { util.arrayEach(list, function(value) { var name = shape.member.name || 'member'; var element = new XmlNode(name); xml.addChildNode(element); serialize(element, value, shape.member); }); } } function serializeScalar(xml, value, shape) { xml.addChildNode( new XmlText(shape.toWireFormat(value)) ); } function applyNamespaces(xml, shape, isRoot) { var uri, prefix = 'xmlns'; if (shape.xmlNamespaceUri) { uri = shape.xmlNamespaceUri; if (shape.xmlNamespacePrefix) prefix += ':' + shape.xmlNamespacePrefix; } else if (isRoot && shape.api.xmlNamespaceUri) { uri = shape.api.xmlNamespaceUri; } if (uri) xml.addAttribute(prefix, uri); } /** * @api private */ module.exports = XmlBuilder; /***/ }), /***/ 98241: /***/ ((module) => { /** * Escapes characters that can not be in an XML attribute. */ function escapeAttribute(value) { return value.replace(/&/g, '&').replace(/'/g, ''').replace(//g, '>').replace(/"/g, '"'); } /** * @api private */ module.exports = { escapeAttribute: escapeAttribute }; /***/ }), /***/ 98464: /***/ ((module) => { /** * Escapes characters that can not be in an XML element. */ function escapeElement(value) { return value.replace(/&/g, '&').replace(//g, '>'); } /** * @api private */ module.exports = { escapeElement: escapeElement }; /***/ }), /***/ 96752: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var AWS = __webpack_require__(28437); var util = AWS.util; var Shape = AWS.Model.Shape; var xml2js = __webpack_require__(66189); /** * @api private */ var options = { // options passed to xml2js parser explicitCharkey: false, // undocumented trim: false, // trim the leading/trailing whitespace from text nodes normalize: false, // trim interior whitespace inside text nodes explicitRoot: false, // return the root node in the resulting object? emptyTag: null, // the default value for empty nodes explicitArray: true, // always put child nodes in an array ignoreAttrs: false, // ignore attributes, only create text nodes mergeAttrs: false, // merge attributes and child elements validator: null // a callable validator }; function NodeXmlParser() { } NodeXmlParser.prototype.parse = function(xml, shape) { shape = shape || {}; var result = null; var error = null; var parser = new xml2js.Parser(options); parser.parseString(xml, function (e, r) { error = e; result = r; }); if (result) { var data = parseXml(result, shape); if (result.ResponseMetadata) { data.ResponseMetadata = parseXml(result.ResponseMetadata[0], {}); } return data; } else if (error) { throw util.error(error, {code: 'XMLParserError', retryable: true}); } else { // empty xml document return parseXml({}, shape); } }; function parseXml(xml, shape) { switch (shape.type) { case 'structure': return parseStructure(xml, shape); case 'map': return parseMap(xml, shape); case 'list': return parseList(xml, shape); case undefined: case null: return parseUnknown(xml); default: return parseScalar(xml, shape); } } function parseStructure(xml, shape) { var data = {}; if (xml === null) return data; util.each(shape.members, function(memberName, memberShape) { var xmlName = memberShape.name; if (Object.prototype.hasOwnProperty.call(xml, xmlName) && Array.isArray(xml[xmlName])) { var xmlChild = xml[xmlName]; if (!memberShape.flattened) xmlChild = xmlChild[0]; data[memberName] = parseXml(xmlChild, memberShape); } else if (memberShape.isXmlAttribute && xml.$ && Object.prototype.hasOwnProperty.call(xml.$, xmlName)) { data[memberName] = parseScalar(xml.$[xmlName], memberShape); } else if (memberShape.type === 'list' && !shape.api.xmlNoDefaultLists) { data[memberName] = memberShape.defaultValue; } }); return data; } function parseMap(xml, shape) { var data = {}; if (xml === null) return data; var xmlKey = shape.key.name || 'key'; var xmlValue = shape.value.name || 'value'; var iterable = shape.flattened ? xml : xml.entry; if (Array.isArray(iterable)) { util.arrayEach(iterable, function(child) { data[child[xmlKey][0]] = parseXml(child[xmlValue][0], shape.value); }); } return data; } function parseList(xml, shape) { var data = []; var name = shape.member.name || 'member'; if (shape.flattened) { util.arrayEach(xml, function(xmlChild) { data.push(parseXml(xmlChild, shape.member)); }); } else if (xml && Array.isArray(xml[name])) { util.arrayEach(xml[name], function(child) { data.push(parseXml(child, shape.member)); }); } return data; } function parseScalar(text, shape) { if (text && text.$ && text.$.encoding === 'base64') { shape = new Shape.create({type: text.$.encoding}); } if (text && text._) text = text._; if (typeof shape.toType === 'function') { return shape.toType(text); } else { return text; } } function parseUnknown(xml) { if (xml === undefined || xml === null) return ''; if (typeof xml === 'string') return xml; // parse a list if (Array.isArray(xml)) { var arr = []; for (i = 0; i < xml.length; i++) { arr.push(parseXml(xml[i], {})); } return arr; } // empty object var keys = Object.keys(xml), i; if (keys.length === 0 || (keys.length === 1 && keys[0] === '$')) { return {}; } // object, parse as structure var data = {}; for (i = 0; i < keys.length; i++) { var key = keys[i], value = xml[key]; if (key === '$') continue; if (value.length > 1) { // this member is a list data[key] = parseList(value, {member: {}}); } else { // this member is a single item data[key] = parseXml(value[0], {}); } } return data; } /** * @api private */ module.exports = NodeXmlParser; /***/ }), /***/ 20397: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var escapeAttribute = __webpack_require__(98241).escapeAttribute; /** * Represents an XML node. * @api private */ function XmlNode(name, children) { if (children === void 0) { children = []; } this.name = name; this.children = children; this.attributes = {}; } XmlNode.prototype.addAttribute = function (name, value) { this.attributes[name] = value; return this; }; XmlNode.prototype.addChildNode = function (child) { this.children.push(child); return this; }; XmlNode.prototype.removeAttribute = function (name) { delete this.attributes[name]; return this; }; XmlNode.prototype.toString = function () { var hasChildren = Boolean(this.children.length); var xmlText = '<' + this.name; // add attributes var attributes = this.attributes; for (var i = 0, attributeNames = Object.keys(attributes); i < attributeNames.length; i++) { var attributeName = attributeNames[i]; var attribute = attributes[attributeName]; if (typeof attribute !== 'undefined' && attribute !== null) { xmlText += ' ' + attributeName + '=\"' + escapeAttribute('' + attribute) + '\"'; } } return xmlText += !hasChildren ? '/>' : '>' + this.children.map(function (c) { return c.toString(); }).join('') + ''; }; /** * @api private */ module.exports = { XmlNode: XmlNode }; /***/ }), /***/ 90971: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var escapeElement = __webpack_require__(98464).escapeElement; /** * Represents an XML text value. * @api private */ function XmlText(value) { this.value = value; } XmlText.prototype.toString = function () { return escapeElement('' + this.value); }; /** * @api private */ module.exports = { XmlText: XmlText }; /***/ }), /***/ 71062: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var v1 = __webpack_require__(68207); var v4 = __webpack_require__(54151); var uuid = v4; uuid.v1 = v1; uuid.v4 = v4; module.exports = uuid; /***/ }), /***/ 50367: /***/ ((module) => { /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 return ([bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]]).join(''); } module.exports = bytesToUuid; /***/ }), /***/ 91734: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. var crypto = __webpack_require__(76417); module.exports = function nodeRNG() { return crypto.randomBytes(16); }; /***/ }), /***/ 68207: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var rng = __webpack_require__(91734); var bytesToUuid = __webpack_require__(50367); // **`v1()` - Generate time-based UUID** // // Inspired by https://github.com/LiosK/UUID.js // and http://docs.python.org/library/uuid.html var _nodeId; var _clockseq; // Previous uuid creation time var _lastMSecs = 0; var _lastNSecs = 0; // See https://github.com/broofa/node-uuid for API details function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var node = options.node || _nodeId; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not // specified. We do this lazily to minimize issues related to insufficient // system entropy. See #189 if (node == null || clockseq == null) { var seedBytes = rng(); if (node == null) { // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) node = _nodeId = [ seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] ]; } if (clockseq == null) { // Per 4.2.2, randomize (14 bit) clockseq clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } } // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; // Per 4.2.1.2, Bump clockseq on clock regression if (dt < 0 && options.clockseq === undefined) { clockseq = clockseq + 1 & 0x3fff; } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // time interval if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { nsecs = 0; } // Per 4.2.1.2 Throw error if too many uuids are requested if (nsecs >= 10000) { throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); } _lastMSecs = msecs; _lastNSecs = nsecs; _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch msecs += 12219292800000; // `time_low` var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; b[i++] = tl >>> 24 & 0xff; b[i++] = tl >>> 16 & 0xff; b[i++] = tl >>> 8 & 0xff; b[i++] = tl & 0xff; // `time_mid` var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; b[i++] = tmh >>> 8 & 0xff; b[i++] = tmh & 0xff; // `time_high_and_version` b[i++] = tmh >>> 24 & 0xf | 0x10; // include version b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` b[i++] = clockseq & 0xff; // `node` for (var n = 0; n < 6; ++n) { b[i + n] = node[n]; } return buf ? buf : bytesToUuid(b); } module.exports = v1; /***/ }), /***/ 54151: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var rng = __webpack_require__(91734); var bytesToUuid = __webpack_require__(50367); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }), /***/ 96323: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); var LRU_1 = __webpack_require__(77710); var CACHE_SIZE = 1000; /** * Inspired node-lru-cache[https://github.com/isaacs/node-lru-cache] */ var EndpointCache = /** @class */ (function () { function EndpointCache(maxSize) { if (maxSize === void 0) { maxSize = CACHE_SIZE; } this.maxSize = maxSize; this.cache = new LRU_1.LRUCache(maxSize); } ; Object.defineProperty(EndpointCache.prototype, "size", { get: function () { return this.cache.length; }, enumerable: true, configurable: true }); EndpointCache.prototype.put = function (key, value) { var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; var endpointRecord = this.populateValue(value); this.cache.put(keyString, endpointRecord); }; EndpointCache.prototype.get = function (key) { var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; var now = Date.now(); var records = this.cache.get(keyString); if (records) { for (var i = 0; i < records.length; i++) { var record = records[i]; if (record.Expire < now) { this.cache.remove(keyString); return undefined; } } } return records; }; EndpointCache.getKeyString = function (key) { var identifiers = []; var identifierNames = Object.keys(key).sort(); for (var i = 0; i < identifierNames.length; i++) { var identifierName = identifierNames[i]; if (key[identifierName] === undefined) continue; identifiers.push(key[identifierName]); } return identifiers.join(' '); }; EndpointCache.prototype.populateValue = function (endpoints) { var now = Date.now(); return endpoints.map(function (endpoint) { return ({ Address: endpoint.Address || '', Expire: now + (endpoint.CachePeriodInMinutes || 1) * 60 * 1000 }); }); }; EndpointCache.prototype.empty = function () { this.cache.empty(); }; EndpointCache.prototype.remove = function (key) { var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key; this.cache.remove(keyString); }; return EndpointCache; }()); exports.$ = EndpointCache; /***/ }), /***/ 77710: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var LinkedListNode = /** @class */ (function () { function LinkedListNode(key, value) { this.key = key; this.value = value; } return LinkedListNode; }()); var LRUCache = /** @class */ (function () { function LRUCache(size) { this.nodeMap = {}; this.size = 0; if (typeof size !== 'number' || size < 1) { throw new Error('Cache size can only be positive number'); } this.sizeLimit = size; } Object.defineProperty(LRUCache.prototype, "length", { get: function () { return this.size; }, enumerable: true, configurable: true }); LRUCache.prototype.prependToList = function (node) { if (!this.headerNode) { this.tailNode = node; } else { this.headerNode.prev = node; node.next = this.headerNode; } this.headerNode = node; this.size++; }; LRUCache.prototype.removeFromTail = function () { if (!this.tailNode) { return undefined; } var node = this.tailNode; var prevNode = node.prev; if (prevNode) { prevNode.next = undefined; } node.prev = undefined; this.tailNode = prevNode; this.size--; return node; }; LRUCache.prototype.detachFromList = function (node) { if (this.headerNode === node) { this.headerNode = node.next; } if (this.tailNode === node) { this.tailNode = node.prev; } if (node.prev) { node.prev.next = node.next; } if (node.next) { node.next.prev = node.prev; } node.next = undefined; node.prev = undefined; this.size--; }; LRUCache.prototype.get = function (key) { if (this.nodeMap[key]) { var node = this.nodeMap[key]; this.detachFromList(node); this.prependToList(node); return node.value; } }; LRUCache.prototype.remove = function (key) { if (this.nodeMap[key]) { var node = this.nodeMap[key]; this.detachFromList(node); delete this.nodeMap[key]; } }; LRUCache.prototype.put = function (key, value) { if (this.nodeMap[key]) { this.remove(key); } else if (this.size === this.sizeLimit) { var tailNode = this.removeFromTail(); var key_1 = tailNode.key; delete this.nodeMap[key_1]; } var newNode = new LinkedListNode(key, value); this.nodeMap[key] = newNode; this.prependToList(newNode); }; LRUCache.prototype.empty = function () { var keys = Object.keys(this.nodeMap); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var node = this.nodeMap[key]; this.detachFromList(node); delete this.nodeMap[key]; } }; return LRUCache; }()); exports.LRUCache = LRUCache; /***/ }), /***/ 96342: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*! * Copyright 2010 LearnBoost * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Module dependencies. */ var crypto = __webpack_require__(76417) , parse = __webpack_require__(78835).parse ; /** * Valid keys. */ var keys = [ 'acl' , 'location' , 'logging' , 'notification' , 'partNumber' , 'policy' , 'requestPayment' , 'torrent' , 'uploadId' , 'uploads' , 'versionId' , 'versioning' , 'versions' , 'website' ] /** * Return an "Authorization" header value with the given `options` * in the form of "AWS :" * * @param {Object} options * @return {String} * @api private */ function authorization (options) { return 'AWS ' + options.key + ':' + sign(options) } module.exports = authorization module.exports.authorization = authorization /** * Simple HMAC-SHA1 Wrapper * * @param {Object} options * @return {String} * @api private */ function hmacSha1 (options) { return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') } module.exports.hmacSha1 = hmacSha1 /** * Create a base64 sha1 HMAC for `options`. * * @param {Object} options * @return {String} * @api private */ function sign (options) { options.message = stringToSign(options) return hmacSha1(options) } module.exports.sign = sign /** * Create a base64 sha1 HMAC for `options`. * * Specifically to be used with S3 presigned URLs * * @param {Object} options * @return {String} * @api private */ function signQuery (options) { options.message = queryStringToSign(options) return hmacSha1(options) } module.exports.signQuery= signQuery /** * Return a string for sign() with the given `options`. * * Spec: * * \n * \n * \n * \n * [headers\n] * * * @param {Object} options * @return {String} * @api private */ function stringToSign (options) { var headers = options.amazonHeaders || '' if (headers) headers += '\n' var r = [ options.verb , options.md5 , options.contentType , options.date ? options.date.toUTCString() : '' , headers + options.resource ] return r.join('\n') } module.exports.stringToSign = stringToSign /** * Return a string for sign() with the given `options`, but is meant exclusively * for S3 presigned URLs * * Spec: * * \n * * * @param {Object} options * @return {String} * @api private */ function queryStringToSign (options){ return 'GET\n\n\n' + options.date + '\n' + options.resource } module.exports.queryStringToSign = queryStringToSign /** * Perform the following: * * - ignore non-amazon headers * - lowercase fields * - sort lexicographically * - trim whitespace between ":" * - join with newline * * @param {Object} headers * @return {String} * @api private */ function canonicalizeHeaders (headers) { var buf = [] , fields = Object.keys(headers) ; for (var i = 0, len = fields.length; i < len; ++i) { var field = fields[i] , val = headers[field] , field = field.toLowerCase() ; if (0 !== field.indexOf('x-amz')) continue buf.push(field + ':' + val) } return buf.sort().join('\n') } module.exports.canonicalizeHeaders = canonicalizeHeaders /** * Perform the following: * * - ignore non sub-resources * - sort lexicographically * * @param {String} resource * @return {String} * @api private */ function canonicalizeResource (resource) { var url = parse(resource, true) , path = url.pathname , buf = [] ; Object.keys(url.query).forEach(function(key){ if (!~keys.indexOf(key)) return var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) buf.push(key + val) }) return path + (buf.length ? '?' + buf.sort().join('&') : '') } module.exports.canonicalizeResource = canonicalizeResource /***/ }), /***/ 16071: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var aws4 = exports, url = __webpack_require__(78835), querystring = __webpack_require__(71191), crypto = __webpack_require__(76417), lru = __webpack_require__(74225), credentialsCache = lru(1000) // http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html function hmac(key, string, encoding) { return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) } function hash(string, encoding) { return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) } // This function assumes the string has already been percent encoded function encodeRfc3986(urlEncodedString) { return urlEncodedString.replace(/[!'()*]/g, function(c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } function encodeRfc3986Full(str) { return encodeRfc3986(encodeURIComponent(str)) } // A bit of a combination of: // https://github.com/aws/aws-sdk-java-v2/blob/dc695de6ab49ad03934e1b02e7263abbd2354be0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAws4Signer.java#L59 // https://github.com/aws/aws-sdk-js/blob/18cb7e5b463b46239f9fdd4a65e2ff8c81831e8f/lib/signers/v4.js#L191-L199 // https://github.com/mhart/aws4fetch/blob/b3aed16b6f17384cf36ea33bcba3c1e9f3bdfefd/src/main.js#L25-L34 var HEADERS_TO_IGNORE = { 'authorization': true, 'connection': true, 'x-amzn-trace-id': true, 'user-agent': true, 'expect': true, 'presigned-expires': true, 'range': true, } // request: { path | body, [host], [method], [headers], [service], [region] } // credentials: { accessKeyId, secretAccessKey, [sessionToken] } function RequestSigner(request, credentials) { if (typeof request === 'string') request = url.parse(request) var headers = request.headers = (request.headers || {}), hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host) this.request = request this.credentials = credentials || this.defaultCredentials() this.service = request.service || hostParts[0] || '' this.region = request.region || hostParts[1] || 'us-east-1' // SES uses a different domain from the service name if (this.service === 'email') this.service = 'ses' if (!request.method && request.body) request.method = 'POST' if (!headers.Host && !headers.host) { headers.Host = request.hostname || request.host || this.createHost() // If a port is specified explicitly, use it as is if (request.port) headers.Host += ':' + request.port } if (!request.hostname && !request.host) request.hostname = headers.Host || headers.host this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' } RequestSigner.prototype.matchHost = function(host) { var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/) var hostParts = (match || []).slice(1, 3) // ES's hostParts are sometimes the other way round, if the value that is expected // to be region equals ‘es’ switch them back // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com if (hostParts[1] === 'es') hostParts = hostParts.reverse() if (hostParts[1] == 's3') { hostParts[0] = 's3' hostParts[1] = 'us-east-1' } else { for (var i = 0; i < 2; i++) { if (/^s3-/.test(hostParts[i])) { hostParts[1] = hostParts[i].slice(3) hostParts[0] = 's3' break } } } return hostParts } // http://docs.aws.amazon.com/general/latest/gr/rande.html RequestSigner.prototype.isSingleRegion = function() { // Special case for S3 and SimpleDB in us-east-1 if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] .indexOf(this.service) >= 0 } RequestSigner.prototype.createHost = function() { var region = this.isSingleRegion() ? '' : '.' + this.region, subdomain = this.service === 'ses' ? 'email' : this.service return subdomain + region + '.amazonaws.com' } RequestSigner.prototype.prepareRequest = function() { this.parsePath() var request = this.request, headers = request.headers, query if (request.signQuery) { this.parsedPath.query = query = this.parsedPath.query || {} if (this.credentials.sessionToken) query['X-Amz-Security-Token'] = this.credentials.sessionToken if (this.service === 's3' && !query['X-Amz-Expires']) query['X-Amz-Expires'] = 86400 if (query['X-Amz-Date']) this.datetime = query['X-Amz-Date'] else query['X-Amz-Date'] = this.getDateTime() query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() query['X-Amz-SignedHeaders'] = this.signedHeaders() } else { if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { if (request.body && !headers['Content-Type'] && !headers['content-type']) headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' if (request.body && !headers['Content-Length'] && !headers['content-length']) headers['Content-Length'] = Buffer.byteLength(request.body) if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) headers['X-Amz-Security-Token'] = this.credentials.sessionToken if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') if (headers['X-Amz-Date'] || headers['x-amz-date']) this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] else headers['X-Amz-Date'] = this.getDateTime() } delete headers.Authorization delete headers.authorization } } RequestSigner.prototype.sign = function() { if (!this.parsedPath) this.prepareRequest() if (this.request.signQuery) { this.parsedPath.query['X-Amz-Signature'] = this.signature() } else { this.request.headers.Authorization = this.authHeader() } this.request.path = this.formatPath() return this.request } RequestSigner.prototype.getDateTime = function() { if (!this.datetime) { var headers = this.request.headers, date = new Date(headers.Date || headers.date || new Date) this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') // Remove the trailing 'Z' on the timestamp string for CodeCommit git access if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) } return this.datetime } RequestSigner.prototype.getDate = function() { return this.getDateTime().substr(0, 8) } RequestSigner.prototype.authHeader = function() { return [ 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), 'SignedHeaders=' + this.signedHeaders(), 'Signature=' + this.signature(), ].join(', ') } RequestSigner.prototype.signature = function() { var date = this.getDate(), cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) if (!kCredentials) { kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) kRegion = hmac(kDate, this.region) kService = hmac(kRegion, this.service) kCredentials = hmac(kService, 'aws4_request') credentialsCache.set(cacheKey, kCredentials) } return hmac(kCredentials, this.stringToSign(), 'hex') } RequestSigner.prototype.stringToSign = function() { return [ 'AWS4-HMAC-SHA256', this.getDateTime(), this.credentialString(), hash(this.canonicalString(), 'hex'), ].join('\n') } RequestSigner.prototype.canonicalString = function() { if (!this.parsedPath) this.prepareRequest() var pathStr = this.parsedPath.path, query = this.parsedPath.query, headers = this.request.headers, queryStr = '', normalizePath = this.service !== 's3', decodePath = this.service === 's3' || this.request.doNotEncodePath, decodeSlashesInPath = this.service === 's3', firstValOnly = this.service === 's3', bodyHash if (this.service === 's3' && this.request.signQuery) { bodyHash = 'UNSIGNED-PAYLOAD' } else if (this.isCodeCommitGit) { bodyHash = '' } else { bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || hash(this.request.body || '', 'hex') } if (query) { var reducedQuery = Object.keys(query).reduce(function(obj, key) { if (!key) return obj obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] : (firstValOnly ? query[key][0] : query[key]) return obj }, {}) var encodedQueryPieces = [] Object.keys(reducedQuery).sort().forEach(function(key) { if (!Array.isArray(reducedQuery[key])) { encodedQueryPieces.push(key + '=' + encodeRfc3986Full(reducedQuery[key])) } else { reducedQuery[key].map(encodeRfc3986Full).sort() .forEach(function(val) { encodedQueryPieces.push(key + '=' + val) }) } }) queryStr = encodedQueryPieces.join('&') } if (pathStr !== '/') { if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') pathStr = pathStr.split('/').reduce(function(path, piece) { if (normalizePath && piece === '..') { path.pop() } else if (!normalizePath || piece !== '.') { if (decodePath) piece = decodeURIComponent(piece.replace(/\+/g, ' ')) path.push(encodeRfc3986Full(piece)) } return path }, []).join('/') if (pathStr[0] !== '/') pathStr = '/' + pathStr if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') } return [ this.request.method || 'GET', pathStr, queryStr, this.canonicalHeaders() + '\n', this.signedHeaders(), bodyHash, ].join('\n') } RequestSigner.prototype.canonicalHeaders = function() { var headers = this.request.headers function trimAll(header) { return header.toString().trim().replace(/\s+/g, ' ') } return Object.keys(headers) .filter(function(key) { return HEADERS_TO_IGNORE[key.toLowerCase()] == null }) .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) .join('\n') } RequestSigner.prototype.signedHeaders = function() { return Object.keys(this.request.headers) .map(function(key) { return key.toLowerCase() }) .filter(function(key) { return HEADERS_TO_IGNORE[key] == null }) .sort() .join(';') } RequestSigner.prototype.credentialString = function() { return [ this.getDate(), this.region, this.service, 'aws4_request', ].join('/') } RequestSigner.prototype.defaultCredentials = function() { var env = process.env return { accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, sessionToken: env.AWS_SESSION_TOKEN, } } RequestSigner.prototype.parsePath = function() { var path = this.request.path || '/' // S3 doesn't always encode characters > 127 correctly and // all services don't encode characters > 255 correctly // So if there are non-reserved chars (and it's not already all % encoded), just encode them all if (/[^0-9A-Za-z;,/?:@&=+$\-_.!~*'()#%]/.test(path)) { path = encodeURI(decodeURI(path)) } var queryIx = path.indexOf('?'), query = null if (queryIx >= 0) { query = querystring.parse(path.slice(queryIx + 1)) path = path.slice(0, queryIx) } this.parsedPath = { path: path, query: query, } } RequestSigner.prototype.formatPath = function() { var path = this.parsedPath.path, query = this.parsedPath.query if (!query) return path // Services don't support empty query string keys if (query[''] != null) delete query[''] return path + '?' + encodeRfc3986(querystring.stringify(query)) } aws4.RequestSigner = RequestSigner aws4.sign = function(request, credentials) { return new RequestSigner(request, credentials).sign() } /***/ }), /***/ 74225: /***/ ((module) => { module.exports = function(size) { return new LruCache(size) } function LruCache(size) { this.capacity = size | 0 this.map = Object.create(null) this.list = new DoublyLinkedList() } LruCache.prototype.get = function(key) { var node = this.map[key] if (node == null) return undefined this.used(node) return node.val } LruCache.prototype.set = function(key, val) { var node = this.map[key] if (node != null) { node.val = val } else { if (!this.capacity) this.prune() if (!this.capacity) return false node = new DoublyLinkedNode(key, val) this.map[key] = node this.capacity-- } this.used(node) return true } LruCache.prototype.used = function(node) { this.list.moveToFront(node) } LruCache.prototype.prune = function() { var node = this.list.pop() if (node != null) { delete this.map[node.key] this.capacity++ } } function DoublyLinkedList() { this.firstNode = null this.lastNode = null } DoublyLinkedList.prototype.moveToFront = function(node) { if (this.firstNode == node) return this.remove(node) if (this.firstNode == null) { this.firstNode = node this.lastNode = node node.prev = null node.next = null } else { node.prev = null node.next = this.firstNode node.next.prev = node this.firstNode = node } } DoublyLinkedList.prototype.pop = function() { var lastNode = this.lastNode if (lastNode != null) { this.remove(lastNode) } return lastNode } DoublyLinkedList.prototype.remove = function(node) { if (this.firstNode == node) { this.firstNode = node.next } else if (node.prev != null) { node.prev.next = node.next } if (this.lastNode == node) { this.lastNode = node.prev } else if (node.next != null) { node.next.prev = node.prev } } function DoublyLinkedNode(key, val) { this.key = key this.val = val this.prev = null this.next = null } /***/ }), /***/ 9417: /***/ ((module) => { "use strict"; module.exports = balanced; function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; if (ai >= 0 && bi > 0) { if(a===b) { return [ai, bi]; } begs = []; left = str.length; while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length == 1) { result = [ begs.pop(), bi ]; } else { beg = begs.pop(); if (beg < left) { left = beg; right = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { result = [ left, right ]; } } return result; } /***/ }), /***/ 85848: /***/ (function(module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); /*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */ ;(function(root) { // Detect free variables `exports`. var freeExports = true && exports; // Detect free variable `module`. var freeModule = true && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js or Browserified code, and use // it as `root`. var freeGlobal = typeof global == 'object' && global; if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { root = freeGlobal; } /*--------------------------------------------------------------------------*/ var InvalidCharacterError = function(message) { this.message = message; }; InvalidCharacterError.prototype = new Error; InvalidCharacterError.prototype.name = 'InvalidCharacterError'; var error = function(message) { // Note: the error messages used throughout this file match those used by // the native `atob`/`btoa` implementation in Chromium. throw new InvalidCharacterError(message); }; var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // http://whatwg.org/html/common-microsyntaxes.html#space-character var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g; // `decode` is designed to be fully compatible with `atob` as described in the // HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob // The optimized base64-decoding algorithm used is based on @atk’s excellent // implementation. https://gist.github.com/atk/1020396 var decode = function(input) { input = String(input) .replace(REGEX_SPACE_CHARACTERS, ''); var length = input.length; if (length % 4 == 0) { input = input.replace(/==?$/, ''); length = input.length; } if ( length % 4 == 1 || // http://whatwg.org/C#alphanumeric-ascii-characters /[^+a-zA-Z0-9/]/.test(input) ) { error( 'Invalid character: the string to be decoded is not correctly encoded.' ); } var bitCounter = 0; var bitStorage; var buffer; var output = ''; var position = -1; while (++position < length) { buffer = TABLE.indexOf(input.charAt(position)); bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer; // Unless this is the first of a group of 4 characters… if (bitCounter++ % 4) { // …convert the first 8 bits to a single ASCII character. output += String.fromCharCode( 0xFF & bitStorage >> (-2 * bitCounter & 6) ); } } return output; }; // `encode` is designed to be fully compatible with `btoa` as described in the // HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa var encode = function(input) { input = String(input); if (/[^\0-\xFF]/.test(input)) { // Note: no need to special-case astral symbols here, as surrogates are // matched, and the input is supposed to only contain ASCII anyway. error( 'The string to be encoded contains characters outside of the ' + 'Latin1 range.' ); } var padding = input.length % 3; var output = ''; var position = -1; var a; var b; var c; var buffer; // Make sure any padding is handled outside of the loop. var length = input.length - padding; while (++position < length) { // Read three bytes, i.e. 24 bits. a = input.charCodeAt(position) << 16; b = input.charCodeAt(++position) << 8; c = input.charCodeAt(++position); buffer = a + b + c; // Turn the 24 bits into four chunks of 6 bits each, and append the // matching character for each of them to the output. output += ( TABLE.charAt(buffer >> 18 & 0x3F) + TABLE.charAt(buffer >> 12 & 0x3F) + TABLE.charAt(buffer >> 6 & 0x3F) + TABLE.charAt(buffer & 0x3F) ); } if (padding == 2) { a = input.charCodeAt(position) << 8; b = input.charCodeAt(++position); buffer = a + b; output += ( TABLE.charAt(buffer >> 10) + TABLE.charAt((buffer >> 4) & 0x3F) + TABLE.charAt((buffer << 2) & 0x3F) + '=' ); } else if (padding == 1) { buffer = input.charCodeAt(position); output += ( TABLE.charAt(buffer >> 2) + TABLE.charAt((buffer << 4) & 0x3F) + '==' ); } return output; }; var base64 = { 'encode': encode, 'decode': decode, 'version': '1.0.0' }; // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { define(function() { return base64; }); } else if (freeExports && !freeExports.nodeType) { if (freeModule) { // in Node.js or RingoJS v0.8.0+ freeModule.exports = base64; } else { // in Narwhal or RingoJS v0.7.0- for (var key in base64) { base64.hasOwnProperty(key) && (freeExports[key] = base64[key]); } } } else { // in Rhino or a web browser root.base64 = base64; } }(this)); /***/ }), /***/ 26463: /***/ ((__unused_webpack_module, exports) => { "use strict"; exports.byteLength = byteLength exports.toByteArray = toByteArray exports.fromByteArray = fromByteArray var lookup = [] var revLookup = [] var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' for (var i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i] revLookup[code.charCodeAt(i)] = i } // Support decoding URL-safe base64 strings, as Node.js does. // See: https://en.wikipedia.org/wiki/Base64#URL_applications revLookup['-'.charCodeAt(0)] = 62 revLookup['_'.charCodeAt(0)] = 63 function getLens (b64) { var len = b64.length if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 var validLen = b64.indexOf('=') if (validLen === -1) validLen = len var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4) return [validLen, placeHoldersLen] } // base64 is 4/3 + up to two characters of the original data function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function _byteLength (b64, validLen, placeHoldersLen) { return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function toByteArray (b64) { var tmp var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) var curByte = 0 // if there are placeholders, only get up to the last complete 4 chars var len = placeHoldersLen > 0 ? validLen - 4 : validLen var i for (i = 0; i < len; i += 4) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[curByte++] = (tmp >> 16) & 0xFF arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 2) { tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 1) { tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) output.push(tripletToBase64(tmp)) } return output.join('') } function fromByteArray (uint8) { var tmp var len = uint8.length var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes var parts = [] var maxChunkLength = 16383 // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] parts.push( lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3F] + '==' ) } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1] parts.push( lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3F] + lookup[(tmp << 2) & 0x3F] + '=' ) } return parts.join('') } /***/ }), /***/ 45447: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var crypto_hash_sha512 = __webpack_require__(68729).lowlevel.crypto_hash; /* * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a * result, it retains the original copyright and license. The two files are * under slightly different (but compatible) licenses, and are here combined in * one file. * * Credit for the actual porting work goes to: * Devi Mandiri */ /* * The Blowfish portions are under the following license: * * Blowfish block cipher for OpenBSD * Copyright 1997 Niels Provos * All rights reserved. * * Implementation advice by David Mazieres . * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * The bcrypt_pbkdf portions are under the following license: * * Copyright (c) 2013 Ted Unangst * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Performance improvements (Javascript-specific): * * Copyright 2016, Joyent Inc * Author: Alex Wilson * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ // Ported from OpenBSD bcrypt_pbkdf.c v1.9 var BLF_J = 0; var Blowfish = function() { this.S = [ new Uint32Array([ 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), new Uint32Array([ 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), new Uint32Array([ 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), new Uint32Array([ 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) ]; this.P = new Uint32Array([ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b]); }; function F(S, x8, i) { return (((S[0][x8[i+3]] + S[1][x8[i+2]]) ^ S[2][x8[i+1]]) + S[3][x8[i]]); }; Blowfish.prototype.encipher = function(x, x8) { if (x8 === undefined) { x8 = new Uint8Array(x.buffer); if (x.byteOffset !== 0) x8 = x8.subarray(x.byteOffset); } x[0] ^= this.P[0]; for (var i = 1; i < 16; i += 2) { x[1] ^= F(this.S, x8, 0) ^ this.P[i]; x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; } var t = x[0]; x[0] = x[1] ^ this.P[17]; x[1] = t; }; Blowfish.prototype.decipher = function(x) { var x8 = new Uint8Array(x.buffer); if (x.byteOffset !== 0) x8 = x8.subarray(x.byteOffset); x[0] ^= this.P[17]; for (var i = 16; i > 0; i -= 2) { x[1] ^= F(this.S, x8, 0) ^ this.P[i]; x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; } var t = x[0]; x[0] = x[1] ^ this.P[0]; x[1] = t; }; function stream2word(data, databytes){ var i, temp = 0; for (i = 0; i < 4; i++, BLF_J++) { if (BLF_J >= databytes) BLF_J = 0; temp = (temp << 8) | data[BLF_J]; } return temp; }; Blowfish.prototype.expand0state = function(key, keybytes) { var d = new Uint32Array(2), i, k; var d8 = new Uint8Array(d.buffer); for (i = 0, BLF_J = 0; i < 18; i++) { this.P[i] ^= stream2word(key, keybytes); } BLF_J = 0; for (i = 0; i < 18; i += 2) { this.encipher(d, d8); this.P[i] = d[0]; this.P[i+1] = d[1]; } for (i = 0; i < 4; i++) { for (k = 0; k < 256; k += 2) { this.encipher(d, d8); this.S[i][k] = d[0]; this.S[i][k+1] = d[1]; } } }; Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { var d = new Uint32Array(2), i, k; for (i = 0, BLF_J = 0; i < 18; i++) { this.P[i] ^= stream2word(key, keybytes); } for (i = 0, BLF_J = 0; i < 18; i += 2) { d[0] ^= stream2word(data, databytes); d[1] ^= stream2word(data, databytes); this.encipher(d); this.P[i] = d[0]; this.P[i+1] = d[1]; } for (i = 0; i < 4; i++) { for (k = 0; k < 256; k += 2) { d[0] ^= stream2word(data, databytes); d[1] ^= stream2word(data, databytes); this.encipher(d); this.S[i][k] = d[0]; this.S[i][k+1] = d[1]; } } BLF_J = 0; }; Blowfish.prototype.enc = function(data, blocks) { for (var i = 0; i < blocks; i++) { this.encipher(data.subarray(i*2)); } }; Blowfish.prototype.dec = function(data, blocks) { for (var i = 0; i < blocks; i++) { this.decipher(data.subarray(i*2)); } }; var BCRYPT_BLOCKS = 8, BCRYPT_HASHSIZE = 32; function bcrypt_hash(sha2pass, sha2salt, out) { var state = new Blowfish(), cdata = new Uint32Array(BCRYPT_BLOCKS), i, ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, 105,116,101]); //"OxychromaticBlowfishSwatDynamite" state.expandstate(sha2salt, 64, sha2pass, 64); for (i = 0; i < 64; i++) { state.expand0state(sha2salt, 64); state.expand0state(sha2pass, 64); } for (i = 0; i < BCRYPT_BLOCKS; i++) cdata[i] = stream2word(ciphertext, ciphertext.byteLength); for (i = 0; i < 64; i++) state.enc(cdata, cdata.byteLength / 8); for (i = 0; i < BCRYPT_BLOCKS; i++) { out[4*i+3] = cdata[i] >>> 24; out[4*i+2] = cdata[i] >>> 16; out[4*i+1] = cdata[i] >>> 8; out[4*i+0] = cdata[i]; } }; function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { var sha2pass = new Uint8Array(64), sha2salt = new Uint8Array(64), out = new Uint8Array(BCRYPT_HASHSIZE), tmpout = new Uint8Array(BCRYPT_HASHSIZE), countsalt = new Uint8Array(saltlen+4), i, j, amt, stride, dest, count, origkeylen = keylen; if (rounds < 1) return -1; if (passlen === 0 || saltlen === 0 || keylen === 0 || keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) return -1; stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); amt = Math.floor((keylen + stride - 1) / stride); for (i = 0; i < saltlen; i++) countsalt[i] = salt[i]; crypto_hash_sha512(sha2pass, pass, passlen); for (count = 1; keylen > 0; count++) { countsalt[saltlen+0] = count >>> 24; countsalt[saltlen+1] = count >>> 16; countsalt[saltlen+2] = count >>> 8; countsalt[saltlen+3] = count; crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); bcrypt_hash(sha2pass, sha2salt, tmpout); for (i = out.byteLength; i--;) out[i] = tmpout[i]; for (i = 1; i < rounds; i++) { crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); bcrypt_hash(sha2pass, sha2salt, tmpout); for (j = 0; j < out.byteLength; j++) out[j] ^= tmpout[j]; } amt = Math.min(amt, keylen); for (i = 0; i < amt; i++) { dest = i * stride + (count - 1); if (dest >= origkeylen) break; key[dest] = out[i]; } keylen -= i; } return 0; }; module.exports = { BLOCKS: BCRYPT_BLOCKS, HASHSIZE: BCRYPT_HASHSIZE, hash: bcrypt_hash, pbkdf: bcrypt_pbkdf }; /***/ }), /***/ 87558: /***/ (function(module) { ;(function (globalObject) { 'use strict'; /* * bignumber.js v9.0.2 * A JavaScript library for arbitrary-precision arithmetic. * https://github.com/MikeMcl/bignumber.js * Copyright (c) 2021 Michael Mclaughlin * MIT Licensed. * * BigNumber.prototype methods | BigNumber methods * | * absoluteValue abs | clone * comparedTo | config set * decimalPlaces dp | DECIMAL_PLACES * dividedBy div | ROUNDING_MODE * dividedToIntegerBy idiv | EXPONENTIAL_AT * exponentiatedBy pow | RANGE * integerValue | CRYPTO * isEqualTo eq | MODULO_MODE * isFinite | POW_PRECISION * isGreaterThan gt | FORMAT * isGreaterThanOrEqualTo gte | ALPHABET * isInteger | isBigNumber * isLessThan lt | maximum max * isLessThanOrEqualTo lte | minimum min * isNaN | random * isNegative | sum * isPositive | * isZero | * minus | * modulo mod | * multipliedBy times | * negated | * plus | * precision sd | * shiftedBy | * squareRoot sqrt | * toExponential | * toFixed | * toFormat | * toFraction | * toJSON | * toNumber | * toPrecision | * toString | * valueOf | * */ var BigNumber, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = '[BigNumber Error] ', tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 // MAX_INT32 = 0x7fffffff, // 2^31 - 1 POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, // EDITABLE // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and // the arguments to toExponential, toFixed, toFormat, and toPrecision. MAX = 1E9; // 0 to MAX_INT32 /* * Create and return a BigNumber constructor. */ function clone(configObject) { var div, convertBase, parseNumeric, P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, ONE = new BigNumber(1), //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- // The default values below must be integers within the inclusive ranges stated. // The values can also be changed at run-time using BigNumber.set. // The maximum number of decimal places for operations involving division. DECIMAL_PLACES = 20, // 0 to MAX // The rounding mode used when rounding to the above decimal places, and when using // toExponential, toFixed, toFormat and toPrecision, and round (default value). // UP 0 Away from zero. // DOWN 1 Towards zero. // CEIL 2 Towards +Infinity. // FLOOR 3 Towards -Infinity. // HALF_UP 4 Towards nearest neighbour. If equidistant, up. // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. ROUNDING_MODE = 4, // 0 to 8 // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] // The exponent value at and beneath which toString returns exponential notation. // Number type: -7 TO_EXP_NEG = -7, // 0 to -MAX // The exponent value at and above which toString returns exponential notation. // Number type: 21 TO_EXP_POS = 21, // 0 to MAX // RANGE : [MIN_EXP, MAX_EXP] // The minimum exponent value, beneath which underflow to zero occurs. // Number type: -324 (5e-324) MIN_EXP = -1e7, // -1 to -MAX // The maximum exponent value, above which overflow to Infinity occurs. // Number type: 308 (1.7976931348623157e+308) // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. MAX_EXP = 1e7, // 1 to MAX // Whether to use cryptographically-secure random number generation, if available. CRYPTO = false, // true or false // The modulo mode used when calculating the modulus: a mod n. // The quotient (q = a / n) is calculated according to the corresponding rounding mode. // The remainder (r) is calculated as: r = a - n * q. // // UP 0 The remainder is positive if the dividend is negative, else is negative. // DOWN 1 The remainder has the same sign as the dividend. // This modulo mode is commonly known as 'truncated division' and is // equivalent to (a % n) in JavaScript. // FLOOR 3 The remainder has the same sign as the divisor (Python %). // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). // The remainder is always positive. // // The truncated division, floored division, Euclidian division and IEEE 754 remainder // modes are commonly used for the modulus operation. // Although the other rounding modes can also be used, they may not give useful results. MODULO_MODE = 1, // 0 to 9 // The maximum number of significant digits of the result of the exponentiatedBy operation. // If POW_PRECISION is 0, there will be unlimited significant digits. POW_PRECISION = 0, // 0 to MAX // The format specification used by the BigNumber.prototype.toFormat method. FORMAT = { prefix: '', groupSize: 3, secondaryGroupSize: 0, groupSeparator: ',', decimalSeparator: '.', fractionGroupSize: 0, fractionGroupSeparator: '\xA0', // non-breaking space suffix: '' }, // The alphabet used for base conversion. It must be at least 2 characters long, with no '+', // '-', '.', whitespace, or repeated character. // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz', alphabetHasNormalDecimalDigits = true; //------------------------------------------------------------------------------------------ // CONSTRUCTOR /* * The BigNumber constructor and exported function. * Create and return a new instance of a BigNumber object. * * v {number|string|BigNumber} A numeric value. * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive. */ function BigNumber(v, b) { var alphabet, c, caseChanged, e, i, isNum, len, str, x = this; // Enable constructor call without `new`. if (!(x instanceof BigNumber)) return new BigNumber(v, b); if (b == null) { if (v && v._isBigNumber === true) { x.s = v.s; if (!v.c || v.e > MAX_EXP) { x.c = x.e = null; } else if (v.e < MIN_EXP) { x.c = [x.e = 0]; } else { x.e = v.e; x.c = v.c.slice(); } return; } if ((isNum = typeof v == 'number') && v * 0 == 0) { // Use `1 / n` to handle minus zero also. x.s = 1 / v < 0 ? (v = -v, -1) : 1; // Fast path for integers, where n < 2147483648 (2**31). if (v === ~~v) { for (e = 0, i = v; i >= 10; i /= 10, e++); if (e > MAX_EXP) { x.c = x.e = null; } else { x.e = e; x.c = [v]; } return; } str = String(v); } else { if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum); x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; } // Decimal point? if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); // Exponential form? if ((i = str.search(/e/i)) > 0) { // Determine exponent. if (e < 0) e = i; e += +str.slice(i + 1); str = str.substring(0, i); } else if (e < 0) { // Integer. e = str.length; } } else { // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' intCheck(b, 2, ALPHABET.length, 'Base'); // Allow exponential notation to be used with base 10 argument, while // also rounding to DECIMAL_PLACES as with other bases. if (b == 10 && alphabetHasNormalDecimalDigits) { x = new BigNumber(v); return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); } str = String(v); if (isNum = typeof v == 'number') { // Avoid potential interpretation of Infinity and NaN as base 44+ values. if (v * 0 != 0) return parseNumeric(x, str, isNum, b); x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1; // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { throw Error (tooManyDigits + v); } } else { x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; } alphabet = ALPHABET.slice(0, b); e = i = 0; // Check that str is a valid base b number. // Don't use RegExp, so alphabet can contain special characters. for (len = str.length; i < len; i++) { if (alphabet.indexOf(c = str.charAt(i)) < 0) { if (c == '.') { // If '.' is not the first character and it has not be found before. if (i > e) { e = len; continue; } } else if (!caseChanged) { // Allow e.g. hexadecimal 'FF' as well as 'ff'. if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) { caseChanged = true; i = -1; e = 0; continue; } } return parseNumeric(x, String(v), isNum, b); } } // Prevent later check for length on converted number. isNum = false; str = convertBase(str, b, 10, x.s); // Decimal point? if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); else e = str.length; } // Determine leading zeros. for (i = 0; str.charCodeAt(i) === 48; i++); // Determine trailing zeros. for (len = str.length; str.charCodeAt(--len) === 48;); if (str = str.slice(i, ++len)) { len -= i; // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' if (isNum && BigNumber.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) { throw Error (tooManyDigits + (x.s * v)); } // Overflow? if ((e = e - i - 1) > MAX_EXP) { // Infinity. x.c = x.e = null; // Underflow? } else if (e < MIN_EXP) { // Zero. x.c = [x.e = 0]; } else { x.e = e; x.c = []; // Transform base // e is the base 10 exponent. // i is where to slice str to get the first element of the coefficient array. i = (e + 1) % LOG_BASE; if (e < 0) i += LOG_BASE; // i < 1 if (i < len) { if (i) x.c.push(+str.slice(0, i)); for (len -= LOG_BASE; i < len;) { x.c.push(+str.slice(i, i += LOG_BASE)); } i = LOG_BASE - (str = str.slice(i)).length; } else { i -= len; } for (; i--; str += '0'); x.c.push(+str); } } else { // Zero. x.c = [x.e = 0]; } } // CONSTRUCTOR PROPERTIES BigNumber.clone = clone; BigNumber.ROUND_UP = 0; BigNumber.ROUND_DOWN = 1; BigNumber.ROUND_CEIL = 2; BigNumber.ROUND_FLOOR = 3; BigNumber.ROUND_HALF_UP = 4; BigNumber.ROUND_HALF_DOWN = 5; BigNumber.ROUND_HALF_EVEN = 6; BigNumber.ROUND_HALF_CEIL = 7; BigNumber.ROUND_HALF_FLOOR = 8; BigNumber.EUCLID = 9; /* * Configure infrequently-changing library-wide settings. * * Accept an object with the following optional properties (if the value of a property is * a number, it must be an integer within the inclusive range stated): * * DECIMAL_PLACES {number} 0 to MAX * ROUNDING_MODE {number} 0 to 8 * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] * CRYPTO {boolean} true or false * MODULO_MODE {number} 0 to 9 * POW_PRECISION {number} 0 to MAX * ALPHABET {string} A string of two or more unique characters which does * not contain '.'. * FORMAT {object} An object with some of the following properties: * prefix {string} * groupSize {number} * secondaryGroupSize {number} * groupSeparator {string} * decimalSeparator {string} * fractionGroupSize {number} * fractionGroupSeparator {string} * suffix {string} * * (The values assigned to the above FORMAT object properties are not checked for validity.) * * E.g. * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) * * Ignore properties/parameters set to null or undefined, except for ALPHABET. * * Return an object with the properties current values. */ BigNumber.config = BigNumber.set = function (obj) { var p, v; if (obj != null) { if (typeof obj == 'object') { // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { v = obj[p]; intCheck(v, 0, MAX, p); DECIMAL_PLACES = v; } // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { v = obj[p]; intCheck(v, 0, 8, p); ROUNDING_MODE = v; } // EXPONENTIAL_AT {number|number[]} // Integer, -MAX to MAX inclusive or // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { v = obj[p]; if (v && v.pop) { intCheck(v[0], -MAX, 0, p); intCheck(v[1], 0, MAX, p); TO_EXP_NEG = v[0]; TO_EXP_POS = v[1]; } else { intCheck(v, -MAX, MAX, p); TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); } } // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' if (obj.hasOwnProperty(p = 'RANGE')) { v = obj[p]; if (v && v.pop) { intCheck(v[0], -MAX, -1, p); intCheck(v[1], 1, MAX, p); MIN_EXP = v[0]; MAX_EXP = v[1]; } else { intCheck(v, -MAX, MAX, p); if (v) { MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); } else { throw Error (bignumberError + p + ' cannot be zero: ' + v); } } } // CRYPTO {boolean} true or false. // '[BigNumber Error] CRYPTO not true or false: {v}' // '[BigNumber Error] crypto unavailable' if (obj.hasOwnProperty(p = 'CRYPTO')) { v = obj[p]; if (v === !!v) { if (v) { if (typeof crypto != 'undefined' && crypto && (crypto.getRandomValues || crypto.randomBytes)) { CRYPTO = v; } else { CRYPTO = !v; throw Error (bignumberError + 'crypto unavailable'); } } else { CRYPTO = v; } } else { throw Error (bignumberError + p + ' not true or false: ' + v); } } // MODULO_MODE {number} Integer, 0 to 9 inclusive. // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' if (obj.hasOwnProperty(p = 'MODULO_MODE')) { v = obj[p]; intCheck(v, 0, 9, p); MODULO_MODE = v; } // POW_PRECISION {number} Integer, 0 to MAX inclusive. // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' if (obj.hasOwnProperty(p = 'POW_PRECISION')) { v = obj[p]; intCheck(v, 0, MAX, p); POW_PRECISION = v; } // FORMAT {object} // '[BigNumber Error] FORMAT not an object: {v}' if (obj.hasOwnProperty(p = 'FORMAT')) { v = obj[p]; if (typeof v == 'object') FORMAT = v; else throw Error (bignumberError + p + ' not an object: ' + v); } // ALPHABET {string} // '[BigNumber Error] ALPHABET invalid: {v}' if (obj.hasOwnProperty(p = 'ALPHABET')) { v = obj[p]; // Disallow if less than two characters, // or if it contains '+', '-', '.', whitespace, or a repeated character. if (typeof v == 'string' && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) { alphabetHasNormalDecimalDigits = v.slice(0, 10) == '0123456789'; ALPHABET = v; } else { throw Error (bignumberError + p + ' invalid: ' + v); } } } else { // '[BigNumber Error] Object expected: {v}' throw Error (bignumberError + 'Object expected: ' + obj); } } return { DECIMAL_PLACES: DECIMAL_PLACES, ROUNDING_MODE: ROUNDING_MODE, EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], RANGE: [MIN_EXP, MAX_EXP], CRYPTO: CRYPTO, MODULO_MODE: MODULO_MODE, POW_PRECISION: POW_PRECISION, FORMAT: FORMAT, ALPHABET: ALPHABET }; }; /* * Return true if v is a BigNumber instance, otherwise return false. * * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed. * * v {any} * * '[BigNumber Error] Invalid BigNumber: {v}' */ BigNumber.isBigNumber = function (v) { if (!v || v._isBigNumber !== true) return false; if (!BigNumber.DEBUG) return true; var i, n, c = v.c, e = v.e, s = v.s; out: if ({}.toString.call(c) == '[object Array]') { if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) { // If the first element is zero, the BigNumber value must be zero. if (c[0] === 0) { if (e === 0 && c.length === 1) return true; break out; } // Calculate number of digits that c[0] should have, based on the exponent. i = (e + 1) % LOG_BASE; if (i < 1) i += LOG_BASE; // Calculate number of digits of c[0]. //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) { if (String(c[0]).length == i) { for (i = 0; i < c.length; i++) { n = c[i]; if (n < 0 || n >= BASE || n !== mathfloor(n)) break out; } // Last element cannot be zero, unless it is the only element. if (n !== 0) return true; } } // Infinity/NaN } else if (c === null && e === null && (s === null || s === 1 || s === -1)) { return true; } throw Error (bignumberError + 'Invalid BigNumber: ' + v); }; /* * Return a new BigNumber whose value is the maximum of the arguments. * * arguments {number|string|BigNumber} */ BigNumber.maximum = BigNumber.max = function () { return maxOrMin(arguments, P.lt); }; /* * Return a new BigNumber whose value is the minimum of the arguments. * * arguments {number|string|BigNumber} */ BigNumber.minimum = BigNumber.min = function () { return maxOrMin(arguments, P.gt); }; /* * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing * zeros are produced). * * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' * '[BigNumber Error] crypto unavailable' */ BigNumber.random = (function () { var pow2_53 = 0x20000000000000; // Return a 53 bit integer n, where 0 <= n < 9007199254740992. // Check if Math.random() produces more than 32 bits of randomness. // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. var random53bitInt = (Math.random() * pow2_53) & 0x1fffff ? function () { return mathfloor(Math.random() * pow2_53); } : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + (Math.random() * 0x800000 | 0); }; return function (dp) { var a, b, e, k, v, i = 0, c = [], rand = new BigNumber(ONE); if (dp == null) dp = DECIMAL_PLACES; else intCheck(dp, 0, MAX); k = mathceil(dp / LOG_BASE); if (CRYPTO) { // Browsers supporting crypto.getRandomValues. if (crypto.getRandomValues) { a = crypto.getRandomValues(new Uint32Array(k *= 2)); for (; i < k;) { // 53 bits: // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) // 11111 11111111 11111111 11111111 11100000 00000000 00000000 // ((Math.pow(2, 32) - 1) >>> 11).toString(2) // 11111 11111111 11111111 // 0x20000 is 2^21. v = a[i] * 0x20000 + (a[i + 1] >>> 11); // Rejection sampling: // 0 <= v < 9007199254740992 // Probability that v >= 9e15, is // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 if (v >= 9e15) { b = crypto.getRandomValues(new Uint32Array(2)); a[i] = b[0]; a[i + 1] = b[1]; } else { // 0 <= v <= 8999999999999999 // 0 <= (v % 1e14) <= 99999999999999 c.push(v % 1e14); i += 2; } } i = k / 2; // Node.js supporting crypto.randomBytes. } else if (crypto.randomBytes) { // buffer a = crypto.randomBytes(k *= 7); for (; i < k;) { // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 // 0x100000000 is 2^32, 0x1000000 is 2^24 // 11111 11111111 11111111 11111111 11111111 11111111 11111111 // 0 <= v < 9007199254740992 v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; if (v >= 9e15) { crypto.randomBytes(7).copy(a, i); } else { // 0 <= (v % 1e14) <= 99999999999999 c.push(v % 1e14); i += 7; } } i = k / 7; } else { CRYPTO = false; throw Error (bignumberError + 'crypto unavailable'); } } // Use Math.random. if (!CRYPTO) { for (; i < k;) { v = random53bitInt(); if (v < 9e15) c[i++] = v % 1e14; } } k = c[--i]; dp %= LOG_BASE; // Convert trailing digits to zeros according to dp. if (k && dp) { v = POWS_TEN[LOG_BASE - dp]; c[i] = mathfloor(k / v) * v; } // Remove trailing elements which are zero. for (; c[i] === 0; c.pop(), i--); // Zero? if (i < 0) { c = [e = 0]; } else { // Remove leading elements which are zero and adjust exponent accordingly. for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); // Count the digits of the first element of c to determine leading zeros, and... for (i = 1, v = c[0]; v >= 10; v /= 10, i++); // adjust the exponent accordingly. if (i < LOG_BASE) e -= LOG_BASE - i; } rand.e = e; rand.c = c; return rand; }; })(); /* * Return a BigNumber whose value is the sum of the arguments. * * arguments {number|string|BigNumber} */ BigNumber.sum = function () { var i = 1, args = arguments, sum = new BigNumber(args[0]); for (; i < args.length;) sum = sum.plus(args[i++]); return sum; }; // PRIVATE FUNCTIONS // Called by BigNumber and BigNumber.prototype.toString. convertBase = (function () { var decimal = '0123456789'; /* * Convert string of baseIn to an array of numbers of baseOut. * Eg. toBaseOut('255', 10, 16) returns [15, 15]. * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. */ function toBaseOut(str, baseIn, baseOut, alphabet) { var j, arr = [0], arrL, i = 0, len = str.length; for (; i < len;) { for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); arr[0] += alphabet.indexOf(str.charAt(i++)); for (j = 0; j < arr.length; j++) { if (arr[j] > baseOut - 1) { if (arr[j + 1] == null) arr[j + 1] = 0; arr[j + 1] += arr[j] / baseOut | 0; arr[j] %= baseOut; } } } return arr.reverse(); } // Convert a numeric string of baseIn to a numeric string of baseOut. // If the caller is toString, we are converting from base 10 to baseOut. // If the caller is BigNumber, we are converting from baseIn to base 10. return function (str, baseIn, baseOut, sign, callerIsToString) { var alphabet, d, e, k, r, x, xc, y, i = str.indexOf('.'), dp = DECIMAL_PLACES, rm = ROUNDING_MODE; // Non-integer. if (i >= 0) { k = POW_PRECISION; // Unlimited precision. POW_PRECISION = 0; str = str.replace('.', ''); y = new BigNumber(baseIn); x = y.pow(str.length - i); POW_PRECISION = k; // Convert str as if an integer, then restore the fraction part by dividing the // result by its base raised to a power. y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), 10, baseOut, decimal); y.e = y.c.length; } // Convert the number as integer. xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET)); // xc now represents str as an integer and converted to baseOut. e is the exponent. e = k = xc.length; // Remove trailing zeros. for (; xc[--k] == 0; xc.pop()); // Zero? if (!xc[0]) return alphabet.charAt(0); // Does str represent an integer? If so, no need for the division. if (i < 0) { --e; } else { x.c = xc; x.e = e; // The sign is needed for correct rounding. x.s = sign; x = div(x, y, dp, rm, baseOut); xc = x.c; r = x.r; e = x.e; } // xc now represents str converted to baseOut. // THe index of the rounding digit. d = e + dp + 1; // The rounding digit: the digit to the right of the digit that may be rounded up. i = xc[d]; // Look at the rounding digits and mode to determine whether to round up. k = baseOut / 2; r = r || d < 0 || xc[d + 1] != null; r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7)); // If the index of the rounding digit is not greater than zero, or xc represents // zero, then the result of the base conversion is zero or, if rounding up, a value // such as 0.00001. if (d < 1 || !xc[0]) { // 1^-dp or 0 str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0); } else { // Truncate xc to the required number of decimal places. xc.length = d; // Round up? if (r) { // Rounding up may mean the previous digit has to be rounded up and so on. for (--baseOut; ++xc[--d] > baseOut;) { xc[d] = 0; if (!d) { ++e; xc = [1].concat(xc); } } } // Determine trailing zeros. for (k = xc.length; !xc[--k];); // E.g. [4, 11, 15] becomes 4bf. for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); // Add leading zeros, decimal point and trailing zeros as required. str = toFixedPoint(str, e, alphabet.charAt(0)); } // The caller will add the sign. return str; }; })(); // Perform division in the specified base. Called by div and convertBase. div = (function () { // Assume non-zero x and k. function multiply(x, k, base) { var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0; for (x = x.slice(); i--;) { xlo = x[i] % SQRT_BASE; xhi = x[i] / SQRT_BASE | 0; m = khi * xlo + xhi * klo; temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; x[i] = temp % base; } if (carry) x = [carry].concat(x); return x; } function compare(a, b, aL, bL) { var i, cmp; if (aL != bL) { cmp = aL > bL ? 1 : -1; } else { for (i = cmp = 0; i < aL; i++) { if (a[i] != b[i]) { cmp = a[i] > b[i] ? 1 : -1; break; } } } return cmp; } function subtract(a, b, aL, base) { var i = 0; // Subtract b from a. for (; aL--;) { a[aL] -= i; i = a[aL] < b[aL] ? 1 : 0; a[aL] = i * base + a[aL] - b[aL]; } // Remove leading zeros. for (; !a[0] && a.length > 1; a.splice(0, 1)); } // x: dividend, y: divisor. return function (x, y, dp, rm, base) { var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c; // Either NaN, Infinity or 0? if (!xc || !xc[0] || !yc || !yc[0]) { return new BigNumber( // Return NaN if either NaN, or both Infinity or 0. !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. xc && xc[0] == 0 || !yc ? s * 0 : s / 0 ); } q = new BigNumber(s); qc = q.c = []; e = x.e - y.e; s = dp + e + 1; if (!base) { base = BASE; e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); s = s / LOG_BASE | 0; } // Result exponent may be one less then the current value of e. // The coefficients of the BigNumbers from convertBase may have trailing zeros. for (i = 0; yc[i] == (xc[i] || 0); i++); if (yc[i] > (xc[i] || 0)) e--; if (s < 0) { qc.push(1); more = true; } else { xL = xc.length; yL = yc.length; i = 0; s += 2; // Normalise xc and yc so highest order digit of yc is >= base / 2. n = mathfloor(base / (yc[0] + 1)); // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. // if (n > 1 || n++ == 1 && yc[0] < base / 2) { if (n > 1) { yc = multiply(yc, n, base); xc = multiply(xc, n, base); yL = yc.length; xL = xc.length; } xi = yL; rem = xc.slice(0, yL); remL = rem.length; // Add zeros to make remainder as long as divisor. for (; remL < yL; rem[remL++] = 0); yz = yc.slice(); yz = [0].concat(yz); yc0 = yc[0]; if (yc[1] >= base / 2) yc0++; // Not necessary, but to prevent trial digit n > base, when using base 3. // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; do { n = 0; // Compare divisor and remainder. cmp = compare(yc, rem, yL, remL); // If divisor < remainder. if (cmp < 0) { // Calculate trial digit, n. rem0 = rem[0]; if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); // n is how many times the divisor goes into the current remainder. n = mathfloor(rem0 / yc0); // Algorithm: // product = divisor multiplied by trial digit (n). // Compare product and remainder. // If product is greater than remainder: // Subtract divisor from product, decrement trial digit. // Subtract product from remainder. // If product was less than remainder at the last compare: // Compare new remainder and divisor. // If remainder is greater than divisor: // Subtract divisor from remainder, increment trial digit. if (n > 1) { // n may be > base only when base is 3. if (n >= base) n = base - 1; // product = divisor * trial digit. prod = multiply(yc, n, base); prodL = prod.length; remL = rem.length; // Compare product and remainder. // If product > remainder then trial digit n too high. // n is 1 too high about 5% of the time, and is not known to have // ever been more than 1 too high. while (compare(prod, rem, prodL, remL) == 1) { n--; // Subtract divisor from product. subtract(prod, yL < prodL ? yz : yc, prodL, base); prodL = prod.length; cmp = 1; } } else { // n is 0 or 1, cmp is -1. // If n is 0, there is no need to compare yc and rem again below, // so change cmp to 1 to avoid it. // If n is 1, leave cmp as -1, so yc and rem are compared again. if (n == 0) { // divisor < remainder, so n must be at least 1. cmp = n = 1; } // product = divisor prod = yc.slice(); prodL = prod.length; } if (prodL < remL) prod = [0].concat(prod); // Subtract product from remainder. subtract(rem, prod, remL, base); remL = rem.length; // If product was < remainder. if (cmp == -1) { // Compare divisor and new remainder. // If divisor < new remainder, subtract divisor from remainder. // Trial digit n too low. // n is 1 too low about 5% of the time, and very rarely 2 too low. while (compare(yc, rem, yL, remL) < 1) { n++; // Subtract divisor from remainder. subtract(rem, yL < remL ? yz : yc, remL, base); remL = rem.length; } } } else if (cmp === 0) { n++; rem = [0]; } // else cmp === 1 and n will be 0 // Add the next digit, n, to the result array. qc[i++] = n; // Update the remainder. if (rem[0]) { rem[remL++] = xc[xi] || 0; } else { rem = [xc[xi]]; remL = 1; } } while ((xi++ < xL || rem[0] != null) && s--); more = rem[0] != null; // Leading zero? if (!qc[0]) qc.splice(0, 1); } if (base == BASE) { // To calculate q.e, first get the number of digits of qc[0]. for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); // Caller is convertBase. } else { q.e = e; q.r = +more; } return q; }; })(); /* * Return a string representing the value of BigNumber n in fixed-point or exponential * notation rounded to the specified decimal places or significant digits. * * n: a BigNumber. * i: the index of the last digit required (i.e. the digit that may be rounded up). * rm: the rounding mode. * id: 1 (toExponential) or 2 (toPrecision). */ function format(n, i, rm, id) { var c0, e, ne, len, str; if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); if (!n.c) return n.toString(); c0 = n.c[0]; ne = n.e; if (i == null) { str = coeffToString(n.c); str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, '0'); } else { n = round(new BigNumber(n), i, rm); // n.e may have changed if the value was rounded up. e = n.e; str = coeffToString(n.c); len = str.length; // toPrecision returns exponential notation if the number of significant digits // specified is less than the number of digits necessary to represent the integer // part of the value in fixed-point notation. // Exponential notation. if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { // Append zeros? for (; len < i; str += '0', len++); str = toExponential(str, e); // Fixed-point notation. } else { i -= ne; str = toFixedPoint(str, e, '0'); // Append zeros? if (e + 1 > len) { if (--i > 0) for (str += '.'; i--; str += '0'); } else { i += e - len; if (i > 0) { if (e + 1 == len) str += '.'; for (; i--; str += '0'); } } } } return n.s < 0 && c0 ? '-' + str : str; } // Handle BigNumber.max and BigNumber.min. function maxOrMin(args, method) { var n, i = 1, m = new BigNumber(args[0]); for (; i < args.length; i++) { n = new BigNumber(args[i]); // If any number is NaN, return NaN. if (!n.s) { m = n; break; } else if (method.call(m, n)) { m = n; } } return m; } /* * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. * Called by minus, plus and times. */ function normalise(n, c, e) { var i = 1, j = c.length; // Remove trailing zeros. for (; !c[--j]; c.pop()); // Calculate the base 10 exponent. First get the number of digits of c[0]. for (j = c[0]; j >= 10; j /= 10, i++); // Overflow? if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { // Infinity. n.c = n.e = null; // Underflow? } else if (e < MIN_EXP) { // Zero. n.c = [n.e = 0]; } else { n.e = e; n.c = c; } return n; } // Handle values that fail the validity test in BigNumber. parseNumeric = (function () { var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; return function (x, str, isNum, b) { var base, s = isNum ? str : str.replace(whitespaceOrPlus, ''); // No exception on ±Infinity or NaN. if (isInfinityOrNaN.test(s)) { x.s = isNaN(s) ? null : s < 0 ? -1 : 1; } else { if (!isNum) { // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i s = s.replace(basePrefix, function (m, p1, p2) { base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; return !b || b == base ? p1 : m; }); if (b) { base = b; // E.g. '1.' to '1', '.1' to '0.1' s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); } if (str != s) return new BigNumber(s, base); } // '[BigNumber Error] Not a number: {n}' // '[BigNumber Error] Not a base {b} number: {n}' if (BigNumber.DEBUG) { throw Error (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); } // NaN x.s = null; } x.c = x.e = null; } })(); /* * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. * If r is truthy, it is known that there are more digits after the rounding digit. */ function round(x, sd, rm, r) { var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN; // if x is not Infinity or NaN... if (xc) { // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. // n is a base 1e14 number, the value of the element of array x.c containing rd. // ni is the index of n within x.c. // d is the number of digits of n. // i is the index of rd within n including leading zeros. // j is the actual index of rd within n (if < 0, rd is a leading zero). out: { // Get the number of digits of the first element of xc. for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); i = sd - d; // If the rounding digit is in the first element of xc... if (i < 0) { i += LOG_BASE; j = sd; n = xc[ni = 0]; // Get the rounding digit at index j of n. rd = n / pows10[d - j - 1] % 10 | 0; } else { ni = mathceil((i + 1) / LOG_BASE); if (ni >= xc.length) { if (r) { // Needed by sqrt. for (; xc.length <= ni; xc.push(0)); n = rd = 0; d = 1; i %= LOG_BASE; j = i - LOG_BASE + 1; } else { break out; } } else { n = k = xc[ni]; // Get the number of digits of n. for (d = 1; k >= 10; k /= 10, d++); // Get the index of rd within n. i %= LOG_BASE; // Get the index of rd within n, adjusted for leading zeros. // The number of leading zeros of n is given by LOG_BASE - d. j = i - LOG_BASE + d; // Get the rounding digit at index j of n. rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; } } r = r || sd < 0 || // Are there any non-zero digits after the rounding digit? // The expression n % pows10[d - j - 1] returns all digits of n to the right // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && // Check whether the digit to the left of the rounding digit is odd. ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || rm == (x.s < 0 ? 8 : 7)); if (sd < 1 || !xc[0]) { xc.length = 0; if (r) { // Convert sd to decimal places. sd -= x.e + 1; // 1, 0.1, 0.01, 0.001, 0.0001 etc. xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; x.e = -sd || 0; } else { // Zero. xc[0] = x.e = 0; } return x; } // Remove excess digits. if (i == 0) { xc.length = ni; k = 1; ni--; } else { xc.length = ni + 1; k = pows10[LOG_BASE - i]; // E.g. 56700 becomes 56000 if 7 is the rounding digit. // j > 0 means i > number of leading zeros of n. xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; } // Round up? if (r) { for (; ;) { // If the digit to be rounded up is in the first element of xc... if (ni == 0) { // i will be the length of xc[0] before k is added. for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); j = xc[0] += k; for (k = 1; j >= 10; j /= 10, k++); // if i != k the length has increased. if (i != k) { x.e++; if (xc[0] == BASE) xc[0] = 1; } break; } else { xc[ni] += k; if (xc[ni] != BASE) break; xc[ni--] = 0; k = 1; } } } // Remove trailing zeros. for (i = xc.length; xc[--i] === 0; xc.pop()); } // Overflow? Infinity. if (x.e > MAX_EXP) { x.c = x.e = null; // Underflow? Zero. } else if (x.e < MIN_EXP) { x.c = [x.e = 0]; } } return x; } function valueOf(n) { var str, e = n.e; if (e === null) return n.toString(); str = coeffToString(n.c); str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, '0'); return n.s < 0 ? '-' + str : str; } // PROTOTYPE/INSTANCE METHODS /* * Return a new BigNumber whose value is the absolute value of this BigNumber. */ P.absoluteValue = P.abs = function () { var x = new BigNumber(this); if (x.s < 0) x.s = 1; return x; }; /* * Return * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), * 0 if they have the same value, * or null if the value of either is NaN. */ P.comparedTo = function (y, b) { return compare(this, new BigNumber(y, b)); }; /* * If dp is undefined or null or true or false, return the number of decimal places of the * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. * * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or * ROUNDING_MODE if rm is omitted. * * [dp] {number} Decimal places: integer, 0 to MAX inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' */ P.decimalPlaces = P.dp = function (dp, rm) { var c, n, v, x = this; if (dp != null) { intCheck(dp, 0, MAX); if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); return round(new BigNumber(x), dp + x.e + 1, rm); } if (!(c = x.c)) return null; n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; // Subtract the number of trailing zeros of the last number. if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); if (n < 0) n = 0; return n; }; /* * n / 0 = I * n / N = N * n / I = 0 * 0 / n = 0 * 0 / 0 = N * 0 / N = N * 0 / I = 0 * N / n = N * N / 0 = N * N / N = N * N / I = N * I / n = I * I / 0 = I * I / N = N * I / I = N * * Return a new BigNumber whose value is the value of this BigNumber divided by the value of * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. */ P.dividedBy = P.div = function (y, b) { return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); }; /* * Return a new BigNumber whose value is the integer part of dividing the value of this * BigNumber by the value of BigNumber(y, b). */ P.dividedToIntegerBy = P.idiv = function (y, b) { return div(this, new BigNumber(y, b), 0, 1); }; /* * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. * * If m is present, return the result modulo m. * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. * * The modular power operation works efficiently when x, n, and m are integers, otherwise it * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. * * n {number|string|BigNumber} The exponent. An integer. * [m] {number|string|BigNumber} The modulus. * * '[BigNumber Error] Exponent not an integer: {n}' */ P.exponentiatedBy = P.pow = function (n, m) { var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this; n = new BigNumber(n); // Allow NaN and ±Infinity, but not other non-integers. if (n.c && !n.isInteger()) { throw Error (bignumberError + 'Exponent not an integer: ' + valueOf(n)); } if (m != null) m = new BigNumber(m); // Exponent of MAX_SAFE_INTEGER is 15. nIsBig = n.e > 14; // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { // The sign of the result of pow when x is negative depends on the evenness of n. // If +n overflows to ±Infinity, the evenness of n would be not be known. y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n))); return m ? y.mod(m) : y; } nIsNeg = n.s < 0; if (m) { // x % m returns NaN if abs(m) is zero, or m is NaN. if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); isModExp = !nIsNeg && x.isInteger() && m.isInteger(); if (isModExp) x = x.mod(m); // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 // [1, 240000000] ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 // [80000000000000] [99999750000000] : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { // If x is negative and n is odd, k = -0, else k = 0. k = x.s < 0 && isOdd(n) ? -0 : 0; // If x >= 1, k = ±Infinity. if (x.e > -1) k = 1 / k; // If n is negative return ±0, else return ±Infinity. return new BigNumber(nIsNeg ? 1 / k : k); } else if (POW_PRECISION) { // Truncating each coefficient array to a length of k after each multiplication // equates to truncating significant digits to POW_PRECISION + [28, 41], // i.e. there will be a minimum of 28 guard digits retained. k = mathceil(POW_PRECISION / LOG_BASE + 2); } if (nIsBig) { half = new BigNumber(0.5); if (nIsNeg) n.s = 1; nIsOdd = isOdd(n); } else { i = Math.abs(+valueOf(n)); nIsOdd = i % 2; } y = new BigNumber(ONE); // Performs 54 loop iterations for n of 9007199254740991. for (; ;) { if (nIsOdd) { y = y.times(x); if (!y.c) break; if (k) { if (y.c.length > k) y.c.length = k; } else if (isModExp) { y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); } } if (i) { i = mathfloor(i / 2); if (i === 0) break; nIsOdd = i % 2; } else { n = n.times(half); round(n, n.e + 1, 1); if (n.e > 14) { nIsOdd = isOdd(n); } else { i = +valueOf(n); if (i === 0) break; nIsOdd = i % 2; } } x = x.times(x); if (k) { if (x.c && x.c.length > k) x.c.length = k; } else if (isModExp) { x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); } } if (isModExp) return y; if (nIsNeg) y = ONE.div(y); return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; }; /* * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer * using rounding mode rm, or ROUNDING_MODE if rm is omitted. * * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' */ P.integerValue = function (rm) { var n = new BigNumber(this); if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); return round(n, n.e + 1, rm); }; /* * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), * otherwise return false. */ P.isEqualTo = P.eq = function (y, b) { return compare(this, new BigNumber(y, b)) === 0; }; /* * Return true if the value of this BigNumber is a finite number, otherwise return false. */ P.isFinite = function () { return !!this.c; }; /* * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), * otherwise return false. */ P.isGreaterThan = P.gt = function (y, b) { return compare(this, new BigNumber(y, b)) > 0; }; /* * Return true if the value of this BigNumber is greater than or equal to the value of * BigNumber(y, b), otherwise return false. */ P.isGreaterThanOrEqualTo = P.gte = function (y, b) { return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; }; /* * Return true if the value of this BigNumber is an integer, otherwise return false. */ P.isInteger = function () { return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; }; /* * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), * otherwise return false. */ P.isLessThan = P.lt = function (y, b) { return compare(this, new BigNumber(y, b)) < 0; }; /* * Return true if the value of this BigNumber is less than or equal to the value of * BigNumber(y, b), otherwise return false. */ P.isLessThanOrEqualTo = P.lte = function (y, b) { return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; }; /* * Return true if the value of this BigNumber is NaN, otherwise return false. */ P.isNaN = function () { return !this.s; }; /* * Return true if the value of this BigNumber is negative, otherwise return false. */ P.isNegative = function () { return this.s < 0; }; /* * Return true if the value of this BigNumber is positive, otherwise return false. */ P.isPositive = function () { return this.s > 0; }; /* * Return true if the value of this BigNumber is 0 or -0, otherwise return false. */ P.isZero = function () { return !!this.c && this.c[0] == 0; }; /* * n - 0 = n * n - N = N * n - I = -I * 0 - n = -n * 0 - 0 = 0 * 0 - N = N * 0 - I = -I * N - n = N * N - 0 = N * N - N = N * N - I = N * I - n = I * I - 0 = I * I - N = N * I - I = N * * Return a new BigNumber whose value is the value of this BigNumber minus the value of * BigNumber(y, b). */ P.minus = function (y, b) { var i, j, t, xLTy, x = this, a = x.s; y = new BigNumber(y, b); b = y.s; // Either NaN? if (!a || !b) return new BigNumber(NaN); // Signs differ? if (a != b) { y.s = -b; return x.plus(y); } var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c; if (!xe || !ye) { // Either Infinity? if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); // Either zero? if (!xc[0] || !yc[0]) { // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity ROUNDING_MODE == 3 ? -0 : 0); } } xe = bitFloor(xe); ye = bitFloor(ye); xc = xc.slice(); // Determine which is the bigger number. if (a = xe - ye) { if (xLTy = a < 0) { a = -a; t = xc; } else { ye = xe; t = yc; } t.reverse(); // Prepend zeros to equalise exponents. for (b = a; b--; t.push(0)); t.reverse(); } else { // Exponents equal. Check digit by digit. j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; for (a = b = 0; b < j; b++) { if (xc[b] != yc[b]) { xLTy = xc[b] < yc[b]; break; } } } // x < y? Point xc to the array of the bigger number. if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; b = (j = yc.length) - (i = xc.length); // Append zeros to xc if shorter. // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. if (b > 0) for (; b--; xc[i++] = 0); b = BASE - 1; // Subtract yc from xc. for (; j > a;) { if (xc[--j] < yc[j]) { for (i = j; i && !xc[--i]; xc[i] = b); --xc[i]; xc[j] += BASE; } xc[j] -= yc[j]; } // Remove leading zeros and adjust exponent accordingly. for (; xc[0] == 0; xc.splice(0, 1), --ye); // Zero? if (!xc[0]) { // Following IEEE 754 (2008) 6.3, // n - n = +0 but n - n = -0 when rounding towards -Infinity. y.s = ROUNDING_MODE == 3 ? -1 : 1; y.c = [y.e = 0]; return y; } // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity // for finite x and y. return normalise(y, xc, ye); }; /* * n % 0 = N * n % N = N * n % I = n * 0 % n = 0 * -0 % n = -0 * 0 % 0 = N * 0 % N = N * 0 % I = 0 * N % n = N * N % 0 = N * N % N = N * N % I = N * I % n = N * I % 0 = N * I % N = N * I % I = N * * Return a new BigNumber whose value is the value of this BigNumber modulo the value of * BigNumber(y, b). The result depends on the value of MODULO_MODE. */ P.modulo = P.mod = function (y, b) { var q, s, x = this; y = new BigNumber(y, b); // Return NaN if x is Infinity or NaN, or y is NaN or zero. if (!x.c || !y.s || y.c && !y.c[0]) { return new BigNumber(NaN); // Return x if y is Infinity or x is zero. } else if (!y.c || x.c && !x.c[0]) { return new BigNumber(x); } if (MODULO_MODE == 9) { // Euclidian division: q = sign(y) * floor(x / abs(y)) // r = x - qy where 0 <= r < abs(y) s = y.s; y.s = 1; q = div(x, y, 0, 3); y.s = s; q.s *= s; } else { q = div(x, y, 0, MODULO_MODE); } y = x.minus(q.times(y)); // To match JavaScript %, ensure sign of zero is sign of dividend. if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; return y; }; /* * n * 0 = 0 * n * N = N * n * I = I * 0 * n = 0 * 0 * 0 = 0 * 0 * N = N * 0 * I = N * N * n = N * N * 0 = N * N * N = N * N * I = N * I * n = I * I * 0 = N * I * N = N * I * I = I * * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value * of BigNumber(y, b). */ P.multipliedBy = P.times = function (y, b) { var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber(y, b)).c; // Either NaN, ±Infinity or ±0? if (!xc || !yc || !xc[0] || !yc[0]) { // Return NaN if either is NaN, or one is 0 and the other is Infinity. if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { y.c = y.e = y.s = null; } else { y.s *= x.s; // Return ±Infinity if either is ±Infinity. if (!xc || !yc) { y.c = y.e = null; // Return ±0 if either is ±0. } else { y.c = [0]; y.e = 0; } } return y; } e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); y.s *= x.s; xcL = xc.length; ycL = yc.length; // Ensure xc points to longer array and xcL to its length. if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; // Initialise the result array with zeros. for (i = xcL + ycL, zc = []; i--; zc.push(0)); base = BASE; sqrtBase = SQRT_BASE; for (i = ycL; --i >= 0;) { c = 0; ylo = yc[i] % sqrtBase; yhi = yc[i] / sqrtBase | 0; for (k = xcL, j = i + k; j > i;) { xlo = xc[--k] % sqrtBase; xhi = xc[k] / sqrtBase | 0; m = yhi * xlo + xhi * ylo; xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; zc[j--] = xlo % base; } zc[j] = c; } if (c) { ++e; } else { zc.splice(0, 1); } return normalise(y, zc, e); }; /* * Return a new BigNumber whose value is the value of this BigNumber negated, * i.e. multiplied by -1. */ P.negated = function () { var x = new BigNumber(this); x.s = -x.s || null; return x; }; /* * n + 0 = n * n + N = N * n + I = I * 0 + n = n * 0 + 0 = 0 * 0 + N = N * 0 + I = I * N + n = N * N + 0 = N * N + N = N * N + I = N * I + n = I * I + 0 = I * I + N = N * I + I = I * * Return a new BigNumber whose value is the value of this BigNumber plus the value of * BigNumber(y, b). */ P.plus = function (y, b) { var t, x = this, a = x.s; y = new BigNumber(y, b); b = y.s; // Either NaN? if (!a || !b) return new BigNumber(NaN); // Signs differ? if (a != b) { y.s = -b; return x.minus(y); } var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c; if (!xe || !ye) { // Return ±Infinity if either ±Infinity. if (!xc || !yc) return new BigNumber(a / 0); // Either zero? // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); } xe = bitFloor(xe); ye = bitFloor(ye); xc = xc.slice(); // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. if (a = xe - ye) { if (a > 0) { ye = xe; t = yc; } else { a = -a; t = xc; } t.reverse(); for (; a--; t.push(0)); t.reverse(); } a = xc.length; b = yc.length; // Point xc to the longer array, and b to the shorter length. if (a - b < 0) t = yc, yc = xc, xc = t, b = a; // Only start adding at yc.length - 1 as the further digits of xc can be ignored. for (a = 0; b;) { a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; } if (a) { xc = [a].concat(xc); ++ye; } // No need to check for zero, as +x + +y != 0 && -x + -y != 0 // ye = MAX_EXP + 1 possible return normalise(y, xc, ye); }; /* * If sd is undefined or null or true or false, return the number of significant digits of * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. * If sd is true include integer-part trailing zeros in the count. * * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or * ROUNDING_MODE if rm is omitted. * * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. * boolean: whether to count integer-part trailing zeros: true or false. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' */ P.precision = P.sd = function (sd, rm) { var c, n, v, x = this; if (sd != null && sd !== !!sd) { intCheck(sd, 1, MAX); if (rm == null) rm = ROUNDING_MODE; else intCheck(rm, 0, 8); return round(new BigNumber(x), sd, rm); } if (!(c = x.c)) return null; v = c.length - 1; n = v * LOG_BASE + 1; if (v = c[v]) { // Subtract the number of trailing zeros of the last element. for (; v % 10 == 0; v /= 10, n--); // Add the number of digits of the first element. for (v = c[0]; v >= 10; v /= 10, n++); } if (sd && x.e + 1 > n) n = x.e + 1; return n; }; /* * Return a new BigNumber whose value is the value of this BigNumber shifted by k places * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. * * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' */ P.shiftedBy = function (k) { intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); return this.times('1e' + k); }; /* * sqrt(-n) = N * sqrt(N) = N * sqrt(-I) = N * sqrt(I) = I * sqrt(0) = 0 * sqrt(-0) = -0 * * Return a new BigNumber whose value is the square root of the value of this BigNumber, * rounded according to DECIMAL_PLACES and ROUNDING_MODE. */ P.squareRoot = P.sqrt = function () { var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber('0.5'); // Negative/NaN/Infinity/zero? if (s !== 1 || !c || !c[0]) { return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); } // Initial estimate. s = Math.sqrt(+valueOf(x)); // Math.sqrt underflow/overflow? // Pass x to Math.sqrt as integer, then adjust the exponent of the result. if (s == 0 || s == 1 / 0) { n = coeffToString(c); if ((n.length + e) % 2 == 0) n += '0'; s = Math.sqrt(+n); e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); if (s == 1 / 0) { n = '5e' + e; } else { n = s.toExponential(); n = n.slice(0, n.indexOf('e') + 1) + e; } r = new BigNumber(n); } else { r = new BigNumber(s + ''); } // Check for zero. // r could be zero if MIN_EXP is changed after the this value was created. // This would cause a division by zero (x/t) and hence Infinity below, which would cause // coeffToString to throw. if (r.c[0]) { e = r.e; s = e + dp; if (s < 3) s = 0; // Newton-Raphson iteration. for (; ;) { t = r; r = half.times(t.plus(div(x, t, dp, 1))); if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) { // The exponent of r may here be one less than the final result exponent, // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits // are indexed correctly. if (r.e < e) --s; n = n.slice(s - 3, s + 1); // The 4th rounding digit may be in error by -1 so if the 4 rounding digits // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the // iteration. if (n == '9999' || !rep && n == '4999') { // On the first iteration only, check to see if rounding up gives the // exact result as the nines may infinitely repeat. if (!rep) { round(t, t.e + DECIMAL_PLACES + 2, 0); if (t.times(t).eq(x)) { r = t; break; } } dp += 4; s += 4; rep = 1; } else { // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact // result. If not, then there are further digits and m will be truthy. if (!+n || !+n.slice(1) && n.charAt(0) == '5') { // Truncate to the first rounding digit. round(r, r.e + DECIMAL_PLACES + 2, 1); m = !r.times(r).eq(x); } break; } } } } return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); }; /* * Return a string representing the value of this BigNumber in exponential notation and * rounded using ROUNDING_MODE to dp fixed decimal places. * * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' */ P.toExponential = function (dp, rm) { if (dp != null) { intCheck(dp, 0, MAX); dp++; } return format(this, dp, rm, 1); }; /* * Return a string representing the value of this BigNumber in fixed-point notation rounding * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. * * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', * but e.g. (-0.00001).toFixed(0) is '-0'. * * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' */ P.toFixed = function (dp, rm) { if (dp != null) { intCheck(dp, 0, MAX); dp = dp + this.e + 1; } return format(this, dp, rm); }; /* * Return a string representing the value of this BigNumber in fixed-point notation rounded * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties * of the format or FORMAT object (see BigNumber.set). * * The formatting object may contain some or all of the properties shown below. * * FORMAT = { * prefix: '', * groupSize: 3, * secondaryGroupSize: 0, * groupSeparator: ',', * decimalSeparator: '.', * fractionGroupSize: 0, * fractionGroupSeparator: '\xA0', // non-breaking space * suffix: '' * }; * * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * [format] {object} Formatting options. See FORMAT pbject above. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' * '[BigNumber Error] Argument not an object: {format}' */ P.toFormat = function (dp, rm, format) { var str, x = this; if (format == null) { if (dp != null && rm && typeof rm == 'object') { format = rm; rm = null; } else if (dp && typeof dp == 'object') { format = dp; dp = rm = null; } else { format = FORMAT; } } else if (typeof format != 'object') { throw Error (bignumberError + 'Argument not an object: ' + format); } str = x.toFixed(dp, rm); if (x.c) { var i, arr = str.split('.'), g1 = +format.groupSize, g2 = +format.secondaryGroupSize, groupSeparator = format.groupSeparator || '', intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length; if (g2) i = g1, g1 = g2, g2 = i, len -= i; if (g1 > 0 && len > 0) { i = len % g1 || g1; intPart = intDigits.substr(0, i); for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1); if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); if (isNeg) intPart = '-' + intPart; } str = fractionPart ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize) ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), '$&' + (format.fractionGroupSeparator || '')) : fractionPart) : intPart; } return (format.prefix || '') + str + (format.suffix || ''); }; /* * Return an array of two BigNumbers representing the value of this BigNumber as a simple * fraction with an integer numerator and an integer denominator. * The denominator will be a positive non-zero value less than or equal to the specified * maximum denominator. If a maximum denominator is not specified, the denominator will be * the lowest value necessary to represent the number exactly. * * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. * * '[BigNumber Error] Argument {not an integer|out of range} : {md}' */ P.toFraction = function (md) { var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c; if (md != null) { n = new BigNumber(md); // Throw if md is less than one or is not an integer, unless it is Infinity. if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { throw Error (bignumberError + 'Argument ' + (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n)); } } if (!xc) return new BigNumber(x); d = new BigNumber(ONE); n1 = d0 = new BigNumber(ONE); d1 = n0 = new BigNumber(ONE); s = coeffToString(xc); // Determine initial denominator. // d is a power of 10 and the minimum max denominator that specifies the value exactly. e = d.e = s.length - x.e - 1; d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; exp = MAX_EXP; MAX_EXP = 1 / 0; n = new BigNumber(s); // n0 = d1 = 0 n0.c[0] = 0; for (; ;) { q = div(n, d, 0, 1); d2 = d0.plus(q.times(d1)); if (d2.comparedTo(md) == 1) break; d0 = d1; d1 = d2; n1 = n0.plus(q.times(d2 = n1)); n0 = d2; d = n.minus(q.times(d2 = d)); n = d2; } d2 = div(md.minus(d0), d1, 0, 1); n0 = n0.plus(d2.times(n1)); d0 = d0.plus(d2.times(d1)); n0.s = n1.s = x.s; e = e * 2; // Determine which fraction is closer to x, n0/d0 or n1/d1 r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; MAX_EXP = exp; return r; }; /* * Return the value of this BigNumber converted to a number primitive. */ P.toNumber = function () { return +valueOf(this); }; /* * Return a string representing the value of this BigNumber rounded to sd significant digits * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits * necessary to represent the integer part of the value in fixed-point notation, then use * exponential notation. * * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. * * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' */ P.toPrecision = function (sd, rm) { if (sd != null) intCheck(sd, 1, MAX); return format(this, sd, rm, 2); }; /* * Return a string representing the value of this BigNumber in base b, or base 10 if b is * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than * TO_EXP_NEG, return exponential notation. * * [b] {number} Integer, 2 to ALPHABET.length inclusive. * * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' */ P.toString = function (b) { var str, n = this, s = n.s, e = n.e; // Infinity or NaN? if (e === null) { if (s) { str = 'Infinity'; if (s < 0) str = '-' + str; } else { str = 'NaN'; } } else { if (b == null) { str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, '0'); } else if (b === 10 && alphabetHasNormalDecimalDigits) { n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE); str = toFixedPoint(coeffToString(n.c), n.e, '0'); } else { intCheck(b, 2, ALPHABET.length, 'Base'); str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true); } if (s < 0 && n.c[0]) str = '-' + str; } return str; }; /* * Return as toString, but do not accept a base argument, and include the minus sign for * negative zero. */ P.valueOf = P.toJSON = function () { return valueOf(this); }; P._isBigNumber = true; if (configObject != null) BigNumber.set(configObject); return BigNumber; } // PRIVATE HELPER FUNCTIONS // These functions don't need access to variables, // e.g. DECIMAL_PLACES, in the scope of the `clone` function above. function bitFloor(n) { var i = n | 0; return n > 0 || n === i ? i : i - 1; } // Return a coefficient array as a string of base 10 digits. function coeffToString(a) { var s, z, i = 1, j = a.length, r = a[0] + ''; for (; i < j;) { s = a[i++] + ''; z = LOG_BASE - s.length; for (; z--; s = '0' + s); r += s; } // Determine trailing zeros. for (j = r.length; r.charCodeAt(--j) === 48;); return r.slice(0, j + 1 || 1); } // Compare the value of BigNumbers x and y. function compare(x, y) { var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e; // Either NaN? if (!i || !j) return null; a = xc && !xc[0]; b = yc && !yc[0]; // Either zero? if (a || b) return a ? b ? 0 : -j : i; // Signs differ? if (i != j) return i; a = i < 0; b = k == l; // Either Infinity? if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; // Compare exponents. if (!b) return k > l ^ a ? 1 : -1; j = (k = xc.length) < (l = yc.length) ? k : l; // Compare digit by digit. for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; // Compare lengths. return k == l ? 0 : k > l ^ a ? 1 : -1; } /* * Check that n is a primitive number, an integer, and in range, otherwise throw. */ function intCheck(n, min, max, name) { if (n < min || n > max || n !== mathfloor(n)) { throw Error (bignumberError + (name || 'Argument') + (typeof n == 'number' ? n < min || n > max ? ' out of range: ' : ' not an integer: ' : ' not a primitive number: ') + String(n)); } } // Assumes finite n. function isOdd(n) { var k = n.c.length - 1; return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; } function toExponential(str, e) { return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + (e < 0 ? 'e' : 'e+') + e; } function toFixedPoint(str, e, z) { var len, zs; // Negative exponent? if (e < 0) { // Prepend zeros. for (zs = z + '.'; ++e; zs += z); str = zs + str; // Positive exponent } else { len = str.length; // Append zeros. if (++e > len) { for (zs = z, e -= len; --e; zs += z); str += zs; } else if (e < len) { str = str.slice(0, e) + '.' + str.slice(e); } } return str; } // EXPORT BigNumber = clone(); BigNumber['default'] = BigNumber.BigNumber = BigNumber; // AMD. if (typeof define == 'function' && define.amd) { define(function () { return BigNumber; }); // Node.js and other environments that support module.exports. } else if ( true && module.exports) { module.exports = BigNumber; // Browser. } else { if (!globalObject) { globalObject = typeof self != 'undefined' && self ? self : window; } globalObject.BigNumber = BigNumber; } })(this); /***/ }), /***/ 33717: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var concatMap = __webpack_require__(86891); var balanced = __webpack_require__(9417); module.exports = expandTop; var escSlash = '\0SLASH'+Math.random()+'\0'; var escOpen = '\0OPEN'+Math.random()+'\0'; var escClose = '\0CLOSE'+Math.random()+'\0'; var escComma = '\0COMMA'+Math.random()+'\0'; var escPeriod = '\0PERIOD'+Math.random()+'\0'; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split('\\\\').join(escSlash) .split('\\{').join(escOpen) .split('\\}').join(escClose) .split('\\,').join(escComma) .split('\\.').join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join('\\') .split(escOpen).join('{') .split(escClose).join('}') .split(escComma).join(',') .split(escPeriod).join('.'); } // Basically just str.split(","), but handling cases // where we have nested braced sections, which should be // treated as individual members, like {a,{b,c},d} function parseCommaParts(str) { if (!str) return ['']; var parts = []; var m = balanced('{', '}', str); if (!m) return str.split(','); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(','); p[p.length-1] += '{' + body + '}'; var postParts = parseCommaParts(post); if (post.length) { p[p.length-1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, // but a{},b}c will be expanded to [a}c,abc]. // One could argue that this is a bug in Bash, but since the goal of // this module is to match Bash's rules, we escape a leading {} if (str.substr(0, 2) === '{}') { str = '\\{\\}' + str.substr(2); } return expand(escapeBraces(str), true).map(unescapeBraces); } function identity(e) { return e; } function embrace(str) { return '{' + str + '}'; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); if (!m || /\$$/.test(m.pre)) return [str]; var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(',') >= 0; if (!isSequence && !isOptions) { // {a},b} if (m.post.match(/,.*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { // x{{a,b}}y ==> x{a}y x{b}y n = expand(n[0], false).map(embrace); if (n.length === 1) { var post = m.post.length ? expand(m.post, false) : ['']; return post.map(function(p) { return m.pre + n[0] + p; }); } } } // at this point, n is the parts, and we know it's not a comma set // with a single entry. // no need to expand pre, since it is guaranteed to be free of brace-sets var pre = m.pre; var post = m.post.length ? expand(m.post, false) : ['']; var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length) var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === '\\') c = ''; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join('0'); if (i < 0) c = '-' + z + c.slice(1); else c = z + c; } } } N.push(c); } } else { N = concatMap(n, function(el) { return expand(el, false) }); } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } return expansions; } /***/ }), /***/ 9239: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*jshint node:true */ var Buffer = __webpack_require__(64293).Buffer; // browserify var SlowBuffer = __webpack_require__(64293).SlowBuffer; module.exports = bufferEq; function bufferEq(a, b) { // shortcutting on type is necessary for correctness if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { return false; } // buffer sizes should be well-known information, so despite this // shortcutting, it doesn't leak any information about the *contents* of the // buffers. if (a.length !== b.length) { return false; } var c = 0; for (var i = 0; i < a.length; i++) { /*jshint bitwise:false */ c |= a[i] ^ b[i]; // XOR } return c === 0; } bufferEq.install = function() { Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) { return bufferEq(this, that); }; }; var origBufEqual = Buffer.prototype.equal; var origSlowBufEqual = SlowBuffer.prototype.equal; bufferEq.restore = function() { Buffer.prototype.equal = origBufEqual; SlowBuffer.prototype.equal = origSlowBufEqual; }; /***/ }), /***/ 29700: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright (C) 2011-2015 John Hewson // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. var stream = __webpack_require__(92413), util = __webpack_require__(31669), timers = __webpack_require__(78213); // convinience API module.exports = function(readStream, options) { return module.exports.createStream(readStream, options); }; // basic API module.exports.createStream = function(readStream, options) { if (readStream) { return createLineStream(readStream, options); } else { return new LineStream(options); } }; // deprecated API module.exports.createLineStream = function(readStream) { console.log('WARNING: byline#createLineStream is deprecated and will be removed soon'); return createLineStream(readStream); }; function createLineStream(readStream, options) { if (!readStream) { throw new Error('expected readStream'); } if (!readStream.readable) { throw new Error('readStream must be readable'); } var ls = new LineStream(options); readStream.pipe(ls); return ls; } // // using the new node v0.10 "streams2" API // module.exports.LineStream = LineStream; function LineStream(options) { stream.Transform.call(this, options); options = options || {}; // use objectMode to stop the output from being buffered // which re-concatanates the lines, just without newlines. this._readableState.objectMode = true; this._lineBuffer = []; this._keepEmptyLines = options.keepEmptyLines || false; this._lastChunkEndedWithCR = false; // take the source's encoding if we don't have one var self = this; this.on('pipe', function(src) { if (!self.encoding) { // but we can't do this for old-style streams if (src instanceof stream.Readable) { self.encoding = src._readableState.encoding; } } }); } util.inherits(LineStream, stream.Transform); LineStream.prototype._transform = function(chunk, encoding, done) { // decode binary chunks as UTF-8 encoding = encoding || 'utf8'; if (Buffer.isBuffer(chunk)) { if (encoding == 'buffer') { chunk = chunk.toString(); // utf8 encoding = 'utf8'; } else { chunk = chunk.toString(encoding); } } this._chunkEncoding = encoding; // see: http://www.unicode.org/reports/tr18/#Line_Boundaries var lines = chunk.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g); // don't split CRLF which spans chunks if (this._lastChunkEndedWithCR && chunk[0] == '\n') { lines.shift(); } if (this._lineBuffer.length > 0) { this._lineBuffer[this._lineBuffer.length - 1] += lines[0]; lines.shift(); } this._lastChunkEndedWithCR = chunk[chunk.length - 1] == '\r'; this._lineBuffer = this._lineBuffer.concat(lines); this._pushBuffer(encoding, 1, done); }; LineStream.prototype._pushBuffer = function(encoding, keep, done) { // always buffer the last (possibly partial) line while (this._lineBuffer.length > keep) { var line = this._lineBuffer.shift(); // skip empty lines if (this._keepEmptyLines || line.length > 0 ) { if (!this.push(this._reencode(line, encoding))) { // when the high-water mark is reached, defer pushes until the next tick var self = this; timers.setImmediate(function() { self._pushBuffer(encoding, keep, done); }); return; } } } done(); }; LineStream.prototype._flush = function(done) { this._pushBuffer(this._chunkEncoding, 0, done); }; // see Readable::push LineStream.prototype._reencode = function(line, chunkEncoding) { if (this.encoding && this.encoding != chunkEncoding) { return new Buffer(line, chunkEncoding).toString(this.encoding); } else if (this.encoding) { // this should be the most common case, i.e. we're using an encoded source stream return line; } else { return new Buffer(line, chunkEncoding); } }; /***/ }), /***/ 2286: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { V4MAPPED, ADDRCONFIG, ALL, promises: { Resolver: AsyncResolver }, lookup: dnsLookup } = __webpack_require__(40881); const {promisify} = __webpack_require__(31669); const os = __webpack_require__(12087); const kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection'); const kCacheableLookupInstance = Symbol('cacheableLookupInstance'); const kExpires = Symbol('expires'); const supportsALL = typeof ALL === 'number'; const verifyAgent = agent => { if (!(agent && typeof agent.createConnection === 'function')) { throw new Error('Expected an Agent instance as the first argument'); } }; const map4to6 = entries => { for (const entry of entries) { if (entry.family === 6) { continue; } entry.address = `::ffff:${entry.address}`; entry.family = 6; } }; const getIfaceInfo = () => { let has4 = false; let has6 = false; for (const device of Object.values(os.networkInterfaces())) { for (const iface of device) { if (iface.internal) { continue; } if (iface.family === 'IPv6') { has6 = true; } else { has4 = true; } if (has4 && has6) { return {has4, has6}; } } } return {has4, has6}; }; const isIterable = map => { return Symbol.iterator in map; }; const ttl = {ttl: true}; const all = {all: true}; class CacheableLookup { constructor({ cache = new Map(), maxTtl = Infinity, fallbackDuration = 3600, errorTtl = 0.15, resolver = new AsyncResolver(), lookup = dnsLookup } = {}) { this.maxTtl = maxTtl; this.errorTtl = errorTtl; this._cache = cache; this._resolver = resolver; this._dnsLookup = promisify(lookup); if (this._resolver instanceof AsyncResolver) { this._resolve4 = this._resolver.resolve4.bind(this._resolver); this._resolve6 = this._resolver.resolve6.bind(this._resolver); } else { this._resolve4 = promisify(this._resolver.resolve4.bind(this._resolver)); this._resolve6 = promisify(this._resolver.resolve6.bind(this._resolver)); } this._iface = getIfaceInfo(); this._pending = {}; this._nextRemovalTime = false; this._hostnamesToFallback = new Set(); if (fallbackDuration < 1) { this._fallback = false; } else { this._fallback = true; const interval = setInterval(() => { this._hostnamesToFallback.clear(); }, fallbackDuration * 1000); /* istanbul ignore next: There is no `interval.unref()` when running inside an Electron renderer */ if (interval.unref) { interval.unref(); } } this.lookup = this.lookup.bind(this); this.lookupAsync = this.lookupAsync.bind(this); } set servers(servers) { this.clear(); this._resolver.setServers(servers); } get servers() { return this._resolver.getServers(); } lookup(hostname, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } else if (typeof options === 'number') { options = { family: options }; } if (!callback) { throw new Error('Callback must be a function.'); } // eslint-disable-next-line promise/prefer-await-to-then this.lookupAsync(hostname, options).then(result => { if (options.all) { callback(null, result); } else { callback(null, result.address, result.family, result.expires, result.ttl); } }, callback); } async lookupAsync(hostname, options = {}) { if (typeof options === 'number') { options = { family: options }; } let cached = await this.query(hostname); if (options.family === 6) { const filtered = cached.filter(entry => entry.family === 6); if (options.hints & V4MAPPED) { if ((supportsALL && options.hints & ALL) || filtered.length === 0) { map4to6(cached); } else { cached = filtered; } } else { cached = filtered; } } else if (options.family === 4) { cached = cached.filter(entry => entry.family === 4); } if (options.hints & ADDRCONFIG) { const {_iface} = this; cached = cached.filter(entry => entry.family === 6 ? _iface.has6 : _iface.has4); } if (cached.length === 0) { const error = new Error(`cacheableLookup ENOTFOUND ${hostname}`); error.code = 'ENOTFOUND'; error.hostname = hostname; throw error; } if (options.all) { return cached; } return cached[0]; } async query(hostname) { let cached = await this._cache.get(hostname); if (!cached) { const pending = this._pending[hostname]; if (pending) { cached = await pending; } else { const newPromise = this.queryAndCache(hostname); this._pending[hostname] = newPromise; try { cached = await newPromise; } finally { delete this._pending[hostname]; } } } cached = cached.map(entry => { return {...entry}; }); return cached; } async _resolve(hostname) { const wrap = async promise => { try { return await promise; } catch (error) { if (error.code === 'ENODATA' || error.code === 'ENOTFOUND') { return []; } throw error; } }; // ANY is unsafe as it doesn't trigger new queries in the underlying server. const [A, AAAA] = await Promise.all([ this._resolve4(hostname, ttl), this._resolve6(hostname, ttl) ].map(promise => wrap(promise))); let aTtl = 0; let aaaaTtl = 0; let cacheTtl = 0; const now = Date.now(); for (const entry of A) { entry.family = 4; entry.expires = now + (entry.ttl * 1000); aTtl = Math.max(aTtl, entry.ttl); } for (const entry of AAAA) { entry.family = 6; entry.expires = now + (entry.ttl * 1000); aaaaTtl = Math.max(aaaaTtl, entry.ttl); } if (A.length > 0) { if (AAAA.length > 0) { cacheTtl = Math.min(aTtl, aaaaTtl); } else { cacheTtl = aTtl; } } else { cacheTtl = aaaaTtl; } return { entries: [ ...A, ...AAAA ], cacheTtl }; } async _lookup(hostname) { try { const entries = await this._dnsLookup(hostname, { all: true }); return { entries, cacheTtl: 0 }; } catch (_) { return { entries: [], cacheTtl: 0 }; } } async _set(hostname, data, cacheTtl) { if (this.maxTtl > 0 && cacheTtl > 0) { cacheTtl = Math.min(cacheTtl, this.maxTtl) * 1000; data[kExpires] = Date.now() + cacheTtl; try { await this._cache.set(hostname, data, cacheTtl); } catch (error) { this.lookupAsync = async () => { const cacheError = new Error('Cache Error. Please recreate the CacheableLookup instance.'); cacheError.cause = error; throw cacheError; }; } if (isIterable(this._cache)) { this._tick(cacheTtl); } } } async queryAndCache(hostname) { if (this._hostnamesToFallback.has(hostname)) { return this._dnsLookup(hostname, all); } let query = await this._resolve(hostname); if (query.entries.length === 0 && this._fallback) { query = await this._lookup(hostname); if (query.entries.length !== 0) { // Use `dns.lookup(...)` for that particular hostname this._hostnamesToFallback.add(hostname); } } const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl; await this._set(hostname, query.entries, cacheTtl); return query.entries; } _tick(ms) { const nextRemovalTime = this._nextRemovalTime; if (!nextRemovalTime || ms < nextRemovalTime) { clearTimeout(this._removalTimeout); this._nextRemovalTime = ms; this._removalTimeout = setTimeout(() => { this._nextRemovalTime = false; let nextExpiry = Infinity; const now = Date.now(); for (const [hostname, entries] of this._cache) { const expires = entries[kExpires]; if (now >= expires) { this._cache.delete(hostname); } else if (expires < nextExpiry) { nextExpiry = expires; } } if (nextExpiry !== Infinity) { this._tick(nextExpiry - now); } }, ms); /* istanbul ignore next: There is no `timeout.unref()` when running inside an Electron renderer */ if (this._removalTimeout.unref) { this._removalTimeout.unref(); } } } install(agent) { verifyAgent(agent); if (kCacheableLookupCreateConnection in agent) { throw new Error('CacheableLookup has been already installed'); } agent[kCacheableLookupCreateConnection] = agent.createConnection; agent[kCacheableLookupInstance] = this; agent.createConnection = (options, callback) => { if (!('lookup' in options)) { options.lookup = this.lookup; } return agent[kCacheableLookupCreateConnection](options, callback); }; } uninstall(agent) { verifyAgent(agent); if (agent[kCacheableLookupCreateConnection]) { if (agent[kCacheableLookupInstance] !== this) { throw new Error('The agent is not owned by this CacheableLookup instance'); } agent.createConnection = agent[kCacheableLookupCreateConnection]; delete agent[kCacheableLookupCreateConnection]; delete agent[kCacheableLookupInstance]; } } updateInterfaceInfo() { const {_iface} = this; this._iface = getIfaceInfo(); if ((_iface.has4 && !this._iface.has4) || (_iface.has6 && !this._iface.has6)) { this._cache.clear(); } } clear(hostname) { if (hostname) { this._cache.delete(hostname); return; } this._cache.clear(); } } module.exports = CacheableLookup; module.exports.default = CacheableLookup; /***/ }), /***/ 35684: /***/ ((module) => { function Caseless (dict) { this.dict = dict || {} } Caseless.prototype.set = function (name, value, clobber) { if (typeof name === 'object') { for (var i in name) { this.set(i, name[i], value) } } else { if (typeof clobber === 'undefined') clobber = true var has = this.has(name) if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value else this.dict[has || name] = value return has } } Caseless.prototype.has = function (name) { var keys = Object.keys(this.dict) , name = name.toLowerCase() ; for (var i=0;i { "use strict"; const fs = __webpack_require__(35747) const path = __webpack_require__(85622) /* istanbul ignore next */ const LCHOWN = fs.lchown ? 'lchown' : 'chown' /* istanbul ignore next */ const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync' /* istanbul ignore next */ const needEISDIRHandled = fs.lchown && !process.version.match(/v1[1-9]+\./) && !process.version.match(/v10\.[6-9]/) const lchownSync = (path, uid, gid) => { try { return fs[LCHOWNSYNC](path, uid, gid) } catch (er) { if (er.code !== 'ENOENT') throw er } } /* istanbul ignore next */ const chownSync = (path, uid, gid) => { try { return fs.chownSync(path, uid, gid) } catch (er) { if (er.code !== 'ENOENT') throw er } } /* istanbul ignore next */ const handleEISDIR = needEISDIRHandled ? (path, uid, gid, cb) => er => { // Node prior to v10 had a very questionable implementation of // fs.lchown, which would always try to call fs.open on a directory // Fall back to fs.chown in those cases. if (!er || er.code !== 'EISDIR') cb(er) else fs.chown(path, uid, gid, cb) } : (_, __, ___, cb) => cb /* istanbul ignore next */ const handleEISDirSync = needEISDIRHandled ? (path, uid, gid) => { try { return lchownSync(path, uid, gid) } catch (er) { if (er.code !== 'EISDIR') throw er chownSync(path, uid, gid) } } : (path, uid, gid) => lchownSync(path, uid, gid) // fs.readdir could only accept an options object as of node v6 const nodeVersion = process.version let readdir = (path, options, cb) => fs.readdir(path, options, cb) let readdirSync = (path, options) => fs.readdirSync(path, options) /* istanbul ignore next */ if (/^v4\./.test(nodeVersion)) readdir = (path, options, cb) => fs.readdir(path, cb) const chown = (cpath, uid, gid, cb) => { fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => { // Skip ENOENT error cb(er && er.code !== 'ENOENT' ? er : null) })) } const chownrKid = (p, child, uid, gid, cb) => { if (typeof child === 'string') return fs.lstat(path.resolve(p, child), (er, stats) => { // Skip ENOENT error if (er) return cb(er.code !== 'ENOENT' ? er : null) stats.name = child chownrKid(p, stats, uid, gid, cb) }) if (child.isDirectory()) { chownr(path.resolve(p, child.name), uid, gid, er => { if (er) return cb(er) const cpath = path.resolve(p, child.name) chown(cpath, uid, gid, cb) }) } else { const cpath = path.resolve(p, child.name) chown(cpath, uid, gid, cb) } } const chownr = (p, uid, gid, cb) => { readdir(p, { withFileTypes: true }, (er, children) => { // any error other than ENOTDIR or ENOTSUP means it's not readable, // or doesn't exist. give up. if (er) { if (er.code === 'ENOENT') return cb() else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') return cb(er) } if (er || !children.length) return chown(p, uid, gid, cb) let len = children.length let errState = null const then = er => { if (errState) return if (er) return cb(errState = er) if (-- len === 0) return chown(p, uid, gid, cb) } children.forEach(child => chownrKid(p, child, uid, gid, then)) }) } const chownrKidSync = (p, child, uid, gid) => { if (typeof child === 'string') { try { const stats = fs.lstatSync(path.resolve(p, child)) stats.name = child child = stats } catch (er) { if (er.code === 'ENOENT') return else throw er } } if (child.isDirectory()) chownrSync(path.resolve(p, child.name), uid, gid) handleEISDirSync(path.resolve(p, child.name), uid, gid) } const chownrSync = (p, uid, gid) => { let children try { children = readdirSync(p, { withFileTypes: true }) } catch (er) { if (er.code === 'ENOENT') return else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP') return handleEISDirSync(p, uid, gid) else throw er } if (children && children.length) children.forEach(child => chownrKidSync(p, child, uid, gid)) return handleEISDirSync(p, uid, gid) } module.exports = chownr chownr.sync = chownrSync /***/ }), /***/ 27972: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const os = __webpack_require__(12087); const extractPathRegex = /\s+at.*(?:\(|\s)(.*)\)?/; const pathRegex = /^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/; const homeDir = typeof os.homedir === 'undefined' ? '' : os.homedir(); module.exports = (stack, options) => { options = Object.assign({pretty: false}, options); return stack.replace(/\\/g, '/') .split('\n') .filter(line => { const pathMatches = line.match(extractPathRegex); if (pathMatches === null || !pathMatches[1]) { return true; } const match = pathMatches[1]; // Electron if ( match.includes('.app/Contents/Resources/electron.asar') || match.includes('.app/Contents/Resources/default_app.asar') ) { return false; } return !pathRegex.test(match); }) .filter(line => line.trim() !== '') .map(line => { if (options.pretty) { return line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~'))); } return line; }) .join('\n'); }; /***/ }), /***/ 81312: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const PassThrough = __webpack_require__(92413).PassThrough; const mimicResponse = __webpack_require__(42610); const cloneResponse = response => { if (!(response && response.pipe)) { throw new TypeError('Parameter `response` must be a response stream.'); } const clone = new PassThrough(); mimicResponse(response, clone); return response.pipe(clone); }; module.exports = cloneResponse; /***/ }), /***/ 85443: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var util = __webpack_require__(31669); var Stream = __webpack_require__(92413).Stream; var DelayedStream = __webpack_require__(18611); module.exports = CombinedStream; function CombinedStream() { this.writable = false; this.readable = true; this.dataSize = 0; this.maxDataSize = 2 * 1024 * 1024; this.pauseStreams = true; this._released = false; this._streams = []; this._currentStream = null; this._insideLoop = false; this._pendingNext = false; } util.inherits(CombinedStream, Stream); CombinedStream.create = function(options) { var combinedStream = new this(); options = options || {}; for (var option in options) { combinedStream[option] = options[option]; } return combinedStream; }; CombinedStream.isStreamLike = function(stream) { return (typeof stream !== 'function') && (typeof stream !== 'string') && (typeof stream !== 'boolean') && (typeof stream !== 'number') && (!Buffer.isBuffer(stream)); }; CombinedStream.prototype.append = function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { if (!(stream instanceof DelayedStream)) { var newStream = DelayedStream.create(stream, { maxDataSize: Infinity, pauseStream: this.pauseStreams, }); stream.on('data', this._checkDataSize.bind(this)); stream = newStream; } this._handleErrors(stream); if (this.pauseStreams) { stream.pause(); } } this._streams.push(stream); return this; }; CombinedStream.prototype.pipe = function(dest, options) { Stream.prototype.pipe.call(this, dest, options); this.resume(); return dest; }; CombinedStream.prototype._getNext = function() { this._currentStream = null; if (this._insideLoop) { this._pendingNext = true; return; // defer call } this._insideLoop = true; try { do { this._pendingNext = false; this._realGetNext(); } while (this._pendingNext); } finally { this._insideLoop = false; } }; CombinedStream.prototype._realGetNext = function() { var stream = this._streams.shift(); if (typeof stream == 'undefined') { this.end(); return; } if (typeof stream !== 'function') { this._pipeNext(stream); return; } var getStream = stream; getStream(function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { stream.on('data', this._checkDataSize.bind(this)); this._handleErrors(stream); } this._pipeNext(stream); }.bind(this)); }; CombinedStream.prototype._pipeNext = function(stream) { this._currentStream = stream; var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { stream.on('end', this._getNext.bind(this)); stream.pipe(this, {end: false}); return; } var value = stream; this.write(value); this._getNext(); }; CombinedStream.prototype._handleErrors = function(stream) { var self = this; stream.on('error', function(err) { self._emitError(err); }); }; CombinedStream.prototype.write = function(data) { this.emit('data', data); }; CombinedStream.prototype.pause = function() { if (!this.pauseStreams) { return; } if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); this.emit('pause'); }; CombinedStream.prototype.resume = function() { if (!this._released) { this._released = true; this.writable = true; this._getNext(); } if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); this.emit('resume'); }; CombinedStream.prototype.end = function() { this._reset(); this.emit('end'); }; CombinedStream.prototype.destroy = function() { this._reset(); this.emit('close'); }; CombinedStream.prototype._reset = function() { this.writable = false; this._streams = []; this._currentStream = null; }; CombinedStream.prototype._checkDataSize = function() { this._updateDataSize(); if (this.dataSize <= this.maxDataSize) { return; } var message = 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; this._emitError(new Error(message)); }; CombinedStream.prototype._updateDataSize = function() { this.dataSize = 0; var self = this; this._streams.forEach(function(stream) { if (!stream.dataSize) { return; } self.dataSize += stream.dataSize; }); if (this._currentStream && this._currentStream.dataSize) { this.dataSize += this._currentStream.dataSize; } }; CombinedStream.prototype._emitError = function(err) { this._reset(); this.emit('error', err); }; /***/ }), /***/ 17044: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.action = void 0; const commander = __webpack_require__(133); function action() { return (target, propertyKey, descriptor) => { commander.action(target[propertyKey]); }; } exports.action = action; //# sourceMappingURL=action.decorator.js.map /***/ }), /***/ 71303: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.alias = void 0; const program = __webpack_require__(133); function alias(text) { return (target) => { program.usage(text); }; } exports.alias = alias; //# sourceMappingURL=alias.decorator.js.map /***/ }), /***/ 55508: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.variadicArg = exports.requiredArg = exports.optionalArg = void 0; const metadata_1 = __webpack_require__(104); const models_1 = __webpack_require__(84908); const utils_1 = __webpack_require__(66725); /** * Parameter decorator used in subcommand function to denote an optional argument. */ function optionalArg(name) { return (target, propertyKey, parameterIndex) => { const args = (0, utils_1.decorateIfNot)(metadata_1.ArgsMetadata, [], target, propertyKey); args.unshift(new models_1.OptionalArg(name, parameterIndex)); }; } exports.optionalArg = optionalArg; /** * Parameter decorator used in subcommand function to denote a required argument. */ function requiredArg(name) { return (target, propertyKey, parameterIndex) => { const args = (0, utils_1.decorateIfNot)(metadata_1.ArgsMetadata, [], target, propertyKey); args.unshift(new models_1.RequiredArg(name, parameterIndex)); }; } exports.requiredArg = requiredArg; /** * Parameter decorator used in subcommand function to denote variadic arguments. */ function variadicArg(name) { return (target, propertyKey, parameterIndex) => { const args = (0, utils_1.decorateIfNot)(metadata_1.ArgsMetadata, [], target, propertyKey); args.unshift(new models_1.VariadicArg(name, parameterIndex)); }; } exports.variadicArg = variadicArg; //# sourceMappingURL=arg.decorator.js.map /***/ }), /***/ 71196: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.args = void 0; const commander = __webpack_require__(133); function args() { return (target, propertyKey, parameterIndex) => { commander .option(propertyKey) .action(target[propertyKey]); }; } exports.args = args; //# sourceMappingURL=arguments.decorator.js.map /***/ }), /***/ 69904: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.commandOption = void 0; const metadata_1 = __webpack_require__(104); const utils_1 = __webpack_require__(66725); function commandOption(...args) { return ((target, propertyKey, descriptor) => { args[0] = args[0] || `--${String(propertyKey)}`; (0, utils_1.decorateIfNot)(metadata_1.CommandOptionsMetadata, [], target, propertyKey); const options = Reflect.getMetadata(metadata_1.CommandOptionsMetadata, target, propertyKey); options.push(args); }); } exports.commandOption = commandOption; //# sourceMappingURL=command-option.decorator.js.map /***/ }), /***/ 1442: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.command = void 0; const commander = __webpack_require__(133); const helpers_1 = __webpack_require__(69882); const metadata_1 = __webpack_require__(104); function command() { return (target, propertyKey, descriptor) => { try { const cmd = (0, helpers_1.prepareSubcommand)(target, propertyKey); let chain = commander.command(cmd); if (Reflect.hasMetadata(metadata_1.CommandOptionsMetadata, target, propertyKey)) { const options = Reflect.getMetadata(metadata_1.CommandOptionsMetadata, target, propertyKey); chain = options.reduce((prev, opt) => { const [arg1, arg2, arg3, arg4] = opt; return chain.option(arg1, arg2, arg3, arg4); }, chain); } chain.action((...args) => __awaiter(this, void 0, void 0, function* () { const context = args[args.length - 1]; const cmdArgs = args.slice(0, args.length - 1); try { const result = target[propertyKey].apply(context, cmdArgs); if (result instanceof Promise) { yield result; } } catch (_a) { process.exit(1); } finally { process.exit(0); } })); } catch (e) { console.error(e.message); process.exit(1); } }; } exports.command = command; //# sourceMappingURL=command.decorator.js.map /***/ }), /***/ 14432: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.description = void 0; const program = __webpack_require__(133); function description(text) { return (target) => { program.description(text); }; } exports.description = description; //# sourceMappingURL=description.decorator.js.map /***/ }), /***/ 90154: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); __exportStar(__webpack_require__(104), exports); __exportStar(__webpack_require__(17044), exports); __exportStar(__webpack_require__(71303), exports); __exportStar(__webpack_require__(55508), exports); __exportStar(__webpack_require__(71196), exports); __exportStar(__webpack_require__(69904), exports); __exportStar(__webpack_require__(1442), exports); __exportStar(__webpack_require__(14432), exports); __exportStar(__webpack_require__(98166), exports); __exportStar(__webpack_require__(42991), exports); __exportStar(__webpack_require__(3813), exports); __exportStar(__webpack_require__(84768), exports); __exportStar(__webpack_require__(98162), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 98166: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.on = void 0; const commander = __webpack_require__(133); function on(event, handler) { return (target, propertyKey, descriptor) => { commander.on(event, handler); }; } exports.on = on; //# sourceMappingURL=on.decorator.js.map /***/ }), /***/ 42991: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.option = void 0; const metadata_1 = __webpack_require__(104); const models_1 = __webpack_require__(84908); const utils_1 = __webpack_require__(66725); function option(...args) { return ((target, propertyKey) => { args[0] = args[0] || `--${String(propertyKey)}`; (0, utils_1.decorateIfNot)(metadata_1.OptionsMetadata, [], target, propertyKey); const options = Reflect.getMetadata(metadata_1.OptionsMetadata, target, propertyKey); options.push(new models_1.Option(propertyKey, args)); }); } exports.option = option; //# sourceMappingURL=option.decorator.js.map /***/ }), /***/ 3813: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.program = void 0; const commander = __webpack_require__(133); const helpers_1 = __webpack_require__(69882); const metadata_1 = __webpack_require__(104); let instances = 0; function program() { instances += 1; if (instances > 1) { throw new Error('Only one instance of @program is permitted.'); } return function (constructor) { const mixin = class extends constructor { constructor(...args) { super(...args); if (!this.run) { console.error('Program class must define a run() method.'); process.exit(1); } const cmd = (0, helpers_1.prepareCommand)(this, 'run'); if (cmd) { commander.command(cmd); } const options = Object.keys(this).reduce((list, prop) => { if (Reflect.hasMetadata(metadata_1.OptionsMetadata, this, prop)) { const metadata = Reflect.getMetadata(metadata_1.OptionsMetadata, this, prop); list.push(metadata); } return list; }, []); const chainAfterOptions = options .reduce((prev, option) => { return prev.option.apply(prev, option[0].args); }, commander); commander.parse(process.argv); if (this.run) { this.run.apply(commander, (0, helpers_1.injectArgs)(commander, this, 'run')); } } }; (0, helpers_1.initCommander)(constructor); return mixin; }; } exports.program = program; function prepareProgram(target) { let argList = ''; if (Reflect.hasMetadata(metadata_1.OptionsMetadata, target)) { const args = Reflect.getMetadata(metadata_1.OptionsMetadata, target); argList = args .map((arg) => { return arg.toString(); }) .join(' ') .replace(/^(.)/, ' $1'); } return `${argList}`; } //# sourceMappingURL=program.decorator.js.map /***/ }), /***/ 84768: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.usage = void 0; const commander = __webpack_require__(133); function usage(text) { return (target) => { commander.usage(text); }; } exports.usage = usage; //# sourceMappingURL=usage.decorator.js.map /***/ }), /***/ 98162: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.version = void 0; const helpers_1 = __webpack_require__(69882); const metadata_1 = __webpack_require__(104); function version(text) { return (target) => { (0, helpers_1.initCommander)(target); const program = Reflect.getMetadata(metadata_1.ProgramMetadata, target); program.version(text); }; } exports.version = version; //# sourceMappingURL=version.decorator.js.map /***/ }), /***/ 69882: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); __exportStar(__webpack_require__(65339), exports); __exportStar(__webpack_require__(70), exports); __exportStar(__webpack_require__(11413), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 65339: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.initCommander = void 0; const commander = __webpack_require__(133); const metadata_1 = __webpack_require__(104); function initCommander(target) { if (!Reflect.hasMetadata(metadata_1.ProgramMetadata, target)) { const decorator = Reflect.metadata(metadata_1.ProgramMetadata, commander); Reflect.decorate([decorator], target); } } exports.initCommander = initCommander; //# sourceMappingURL=init-commander.js.map /***/ }), /***/ 70: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.injectArgs = void 0; const metadata_1 = __webpack_require__(104); const index_1 = __webpack_require__(84908); function injectArgs(program, target, propertyKey) { if (Reflect.hasMetadata(metadata_1.ArgsMetadata, target, propertyKey)) { const args = Reflect.getMetadata(metadata_1.ArgsMetadata, target, propertyKey); const predicate = (arg) => arg instanceof index_1.VariadicArg; const variadic = args.find(predicate); if (variadic && (args.findIndex(predicate) !== (args.length - 1))) { throw new TypeError(`Variadic argument must be specified last the argument list of the ${String(propertyKey)}() function.`); } const argv = []; let index = 0; for (let i = 0; i < args.length; i += 1) { if (args.find(arg => arg.index === i)) { argv.push(program.args[index]); index += 1; } else { argv.push(undefined); } } return argv; } } exports.injectArgs = injectArgs; //# sourceMappingURL=inject-args.js.map /***/ }), /***/ 11413: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareSubcommand = exports.prepareCommand = void 0; const metadata_1 = __webpack_require__(104); const index_1 = __webpack_require__(84908); function prepareCommand(target, propertyKey) { let argList = ''; if (Reflect.hasMetadata(metadata_1.ArgsMetadata, target, propertyKey)) { const args = Reflect.getMetadata(metadata_1.ArgsMetadata, target, propertyKey); const predicate = (arg) => arg instanceof index_1.VariadicArg; const variadic = args.find(predicate); if (variadic && (args.findIndex(predicate) !== (args.length - 1))) { throw new TypeError(`Variadic argument must be specified last the argument list of the ${String(propertyKey)}() function.`); } argList = args .map((arg) => { return arg.toString(); }) .join(' ') .replace(/^(.)/, '$1'); } return `${argList}`; } exports.prepareCommand = prepareCommand; function prepareSubcommand(target, propertyKey) { const argList = prepareCommand(target, propertyKey); return `${String(propertyKey)} ${argList}`; } exports.prepareSubcommand = prepareSubcommand; //# sourceMappingURL=prepare-command.js.map /***/ }), /***/ 40451: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Option = exports.Command = void 0; __webpack_require__(29977); var commander_1 = __webpack_require__(133); Object.defineProperty(exports, "Command", ({ enumerable: true, get: function () { return commander_1.Command; } })); Object.defineProperty(exports, "Option", ({ enumerable: true, get: function () { return commander_1.Option; } })); __exportStar(__webpack_require__(90154), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 104: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SubcommandMetadata = exports.ProgramMetadata = exports.OptionsMetadata = exports.CommandOptionsMetadata = exports.ArgsMetadata = void 0; exports.ArgsMetadata = Symbol('ArgsMetadata'); exports.CommandOptionsMetadata = Symbol('CommandOptionsMetadata'); exports.OptionsMetadata = Symbol('OptionsMetadata'); exports.ProgramMetadata = Symbol('ProgramMetadata'); exports.SubcommandMetadata = Symbol('SubcommandMetadata'); //# sourceMappingURL=metadata.js.map /***/ }), /***/ 6312: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VariadicArg = exports.RequiredArg = exports.OptionalArg = exports.CommandArg = void 0; class CommandArg { constructor(name, index) { this.name = name; this.index = index; if (typeof name === 'symbol') { throw new TypeError('Symbols are not supported as argument names.'); } } } exports.CommandArg = CommandArg; class OptionalArg extends CommandArg { toString() { return `[${String(this.name)}]`; } } exports.OptionalArg = OptionalArg; class RequiredArg extends CommandArg { toString() { return `<${String(this.name)}>`; } } exports.RequiredArg = RequiredArg; class VariadicArg extends CommandArg { toString() { return `[${String(this.name)}...]`; } } exports.VariadicArg = VariadicArg; //# sourceMappingURL=arg.model.js.map /***/ }), /***/ 84908: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); __exportStar(__webpack_require__(6312), exports); __exportStar(__webpack_require__(4860), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 4860: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Option = void 0; class Option { constructor(name, args) { this.name = name; this.args = args; } } exports.Option = Option; //# sourceMappingURL=option.model.js.map /***/ }), /***/ 65058: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decorateIfNot = void 0; function decorateIfNot(metadataKey, value, target, propertyKey) { if (!Reflect.hasMetadata(metadataKey, target, propertyKey)) { const decorator = Reflect.metadata(metadataKey, value); Reflect.decorate([decorator], target, propertyKey); } return Reflect.getMetadata(metadataKey, target, propertyKey); } exports.decorateIfNot = decorateIfNot; //# sourceMappingURL=decorateIfNot.js.map /***/ }), /***/ 66725: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); __exportStar(__webpack_require__(65058), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 133: /***/ ((module, exports, __webpack_require__) => { /** * Module dependencies. */ const EventEmitter = __webpack_require__(28614).EventEmitter; const childProcess = __webpack_require__(63129); const path = __webpack_require__(85622); const fs = __webpack_require__(35747); // @ts-check // Although this is a class, methods are static in style to allow override using subclass or just functions. class Help { constructor() { this.helpWidth = undefined; this.sortSubcommands = false; this.sortOptions = false; } /** * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. * * @param {Command} cmd * @returns {Command[]} */ visibleCommands(cmd) { const visibleCommands = cmd.commands.filter(cmd => !cmd._hidden); if (cmd._hasImplicitHelpCommand()) { // Create a command matching the implicit help command. const args = cmd._helpCommandnameAndArgs.split(/ +/); const helpCommand = cmd.createCommand(args.shift()) .helpOption(false); helpCommand.description(cmd._helpCommandDescription); helpCommand._parseExpectedArgs(args); visibleCommands.push(helpCommand); } if (this.sortSubcommands) { visibleCommands.sort((a, b) => { return a.name().localeCompare(b.name()); }); } return visibleCommands; } /** * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. * * @param {Command} cmd * @returns {Option[]} */ visibleOptions(cmd) { const visibleOptions = cmd.options.filter((option) => !option.hidden); // Implicit help const showShortHelpFlag = cmd._hasHelpOption && cmd._helpShortFlag && !cmd._findOption(cmd._helpShortFlag); const showLongHelpFlag = cmd._hasHelpOption && !cmd._findOption(cmd._helpLongFlag); if (showShortHelpFlag || showLongHelpFlag) { let helpOption; if (!showShortHelpFlag) { helpOption = cmd.createOption(cmd._helpLongFlag, cmd._helpDescription); } else if (!showLongHelpFlag) { helpOption = cmd.createOption(cmd._helpShortFlag, cmd._helpDescription); } else { helpOption = cmd.createOption(cmd._helpFlags, cmd._helpDescription); } visibleOptions.push(helpOption); } if (this.sortOptions) { const getSortKey = (option) => { // WYSIWYG for order displayed in help with short before long, no special handling for negated. return option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, ''); }; visibleOptions.sort((a, b) => { return getSortKey(a).localeCompare(getSortKey(b)); }); } return visibleOptions; } /** * Get an array of the arguments which have descriptions. * * @param {Command} cmd * @returns {{ term: string, description:string }[]} */ visibleArguments(cmd) { if (cmd._argsDescription && cmd._args.length) { return cmd._args.map((argument) => { return { term: argument.name, description: cmd._argsDescription[argument.name] || '' }; }, 0); } return []; } /** * Get the command term to show in the list of subcommands. * * @param {Command} cmd * @returns {string} */ subcommandTerm(cmd) { // Legacy. Ignores custom usage string, and nested commands. const args = cmd._args.map(arg => humanReadableArgName(arg)).join(' '); return cmd._name + (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') + (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option (args ? ' ' + args : ''); } /** * Get the option term to show in the list of options. * * @param {Option} option * @returns {string} */ optionTerm(option) { return option.flags; } /** * Get the longest command term length. * * @param {Command} cmd * @param {Help} helper * @returns {number} */ longestSubcommandTermLength(cmd, helper) { return helper.visibleCommands(cmd).reduce((max, command) => { return Math.max(max, helper.subcommandTerm(command).length); }, 0); }; /** * Get the longest option term length. * * @param {Command} cmd * @param {Help} helper * @returns {number} */ longestOptionTermLength(cmd, helper) { return helper.visibleOptions(cmd).reduce((max, option) => { return Math.max(max, helper.optionTerm(option).length); }, 0); }; /** * Get the longest argument term length. * * @param {Command} cmd * @param {Help} helper * @returns {number} */ longestArgumentTermLength(cmd, helper) { return helper.visibleArguments(cmd).reduce((max, argument) => { return Math.max(max, argument.term.length); }, 0); }; /** * Get the command usage to be displayed at the top of the built-in help. * * @param {Command} cmd * @returns {string} */ commandUsage(cmd) { // Usage let cmdName = cmd._name; if (cmd._aliases[0]) { cmdName = cmdName + '|' + cmd._aliases[0]; } let parentCmdNames = ''; for (let parentCmd = cmd.parent; parentCmd; parentCmd = parentCmd.parent) { parentCmdNames = parentCmd.name() + ' ' + parentCmdNames; } return parentCmdNames + cmdName + ' ' + cmd.usage(); } /** * Get the description for the command. * * @param {Command} cmd * @returns {string} */ commandDescription(cmd) { // @ts-ignore: overloaded return type return cmd.description(); } /** * Get the command description to show in the list of subcommands. * * @param {Command} cmd * @returns {string} */ subcommandDescription(cmd) { // @ts-ignore: overloaded return type return cmd.description(); } /** * Get the option description to show in the list of options. * * @param {Option} option * @return {string} */ optionDescription(option) { if (option.negate) { return option.description; } const extraInfo = []; if (option.argChoices) { extraInfo.push( // use stringify to match the display of the default value `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`); } if (option.defaultValue !== undefined) { extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`); } if (extraInfo.length > 0) { return `${option.description} (${extraInfo.join(', ')})`; } return option.description; }; /** * Generate the built-in help text. * * @param {Command} cmd * @param {Help} helper * @returns {string} */ formatHelp(cmd, helper) { const termWidth = helper.padWidth(cmd, helper); const helpWidth = helper.helpWidth || 80; const itemIndentWidth = 2; const itemSeparatorWidth = 2; // between term and description function formatItem(term, description) { if (description) { const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`; return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth); } return term; }; function formatList(textArray) { return textArray.join('\n').replace(/^/gm, ' '.repeat(itemIndentWidth)); } // Usage let output = [`Usage: ${helper.commandUsage(cmd)}`, '']; // Description const commandDescription = helper.commandDescription(cmd); if (commandDescription.length > 0) { output = output.concat([commandDescription, '']); } // Arguments const argumentList = helper.visibleArguments(cmd).map((argument) => { return formatItem(argument.term, argument.description); }); if (argumentList.length > 0) { output = output.concat(['Arguments:', formatList(argumentList), '']); } // Options const optionList = helper.visibleOptions(cmd).map((option) => { return formatItem(helper.optionTerm(option), helper.optionDescription(option)); }); if (optionList.length > 0) { output = output.concat(['Options:', formatList(optionList), '']); } // Commands const commandList = helper.visibleCommands(cmd).map((cmd) => { return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd)); }); if (commandList.length > 0) { output = output.concat(['Commands:', formatList(commandList), '']); } return output.join('\n'); } /** * Calculate the pad width from the maximum term length. * * @param {Command} cmd * @param {Help} helper * @returns {number} */ padWidth(cmd, helper) { return Math.max( helper.longestOptionTermLength(cmd, helper), helper.longestSubcommandTermLength(cmd, helper), helper.longestArgumentTermLength(cmd, helper) ); }; /** * Wrap the given string to width characters per line, with lines after the first indented. * Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted. * * @param {string} str * @param {number} width * @param {number} indent * @param {number} [minColumnWidth=40] * @return {string} * */ wrap(str, width, indent, minColumnWidth = 40) { // Detect manually wrapped and indented strings by searching for line breaks // followed by multiple spaces/tabs. if (str.match(/[\n]\s+/)) return str; // Do not wrap if not enough room for a wrapped column of text (as could end up with a word per line). const columnWidth = width - indent; if (columnWidth < minColumnWidth) return str; const leadingStr = str.substr(0, indent); const columnText = str.substr(indent); const indentString = ' '.repeat(indent); const regex = new RegExp('.{1,' + (columnWidth - 1) + '}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)', 'g'); const lines = columnText.match(regex) || []; return leadingStr + lines.map((line, i) => { if (line.slice(-1) === '\n') { line = line.slice(0, line.length - 1); } return ((i > 0) ? indentString : '') + line.trimRight(); }).join('\n'); } } class Option { /** * Initialize a new `Option` with the given `flags` and `description`. * * @param {string} flags * @param {string} [description] */ constructor(flags, description) { this.flags = flags; this.description = description || ''; this.required = flags.includes('<'); // A value must be supplied when the option is specified. this.optional = flags.includes('['); // A value is optional when the option is specified. // variadic test ignores et al which might be used to describe custom splitting of single argument this.variadic = /\w\.\.\.[>\]]$/.test(flags); // The option can take multiple values. this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line. const optionFlags = _parseOptionFlags(flags); this.short = optionFlags.shortFlag; this.long = optionFlags.longFlag; this.negate = false; if (this.long) { this.negate = this.long.startsWith('--no-'); } this.defaultValue = undefined; this.defaultValueDescription = undefined; this.parseArg = undefined; this.hidden = false; this.argChoices = undefined; } /** * Set the default value, and optionally supply the description to be displayed in the help. * * @param {any} value * @param {string} [description] * @return {Option} */ default(value, description) { this.defaultValue = value; this.defaultValueDescription = description; return this; }; /** * Set the custom handler for processing CLI option arguments into option values. * * @param {Function} [fn] * @return {Option} */ argParser(fn) { this.parseArg = fn; return this; }; /** * Whether the option is mandatory and must have a value after parsing. * * @param {boolean} [mandatory=true] * @return {Option} */ makeOptionMandatory(mandatory = true) { this.mandatory = !!mandatory; return this; }; /** * Hide option in help. * * @param {boolean} [hide=true] * @return {Option} */ hideHelp(hide = true) { this.hidden = !!hide; return this; }; /** * @api private */ _concatValue(value, previous) { if (previous === this.defaultValue || !Array.isArray(previous)) { return [value]; } return previous.concat(value); } /** * Only allow option value to be one of choices. * * @param {string[]} values * @return {Option} */ choices(values) { this.argChoices = values; this.parseArg = (arg, previous) => { if (!values.includes(arg)) { throw new InvalidOptionArgumentError(`Allowed choices are ${values.join(', ')}.`); } if (this.variadic) { return this._concatValue(arg, previous); } return arg; }; return this; }; /** * Return option name. * * @return {string} */ name() { if (this.long) { return this.long.replace(/^--/, ''); } return this.short.replace(/^-/, ''); }; /** * Return option name, in a camelcase format that can be used * as a object attribute key. * * @return {string} * @api private */ attributeName() { return camelcase(this.name().replace(/^no-/, '')); }; /** * Check if `arg` matches the short or long flag. * * @param {string} arg * @return {boolean} * @api private */ is(arg) { return this.short === arg || this.long === arg; }; } /** * CommanderError class * @class */ class CommanderError extends Error { /** * Constructs the CommanderError class * @param {number} exitCode suggested exit code which could be used with process.exit * @param {string} code an id string representing the error * @param {string} message human-readable description of the error * @constructor */ constructor(exitCode, code, message) { super(message); // properly capture stack trace in Node.js Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; this.code = code; this.exitCode = exitCode; this.nestedError = undefined; } } /** * InvalidOptionArgumentError class * @class */ class InvalidOptionArgumentError extends CommanderError { /** * Constructs the InvalidOptionArgumentError class * @param {string} [message] explanation of why argument is invalid * @constructor */ constructor(message) { super(1, 'commander.invalidOptionArgument', message); // properly capture stack trace in Node.js Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; } } class Command extends EventEmitter { /** * Initialize a new `Command`. * * @param {string} [name] */ constructor(name) { super(); this.commands = []; this.options = []; this.parent = null; this._allowUnknownOption = false; this._allowExcessArguments = true; this._args = []; this.rawArgs = null; this._scriptPath = null; this._name = name || ''; this._optionValues = {}; this._storeOptionsAsProperties = false; this._actionResults = []; this._actionHandler = null; this._executableHandler = false; this._executableFile = null; // custom name for executable this._defaultCommandName = null; this._exitCallback = null; this._aliases = []; this._combineFlagAndOptionalValue = true; this._description = ''; this._argsDescription = undefined; this._enablePositionalOptions = false; this._passThroughOptions = false; // see .configureOutput() for docs this._outputConfiguration = { writeOut: (str) => process.stdout.write(str), writeErr: (str) => process.stderr.write(str), getOutHelpWidth: () => process.stdout.isTTY ? process.stdout.columns : undefined, getErrHelpWidth: () => process.stderr.isTTY ? process.stderr.columns : undefined, outputError: (str, write) => write(str) }; this._hidden = false; this._hasHelpOption = true; this._helpFlags = '-h, --help'; this._helpDescription = 'display help for command'; this._helpShortFlag = '-h'; this._helpLongFlag = '--help'; this._addImplicitHelpCommand = undefined; // Deliberately undefined, not decided whether true or false this._helpCommandName = 'help'; this._helpCommandnameAndArgs = 'help [command]'; this._helpCommandDescription = 'display help for command'; this._helpConfiguration = {}; } /** * Define a command. * * There are two styles of command: pay attention to where to put the description. * * Examples: * * // Command implemented using action handler (description is supplied separately to `.command`) * program * .command('clone [destination]') * .description('clone a repository into a newly created directory') * .action((source, destination) => { * console.log('clone command called'); * }); * * // Command implemented using separate executable file (description is second parameter to `.command`) * program * .command('start ', 'start named service') * .command('stop [service]', 'stop named service, or all if no name supplied'); * * @param {string} nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...` * @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable) * @param {Object} [execOpts] - configuration options (for executable) * @return {Command} returns new command for action handler, or `this` for executable command */ command(nameAndArgs, actionOptsOrExecDesc, execOpts) { let desc = actionOptsOrExecDesc; let opts = execOpts; if (typeof desc === 'object' && desc !== null) { opts = desc; desc = null; } opts = opts || {}; const args = nameAndArgs.split(/ +/); const cmd = this.createCommand(args.shift()); if (desc) { cmd.description(desc); cmd._executableHandler = true; } if (opts.isDefault) this._defaultCommandName = cmd._name; cmd._outputConfiguration = this._outputConfiguration; cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden cmd._hasHelpOption = this._hasHelpOption; cmd._helpFlags = this._helpFlags; cmd._helpDescription = this._helpDescription; cmd._helpShortFlag = this._helpShortFlag; cmd._helpLongFlag = this._helpLongFlag; cmd._helpCommandName = this._helpCommandName; cmd._helpCommandnameAndArgs = this._helpCommandnameAndArgs; cmd._helpCommandDescription = this._helpCommandDescription; cmd._helpConfiguration = this._helpConfiguration; cmd._exitCallback = this._exitCallback; cmd._storeOptionsAsProperties = this._storeOptionsAsProperties; cmd._combineFlagAndOptionalValue = this._combineFlagAndOptionalValue; cmd._allowExcessArguments = this._allowExcessArguments; cmd._enablePositionalOptions = this._enablePositionalOptions; cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor this.commands.push(cmd); cmd._parseExpectedArgs(args); cmd.parent = this; if (desc) return this; return cmd; }; /** * Factory routine to create a new unattached command. * * See .command() for creating an attached subcommand, which uses this routine to * create the command. You can override createCommand to customise subcommands. * * @param {string} [name] * @return {Command} new command */ createCommand(name) { return new Command(name); }; /** * You can customise the help with a subclass of Help by overriding createHelp, * or by overriding Help properties using configureHelp(). * * @return {Help} */ createHelp() { return Object.assign(new Help(), this.configureHelp()); }; /** * You can customise the help by overriding Help properties using configureHelp(), * or with a subclass of Help by overriding createHelp(). * * @param {Object} [configuration] - configuration options * @return {Command|Object} `this` command for chaining, or stored configuration */ configureHelp(configuration) { if (configuration === undefined) return this._helpConfiguration; this._helpConfiguration = configuration; return this; } /** * The default output goes to stdout and stderr. You can customise this for special * applications. You can also customise the display of errors by overriding outputError. * * The configuration properties are all functions: * * // functions to change where being written, stdout and stderr * writeOut(str) * writeErr(str) * // matching functions to specify width for wrapping help * getOutHelpWidth() * getErrHelpWidth() * // functions based on what is being written out * outputError(str, write) // used for displaying errors, and not used for displaying help * * @param {Object} [configuration] - configuration options * @return {Command|Object} `this` command for chaining, or stored configuration */ configureOutput(configuration) { if (configuration === undefined) return this._outputConfiguration; Object.assign(this._outputConfiguration, configuration); return this; } /** * Add a prepared subcommand. * * See .command() for creating an attached subcommand which inherits settings from its parent. * * @param {Command} cmd - new subcommand * @param {Object} [opts] - configuration options * @return {Command} `this` command for chaining */ addCommand(cmd, opts) { if (!cmd._name) throw new Error('Command passed to .addCommand() must have a name'); // To keep things simple, block automatic name generation for deeply nested executables. // Fail fast and detect when adding rather than later when parsing. function checkExplicitNames(commandArray) { commandArray.forEach((cmd) => { if (cmd._executableHandler && !cmd._executableFile) { throw new Error(`Must specify executableFile for deeply nested executable: ${cmd.name()}`); } checkExplicitNames(cmd.commands); }); } checkExplicitNames(cmd.commands); opts = opts || {}; if (opts.isDefault) this._defaultCommandName = cmd._name; if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation this.commands.push(cmd); cmd.parent = this; return this; }; /** * Define argument syntax for the command. */ arguments(desc) { return this._parseExpectedArgs(desc.split(/ +/)); }; /** * Override default decision whether to add implicit help command. * * addHelpCommand() // force on * addHelpCommand(false); // force off * addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details * * @return {Command} `this` command for chaining */ addHelpCommand(enableOrNameAndArgs, description) { if (enableOrNameAndArgs === false) { this._addImplicitHelpCommand = false; } else { this._addImplicitHelpCommand = true; if (typeof enableOrNameAndArgs === 'string') { this._helpCommandName = enableOrNameAndArgs.split(' ')[0]; this._helpCommandnameAndArgs = enableOrNameAndArgs; } this._helpCommandDescription = description || this._helpCommandDescription; } return this; }; /** * @return {boolean} * @api private */ _hasImplicitHelpCommand() { if (this._addImplicitHelpCommand === undefined) { return this.commands.length && !this._actionHandler && !this._findCommand('help'); } return this._addImplicitHelpCommand; }; /** * Parse expected `args`. * * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. * * @param {Array} args * @return {Command} `this` command for chaining * @api private */ _parseExpectedArgs(args) { if (!args.length) return; args.forEach((arg) => { const argDetails = { required: false, name: '', variadic: false }; switch (arg[0]) { case '<': argDetails.required = true; argDetails.name = arg.slice(1, -1); break; case '[': argDetails.name = arg.slice(1, -1); break; } if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { argDetails.variadic = true; argDetails.name = argDetails.name.slice(0, -3); } if (argDetails.name) { this._args.push(argDetails); } }); this._args.forEach((arg, i) => { if (arg.variadic && i < this._args.length - 1) { throw new Error(`only the last argument can be variadic '${arg.name}'`); } }); return this; }; /** * Register callback to use as replacement for calling process.exit. * * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing * @return {Command} `this` command for chaining */ exitOverride(fn) { if (fn) { this._exitCallback = fn; } else { this._exitCallback = (err) => { if (err.code !== 'commander.executeSubCommandAsync') { throw err; } else { // Async callback from spawn events, not useful to throw. } }; } return this; }; /** * Call process.exit, and _exitCallback if defined. * * @param {number} exitCode exit code for using with process.exit * @param {string} code an id string representing the error * @param {string} message human-readable description of the error * @return never * @api private */ _exit(exitCode, code, message) { if (this._exitCallback) { this._exitCallback(new CommanderError(exitCode, code, message)); // Expecting this line is not reached. } process.exit(exitCode); }; /** * Register callback `fn` for the command. * * Examples: * * program * .command('help') * .description('display verbose help') * .action(function() { * // output help here * }); * * @param {Function} fn * @return {Command} `this` command for chaining */ action(fn) { const listener = (args) => { // The .action callback takes an extra parameter which is the command or options. const expectedArgsCount = this._args.length; const actionArgs = args.slice(0, expectedArgsCount); if (this._storeOptionsAsProperties) { actionArgs[expectedArgsCount] = this; // backwards compatible "options" } else { actionArgs[expectedArgsCount] = this.opts(); } actionArgs.push(this); const actionResult = fn.apply(this, actionArgs); // Remember result in case it is async. Assume parseAsync getting called on root. let rootCommand = this; while (rootCommand.parent) { rootCommand = rootCommand.parent; } rootCommand._actionResults.push(actionResult); }; this._actionHandler = listener; return this; }; /** * Factory routine to create a new unattached option. * * See .option() for creating an attached option, which uses this routine to * create the option. You can override createOption to return a custom option. * * @param {string} flags * @param {string} [description] * @return {Option} new option */ createOption(flags, description) { return new Option(flags, description); }; /** * Add an option. * * @param {Option} option * @return {Command} `this` command for chaining */ addOption(option) { const oname = option.name(); const name = option.attributeName(); let defaultValue = option.defaultValue; // preassign default value for --no-*, [optional], , or plain flag if boolean value if (option.negate || option.optional || option.required || typeof defaultValue === 'boolean') { // when --no-foo we make sure default is true, unless a --foo option is already defined if (option.negate) { const positiveLongFlag = option.long.replace(/^--no-/, '--'); defaultValue = this._findOption(positiveLongFlag) ? this._getOptionValue(name) : true; } // preassign only if we have a default if (defaultValue !== undefined) { this._setOptionValue(name, defaultValue); } } // register the option this.options.push(option); // when it's passed assign the value // and conditionally invoke the callback this.on('option:' + oname, (val) => { const oldValue = this._getOptionValue(name); // custom processing if (val !== null && option.parseArg) { try { val = option.parseArg(val, oldValue === undefined ? defaultValue : oldValue); } catch (err) { if (err.code === 'commander.invalidOptionArgument') { const message = `error: option '${option.flags}' argument '${val}' is invalid. ${err.message}`; this._displayError(err.exitCode, err.code, message); } throw err; } } else if (val !== null && option.variadic) { val = option._concatValue(val, oldValue); } // unassigned or boolean value if (typeof oldValue === 'boolean' || typeof oldValue === 'undefined') { // if no value, negate false, and we have a default, then use it! if (val == null) { this._setOptionValue(name, option.negate ? false : defaultValue || true); } else { this._setOptionValue(name, val); } } else if (val !== null) { // reassign this._setOptionValue(name, option.negate ? false : val); } }); return this; } /** * Internal implementation shared by .option() and .requiredOption() * * @api private */ _optionEx(config, flags, description, fn, defaultValue) { const option = this.createOption(flags, description); option.makeOptionMandatory(!!config.mandatory); if (typeof fn === 'function') { option.default(defaultValue).argParser(fn); } else if (fn instanceof RegExp) { // deprecated const regex = fn; fn = (val, def) => { const m = regex.exec(val); return m ? m[0] : def; }; option.default(defaultValue).argParser(fn); } else { option.default(fn); } return this.addOption(option); } /** * Define option with `flags`, `description` and optional * coercion `fn`. * * The `flags` string contains the short and/or long flags, * separated by comma, a pipe or space. The following are all valid * all will output this way when `--help` is used. * * "-p, --pepper" * "-p|--pepper" * "-p --pepper" * * Examples: * * // simple boolean defaulting to undefined * program.option('-p, --pepper', 'add pepper'); * * program.pepper * // => undefined * * --pepper * program.pepper * // => true * * // simple boolean defaulting to true (unless non-negated option is also defined) * program.option('-C, --no-cheese', 'remove cheese'); * * program.cheese * // => true * * --no-cheese * program.cheese * // => false * * // required argument * program.option('-C, --chdir ', 'change the working directory'); * * --chdir /tmp * program.chdir * // => "/tmp" * * // optional argument * program.option('-c, --cheese [type]', 'add cheese [marble]'); * * @param {string} flags * @param {string} [description] * @param {Function|*} [fn] - custom option processing function or default value * @param {*} [defaultValue] * @return {Command} `this` command for chaining */ option(flags, description, fn, defaultValue) { return this._optionEx({}, flags, description, fn, defaultValue); }; /** * Add a required option which must have a value after parsing. This usually means * the option must be specified on the command line. (Otherwise the same as .option().) * * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. * * @param {string} flags * @param {string} [description] * @param {Function|*} [fn] - custom option processing function or default value * @param {*} [defaultValue] * @return {Command} `this` command for chaining */ requiredOption(flags, description, fn, defaultValue) { return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue); }; /** * Alter parsing of short flags with optional values. * * Examples: * * // for `.option('-f,--flag [value]'): * .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b` * * @param {Boolean} [combine=true] - if `true` or omitted, an optional value can be specified directly after the flag. */ combineFlagAndOptionalValue(combine = true) { this._combineFlagAndOptionalValue = !!combine; return this; }; /** * Allow unknown options on the command line. * * @param {Boolean} [allowUnknown=true] - if `true` or omitted, no error will be thrown * for unknown options. */ allowUnknownOption(allowUnknown = true) { this._allowUnknownOption = !!allowUnknown; return this; }; /** * Allow excess command-arguments on the command line. Pass false to make excess arguments an error. * * @param {Boolean} [allowExcess=true] - if `true` or omitted, no error will be thrown * for excess arguments. */ allowExcessArguments(allowExcess = true) { this._allowExcessArguments = !!allowExcess; return this; }; /** * Enable positional options. Positional means global options are specified before subcommands which lets * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions. * The default behaviour is non-positional and global options may appear anywhere on the command line. * * @param {Boolean} [positional=true] */ enablePositionalOptions(positional = true) { this._enablePositionalOptions = !!positional; return this; }; /** * Pass through options that come after command-arguments rather than treat them as command-options, * so actual command-options come before command-arguments. Turning this on for a subcommand requires * positional options to have been enabled on the program (parent commands). * The default behaviour is non-positional and options may appear before or after command-arguments. * * @param {Boolean} [passThrough=true] * for unknown options. */ passThroughOptions(passThrough = true) { this._passThroughOptions = !!passThrough; if (!!this.parent && passThrough && !this.parent._enablePositionalOptions) { throw new Error('passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)'); } return this; }; /** * Whether to store option values as properties on command object, * or store separately (specify false). In both cases the option values can be accessed using .opts(). * * @param {boolean} [storeAsProperties=true] * @return {Command} `this` command for chaining */ storeOptionsAsProperties(storeAsProperties = true) { this._storeOptionsAsProperties = !!storeAsProperties; if (this.options.length) { throw new Error('call .storeOptionsAsProperties() before adding options'); } return this; }; /** * Store option value * * @param {string} key * @param {Object} value * @api private */ _setOptionValue(key, value) { if (this._storeOptionsAsProperties) { this[key] = value; } else { this._optionValues[key] = value; } }; /** * Retrieve option value * * @param {string} key * @return {Object} value * @api private */ _getOptionValue(key) { if (this._storeOptionsAsProperties) { return this[key]; } return this._optionValues[key]; }; /** * Parse `argv`, setting options and invoking commands when defined. * * The default expectation is that the arguments are from node and have the application as argv[0] * and the script being run in argv[1], with user parameters after that. * * Examples: * * program.parse(process.argv); * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] * * @param {string[]} [argv] - optional, defaults to process.argv * @param {Object} [parseOptions] - optionally specify style of options with from: node/user/electron * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron' * @return {Command} `this` command for chaining */ parse(argv, parseOptions) { if (argv !== undefined && !Array.isArray(argv)) { throw new Error('first parameter to parse must be array or undefined'); } parseOptions = parseOptions || {}; // Default to using process.argv if (argv === undefined) { argv = process.argv; // @ts-ignore: unknown property if (process.versions && process.versions.electron) { parseOptions.from = 'electron'; } } this.rawArgs = argv.slice(); // make it a little easier for callers by supporting various argv conventions let userArgs; switch (parseOptions.from) { case undefined: case 'node': this._scriptPath = argv[1]; userArgs = argv.slice(2); break; case 'electron': // @ts-ignore: unknown property if (process.defaultApp) { this._scriptPath = argv[1]; userArgs = argv.slice(2); } else { userArgs = argv.slice(1); } break; case 'user': userArgs = argv.slice(0); break; default: throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`); } if (!this._scriptPath && require.main) { this._scriptPath = require.main.filename; } // Guess name, used in usage in help. this._name = this._name || (this._scriptPath && path.basename(this._scriptPath, path.extname(this._scriptPath))); // Let's go! this._parseCommand([], userArgs); return this; }; /** * Parse `argv`, setting options and invoking commands when defined. * * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise. * * The default expectation is that the arguments are from node and have the application as argv[0] * and the script being run in argv[1], with user parameters after that. * * Examples: * * program.parseAsync(process.argv); * program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions * program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] * * @param {string[]} [argv] * @param {Object} [parseOptions] * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron' * @return {Promise} */ parseAsync(argv, parseOptions) { this.parse(argv, parseOptions); return Promise.all(this._actionResults).then(() => this); }; /** * Execute a sub-command executable. * * @api private */ _executeSubCommand(subcommand, args) { args = args.slice(); let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows. const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs']; // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command. this._checkForMissingMandatoryOptions(); // Want the entry script as the reference for command name and directory for searching for other files. let scriptPath = this._scriptPath; // Fallback in case not set, due to how Command created or called. if (!scriptPath && require.main) { scriptPath = require.main.filename; } let baseDir; try { const resolvedLink = fs.realpathSync(scriptPath); baseDir = path.dirname(resolvedLink); } catch (e) { baseDir = '.'; // dummy, probably not going to find executable! } // name of the subcommand, like `pm-install` let bin = path.basename(scriptPath, path.extname(scriptPath)) + '-' + subcommand._name; if (subcommand._executableFile) { bin = subcommand._executableFile; } const localBin = path.join(baseDir, bin); if (fs.existsSync(localBin)) { // prefer local `./` to bin in the $PATH bin = localBin; } else { // Look for source files. sourceExt.forEach((ext) => { if (fs.existsSync(`${localBin}${ext}`)) { bin = `${localBin}${ext}`; } }); } launchWithNode = sourceExt.includes(path.extname(bin)); let proc; if (process.platform !== 'win32') { if (launchWithNode) { args.unshift(bin); // add executable arguments to spawn args = incrementNodeInspectorPort(process.execArgv).concat(args); proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' }); } else { proc = childProcess.spawn(bin, args, { stdio: 'inherit' }); } } else { args.unshift(bin); // add executable arguments to spawn args = incrementNodeInspectorPort(process.execArgv).concat(args); proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' }); } const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; signals.forEach((signal) => { // @ts-ignore process.on(signal, () => { if (proc.killed === false && proc.exitCode === null) { proc.kill(signal); } }); }); // By default terminate process when spawned process terminates. // Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running! const exitCallback = this._exitCallback; if (!exitCallback) { proc.on('close', process.exit.bind(process)); } else { proc.on('close', () => { exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)')); }); } proc.on('error', (err) => { // @ts-ignore if (err.code === 'ENOENT') { const executableMissing = `'${bin}' does not exist - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name`; throw new Error(executableMissing); // @ts-ignore } else if (err.code === 'EACCES') { throw new Error(`'${bin}' not executable`); } if (!exitCallback) { process.exit(1); } else { const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)'); wrappedError.nestedError = err; exitCallback(wrappedError); } }); // Store the reference to the child process this.runningCommand = proc; }; /** * @api private */ _dispatchSubcommand(commandName, operands, unknown) { const subCommand = this._findCommand(commandName); if (!subCommand) this.help({ error: true }); if (subCommand._executableHandler) { this._executeSubCommand(subCommand, operands.concat(unknown)); } else { subCommand._parseCommand(operands, unknown); } }; /** * Process arguments in context of this command. * * @api private */ _parseCommand(operands, unknown) { const parsed = this.parseOptions(unknown); operands = operands.concat(parsed.operands); unknown = parsed.unknown; this.args = operands.concat(unknown); if (operands && this._findCommand(operands[0])) { this._dispatchSubcommand(operands[0], operands.slice(1), unknown); } else if (this._hasImplicitHelpCommand() && operands[0] === this._helpCommandName) { if (operands.length === 1) { this.help(); } else { this._dispatchSubcommand(operands[1], [], [this._helpLongFlag]); } } else if (this._defaultCommandName) { outputHelpIfRequested(this, unknown); // Run the help for default command from parent rather than passing to default command this._dispatchSubcommand(this._defaultCommandName, operands, unknown); } else { if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) { // probably missing subcommand and no handler, user needs help this.help({ error: true }); } outputHelpIfRequested(this, parsed.unknown); this._checkForMissingMandatoryOptions(); // We do not always call this check to avoid masking a "better" error, like unknown command. const checkForUnknownOptions = () => { if (parsed.unknown.length > 0) { this.unknownOption(parsed.unknown[0]); } }; const commandEvent = `command:${this.name()}`; if (this._actionHandler) { checkForUnknownOptions(); // Check expected arguments and collect variadic together. const args = this.args.slice(); this._args.forEach((arg, i) => { if (arg.required && args[i] == null) { this.missingArgument(arg.name); } else if (arg.variadic) { args[i] = args.splice(i); args.length = Math.min(i + 1, args.length); } }); if (args.length > this._args.length) { this._excessArguments(args); } this._actionHandler(args); if (this.parent) this.parent.emit(commandEvent, operands, unknown); // legacy } else if (this.parent && this.parent.listenerCount(commandEvent)) { checkForUnknownOptions(); this.parent.emit(commandEvent, operands, unknown); // legacy } else if (operands.length) { if (this._findCommand('*')) { // legacy default command this._dispatchSubcommand('*', operands, unknown); } else if (this.listenerCount('command:*')) { // skip option check, emit event for possible misspelling suggestion this.emit('command:*', operands, unknown); } else if (this.commands.length) { this.unknownCommand(); } else { checkForUnknownOptions(); } } else if (this.commands.length) { // This command has subcommands and nothing hooked up at this level, so display help. this.help({ error: true }); } else { checkForUnknownOptions(); // fall through for caller to handle after calling .parse() } } }; /** * Find matching command. * * @api private */ _findCommand(name) { if (!name) return undefined; return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name)); }; /** * Return an option matching `arg` if any. * * @param {string} arg * @return {Option} * @api private */ _findOption(arg) { return this.options.find(option => option.is(arg)); }; /** * Display an error message if a mandatory option does not have a value. * Lazy calling after checking for help flags from leaf subcommand. * * @api private */ _checkForMissingMandatoryOptions() { // Walk up hierarchy so can call in subcommand after checking for displaying help. for (let cmd = this; cmd; cmd = cmd.parent) { cmd.options.forEach((anOption) => { if (anOption.mandatory && (cmd._getOptionValue(anOption.attributeName()) === undefined)) { cmd.missingMandatoryOptionValue(anOption); } }); } }; /** * Parse options from `argv` removing known options, * and return argv split into operands and unknown arguments. * * Examples: * * argv => operands, unknown * --known kkk op => [op], [] * op --known kkk => [op], [] * sub --unknown uuu op => [sub], [--unknown uuu op] * sub -- --unknown uuu op => [sub --unknown uuu op], [] * * @param {String[]} argv * @return {{operands: String[], unknown: String[]}} */ parseOptions(argv) { const operands = []; // operands, not options or values const unknown = []; // first unknown option and remaining unknown args let dest = operands; const args = argv.slice(); function maybeOption(arg) { return arg.length > 1 && arg[0] === '-'; } // parse options let activeVariadicOption = null; while (args.length) { const arg = args.shift(); // literal if (arg === '--') { if (dest === unknown) dest.push(arg); dest.push(...args); break; } if (activeVariadicOption && !maybeOption(arg)) { this.emit(`option:${activeVariadicOption.name()}`, arg); continue; } activeVariadicOption = null; if (maybeOption(arg)) { const option = this._findOption(arg); // recognised option, call listener to assign value with possible custom processing if (option) { if (option.required) { const value = args.shift(); if (value === undefined) this.optionMissingArgument(option); this.emit(`option:${option.name()}`, value); } else if (option.optional) { let value = null; // historical behaviour is optional value is following arg unless an option if (args.length > 0 && !maybeOption(args[0])) { value = args.shift(); } this.emit(`option:${option.name()}`, value); } else { // boolean flag this.emit(`option:${option.name()}`); } activeVariadicOption = option.variadic ? option : null; continue; } } // Look for combo options following single dash, eat first one if known. if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') { const option = this._findOption(`-${arg[1]}`); if (option) { if (option.required || (option.optional && this._combineFlagAndOptionalValue)) { // option with value following in same argument this.emit(`option:${option.name()}`, arg.slice(2)); } else { // boolean option, emit and put back remainder of arg for further processing this.emit(`option:${option.name()}`); args.unshift(`-${arg.slice(2)}`); } continue; } } // Look for known long flag with value, like --foo=bar if (/^--[^=]+=/.test(arg)) { const index = arg.indexOf('='); const option = this._findOption(arg.slice(0, index)); if (option && (option.required || option.optional)) { this.emit(`option:${option.name()}`, arg.slice(index + 1)); continue; } } // Not a recognised option by this command. // Might be a command-argument, or subcommand option, or unknown option, or help command or option. // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands. if (maybeOption(arg)) { dest = unknown; } // If using positionalOptions, stop processing our options at subcommand. if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) { if (this._findCommand(arg)) { operands.push(arg); if (args.length > 0) unknown.push(...args); break; } else if (arg === this._helpCommandName && this._hasImplicitHelpCommand()) { operands.push(arg); if (args.length > 0) operands.push(...args); break; } else if (this._defaultCommandName) { unknown.push(arg); if (args.length > 0) unknown.push(...args); break; } } // If using passThroughOptions, stop processing options at first command-argument. if (this._passThroughOptions) { dest.push(arg); if (args.length > 0) dest.push(...args); break; } // add arg dest.push(arg); } return { operands, unknown }; }; /** * Return an object containing options as key-value pairs * * @return {Object} */ opts() { if (this._storeOptionsAsProperties) { // Preserve original behaviour so backwards compatible when still using properties const result = {}; const len = this.options.length; for (let i = 0; i < len; i++) { const key = this.options[i].attributeName(); result[key] = key === this._versionOptionName ? this._version : this[key]; } return result; } return this._optionValues; }; /** * Internal bottleneck for handling of parsing errors. * * @api private */ _displayError(exitCode, code, message) { this._outputConfiguration.outputError(`${message}\n`, this._outputConfiguration.writeErr); this._exit(exitCode, code, message); } /** * Argument `name` is missing. * * @param {string} name * @api private */ missingArgument(name) { const message = `error: missing required argument '${name}'`; this._displayError(1, 'commander.missingArgument', message); }; /** * `Option` is missing an argument. * * @param {Option} option * @api private */ optionMissingArgument(option) { const message = `error: option '${option.flags}' argument missing`; this._displayError(1, 'commander.optionMissingArgument', message); }; /** * `Option` does not have a value, and is a mandatory option. * * @param {Option} option * @api private */ missingMandatoryOptionValue(option) { const message = `error: required option '${option.flags}' not specified`; this._displayError(1, 'commander.missingMandatoryOptionValue', message); }; /** * Unknown option `flag`. * * @param {string} flag * @api private */ unknownOption(flag) { if (this._allowUnknownOption) return; const message = `error: unknown option '${flag}'`; this._displayError(1, 'commander.unknownOption', message); }; /** * Excess arguments, more than expected. * * @param {string[]} receivedArgs * @api private */ _excessArguments(receivedArgs) { if (this._allowExcessArguments) return; const expected = this._args.length; const s = (expected === 1) ? '' : 's'; const forSubcommand = this.parent ? ` for '${this.name()}'` : ''; const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`; this._displayError(1, 'commander.excessArguments', message); }; /** * Unknown command. * * @api private */ unknownCommand() { const partCommands = [this.name()]; for (let parentCmd = this.parent; parentCmd; parentCmd = parentCmd.parent) { partCommands.unshift(parentCmd.name()); } const fullCommand = partCommands.join(' '); const message = `error: unknown command '${this.args[0]}'.` + (this._hasHelpOption ? ` See '${fullCommand} ${this._helpLongFlag}'.` : ''); this._displayError(1, 'commander.unknownCommand', message); }; /** * Set the program version to `str`. * * This method auto-registers the "-V, --version" flag * which will print the version number when passed. * * You can optionally supply the flags and description to override the defaults. * * @param {string} str * @param {string} [flags] * @param {string} [description] * @return {this | string} `this` command for chaining, or version string if no arguments */ version(str, flags, description) { if (str === undefined) return this._version; this._version = str; flags = flags || '-V, --version'; description = description || 'output the version number'; const versionOption = this.createOption(flags, description); this._versionOptionName = versionOption.attributeName(); this.options.push(versionOption); this.on('option:' + versionOption.name(), () => { this._outputConfiguration.writeOut(`${str}\n`); this._exit(0, 'commander.version', str); }); return this; }; /** * Set the description to `str`. * * @param {string} [str] * @param {Object} [argsDescription] * @return {string|Command} */ description(str, argsDescription) { if (str === undefined && argsDescription === undefined) return this._description; this._description = str; this._argsDescription = argsDescription; return this; }; /** * Set an alias for the command. * * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help. * * @param {string} [alias] * @return {string|Command} */ alias(alias) { if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility let command = this; if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) { // assume adding alias for last added executable subcommand, rather than this command = this.commands[this.commands.length - 1]; } if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); command._aliases.push(alias); return this; }; /** * Set aliases for the command. * * Only the first alias is shown in the auto-generated help. * * @param {string[]} [aliases] * @return {string[]|Command} */ aliases(aliases) { // Getter for the array of aliases is the main reason for having aliases() in addition to alias(). if (aliases === undefined) return this._aliases; aliases.forEach((alias) => this.alias(alias)); return this; }; /** * Set / get the command usage `str`. * * @param {string} [str] * @return {String|Command} */ usage(str) { if (str === undefined) { if (this._usage) return this._usage; const args = this._args.map((arg) => { return humanReadableArgName(arg); }); return [].concat( (this.options.length || this._hasHelpOption ? '[options]' : []), (this.commands.length ? '[command]' : []), (this._args.length ? args : []) ).join(' '); } this._usage = str; return this; }; /** * Get or set the name of the command * * @param {string} [str] * @return {string|Command} */ name(str) { if (str === undefined) return this._name; this._name = str; return this; }; /** * Return program help documentation. * * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout * @return {string} */ helpInformation(contextOptions) { const helper = this.createHelp(); if (helper.helpWidth === undefined) { helper.helpWidth = (contextOptions && contextOptions.error) ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth(); } return helper.formatHelp(this, helper); }; /** * @api private */ _getHelpContext(contextOptions) { contextOptions = contextOptions || {}; const context = { error: !!contextOptions.error }; let write; if (context.error) { write = (arg) => this._outputConfiguration.writeErr(arg); } else { write = (arg) => this._outputConfiguration.writeOut(arg); } context.write = contextOptions.write || write; context.command = this; return context; } /** * Output help information for this command. * * Outputs built-in help, and custom text added using `.addHelpText()`. * * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout */ outputHelp(contextOptions) { let deprecatedCallback; if (typeof contextOptions === 'function') { deprecatedCallback = contextOptions; contextOptions = undefined; } const context = this._getHelpContext(contextOptions); const groupListeners = []; let command = this; while (command) { groupListeners.push(command); // ordered from current command to root command = command.parent; } groupListeners.slice().reverse().forEach(command => command.emit('beforeAllHelp', context)); this.emit('beforeHelp', context); let helpInformation = this.helpInformation(context); if (deprecatedCallback) { helpInformation = deprecatedCallback(helpInformation); if (typeof helpInformation !== 'string' && !Buffer.isBuffer(helpInformation)) { throw new Error('outputHelp callback must return a string or a Buffer'); } } context.write(helpInformation); this.emit(this._helpLongFlag); // deprecated this.emit('afterHelp', context); groupListeners.forEach(command => command.emit('afterAllHelp', context)); }; /** * You can pass in flags and a description to override the help * flags and help description for your command. Pass in false to * disable the built-in help option. * * @param {string | boolean} [flags] * @param {string} [description] * @return {Command} `this` command for chaining */ helpOption(flags, description) { if (typeof flags === 'boolean') { this._hasHelpOption = flags; return this; } this._helpFlags = flags || this._helpFlags; this._helpDescription = description || this._helpDescription; const helpFlags = _parseOptionFlags(this._helpFlags); this._helpShortFlag = helpFlags.shortFlag; this._helpLongFlag = helpFlags.longFlag; return this; }; /** * Output help information and exit. * * Outputs built-in help, and custom text added using `.addHelpText()`. * * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout */ help(contextOptions) { this.outputHelp(contextOptions); let exitCode = process.exitCode || 0; if (exitCode === 0 && contextOptions && typeof contextOptions !== 'function' && contextOptions.error) { exitCode = 1; } // message: do not have all displayed text available so only passing placeholder. this._exit(exitCode, 'commander.help', '(outputHelp)'); }; /** * Add additional text to be displayed with the built-in help. * * Position is 'before' or 'after' to affect just this command, * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands. * * @param {string} position - before or after built-in help * @param {string | Function} text - string to add, or a function returning a string * @return {Command} `this` command for chaining */ addHelpText(position, text) { const allowedValues = ['beforeAll', 'before', 'after', 'afterAll']; if (!allowedValues.includes(position)) { throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${allowedValues.join("', '")}'`); } const helpEvent = `${position}Help`; this.on(helpEvent, (context) => { let helpStr; if (typeof text === 'function') { helpStr = text({ error: context.error, command: context.command }); } else { helpStr = text; } // Ignore falsy value when nothing to output. if (helpStr) { context.write(`${helpStr}\n`); } }); return this; } }; /** * Expose the root command. */ exports = module.exports = new Command(); exports.program = exports; // More explicit access to global command. /** * Expose classes */ exports.Command = Command; exports.Option = Option; exports.CommanderError = CommanderError; exports.InvalidOptionArgumentError = InvalidOptionArgumentError; exports.Help = Help; /** * Camel-case the given `flag` * * @param {string} flag * @return {string} * @api private */ function camelcase(flag) { return flag.split('-').reduce((str, word) => { return str + word[0].toUpperCase() + word.slice(1); }); } /** * Output help information if help flags specified * * @param {Command} cmd - command to output help for * @param {Array} args - array of options to search for help flags * @api private */ function outputHelpIfRequested(cmd, args) { const helpOption = cmd._hasHelpOption && args.find(arg => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag); if (helpOption) { cmd.outputHelp(); // (Do not have all displayed text available so only passing placeholder.) cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)'); } } /** * Takes an argument and returns its human readable equivalent for help usage. * * @param {Object} arg * @return {string} * @api private */ function humanReadableArgName(arg) { const nameOutput = arg.name + (arg.variadic === true ? '...' : ''); return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']'; } /** * Parse the short and long flag out of something like '-m,--mixed ' * * @api private */ function _parseOptionFlags(flags) { let shortFlag; let longFlag; // Use original very loose parsing to maintain backwards compatibility for now, // which allowed for example unintended `-sw, --short-word` [sic]. const flagParts = flags.split(/[ |,]+/); if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift(); longFlag = flagParts.shift(); // Add support for lone short flag without significantly changing parsing! if (!shortFlag && /^-[^-]$/.test(longFlag)) { shortFlag = longFlag; longFlag = undefined; } return { shortFlag, longFlag }; } /** * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command). * * @param {string[]} args - array of arguments from node.execArgv * @returns {string[]} * @api private */ function incrementNodeInspectorPort(args) { // Testing for these options: // --inspect[=[host:]port] // --inspect-brk[=[host:]port] // --inspect-port=[host:]port return args.map((arg) => { if (!arg.startsWith('--inspect')) { return arg; } let debugOption; let debugHost = '127.0.0.1'; let debugPort = '9229'; let match; if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) { // e.g. --inspect debugOption = match[1]; } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) { debugOption = match[1]; if (/^\d+$/.test(match[3])) { // e.g. --inspect=1234 debugPort = match[3]; } else { // e.g. --inspect=localhost debugHost = match[3]; } } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) { // e.g. --inspect=localhost:1234 debugOption = match[1]; debugHost = match[3]; debugPort = match[4]; } if (debugOption && debugPort !== '0') { return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`; } return arg; }); } /***/ }), /***/ 86891: /***/ ((module) => { module.exports = function (xs, fn) { var res = []; for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); if (isArray(x)) res.push.apply(res, x); else res.push(x); } return res; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; /***/ }), /***/ 95898: /***/ ((__unused_webpack_module, exports) => { var __webpack_unused_export__; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; } __webpack_unused_export__ = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } __webpack_unused_export__ = isBoolean; function isNull(arg) { return arg === null; } __webpack_unused_export__ = isNull; function isNullOrUndefined(arg) { return arg == null; } __webpack_unused_export__ = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } __webpack_unused_export__ = isNumber; function isString(arg) { return typeof arg === 'string'; } __webpack_unused_export__ = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } __webpack_unused_export__ = isSymbol; function isUndefined(arg) { return arg === void 0; } __webpack_unused_export__ = isUndefined; function isRegExp(re) { return objectToString(re) === '[object RegExp]'; } __webpack_unused_export__ = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } __webpack_unused_export__ = isObject; function isDate(d) { return objectToString(d) === '[object Date]'; } __webpack_unused_export__ = isDate; function isError(e) { return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.VZ = isError; function isFunction(arg) { return typeof arg === 'function'; } __webpack_unused_export__ = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } __webpack_unused_export__ = isPrimitive; __webpack_unused_export__ = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } /***/ }), /***/ 28222: /***/ ((module, exports, __webpack_require__) => { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } }; })(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.debug()` when available. * No-op when `console.debug` is not a "function". * If `console.debug` is not available, falls back * to `console.log`. * * @api public */ exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = __webpack_require__(46243)(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /***/ }), /***/ 46243: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(80900); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /***/ }), /***/ 38237: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = __webpack_require__(28222); } else { module.exports = __webpack_require__(35332); } /***/ }), /***/ 35332: /***/ ((module, exports, __webpack_require__) => { /** * Module dependencies. */ const tty = __webpack_require__(33867); const util = __webpack_require__(31669); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.destroy = util.deprecate( () => {}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' ); /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = __webpack_require__(59318); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = __webpack_require__(46243)(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .split('\n') .map(str => str.trim()) .join(' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /***/ }), /***/ 18611: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Stream = __webpack_require__(92413).Stream; var util = __webpack_require__(31669); module.exports = DelayedStream; function DelayedStream() { this.source = null; this.dataSize = 0; this.maxDataSize = 1024 * 1024; this.pauseStream = true; this._maxDataSizeExceeded = false; this._released = false; this._bufferedEvents = []; } util.inherits(DelayedStream, Stream); DelayedStream.create = function(source, options) { var delayedStream = new this(); options = options || {}; for (var option in options) { delayedStream[option] = options[option]; } delayedStream.source = source; var realEmit = source.emit; source.emit = function() { delayedStream._handleEmit(arguments); return realEmit.apply(source, arguments); }; source.on('error', function() {}); if (delayedStream.pauseStream) { source.pause(); } return delayedStream; }; Object.defineProperty(DelayedStream.prototype, 'readable', { configurable: true, enumerable: true, get: function() { return this.source.readable; } }); DelayedStream.prototype.setEncoding = function() { return this.source.setEncoding.apply(this.source, arguments); }; DelayedStream.prototype.resume = function() { if (!this._released) { this.release(); } this.source.resume(); }; DelayedStream.prototype.pause = function() { this.source.pause(); }; DelayedStream.prototype.release = function() { this._released = true; this._bufferedEvents.forEach(function(args) { this.emit.apply(this, args); }.bind(this)); this._bufferedEvents = []; }; DelayedStream.prototype.pipe = function() { var r = Stream.prototype.pipe.apply(this, arguments); this.resume(); return r; }; DelayedStream.prototype._handleEmit = function(args) { if (this._released) { this.emit.apply(this, args); return; } if (args[0] === 'data') { this.dataSize += args[1].length; this._checkIfMaxDataSizeExceeded(); } this._bufferedEvents.push(args); }; DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { if (this._maxDataSizeExceeded) { return; } if (this.dataSize <= this.maxDataSize) { return; } this._maxDataSizeExceeded = true; var message = 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' this.emit('error', new Error(message)); }; /***/ }), /***/ 82042: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const isObj = __webpack_require__(51389); const disallowedKeys = new Set([ '__proto__', 'prototype', 'constructor' ]); const isValidPath = pathSegments => !pathSegments.some(segment => disallowedKeys.has(segment)); function getPathSegments(path) { const pathArray = path.split('.'); const parts = []; for (let i = 0; i < pathArray.length; i++) { let p = pathArray[i]; while (p[p.length - 1] === '\\' && pathArray[i + 1] !== undefined) { p = p.slice(0, -1) + '.'; p += pathArray[++i]; } parts.push(p); } if (!isValidPath(parts)) { return []; } return parts; } module.exports = { get(object, path, value) { if (!isObj(object) || typeof path !== 'string') { return value === undefined ? object : value; } const pathArray = getPathSegments(path); if (pathArray.length === 0) { return; } for (let i = 0; i < pathArray.length; i++) { object = object[pathArray[i]]; if (object === undefined || object === null) { // `object` is either `undefined` or `null` so we want to stop the loop, and // if this is not the last bit of the path, and // if it did't return `undefined` // it would return `null` if `object` is `null` // but we want `get({foo: null}, 'foo.bar')` to equal `undefined`, or the supplied value, not `null` if (i !== pathArray.length - 1) { return value; } break; } } return object === undefined ? value : object; }, set(object, path, value) { if (!isObj(object) || typeof path !== 'string') { return object; } const root = object; const pathArray = getPathSegments(path); for (let i = 0; i < pathArray.length; i++) { const p = pathArray[i]; if (!isObj(object[p])) { object[p] = {}; } if (i === pathArray.length - 1) { object[p] = value; } object = object[p]; } return root; }, delete(object, path) { if (!isObj(object) || typeof path !== 'string') { return false; } const pathArray = getPathSegments(path); for (let i = 0; i < pathArray.length; i++) { const p = pathArray[i]; if (i === pathArray.length - 1) { delete object[p]; return true; } object = object[p]; if (!isObj(object)) { return false; } } }, has(object, path) { if (!isObj(object) || typeof path !== 'string') { return false; } const pathArray = getPathSegments(path); if (pathArray.length === 0) { return false; } // eslint-disable-next-line unicorn/no-for-loop for (let i = 0; i < pathArray.length; i++) { if (isObj(object)) { if (!(pathArray[i] in object)) { return false; } object = object[pathArray[i]]; } else { return false; } } return true; } }; /***/ }), /***/ 76599: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var stream = __webpack_require__(51642) var eos = __webpack_require__(81205) var inherits = __webpack_require__(44124) var shift = __webpack_require__(66121) var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from) ? Buffer.from([0]) : new Buffer([0]) var onuncork = function(self, fn) { if (self._corked) self.once('uncork', fn) else fn() } var autoDestroy = function (self, err) { if (self._autoDestroy) self.destroy(err) } var destroyer = function(self, end) { return function(err) { if (err) autoDestroy(self, err.message === 'premature close' ? null : err) else if (end && !self._ended) self.end() } } var end = function(ws, fn) { if (!ws) return fn() if (ws._writableState && ws._writableState.finished) return fn() if (ws._writableState) return ws.end(fn) ws.end() fn() } var noop = function() {} var toStreams2 = function(rs) { return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs) } var Duplexify = function(writable, readable, opts) { if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) stream.Duplex.call(this, opts) this._writable = null this._readable = null this._readable2 = null this._autoDestroy = !opts || opts.autoDestroy !== false this._forwardDestroy = !opts || opts.destroy !== false this._forwardEnd = !opts || opts.end !== false this._corked = 1 // start corked this._ondrain = null this._drained = false this._forwarding = false this._unwrite = null this._unread = null this._ended = false this.destroyed = false if (writable) this.setWritable(writable) if (readable) this.setReadable(readable) } inherits(Duplexify, stream.Duplex) Duplexify.obj = function(writable, readable, opts) { if (!opts) opts = {} opts.objectMode = true opts.highWaterMark = 16 return new Duplexify(writable, readable, opts) } Duplexify.prototype.cork = function() { if (++this._corked === 1) this.emit('cork') } Duplexify.prototype.uncork = function() { if (this._corked && --this._corked === 0) this.emit('uncork') } Duplexify.prototype.setWritable = function(writable) { if (this._unwrite) this._unwrite() if (this.destroyed) { if (writable && writable.destroy) writable.destroy() return } if (writable === null || writable === false) { this.end() return } var self = this var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd)) var ondrain = function() { var ondrain = self._ondrain self._ondrain = null if (ondrain) ondrain() } var clear = function() { self._writable.removeListener('drain', ondrain) unend() } if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks this._writable = writable this._writable.on('drain', ondrain) this._unwrite = clear this.uncork() // always uncork setWritable } Duplexify.prototype.setReadable = function(readable) { if (this._unread) this._unread() if (this.destroyed) { if (readable && readable.destroy) readable.destroy() return } if (readable === null || readable === false) { this.push(null) this.resume() return } var self = this var unend = eos(readable, {writable:false, readable:true}, destroyer(this)) var onreadable = function() { self._forward() } var onend = function() { self.push(null) } var clear = function() { self._readable2.removeListener('readable', onreadable) self._readable2.removeListener('end', onend) unend() } this._drained = true this._readable = readable this._readable2 = readable._readableState ? readable : toStreams2(readable) this._readable2.on('readable', onreadable) this._readable2.on('end', onend) this._unread = clear this._forward() } Duplexify.prototype._read = function() { this._drained = true this._forward() } Duplexify.prototype._forward = function() { if (this._forwarding || !this._readable2 || !this._drained) return this._forwarding = true var data while (this._drained && (data = shift(this._readable2)) !== null) { if (this.destroyed) continue this._drained = this.push(data) } this._forwarding = false } Duplexify.prototype.destroy = function(err, cb) { if (!cb) cb = noop if (this.destroyed) return cb(null) this.destroyed = true var self = this process.nextTick(function() { self._destroy(err) cb(null) }) } Duplexify.prototype._destroy = function(err) { if (err) { var ondrain = this._ondrain this._ondrain = null if (ondrain) ondrain(err) else this.emit('error', err) } if (this._forwardDestroy) { if (this._readable && this._readable.destroy) this._readable.destroy() if (this._writable && this._writable.destroy) this._writable.destroy() } this.emit('close') } Duplexify.prototype._write = function(data, enc, cb) { if (this.destroyed) return if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb)) if (data === SIGNAL_FLUSH) return this._finish(cb) if (!this._writable) return cb() if (this._writable.write(data) === false) this._ondrain = cb else if (!this.destroyed) cb() } Duplexify.prototype._finish = function(cb) { var self = this this.emit('preend') onuncork(this, function() { end(self._forwardEnd && self._writable, function() { // haxx to not emit prefinish twice if (self._writableState.prefinished === false) self._writableState.prefinished = true self.emit('prefinish') onuncork(self, cb) }) }) } Duplexify.prototype.end = function(data, enc, cb) { if (typeof data === 'function') return this.end(null, null, data) if (typeof enc === 'function') return this.end(data, null, enc) this._ended = true if (data) this.write(data) if (!this._writableState.ending && !this._writableState.destroyed) this.write(SIGNAL_FLUSH) return stream.Writable.prototype.end.call(this, cb) } module.exports = Duplexify /***/ }), /***/ 49865: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var crypto = __webpack_require__(76417); var BigInteger = __webpack_require__(85587).BigInteger; var ECPointFp = __webpack_require__(3943).ECPointFp; var Buffer = __webpack_require__(15118).Buffer; exports.ECCurves = __webpack_require__(41452); // zero prepad function unstupid(hex,len) { return (hex.length >= len) ? hex : unstupid("0"+hex,len); } exports.ECKey = function(curve, key, isPublic) { var priv; var c = curve(); var n = c.getN(); var bytes = Math.floor(n.bitLength()/8); if(key) { if(isPublic) { var curve = c.getCurve(); // var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format // var y = key.slice(bytes+1); // this.P = new ECPointFp(curve, // curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)), // curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); this.P = curve.decodePointHex(key.toString("hex")); }else{ if(key.length != bytes) return false; priv = new BigInteger(key.toString("hex"), 16); } }else{ var n1 = n.subtract(BigInteger.ONE); var r = new BigInteger(crypto.randomBytes(n.bitLength())); priv = r.mod(n1).add(BigInteger.ONE); this.P = c.getG().multiply(priv); } if(this.P) { // var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2); // this.PublicKey = Buffer.from("04"+pubhex,"hex"); this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),"hex"); } if(priv) { this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),"hex"); this.deriveSharedSecret = function(key) { if(!key || !key.P) return false; var S = key.P.multiply(priv); return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex"); } } } /***/ }), /***/ 3943: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Basic Javascript Elliptic Curve implementation // Ported loosely from BouncyCastle's Java EC code // Only Fp curves implemented for now // Requires jsbn.js and jsbn2.js var BigInteger = __webpack_require__(85587).BigInteger var Barrett = BigInteger.prototype.Barrett // ---------------- // ECFieldElementFp // constructor function ECFieldElementFp(q,x) { this.x = x; // TODO if(x.compareTo(q) >= 0) error this.q = q; } function feFpEquals(other) { if(other == this) return true; return (this.q.equals(other.q) && this.x.equals(other.x)); } function feFpToBigInteger() { return this.x; } function feFpNegate() { return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); } function feFpAdd(b) { return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); } function feFpSubtract(b) { return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); } function feFpMultiply(b) { return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); } function feFpSquare() { return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); } function feFpDivide(b) { return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); } ECFieldElementFp.prototype.equals = feFpEquals; ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; ECFieldElementFp.prototype.negate = feFpNegate; ECFieldElementFp.prototype.add = feFpAdd; ECFieldElementFp.prototype.subtract = feFpSubtract; ECFieldElementFp.prototype.multiply = feFpMultiply; ECFieldElementFp.prototype.square = feFpSquare; ECFieldElementFp.prototype.divide = feFpDivide; // ---------------- // ECPointFp // constructor function ECPointFp(curve,x,y,z) { this.curve = curve; this.x = x; this.y = y; // Projective coordinates: either zinv == null or z * zinv == 1 // z and zinv are just BigIntegers, not fieldElements if(z == null) { this.z = BigInteger.ONE; } else { this.z = z; } this.zinv = null; //TODO: compression flag } function pointFpGetX() { if(this.zinv == null) { this.zinv = this.z.modInverse(this.curve.q); } var r = this.x.toBigInteger().multiply(this.zinv); this.curve.reduce(r); return this.curve.fromBigInteger(r); } function pointFpGetY() { if(this.zinv == null) { this.zinv = this.z.modInverse(this.curve.q); } var r = this.y.toBigInteger().multiply(this.zinv); this.curve.reduce(r); return this.curve.fromBigInteger(r); } function pointFpEquals(other) { if(other == this) return true; if(this.isInfinity()) return other.isInfinity(); if(other.isInfinity()) return this.isInfinity(); var u, v; // u = Y2 * Z1 - Y1 * Z2 u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); if(!u.equals(BigInteger.ZERO)) return false; // v = X2 * Z1 - X1 * Z2 v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); return v.equals(BigInteger.ZERO); } function pointFpIsInfinity() { if((this.x == null) && (this.y == null)) return true; return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); } function pointFpNegate() { return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); } function pointFpAdd(b) { if(this.isInfinity()) return b; if(b.isInfinity()) return this; // u = Y2 * Z1 - Y1 * Z2 var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); // v = X2 * Z1 - X1 * Z2 var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); if(BigInteger.ZERO.equals(v)) { if(BigInteger.ZERO.equals(u)) { return this.twice(); // this == b, so double } return this.curve.getInfinity(); // this = -b, so infinity } var THREE = new BigInteger("3"); var x1 = this.x.toBigInteger(); var y1 = this.y.toBigInteger(); var x2 = b.x.toBigInteger(); var y2 = b.y.toBigInteger(); var v2 = v.square(); var v3 = v2.multiply(v); var x1v2 = x1.multiply(v2); var zu2 = u.square().multiply(this.z); // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q); // z3 = v^3 * z1 * z2 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); } function pointFpTwice() { if(this.isInfinity()) return this; if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); // TODO: optimized handling of constants var THREE = new BigInteger("3"); var x1 = this.x.toBigInteger(); var y1 = this.y.toBigInteger(); var y1z1 = y1.multiply(this.z); var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); var a = this.curve.a.toBigInteger(); // w = 3 * x1^2 + a * z1^2 var w = x1.square().multiply(THREE); if(!BigInteger.ZERO.equals(a)) { w = w.add(this.z.square().multiply(a)); } w = w.mod(this.curve.q); //this.curve.reduce(w); // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); // z3 = 8 * (y1 * z1)^3 var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); } // Simple NAF (Non-Adjacent Form) multiplication algorithm // TODO: modularize the multiplication algorithm function pointFpMultiply(k) { if(this.isInfinity()) return this; if(k.signum() == 0) return this.curve.getInfinity(); var e = k; var h = e.multiply(new BigInteger("3")); var neg = this.negate(); var R = this; var i; for(i = h.bitLength() - 2; i > 0; --i) { R = R.twice(); var hBit = h.testBit(i); var eBit = e.testBit(i); if (hBit != eBit) { R = R.add(hBit ? this : neg); } } return R; } // Compute this*j + x*k (simultaneous multiplication) function pointFpMultiplyTwo(j,x,k) { var i; if(j.bitLength() > k.bitLength()) i = j.bitLength() - 1; else i = k.bitLength() - 1; var R = this.curve.getInfinity(); var both = this.add(x); while(i >= 0) { R = R.twice(); if(j.testBit(i)) { if(k.testBit(i)) { R = R.add(both); } else { R = R.add(this); } } else { if(k.testBit(i)) { R = R.add(x); } } --i; } return R; } ECPointFp.prototype.getX = pointFpGetX; ECPointFp.prototype.getY = pointFpGetY; ECPointFp.prototype.equals = pointFpEquals; ECPointFp.prototype.isInfinity = pointFpIsInfinity; ECPointFp.prototype.negate = pointFpNegate; ECPointFp.prototype.add = pointFpAdd; ECPointFp.prototype.twice = pointFpTwice; ECPointFp.prototype.multiply = pointFpMultiply; ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; // ---------------- // ECCurveFp // constructor function ECCurveFp(q,a,b) { this.q = q; this.a = this.fromBigInteger(a); this.b = this.fromBigInteger(b); this.infinity = new ECPointFp(this, null, null); this.reducer = new Barrett(this.q); } function curveFpGetQ() { return this.q; } function curveFpGetA() { return this.a; } function curveFpGetB() { return this.b; } function curveFpEquals(other) { if(other == this) return true; return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); } function curveFpGetInfinity() { return this.infinity; } function curveFpFromBigInteger(x) { return new ECFieldElementFp(this.q, x); } function curveReduce(x) { this.reducer.reduce(x); } // for now, work with hex strings because they're easier in JS function curveFpDecodePointHex(s) { switch(parseInt(s.substr(0,2), 16)) { // first byte case 0: return this.infinity; case 2: case 3: // point compression not supported yet return null; case 4: case 6: case 7: var len = (s.length - 2) / 2; var xHex = s.substr(2, len); var yHex = s.substr(len+2, len); return new ECPointFp(this, this.fromBigInteger(new BigInteger(xHex, 16)), this.fromBigInteger(new BigInteger(yHex, 16))); default: // unsupported return null; } } function curveFpEncodePointHex(p) { if (p.isInfinity()) return "00"; var xHex = p.getX().toBigInteger().toString(16); var yHex = p.getY().toBigInteger().toString(16); var oLen = this.getQ().toString(16).length; if ((oLen % 2) != 0) oLen++; while (xHex.length < oLen) { xHex = "0" + xHex; } while (yHex.length < oLen) { yHex = "0" + yHex; } return "04" + xHex + yHex; } ECCurveFp.prototype.getQ = curveFpGetQ; ECCurveFp.prototype.getA = curveFpGetA; ECCurveFp.prototype.getB = curveFpGetB; ECCurveFp.prototype.equals = curveFpEquals; ECCurveFp.prototype.getInfinity = curveFpGetInfinity; ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; ECCurveFp.prototype.reduce = curveReduce; //ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; // from: https://github.com/kaielvin/jsbn-ec-point-compression ECCurveFp.prototype.decodePointHex = function(s) { var yIsEven; switch(parseInt(s.substr(0,2), 16)) { // first byte case 0: return this.infinity; case 2: yIsEven = false; case 3: if(yIsEven == undefined) yIsEven = true; var len = s.length - 2; var xHex = s.substr(2, len); var x = this.fromBigInteger(new BigInteger(xHex,16)); var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); var beta = alpha.sqrt(); if (beta == null) throw "Invalid point compression"; var betaValue = beta.toBigInteger(); if (betaValue.testBit(0) != yIsEven) { // Use the other root beta = this.fromBigInteger(this.getQ().subtract(betaValue)); } return new ECPointFp(this,x,beta); case 4: case 6: case 7: var len = (s.length - 2) / 2; var xHex = s.substr(2, len); var yHex = s.substr(len+2, len); return new ECPointFp(this, this.fromBigInteger(new BigInteger(xHex, 16)), this.fromBigInteger(new BigInteger(yHex, 16))); default: // unsupported return null; } } ECCurveFp.prototype.encodeCompressedPointHex = function(p) { if (p.isInfinity()) return "00"; var xHex = p.getX().toBigInteger().toString(16); var oLen = this.getQ().toString(16).length; if ((oLen % 2) != 0) oLen++; while (xHex.length < oLen) xHex = "0" + xHex; var yPrefix; if(p.getY().toBigInteger().isEven()) yPrefix = "02"; else yPrefix = "03"; return yPrefix + xHex; } ECFieldElementFp.prototype.getR = function() { if(this.r != undefined) return this.r; this.r = null; var bitLength = this.q.bitLength(); if (bitLength > 128) { var firstWord = this.q.shiftRight(bitLength - 64); if (firstWord.intValue() == -1) { this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); } } return this.r; } ECFieldElementFp.prototype.modMult = function(x1,x2) { return this.modReduce(x1.multiply(x2)); } ECFieldElementFp.prototype.modReduce = function(x) { if (this.getR() != null) { var qLen = q.bitLength(); while (x.bitLength() > (qLen + 1)) { var u = x.shiftRight(qLen); var v = x.subtract(u.shiftLeft(qLen)); if (!this.getR().equals(BigInteger.ONE)) { u = u.multiply(this.getR()); } x = u.add(v); } while (x.compareTo(q) >= 0) { x = x.subtract(q); } } else { x = x.mod(q); } return x; } ECFieldElementFp.prototype.sqrt = function() { if (!this.q.testBit(0)) throw "unsupported"; // p mod 4 == 3 if (this.q.testBit(1)) { var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); return z.square().equals(this) ? z : null; } // p mod 4 == 1 var qMinusOne = this.q.subtract(BigInteger.ONE); var legendreExponent = qMinusOne.shiftRight(1); if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) { return null; } var u = qMinusOne.shiftRight(2); var k = u.shiftLeft(1).add(BigInteger.ONE); var Q = this.x; var fourQ = modDouble(modDouble(Q)); var U, V; do { var P; do { P = new BigInteger(this.q.bitLength(), new SecureRandom()); } while (P.compareTo(this.q) >= 0 || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne))); var result = this.lucasSequence(P, Q, k); U = result[0]; V = result[1]; if (this.modMult(V, V).equals(fourQ)) { // Integer division by 2, mod q if (V.testBit(0)) { V = V.add(q); } V = V.shiftRight(1); return new ECFieldElementFp(q,V); } } while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); return null; } ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) { var n = k.bitLength(); var s = k.getLowestSetBit(); var Uh = BigInteger.ONE; var Vl = BigInteger.TWO; var Vh = P; var Ql = BigInteger.ONE; var Qh = BigInteger.ONE; for (var j = n - 1; j >= s + 1; --j) { Ql = this.modMult(Ql, Qh); if (k.testBit(j)) { Qh = this.modMult(Ql, Q); Uh = this.modMult(Uh, Vh); Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1))); } else { Qh = Ql; Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); } } Ql = this.modMult(Ql, Qh); Qh = this.modMult(Ql, Q); Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); Ql = this.modMult(Ql, Qh); for (var j = 1; j <= s; ++j) { Uh = this.modMult(Uh, Vl); Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); Ql = this.modMult(Ql, Ql); } return [ Uh, Vl ]; } var exports = { ECCurveFp: ECCurveFp, ECPointFp: ECPointFp, ECFieldElementFp: ECFieldElementFp } module.exports = exports /***/ }), /***/ 41452: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Named EC curves // Requires ec.js, jsbn.js, and jsbn2.js var BigInteger = __webpack_require__(85587).BigInteger var ECCurveFp = __webpack_require__(3943).ECCurveFp // ---------------- // X9ECParameters // constructor function X9ECParameters(curve,g,n,h) { this.curve = curve; this.g = g; this.n = n; this.h = h; } function x9getCurve() { return this.curve; } function x9getG() { return this.g; } function x9getN() { return this.n; } function x9getH() { return this.h; } X9ECParameters.prototype.getCurve = x9getCurve; X9ECParameters.prototype.getG = x9getG; X9ECParameters.prototype.getN = x9getN; X9ECParameters.prototype.getH = x9getH; // ---------------- // SECNamedCurves function fromHex(s) { return new BigInteger(s, 16); } function secp128r1() { // p = 2^128 - 2^97 - 1 var p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"); var b = fromHex("E87579C11079F43DD824993C2CEE5ED3"); //byte[] S = Hex.decode("000E0D4D696E6768756151750CC03A4473D03679"); var n = fromHex("FFFFFFFE0000000075A30D1B9038A115"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "161FF7528B899B2D0C28607CA52C5B86" + "CF5AC8395BAFEB13C02DA292DDED7A83"); return new X9ECParameters(curve, G, n, h); } function secp160k1() { // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"); var a = BigInteger.ZERO; var b = fromHex("7"); //byte[] S = null; var n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB" + "938CF935318FDCED6BC28286531733C3F03C4FEE"); return new X9ECParameters(curve, G, n, h); } function secp160r1() { // p = 2^160 - 2^31 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"); var b = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"); //byte[] S = Hex.decode("1053CDE42C14D696E67687561517533BF3F83345"); var n = fromHex("0100000000000000000001F4C8F927AED3CA752257"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "4A96B5688EF573284664698968C38BB913CBFC82" + "23A628553168947D59DCC912042351377AC5FB32"); return new X9ECParameters(curve, G, n, h); } function secp192k1() { // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"); var a = BigInteger.ZERO; var b = fromHex("3"); //byte[] S = null; var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D" + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D"); return new X9ECParameters(curve, G, n, h); } function secp192r1() { // p = 2^192 - 2^64 - 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"); var b = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"); //byte[] S = Hex.decode("3045AE6FC8422F64ED579528D38120EAE12196D5"); var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012" + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811"); return new X9ECParameters(curve, G, n, h); } function secp224r1() { // p = 2^224 - 2^96 + 1 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"); var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"); var b = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"); //byte[] S = Hex.decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5"); var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21" + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"); return new X9ECParameters(curve, G, n, h); } function secp256r1() { // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1 var p = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"); var a = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"); var b = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"); //byte[] S = Hex.decode("C49D360886E704936A6678E1139D26B7819F7E90"); var n = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"); var h = BigInteger.ONE; var curve = new ECCurveFp(p, a, b); var G = curve.decodePointHex("04" + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296" + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"); return new X9ECParameters(curve, G, n, h); } // TODO: make this into a proper hashtable function getSECCurveByName(name) { if(name == "secp128r1") return secp128r1(); if(name == "secp160k1") return secp160k1(); if(name == "secp160r1") return secp160r1(); if(name == "secp192k1") return secp192k1(); if(name == "secp192r1") return secp192r1(); if(name == "secp224r1") return secp224r1(); if(name == "secp256r1") return secp256r1(); return null; } module.exports = { "secp128r1":secp128r1, "secp160k1":secp160k1, "secp160r1":secp160r1, "secp192k1":secp192k1, "secp192r1":secp192r1, "secp224r1":secp224r1, "secp256r1":secp256r1 } /***/ }), /***/ 11728: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(21867).Buffer; var getParamBytesForAlg = __webpack_require__(30528); var MAX_OCTET = 0x80, CLASS_UNIVERSAL = 0, PRIMITIVE_BIT = 0x20, TAG_SEQ = 0x10, TAG_INT = 0x02, ENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6), ENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6); function base64Url(base64) { return base64 .replace(/=/g, '') .replace(/\+/g, '-') .replace(/\//g, '_'); } function signatureAsBuffer(signature) { if (Buffer.isBuffer(signature)) { return signature; } else if ('string' === typeof signature) { return Buffer.from(signature, 'base64'); } throw new TypeError('ECDSA signature must be a Base64 string or a Buffer'); } function derToJose(signature, alg) { signature = signatureAsBuffer(signature); var paramBytes = getParamBytesForAlg(alg); // the DER encoded param should at most be the param size, plus a padding // zero, since due to being a signed integer var maxEncodedParamLength = paramBytes + 1; var inputLength = signature.length; var offset = 0; if (signature[offset++] !== ENCODED_TAG_SEQ) { throw new Error('Could not find expected "seq"'); } var seqLength = signature[offset++]; if (seqLength === (MAX_OCTET | 1)) { seqLength = signature[offset++]; } if (inputLength - offset < seqLength) { throw new Error('"seq" specified length of "' + seqLength + '", only "' + (inputLength - offset) + '" remaining'); } if (signature[offset++] !== ENCODED_TAG_INT) { throw new Error('Could not find expected "int" for "r"'); } var rLength = signature[offset++]; if (inputLength - offset - 2 < rLength) { throw new Error('"r" specified length of "' + rLength + '", only "' + (inputLength - offset - 2) + '" available'); } if (maxEncodedParamLength < rLength) { throw new Error('"r" specified length of "' + rLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); } var rOffset = offset; offset += rLength; if (signature[offset++] !== ENCODED_TAG_INT) { throw new Error('Could not find expected "int" for "s"'); } var sLength = signature[offset++]; if (inputLength - offset !== sLength) { throw new Error('"s" specified length of "' + sLength + '", expected "' + (inputLength - offset) + '"'); } if (maxEncodedParamLength < sLength) { throw new Error('"s" specified length of "' + sLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); } var sOffset = offset; offset += sLength; if (offset !== inputLength) { throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain'); } var rPadding = paramBytes - rLength, sPadding = paramBytes - sLength; var dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength); for (offset = 0; offset < rPadding; ++offset) { dst[offset] = 0; } signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength); offset = paramBytes; for (var o = offset; offset < o + sPadding; ++offset) { dst[offset] = 0; } signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength); dst = dst.toString('base64'); dst = base64Url(dst); return dst; } function countPadding(buf, start, stop) { var padding = 0; while (start + padding < stop && buf[start + padding] === 0) { ++padding; } var needsSign = buf[start + padding] >= MAX_OCTET; if (needsSign) { --padding; } return padding; } function joseToDer(signature, alg) { signature = signatureAsBuffer(signature); var paramBytes = getParamBytesForAlg(alg); var signatureBytes = signature.length; if (signatureBytes !== paramBytes * 2) { throw new TypeError('"' + alg + '" signatures must be "' + paramBytes * 2 + '" bytes, saw "' + signatureBytes + '"'); } var rPadding = countPadding(signature, 0, paramBytes); var sPadding = countPadding(signature, paramBytes, signature.length); var rLength = paramBytes - rPadding; var sLength = paramBytes - sPadding; var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength; var shortLength = rsBytes < MAX_OCTET; var dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes); var offset = 0; dst[offset++] = ENCODED_TAG_SEQ; if (shortLength) { // Bit 8 has value "0" // bits 7-1 give the length. dst[offset++] = rsBytes; } else { // Bit 8 of first octet has value "1" // bits 7-1 give the number of additional length octets. dst[offset++] = MAX_OCTET | 1; // length, base 256 dst[offset++] = rsBytes & 0xff; } dst[offset++] = ENCODED_TAG_INT; dst[offset++] = rLength; if (rPadding < 0) { dst[offset++] = 0; offset += signature.copy(dst, offset, 0, paramBytes); } else { offset += signature.copy(dst, offset, rPadding, paramBytes); } dst[offset++] = ENCODED_TAG_INT; dst[offset++] = sLength; if (sPadding < 0) { dst[offset++] = 0; signature.copy(dst, offset, paramBytes); } else { signature.copy(dst, offset, paramBytes + sPadding); } return dst; } module.exports = { derToJose: derToJose, joseToDer: joseToDer }; /***/ }), /***/ 30528: /***/ ((module) => { "use strict"; function getParamSize(keySize) { var result = ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1); return result; } var paramBytesForAlg = { ES256: getParamSize(256), ES384: getParamSize(384), ES512: getParamSize(521) }; function getParamBytesForAlg(alg) { var paramBytes = paramBytesForAlg[alg]; if (paramBytes) { return paramBytes; } throw new Error('Unknown algorithm "' + alg + '"'); } module.exports = getParamBytesForAlg; /***/ }), /***/ 14401: /***/ ((module) => { "use strict"; /*! * ee-first * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. * @public */ module.exports = first /** * Get the first event in a set of event emitters and event pairs. * * @param {array} stuff * @param {function} done * @public */ function first(stuff, done) { if (!Array.isArray(stuff)) throw new TypeError('arg must be an array of [ee, events...] arrays') var cleanups = [] for (var i = 0; i < stuff.length; i++) { var arr = stuff[i] if (!Array.isArray(arr) || arr.length < 2) throw new TypeError('each array member must be [ee, events...]') var ee = arr[0] for (var j = 1; j < arr.length; j++) { var event = arr[j] var fn = listener(event, callback) // listen to the event ee.on(event, fn) // push this listener to the list of cleanups cleanups.push({ ee: ee, event: event, fn: fn, }) } } function callback() { cleanup() done.apply(null, arguments) } function cleanup() { var x for (var i = 0; i < cleanups.length; i++) { x = cleanups[i] x.ee.removeListener(x.event, x.fn) } } function thunk(fn) { done = fn } thunk.cancel = cleanup return thunk } /** * Create the event listener. * @private */ function listener(event, done) { return function onevent(arg1) { var args = new Array(arguments.length) var ee = this var err = event === 'error' ? arg1 : null // copy args to prevent arguments escaping scope for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } done(err, ee, event, args) } } /***/ }), /***/ 81205: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var once = __webpack_require__(1223); var noop = function() {}; var isRequest = function(stream) { return stream.setHeader && typeof stream.abort === 'function'; }; var isChildProcess = function(stream) { return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 }; var eos = function(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var ws = stream._writableState; var rs = stream._readableState; var readable = opts.readable || (opts.readable !== false && stream.readable); var writable = opts.writable || (opts.writable !== false && stream.writable); var cancelled = false; var onlegacyfinish = function() { if (!stream.writable) onfinish(); }; var onfinish = function() { writable = false; if (!readable) callback.call(stream); }; var onend = function() { readable = false; if (!writable) callback.call(stream); }; var onexit = function(exitCode) { callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); }; var onerror = function(err) { callback.call(stream, err); }; var onclose = function() { process.nextTick(onclosenexttick); }; var onclosenexttick = function() { if (cancelled) return; if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); }; var onrequest = function() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest(); else stream.on('request', onrequest); } else if (writable && !ws) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } if (isChildProcess(stream)) stream.on('exit', onexit); stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function() { cancelled = true; stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('exit', onexit); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; }; module.exports = eos; /***/ }), /***/ 35771: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var punycode = __webpack_require__(94213); var entities = __webpack_require__(15615); module.exports = decode; function decode (str) { if (typeof str !== 'string') { throw new TypeError('Expected a String'); } return str.replace(/&(#?[^;\W]+;?)/g, function (_, match) { var m; if (m = /^#(\d+);?$/.exec(match)) { return punycode.ucs2.encode([ parseInt(m[1], 10) ]); } else if (m = /^#[Xx]([A-Fa-f0-9]+);?/.exec(match)) { return punycode.ucs2.encode([ parseInt(m[1], 16) ]); } else { // named entity var hasSemi = /;$/.test(match); var withoutSemi = hasSemi ? match.replace(/;$/, '') : match; var target = entities[withoutSemi] || (hasSemi && entities[match]); if (typeof target === 'number') { return punycode.ucs2.encode([ target ]); } else if (typeof target === 'string') { return target; } else { return '&' + match; } } }); } /***/ }), /***/ 86521: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var punycode = __webpack_require__(94213); var revEntities = __webpack_require__(88245); module.exports = encode; function encode (str, opts) { if (typeof str !== 'string') { throw new TypeError('Expected a String'); } if (!opts) opts = {}; var numeric = true; if (opts.named) numeric = false; if (opts.numeric !== undefined) numeric = opts.numeric; var special = opts.special || { '"': true, "'": true, '<': true, '>': true, '&': true }; var codePoints = punycode.ucs2.decode(str); var chars = []; for (var i = 0; i < codePoints.length; i++) { var cc = codePoints[i]; var c = punycode.ucs2.encode([ cc ]); var e = revEntities[cc]; if (e && (cc >= 127 || special[c]) && !numeric) { chars.push('&' + (/;$/.test(e) ? e : e + ';')); } else if (cc < 32 || cc >= 127 || special[c]) { chars.push('&#' + cc + ';'); } else { chars.push(c); } } return chars.join(''); } /***/ }), /***/ 1151: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { exports.encode = __webpack_require__(86521); exports.decode = __webpack_require__(35771); /***/ }), /***/ 84697: /***/ ((module, exports) => { "use strict"; /** * @author Toru Nagashima * @copyright 2015 Toru Nagashima. All rights reserved. * See LICENSE file in root directory for full license. */ Object.defineProperty(exports, "__esModule", ({ value: true })); /** * @typedef {object} PrivateData * @property {EventTarget} eventTarget The event target. * @property {{type:string}} event The original event object. * @property {number} eventPhase The current event phase. * @property {EventTarget|null} currentTarget The current event target. * @property {boolean} canceled The flag to prevent default. * @property {boolean} stopped The flag to stop propagation. * @property {boolean} immediateStopped The flag to stop propagation immediately. * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null. * @property {number} timeStamp The unix time. * @private */ /** * Private data for event wrappers. * @type {WeakMap} * @private */ const privateData = new WeakMap(); /** * Cache for wrapper classes. * @type {WeakMap} * @private */ const wrappers = new WeakMap(); /** * Get private data. * @param {Event} event The event object to get private data. * @returns {PrivateData} The private data of the event. * @private */ function pd(event) { const retv = privateData.get(event); console.assert( retv != null, "'this' is expected an Event object, but got", event ); return retv } /** * https://dom.spec.whatwg.org/#set-the-canceled-flag * @param data {PrivateData} private data. */ function setCancelFlag(data) { if (data.passiveListener != null) { if ( typeof console !== "undefined" && typeof console.error === "function" ) { console.error( "Unable to preventDefault inside passive event listener invocation.", data.passiveListener ); } return } if (!data.event.cancelable) { return } data.canceled = true; if (typeof data.event.preventDefault === "function") { data.event.preventDefault(); } } /** * @see https://dom.spec.whatwg.org/#interface-event * @private */ /** * The event wrapper. * @constructor * @param {EventTarget} eventTarget The event target of this dispatching. * @param {Event|{type:string}} event The original event to wrap. */ function Event(eventTarget, event) { privateData.set(this, { eventTarget, event, eventPhase: 2, currentTarget: eventTarget, canceled: false, stopped: false, immediateStopped: false, passiveListener: null, timeStamp: event.timeStamp || Date.now(), }); // https://heycam.github.io/webidl/#Unforgeable Object.defineProperty(this, "isTrusted", { value: false, enumerable: true }); // Define accessors const keys = Object.keys(event); for (let i = 0; i < keys.length; ++i) { const key = keys[i]; if (!(key in this)) { Object.defineProperty(this, key, defineRedirectDescriptor(key)); } } } // Should be enumerable, but class methods are not enumerable. Event.prototype = { /** * The type of this event. * @type {string} */ get type() { return pd(this).event.type }, /** * The target of this event. * @type {EventTarget} */ get target() { return pd(this).eventTarget }, /** * The target of this event. * @type {EventTarget} */ get currentTarget() { return pd(this).currentTarget }, /** * @returns {EventTarget[]} The composed path of this event. */ composedPath() { const currentTarget = pd(this).currentTarget; if (currentTarget == null) { return [] } return [currentTarget] }, /** * Constant of NONE. * @type {number} */ get NONE() { return 0 }, /** * Constant of CAPTURING_PHASE. * @type {number} */ get CAPTURING_PHASE() { return 1 }, /** * Constant of AT_TARGET. * @type {number} */ get AT_TARGET() { return 2 }, /** * Constant of BUBBLING_PHASE. * @type {number} */ get BUBBLING_PHASE() { return 3 }, /** * The target of this event. * @type {number} */ get eventPhase() { return pd(this).eventPhase }, /** * Stop event bubbling. * @returns {void} */ stopPropagation() { const data = pd(this); data.stopped = true; if (typeof data.event.stopPropagation === "function") { data.event.stopPropagation(); } }, /** * Stop event bubbling. * @returns {void} */ stopImmediatePropagation() { const data = pd(this); data.stopped = true; data.immediateStopped = true; if (typeof data.event.stopImmediatePropagation === "function") { data.event.stopImmediatePropagation(); } }, /** * The flag to be bubbling. * @type {boolean} */ get bubbles() { return Boolean(pd(this).event.bubbles) }, /** * The flag to be cancelable. * @type {boolean} */ get cancelable() { return Boolean(pd(this).event.cancelable) }, /** * Cancel this event. * @returns {void} */ preventDefault() { setCancelFlag(pd(this)); }, /** * The flag to indicate cancellation state. * @type {boolean} */ get defaultPrevented() { return pd(this).canceled }, /** * The flag to be composed. * @type {boolean} */ get composed() { return Boolean(pd(this).event.composed) }, /** * The unix time of this event. * @type {number} */ get timeStamp() { return pd(this).timeStamp }, /** * The target of this event. * @type {EventTarget} * @deprecated */ get srcElement() { return pd(this).eventTarget }, /** * The flag to stop event bubbling. * @type {boolean} * @deprecated */ get cancelBubble() { return pd(this).stopped }, set cancelBubble(value) { if (!value) { return } const data = pd(this); data.stopped = true; if (typeof data.event.cancelBubble === "boolean") { data.event.cancelBubble = true; } }, /** * The flag to indicate cancellation state. * @type {boolean} * @deprecated */ get returnValue() { return !pd(this).canceled }, set returnValue(value) { if (!value) { setCancelFlag(pd(this)); } }, /** * Initialize this event object. But do nothing under event dispatching. * @param {string} type The event type. * @param {boolean} [bubbles=false] The flag to be possible to bubble up. * @param {boolean} [cancelable=false] The flag to be possible to cancel. * @deprecated */ initEvent() { // Do nothing. }, }; // `constructor` is not enumerable. Object.defineProperty(Event.prototype, "constructor", { value: Event, configurable: true, writable: true, }); // Ensure `event instanceof window.Event` is `true`. if (typeof window !== "undefined" && typeof window.Event !== "undefined") { Object.setPrototypeOf(Event.prototype, window.Event.prototype); // Make association for wrappers. wrappers.set(window.Event.prototype, Event); } /** * Get the property descriptor to redirect a given property. * @param {string} key Property name to define property descriptor. * @returns {PropertyDescriptor} The property descriptor to redirect the property. * @private */ function defineRedirectDescriptor(key) { return { get() { return pd(this).event[key] }, set(value) { pd(this).event[key] = value; }, configurable: true, enumerable: true, } } /** * Get the property descriptor to call a given method property. * @param {string} key Property name to define property descriptor. * @returns {PropertyDescriptor} The property descriptor to call the method property. * @private */ function defineCallDescriptor(key) { return { value() { const event = pd(this).event; return event[key].apply(event, arguments) }, configurable: true, enumerable: true, } } /** * Define new wrapper class. * @param {Function} BaseEvent The base wrapper class. * @param {Object} proto The prototype of the original event. * @returns {Function} The defined wrapper class. * @private */ function defineWrapper(BaseEvent, proto) { const keys = Object.keys(proto); if (keys.length === 0) { return BaseEvent } /** CustomEvent */ function CustomEvent(eventTarget, event) { BaseEvent.call(this, eventTarget, event); } CustomEvent.prototype = Object.create(BaseEvent.prototype, { constructor: { value: CustomEvent, configurable: true, writable: true }, }); // Define accessors. for (let i = 0; i < keys.length; ++i) { const key = keys[i]; if (!(key in BaseEvent.prototype)) { const descriptor = Object.getOwnPropertyDescriptor(proto, key); const isFunc = typeof descriptor.value === "function"; Object.defineProperty( CustomEvent.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key) ); } } return CustomEvent } /** * Get the wrapper class of a given prototype. * @param {Object} proto The prototype of the original event to get its wrapper. * @returns {Function} The wrapper class. * @private */ function getWrapper(proto) { if (proto == null || proto === Object.prototype) { return Event } let wrapper = wrappers.get(proto); if (wrapper == null) { wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto); wrappers.set(proto, wrapper); } return wrapper } /** * Wrap a given event to management a dispatching. * @param {EventTarget} eventTarget The event target of this dispatching. * @param {Object} event The event to wrap. * @returns {Event} The wrapper instance. * @private */ function wrapEvent(eventTarget, event) { const Wrapper = getWrapper(Object.getPrototypeOf(event)); return new Wrapper(eventTarget, event) } /** * Get the immediateStopped flag of a given event. * @param {Event} event The event to get. * @returns {boolean} The flag to stop propagation immediately. * @private */ function isStopped(event) { return pd(event).immediateStopped } /** * Set the current event phase of a given event. * @param {Event} event The event to set current target. * @param {number} eventPhase New event phase. * @returns {void} * @private */ function setEventPhase(event, eventPhase) { pd(event).eventPhase = eventPhase; } /** * Set the current target of a given event. * @param {Event} event The event to set current target. * @param {EventTarget|null} currentTarget New current target. * @returns {void} * @private */ function setCurrentTarget(event, currentTarget) { pd(event).currentTarget = currentTarget; } /** * Set a passive listener of a given event. * @param {Event} event The event to set current target. * @param {Function|null} passiveListener New passive listener. * @returns {void} * @private */ function setPassiveListener(event, passiveListener) { pd(event).passiveListener = passiveListener; } /** * @typedef {object} ListenerNode * @property {Function} listener * @property {1|2|3} listenerType * @property {boolean} passive * @property {boolean} once * @property {ListenerNode|null} next * @private */ /** * @type {WeakMap>} * @private */ const listenersMap = new WeakMap(); // Listener types const CAPTURE = 1; const BUBBLE = 2; const ATTRIBUTE = 3; /** * Check whether a given value is an object or not. * @param {any} x The value to check. * @returns {boolean} `true` if the value is an object. */ function isObject(x) { return x !== null && typeof x === "object" //eslint-disable-line no-restricted-syntax } /** * Get listeners. * @param {EventTarget} eventTarget The event target to get. * @returns {Map} The listeners. * @private */ function getListeners(eventTarget) { const listeners = listenersMap.get(eventTarget); if (listeners == null) { throw new TypeError( "'this' is expected an EventTarget object, but got another value." ) } return listeners } /** * Get the property descriptor for the event attribute of a given event. * @param {string} eventName The event name to get property descriptor. * @returns {PropertyDescriptor} The property descriptor. * @private */ function defineEventAttributeDescriptor(eventName) { return { get() { const listeners = getListeners(this); let node = listeners.get(eventName); while (node != null) { if (node.listenerType === ATTRIBUTE) { return node.listener } node = node.next; } return null }, set(listener) { if (typeof listener !== "function" && !isObject(listener)) { listener = null; // eslint-disable-line no-param-reassign } const listeners = getListeners(this); // Traverse to the tail while removing old value. let prev = null; let node = listeners.get(eventName); while (node != null) { if (node.listenerType === ATTRIBUTE) { // Remove old value. if (prev !== null) { prev.next = node.next; } else if (node.next !== null) { listeners.set(eventName, node.next); } else { listeners.delete(eventName); } } else { prev = node; } node = node.next; } // Add new value. if (listener !== null) { const newNode = { listener, listenerType: ATTRIBUTE, passive: false, once: false, next: null, }; if (prev === null) { listeners.set(eventName, newNode); } else { prev.next = newNode; } } }, configurable: true, enumerable: true, } } /** * Define an event attribute (e.g. `eventTarget.onclick`). * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite. * @param {string} eventName The event name to define. * @returns {void} */ function defineEventAttribute(eventTargetPrototype, eventName) { Object.defineProperty( eventTargetPrototype, `on${eventName}`, defineEventAttributeDescriptor(eventName) ); } /** * Define a custom EventTarget with event attributes. * @param {string[]} eventNames Event names for event attributes. * @returns {EventTarget} The custom EventTarget. * @private */ function defineCustomEventTarget(eventNames) { /** CustomEventTarget */ function CustomEventTarget() { EventTarget.call(this); } CustomEventTarget.prototype = Object.create(EventTarget.prototype, { constructor: { value: CustomEventTarget, configurable: true, writable: true, }, }); for (let i = 0; i < eventNames.length; ++i) { defineEventAttribute(CustomEventTarget.prototype, eventNames[i]); } return CustomEventTarget } /** * EventTarget. * * - This is constructor if no arguments. * - This is a function which returns a CustomEventTarget constructor if there are arguments. * * For example: * * class A extends EventTarget {} * class B extends EventTarget("message") {} * class C extends EventTarget("message", "error") {} * class D extends EventTarget(["message", "error"]) {} */ function EventTarget() { /*eslint-disable consistent-return */ if (this instanceof EventTarget) { listenersMap.set(this, new Map()); return } if (arguments.length === 1 && Array.isArray(arguments[0])) { return defineCustomEventTarget(arguments[0]) } if (arguments.length > 0) { const types = new Array(arguments.length); for (let i = 0; i < arguments.length; ++i) { types[i] = arguments[i]; } return defineCustomEventTarget(types) } throw new TypeError("Cannot call a class as a function") /*eslint-enable consistent-return */ } // Should be enumerable, but class methods are not enumerable. EventTarget.prototype = { /** * Add a given listener to this event target. * @param {string} eventName The event name to add. * @param {Function} listener The listener to add. * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. * @returns {void} */ addEventListener(eventName, listener, options) { if (listener == null) { return } if (typeof listener !== "function" && !isObject(listener)) { throw new TypeError("'listener' should be a function or an object.") } const listeners = getListeners(this); const optionsIsObj = isObject(options); const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; const newNode = { listener, listenerType, passive: optionsIsObj && Boolean(options.passive), once: optionsIsObj && Boolean(options.once), next: null, }; // Set it as the first node if the first node is null. let node = listeners.get(eventName); if (node === undefined) { listeners.set(eventName, newNode); return } // Traverse to the tail while checking duplication.. let prev = null; while (node != null) { if ( node.listener === listener && node.listenerType === listenerType ) { // Should ignore duplication. return } prev = node; node = node.next; } // Add it. prev.next = newNode; }, /** * Remove a given listener from this event target. * @param {string} eventName The event name to remove. * @param {Function} listener The listener to remove. * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. * @returns {void} */ removeEventListener(eventName, listener, options) { if (listener == null) { return } const listeners = getListeners(this); const capture = isObject(options) ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; let prev = null; let node = listeners.get(eventName); while (node != null) { if ( node.listener === listener && node.listenerType === listenerType ) { if (prev !== null) { prev.next = node.next; } else if (node.next !== null) { listeners.set(eventName, node.next); } else { listeners.delete(eventName); } return } prev = node; node = node.next; } }, /** * Dispatch a given event. * @param {Event|{type:string}} event The event to dispatch. * @returns {boolean} `false` if canceled. */ dispatchEvent(event) { if (event == null || typeof event.type !== "string") { throw new TypeError('"event.type" should be a string.') } // If listeners aren't registered, terminate. const listeners = getListeners(this); const eventName = event.type; let node = listeners.get(eventName); if (node == null) { return true } // Since we cannot rewrite several properties, so wrap object. const wrappedEvent = wrapEvent(this, event); // This doesn't process capturing phase and bubbling phase. // This isn't participating in a tree. let prev = null; while (node != null) { // Remove this listener if it's once if (node.once) { if (prev !== null) { prev.next = node.next; } else if (node.next !== null) { listeners.set(eventName, node.next); } else { listeners.delete(eventName); } } else { prev = node; } // Call this listener setPassiveListener( wrappedEvent, node.passive ? node.listener : null ); if (typeof node.listener === "function") { try { node.listener.call(this, wrappedEvent); } catch (err) { if ( typeof console !== "undefined" && typeof console.error === "function" ) { console.error(err); } } } else if ( node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function" ) { node.listener.handleEvent(wrappedEvent); } // Break if `event.stopImmediatePropagation` was called. if (isStopped(wrappedEvent)) { break } node = node.next; } setPassiveListener(wrappedEvent, null); setEventPhase(wrappedEvent, 0); setCurrentTarget(wrappedEvent, null); return !wrappedEvent.defaultPrevented }, }; // `constructor` is not enumerable. Object.defineProperty(EventTarget.prototype, "constructor", { value: EventTarget, configurable: true, writable: true, }); // Ensure `eventTarget instanceof window.EventTarget` is `true`. if ( typeof window !== "undefined" && typeof window.EventTarget !== "undefined" ) { Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype); } exports.defineEventAttribute = defineEventAttribute; exports.EventTarget = EventTarget; exports.default = EventTarget; module.exports = EventTarget module.exports.EventTarget = module.exports.default = EventTarget module.exports.defineEventAttribute = defineEventAttribute //# sourceMappingURL=event-target-shim.js.map /***/ }), /***/ 97271: /***/ ((module, exports, __webpack_require__) => { "use strict"; // Copyright 2017 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventId = void 0; const uuid = __webpack_require__(4552); // This function is pulled directly from the d64 module: // https://github.com/dominictarr/d64 // That module hasn't been updated in 8 years, and misuses the Buffer package. // See issue here: https://github.com/google/eventid-js/issues/160 const chars = '.PYFGCRLAOEUIDHTNSQJKXBMWVZ_pyfgcrlaoeuidhtnsqjkxbmwvz1234567890' .split('') .sort() .join(''); function encode(data) { let s = ''; const l = data.length; let hang = 0; for (let i = 0; i < l; i++) { const v = data[i]; switch (i % 3) { case 0: s += chars[v >> 2]; hang = (v & 3) << 4; break; case 1: s += chars[hang | (v >> 4)]; hang = (v & 0xf) << 2; break; case 2: s += chars[hang | (v >> 6)]; s += chars[v & 0x3f]; hang = 0; break; } } if (l % 3) s += chars[hang]; return s; } class EventId { constructor() { this.b = new Uint8Array(24); uuid.v4(null, this.b, 8); } new() { for (let i = 7; i >= 0; i--) { if (this.b[i] !== 255) { this.b[i]++; break; } this.b[i] = 0; } return encode(this.b); } } exports.EventId = EventId; // preserve `const EventId = require('EventId')` syntax const existingExports = module.exports; module.exports = EventId; module.exports = Object.assign(module.exports, existingExports); //# sourceMappingURL=index.js.map /***/ }), /***/ 55447: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(85622); const childProcess = __webpack_require__(63129); const crossSpawn = __webpack_require__(1678); const stripEof = __webpack_require__(85515); const npmRunPath = __webpack_require__(33459); const isStream = __webpack_require__(81657); const _getStream = __webpack_require__(71336); const pFinally = __webpack_require__(31330); const onExit = __webpack_require__(24931); const errname = __webpack_require__(64689); const stdio = __webpack_require__(10166); const TEN_MEGABYTES = 1000 * 1000 * 10; function handleArgs(cmd, args, opts) { let parsed; opts = Object.assign({ extendEnv: true, env: {} }, opts); if (opts.extendEnv) { opts.env = Object.assign({}, process.env, opts.env); } if (opts.__winShell === true) { delete opts.__winShell; parsed = { command: cmd, args, options: opts, file: cmd, original: { cmd, args } }; } else { parsed = crossSpawn._parse(cmd, args, opts); } opts = Object.assign({ maxBuffer: TEN_MEGABYTES, buffer: true, stripEof: true, preferLocal: true, localDir: parsed.options.cwd || process.cwd(), encoding: 'utf8', reject: true, cleanup: true }, parsed.options); opts.stdio = stdio(opts); if (opts.preferLocal) { opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); } if (opts.detached) { // #115 opts.cleanup = false; } if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { // #116 parsed.args.unshift('/q'); } return { cmd: parsed.command, args: parsed.args, opts, parsed }; } function handleInput(spawned, input) { if (input === null || input === undefined) { return; } if (isStream(input)) { input.pipe(spawned.stdin); } else { spawned.stdin.end(input); } } function handleOutput(opts, val) { if (val && opts.stripEof) { val = stripEof(val); } return val; } function handleShell(fn, cmd, opts) { let file = '/bin/sh'; let args = ['-c', cmd]; opts = Object.assign({}, opts); if (process.platform === 'win32') { opts.__winShell = true; file = process.env.comspec || 'cmd.exe'; args = ['/s', '/c', `"${cmd}"`]; opts.windowsVerbatimArguments = true; } if (opts.shell) { file = opts.shell; delete opts.shell; } return fn(file, args, opts); } function getStream(process, stream, {encoding, buffer, maxBuffer}) { if (!process[stream]) { return null; } let ret; if (!buffer) { // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10 ret = new Promise((resolve, reject) => { process[stream] .once('end', resolve) .once('error', reject); }); } else if (encoding) { ret = _getStream(process[stream], { encoding, maxBuffer }); } else { ret = _getStream.buffer(process[stream], {maxBuffer}); } return ret.catch(err => { err.stream = stream; err.message = `${stream} ${err.message}`; throw err; }); } function makeError(result, options) { const {stdout, stderr} = result; let err = result.error; const {code, signal} = result; const {parsed, joinedCmd} = options; const timedOut = options.timedOut || false; if (!err) { let output = ''; if (Array.isArray(parsed.opts.stdio)) { if (parsed.opts.stdio[2] !== 'inherit') { output += output.length > 0 ? stderr : `\n${stderr}`; } if (parsed.opts.stdio[1] !== 'inherit') { output += `\n${stdout}`; } } else if (parsed.opts.stdio !== 'inherit') { output = `\n${stderr}${stdout}`; } err = new Error(`Command failed: ${joinedCmd}${output}`); err.code = code < 0 ? errname(code) : code; } err.stdout = stdout; err.stderr = stderr; err.failed = true; err.signal = signal || null; err.cmd = joinedCmd; err.timedOut = timedOut; return err; } function joinCmd(cmd, args) { let joinedCmd = cmd; if (Array.isArray(args) && args.length > 0) { joinedCmd += ' ' + args.join(' '); } return joinedCmd; } module.exports = (cmd, args, opts) => { const parsed = handleArgs(cmd, args, opts); const {encoding, buffer, maxBuffer} = parsed.opts; const joinedCmd = joinCmd(cmd, args); let spawned; try { spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); } catch (err) { return Promise.reject(err); } let removeExitHandler; if (parsed.opts.cleanup) { removeExitHandler = onExit(() => { spawned.kill(); }); } let timeoutId = null; let timedOut = false; const cleanup = () => { if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } if (removeExitHandler) { removeExitHandler(); } }; if (parsed.opts.timeout > 0) { timeoutId = setTimeout(() => { timeoutId = null; timedOut = true; spawned.kill(parsed.opts.killSignal); }, parsed.opts.timeout); } const processDone = new Promise(resolve => { spawned.on('exit', (code, signal) => { cleanup(); resolve({code, signal}); }); spawned.on('error', err => { cleanup(); resolve({error: err}); }); if (spawned.stdin) { spawned.stdin.on('error', err => { cleanup(); resolve({error: err}); }); } }); function destroy() { if (spawned.stdout) { spawned.stdout.destroy(); } if (spawned.stderr) { spawned.stderr.destroy(); } } const handlePromise = () => pFinally(Promise.all([ processDone, getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}), getStream(spawned, 'stderr', {encoding, buffer, maxBuffer}) ]).then(arr => { const result = arr[0]; result.stdout = arr[1]; result.stderr = arr[2]; if (result.error || result.code !== 0 || result.signal !== null) { const err = makeError(result, { joinedCmd, parsed, timedOut }); // TODO: missing some timeout logic for killed // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 // err.killed = spawned.killed || killed; err.killed = err.killed || spawned.killed; if (!parsed.opts.reject) { return err; } throw err; } return { stdout: handleOutput(parsed.opts, result.stdout), stderr: handleOutput(parsed.opts, result.stderr), code: 0, failed: false, killed: false, signal: null, cmd: joinedCmd, timedOut: false }; }), destroy); crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); handleInput(spawned, parsed.opts.input); spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); spawned.catch = onrejected => handlePromise().catch(onrejected); return spawned; }; // TODO: set `stderr: 'ignore'` when that option is implemented module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout); // TODO: set `stdout: 'ignore'` when that option is implemented module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr); module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); module.exports.sync = (cmd, args, opts) => { const parsed = handleArgs(cmd, args, opts); const joinedCmd = joinCmd(cmd, args); if (isStream(parsed.opts.input)) { throw new TypeError('The `input` option cannot be a stream in sync mode'); } const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); result.code = result.status; if (result.error || result.status !== 0 || result.signal !== null) { const err = makeError(result, { joinedCmd, parsed }); if (!parsed.opts.reject) { return err; } throw err; } return { stdout: handleOutput(parsed.opts, result.stdout), stderr: handleOutput(parsed.opts, result.stderr), code: 0, failed: false, signal: null, cmd: joinedCmd, timedOut: false }; }; module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); /***/ }), /***/ 64689: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Older verions of Node.js might not have `util.getSystemErrorName()`. // In that case, fall back to a deprecated internal. const util = __webpack_require__(31669); let uv; if (typeof util.getSystemErrorName === 'function') { module.exports = util.getSystemErrorName; } else { try { uv = process.binding('uv'); if (typeof uv.errname !== 'function') { throw new TypeError('uv.errname is not a function'); } } catch (err) { console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); uv = null; } module.exports = code => errname(uv, code); } // Used for testing the fallback behavior module.exports.__test__ = errname; function errname(uv, code) { if (uv) { return uv.errname(code); } if (!(code < 0)) { throw new Error('err >= 0'); } return `Unknown system error ${code}`; } /***/ }), /***/ 10166: /***/ ((module) => { "use strict"; const alias = ['stdin', 'stdout', 'stderr']; const hasAlias = opts => alias.some(x => Boolean(opts[x])); module.exports = opts => { if (!opts) { return null; } if (opts.stdio && hasAlias(opts)) { throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); } if (typeof opts.stdio === 'string') { return opts.stdio; } const stdio = opts.stdio || []; if (!Array.isArray(stdio)) { throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); } const result = []; const len = Math.max(stdio.length, alias.length); for (let i = 0; i < len; i++) { let value = null; if (stdio[i] !== undefined) { value = stdio[i]; } else if (opts[alias[i]] !== undefined) { value = opts[alias[i]]; } result[i] = value; } return result; }; /***/ }), /***/ 1678: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const cp = __webpack_require__(63129); const parse = __webpack_require__(73756); const enoent = __webpack_require__(35419); function spawn(command, args, options) { // Parse the arguments const parsed = parse(command, args, options); // Spawn the child process const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); // Hook into child process "exit" event to emit an error if the command // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 enoent.hookChildProcess(spawned, parsed); return spawned; } function spawnSync(command, args, options) { // Parse the arguments const parsed = parse(command, args, options); // Spawn the child process const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); return result; } module.exports = spawn; module.exports.spawn = spawn; module.exports.sync = spawnSync; module.exports._parse = parse; module.exports._enoent = enoent; /***/ }), /***/ 35419: /***/ ((module) => { "use strict"; const isWin = process.platform === 'win32'; function notFoundError(original, syscall) { return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { code: 'ENOENT', errno: 'ENOENT', syscall: `${syscall} ${original.command}`, path: original.command, spawnargs: original.args, }); } function hookChildProcess(cp, parsed) { if (!isWin) { return; } const originalEmit = cp.emit; cp.emit = function (name, arg1) { // If emitting "exit" event and exit code is 1, we need to check if // the command exists and emit an "error" instead // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 if (name === 'exit') { const err = verifyENOENT(arg1, parsed, 'spawn'); if (err) { return originalEmit.call(cp, 'error', err); } } return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params }; } function verifyENOENT(status, parsed) { if (isWin && status === 1 && !parsed.file) { return notFoundError(parsed.original, 'spawn'); } return null; } function verifyENOENTSync(status, parsed) { if (isWin && status === 1 && !parsed.file) { return notFoundError(parsed.original, 'spawnSync'); } return null; } module.exports = { hookChildProcess, verifyENOENT, verifyENOENTSync, notFoundError, }; /***/ }), /***/ 73756: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(85622); const niceTry = __webpack_require__(38560); const resolveCommand = __webpack_require__(19727); const escape = __webpack_require__(79482); const readShebang = __webpack_require__(17295); const semver = __webpack_require__(55232); const isWin = process.platform === 'win32'; const isExecutableRegExp = /\.(?:com|exe)$/i; const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0 const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false; function detectShebang(parsed) { parsed.file = resolveCommand(parsed); const shebang = parsed.file && readShebang(parsed.file); if (shebang) { parsed.args.unshift(parsed.file); parsed.command = shebang; return resolveCommand(parsed); } return parsed.file; } function parseNonShell(parsed) { if (!isWin) { return parsed; } // Detect & add support for shebangs const commandFile = detectShebang(parsed); // We don't need a shell if the command filename is an executable const needsShell = !isExecutableRegExp.test(commandFile); // If a shell is required, use cmd.exe and take care of escaping everything correctly // Note that `forceShell` is an hidden option used only in tests if (parsed.options.forceShell || needsShell) { // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, // we need to double escape them const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) // This is necessary otherwise it will always fail with ENOENT in those cases parsed.command = path.normalize(parsed.command); // Escape command & arguments parsed.command = escape.command(parsed.command); parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); const shellCommand = [parsed.command].concat(parsed.args).join(' '); parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; parsed.command = process.env.comspec || 'cmd.exe'; parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped } return parsed; } function parseShell(parsed) { // If node supports the shell option, there's no need to mimic its behavior if (supportsShellOption) { return parsed; } // Mimic node shell option // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 const shellCommand = [parsed.command].concat(parsed.args).join(' '); if (isWin) { parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped } else { if (typeof parsed.options.shell === 'string') { parsed.command = parsed.options.shell; } else if (process.platform === 'android') { parsed.command = '/system/bin/sh'; } else { parsed.command = '/bin/sh'; } parsed.args = ['-c', shellCommand]; } return parsed; } function parse(command, args, options) { // Normalize arguments, similar to nodejs if (args && !Array.isArray(args)) { options = args; args = null; } args = args ? args.slice(0) : []; // Clone array to avoid changing the original options = Object.assign({}, options); // Clone object to avoid changing the original // Build our parsed object const parsed = { command, args, options, file: undefined, original: { command, args, }, }; // Delegate further parsing to shell or non-shell return options.shell ? parseShell(parsed) : parseNonShell(parsed); } module.exports = parse; /***/ }), /***/ 79482: /***/ ((module) => { "use strict"; // See http://www.robvanderwoude.com/escapechars.php const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; function escapeCommand(arg) { // Escape meta chars arg = arg.replace(metaCharsRegExp, '^$1'); return arg; } function escapeArgument(arg, doubleEscapeMetaChars) { // Convert to string arg = `${arg}`; // Algorithm below is based on https://qntm.org/cmd // Sequence of backslashes followed by a double quote: // double up all the backslashes and escape the double quote arg = arg.replace(/(\\*)"/g, '$1$1\\"'); // Sequence of backslashes followed by the end of the string // (which will become a double quote later): // double up all the backslashes arg = arg.replace(/(\\*)$/, '$1$1'); // All other backslashes occur literally // Quote the whole thing: arg = `"${arg}"`; // Escape meta chars arg = arg.replace(metaCharsRegExp, '^$1'); // Double escape meta chars if necessary if (doubleEscapeMetaChars) { arg = arg.replace(metaCharsRegExp, '^$1'); } return arg; } module.exports.command = escapeCommand; module.exports.argument = escapeArgument; /***/ }), /***/ 17295: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(35747); const shebangCommand = __webpack_require__(52665); function readShebang(command) { // Read the first 150 bytes from the file const size = 150; let buffer; if (Buffer.alloc) { // Node.js v4.5+ / v5.10+ buffer = Buffer.alloc(size); } else { // Old Node.js API buffer = new Buffer(size); buffer.fill(0); // zero-fill } let fd; try { fd = fs.openSync(command, 'r'); fs.readSync(fd, buffer, 0, size, 0); fs.closeSync(fd); } catch (e) { /* Empty */ } // Attempt to extract shebang (null is returned if not a shebang) return shebangCommand(buffer.toString()); } module.exports = readShebang; /***/ }), /***/ 19727: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(85622); const which = __webpack_require__(93008); const pathKey = __webpack_require__(20539)(); function resolveCommandAttempt(parsed, withoutPathExt) { const cwd = process.cwd(); const hasCustomCwd = parsed.options.cwd != null; // If a custom `cwd` was specified, we need to change the process cwd // because `which` will do stat calls but does not support a custom cwd if (hasCustomCwd) { try { process.chdir(parsed.options.cwd); } catch (err) { /* Empty */ } } let resolved; try { resolved = which.sync(parsed.command, { path: (parsed.options.env || process.env)[pathKey], pathExt: withoutPathExt ? path.delimiter : undefined, }); } catch (e) { /* Empty */ } finally { process.chdir(cwd); } // If we successfully resolved, ensure that an absolute path is returned // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it if (resolved) { resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); } return resolved; } function resolveCommand(parsed) { return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); } module.exports = resolveCommand; /***/ }), /***/ 7740: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {PassThrough} = __webpack_require__(92413); module.exports = options => { options = Object.assign({}, options); const {array} = options; let {encoding} = options; const buffer = encoding === 'buffer'; let objectMode = false; if (array) { objectMode = !(encoding || buffer); } else { encoding = encoding || 'utf8'; } if (buffer) { encoding = null; } let len = 0; const ret = []; const stream = new PassThrough({objectMode}); if (encoding) { stream.setEncoding(encoding); } stream.on('data', chunk => { ret.push(chunk); if (objectMode) { len = ret.length; } else { len += chunk.length; } }); stream.getBufferedValue = () => { if (array) { return ret; } return buffer ? Buffer.concat(ret, len) : ret.join(''); }; stream.getBufferedLength = () => len; return stream; }; /***/ }), /***/ 71336: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const pump = __webpack_require__(18341); const bufferStream = __webpack_require__(7740); class MaxBufferError extends Error { constructor() { super('maxBuffer exceeded'); this.name = 'MaxBufferError'; } } function getStream(inputStream, options) { if (!inputStream) { return Promise.reject(new Error('Expected a stream')); } options = Object.assign({maxBuffer: Infinity}, options); const {maxBuffer} = options; let stream; return new Promise((resolve, reject) => { const rejectPromise = error => { if (error) { // A null check error.bufferedData = stream.getBufferedValue(); } reject(error); }; stream = pump(inputStream, bufferStream(options), error => { if (error) { rejectPromise(error); return; } resolve(); }); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { rejectPromise(new MaxBufferError()); } }); }).then(() => stream.getBufferedValue()); } module.exports = getStream; module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'})); module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true})); module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 81657: /***/ ((module) => { "use strict"; var isStream = module.exports = function (stream) { return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; }; isStream.writable = function (stream) { return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; }; isStream.readable = function (stream) { return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; }; isStream.duplex = function (stream) { return isStream.writable(stream) && isStream.readable(stream); }; isStream.transform = function (stream) { return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; }; /***/ }), /***/ 33459: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(85622); const pathKey = __webpack_require__(20539); module.exports = opts => { opts = Object.assign({ cwd: process.cwd(), path: process.env[pathKey()] }, opts); let prev; let pth = path.resolve(opts.cwd); const ret = []; while (prev !== pth) { ret.push(path.join(pth, 'node_modules/.bin')); prev = pth; pth = path.resolve(pth, '..'); } // ensure the running `node` binary is used ret.push(path.dirname(process.execPath)); return ret.concat(opts.path).join(path.delimiter); }; module.exports.env = opts => { opts = Object.assign({ env: process.env }, opts); const env = Object.assign({}, opts.env); const path = pathKey({env}); opts.path = env[path]; env[path] = module.exports(opts); return env; }; /***/ }), /***/ 55232: /***/ ((module, exports) => { exports = module.exports = SemVer var debug /* istanbul ignore next */ if (typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { debug = function () { var args = Array.prototype.slice.call(arguments, 0) args.unshift('SEMVER') console.log.apply(console, args) } } else { debug = function () {} } // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. exports.SEMVER_SPEC_VERSION = '2.0.0' var MAX_LENGTH = 256 var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 // The actual regexps go on exports.re var re = exports.re = [] var src = exports.src = [] var R = 0 // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. var NUMERICIDENTIFIER = R++ src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' var NUMERICIDENTIFIERLOOSE = R++ src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. var NONNUMERICIDENTIFIER = R++ src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' // ## Main Version // Three dot-separated numeric identifiers. var MAINVERSION = R++ src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')' var MAINVERSIONLOOSE = R++ src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')' // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. var PRERELEASEIDENTIFIER = R++ src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + '|' + src[NONNUMERICIDENTIFIER] + ')' var PRERELEASEIDENTIFIERLOOSE = R++ src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + '|' + src[NONNUMERICIDENTIFIER] + ')' // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. var PRERELEASE = R++ src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' var PRERELEASELOOSE = R++ src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. var BUILDIDENTIFIER = R++ src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. var BUILD = R++ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. var FULL = R++ var FULLPLAIN = 'v?' + src[MAINVERSION] + src[PRERELEASE] + '?' + src[BUILD] + '?' src[FULL] = '^' + FULLPLAIN + '$' // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + '?' + src[BUILD] + '?' var LOOSE = R++ src[LOOSE] = '^' + LOOSEPLAIN + '$' var GTLT = R++ src[GTLT] = '((?:<|>)?=?)' // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. var XRANGEIDENTIFIERLOOSE = R++ src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' var XRANGEIDENTIFIER = R++ src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' var XRANGEPLAIN = R++ src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:' + src[PRERELEASE] + ')?' + src[BUILD] + '?' + ')?)?' var XRANGEPLAINLOOSE = R++ src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[PRERELEASELOOSE] + ')?' + src[BUILD] + '?' + ')?)?' var XRANGE = R++ src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' var XRANGELOOSE = R++ src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' // Coercion. // Extract anything that could conceivably be a part of a valid semver var COERCE = R++ src[COERCE] = '(?:^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])' // Tilde ranges. // Meaning is "reasonably at or greater than" var LONETILDE = R++ src[LONETILDE] = '(?:~>?)' var TILDETRIM = R++ src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') var tildeTrimReplace = '$1~' var TILDE = R++ src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' var TILDELOOSE = R++ src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' // Caret ranges. // Meaning is "at least and backwards compatible with" var LONECARET = R++ src[LONECARET] = '(?:\\^)' var CARETTRIM = R++ src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') var caretTrimReplace = '$1^' var CARET = R++ src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' var CARETLOOSE = R++ src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' // A simple gt/lt/eq thing, or just "" to indicate "any version" var COMPARATORLOOSE = R++ src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' var COMPARATOR = R++ src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` var COMPARATORTRIM = R++ src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' // this one has to use the /g flag re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. var HYPHENRANGE = R++ src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAIN] + ')' + '\\s*$' var HYPHENRANGELOOSE = R++ src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAINLOOSE] + ')' + '\\s*$' // Star ranges basically just allow anything at all. var STAR = R++ src[STAR] = '(<|>)?=?\\s*\\*' // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) } } exports.parse = parse function parse (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } var r = options.loose ? re[LOOSE] : re[FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } exports.valid = valid function valid (version, options) { var v = parse(version, options) return v ? v.version : null } exports.clean = clean function clean (version, options) { var s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } exports.SemVer = SemVer function SemVer (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { if (version.loose === options.loose) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError('Invalid Version: ' + version) } if (version.length > MAX_LENGTH) { throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') } if (!(this instanceof SemVer)) { return new SemVer(version, options) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map(function (id) { if (/^[0-9]+$/.test(id)) { var num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } SemVer.prototype.format = function () { this.version = this.major + '.' + this.minor + '.' + this.patch if (this.prerelease.length) { this.version += '-' + this.prerelease.join('.') } return this.version } SemVer.prototype.toString = function () { return this.version } SemVer.prototype.compare = function (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return this.compareMain(other) || this.comparePre(other) } SemVer.prototype.compareMain = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) } SemVer.prototype.comparePre = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } var i = 0 do { var a = this.prerelease[i] var b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. SemVer.prototype.inc = function (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { var i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error('invalid increment argument: ' + release) } this.format() this.raw = this.version return this } exports.inc = inc function inc (version, release, loose, identifier) { if (typeof (loose) === 'string') { identifier = loose loose = undefined } try { return new SemVer(version, loose).inc(release, identifier).version } catch (er) { return null } } exports.diff = diff function diff (version1, version2) { if (eq(version1, version2)) { return null } else { var v1 = parse(version1) var v2 = parse(version2) var prefix = '' if (v1.prerelease.length || v2.prerelease.length) { prefix = 'pre' var defaultResult = 'prerelease' } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } exports.compareIdentifiers = compareIdentifiers var numeric = /^[0-9]+$/ function compareIdentifiers (a, b) { var anum = numeric.test(a) var bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } exports.rcompareIdentifiers = rcompareIdentifiers function rcompareIdentifiers (a, b) { return compareIdentifiers(b, a) } exports.major = major function major (a, loose) { return new SemVer(a, loose).major } exports.minor = minor function minor (a, loose) { return new SemVer(a, loose).minor } exports.patch = patch function patch (a, loose) { return new SemVer(a, loose).patch } exports.compare = compare function compare (a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)) } exports.compareLoose = compareLoose function compareLoose (a, b) { return compare(a, b, true) } exports.rcompare = rcompare function rcompare (a, b, loose) { return compare(b, a, loose) } exports.sort = sort function sort (list, loose) { return list.sort(function (a, b) { return exports.compare(a, b, loose) }) } exports.rsort = rsort function rsort (list, loose) { return list.sort(function (a, b) { return exports.rcompare(a, b, loose) }) } exports.gt = gt function gt (a, b, loose) { return compare(a, b, loose) > 0 } exports.lt = lt function lt (a, b, loose) { return compare(a, b, loose) < 0 } exports.eq = eq function eq (a, b, loose) { return compare(a, b, loose) === 0 } exports.neq = neq function neq (a, b, loose) { return compare(a, b, loose) !== 0 } exports.gte = gte function gte (a, b, loose) { return compare(a, b, loose) >= 0 } exports.lte = lte function lte (a, b, loose) { return compare(a, b, loose) <= 0 } exports.cmp = cmp function cmp (a, op, b, loose) { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError('Invalid operator: ' + op) } } exports.Comparator = Comparator function Comparator (comp, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } if (!(this instanceof Comparator)) { return new Comparator(comp, options) } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } var ANY = {} Comparator.prototype.parse = function (comp) { var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] var m = comp.match(r) if (!m) { throw new TypeError('Invalid comparator: ' + comp) } this.operator = m[1] if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } Comparator.prototype.toString = function () { return this.value } Comparator.prototype.test = function (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY) { return true } if (typeof version === 'string') { version = new SemVer(version, this.options) } return cmp(version, this.operator, this.semver, this.options) } Comparator.prototype.intersects = function (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } var rangeTmp if (this.operator === '') { rangeTmp = new Range(comp.value, options) return satisfies(this.value, rangeTmp, options) } else if (comp.operator === '') { rangeTmp = new Range(this.value, options) return satisfies(comp.semver, rangeTmp, options) } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') var sameSemVer = this.semver.version === comp.semver.version var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && ((this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<')) var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && ((this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>')) return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan } exports.Range = Range function Range (range, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (range instanceof Range) { if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { return new Range(range.value, options) } if (!(this instanceof Range)) { return new Range(range, options) } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range.split(/\s*\|\|\s*/).map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason return c.length }) if (!this.set.length) { throw new TypeError('Invalid SemVer Range: ' + range) } this.format() } Range.prototype.format = function () { this.range = this.set.map(function (comps) { return comps.join(' ').trim() }).join('||').trim() return this.range } Range.prototype.toString = function () { return this.range } Range.prototype.parseRange = function (range) { var loose = this.options.loose range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) if (this.options.loose) { // in loose mode, throw out any that are not valid comparators set = set.filter(function (comp) { return !!comp.match(compRe) }) } set = set.map(function (comp) { return new Comparator(comp, this.options) }, this) return set } Range.prototype.intersects = function (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some(function (thisComparators) { return thisComparators.every(function (thisComparator) { return range.set.some(function (rangeComparators) { return rangeComparators.every(function (rangeComparator) { return thisComparator.intersects(rangeComparator, options) }) }) }) }) } // Mostly just for testing and legacy API reasons exports.toComparators = toComparators function toComparators (range, options) { return new Range(range, options).set.map(function (comp) { return comp.map(function (c) { return c.value }).join(' ').trim().split(' ') }) } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. function parseComparator (comp, options) { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } function isX (id) { return !id || id.toLowerCase() === 'x' || id === '*' } // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceTilde(comp, options) }).join(' ') } function replaceTilde (comp, options) { var r = options.loose ? re[TILDELOOSE] : re[TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else if (pr) { debug('replaceTilde pr', pr) ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } else { // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceCaret(comp, options) }).join(' ') } function replaceCaret (comp, options) { debug('caret', comp, options) var r = options.loose ? re[CARETLOOSE] : re[CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { if (M === '0') { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else { ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0' } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0' } } debug('caret return', ret) return ret }) } function replaceXRanges (comp, options) { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map(function (comp) { return replaceXRange(comp, options) }).join(' ') } function replaceXRange (comp, options) { comp = comp.trim() var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) var xm = xM || isX(m) var xp = xm || isX(p) var anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } ret = gtlt + M + '.' + m + '.' + p } else if (xm) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (xp) { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[STAR], '') } // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) { from = '' } else if (isX(fm)) { from = '>=' + fM + '.0.0' } else if (isX(fp)) { from = '>=' + fM + '.' + fm + '.0' } else { from = '>=' + from } if (isX(tM)) { to = '' } else if (isX(tm)) { to = '<' + (+tM + 1) + '.0.0' } else if (isX(tp)) { to = '<' + tM + '.' + (+tm + 1) + '.0' } else if (tpr) { to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr } else { to = '<=' + to } return (from + ' ' + to).trim() } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function (version) { if (!version) { return false } if (typeof version === 'string') { version = new SemVer(version, this.options) } for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } function testSet (set, version, options) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === ANY) { continue } if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } exports.satisfies = satisfies function satisfies (version, range, options) { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } exports.maxSatisfying = maxSatisfying function maxSatisfying (versions, range, options) { var max = null var maxSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } exports.minSatisfying = minSatisfying function minSatisfying (versions, range, options) { var min = null var minSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } exports.minVersion = minVersion function minVersion (range, loose) { range = new Range(range, loose) var minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] comparators.forEach(function (comparator) { // Clone to avoid manipulating the comparator's semver object. var compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!minver || gt(minver, compver)) { minver = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error('Unexpected operation: ' + comparator.operator) } }) } if (minver && range.test(minver)) { return minver } return null } exports.validRange = validRange function validRange (range, options) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr function ltr (version, range, options) { return outside(version, range, '<', options) } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr function gtr (version, range, options) { return outside(version, range, '>', options) } exports.outside = outside function outside (version, range, hilo, options) { version = new SemVer(version, options) range = new Range(range, options) var gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisifes the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] var high = null var low = null comparators.forEach(function (comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } exports.prerelease = prerelease function prerelease (version, options) { var parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } exports.intersects = intersects function intersects (r1, r2, options) { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } exports.coerce = coerce function coerce (version) { if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } var match = version.match(re[COERCE]) if (match == null) { return null } return parse(match[1] + '.' + (match[2] || '0') + '.' + (match[3] || '0')) } /***/ }), /***/ 52665: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var shebangRegex = __webpack_require__(27433); module.exports = function (str) { var match = str.match(shebangRegex); if (!match) { return null; } var arr = match[0].replace(/#! ?/, '').split(' '); var bin = arr[0].split('/').pop(); var arg = arr[1]; return (bin === 'env' ? arg : bin + (arg ? ' ' + arg : '') ); }; /***/ }), /***/ 27433: /***/ ((module) => { "use strict"; module.exports = /^#!.*/; /***/ }), /***/ 93008: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = which which.sync = whichSync var isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' var path = __webpack_require__(85622) var COLON = isWindows ? ';' : ':' var isexe = __webpack_require__(97126) function getNotFoundError (cmd) { var er = new Error('not found: ' + cmd) er.code = 'ENOENT' return er } function getPathInfo (cmd, opt) { var colon = opt.colon || COLON var pathEnv = opt.path || process.env.PATH || '' var pathExt = [''] pathEnv = pathEnv.split(colon) var pathExtExe = '' if (isWindows) { pathEnv.unshift(process.cwd()) pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') pathExt = pathExtExe.split(colon) // Always test the cmd itself first. isexe will check to make sure // it's found in the pathExt set. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') pathExt.unshift('') } // If it has a slash, then we don't bother searching the pathenv. // just check the file itself, and that's it. if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) pathEnv = [''] return { env: pathEnv, ext: pathExt, extExe: pathExtExe } } function which (cmd, opt, cb) { if (typeof opt === 'function') { cb = opt opt = {} } var info = getPathInfo(cmd, opt) var pathEnv = info.env var pathExt = info.ext var pathExtExe = info.extExe var found = [] ;(function F (i, l) { if (i === l) { if (opt.all && found.length) return cb(null, found) else return cb(getNotFoundError(cmd)) } var pathPart = pathEnv[i] if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1) var p = path.join(pathPart, cmd) if (!pathPart && (/^\.[\\\/]/).test(cmd)) { p = cmd.slice(0, 2) + p } ;(function E (ii, ll) { if (ii === ll) return F(i + 1, l) var ext = pathExt[ii] isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { if (!er && is) { if (opt.all) found.push(p + ext) else return cb(null, p + ext) } return E(ii + 1, ll) }) })(0, pathExt.length) })(0, pathEnv.length) } function whichSync (cmd, opt) { opt = opt || {} var info = getPathInfo(cmd, opt) var pathEnv = info.env var pathExt = info.ext var pathExtExe = info.extExe var found = [] for (var i = 0, l = pathEnv.length; i < l; i ++) { var pathPart = pathEnv[i] if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1) var p = path.join(pathPart, cmd) if (!pathPart && /^\.[\\\/]/.test(cmd)) { p = cmd.slice(0, 2) + p } for (var j = 0, ll = pathExt.length; j < ll; j ++) { var cur = p + pathExt[j] var is try { is = isexe.sync(cur, { pathExt: pathExtExe }) if (is) { if (opt.all) found.push(cur) else return cur } } catch (ex) {} } } if (opt.all && found.length) return found if (opt.nothrow) return null throw getNotFoundError(cmd) } /***/ }), /***/ 38171: /***/ ((module) => { "use strict"; var hasOwn = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var defineProperty = Object.defineProperty; var gOPD = Object.getOwnPropertyDescriptor; var isArray = function isArray(arr) { if (typeof Array.isArray === 'function') { return Array.isArray(arr); } return toStr.call(arr) === '[object Array]'; }; var isPlainObject = function isPlainObject(obj) { if (!obj || toStr.call(obj) !== '[object Object]') { return false; } var hasOwnConstructor = hasOwn.call(obj, 'constructor'); var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); // Not own constructor property must be Object if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for (key in obj) { /**/ } return typeof key === 'undefined' || hasOwn.call(obj, key); }; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target var setProperty = function setProperty(target, options) { if (defineProperty && options.name === '__proto__') { defineProperty(target, options.name, { enumerable: true, configurable: true, value: options.newValue, writable: true }); } else { target[options.name] = options.newValue; } }; // Return undefined instead of __proto__ if '__proto__' is not an own property var getProperty = function getProperty(obj, name) { if (name === '__proto__') { if (!hasOwn.call(obj, name)) { return void 0; } else if (gOPD) { // In early versions of node, obj['__proto__'] is buggy when obj has // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. return gOPD(obj, name).value; } } return obj[name]; }; module.exports = function extend() { var options, name, src, copy, copyIsArray, clone; var target = arguments[0]; var i = 1; var length = arguments.length; var deep = false; // Handle a deep copy situation if (typeof target === 'boolean') { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { target = {}; } for (; i < length; ++i) { options = arguments[i]; // Only deal with non-null/undefined values if (options != null) { // Extend the base object for (name in options) { src = getProperty(target, name); copy = getProperty(options, name); // Prevent never-ending loop if (target !== copy) { // Recurse if we're merging plain objects or arrays if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && isArray(src) ? src : []; } else { clone = src && isPlainObject(src) ? src : {}; } // Never move original objects, clone them setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); // Don't bring in undefined values } else if (typeof copy !== 'undefined') { setProperty(target, { name: name, newValue: copy }); } } } } } // Return the modified object return target; }; /***/ }), /***/ 87264: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* * extsprintf.js: extended POSIX-style sprintf */ var mod_assert = __webpack_require__(42357); var mod_util = __webpack_require__(31669); /* * Public interface */ exports.sprintf = jsSprintf; exports.printf = jsPrintf; exports.fprintf = jsFprintf; /* * Stripped down version of s[n]printf(3c). We make a best effort to throw an * exception when given a format string we don't understand, rather than * ignoring it, so that we won't break existing programs if/when we go implement * the rest of this. * * This implementation currently supports specifying * - field alignment ('-' flag), * - zero-pad ('0' flag) * - always show numeric sign ('+' flag), * - field width * - conversions for strings, decimal integers, and floats (numbers). * - argument size specifiers. These are all accepted but ignored, since * Javascript has no notion of the physical size of an argument. * * Everything else is currently unsupported, most notably precision, unsigned * numbers, non-decimal numbers, and characters. */ function jsSprintf(fmt) { var regex = [ '([^%]*)', /* normal text */ '%', /* start of format */ '([\'\\-+ #0]*?)', /* flags (optional) */ '([1-9]\\d*)?', /* width (optional) */ '(\\.([1-9]\\d*))?', /* precision (optional) */ '[lhjztL]*?', /* length mods (ignored) */ '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */ ].join(''); var re = new RegExp(regex); var args = Array.prototype.slice.call(arguments, 1); var flags, width, precision, conversion; var left, pad, sign, arg, match; var ret = ''; var argn = 1; mod_assert.equal('string', typeof (fmt)); while ((match = re.exec(fmt)) !== null) { ret += match[1]; fmt = fmt.substring(match[0].length); flags = match[2] || ''; width = match[3] || 0; precision = match[4] || ''; conversion = match[6]; left = false; sign = false; pad = ' '; if (conversion == '%') { ret += '%'; continue; } if (args.length === 0) throw (new Error('too few args to sprintf')); arg = args.shift(); argn++; if (flags.match(/[\' #]/)) throw (new Error( 'unsupported flags: ' + flags)); if (precision.length > 0) throw (new Error( 'non-zero precision not supported')); if (flags.match(/-/)) left = true; if (flags.match(/0/)) pad = '0'; if (flags.match(/\+/)) sign = true; switch (conversion) { case 's': if (arg === undefined || arg === null) throw (new Error('argument ' + argn + ': attempted to print undefined or null ' + 'as a string')); ret += doPad(pad, width, left, arg.toString()); break; case 'd': arg = Math.floor(arg); /*jsl:fallthru*/ case 'f': sign = sign && arg > 0 ? '+' : ''; ret += sign + doPad(pad, width, left, arg.toString()); break; case 'x': ret += doPad(pad, width, left, arg.toString(16)); break; case 'j': /* non-standard */ if (width === 0) width = 10; ret += mod_util.inspect(arg, false, width); break; case 'r': /* non-standard */ ret += dumpException(arg); break; default: throw (new Error('unsupported conversion: ' + conversion)); } } ret += fmt; return (ret); } function jsPrintf() { var args = Array.prototype.slice.call(arguments); args.unshift(process.stdout); jsFprintf.apply(null, args); } function jsFprintf(stream) { var args = Array.prototype.slice.call(arguments, 1); return (stream.write(jsSprintf.apply(this, args))); } function doPad(chr, width, left, str) { var ret = str; while (ret.length < width) { if (left) ret += chr; else ret = chr + ret; } return (ret); } /* * This function dumps long stack traces for exceptions having a cause() method. * See node-verror for an example. */ function dumpException(ex) { var ret; if (!(ex instanceof Error)) throw (new Error(jsSprintf('invalid type for %%r: %j', ex))); /* Note that V8 prepends "ex.stack" with ex.toString(). */ ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack; if (ex.cause && typeof (ex.cause) === 'function') { var cex = ex.cause(); if (cex) { ret += '\nCaused by: ' + dumpException(cex); } } return (ret); } /***/ }), /***/ 28206: /***/ ((module) => { "use strict"; // do not edit .js files directly - edit src/index.jst module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; /***/ }), /***/ 30969: /***/ ((module) => { "use strict"; module.exports = function (data, opts) { if (!opts) opts = {}; if (typeof opts === 'function') opts = { cmp: opts }; var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; var cmp = opts.cmp && (function (f) { return function (node) { return function (a, b) { var aobj = { key: a, value: node[a] }; var bobj = { key: b, value: node[b] }; return f(aobj, bobj); }; }; })(opts.cmp); var seen = []; return (function stringify (node) { if (node && node.toJSON && typeof node.toJSON === 'function') { node = node.toJSON(); } if (node === undefined) return; if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; if (typeof node !== 'object') return JSON.stringify(node); var i, out; if (Array.isArray(node)) { out = '['; for (i = 0; i < node.length; i++) { if (i) out += ','; out += stringify(node[i]) || 'null'; } return out + ']'; } if (node === null) return 'null'; if (seen.indexOf(node) !== -1) { if (cycles) return JSON.stringify('__cycle__'); throw new TypeError('Converting circular structure to JSON'); } var seenIndex = seen.push(node) - 1; var keys = Object.keys(node).sort(cmp && cmp(node)); out = ''; for (i = 0; i < keys.length; i++) { var key = keys[i]; var value = stringify(node[key]); if (!value) continue; if (out) out += ','; out += JSON.stringify(key) + ':' + value; } seen.splice(seenIndex, 1); return '{' + out + '}'; })(data); }; /***/ }), /***/ 21917: /***/ (function() { (function(l){function m(){}function k(a,c){a=void 0===a?"utf-8":a;c=void 0===c?{fatal:!1}:c;if(-1===r.indexOf(a.toLowerCase()))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+a+"') is invalid.");if(c.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}function t(a){return Buffer.from(a.buffer,a.byteOffset,a.byteLength).toString("utf-8")}function u(a){var c=URL.createObjectURL(new Blob([a],{type:"text/plain;charset=UTF-8"})); try{var f=new XMLHttpRequest;f.open("GET",c,!1);f.send();return f.responseText}catch(e){return q(a)}finally{URL.revokeObjectURL(c)}}function q(a){for(var c=0,f=Math.min(65536,a.length+1),e=new Uint16Array(f),h=[],d=0;;){var b=c=f-1){h.push(String.fromCharCode.apply(null,e.subarray(0,d)));if(!b)return h.join("");a=a.subarray(c);d=c=0}b=a[c++];if(0===(b&128))e[d++]=b;else if(192===(b&224)){var g=a[c++]&63;e[d++]=(b&31)<<6|g}else if(224===(b&240)){g=a[c++]&63;var n=a[c++]&63;e[d++]= (b&31)<<12|g<<6|n}else if(240===(b&248)){g=a[c++]&63;n=a[c++]&63;var v=a[c++]&63;b=(b&7)<<18|g<<12|n<<6|v;65535>>10&1023|55296,b=56320|b&1023);e[d++]=b}}}if(l.TextEncoder&&l.TextDecoder)return!1;var r=["utf-8","utf8","unicode-1-1-utf-8"];Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(a,c){c=void 0===c?{stream:!1}:c;if(c.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");c=0;for(var f=a.length,e=0,h=Math.max(32, f+(f>>>1)+7),d=new Uint8Array(h>>>3<<3);c=b){if(c=b)continue}e+4>d.length&&(h+=8,h*=1+c/a.length*2,h=h>>>3<<3,g=new Uint8Array(h),g.set(d),d=g);if(0===(b&4294967168))d[e++]=b;else{if(0===(b&4294965248))d[e++]=b>>>6&31|192;else if(0===(b&4294901760))d[e++]=b>>>12&15|224,d[e++]=b>>>6&63|128;else if(0===(b&4292870144))d[e++]=b>>>18&7|240,d[e++]=b>>>12& 63|128,d[e++]=b>>>6&63|128;else continue;d[e++]=b&63|128}}return d.slice?d.slice(0,e):d.subarray(0,e)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});var p=q;"function"===typeof Buffer&&Buffer.from?p=t:"function"===typeof Blob&&"function"===typeof URL&&"function"===typeof URL.createObjectURL&&(p=u);k.prototype.decode=function(a,c){c=void 0===c?{stream:!1}:c;if(c.stream)throw Error("Failed to decode: the 'stream' option is unsupported."); a=a instanceof Uint8Array?a:a.buffer instanceof ArrayBuffer?new Uint8Array(a.buffer):new Uint8Array(a);return p(a)};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this); /***/ }), /***/ 47568: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = ForeverAgent ForeverAgent.SSL = ForeverAgentSSL var util = __webpack_require__(31669) , Agent = __webpack_require__(98605).Agent , net = __webpack_require__(11631) , tls = __webpack_require__(4016) , AgentSSL = __webpack_require__(57211).Agent function getConnectionName(host, port) { var name = '' if (typeof host === 'string') { name = host + ':' + port } else { // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name. name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') } return name } function ForeverAgent(options) { var self = this self.options = options || {} self.requests = {} self.sockets = {} self.freeSockets = {} self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets self.on('free', function(socket, host, port) { var name = getConnectionName(host, port) if (self.requests[name] && self.requests[name].length) { self.requests[name].shift().onSocket(socket) } else if (self.sockets[name].length < self.minSockets) { if (!self.freeSockets[name]) self.freeSockets[name] = [] self.freeSockets[name].push(socket) // if an error happens while we don't use the socket anyway, meh, throw the socket away var onIdleError = function() { socket.destroy() } socket._onIdleError = onIdleError socket.on('error', onIdleError) } else { // If there are no pending requests just destroy the // socket and it will get removed from the pool. This // gets us out of timeout issues and allows us to // default to Connection:keep-alive. socket.destroy() } }) } util.inherits(ForeverAgent, Agent) ForeverAgent.defaultMinSockets = 5 ForeverAgent.prototype.createConnection = net.createConnection ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port) if (typeof host !== 'string') { var options = host port = options.port host = options.host } if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { var idleSocket = this.freeSockets[name].pop() idleSocket.removeListener('error', idleSocket._onIdleError) delete idleSocket._onIdleError req._reusedSocket = true req.onSocket(idleSocket) } else { this.addRequestNoreuse(req, host, port) } } ForeverAgent.prototype.removeSocket = function(s, name, host, port) { if (this.sockets[name]) { var index = this.sockets[name].indexOf(s) if (index !== -1) { this.sockets[name].splice(index, 1) } } else if (this.sockets[name] && this.sockets[name].length === 0) { // don't leak delete this.sockets[name] delete this.requests[name] } if (this.freeSockets[name]) { var index = this.freeSockets[name].indexOf(s) if (index !== -1) { this.freeSockets[name].splice(index, 1) if (this.freeSockets[name].length === 0) { delete this.freeSockets[name] } } } if (this.requests[name] && this.requests[name].length) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createSocket(name, host, port).emit('free') } } function ForeverAgentSSL (options) { ForeverAgent.call(this, options) } util.inherits(ForeverAgentSSL, ForeverAgent) ForeverAgentSSL.prototype.createConnection = createConnectionSSL ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest function createConnectionSSL (port, host, options) { if (typeof port === 'object') { options = port; } else if (typeof host === 'object') { options = host; } else if (typeof options === 'object') { options = options; } else { options = {}; } if (typeof port === 'number') { options.port = port; } if (typeof host === 'string') { options.host = host; } return tls.connect(options); } /***/ }), /***/ 27714: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; const MiniPass = __webpack_require__(73078) const EE = __webpack_require__(28614).EventEmitter const fs = __webpack_require__(35747) let writev = fs.writev /* istanbul ignore next */ if (!writev) { // This entire block can be removed if support for earlier than Node.js // 12.9.0 is not needed. const binding = process.binding('fs') const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback writev = (fd, iovec, pos, cb) => { const done = (er, bw) => cb(er, bw, iovec) const req = new FSReqWrap() req.oncomplete = done binding.writeBuffers(fd, iovec, pos, req) } } const _autoClose = Symbol('_autoClose') const _close = Symbol('_close') const _ended = Symbol('_ended') const _fd = Symbol('_fd') const _finished = Symbol('_finished') const _flags = Symbol('_flags') const _flush = Symbol('_flush') const _handleChunk = Symbol('_handleChunk') const _makeBuf = Symbol('_makeBuf') const _mode = Symbol('_mode') const _needDrain = Symbol('_needDrain') const _onerror = Symbol('_onerror') const _onopen = Symbol('_onopen') const _onread = Symbol('_onread') const _onwrite = Symbol('_onwrite') const _open = Symbol('_open') const _path = Symbol('_path') const _pos = Symbol('_pos') const _queue = Symbol('_queue') const _read = Symbol('_read') const _readSize = Symbol('_readSize') const _reading = Symbol('_reading') const _remain = Symbol('_remain') const _size = Symbol('_size') const _write = Symbol('_write') const _writing = Symbol('_writing') const _defaultFlag = Symbol('_defaultFlag') const _errored = Symbol('_errored') class ReadStream extends MiniPass { constructor (path, opt) { opt = opt || {} super(opt) this.readable = true this.writable = false if (typeof path !== 'string') throw new TypeError('path must be a string') this[_errored] = false this[_fd] = typeof opt.fd === 'number' ? opt.fd : null this[_path] = path this[_readSize] = opt.readSize || 16*1024*1024 this[_reading] = false this[_size] = typeof opt.size === 'number' ? opt.size : Infinity this[_remain] = this[_size] this[_autoClose] = typeof opt.autoClose === 'boolean' ? opt.autoClose : true if (typeof this[_fd] === 'number') this[_read]() else this[_open]() } get fd () { return this[_fd] } get path () { return this[_path] } write () { throw new TypeError('this is a readable stream') } end () { throw new TypeError('this is a readable stream') } [_open] () { fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd)) } [_onopen] (er, fd) { if (er) this[_onerror](er) else { this[_fd] = fd this.emit('open', fd) this[_read]() } } [_makeBuf] () { return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])) } [_read] () { if (!this[_reading]) { this[_reading] = true const buf = this[_makeBuf]() /* istanbul ignore if */ if (buf.length === 0) return process.nextTick(() => this[_onread](null, 0, buf)) fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) => this[_onread](er, br, buf)) } } [_onread] (er, br, buf) { this[_reading] = false if (er) this[_onerror](er) else if (this[_handleChunk](br, buf)) this[_read]() } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { const fd = this[_fd] this[_fd] = null fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) } } [_onerror] (er) { this[_reading] = true this[_close]() this.emit('error', er) } [_handleChunk] (br, buf) { let ret = false // no effect if infinite this[_remain] -= br if (br > 0) ret = super.write(br < buf.length ? buf.slice(0, br) : buf) if (br === 0 || this[_remain] <= 0) { ret = false this[_close]() super.end() } return ret } emit (ev, data) { switch (ev) { case 'prefinish': case 'finish': break case 'drain': if (typeof this[_fd] === 'number') this[_read]() break case 'error': if (this[_errored]) return this[_errored] = true return super.emit(ev, data) default: return super.emit(ev, data) } } } class ReadStreamSync extends ReadStream { [_open] () { let threw = true try { this[_onopen](null, fs.openSync(this[_path], 'r')) threw = false } finally { if (threw) this[_close]() } } [_read] () { let threw = true try { if (!this[_reading]) { this[_reading] = true do { const buf = this[_makeBuf]() /* istanbul ignore next */ const br = buf.length === 0 ? 0 : fs.readSync(this[_fd], buf, 0, buf.length, null) if (!this[_handleChunk](br, buf)) break } while (true) this[_reading] = false } threw = false } finally { if (threw) this[_close]() } } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { const fd = this[_fd] this[_fd] = null fs.closeSync(fd) this.emit('close') } } } class WriteStream extends EE { constructor (path, opt) { opt = opt || {} super(opt) this.readable = false this.writable = true this[_errored] = false this[_writing] = false this[_ended] = false this[_needDrain] = false this[_queue] = [] this[_path] = path this[_fd] = typeof opt.fd === 'number' ? opt.fd : null this[_mode] = opt.mode === undefined ? 0o666 : opt.mode this[_pos] = typeof opt.start === 'number' ? opt.start : null this[_autoClose] = typeof opt.autoClose === 'boolean' ? opt.autoClose : true // truncating makes no sense when writing into the middle const defaultFlag = this[_pos] !== null ? 'r+' : 'w' this[_defaultFlag] = opt.flags === undefined this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags if (this[_fd] === null) this[_open]() } emit (ev, data) { if (ev === 'error') { if (this[_errored]) return this[_errored] = true } return super.emit(ev, data) } get fd () { return this[_fd] } get path () { return this[_path] } [_onerror] (er) { this[_close]() this[_writing] = true this.emit('error', er) } [_open] () { fs.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd)) } [_onopen] (er, fd) { if (this[_defaultFlag] && this[_flags] === 'r+' && er && er.code === 'ENOENT') { this[_flags] = 'w' this[_open]() } else if (er) this[_onerror](er) else { this[_fd] = fd this.emit('open', fd) this[_flush]() } } end (buf, enc) { if (buf) this.write(buf, enc) this[_ended] = true // synthetic after-write logic, where drain/finish live if (!this[_writing] && !this[_queue].length && typeof this[_fd] === 'number') this[_onwrite](null, 0) return this } write (buf, enc) { if (typeof buf === 'string') buf = Buffer.from(buf, enc) if (this[_ended]) { this.emit('error', new Error('write() after end()')) return false } if (this[_fd] === null || this[_writing] || this[_queue].length) { this[_queue].push(buf) this[_needDrain] = true return false } this[_writing] = true this[_write](buf) return true } [_write] (buf) { fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)) } [_onwrite] (er, bw) { if (er) this[_onerror](er) else { if (this[_pos] !== null) this[_pos] += bw if (this[_queue].length) this[_flush]() else { this[_writing] = false if (this[_ended] && !this[_finished]) { this[_finished] = true this[_close]() this.emit('finish') } else if (this[_needDrain]) { this[_needDrain] = false this.emit('drain') } } } } [_flush] () { if (this[_queue].length === 0) { if (this[_ended]) this[_onwrite](null, 0) } else if (this[_queue].length === 1) this[_write](this[_queue].pop()) else { const iovec = this[_queue] this[_queue] = [] writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw)) } } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { const fd = this[_fd] this[_fd] = null fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) } } } class WriteStreamSync extends WriteStream { [_open] () { let fd // only wrap in a try{} block if we know we'll retry, to avoid // the rethrow obscuring the error's source frame in most cases. if (this[_defaultFlag] && this[_flags] === 'r+') { try { fd = fs.openSync(this[_path], this[_flags], this[_mode]) } catch (er) { if (er.code === 'ENOENT') { this[_flags] = 'w' return this[_open]() } else throw er } } else fd = fs.openSync(this[_path], this[_flags], this[_mode]) this[_onopen](null, fd) } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { const fd = this[_fd] this[_fd] = null fs.closeSync(fd) this.emit('close') } } [_write] (buf) { // throw the original, but try to close if it fails let threw = true try { this[_onwrite](null, fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos])) threw = false } finally { if (threw) try { this[_close]() } catch (_) {} } } } exports.ReadStream = ReadStream exports.ReadStreamSync = ReadStreamSync exports.WriteStream = WriteStream exports.WriteStreamSync = WriteStreamSync /***/ }), /***/ 46863: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = realpath realpath.realpath = realpath realpath.sync = realpathSync realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch var fs = __webpack_require__(35747) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) var old = __webpack_require__(71734) function newError (er) { return er && er.syscall === 'realpath' && ( er.code === 'ELOOP' || er.code === 'ENOMEM' || er.code === 'ENAMETOOLONG' ) } function realpath (p, cache, cb) { if (ok) { return origRealpath(p, cache, cb) } if (typeof cache === 'function') { cb = cache cache = null } origRealpath(p, cache, function (er, result) { if (newError(er)) { old.realpath(p, cache, cb) } else { cb(er, result) } }) } function realpathSync (p, cache) { if (ok) { return origRealpathSync(p, cache) } try { return origRealpathSync(p, cache) } catch (er) { if (newError(er)) { return old.realpathSync(p, cache) } else { throw er } } } function monkeypatch () { fs.realpath = realpath fs.realpathSync = realpathSync } function unmonkeypatch () { fs.realpath = origRealpath fs.realpathSync = origRealpathSync } /***/ }), /***/ 71734: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var pathModule = __webpack_require__(85622); var isWindows = process.platform === 'win32'; var fs = __webpack_require__(35747); // JavaScript implementation of realpath, ported from node pre-v6 var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); function rethrow() { // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and // is fairly slow to generate. var callback; if (DEBUG) { var backtrace = new Error; callback = debugCallback; } else callback = missingCallback; return callback; function debugCallback(err) { if (err) { backtrace.message = err.message; err = backtrace; missingCallback(err); } } function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs else if (!process.noDeprecation) { var msg = 'fs: missing callback ' + (err.stack || err.message); if (process.traceDeprecation) console.trace(msg); else console.error(msg); } } } } function maybeCallback(cb) { return typeof cb === 'function' ? cb : rethrow(); } var normalize = pathModule.normalize; // Regexp that finds the next partion of a (partial) path // result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] if (isWindows) { var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; } else { var nextPartRe = /(.*?)(?:[\/]+|$)/g; } // Regex to find the device root, including trailing slash. E.g. 'c:\\'. if (isWindows) { var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; } else { var splitRootRe = /^[\/]*/; } exports.realpathSync = function realpathSync(p, cache) { // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return cache[p]; } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstatSync(base); knownHard[base] = true; } } // walk down the path, swapping out linked pathparts for their real // values // NB: p.length changes. while (pos < p.length) { // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { continue; } var resolvedLink; if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // some known symbolic link. no need to stat again. resolvedLink = cache[base]; } else { var stat = fs.lstatSync(base); if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; continue; } // read the link if it wasn't read before // dev/ino always return 0 on windows, so skip the check. var linkTarget = null; if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { linkTarget = seenLinks[id]; } } if (linkTarget === null) { fs.statSync(base); linkTarget = fs.readlinkSync(base); } resolvedLink = pathModule.resolve(previous, linkTarget); // track this, if given a cache. if (cache) cache[base] = resolvedLink; if (!isWindows) seenLinks[id] = linkTarget; } // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } if (cache) cache[original] = p; return p; }; exports.realpath = function realpath(p, cache, cb) { if (typeof cb !== 'function') { cb = maybeCallback(cache); cache = null; } // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return process.nextTick(cb.bind(null, null, cache[p])); } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstat(base, function(err) { if (err) return cb(err); knownHard[base] = true; LOOP(); }); } else { process.nextTick(LOOP); } } // walk down the path, swapping out linked pathparts for their real // values function LOOP() { // stop if scanned past end of path if (pos >= p.length) { if (cache) cache[original] = p; return cb(null, p); } // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { return process.nextTick(LOOP); } if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // known symbolic link. no need to stat again. return gotResolvedLink(cache[base]); } return fs.lstat(base, gotStat); } function gotStat(err, stat) { if (err) return cb(err); // if not a symlink, skip to the next path part if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; return process.nextTick(LOOP); } // stat & read the link if not read before // call gotTarget as soon as the link target is known // dev/ino always return 0 on windows, so skip the check. if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { return gotTarget(null, seenLinks[id], base); } } fs.stat(base, function(err) { if (err) return cb(err); fs.readlink(base, function(err, target) { if (!isWindows) seenLinks[id] = target; gotTarget(err, target); }); }); } function gotTarget(err, target, base) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); if (cache) cache[base] = resolvedLink; gotResolvedLink(resolvedLink); } function gotResolvedLink(resolvedLink) { // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } }; /***/ }), /***/ 66129: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2018 Google LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GaxiosError = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ class GaxiosError extends Error { constructor(message, options, response) { super(message); this.response = response; this.config = options; this.code = response.status.toString(); } } exports.GaxiosError = GaxiosError; //# sourceMappingURL=common.js.map /***/ }), /***/ 28133: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; // Copyright 2018 Google LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Gaxios = void 0; const extend_1 = __importDefault(__webpack_require__(38171)); const https_1 = __webpack_require__(57211); const node_fetch_1 = __importDefault(__webpack_require__(80467)); const querystring_1 = __importDefault(__webpack_require__(71191)); const is_stream_1 = __importDefault(__webpack_require__(41554)); const url_1 = __webpack_require__(78835); const common_1 = __webpack_require__(66129); const retry_1 = __webpack_require__(31052); /* eslint-disable @typescript-eslint/no-explicit-any */ const fetch = hasFetch() ? window.fetch : node_fetch_1.default; function hasWindow() { return typeof window !== 'undefined' && !!window; } function hasFetch() { return hasWindow() && !!window.fetch; } function hasBuffer() { return typeof Buffer !== 'undefined'; } function hasHeader(options, header) { return !!getHeader(options, header); } function getHeader(options, header) { header = header.toLowerCase(); for (const key of Object.keys((options === null || options === void 0 ? void 0 : options.headers) || {})) { if (header === key.toLowerCase()) { return options.headers[key]; } } return undefined; } let HttpsProxyAgent; function loadProxy() { const proxy = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy; if (proxy) { HttpsProxyAgent = __webpack_require__(77219); } return proxy; } loadProxy(); function skipProxy(url) { var _a; const noProxyEnv = (_a = process.env.NO_PROXY) !== null && _a !== void 0 ? _a : process.env.no_proxy; if (!noProxyEnv) { return false; } const noProxyUrls = noProxyEnv.split(','); const parsedURL = new url_1.URL(url); return !!noProxyUrls.find(url => { if (url.startsWith('*.') || url.startsWith('.')) { url = url.replace(/^\*\./, '.'); return parsedURL.hostname.endsWith(url); } else { return url === parsedURL.origin || url === parsedURL.hostname; } }); } // Figure out if we should be using a proxy. Only if it's required, load // the https-proxy-agent module as it adds startup cost. function getProxy(url) { // If there is a match between the no_proxy env variables and the url, then do not proxy if (skipProxy(url)) { return undefined; // If there is not a match between the no_proxy env variables and the url, check to see if there should be a proxy } else { return loadProxy(); } } class Gaxios { /** * The Gaxios class is responsible for making HTTP requests. * @param defaults The default set of options to be used for this instance. */ constructor(defaults) { this.agentCache = new Map(); this.defaults = defaults || {}; } /** * Perform an HTTP request with the given options. * @param opts Set of HTTP options that will be used for this HTTP request. */ async request(opts = {}) { opts = this.validateOpts(opts); return this._request(opts); } async _defaultAdapter(opts) { const fetchImpl = opts.fetchImplementation || fetch; const res = (await fetchImpl(opts.url, opts)); const data = await this.getResponseData(opts, res); return this.translateResponse(opts, res, data); } /** * Internal, retryable version of the `request` method. * @param opts Set of HTTP options that will be used for this HTTP request. */ async _request(opts = {}) { try { let translatedResponse; if (opts.adapter) { translatedResponse = await opts.adapter(opts, this._defaultAdapter.bind(this)); } else { translatedResponse = await this._defaultAdapter(opts); } if (!opts.validateStatus(translatedResponse.status)) { throw new common_1.GaxiosError(`Request failed with status code ${translatedResponse.status}`, opts, translatedResponse); } return translatedResponse; } catch (e) { const err = e; err.config = opts; const { shouldRetry, config } = await retry_1.getRetryConfig(e); if (shouldRetry && config) { err.config.retryConfig.currentRetryAttempt = config.retryConfig.currentRetryAttempt; return this._request(err.config); } throw err; } } async getResponseData(opts, res) { switch (opts.responseType) { case 'stream': return res.body; case 'json': { let data = await res.text(); try { data = JSON.parse(data); } catch (_a) { // continue } return data; } case 'arraybuffer': return res.arrayBuffer(); case 'blob': return res.blob(); default: return res.text(); } } /** * Validates the options, and merges them with defaults. * @param opts The original options passed from the client. */ validateOpts(options) { const opts = extend_1.default(true, {}, this.defaults, options); if (!opts.url) { throw new Error('URL is required.'); } // baseUrl has been deprecated, remove in 2.0 const baseUrl = opts.baseUrl || opts.baseURL; if (baseUrl) { opts.url = baseUrl + opts.url; } opts.paramsSerializer = opts.paramsSerializer || this.paramsSerializer; if (opts.params && Object.keys(opts.params).length > 0) { let additionalQueryParams = opts.paramsSerializer(opts.params); if (additionalQueryParams.startsWith('?')) { additionalQueryParams = additionalQueryParams.slice(1); } const prefix = opts.url.includes('?') ? '&' : '?'; opts.url = opts.url + prefix + additionalQueryParams; } if (typeof options.maxContentLength === 'number') { opts.size = options.maxContentLength; } if (typeof options.maxRedirects === 'number') { opts.follow = options.maxRedirects; } opts.headers = opts.headers || {}; if (opts.data) { if (is_stream_1.default.readable(opts.data)) { opts.body = opts.data; } else if (hasBuffer() && Buffer.isBuffer(opts.data)) { // Do not attempt to JSON.stringify() a Buffer: opts.body = opts.data; if (!hasHeader(opts, 'Content-Type')) { opts.headers['Content-Type'] = 'application/json'; } } else if (typeof opts.data === 'object') { // If www-form-urlencoded content type has been set, but data is // provided as an object, serialize the content using querystring: if (getHeader(opts, 'content-type') === 'application/x-www-form-urlencoded') { opts.body = opts.paramsSerializer(opts.data); } else { if (!hasHeader(opts, 'Content-Type')) { opts.headers['Content-Type'] = 'application/json'; } opts.body = JSON.stringify(opts.data); } } else { opts.body = opts.data; } } opts.validateStatus = opts.validateStatus || this.validateStatus; opts.responseType = opts.responseType || 'json'; if (!opts.headers['Accept'] && opts.responseType === 'json') { opts.headers['Accept'] = 'application/json'; } opts.method = opts.method || 'GET'; const proxy = getProxy(opts.url); if (proxy) { if (this.agentCache.has(proxy)) { opts.agent = this.agentCache.get(proxy); } else { // Proxy is being used in conjunction with mTLS. if (opts.cert && opts.key) { const parsedURL = new url_1.URL(proxy); opts.agent = new HttpsProxyAgent({ port: parsedURL.port, host: parsedURL.host, protocol: parsedURL.protocol, cert: opts.cert, key: opts.key, }); } else { opts.agent = new HttpsProxyAgent(proxy); } this.agentCache.set(proxy, opts.agent); } } else if (opts.cert && opts.key) { // Configure client for mTLS: if (this.agentCache.has(opts.key)) { opts.agent = this.agentCache.get(opts.key); } else { opts.agent = new https_1.Agent({ cert: opts.cert, key: opts.key, }); this.agentCache.set(opts.key, opts.agent); } } return opts; } /** * By default, throw for any non-2xx status code * @param status status code from the HTTP response */ validateStatus(status) { return status >= 200 && status < 300; } /** * Encode a set of key/value pars into a querystring format (?foo=bar&baz=boo) * @param params key value pars to encode */ paramsSerializer(params) { return querystring_1.default.stringify(params); } translateResponse(opts, res, data) { // headers need to be converted from a map to an obj const headers = {}; res.headers.forEach((value, key) => { headers[key] = value; }); return { config: opts, data: data, headers, status: res.status, statusText: res.statusText, // XMLHttpRequestLike request: { responseURL: res.url, }, }; } } exports.Gaxios = Gaxios; //# sourceMappingURL=gaxios.js.map /***/ }), /***/ 59555: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2018 Google LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.request = exports.instance = exports.Gaxios = void 0; const gaxios_1 = __webpack_require__(28133); Object.defineProperty(exports, "Gaxios", ({ enumerable: true, get: function () { return gaxios_1.Gaxios; } })); var common_1 = __webpack_require__(66129); Object.defineProperty(exports, "GaxiosError", ({ enumerable: true, get: function () { return common_1.GaxiosError; } })); /** * The default instance used when the `request` method is directly * invoked. */ exports.instance = new gaxios_1.Gaxios(); /** * Make an HTTP request using the given options. * @param opts Options for the request */ async function request(opts) { return exports.instance.request(opts); } exports.request = request; //# sourceMappingURL=index.js.map /***/ }), /***/ 31052: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2018 Google LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRetryConfig = void 0; async function getRetryConfig(err) { var _a; let config = getConfig(err); if (!err || !err.config || (!config && !err.config.retry)) { return { shouldRetry: false }; } config = config || {}; config.currentRetryAttempt = config.currentRetryAttempt || 0; config.retry = config.retry === undefined || config.retry === null ? 3 : config.retry; config.httpMethodsToRetry = config.httpMethodsToRetry || [ 'GET', 'HEAD', 'PUT', 'OPTIONS', 'DELETE', ]; config.noResponseRetries = config.noResponseRetries === undefined || config.noResponseRetries === null ? 2 : config.noResponseRetries; // If this wasn't in the list of status codes where we want // to automatically retry, return. const retryRanges = [ // https://en.wikipedia.org/wiki/List_of_HTTP_status_codes // 1xx - Retry (Informational, request still processing) // 2xx - Do not retry (Success) // 3xx - Do not retry (Redirect) // 4xx - Do not retry (Client errors) // 429 - Retry ("Too Many Requests") // 5xx - Retry (Server errors) [100, 199], [429, 429], [500, 599], ]; config.statusCodesToRetry = config.statusCodesToRetry || retryRanges; // Put the config back into the err err.config.retryConfig = config; // Determine if we should retry the request const shouldRetryFn = config.shouldRetry || shouldRetryRequest; if (!(await shouldRetryFn(err))) { return { shouldRetry: false, config: err.config }; } // Calculate time to wait with exponential backoff. // If this is the first retry, look for a configured retryDelay. const retryDelay = config.currentRetryAttempt ? 0 : (_a = config.retryDelay) !== null && _a !== void 0 ? _a : 100; // Formula: retryDelay + ((2^c - 1 / 2) * 1000) const delay = retryDelay + ((Math.pow(2, config.currentRetryAttempt) - 1) / 2) * 1000; // We're going to retry! Incremenent the counter. err.config.retryConfig.currentRetryAttempt += 1; // Create a promise that invokes the retry after the backOffDelay const backoff = new Promise(resolve => { setTimeout(resolve, delay); }); // Notify the user if they added an `onRetryAttempt` handler if (config.onRetryAttempt) { config.onRetryAttempt(err); } // Return the promise in which recalls Gaxios to retry the request await backoff; return { shouldRetry: true, config: err.config }; } exports.getRetryConfig = getRetryConfig; /** * Determine based on config if we should retry the request. * @param err The GaxiosError passed to the interceptor. */ function shouldRetryRequest(err) { const config = getConfig(err); // node-fetch raises an AbortError if signaled: // https://github.com/bitinn/node-fetch#request-cancellation-with-abortsignal if (err.name === 'AbortError') { return false; } // If there's no config, or retries are disabled, return. if (!config || config.retry === 0) { return false; } // Check if this error has no response (ETIMEDOUT, ENOTFOUND, etc) if (!err.response && (config.currentRetryAttempt || 0) >= config.noResponseRetries) { return false; } // Only retry with configured HttpMethods. if (!err.config.method || config.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) { return false; } // If this wasn't in the list of status codes where we want // to automatically retry, return. if (err.response && err.response.status) { let isInRange = false; for (const [min, max] of config.statusCodesToRetry) { const status = err.response.status; if (status >= min && status <= max) { isInRange = true; break; } } if (!isInRange) { return false; } } // If we are out of retry attempts, return config.currentRetryAttempt = config.currentRetryAttempt || 0; if (config.currentRetryAttempt >= config.retry) { return false; } return true; } /** * Acquire the raxConfig object from an GaxiosError if available. * @param err The Gaxios error with a config object. */ function getConfig(err) { if (err && err.config && err.config.retryConfig) { return err.config.retryConfig; } return; } //# sourceMappingURL=retry.js.map /***/ }), /***/ 3563: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2018 Google LLC * * Distributed under MIT license. * See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.requestTimeout = exports.resetIsAvailableCache = exports.isAvailable = exports.project = exports.instance = exports.HEADERS = exports.HEADER_VALUE = exports.HEADER_NAME = exports.SECONDARY_HOST_ADDRESS = exports.HOST_ADDRESS = exports.BASE_PATH = void 0; const gaxios_1 = __webpack_require__(59555); const jsonBigint = __webpack_require__(55031); exports.BASE_PATH = '/computeMetadata/v1'; exports.HOST_ADDRESS = 'http://169.254.169.254'; exports.SECONDARY_HOST_ADDRESS = 'http://metadata.google.internal.'; exports.HEADER_NAME = 'Metadata-Flavor'; exports.HEADER_VALUE = 'Google'; exports.HEADERS = Object.freeze({ [exports.HEADER_NAME]: exports.HEADER_VALUE }); /** * Returns the base URL while taking into account the GCE_METADATA_HOST * environment variable if it exists. * * @returns The base URL, e.g., http://169.254.169.254/computeMetadata/v1. */ function getBaseUrl(baseUrl) { if (!baseUrl) { baseUrl = process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST || exports.HOST_ADDRESS; } // If no scheme is provided default to HTTP: if (!/^https?:\/\//.test(baseUrl)) { baseUrl = `http://${baseUrl}`; } return new URL(exports.BASE_PATH, baseUrl).href; } // Accepts an options object passed from the user to the API. In previous // versions of the API, it referred to a `Request` or an `Axios` request // options object. Now it refers to an object with very limited property // names. This is here to help ensure users don't pass invalid options when // they upgrade from 0.4 to 0.5 to 0.8. function validate(options) { Object.keys(options).forEach(key => { switch (key) { case 'params': case 'property': case 'headers': break; case 'qs': throw new Error("'qs' is not a valid configuration option. Please use 'params' instead."); default: throw new Error(`'${key}' is not a valid configuration option.`); } }); } async function metadataAccessor(type, options, noResponseRetries = 3, fastFail = false) { options = options || {}; if (typeof options === 'string') { options = { property: options }; } let property = ''; if (typeof options === 'object' && options.property) { property = '/' + options.property; } validate(options); try { const requestMethod = fastFail ? fastFailMetadataRequest : gaxios_1.request; const res = await requestMethod({ url: `${getBaseUrl()}/${type}${property}`, headers: Object.assign({}, exports.HEADERS, options.headers), retryConfig: { noResponseRetries }, params: options.params, responseType: 'text', timeout: requestTimeout(), }); // NOTE: node.js converts all incoming headers to lower case. if (res.headers[exports.HEADER_NAME.toLowerCase()] !== exports.HEADER_VALUE) { throw new Error(`Invalid response from metadata service: incorrect ${exports.HEADER_NAME} header.`); } else if (!res.data) { throw new Error('Invalid response from the metadata service'); } if (typeof res.data === 'string') { try { return jsonBigint.parse(res.data); } catch (_a) { /* ignore */ } } return res.data; } catch (e) { if (e.response && e.response.status !== 200) { e.message = `Unsuccessful response status code. ${e.message}`; } throw e; } } async function fastFailMetadataRequest(options) { const secondaryOptions = { ...options, url: options.url.replace(getBaseUrl(), getBaseUrl(exports.SECONDARY_HOST_ADDRESS)), }; // We race a connection between DNS/IP to metadata server. There are a couple // reasons for this: // // 1. the DNS is slow in some GCP environments; by checking both, we might // detect the runtime environment signficantly faster. // 2. we can't just check the IP, which is tarpitted and slow to respond // on a user's local machine. // // Additional logic has been added to make sure that we don't create an // unhandled rejection in scenarios where a failure happens sometime // after a success. // // Note, however, if a failure happens prior to a success, a rejection should // occur, this is for folks running locally. // let responded = false; const r1 = gaxios_1.request(options) .then(res => { responded = true; return res; }) .catch(err => { if (responded) { return r2; } else { responded = true; throw err; } }); const r2 = gaxios_1.request(secondaryOptions) .then(res => { responded = true; return res; }) .catch(err => { if (responded) { return r1; } else { responded = true; throw err; } }); return Promise.race([r1, r2]); } /** * Obtain metadata for the current GCE instance */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function instance(options) { return metadataAccessor('instance', options); } exports.instance = instance; /** * Obtain metadata for the current GCP Project. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function project(options) { return metadataAccessor('project', options); } exports.project = project; /* * How many times should we retry detecting GCP environment. */ function detectGCPAvailableRetries() { return process.env.DETECT_GCP_RETRIES ? Number(process.env.DETECT_GCP_RETRIES) : 0; } let cachedIsAvailableResponse; /** * Determine if the metadata server is currently available. */ async function isAvailable() { try { // If a user is instantiating several GCP libraries at the same time, // this may result in multiple calls to isAvailable(), to detect the // runtime environment. We use the same promise for each of these calls // to reduce the network load. if (cachedIsAvailableResponse === undefined) { cachedIsAvailableResponse = metadataAccessor('instance', undefined, detectGCPAvailableRetries(), // If the default HOST_ADDRESS has been overridden, we should not // make an effort to try SECONDARY_HOST_ADDRESS (as we are likely in // a non-GCP environment): !(process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST)); } await cachedIsAvailableResponse; return true; } catch (err) { if (process.env.DEBUG_AUTH) { console.info(err); } if (err.type === 'request-timeout') { // If running in a GCP environment, metadata endpoint should return // within ms. return false; } if (err.response && err.response.status === 404) { return false; } else { if (!(err.response && err.response.status === 404) && // A warning is emitted if we see an unexpected err.code, or err.code // is not populated: (!err.code || ![ 'EHOSTDOWN', 'EHOSTUNREACH', 'ENETUNREACH', 'ENOENT', 'ENOTFOUND', 'ECONNREFUSED', ].includes(err.code))) { let code = 'UNKNOWN'; if (err.code) code = err.code; process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, 'MetadataLookupWarning'); } // Failure to resolve the metadata service means that it is not available. return false; } } } exports.isAvailable = isAvailable; /** * reset the memoized isAvailable() lookup. */ function resetIsAvailableCache() { cachedIsAvailableResponse = undefined; } exports.resetIsAvailableCache = resetIsAvailableCache; /** * Obtain the timeout for requests to the metadata server. */ function requestTimeout() { // In testing, we were able to reproduce behavior similar to // https://github.com/googleapis/google-auth-library-nodejs/issues/798 // by making many concurrent network requests. Requests do not actually fail, // rather they take significantly longer to complete (and we hit our // default 3000ms timeout). // // This logic detects a GCF environment, using the documented environment // variables K_SERVICE and FUNCTION_NAME: // https://cloud.google.com/functions/docs/env-var and, in a GCF environment // eliminates timeouts (by setting the value to 0 to disable). return process.env.K_SERVICE || process.env.FUNCTION_NAME ? 0 : 3000; } exports.requestTimeout = requestTimeout; //# sourceMappingURL=index.js.map /***/ }), /***/ 91585: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {PassThrough: PassThroughStream} = __webpack_require__(92413); module.exports = options => { options = {...options}; const {array} = options; let {encoding} = options; const isBuffer = encoding === 'buffer'; let objectMode = false; if (array) { objectMode = !(encoding || isBuffer); } else { encoding = encoding || 'utf8'; } if (isBuffer) { encoding = null; } const stream = new PassThroughStream({objectMode}); if (encoding) { stream.setEncoding(encoding); } let length = 0; const chunks = []; stream.on('data', chunk => { chunks.push(chunk); if (objectMode) { length = chunks.length; } else { length += chunk.length; } }); stream.getBufferedValue = () => { if (array) { return chunks; } return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); }; stream.getBufferedLength = () => length; return stream; }; /***/ }), /***/ 21766: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {constants: BufferConstants} = __webpack_require__(64293); const pump = __webpack_require__(18341); const bufferStream = __webpack_require__(91585); class MaxBufferError extends Error { constructor() { super('maxBuffer exceeded'); this.name = 'MaxBufferError'; } } async function getStream(inputStream, options) { if (!inputStream) { return Promise.reject(new Error('Expected a stream')); } options = { maxBuffer: Infinity, ...options }; const {maxBuffer} = options; let stream; await new Promise((resolve, reject) => { const rejectPromise = error => { // Don't retrieve an oversized buffer. if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { error.bufferedData = stream.getBufferedValue(); } reject(error); }; stream = pump(inputStream, bufferStream(options), error => { if (error) { rejectPromise(error); return; } resolve(); }); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { rejectPromise(new MaxBufferError()); } }); }); return stream.getBufferedValue(); } module.exports = getStream; // TODO: Remove this for the next major release module.exports.default = getStream; module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); module.exports.MaxBufferError = MaxBufferError; /***/ }), /***/ 47625: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { exports.alphasort = alphasort exports.alphasorti = alphasorti exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var path = __webpack_require__(85622) var minimatch = __webpack_require__(83973) var isAbsolute = __webpack_require__(38714) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()) } function alphasort (a, b) { return a.localeCompare(b) } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(self.nocase ? alphasorti : alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } /***/ }), /***/ 91957: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs = __webpack_require__(35747) var rp = __webpack_require__(46863) var minimatch = __webpack_require__(83973) var Minimatch = minimatch.Minimatch var inherits = __webpack_require__(44124) var EE = __webpack_require__(28614).EventEmitter var path = __webpack_require__(85622) var assert = __webpack_require__(42357) var isAbsolute = __webpack_require__(38714) var globSync = __webpack_require__(29010) var common = __webpack_require__(47625) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var inflight = __webpack_require__(52492) var util = __webpack_require__(31669) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = __webpack_require__(1223) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } /***/ }), /***/ 29010: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = globSync globSync.GlobSync = GlobSync var fs = __webpack_require__(35747) var rp = __webpack_require__(46863) var minimatch = __webpack_require__(83973) var Minimatch = minimatch.Minimatch var Glob = __webpack_require__(91957).Glob var util = __webpack_require__(31669) var path = __webpack_require__(85622) var assert = __webpack_require__(42357) var isAbsolute = __webpack_require__(38714) var common = __webpack_require__(47625) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } /***/ }), /***/ 44627: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2012 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AuthClient = void 0; const events_1 = __webpack_require__(28614); const transporters_1 = __webpack_require__(72649); class AuthClient extends events_1.EventEmitter { constructor() { super(...arguments); this.transporter = new transporters_1.DefaultTransporter(); this.credentials = {}; this.eagerRefreshThresholdMillis = 5 * 60 * 1000; this.forceRefreshOnFailure = false; } /** * Sets the auth credentials. */ setCredentials(credentials) { this.credentials = credentials; } /** * Append additional headers, e.g., x-goog-user-project, shared across the * classes inheriting AuthClient. This method should be used by any method * that overrides getRequestMetadataAsync(), which is a shared helper for * setting request information in both gRPC and HTTP API calls. * * @param headers objedcdt to append additional headers to. */ addSharedMetadataHeaders(headers) { // quota_project_id, stored in application_default_credentials.json, is set in // the x-goog-user-project header, to indicate an alternate account for // billing and quota: if (!headers['x-goog-user-project'] && // don't override a value the user sets. this.quotaProjectId) { headers['x-goog-user-project'] = this.quotaProjectId; } return headers; } } exports.AuthClient = AuthClient; //# sourceMappingURL=authclient.js.map /***/ }), /***/ 71569: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AwsClient = void 0; const awsrequestsigner_1 = __webpack_require__(1754); const baseexternalclient_1 = __webpack_require__(40810); /** * AWS external account client. This is used for AWS workloads, where * AWS STS GetCallerIdentity serialized signed requests are exchanged for * GCP access token. */ class AwsClient extends baseexternalclient_1.BaseExternalAccountClient { /** * Instantiates an AwsClient instance using the provided JSON * object loaded from an external account credentials file. * An error is thrown if the credential is not a valid AWS credential. * @param options The external account options object typically loaded * from the external account JSON credential file. * @param additionalOptions Optional additional behavior customization * options. These currently customize expiration threshold time and * whether to retry on 401/403 API request errors. */ constructor(options, additionalOptions) { var _a; super(options, additionalOptions); this.environmentId = options.credential_source.environment_id; // This is only required if the AWS region is not available in the // AWS_REGION or AWS_DEFAULT_REGION environment variables. this.regionUrl = options.credential_source.region_url; // This is only required if AWS security credentials are not available in // environment variables. this.securityCredentialsUrl = options.credential_source.url; this.regionalCredVerificationUrl = options.credential_source.regional_cred_verification_url; const match = (_a = this.environmentId) === null || _a === void 0 ? void 0 : _a.match(/^(aws)(\d+)$/); if (!match || !this.regionalCredVerificationUrl) { throw new Error('No valid AWS "credential_source" provided'); } else if (parseInt(match[2], 10) !== 1) { throw new Error(`aws version "${match[2]}" is not supported in the current build.`); } this.awsRequestSigner = null; this.region = ''; } /** * Triggered when an external subject token is needed to be exchanged for a * GCP access token via GCP STS endpoint. * This uses the `options.credential_source` object to figure out how * to retrieve the token using the current environment. In this case, * this uses a serialized AWS signed request to the STS GetCallerIdentity * endpoint. * The logic is summarized as: * 1. Retrieve AWS region from availability-zone. * 2a. Check AWS credentials in environment variables. If not found, get * from security-credentials endpoint. * 2b. Get AWS credentials from security-credentials endpoint. In order * to retrieve this, the AWS role needs to be determined by calling * security-credentials endpoint without any argument. Then the * credentials can be retrieved via: security-credentials/role_name * 3. Generate the signed request to AWS STS GetCallerIdentity action. * 4. Inject x-goog-cloud-target-resource into header and serialize the * signed request. This will be the subject-token to pass to GCP STS. * @return A promise that resolves with the external subject token. */ async retrieveSubjectToken() { // Initialize AWS request signer if not already initialized. if (!this.awsRequestSigner) { this.region = await this.getAwsRegion(); this.awsRequestSigner = new awsrequestsigner_1.AwsRequestSigner(async () => { // Check environment variables for permanent credentials first. // https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html if (process.env['AWS_ACCESS_KEY_ID'] && process.env['AWS_SECRET_ACCESS_KEY']) { return { accessKeyId: process.env['AWS_ACCESS_KEY_ID'], secretAccessKey: process.env['AWS_SECRET_ACCESS_KEY'], // This is normally not available for permanent credentials. token: process.env['AWS_SESSION_TOKEN'], }; } // Since the role on a VM can change, we don't need to cache it. const roleName = await this.getAwsRoleName(); // Temporary credentials typically last for several hours. // Expiration is returned in response. // Consider future optimization of this logic to cache AWS tokens // until their natural expiration. const awsCreds = await this.getAwsSecurityCredentials(roleName); return { accessKeyId: awsCreds.AccessKeyId, secretAccessKey: awsCreds.SecretAccessKey, token: awsCreds.Token, }; }, this.region); } // Generate signed request to AWS STS GetCallerIdentity API. // Use the required regional endpoint. Otherwise, the request will fail. const options = await this.awsRequestSigner.getRequestOptions({ url: this.regionalCredVerificationUrl.replace('{region}', this.region), method: 'POST', }); // The GCP STS endpoint expects the headers to be formatted as: // [ // {key: 'x-amz-date', value: '...'}, // {key: 'Authorization', value: '...'}, // ... // ] // And then serialized as: // encodeURIComponent(JSON.stringify({ // url: '...', // method: 'POST', // headers: [{key: 'x-amz-date', value: '...'}, ...] // })) const reformattedHeader = []; const extendedHeaders = Object.assign({ // The full, canonical resource name of the workload identity pool // provider, with or without the HTTPS prefix. // Including this header as part of the signature is recommended to // ensure data integrity. 'x-goog-cloud-target-resource': this.audience, }, options.headers); // Reformat header to GCP STS expected format. for (const key in extendedHeaders) { reformattedHeader.push({ key, value: extendedHeaders[key], }); } // Serialize the reformatted signed request. return encodeURIComponent(JSON.stringify({ url: options.url, method: options.method, headers: reformattedHeader, })); } /** * @return A promise that resolves with the current AWS region. */ async getAwsRegion() { // Priority order for region determination: // AWS_REGION > AWS_DEFAULT_REGION > metadata server. if (process.env['AWS_REGION'] || process.env['AWS_DEFAULT_REGION']) { return (process.env['AWS_REGION'] || process.env['AWS_DEFAULT_REGION']); } if (!this.regionUrl) { throw new Error('Unable to determine AWS region due to missing ' + '"options.credential_source.region_url"'); } const opts = { url: this.regionUrl, method: 'GET', responseType: 'text', }; const response = await this.transporter.request(opts); // Remove last character. For example, if us-east-2b is returned, // the region would be us-east-2. return response.data.substr(0, response.data.length - 1); } /** * @return A promise that resolves with the assigned role to the current * AWS VM. This is needed for calling the security-credentials endpoint. */ async getAwsRoleName() { if (!this.securityCredentialsUrl) { throw new Error('Unable to determine AWS role name due to missing ' + '"options.credential_source.url"'); } const opts = { url: this.securityCredentialsUrl, method: 'GET', responseType: 'text', }; const response = await this.transporter.request(opts); return response.data; } /** * Retrieves the temporary AWS credentials by calling the security-credentials * endpoint as specified in the `credential_source` object. * @param roleName The role attached to the current VM. * @return A promise that resolves with the temporary AWS credentials * needed for creating the GetCallerIdentity signed request. */ async getAwsSecurityCredentials(roleName) { const response = await this.transporter.request({ url: `${this.securityCredentialsUrl}/${roleName}`, responseType: 'json', }); return response.data; } } exports.AwsClient = AwsClient; //# sourceMappingURL=awsclient.js.map /***/ }), /***/ 1754: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AwsRequestSigner = void 0; const crypto_1 = __webpack_require__(78043); /** AWS Signature Version 4 signing algorithm identifier. */ const AWS_ALGORITHM = 'AWS4-HMAC-SHA256'; /** * The termination string for the AWS credential scope value as defined in * https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html */ const AWS_REQUEST_TYPE = 'aws4_request'; /** * Implements an AWS API request signer based on the AWS Signature Version 4 * signing process. * https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html */ class AwsRequestSigner { /** * Instantiates an AWS API request signer used to send authenticated signed * requests to AWS APIs based on the AWS Signature Version 4 signing process. * This also provides a mechanism to generate the signed request without * sending it. * @param getCredentials A mechanism to retrieve AWS security credentials * when needed. * @param region The AWS region to use. */ constructor(getCredentials, region) { this.getCredentials = getCredentials; this.region = region; this.crypto = crypto_1.createCrypto(); } /** * Generates the signed request for the provided HTTP request for calling * an AWS API. This follows the steps described at: * https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html * @param amzOptions The AWS request options that need to be signed. * @return A promise that resolves with the GaxiosOptions containing the * signed HTTP request parameters. */ async getRequestOptions(amzOptions) { if (!amzOptions.url) { throw new Error('"url" is required in "amzOptions"'); } // Stringify JSON requests. This will be set in the request body of the // generated signed request. const requestPayloadData = typeof amzOptions.data === 'object' ? JSON.stringify(amzOptions.data) : amzOptions.data; const url = amzOptions.url; const method = amzOptions.method || 'GET'; const requestPayload = amzOptions.body || requestPayloadData; const additionalAmzHeaders = amzOptions.headers; const awsSecurityCredentials = await this.getCredentials(); const uri = new URL(url); const headerMap = await generateAuthenticationHeaderMap({ crypto: this.crypto, host: uri.host, canonicalUri: uri.pathname, canonicalQuerystring: uri.search.substr(1), method, region: this.region, securityCredentials: awsSecurityCredentials, requestPayload, additionalAmzHeaders, }); // Append additional optional headers, eg. X-Amz-Target, Content-Type, etc. const headers = Object.assign( // Add x-amz-date if available. headerMap.amzDate ? { 'x-amz-date': headerMap.amzDate } : {}, { Authorization: headerMap.authorizationHeader, host: uri.host, }, additionalAmzHeaders || {}); if (awsSecurityCredentials.token) { Object.assign(headers, { 'x-amz-security-token': awsSecurityCredentials.token, }); } const awsSignedReq = { url, method: method, headers, }; if (typeof requestPayload !== 'undefined') { awsSignedReq.body = requestPayload; } return awsSignedReq; } } exports.AwsRequestSigner = AwsRequestSigner; /** * Creates the HMAC-SHA256 hash of the provided message using the * provided key. * * @param crypto The crypto instance used to facilitate cryptographic * operations. * @param key The HMAC-SHA256 key to use. * @param msg The message to hash. * @return The computed hash bytes. */ async function sign(crypto, key, msg) { return await crypto.signWithHmacSha256(key, msg); } /** * Calculates the signing key used to calculate the signature for * AWS Signature Version 4 based on: * https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html * * @param crypto The crypto instance used to facilitate cryptographic * operations. * @param key The AWS secret access key. * @param dateStamp The '%Y%m%d' date format. * @param region The AWS region. * @param serviceName The AWS service name, eg. sts. * @return The signing key bytes. */ async function getSigningKey(crypto, key, dateStamp, region, serviceName) { const kDate = await sign(crypto, `AWS4${key}`, dateStamp); const kRegion = await sign(crypto, kDate, region); const kService = await sign(crypto, kRegion, serviceName); const kSigning = await sign(crypto, kService, 'aws4_request'); return kSigning; } /** * Generates the authentication header map needed for generating the AWS * Signature Version 4 signed request. * * @param option The options needed to compute the authentication header map. * @return The AWS authentication header map which constitutes of the following * components: amz-date, authorization header and canonical query string. */ async function generateAuthenticationHeaderMap(options) { const additionalAmzHeaders = options.additionalAmzHeaders || {}; const requestPayload = options.requestPayload || ''; // iam.amazonaws.com host => iam service. // sts.us-east-2.amazonaws.com => sts service. const serviceName = options.host.split('.')[0]; const now = new Date(); // Format: '%Y%m%dT%H%M%SZ'. const amzDate = now .toISOString() .replace(/[-:]/g, '') .replace(/\.[0-9]+/, ''); // Format: '%Y%m%d'. const dateStamp = now.toISOString().replace(/[-]/g, '').replace(/T.*/, ''); // Change all additional headers to be lower case. const reformattedAdditionalAmzHeaders = {}; Object.keys(additionalAmzHeaders).forEach(key => { reformattedAdditionalAmzHeaders[key.toLowerCase()] = additionalAmzHeaders[key]; }); // Add AWS token if available. if (options.securityCredentials.token) { reformattedAdditionalAmzHeaders['x-amz-security-token'] = options.securityCredentials.token; } // Header keys need to be sorted alphabetically. const amzHeaders = Object.assign({ host: options.host, }, // Previously the date was not fixed with x-amz- and could be provided manually. // https://github.com/boto/botocore/blob/879f8440a4e9ace5d3cf145ce8b3d5e5ffb892ef/tests/unit/auth/aws4_testsuite/get-header-value-trim.req reformattedAdditionalAmzHeaders.date ? {} : { 'x-amz-date': amzDate }, reformattedAdditionalAmzHeaders); let canonicalHeaders = ''; const signedHeadersList = Object.keys(amzHeaders).sort(); signedHeadersList.forEach(key => { canonicalHeaders += `${key}:${amzHeaders[key]}\n`; }); const signedHeaders = signedHeadersList.join(';'); const payloadHash = await options.crypto.sha256DigestHex(requestPayload); // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html const canonicalRequest = `${options.method}\n` + `${options.canonicalUri}\n` + `${options.canonicalQuerystring}\n` + `${canonicalHeaders}\n` + `${signedHeaders}\n` + `${payloadHash}`; const credentialScope = `${dateStamp}/${options.region}/${serviceName}/${AWS_REQUEST_TYPE}`; // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html const stringToSign = `${AWS_ALGORITHM}\n` + `${amzDate}\n` + `${credentialScope}\n` + (await options.crypto.sha256DigestHex(canonicalRequest)); // https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html const signingKey = await getSigningKey(options.crypto, options.securityCredentials.secretAccessKey, dateStamp, options.region, serviceName); const signature = await sign(options.crypto, signingKey, stringToSign); // https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html const authorizationHeader = `${AWS_ALGORITHM} Credential=${options.securityCredentials.accessKeyId}/` + `${credentialScope}, SignedHeaders=${signedHeaders}, ` + `Signature=${crypto_1.fromArrayBufferToHex(signature)}`; return { // Do not return x-amz-date if date is available. amzDate: reformattedAdditionalAmzHeaders.date ? undefined : amzDate, authorizationHeader, canonicalQuerystring: options.canonicalQuerystring, }; } //# sourceMappingURL=awsrequestsigner.js.map /***/ }), /***/ 40810: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BaseExternalAccountClient = exports.CLOUD_RESOURCE_MANAGER = exports.EXTERNAL_ACCOUNT_TYPE = exports.EXPIRATION_TIME_OFFSET = void 0; const stream = __webpack_require__(92413); const authclient_1 = __webpack_require__(44627); const sts = __webpack_require__(86308); /** * The required token exchange grant_type: rfc8693#section-2.1 */ const STS_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:token-exchange'; /** * The requested token exchange requested_token_type: rfc8693#section-2.1 */ const STS_REQUEST_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token'; /** The default OAuth scope to request when none is provided. */ const DEFAULT_OAUTH_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'; /** The google apis domain pattern. */ const GOOGLE_APIS_DOMAIN_PATTERN = '\\.googleapis\\.com$'; /** The variable portion pattern in a Google APIs domain. */ const VARIABLE_PORTION_PATTERN = '[^\\.\\s\\/\\\\]+'; /** * Offset to take into account network delays and server clock skews. */ exports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000; /** * The credentials JSON file type for external account clients. * There are 3 types of JSON configs: * 1. authorized_user => Google end user credential * 2. service_account => Google service account credential * 3. external_Account => non-GCP service (eg. AWS, Azure, K8s) */ exports.EXTERNAL_ACCOUNT_TYPE = 'external_account'; /** Cloud resource manager URL used to retrieve project information. */ exports.CLOUD_RESOURCE_MANAGER = 'https://cloudresourcemanager.googleapis.com/v1/projects/'; /** The workforce audience pattern. */ const WORKFORCE_AUDIENCE_PATTERN = '//iam.googleapis.com/locations/[^/]+/workforcePools/[^/]+/providers/.+'; /** * Base external account client. This is used to instantiate AuthClients for * exchanging external account credentials for GCP access token and authorizing * requests to GCP APIs. * The base class implements common logic for exchanging various type of * external credentials for GCP access token. The logic of determining and * retrieving the external credential based on the environment and * credential_source will be left for the subclasses. */ class BaseExternalAccountClient extends authclient_1.AuthClient { /** * Instantiate a BaseExternalAccountClient instance using the provided JSON * object loaded from an external account credentials file. * @param options The external account options object typically loaded * from the external account JSON credential file. * @param additionalOptions Optional additional behavior customization * options. These currently customize expiration threshold time and * whether to retry on 401/403 API request errors. */ constructor(options, additionalOptions) { super(); if (options.type !== exports.EXTERNAL_ACCOUNT_TYPE) { throw new Error(`Expected "${exports.EXTERNAL_ACCOUNT_TYPE}" type but ` + `received "${options.type}"`); } this.clientAuth = options.client_id ? { confidentialClientType: 'basic', clientId: options.client_id, clientSecret: options.client_secret, } : undefined; if (!this.validateGoogleAPIsUrl('sts', options.token_url)) { throw new Error(`"${options.token_url}" is not a valid token url.`); } this.stsCredential = new sts.StsCredentials(options.token_url, this.clientAuth); // Default OAuth scope. This could be overridden via public property. this.scopes = [DEFAULT_OAUTH_SCOPE]; this.cachedAccessToken = null; this.audience = options.audience; this.subjectTokenType = options.subject_token_type; this.quotaProjectId = options.quota_project_id; this.workforcePoolUserProject = options.workforce_pool_user_project; const workforceAudiencePattern = new RegExp(WORKFORCE_AUDIENCE_PATTERN); if (this.workforcePoolUserProject && !this.audience.match(workforceAudiencePattern)) { throw new Error('workforcePoolUserProject should not be set for non-workforce pool ' + 'credentials.'); } if (typeof options.service_account_impersonation_url !== 'undefined' && !this.validateGoogleAPIsUrl('iamcredentials', options.service_account_impersonation_url)) { throw new Error(`"${options.service_account_impersonation_url}" is ` + 'not a valid service account impersonation url.'); } this.serviceAccountImpersonationUrl = options.service_account_impersonation_url; // As threshold could be zero, // eagerRefreshThresholdMillis || EXPIRATION_TIME_OFFSET will override the // zero value. if (typeof (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.eagerRefreshThresholdMillis) !== 'number') { this.eagerRefreshThresholdMillis = exports.EXPIRATION_TIME_OFFSET; } else { this.eagerRefreshThresholdMillis = additionalOptions .eagerRefreshThresholdMillis; } this.forceRefreshOnFailure = !!(additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.forceRefreshOnFailure); this.projectId = null; this.projectNumber = this.getProjectNumber(this.audience); } /** The service account email to be impersonated, if available. */ getServiceAccountEmail() { var _a; if (this.serviceAccountImpersonationUrl) { // Parse email from URL. The formal looks as follows: // https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/name@project-id.iam.gserviceaccount.com:generateAccessToken const re = /serviceAccounts\/(?[^:]+):generateAccessToken$/; const result = re.exec(this.serviceAccountImpersonationUrl); return ((_a = result === null || result === void 0 ? void 0 : result.groups) === null || _a === void 0 ? void 0 : _a.email) || null; } return null; } /** * Provides a mechanism to inject GCP access tokens directly. * When the provided credential expires, a new credential, using the * external account options, is retrieved. * @param credentials The Credentials object to set on the current client. */ setCredentials(credentials) { super.setCredentials(credentials); this.cachedAccessToken = credentials; } /** * @return A promise that resolves with the current GCP access token * response. If the current credential is expired, a new one is retrieved. */ async getAccessToken() { // If cached access token is unavailable or expired, force refresh. if (!this.cachedAccessToken || this.isExpired(this.cachedAccessToken)) { await this.refreshAccessTokenAsync(); } // Return GCP access token in GetAccessTokenResponse format. return { token: this.cachedAccessToken.access_token, res: this.cachedAccessToken.res, }; } /** * The main authentication interface. It takes an optional url which when * present is the endpoint being accessed, and returns a Promise which * resolves with authorization header fields. * * The result has the form: * { Authorization: 'Bearer ' } */ async getRequestHeaders() { const accessTokenResponse = await this.getAccessToken(); const headers = { Authorization: `Bearer ${accessTokenResponse.token}`, }; return this.addSharedMetadataHeaders(headers); } request(opts, callback) { if (callback) { this.requestAsync(opts).then(r => callback(null, r), e => { return callback(e, e.response); }); } else { return this.requestAsync(opts); } } /** * @return A promise that resolves with the project ID corresponding to the * current workload identity pool or current workforce pool if * determinable. For workforce pool credential, it returns the project ID * corresponding to the workforcePoolUserProject. * This is introduced to match the current pattern of using the Auth * library: * const projectId = await auth.getProjectId(); * const url = `https://dns.googleapis.com/dns/v1/projects/${projectId}`; * const res = await client.request({ url }); * The resource may not have permission * (resourcemanager.projects.get) to call this API or the required * scopes may not be selected: * https://cloud.google.com/resource-manager/reference/rest/v1/projects/get#authorization-scopes */ async getProjectId() { const projectNumber = this.projectNumber || this.workforcePoolUserProject; if (this.projectId) { // Return previously determined project ID. return this.projectId; } else if (projectNumber) { // Preferable not to use request() to avoid retrial policies. const headers = await this.getRequestHeaders(); const response = await this.transporter.request({ headers, url: `${exports.CLOUD_RESOURCE_MANAGER}${projectNumber}`, responseType: 'json', }); this.projectId = response.data.projectId; return this.projectId; } return null; } /** * Authenticates the provided HTTP request, processes it and resolves with the * returned response. * @param opts The HTTP request options. * @param retry Whether the current attempt is a retry after a failed attempt. * @return A promise that resolves with the successful response. */ async requestAsync(opts, retry = false) { let response; try { const requestHeaders = await this.getRequestHeaders(); opts.headers = opts.headers || {}; if (requestHeaders && requestHeaders['x-goog-user-project']) { opts.headers['x-goog-user-project'] = requestHeaders['x-goog-user-project']; } if (requestHeaders && requestHeaders.Authorization) { opts.headers.Authorization = requestHeaders.Authorization; } response = await this.transporter.request(opts); } catch (e) { const res = e.response; if (res) { const statusCode = res.status; // Retry the request for metadata if the following criteria are true: // - We haven't already retried. It only makes sense to retry once. // - The response was a 401 or a 403 // - The request didn't send a readableStream // - forceRefreshOnFailure is true const isReadableStream = res.config.data instanceof stream.Readable; const isAuthErr = statusCode === 401 || statusCode === 403; if (!retry && isAuthErr && !isReadableStream && this.forceRefreshOnFailure) { await this.refreshAccessTokenAsync(); return await this.requestAsync(opts, true); } } throw e; } return response; } /** * Forces token refresh, even if unexpired tokens are currently cached. * External credentials are exchanged for GCP access tokens via the token * exchange endpoint and other settings provided in the client options * object. * If the service_account_impersonation_url is provided, an additional * step to exchange the external account GCP access token for a service * account impersonated token is performed. * @return A promise that resolves with the fresh GCP access tokens. */ async refreshAccessTokenAsync() { // Retrieve the external credential. const subjectToken = await this.retrieveSubjectToken(); // Construct the STS credentials options. const stsCredentialsOptions = { grantType: STS_GRANT_TYPE, audience: this.audience, requestedTokenType: STS_REQUEST_TOKEN_TYPE, subjectToken, subjectTokenType: this.subjectTokenType, // generateAccessToken requires the provided access token to have // scopes: // https://www.googleapis.com/auth/iam or // https://www.googleapis.com/auth/cloud-platform // The new service account access token scopes will match the user // provided ones. scope: this.serviceAccountImpersonationUrl ? [DEFAULT_OAUTH_SCOPE] : this.getScopesArray(), }; // Exchange the external credentials for a GCP access token. // Client auth is prioritized over passing the workforcePoolUserProject // parameter for STS token exchange. const additionalOptions = !this.clientAuth && this.workforcePoolUserProject ? { userProject: this.workforcePoolUserProject } : undefined; const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, undefined, additionalOptions); if (this.serviceAccountImpersonationUrl) { this.cachedAccessToken = await this.getImpersonatedAccessToken(stsResponse.access_token); } else if (stsResponse.expires_in) { // Save response in cached access token. this.cachedAccessToken = { access_token: stsResponse.access_token, expiry_date: new Date().getTime() + stsResponse.expires_in * 1000, res: stsResponse.res, }; } else { // Save response in cached access token. this.cachedAccessToken = { access_token: stsResponse.access_token, res: stsResponse.res, }; } // Save credentials. this.credentials = {}; Object.assign(this.credentials, this.cachedAccessToken); delete this.credentials.res; // Trigger tokens event to notify external listeners. this.emit('tokens', { refresh_token: null, expiry_date: this.cachedAccessToken.expiry_date, access_token: this.cachedAccessToken.access_token, token_type: 'Bearer', id_token: null, }); // Return the cached access token. return this.cachedAccessToken; } /** * Returns the workload identity pool project number if it is determinable * from the audience resource name. * @param audience The STS audience used to determine the project number. * @return The project number associated with the workload identity pool, if * this can be determined from the STS audience field. Otherwise, null is * returned. */ getProjectNumber(audience) { // STS audience pattern: // //iam.googleapis.com/projects/$PROJECT_NUMBER/locations/... const match = audience.match(/\/projects\/([^/]+)/); if (!match) { return null; } return match[1]; } /** * Exchanges an external account GCP access token for a service * account impersonated access token using iamcredentials * GenerateAccessToken API. * @param token The access token to exchange for a service account access * token. * @return A promise that resolves with the service account impersonated * credentials response. */ async getImpersonatedAccessToken(token) { const opts = { url: this.serviceAccountImpersonationUrl, method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}`, }, data: { scope: this.getScopesArray(), }, responseType: 'json', }; const response = await this.transporter.request(opts); const successResponse = response.data; return { access_token: successResponse.accessToken, // Convert from ISO format to timestamp. expiry_date: new Date(successResponse.expireTime).getTime(), res: response, }; } /** * Returns whether the provided credentials are expired or not. * If there is no expiry time, assumes the token is not expired or expiring. * @param accessToken The credentials to check for expiration. * @return Whether the credentials are expired or not. */ isExpired(accessToken) { const now = new Date().getTime(); return accessToken.expiry_date ? now >= accessToken.expiry_date - this.eagerRefreshThresholdMillis : false; } /** * @return The list of scopes for the requested GCP access token. */ getScopesArray() { // Since scopes can be provided as string or array, the type should // be normalized. if (typeof this.scopes === 'string') { return [this.scopes]; } else if (typeof this.scopes === 'undefined') { return [DEFAULT_OAUTH_SCOPE]; } else { return this.scopes; } } /** * Checks whether Google APIs URL is valid. * @param apiName The apiName of url. * @param url The Google API URL to validate. * @return Whether the URL is valid or not. */ validateGoogleAPIsUrl(apiName, url) { let parsedUrl; // Return false if error is thrown during parsing URL. try { parsedUrl = new URL(url); } catch (e) { return false; } const urlDomain = parsedUrl.hostname; // Check the protocol is https. if (parsedUrl.protocol !== 'https:') { return false; } const googleAPIsDomainPatterns = [ new RegExp('^' + VARIABLE_PORTION_PATTERN + '\\.' + apiName + GOOGLE_APIS_DOMAIN_PATTERN), new RegExp('^' + apiName + GOOGLE_APIS_DOMAIN_PATTERN), new RegExp('^' + apiName + '\\.' + VARIABLE_PORTION_PATTERN + GOOGLE_APIS_DOMAIN_PATTERN), new RegExp('^' + VARIABLE_PORTION_PATTERN + '\\-' + apiName + GOOGLE_APIS_DOMAIN_PATTERN), ]; for (const googleAPIsDomainPattern of googleAPIsDomainPatterns) { if (urlDomain.match(googleAPIsDomainPattern)) { return true; } } return false; } } exports.BaseExternalAccountClient = BaseExternalAccountClient; //# sourceMappingURL=baseexternalclient.js.map /***/ }), /***/ 96875: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2013 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Compute = void 0; const arrify = __webpack_require__(61546); const gcpMetadata = __webpack_require__(3563); const oauth2client_1 = __webpack_require__(3936); class Compute extends oauth2client_1.OAuth2Client { /** * Google Compute Engine service account credentials. * * Retrieve access token from the metadata server. * See: https://developers.google.com/compute/docs/authentication */ constructor(options = {}) { super(options); // Start with an expired refresh token, which will automatically be // refreshed before the first API call is made. this.credentials = { expiry_date: 1, refresh_token: 'compute-placeholder' }; this.serviceAccountEmail = options.serviceAccountEmail || 'default'; this.scopes = arrify(options.scopes); } /** * Refreshes the access token. * @param refreshToken Unused parameter */ async refreshTokenNoCache( // eslint-disable-next-line @typescript-eslint/no-unused-vars refreshToken) { const tokenPath = `service-accounts/${this.serviceAccountEmail}/token`; let data; try { const instanceOptions = { property: tokenPath, }; if (this.scopes.length > 0) { instanceOptions.params = { scopes: this.scopes.join(','), }; } data = await gcpMetadata.instance(instanceOptions); } catch (e) { e.message = `Could not refresh access token: ${e.message}`; this.wrapError(e); throw e; } const tokens = data; if (data && data.expires_in) { tokens.expiry_date = new Date().getTime() + data.expires_in * 1000; delete tokens.expires_in; } this.emit('tokens', tokens); return { tokens, res: null }; } /** * Fetches an ID token. * @param targetAudience the audience for the fetched ID token. */ async fetchIdToken(targetAudience) { const idTokenPath = `service-accounts/${this.serviceAccountEmail}/identity` + `?format=full&audience=${targetAudience}`; let idToken; try { const instanceOptions = { property: idTokenPath, }; idToken = await gcpMetadata.instance(instanceOptions); } catch (e) { e.message = `Could not fetch ID token: ${e.message}`; throw e; } return idToken; } wrapError(e) { const res = e.response; if (res && res.status) { e.code = res.status.toString(); if (res.status === 403) { e.message = 'A Forbidden error was returned while attempting to retrieve an access ' + 'token for the Compute Engine built-in service account. This may be because the Compute ' + 'Engine instance does not have the correct permission scopes specified: ' + e.message; } else if (res.status === 404) { e.message = 'A Not Found error was returned while attempting to retrieve an access' + 'token for the Compute Engine built-in service account. This may be because the Compute ' + 'Engine instance does not have any permission scopes specified: ' + e.message; } } } } exports.Compute = Compute; //# sourceMappingURL=computeclient.js.map /***/ }), /***/ 6270: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DownscopedClient = exports.EXPIRATION_TIME_OFFSET = exports.MAX_ACCESS_BOUNDARY_RULES_COUNT = void 0; const stream = __webpack_require__(92413); const authclient_1 = __webpack_require__(44627); const sts = __webpack_require__(86308); /** * The required token exchange grant_type: rfc8693#section-2.1 */ const STS_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:token-exchange'; /** * The requested token exchange requested_token_type: rfc8693#section-2.1 */ const STS_REQUEST_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token'; /** * The requested token exchange subject_token_type: rfc8693#section-2.1 */ const STS_SUBJECT_TOKEN_TYPE = 'urn:ietf:params:oauth:token-type:access_token'; /** The STS access token exchange end point. */ const STS_ACCESS_TOKEN_URL = 'https://sts.googleapis.com/v1/token'; /** * The maximum number of access boundary rules a Credential Access Boundary * can contain. */ exports.MAX_ACCESS_BOUNDARY_RULES_COUNT = 10; /** * Offset to take into account network delays and server clock skews. */ exports.EXPIRATION_TIME_OFFSET = 5 * 60 * 1000; /** * Defines a set of Google credentials that are downscoped from an existing set * of Google OAuth2 credentials. This is useful to restrict the Identity and * Access Management (IAM) permissions that a short-lived credential can use. * The common pattern of usage is to have a token broker with elevated access * generate these downscoped credentials from higher access source credentials * and pass the downscoped short-lived access tokens to a token consumer via * some secure authenticated channel for limited access to Google Cloud Storage * resources. */ class DownscopedClient extends authclient_1.AuthClient { /** * Instantiates a downscoped client object using the provided source * AuthClient and credential access boundary rules. * To downscope permissions of a source AuthClient, a Credential Access * Boundary that specifies which resources the new credential can access, as * well as an upper bound on the permissions that are available on each * resource, has to be defined. A downscoped client can then be instantiated * using the source AuthClient and the Credential Access Boundary. * @param authClient The source AuthClient to be downscoped based on the * provided Credential Access Boundary rules. * @param credentialAccessBoundary The Credential Access Boundary which * contains a list of access boundary rules. Each rule contains information * on the resource that the rule applies to, the upper bound of the * permissions that are available on that resource and an optional * condition to further restrict permissions. * @param additionalOptions Optional additional behavior customization * options. These currently customize expiration threshold time and * whether to retry on 401/403 API request errors. * @param quotaProjectId Optional quota project id for setting up in the * x-goog-user-project header. */ constructor(authClient, credentialAccessBoundary, additionalOptions, quotaProjectId) { super(); this.authClient = authClient; this.credentialAccessBoundary = credentialAccessBoundary; // Check 1-10 Access Boundary Rules are defined within Credential Access // Boundary. if (credentialAccessBoundary.accessBoundary.accessBoundaryRules.length === 0) { throw new Error('At least one access boundary rule needs to be defined.'); } else if (credentialAccessBoundary.accessBoundary.accessBoundaryRules.length > exports.MAX_ACCESS_BOUNDARY_RULES_COUNT) { throw new Error('The provided access boundary has more than ' + `${exports.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`); } // Check at least one permission should be defined in each Access Boundary // Rule. for (const rule of credentialAccessBoundary.accessBoundary .accessBoundaryRules) { if (rule.availablePermissions.length === 0) { throw new Error('At least one permission should be defined in access boundary rules.'); } } this.stsCredential = new sts.StsCredentials(STS_ACCESS_TOKEN_URL); this.cachedDownscopedAccessToken = null; // As threshold could be zero, // eagerRefreshThresholdMillis || EXPIRATION_TIME_OFFSET will override the // zero value. if (typeof (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.eagerRefreshThresholdMillis) !== 'number') { this.eagerRefreshThresholdMillis = exports.EXPIRATION_TIME_OFFSET; } else { this.eagerRefreshThresholdMillis = additionalOptions .eagerRefreshThresholdMillis; } this.forceRefreshOnFailure = !!(additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.forceRefreshOnFailure); this.quotaProjectId = quotaProjectId; } /** * Provides a mechanism to inject Downscoped access tokens directly. * The expiry_date field is required to facilitate determination of the token * expiration which would make it easier for the token consumer to handle. * @param credentials The Credentials object to set on the current client. */ setCredentials(credentials) { if (!credentials.expiry_date) { throw new Error('The access token expiry_date field is missing in the provided ' + 'credentials.'); } super.setCredentials(credentials); this.cachedDownscopedAccessToken = credentials; } async getAccessToken() { // If the cached access token is unavailable or expired, force refresh. // The Downscoped access token will be returned in // DownscopedAccessTokenResponse format. if (!this.cachedDownscopedAccessToken || this.isExpired(this.cachedDownscopedAccessToken)) { await this.refreshAccessTokenAsync(); } // Return Downscoped access token in DownscopedAccessTokenResponse format. return { token: this.cachedDownscopedAccessToken.access_token, expirationTime: this.cachedDownscopedAccessToken.expiry_date, res: this.cachedDownscopedAccessToken.res, }; } /** * The main authentication interface. It takes an optional url which when * present is the endpoint being accessed, and returns a Promise which * resolves with authorization header fields. * * The result has the form: * { Authorization: 'Bearer ' } */ async getRequestHeaders() { const accessTokenResponse = await this.getAccessToken(); const headers = { Authorization: `Bearer ${accessTokenResponse.token}`, }; return this.addSharedMetadataHeaders(headers); } request(opts, callback) { if (callback) { this.requestAsync(opts).then(r => callback(null, r), e => { return callback(e, e.response); }); } else { return this.requestAsync(opts); } } /** * Authenticates the provided HTTP request, processes it and resolves with the * returned response. * @param opts The HTTP request options. * @param retry Whether the current attempt is a retry after a failed attempt. * @return A promise that resolves with the successful response. */ async requestAsync(opts, retry = false) { let response; try { const requestHeaders = await this.getRequestHeaders(); opts.headers = opts.headers || {}; if (requestHeaders && requestHeaders['x-goog-user-project']) { opts.headers['x-goog-user-project'] = requestHeaders['x-goog-user-project']; } if (requestHeaders && requestHeaders.Authorization) { opts.headers.Authorization = requestHeaders.Authorization; } response = await this.transporter.request(opts); } catch (e) { const res = e.response; if (res) { const statusCode = res.status; // Retry the request for metadata if the following criteria are true: // - We haven't already retried. It only makes sense to retry once. // - The response was a 401 or a 403 // - The request didn't send a readableStream // - forceRefreshOnFailure is true const isReadableStream = res.config.data instanceof stream.Readable; const isAuthErr = statusCode === 401 || statusCode === 403; if (!retry && isAuthErr && !isReadableStream && this.forceRefreshOnFailure) { await this.refreshAccessTokenAsync(); return await this.requestAsync(opts, true); } } throw e; } return response; } /** * Forces token refresh, even if unexpired tokens are currently cached. * GCP access tokens are retrieved from authclient object/source credential. * Then GCP access tokens are exchanged for downscoped access tokens via the * token exchange endpoint. * @return A promise that resolves with the fresh downscoped access token. */ async refreshAccessTokenAsync() { var _a; // Retrieve GCP access token from source credential. const subjectToken = (await this.authClient.getAccessToken()).token; // Construct the STS credentials options. const stsCredentialsOptions = { grantType: STS_GRANT_TYPE, requestedTokenType: STS_REQUEST_TOKEN_TYPE, subjectToken: subjectToken, subjectTokenType: STS_SUBJECT_TOKEN_TYPE, }; // Exchange the source AuthClient access token for a Downscoped access // token. const stsResponse = await this.stsCredential.exchangeToken(stsCredentialsOptions, undefined, this.credentialAccessBoundary); /** * The STS endpoint will only return the expiration time for the downscoped * access token if the original access token represents a service account. * The downscoped token's expiration time will always match the source * credential expiration. When no expires_in is returned, we can copy the * source credential's expiration time. */ const sourceCredExpireDate = ((_a = this.authClient.credentials) === null || _a === void 0 ? void 0 : _a.expiry_date) || null; const expiryDate = stsResponse.expires_in ? new Date().getTime() + stsResponse.expires_in * 1000 : sourceCredExpireDate; // Save response in cached access token. this.cachedDownscopedAccessToken = { access_token: stsResponse.access_token, expiry_date: expiryDate, res: stsResponse.res, }; // Save credentials. this.credentials = {}; Object.assign(this.credentials, this.cachedDownscopedAccessToken); delete this.credentials.res; // Trigger tokens event to notify external listeners. this.emit('tokens', { refresh_token: null, expiry_date: this.cachedDownscopedAccessToken.expiry_date, access_token: this.cachedDownscopedAccessToken.access_token, token_type: 'Bearer', id_token: null, }); // Return the cached access token. return this.cachedDownscopedAccessToken; } /** * Returns whether the provided credentials are expired or not. * If there is no expiry time, assumes the token is not expired or expiring. * @param downscopedAccessToken The credentials to check for expiration. * @return Whether the credentials are expired or not. */ isExpired(downscopedAccessToken) { const now = new Date().getTime(); return downscopedAccessToken.expiry_date ? now >= downscopedAccessToken.expiry_date - this.eagerRefreshThresholdMillis : false; } } exports.DownscopedClient = DownscopedClient; //# sourceMappingURL=downscopedclient.js.map /***/ }), /***/ 21380: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getEnv = exports.clear = exports.GCPEnv = void 0; const gcpMetadata = __webpack_require__(3563); var GCPEnv; (function (GCPEnv) { GCPEnv["APP_ENGINE"] = "APP_ENGINE"; GCPEnv["KUBERNETES_ENGINE"] = "KUBERNETES_ENGINE"; GCPEnv["CLOUD_FUNCTIONS"] = "CLOUD_FUNCTIONS"; GCPEnv["COMPUTE_ENGINE"] = "COMPUTE_ENGINE"; GCPEnv["CLOUD_RUN"] = "CLOUD_RUN"; GCPEnv["NONE"] = "NONE"; })(GCPEnv = exports.GCPEnv || (exports.GCPEnv = {})); let envPromise; function clear() { envPromise = undefined; } exports.clear = clear; async function getEnv() { if (envPromise) { return envPromise; } envPromise = getEnvMemoized(); return envPromise; } exports.getEnv = getEnv; async function getEnvMemoized() { let env = GCPEnv.NONE; if (isAppEngine()) { env = GCPEnv.APP_ENGINE; } else if (isCloudFunction()) { env = GCPEnv.CLOUD_FUNCTIONS; } else if (await isComputeEngine()) { if (await isKubernetesEngine()) { env = GCPEnv.KUBERNETES_ENGINE; } else if (isCloudRun()) { env = GCPEnv.CLOUD_RUN; } else { env = GCPEnv.COMPUTE_ENGINE; } } else { env = GCPEnv.NONE; } return env; } function isAppEngine() { return !!(process.env.GAE_SERVICE || process.env.GAE_MODULE_NAME); } function isCloudFunction() { return !!(process.env.FUNCTION_NAME || process.env.FUNCTION_TARGET); } /** * This check only verifies that the environment is running knative. * This must be run *after* checking for Kubernetes, otherwise it will * return a false positive. */ function isCloudRun() { return !!process.env.K_CONFIGURATION; } async function isKubernetesEngine() { try { await gcpMetadata.instance('attributes/cluster-name'); return true; } catch (e) { return false; } } async function isComputeEngine() { return gcpMetadata.isAvailable(); } //# sourceMappingURL=envDetect.js.map /***/ }), /***/ 94381: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExternalAccountClient = void 0; const baseexternalclient_1 = __webpack_require__(40810); const identitypoolclient_1 = __webpack_require__(20117); const awsclient_1 = __webpack_require__(71569); /** * Dummy class with no constructor. Developers are expected to use fromJSON. */ class ExternalAccountClient { constructor() { throw new Error('ExternalAccountClients should be initialized via: ' + 'ExternalAccountClient.fromJSON(), ' + 'directly via explicit constructors, eg. ' + 'new AwsClient(options), new IdentityPoolClient(options) or via ' + 'new GoogleAuth(options).getClient()'); } /** * This static method will instantiate the * corresponding type of external account credential depending on the * underlying credential source. * @param options The external account options object typically loaded * from the external account JSON credential file. * @param additionalOptions Optional additional behavior customization * options. These currently customize expiration threshold time and * whether to retry on 401/403 API request errors. * @return A BaseExternalAccountClient instance or null if the options * provided do not correspond to an external account credential. */ static fromJSON(options, additionalOptions) { var _a; if (options && options.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { if ((_a = options.credential_source) === null || _a === void 0 ? void 0 : _a.environment_id) { return new awsclient_1.AwsClient(options, additionalOptions); } else { return new identitypoolclient_1.IdentityPoolClient(options, additionalOptions); } } else { return null; } } } exports.ExternalAccountClient = ExternalAccountClient; //# sourceMappingURL=externalclient.js.map /***/ }), /***/ 20695: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GoogleAuth = exports.CLOUD_SDK_CLIENT_ID = void 0; const child_process_1 = __webpack_require__(63129); const fs = __webpack_require__(35747); const gcpMetadata = __webpack_require__(3563); const os = __webpack_require__(12087); const path = __webpack_require__(85622); const crypto_1 = __webpack_require__(78043); const transporters_1 = __webpack_require__(72649); const computeclient_1 = __webpack_require__(96875); const idtokenclient_1 = __webpack_require__(80298); const envDetect_1 = __webpack_require__(21380); const jwtclient_1 = __webpack_require__(13959); const refreshclient_1 = __webpack_require__(98790); const externalclient_1 = __webpack_require__(94381); const baseexternalclient_1 = __webpack_require__(40810); exports.CLOUD_SDK_CLIENT_ID = '764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com'; class GoogleAuth { constructor(opts) { /** * Caches a value indicating whether the auth layer is running on Google * Compute Engine. * @private */ this.checkIsGCE = undefined; // To save the contents of the JSON credential file this.jsonContent = null; this.cachedCredential = null; opts = opts || {}; this._cachedProjectId = opts.projectId || null; this.keyFilename = opts.keyFilename || opts.keyFile; this.scopes = opts.scopes; this.jsonContent = opts.credentials || null; this.clientOptions = opts.clientOptions; } // Note: this properly is only public to satisify unit tests. // https://github.com/Microsoft/TypeScript/issues/5228 get isGCE() { return this.checkIsGCE; } // GAPIC client libraries should always use self-signed JWTs. The following // variables are set on the JWT client in order to indicate the type of library, // and sign the JWT with the correct audience and scopes (if not supplied). setGapicJWTValues(client) { client.defaultServicePath = this.defaultServicePath; client.useJWTAccessWithScope = this.useJWTAccessWithScope; client.defaultScopes = this.defaultScopes; } getProjectId(callback) { if (callback) { this.getProjectIdAsync().then(r => callback(null, r), callback); } else { return this.getProjectIdAsync(); } } getProjectIdAsync() { if (this._cachedProjectId) { return Promise.resolve(this._cachedProjectId); } // In implicit case, supports three environments. In order of precedence, // the implicit environments are: // - GCLOUD_PROJECT or GOOGLE_CLOUD_PROJECT environment variable // - GOOGLE_APPLICATION_CREDENTIALS JSON file // - Cloud SDK: `gcloud config config-helper --format json` // - GCE project ID from metadata server) if (!this._getDefaultProjectIdPromise) { // TODO: refactor the below code so that it doesn't mix and match // promises and async/await. this._getDefaultProjectIdPromise = new Promise( // eslint-disable-next-line no-async-promise-executor async (resolve, reject) => { try { const projectId = this.getProductionProjectId() || (await this.getFileProjectId()) || (await this.getDefaultServiceProjectId()) || (await this.getGCEProjectId()) || (await this.getExternalAccountClientProjectId()); this._cachedProjectId = projectId; if (!projectId) { throw new Error('Unable to detect a Project Id in the current environment. \n' + 'To learn more about authentication and Google APIs, visit: \n' + 'https://cloud.google.com/docs/authentication/getting-started'); } resolve(projectId); } catch (e) { reject(e); } }); } return this._getDefaultProjectIdPromise; } /** * @returns Any scopes (user-specified or default scopes specified by the * client library) that need to be set on the current Auth client. */ getAnyScopes() { return this.scopes || this.defaultScopes; } getApplicationDefault(optionsOrCallback = {}, callback) { let options; if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; } else { options = optionsOrCallback; } if (callback) { this.getApplicationDefaultAsync(options).then(r => callback(null, r.credential, r.projectId), callback); } else { return this.getApplicationDefaultAsync(options); } } async getApplicationDefaultAsync(options = {}) { // If we've already got a cached credential, just return it. if (this.cachedCredential) { return { credential: this.cachedCredential, projectId: await this.getProjectIdAsync(), }; } let credential; let projectId; // Check for the existence of a local environment variable pointing to the // location of the credential file. This is typically used in local // developer scenarios. credential = await this._tryGetApplicationCredentialsFromEnvironmentVariable(options); if (credential) { if (credential instanceof jwtclient_1.JWT) { credential.scopes = this.scopes; } else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) { credential.scopes = this.getAnyScopes(); } this.cachedCredential = credential; projectId = await this.getProjectId(); return { credential, projectId }; } // Look in the well-known credential file location. credential = await this._tryGetApplicationCredentialsFromWellKnownFile(options); if (credential) { if (credential instanceof jwtclient_1.JWT) { credential.scopes = this.scopes; } else if (credential instanceof baseexternalclient_1.BaseExternalAccountClient) { credential.scopes = this.getAnyScopes(); } this.cachedCredential = credential; projectId = await this.getProjectId(); return { credential, projectId }; } // Determine if we're running on GCE. let isGCE; try { isGCE = await this._checkIsGCE(); } catch (e) { e.message = `Unexpected error determining execution environment: ${e.message}`; throw e; } if (!isGCE) { // We failed to find the default credentials. Bail out with an error. throw new Error('Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.'); } // For GCE, just return a default ComputeClient. It will take care of // the rest. options.scopes = this.getAnyScopes(); this.cachedCredential = new computeclient_1.Compute(options); projectId = await this.getProjectId(); return { projectId, credential: this.cachedCredential }; } /** * Determines whether the auth layer is running on Google Compute Engine. * @returns A promise that resolves with the boolean. * @api private */ async _checkIsGCE() { if (this.checkIsGCE === undefined) { this.checkIsGCE = await gcpMetadata.isAvailable(); } return this.checkIsGCE; } /** * Attempts to load default credentials from the environment variable path.. * @returns Promise that resolves with the OAuth2Client or null. * @api private */ async _tryGetApplicationCredentialsFromEnvironmentVariable(options) { const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'] || process.env['google_application_credentials']; if (!credentialsPath || credentialsPath.length === 0) { return null; } try { return this._getApplicationCredentialsFromFilePath(credentialsPath, options); } catch (e) { e.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`; throw e; } } /** * Attempts to load default credentials from a well-known file location * @return Promise that resolves with the OAuth2Client or null. * @api private */ async _tryGetApplicationCredentialsFromWellKnownFile(options) { // First, figure out the location of the file, depending upon the OS type. let location = null; if (this._isWindows()) { // Windows location = process.env['APPDATA']; } else { // Linux or Mac const home = process.env['HOME']; if (home) { location = path.join(home, '.config'); } } // If we found the root path, expand it. if (location) { location = path.join(location, 'gcloud', 'application_default_credentials.json'); if (!fs.existsSync(location)) { location = null; } } // The file does not exist. if (!location) { return null; } // The file seems to exist. Try to use it. const client = await this._getApplicationCredentialsFromFilePath(location, options); return client; } /** * Attempts to load default credentials from a file at the given path.. * @param filePath The path to the file to read. * @returns Promise that resolves with the OAuth2Client * @api private */ async _getApplicationCredentialsFromFilePath(filePath, options = {}) { // Make sure the path looks like a string. if (!filePath || filePath.length === 0) { throw new Error('The file path is invalid.'); } // Make sure there is a file at the path. lstatSync will throw if there is // nothing there. try { // Resolve path to actual file in case of symlink. Expect a thrown error // if not resolvable. filePath = fs.realpathSync(filePath); if (!fs.lstatSync(filePath).isFile()) { throw new Error(); } } catch (err) { err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`; throw err; } // Now open a read stream on the file, and parse it. const readStream = fs.createReadStream(filePath); return this.fromStream(readStream, options); } /** * Create a credentials instance using the given input options. * @param json The input object. * @param options The JWT or UserRefresh options for the client * @returns JWT or UserRefresh Client with data */ fromJSON(json, options) { let client; if (!json) { throw new Error('Must pass in a JSON object containing the Google auth settings.'); } options = options || {}; if (json.type === 'authorized_user') { client = new refreshclient_1.UserRefreshClient(options); client.fromJSON(json); } else if (json.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { client = externalclient_1.ExternalAccountClient.fromJSON(json, options); client.scopes = this.getAnyScopes(); } else { options.scopes = this.scopes; client = new jwtclient_1.JWT(options); this.setGapicJWTValues(client); client.fromJSON(json); } return client; } /** * Return a JWT or UserRefreshClient from JavaScript object, caching both the * object used to instantiate and the client. * @param json The input object. * @param options The JWT or UserRefresh options for the client * @returns JWT or UserRefresh Client with data */ _cacheClientFromJSON(json, options) { let client; // create either a UserRefreshClient or JWT client. options = options || {}; if (json.type === 'authorized_user') { client = new refreshclient_1.UserRefreshClient(options); client.fromJSON(json); } else if (json.type === baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { client = externalclient_1.ExternalAccountClient.fromJSON(json, options); client.scopes = this.getAnyScopes(); } else { options.scopes = this.scopes; client = new jwtclient_1.JWT(options); this.setGapicJWTValues(client); client.fromJSON(json); } // cache both raw data used to instantiate client and client itself. this.jsonContent = json; this.cachedCredential = client; return this.cachedCredential; } fromStream(inputStream, optionsOrCallback = {}, callback) { let options = {}; if (typeof optionsOrCallback === 'function') { callback = optionsOrCallback; } else { options = optionsOrCallback; } if (callback) { this.fromStreamAsync(inputStream, options).then(r => callback(null, r), callback); } else { return this.fromStreamAsync(inputStream, options); } } fromStreamAsync(inputStream, options) { return new Promise((resolve, reject) => { if (!inputStream) { throw new Error('Must pass in a stream containing the Google auth settings.'); } let s = ''; inputStream .setEncoding('utf8') .on('error', reject) .on('data', chunk => (s += chunk)) .on('end', () => { try { try { const data = JSON.parse(s); const r = this._cacheClientFromJSON(data, options); return resolve(r); } catch (err) { // If we failed parsing this.keyFileName, assume that it // is a PEM or p12 certificate: if (!this.keyFilename) throw err; const client = new jwtclient_1.JWT({ ...this.clientOptions, keyFile: this.keyFilename, }); this.cachedCredential = client; this.setGapicJWTValues(client); return resolve(client); } } catch (err) { return reject(err); } }); }); } /** * Create a credentials instance using the given API key string. * @param apiKey The API key string * @param options An optional options object. * @returns A JWT loaded from the key */ fromAPIKey(apiKey, options) { options = options || {}; const client = new jwtclient_1.JWT(options); client.fromAPIKey(apiKey); return client; } /** * Determines whether the current operating system is Windows. * @api private */ _isWindows() { const sys = os.platform(); if (sys && sys.length >= 3) { if (sys.substring(0, 3).toLowerCase() === 'win') { return true; } } return false; } /** * Run the Google Cloud SDK command that prints the default project ID */ async getDefaultServiceProjectId() { return new Promise(resolve => { child_process_1.exec('gcloud config config-helper --format json', (err, stdout) => { if (!err && stdout) { try { const projectId = JSON.parse(stdout).configuration.properties.core.project; resolve(projectId); return; } catch (e) { // ignore errors } } resolve(null); }); }); } /** * Loads the project id from environment variables. * @api private */ getProductionProjectId() { return (process.env['GCLOUD_PROJECT'] || process.env['GOOGLE_CLOUD_PROJECT'] || process.env['gcloud_project'] || process.env['google_cloud_project']); } /** * Loads the project id from the GOOGLE_APPLICATION_CREDENTIALS json file. * @api private */ async getFileProjectId() { if (this.cachedCredential) { // Try to read the project ID from the cached credentials file return this.cachedCredential.projectId; } // Ensure the projectId is loaded from the keyFile if available. if (this.keyFilename) { const creds = await this.getClient(); if (creds && creds.projectId) { return creds.projectId; } } // Try to load a credentials file and read its project ID const r = await this._tryGetApplicationCredentialsFromEnvironmentVariable(); if (r) { return r.projectId; } else { return null; } } /** * Gets the project ID from external account client if available. */ async getExternalAccountClientProjectId() { if (!this.jsonContent || this.jsonContent.type !== baseexternalclient_1.EXTERNAL_ACCOUNT_TYPE) { return null; } const creds = await this.getClient(); // Do not suppress the underlying error, as the error could contain helpful // information for debugging and fixing. This is especially true for // external account creds as in order to get the project ID, the following // operations have to succeed: // 1. Valid credentials file should be supplied. // 2. Ability to retrieve access tokens from STS token exchange API. // 3. Ability to exchange for service account impersonated credentials (if // enabled). // 4. Ability to get project info using the access token from step 2 or 3. // Without surfacing the error, it is harder for developers to determine // which step went wrong. return await creds.getProjectId(); } /** * Gets the Compute Engine project ID if it can be inferred. */ async getGCEProjectId() { try { const r = await gcpMetadata.project('project-id'); return r; } catch (e) { // Ignore any errors return null; } } getCredentials(callback) { if (callback) { this.getCredentialsAsync().then(r => callback(null, r), callback); } else { return this.getCredentialsAsync(); } } async getCredentialsAsync() { await this.getClient(); if (this.jsonContent) { const credential = { client_email: this.jsonContent.client_email, private_key: this.jsonContent.private_key, }; return credential; } const isGCE = await this._checkIsGCE(); if (!isGCE) { throw new Error('Unknown error.'); } // For GCE, return the service account details from the metadata server // NOTE: The trailing '/' at the end of service-accounts/ is very important! // The GCF metadata server doesn't respect querystring params if this / is // not included. const data = await gcpMetadata.instance({ property: 'service-accounts/', params: { recursive: 'true' }, }); if (!data || !data.default || !data.default.email) { throw new Error('Failure from metadata server.'); } return { client_email: data.default.email }; } /** * Automatically obtain a client based on the provided configuration. If no * options were passed, use Application Default Credentials. */ async getClient(options) { if (options) { throw new Error('Passing options to getClient is forbidden in v5.0.0. Use new GoogleAuth(opts) instead.'); } if (!this.cachedCredential) { if (this.jsonContent) { this._cacheClientFromJSON(this.jsonContent, this.clientOptions); } else if (this.keyFilename) { const filePath = path.resolve(this.keyFilename); const stream = fs.createReadStream(filePath); await this.fromStreamAsync(stream, this.clientOptions); } else { await this.getApplicationDefaultAsync(this.clientOptions); } } return this.cachedCredential; } /** * Creates a client which will fetch an ID token for authorization. * @param targetAudience the audience for the fetched ID token. * @returns IdTokenClient for making HTTP calls authenticated with ID tokens. */ async getIdTokenClient(targetAudience) { const client = await this.getClient(); if (!('fetchIdToken' in client)) { throw new Error('Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.'); } return new idtokenclient_1.IdTokenClient({ targetAudience, idTokenProvider: client }); } /** * Automatically obtain application default credentials, and return * an access token for making requests. */ async getAccessToken() { const client = await this.getClient(); return (await client.getAccessToken()).token; } /** * Obtain the HTTP headers that will provide authorization for a given * request. */ async getRequestHeaders(url) { const client = await this.getClient(); return client.getRequestHeaders(url); } /** * Obtain credentials for a request, then attach the appropriate headers to * the request options. * @param opts Axios or Request options on which to attach the headers */ async authorizeRequest(opts) { opts = opts || {}; const url = opts.url || opts.uri; const client = await this.getClient(); const headers = await client.getRequestHeaders(url); opts.headers = Object.assign(opts.headers || {}, headers); return opts; } /** * Automatically obtain application default credentials, and make an * HTTP request using the given options. * @param opts Axios request options for the HTTP request. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any async request(opts) { const client = await this.getClient(); return client.request(opts); } /** * Determine the compute environment in which the code is running. */ getEnv() { return envDetect_1.getEnv(); } /** * Sign the given data with the current private key, or go out * to the IAM API to sign it. * @param data The data to be signed. */ async sign(data) { const client = await this.getClient(); const crypto = crypto_1.createCrypto(); if (client instanceof jwtclient_1.JWT && client.key) { const sign = await crypto.sign(client.key, data); return sign; } // signBlob requires a service account email and the underlying // access token to have iam.serviceAccounts.signBlob permission // on the specified resource name. // The "Service Account Token Creator" role should cover this. // As a result external account credentials can support this // operation when service account impersonation is enabled. if (client instanceof baseexternalclient_1.BaseExternalAccountClient && client.getServiceAccountEmail()) { return this.signBlob(crypto, client.getServiceAccountEmail(), data); } const projectId = await this.getProjectId(); if (!projectId) { throw new Error('Cannot sign data without a project ID.'); } const creds = await this.getCredentials(); if (!creds.client_email) { throw new Error('Cannot sign data without `client_email`.'); } return this.signBlob(crypto, creds.client_email, data); } async signBlob(crypto, emailOrUniqueId, data) { const url = 'https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/' + `${emailOrUniqueId}:signBlob`; const res = await this.request({ method: 'POST', url, data: { payload: crypto.encodeBase64StringUtf8(data), }, }); return res.data.signedBlob; } } exports.GoogleAuth = GoogleAuth; /** * Export DefaultTransporter as a static property of the class. */ GoogleAuth.DefaultTransporter = transporters_1.DefaultTransporter; //# sourceMappingURL=googleauth.js.map /***/ }), /***/ 39735: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2014 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.IAMAuth = void 0; class IAMAuth { /** * IAM credentials. * * @param selector the iam authority selector * @param token the token * @constructor */ constructor(selector, token) { this.selector = selector; this.token = token; this.selector = selector; this.token = token; } /** * Acquire the HTTP headers required to make an authenticated request. */ getRequestHeaders() { return { 'x-goog-iam-authority-selector': this.selector, 'x-goog-iam-authorization-token': this.token, }; } } exports.IAMAuth = IAMAuth; //# sourceMappingURL=iam.js.map /***/ }), /***/ 20117: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. var _a, _b, _c; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.IdentityPoolClient = void 0; const fs = __webpack_require__(35747); const util_1 = __webpack_require__(31669); const baseexternalclient_1 = __webpack_require__(40810); // fs.readfile is undefined in browser karma tests causing // `npm run browser-test` to fail as test.oauth2.ts imports this file via // src/index.ts. // Fallback to void function to avoid promisify throwing a TypeError. const readFile = util_1.promisify((_a = fs.readFile) !== null && _a !== void 0 ? _a : (() => { })); const realpath = util_1.promisify((_b = fs.realpath) !== null && _b !== void 0 ? _b : (() => { })); const lstat = util_1.promisify((_c = fs.lstat) !== null && _c !== void 0 ? _c : (() => { })); /** * Defines the Url-sourced and file-sourced external account clients mainly * used for K8s and Azure workloads. */ class IdentityPoolClient extends baseexternalclient_1.BaseExternalAccountClient { /** * Instantiate an IdentityPoolClient instance using the provided JSON * object loaded from an external account credentials file. * An error is thrown if the credential is not a valid file-sourced or * url-sourced credential or a workforce pool user project is provided * with a non workforce audience. * @param options The external account options object typically loaded * from the external account JSON credential file. * @param additionalOptions Optional additional behavior customization * options. These currently customize expiration threshold time and * whether to retry on 401/403 API request errors. */ constructor(options, additionalOptions) { var _a, _b; super(options, additionalOptions); this.file = options.credential_source.file; this.url = options.credential_source.url; this.headers = options.credential_source.headers; if (!this.file && !this.url) { throw new Error('No valid Identity Pool "credential_source" provided'); } // Text is the default format type. this.formatType = ((_a = options.credential_source.format) === null || _a === void 0 ? void 0 : _a.type) || 'text'; this.formatSubjectTokenFieldName = (_b = options.credential_source.format) === null || _b === void 0 ? void 0 : _b.subject_token_field_name; if (this.formatType !== 'json' && this.formatType !== 'text') { throw new Error(`Invalid credential_source format "${this.formatType}"`); } if (this.formatType === 'json' && !this.formatSubjectTokenFieldName) { throw new Error('Missing subject_token_field_name for JSON credential_source format'); } } /** * Triggered when a external subject token is needed to be exchanged for a GCP * access token via GCP STS endpoint. * This uses the `options.credential_source` object to figure out how * to retrieve the token using the current environment. In this case, * this either retrieves the local credential from a file location (k8s * workload) or by sending a GET request to a local metadata server (Azure * workloads). * @return A promise that resolves with the external subject token. */ async retrieveSubjectToken() { if (this.file) { return await this.getTokenFromFile(this.file, this.formatType, this.formatSubjectTokenFieldName); } return await this.getTokenFromUrl(this.url, this.formatType, this.formatSubjectTokenFieldName, this.headers); } /** * Looks up the external subject token in the file path provided and * resolves with that token. * @param file The file path where the external credential is located. * @param formatType The token file or URL response type (JSON or text). * @param formatSubjectTokenFieldName For JSON response types, this is the * subject_token field name. For Azure, this is access_token. For text * response types, this is ignored. * @return A promise that resolves with the external subject token. */ async getTokenFromFile(filePath, formatType, formatSubjectTokenFieldName) { // Make sure there is a file at the path. lstatSync will throw if there is // nothing there. try { // Resolve path to actual file in case of symlink. Expect a thrown error // if not resolvable. filePath = await realpath(filePath); if (!(await lstat(filePath)).isFile()) { throw new Error(); } } catch (err) { err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`; throw err; } let subjectToken; const rawText = await readFile(filePath, { encoding: 'utf8' }); if (formatType === 'text') { subjectToken = rawText; } else if (formatType === 'json' && formatSubjectTokenFieldName) { const json = JSON.parse(rawText); subjectToken = json[formatSubjectTokenFieldName]; } if (!subjectToken) { throw new Error('Unable to parse the subject_token from the credential_source file'); } return subjectToken; } /** * Sends a GET request to the URL provided and resolves with the returned * external subject token. * @param url The URL to call to retrieve the subject token. This is typically * a local metadata server. * @param formatType The token file or URL response type (JSON or text). * @param formatSubjectTokenFieldName For JSON response types, this is the * subject_token field name. For Azure, this is access_token. For text * response types, this is ignored. * @param headers The optional additional headers to send with the request to * the metadata server url. * @return A promise that resolves with the external subject token. */ async getTokenFromUrl(url, formatType, formatSubjectTokenFieldName, headers) { const opts = { url, method: 'GET', headers, responseType: formatType, }; let subjectToken; if (formatType === 'text') { const response = await this.transporter.request(opts); subjectToken = response.data; } else if (formatType === 'json' && formatSubjectTokenFieldName) { const response = await this.transporter.request(opts); subjectToken = response.data[formatSubjectTokenFieldName]; } if (!subjectToken) { throw new Error('Unable to parse the subject_token from the credential_source URL'); } return subjectToken; } } exports.IdentityPoolClient = IdentityPoolClient; //# sourceMappingURL=identitypoolclient.js.map /***/ }), /***/ 80298: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.IdTokenClient = void 0; const oauth2client_1 = __webpack_require__(3936); class IdTokenClient extends oauth2client_1.OAuth2Client { /** * Google ID Token client * * Retrieve access token from the metadata server. * See: https://developers.google.com/compute/docs/authentication */ constructor(options) { super(); this.targetAudience = options.targetAudience; this.idTokenProvider = options.idTokenProvider; } async getRequestMetadataAsync( // eslint-disable-next-line @typescript-eslint/no-unused-vars url) { if (!this.credentials.id_token || (this.credentials.expiry_date || 0) < Date.now()) { const idToken = await this.idTokenProvider.fetchIdToken(this.targetAudience); this.credentials = { id_token: idToken, expiry_date: this.getIdTokenExpiryDate(idToken), }; } const headers = { Authorization: 'Bearer ' + this.credentials.id_token, }; return { headers }; } getIdTokenExpiryDate(idToken) { const payloadB64 = idToken.split('.')[1]; if (payloadB64) { const payload = JSON.parse(Buffer.from(payloadB64, 'base64').toString('ascii')); return payload.exp * 1000; } } } exports.IdTokenClient = IdTokenClient; //# sourceMappingURL=idtokenclient.js.map /***/ }), /***/ 91103: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Impersonated = void 0; const oauth2client_1 = __webpack_require__(3936); class Impersonated extends oauth2client_1.OAuth2Client { /** * Impersonated service account credentials. * * Create a new access token by impersonating another service account. * * Impersonated Credentials allowing credentials issued to a user or * service account to impersonate another. The source project using * Impersonated Credentials must enable the "IAMCredentials" API. * Also, the target service account must grant the orginating principal * the "Service Account Token Creator" IAM role. * * @param {object} options - The configuration object. * @param {object} [options.sourceClient] the source credential used as to * acquire the impersonated credentials. * @param {string} [options.targetPrincipal] the service account to * impersonate. * @param {string[]} [options.delegates] the chained list of delegates * required to grant the final access_token. If set, the sequence of * identities must have "Service Account Token Creator" capability granted to * the preceding identity. For example, if set to [serviceAccountB, * serviceAccountC], the sourceCredential must have the Token Creator role on * serviceAccountB. serviceAccountB must have the Token Creator on * serviceAccountC. Finally, C must have Token Creator on target_principal. * If left unset, sourceCredential must have that role on targetPrincipal. * @param {string[]} [options.targetScopes] scopes to request during the * authorization grant. * @param {number} [options.lifetime] number of seconds the delegated * credential should be valid for up to 3600 seconds by default, or 43,200 * seconds by extending the token's lifetime, see: * https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials#sa-credentials-oauth * @param {string} [options.endpoint] api endpoint override. */ constructor(options = {}) { var _a, _b, _c, _d, _e, _f; super(options); this.credentials = { expiry_date: 1, refresh_token: 'impersonated-placeholder', }; this.sourceClient = (_a = options.sourceClient) !== null && _a !== void 0 ? _a : new oauth2client_1.OAuth2Client(); this.targetPrincipal = (_b = options.targetPrincipal) !== null && _b !== void 0 ? _b : ''; this.delegates = (_c = options.delegates) !== null && _c !== void 0 ? _c : []; this.targetScopes = (_d = options.targetScopes) !== null && _d !== void 0 ? _d : []; this.lifetime = (_e = options.lifetime) !== null && _e !== void 0 ? _e : 3600; this.endpoint = (_f = options.endpoint) !== null && _f !== void 0 ? _f : 'https://iamcredentials.googleapis.com'; } /** * Refreshes the access token. * @param refreshToken Unused parameter */ async refreshToken(refreshToken) { var _a, _b, _c, _d, _e, _f; try { await this.sourceClient.getAccessToken(); const name = 'projects/-/serviceAccounts/' + this.targetPrincipal; const u = `${this.endpoint}/v1/${name}:generateAccessToken`; const body = { delegates: this.delegates, scope: this.targetScopes, lifetime: this.lifetime + 's', }; const res = await this.sourceClient.request({ url: u, data: body, method: 'POST', }); const tokenResponse = res.data; this.credentials.access_token = tokenResponse.accessToken; this.credentials.expiry_date = Date.parse(tokenResponse.expireTime); return { tokens: this.credentials, res, }; } catch (error) { const status = (_c = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c.status; const message = (_f = (_e = (_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) === null || _f === void 0 ? void 0 : _f.message; if (status && message) { error.message = `${status}: unable to impersonate: ${message}`; throw error; } else { error.message = `unable to impersonate: ${error}`; throw error; } } } } exports.Impersonated = Impersonated; //# sourceMappingURL=impersonated.js.map /***/ }), /***/ 68740: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2015 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JWTAccess = void 0; const jws = __webpack_require__(4636); const LRU = __webpack_require__(7129); const DEFAULT_HEADER = { alg: 'RS256', typ: 'JWT', }; class JWTAccess { /** * JWTAccess service account credentials. * * Create a new access token by using the credential to create a new JWT token * that's recognized as the access token. * * @param email the service account email address. * @param key the private key that will be used to sign the token. * @param keyId the ID of the private key used to sign the token. */ constructor(email, key, keyId, eagerRefreshThresholdMillis) { this.cache = new LRU({ max: 500, maxAge: 60 * 60 * 1000, }); this.email = email; this.key = key; this.keyId = keyId; this.eagerRefreshThresholdMillis = eagerRefreshThresholdMillis !== null && eagerRefreshThresholdMillis !== void 0 ? eagerRefreshThresholdMillis : 5 * 60 * 1000; } /** * Ensures that we're caching a key appropriately, giving precedence to scopes vs. url * * @param url The URI being authorized. * @param scopes The scope or scopes being authorized * @returns A string that returns the cached key. */ getCachedKey(url, scopes) { let cacheKey = url; if (scopes && Array.isArray(scopes) && scopes.length) { cacheKey = url ? `${url}_${scopes.join('_')}` : `${scopes.join('_')}`; } else if (typeof scopes === 'string') { cacheKey = url ? `${url}_${scopes}` : scopes; } if (!cacheKey) { throw Error('Scopes or url must be provided'); } return cacheKey; } /** * Get a non-expired access token, after refreshing if necessary. * * @param url The URI being authorized. * @param additionalClaims An object with a set of additional claims to * include in the payload. * @returns An object that includes the authorization header. */ getRequestHeaders(url, additionalClaims, scopes) { // Return cached authorization headers, unless we are within // eagerRefreshThresholdMillis ms of them expiring: const key = this.getCachedKey(url, scopes); const cachedToken = this.cache.get(key); const now = Date.now(); if (cachedToken && cachedToken.expiration - now > this.eagerRefreshThresholdMillis) { return cachedToken.headers; } const iat = Math.floor(Date.now() / 1000); const exp = JWTAccess.getExpirationTime(iat); let defaultClaims; // Turn scopes into space-separated string if (Array.isArray(scopes)) { scopes = scopes.join(' '); } // If scopes are specified, sign with scopes if (scopes) { defaultClaims = { iss: this.email, sub: this.email, scope: scopes, exp, iat, }; } else { defaultClaims = { iss: this.email, sub: this.email, aud: url, exp, iat, }; } // if additionalClaims are provided, ensure they do not collide with // other required claims. if (additionalClaims) { for (const claim in defaultClaims) { if (additionalClaims[claim]) { throw new Error(`The '${claim}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`); } } } const header = this.keyId ? { ...DEFAULT_HEADER, kid: this.keyId } : DEFAULT_HEADER; const payload = Object.assign(defaultClaims, additionalClaims); // Sign the jwt and add it to the cache const signedJWT = jws.sign({ header, payload, secret: this.key }); const headers = { Authorization: `Bearer ${signedJWT}` }; this.cache.set(key, { expiration: exp * 1000, headers, }); return headers; } /** * Returns an expiration time for the JWT token. * * @param iat The issued at time for the JWT. * @returns An expiration time for the JWT. */ static getExpirationTime(iat) { const exp = iat + 3600; // 3600 seconds = 1 hour return exp; } /** * Create a JWTAccess credentials instance using the given input options. * @param json The input object. */ fromJSON(json) { if (!json) { throw new Error('Must pass in a JSON object containing the service account auth settings.'); } if (!json.client_email) { throw new Error('The incoming JSON object does not contain a client_email field'); } if (!json.private_key) { throw new Error('The incoming JSON object does not contain a private_key field'); } // Extract the relevant information from the json key file. this.email = json.client_email; this.key = json.private_key; this.keyId = json.private_key_id; this.projectId = json.project_id; } fromStream(inputStream, callback) { if (callback) { this.fromStreamAsync(inputStream).then(() => callback(), callback); } else { return this.fromStreamAsync(inputStream); } } fromStreamAsync(inputStream) { return new Promise((resolve, reject) => { if (!inputStream) { reject(new Error('Must pass in a stream containing the service account auth settings.')); } let s = ''; inputStream .setEncoding('utf8') .on('data', chunk => (s += chunk)) .on('error', reject) .on('end', () => { try { const data = JSON.parse(s); this.fromJSON(data); resolve(); } catch (err) { reject(err); } }); }); } } exports.JWTAccess = JWTAccess; //# sourceMappingURL=jwtaccess.js.map /***/ }), /***/ 13959: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2013 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JWT = void 0; const gtoken_1 = __webpack_require__(76031); const jwtaccess_1 = __webpack_require__(68740); const oauth2client_1 = __webpack_require__(3936); class JWT extends oauth2client_1.OAuth2Client { constructor(optionsOrEmail, keyFile, key, scopes, subject, keyId) { const opts = optionsOrEmail && typeof optionsOrEmail === 'object' ? optionsOrEmail : { email: optionsOrEmail, keyFile, key, keyId, scopes, subject }; super({ eagerRefreshThresholdMillis: opts.eagerRefreshThresholdMillis, forceRefreshOnFailure: opts.forceRefreshOnFailure, }); this.email = opts.email; this.keyFile = opts.keyFile; this.key = opts.key; this.keyId = opts.keyId; this.scopes = opts.scopes; this.subject = opts.subject; this.additionalClaims = opts.additionalClaims; this.credentials = { refresh_token: 'jwt-placeholder', expiry_date: 1 }; } /** * Creates a copy of the credential with the specified scopes. * @param scopes List of requested scopes or a single scope. * @return The cloned instance. */ createScoped(scopes) { return new JWT({ email: this.email, keyFile: this.keyFile, key: this.key, keyId: this.keyId, scopes, subject: this.subject, additionalClaims: this.additionalClaims, }); } /** * Obtains the metadata to be sent with the request. * * @param url the URI being authorized. */ async getRequestMetadataAsync(url) { url = this.defaultServicePath ? `https://${this.defaultServicePath}/` : url; const useSelfSignedJWT = (!this.hasUserScopes() && url) || (this.useJWTAccessWithScope && this.hasAnyScopes()); if (!this.apiKey && useSelfSignedJWT) { if (this.additionalClaims && this.additionalClaims.target_audience) { const { tokens } = await this.refreshToken(); return { headers: this.addSharedMetadataHeaders({ Authorization: `Bearer ${tokens.id_token}`, }), }; } else { // no scopes have been set, but a uri has been provided. Use JWTAccess // credentials. if (!this.access) { this.access = new jwtaccess_1.JWTAccess(this.email, this.key, this.keyId, this.eagerRefreshThresholdMillis); } let scopes; if (this.hasUserScopes()) { scopes = this.scopes; } else if (!url) { scopes = this.defaultScopes; } const headers = await this.access.getRequestHeaders(url !== null && url !== void 0 ? url : undefined, this.additionalClaims, // Scopes take precedent over audience for signing, // so we only provide them if useJWTAccessWithScope is on this.useJWTAccessWithScope ? scopes : undefined); return { headers: this.addSharedMetadataHeaders(headers) }; } } else if (this.hasAnyScopes() || this.apiKey) { return super.getRequestMetadataAsync(url); } else { // If no audience, apiKey, or scopes are provided, we should not attempt // to populate any headers: return { headers: {} }; } } /** * Fetches an ID token. * @param targetAudience the audience for the fetched ID token. */ async fetchIdToken(targetAudience) { // Create a new gToken for fetching an ID token const gtoken = new gtoken_1.GoogleToken({ iss: this.email, sub: this.subject, scope: this.scopes || this.defaultScopes, keyFile: this.keyFile, key: this.key, additionalClaims: { target_audience: targetAudience }, }); await gtoken.getToken({ forceRefresh: true, }); if (!gtoken.idToken) { throw new Error('Unknown error: Failed to fetch ID token'); } return gtoken.idToken; } /** * Determine if there are currently scopes available. */ hasUserScopes() { if (!this.scopes) { return false; } return this.scopes.length > 0; } /** * Are there any default or user scopes defined. */ hasAnyScopes() { if (this.scopes && this.scopes.length > 0) return true; if (this.defaultScopes && this.defaultScopes.length > 0) return true; return false; } authorize(callback) { if (callback) { this.authorizeAsync().then(r => callback(null, r), callback); } else { return this.authorizeAsync(); } } async authorizeAsync() { const result = await this.refreshToken(); if (!result) { throw new Error('No result returned'); } this.credentials = result.tokens; this.credentials.refresh_token = 'jwt-placeholder'; this.key = this.gtoken.key; this.email = this.gtoken.iss; return result.tokens; } /** * Refreshes the access token. * @param refreshToken ignored * @private */ async refreshTokenNoCache( // eslint-disable-next-line @typescript-eslint/no-unused-vars refreshToken) { const gtoken = this.createGToken(); const token = await gtoken.getToken({ forceRefresh: this.isTokenExpiring(), }); const tokens = { access_token: token.access_token, token_type: 'Bearer', expiry_date: gtoken.expiresAt, id_token: gtoken.idToken, }; this.emit('tokens', tokens); return { res: null, tokens }; } /** * Create a gToken if it doesn't already exist. */ createGToken() { if (!this.gtoken) { this.gtoken = new gtoken_1.GoogleToken({ iss: this.email, sub: this.subject, scope: this.scopes || this.defaultScopes, keyFile: this.keyFile, key: this.key, additionalClaims: this.additionalClaims, }); } return this.gtoken; } /** * Create a JWT credentials instance using the given input options. * @param json The input object. */ fromJSON(json) { if (!json) { throw new Error('Must pass in a JSON object containing the service account auth settings.'); } if (!json.client_email) { throw new Error('The incoming JSON object does not contain a client_email field'); } if (!json.private_key) { throw new Error('The incoming JSON object does not contain a private_key field'); } // Extract the relevant information from the json key file. this.email = json.client_email; this.key = json.private_key; this.keyId = json.private_key_id; this.projectId = json.project_id; this.quotaProjectId = json.quota_project_id; } fromStream(inputStream, callback) { if (callback) { this.fromStreamAsync(inputStream).then(() => callback(), callback); } else { return this.fromStreamAsync(inputStream); } } fromStreamAsync(inputStream) { return new Promise((resolve, reject) => { if (!inputStream) { throw new Error('Must pass in a stream containing the service account auth settings.'); } let s = ''; inputStream .setEncoding('utf8') .on('error', reject) .on('data', chunk => (s += chunk)) .on('end', () => { try { const data = JSON.parse(s); this.fromJSON(data); resolve(); } catch (e) { reject(e); } }); }); } /** * Creates a JWT credentials instance using an API Key for authentication. * @param apiKey The API Key in string form. */ fromAPIKey(apiKey) { if (typeof apiKey !== 'string') { throw new Error('Must provide an API Key string.'); } this.apiKey = apiKey; } /** * Using the key or keyFile on the JWT client, obtain an object that contains * the key and the client email. */ async getCredentials() { if (this.key) { return { private_key: this.key, client_email: this.email }; } else if (this.keyFile) { const gtoken = this.createGToken(); const creds = await gtoken.getCredentials(this.keyFile); return { private_key: creds.privateKey, client_email: creds.clientEmail }; } throw new Error('A key or a keyFile must be provided to getCredentials.'); } } exports.JWT = JWT; //# sourceMappingURL=jwtclient.js.map /***/ }), /***/ 74524: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2014 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LoginTicket = void 0; class LoginTicket { /** * Create a simple class to extract user ID from an ID Token * * @param {string} env Envelope of the jwt * @param {TokenPayload} pay Payload of the jwt * @constructor */ constructor(env, pay) { this.envelope = env; this.payload = pay; } getEnvelope() { return this.envelope; } getPayload() { return this.payload; } /** * Create a simple class to extract user ID from an ID Token * * @return The user ID */ getUserId() { const payload = this.getPayload(); if (payload && payload.sub) { return payload.sub; } return null; } /** * Returns attributes from the login ticket. This can contain * various information about the user session. * * @return The envelope and payload */ getAttributes() { return { envelope: this.getEnvelope(), payload: this.getPayload() }; } } exports.LoginTicket = LoginTicket; //# sourceMappingURL=loginticket.js.map /***/ }), /***/ 3936: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OAuth2Client = exports.CertificateFormat = exports.CodeChallengeMethod = void 0; const querystring = __webpack_require__(71191); const stream = __webpack_require__(92413); const formatEcdsa = __webpack_require__(11728); const crypto_1 = __webpack_require__(78043); const authclient_1 = __webpack_require__(44627); const loginticket_1 = __webpack_require__(74524); var CodeChallengeMethod; (function (CodeChallengeMethod) { CodeChallengeMethod["Plain"] = "plain"; CodeChallengeMethod["S256"] = "S256"; })(CodeChallengeMethod = exports.CodeChallengeMethod || (exports.CodeChallengeMethod = {})); var CertificateFormat; (function (CertificateFormat) { CertificateFormat["PEM"] = "PEM"; CertificateFormat["JWK"] = "JWK"; })(CertificateFormat = exports.CertificateFormat || (exports.CertificateFormat = {})); class OAuth2Client extends authclient_1.AuthClient { constructor(optionsOrClientId, clientSecret, redirectUri) { super(); this.certificateCache = {}; this.certificateExpiry = null; this.certificateCacheFormat = CertificateFormat.PEM; this.refreshTokenPromises = new Map(); const opts = optionsOrClientId && typeof optionsOrClientId === 'object' ? optionsOrClientId : { clientId: optionsOrClientId, clientSecret, redirectUri }; this._clientId = opts.clientId; this._clientSecret = opts.clientSecret; this.redirectUri = opts.redirectUri; this.eagerRefreshThresholdMillis = opts.eagerRefreshThresholdMillis || 5 * 60 * 1000; this.forceRefreshOnFailure = !!opts.forceRefreshOnFailure; } /** * Generates URL for consent page landing. * @param opts Options. * @return URL to consent page. */ generateAuthUrl(opts = {}) { if (opts.code_challenge_method && !opts.code_challenge) { throw new Error('If a code_challenge_method is provided, code_challenge must be included.'); } opts.response_type = opts.response_type || 'code'; opts.client_id = opts.client_id || this._clientId; opts.redirect_uri = opts.redirect_uri || this.redirectUri; // Allow scopes to be passed either as array or a string if (opts.scope instanceof Array) { opts.scope = opts.scope.join(' '); } const rootUrl = OAuth2Client.GOOGLE_OAUTH2_AUTH_BASE_URL_; return (rootUrl + '?' + querystring.stringify(opts)); } generateCodeVerifier() { // To make the code compatible with browser SubtleCrypto we need to make // this method async. throw new Error('generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.'); } /** * Convenience method to automatically generate a code_verifier, and its * resulting SHA256. If used, this must be paired with a S256 * code_challenge_method. * * For a full example see: * https://github.com/googleapis/google-auth-library-nodejs/blob/main/samples/oauth2-codeVerifier.js */ async generateCodeVerifierAsync() { // base64 encoding uses 6 bits per character, and we want to generate128 // characters. 6*128/8 = 96. const crypto = crypto_1.createCrypto(); const randomString = crypto.randomBytesBase64(96); // The valid characters in the code_verifier are [A-Z]/[a-z]/[0-9]/ // "-"/"."/"_"/"~". Base64 encoded strings are pretty close, so we're just // swapping out a few chars. const codeVerifier = randomString .replace(/\+/g, '~') .replace(/=/g, '_') .replace(/\//g, '-'); // Generate the base64 encoded SHA256 const unencodedCodeChallenge = await crypto.sha256DigestBase64(codeVerifier); // We need to use base64UrlEncoding instead of standard base64 const codeChallenge = unencodedCodeChallenge .split('=')[0] .replace(/\+/g, '-') .replace(/\//g, '_'); return { codeVerifier, codeChallenge }; } getToken(codeOrOptions, callback) { const options = typeof codeOrOptions === 'string' ? { code: codeOrOptions } : codeOrOptions; if (callback) { this.getTokenAsync(options).then(r => callback(null, r.tokens, r.res), e => callback(e, null, e.response)); } else { return this.getTokenAsync(options); } } async getTokenAsync(options) { const url = OAuth2Client.GOOGLE_OAUTH2_TOKEN_URL_; const values = { code: options.code, client_id: options.client_id || this._clientId, client_secret: this._clientSecret, redirect_uri: options.redirect_uri || this.redirectUri, grant_type: 'authorization_code', code_verifier: options.codeVerifier, }; const res = await this.transporter.request({ method: 'POST', url, data: querystring.stringify(values), headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, }); const tokens = res.data; if (res.data && res.data.expires_in) { tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000; delete tokens.expires_in; } this.emit('tokens', tokens); return { tokens, res }; } /** * Refreshes the access token. * @param refresh_token Existing refresh token. * @private */ async refreshToken(refreshToken) { if (!refreshToken) { return this.refreshTokenNoCache(refreshToken); } // If a request to refresh using the same token has started, // return the same promise. if (this.refreshTokenPromises.has(refreshToken)) { return this.refreshTokenPromises.get(refreshToken); } const p = this.refreshTokenNoCache(refreshToken).then(r => { this.refreshTokenPromises.delete(refreshToken); return r; }, e => { this.refreshTokenPromises.delete(refreshToken); throw e; }); this.refreshTokenPromises.set(refreshToken, p); return p; } async refreshTokenNoCache(refreshToken) { if (!refreshToken) { throw new Error('No refresh token is set.'); } const url = OAuth2Client.GOOGLE_OAUTH2_TOKEN_URL_; const data = { refresh_token: refreshToken, client_id: this._clientId, client_secret: this._clientSecret, grant_type: 'refresh_token', }; // request for new token const res = await this.transporter.request({ method: 'POST', url, data: querystring.stringify(data), headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, }); const tokens = res.data; // TODO: de-duplicate this code from a few spots if (res.data && res.data.expires_in) { tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000; delete tokens.expires_in; } this.emit('tokens', tokens); return { tokens, res }; } refreshAccessToken(callback) { if (callback) { this.refreshAccessTokenAsync().then(r => callback(null, r.credentials, r.res), callback); } else { return this.refreshAccessTokenAsync(); } } async refreshAccessTokenAsync() { const r = await this.refreshToken(this.credentials.refresh_token); const tokens = r.tokens; tokens.refresh_token = this.credentials.refresh_token; this.credentials = tokens; return { credentials: this.credentials, res: r.res }; } getAccessToken(callback) { if (callback) { this.getAccessTokenAsync().then(r => callback(null, r.token, r.res), callback); } else { return this.getAccessTokenAsync(); } } async getAccessTokenAsync() { const shouldRefresh = !this.credentials.access_token || this.isTokenExpiring(); if (shouldRefresh) { if (!this.credentials.refresh_token) { if (this.refreshHandler) { const refreshedAccessToken = await this.processAndValidateRefreshHandler(); if (refreshedAccessToken === null || refreshedAccessToken === void 0 ? void 0 : refreshedAccessToken.access_token) { this.setCredentials(refreshedAccessToken); return { token: this.credentials.access_token }; } } else { throw new Error('No refresh token or refresh handler callback is set.'); } } const r = await this.refreshAccessTokenAsync(); if (!r.credentials || (r.credentials && !r.credentials.access_token)) { throw new Error('Could not refresh access token.'); } return { token: r.credentials.access_token, res: r.res }; } else { return { token: this.credentials.access_token }; } } /** * The main authentication interface. It takes an optional url which when * present is the endpoint being accessed, and returns a Promise which * resolves with authorization header fields. * * In OAuth2Client, the result has the form: * { Authorization: 'Bearer ' } * @param url The optional url being authorized */ async getRequestHeaders(url) { const headers = (await this.getRequestMetadataAsync(url)).headers; return headers; } async getRequestMetadataAsync( // eslint-disable-next-line @typescript-eslint/no-unused-vars url) { const thisCreds = this.credentials; if (!thisCreds.access_token && !thisCreds.refresh_token && !this.apiKey && !this.refreshHandler) { throw new Error('No access, refresh token, API key or refresh handler callback is set.'); } if (thisCreds.access_token && !this.isTokenExpiring()) { thisCreds.token_type = thisCreds.token_type || 'Bearer'; const headers = { Authorization: thisCreds.token_type + ' ' + thisCreds.access_token, }; return { headers: this.addSharedMetadataHeaders(headers) }; } // If refreshHandler exists, call processAndValidateRefreshHandler(). if (this.refreshHandler) { const refreshedAccessToken = await this.processAndValidateRefreshHandler(); if (refreshedAccessToken === null || refreshedAccessToken === void 0 ? void 0 : refreshedAccessToken.access_token) { this.setCredentials(refreshedAccessToken); const headers = { Authorization: 'Bearer ' + this.credentials.access_token, }; return { headers: this.addSharedMetadataHeaders(headers) }; } } if (this.apiKey) { return { headers: { 'X-Goog-Api-Key': this.apiKey } }; } let r = null; let tokens = null; try { r = await this.refreshToken(thisCreds.refresh_token); tokens = r.tokens; } catch (err) { const e = err; if (e.response && (e.response.status === 403 || e.response.status === 404)) { e.message = `Could not refresh access token: ${e.message}`; } throw e; } const credentials = this.credentials; credentials.token_type = credentials.token_type || 'Bearer'; tokens.refresh_token = credentials.refresh_token; this.credentials = tokens; const headers = { Authorization: credentials.token_type + ' ' + tokens.access_token, }; return { headers: this.addSharedMetadataHeaders(headers), res: r.res }; } /** * Generates an URL to revoke the given token. * @param token The existing token to be revoked. */ static getRevokeTokenUrl(token) { const parameters = querystring.stringify({ token }); return `${OAuth2Client.GOOGLE_OAUTH2_REVOKE_URL_}?${parameters}`; } revokeToken(token, callback) { const opts = { url: OAuth2Client.getRevokeTokenUrl(token), method: 'POST', }; if (callback) { this.transporter .request(opts) .then(r => callback(null, r), callback); } else { return this.transporter.request(opts); } } revokeCredentials(callback) { if (callback) { this.revokeCredentialsAsync().then(res => callback(null, res), callback); } else { return this.revokeCredentialsAsync(); } } async revokeCredentialsAsync() { const token = this.credentials.access_token; this.credentials = {}; if (token) { return this.revokeToken(token); } else { throw new Error('No access token to revoke.'); } } request(opts, callback) { if (callback) { this.requestAsync(opts).then(r => callback(null, r), e => { return callback(e, e.response); }); } else { return this.requestAsync(opts); } } async requestAsync(opts, retry = false) { let r2; try { const r = await this.getRequestMetadataAsync(opts.url); opts.headers = opts.headers || {}; if (r.headers && r.headers['x-goog-user-project']) { opts.headers['x-goog-user-project'] = r.headers['x-goog-user-project']; } if (r.headers && r.headers.Authorization) { opts.headers.Authorization = r.headers.Authorization; } if (this.apiKey) { opts.headers['X-Goog-Api-Key'] = this.apiKey; } r2 = await this.transporter.request(opts); } catch (e) { const res = e.response; if (res) { const statusCode = res.status; // Retry the request for metadata if the following criteria are true: // - We haven't already retried. It only makes sense to retry once. // - The response was a 401 or a 403 // - The request didn't send a readableStream // - An access_token and refresh_token were available, but either no // expiry_date was available or the forceRefreshOnFailure flag is set. // The absent expiry_date case can happen when developers stash the // access_token and refresh_token for later use, but the access_token // fails on the first try because it's expired. Some developers may // choose to enable forceRefreshOnFailure to mitigate time-related // errors. // Or the following criteria are true: // - We haven't already retried. It only makes sense to retry once. // - The response was a 401 or a 403 // - The request didn't send a readableStream // - No refresh_token was available // - An access_token and a refreshHandler callback were available, but // either no expiry_date was available or the forceRefreshOnFailure // flag is set. The access_token fails on the first try because it's // expired. Some developers may choose to enable forceRefreshOnFailure // to mitigate time-related errors. const mayRequireRefresh = this.credentials && this.credentials.access_token && this.credentials.refresh_token && (!this.credentials.expiry_date || this.forceRefreshOnFailure); const mayRequireRefreshWithNoRefreshToken = this.credentials && this.credentials.access_token && !this.credentials.refresh_token && (!this.credentials.expiry_date || this.forceRefreshOnFailure) && this.refreshHandler; const isReadableStream = res.config.data instanceof stream.Readable; const isAuthErr = statusCode === 401 || statusCode === 403; if (!retry && isAuthErr && !isReadableStream && mayRequireRefresh) { await this.refreshAccessTokenAsync(); return this.requestAsync(opts, true); } else if (!retry && isAuthErr && !isReadableStream && mayRequireRefreshWithNoRefreshToken) { const refreshedAccessToken = await this.processAndValidateRefreshHandler(); if (refreshedAccessToken === null || refreshedAccessToken === void 0 ? void 0 : refreshedAccessToken.access_token) { this.setCredentials(refreshedAccessToken); } return this.requestAsync(opts, true); } } throw e; } return r2; } verifyIdToken(options, callback) { // This function used to accept two arguments instead of an options object. // Check the types to help users upgrade with less pain. // This check can be removed after a 2.0 release. if (callback && typeof callback !== 'function') { throw new Error('This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.'); } if (callback) { this.verifyIdTokenAsync(options).then(r => callback(null, r), callback); } else { return this.verifyIdTokenAsync(options); } } async verifyIdTokenAsync(options) { if (!options.idToken) { throw new Error('The verifyIdToken method requires an ID Token'); } const response = await this.getFederatedSignonCertsAsync(); const login = await this.verifySignedJwtWithCertsAsync(options.idToken, response.certs, options.audience, OAuth2Client.ISSUERS_, options.maxExpiry); return login; } /** * Obtains information about the provisioned access token. Especially useful * if you want to check the scopes that were provisioned to a given token. * * @param accessToken Required. The Access Token for which you want to get * user info. */ async getTokenInfo(accessToken) { const { data } = await this.transporter.request({ method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', Authorization: `Bearer ${accessToken}`, }, url: OAuth2Client.GOOGLE_TOKEN_INFO_URL, }); const info = Object.assign({ expiry_date: new Date().getTime() + data.expires_in * 1000, scopes: data.scope.split(' '), }, data); delete info.expires_in; delete info.scope; return info; } getFederatedSignonCerts(callback) { if (callback) { this.getFederatedSignonCertsAsync().then(r => callback(null, r.certs, r.res), callback); } else { return this.getFederatedSignonCertsAsync(); } } async getFederatedSignonCertsAsync() { const nowTime = new Date().getTime(); const format = crypto_1.hasBrowserCrypto() ? CertificateFormat.JWK : CertificateFormat.PEM; if (this.certificateExpiry && nowTime < this.certificateExpiry.getTime() && this.certificateCacheFormat === format) { return { certs: this.certificateCache, format }; } let res; let url; switch (format) { case CertificateFormat.PEM: url = OAuth2Client.GOOGLE_OAUTH2_FEDERATED_SIGNON_PEM_CERTS_URL_; break; case CertificateFormat.JWK: url = OAuth2Client.GOOGLE_OAUTH2_FEDERATED_SIGNON_JWK_CERTS_URL_; break; default: throw new Error(`Unsupported certificate format ${format}`); } try { res = await this.transporter.request({ url }); } catch (e) { e.message = `Failed to retrieve verification certificates: ${e.message}`; throw e; } const cacheControl = res ? res.headers['cache-control'] : undefined; let cacheAge = -1; if (cacheControl) { const pattern = new RegExp('max-age=([0-9]*)'); const regexResult = pattern.exec(cacheControl); if (regexResult && regexResult.length === 2) { // Cache results with max-age (in seconds) cacheAge = Number(regexResult[1]) * 1000; // milliseconds } } let certificates = {}; switch (format) { case CertificateFormat.PEM: certificates = res.data; break; case CertificateFormat.JWK: for (const key of res.data.keys) { certificates[key.kid] = key; } break; default: throw new Error(`Unsupported certificate format ${format}`); } const now = new Date(); this.certificateExpiry = cacheAge === -1 ? null : new Date(now.getTime() + cacheAge); this.certificateCache = certificates; this.certificateCacheFormat = format; return { certs: certificates, format, res }; } getIapPublicKeys(callback) { if (callback) { this.getIapPublicKeysAsync().then(r => callback(null, r.pubkeys, r.res), callback); } else { return this.getIapPublicKeysAsync(); } } async getIapPublicKeysAsync() { let res; const url = OAuth2Client.GOOGLE_OAUTH2_IAP_PUBLIC_KEY_URL_; try { res = await this.transporter.request({ url }); } catch (e) { e.message = `Failed to retrieve verification certificates: ${e.message}`; throw e; } return { pubkeys: res.data, res }; } verifySignedJwtWithCerts() { // To make the code compatible with browser SubtleCrypto we need to make // this method async. throw new Error('verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.'); } /** * Verify the id token is signed with the correct certificate * and is from the correct audience. * @param jwt The jwt to verify (The ID Token in this case). * @param certs The array of certs to test the jwt against. * @param requiredAudience The audience to test the jwt against. * @param issuers The allowed issuers of the jwt (Optional). * @param maxExpiry The max expiry the certificate can be (Optional). * @return Returns a promise resolving to LoginTicket on verification. */ async verifySignedJwtWithCertsAsync(jwt, certs, requiredAudience, issuers, maxExpiry) { const crypto = crypto_1.createCrypto(); if (!maxExpiry) { maxExpiry = OAuth2Client.MAX_TOKEN_LIFETIME_SECS_; } const segments = jwt.split('.'); if (segments.length !== 3) { throw new Error('Wrong number of segments in token: ' + jwt); } const signed = segments[0] + '.' + segments[1]; let signature = segments[2]; let envelope; let payload; try { envelope = JSON.parse(crypto.decodeBase64StringUtf8(segments[0])); } catch (err) { err.message = `Can't parse token envelope: ${segments[0]}': ${err.message}`; throw err; } if (!envelope) { throw new Error("Can't parse token envelope: " + segments[0]); } try { payload = JSON.parse(crypto.decodeBase64StringUtf8(segments[1])); } catch (err) { err.message = `Can't parse token payload '${segments[0]}`; throw err; } if (!payload) { throw new Error("Can't parse token payload: " + segments[1]); } if (!Object.prototype.hasOwnProperty.call(certs, envelope.kid)) { // If this is not present, then there's no reason to attempt verification throw new Error('No pem found for envelope: ' + JSON.stringify(envelope)); } const cert = certs[envelope.kid]; if (envelope.alg === 'ES256') { signature = formatEcdsa.joseToDer(signature, 'ES256').toString('base64'); } const verified = await crypto.verify(cert, signed, signature); if (!verified) { throw new Error('Invalid token signature: ' + jwt); } if (!payload.iat) { throw new Error('No issue time in token: ' + JSON.stringify(payload)); } if (!payload.exp) { throw new Error('No expiration time in token: ' + JSON.stringify(payload)); } const iat = Number(payload.iat); if (isNaN(iat)) throw new Error('iat field using invalid format'); const exp = Number(payload.exp); if (isNaN(exp)) throw new Error('exp field using invalid format'); const now = new Date().getTime() / 1000; if (exp >= now + maxExpiry) { throw new Error('Expiration time too far in future: ' + JSON.stringify(payload)); } const earliest = iat - OAuth2Client.CLOCK_SKEW_SECS_; const latest = exp + OAuth2Client.CLOCK_SKEW_SECS_; if (now < earliest) { throw new Error('Token used too early, ' + now + ' < ' + earliest + ': ' + JSON.stringify(payload)); } if (now > latest) { throw new Error('Token used too late, ' + now + ' > ' + latest + ': ' + JSON.stringify(payload)); } if (issuers && issuers.indexOf(payload.iss) < 0) { throw new Error('Invalid issuer, expected one of [' + issuers + '], but got ' + payload.iss); } // Check the audience matches if we have one if (typeof requiredAudience !== 'undefined' && requiredAudience !== null) { const aud = payload.aud; let audVerified = false; // If the requiredAudience is an array, check if it contains token // audience if (requiredAudience.constructor === Array) { audVerified = requiredAudience.indexOf(aud) > -1; } else { audVerified = aud === requiredAudience; } if (!audVerified) { throw new Error('Wrong recipient, payload audience != requiredAudience'); } } return new loginticket_1.LoginTicket(envelope, payload); } /** * Returns a promise that resolves with AccessTokenResponse type if * refreshHandler is defined. * If not, nothing is returned. */ async processAndValidateRefreshHandler() { if (this.refreshHandler) { const accessTokenResponse = await this.refreshHandler(); if (!accessTokenResponse.access_token) { throw new Error('No access token is returned by the refreshHandler callback.'); } return accessTokenResponse; } return; } /** * Returns true if a token is expired or will expire within * eagerRefreshThresholdMillismilliseconds. * If there is no expiry time, assumes the token is not expired or expiring. */ isTokenExpiring() { const expiryDate = this.credentials.expiry_date; return expiryDate ? expiryDate <= new Date().getTime() + this.eagerRefreshThresholdMillis : false; } } exports.OAuth2Client = OAuth2Client; OAuth2Client.GOOGLE_TOKEN_INFO_URL = 'https://oauth2.googleapis.com/tokeninfo'; /** * The base URL for auth endpoints. */ OAuth2Client.GOOGLE_OAUTH2_AUTH_BASE_URL_ = 'https://accounts.google.com/o/oauth2/v2/auth'; /** * The base endpoint for token retrieval. */ OAuth2Client.GOOGLE_OAUTH2_TOKEN_URL_ = 'https://oauth2.googleapis.com/token'; /** * The base endpoint to revoke tokens. */ OAuth2Client.GOOGLE_OAUTH2_REVOKE_URL_ = 'https://oauth2.googleapis.com/revoke'; /** * Google Sign on certificates in PEM format. */ OAuth2Client.GOOGLE_OAUTH2_FEDERATED_SIGNON_PEM_CERTS_URL_ = 'https://www.googleapis.com/oauth2/v1/certs'; /** * Google Sign on certificates in JWK format. */ OAuth2Client.GOOGLE_OAUTH2_FEDERATED_SIGNON_JWK_CERTS_URL_ = 'https://www.googleapis.com/oauth2/v3/certs'; /** * Google Sign on certificates in JWK format. */ OAuth2Client.GOOGLE_OAUTH2_IAP_PUBLIC_KEY_URL_ = 'https://www.gstatic.com/iap/verify/public_key'; /** * Clock skew - five minutes in seconds */ OAuth2Client.CLOCK_SKEW_SECS_ = 300; /** * Max Token Lifetime is one day in seconds */ OAuth2Client.MAX_TOKEN_LIFETIME_SECS_ = 86400; /** * The allowed oauth token issuers. */ OAuth2Client.ISSUERS_ = [ 'accounts.google.com', 'https://accounts.google.com', ]; //# sourceMappingURL=oauth2client.js.map /***/ }), /***/ 19510: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getErrorFromOAuthErrorResponse = exports.OAuthClientAuthHandler = void 0; const querystring = __webpack_require__(71191); const crypto_1 = __webpack_require__(78043); /** List of HTTP methods that accept request bodies. */ const METHODS_SUPPORTING_REQUEST_BODY = ['PUT', 'POST', 'PATCH']; /** * Abstract class for handling client authentication in OAuth-based * operations. * When request-body client authentication is used, only application/json and * application/x-www-form-urlencoded content types for HTTP methods that support * request bodies are supported. */ class OAuthClientAuthHandler { /** * Instantiates an OAuth client authentication handler. * @param clientAuthentication The client auth credentials. */ constructor(clientAuthentication) { this.clientAuthentication = clientAuthentication; this.crypto = crypto_1.createCrypto(); } /** * Applies client authentication on the OAuth request's headers or POST * body but does not process the request. * @param opts The GaxiosOptions whose headers or data are to be modified * depending on the client authentication mechanism to be used. * @param bearerToken The optional bearer token to use for authentication. * When this is used, no client authentication credentials are needed. */ applyClientAuthenticationOptions(opts, bearerToken) { // Inject authenticated header. this.injectAuthenticatedHeaders(opts, bearerToken); // Inject authenticated request body. if (!bearerToken) { this.injectAuthenticatedRequestBody(opts); } } /** * Applies client authentication on the request's header if either * basic authentication or bearer token authentication is selected. * * @param opts The GaxiosOptions whose headers or data are to be modified * depending on the client authentication mechanism to be used. * @param bearerToken The optional bearer token to use for authentication. * When this is used, no client authentication credentials are needed. */ injectAuthenticatedHeaders(opts, bearerToken) { var _a; // Bearer token prioritized higher than basic Auth. if (bearerToken) { opts.headers = opts.headers || {}; Object.assign(opts.headers, { Authorization: `Bearer ${bearerToken}}`, }); } else if (((_a = this.clientAuthentication) === null || _a === void 0 ? void 0 : _a.confidentialClientType) === 'basic') { opts.headers = opts.headers || {}; const clientId = this.clientAuthentication.clientId; const clientSecret = this.clientAuthentication.clientSecret || ''; const base64EncodedCreds = this.crypto.encodeBase64StringUtf8(`${clientId}:${clientSecret}`); Object.assign(opts.headers, { Authorization: `Basic ${base64EncodedCreds}`, }); } } /** * Applies client authentication on the request's body if request-body * client authentication is selected. * * @param opts The GaxiosOptions whose headers or data are to be modified * depending on the client authentication mechanism to be used. */ injectAuthenticatedRequestBody(opts) { var _a; if (((_a = this.clientAuthentication) === null || _a === void 0 ? void 0 : _a.confidentialClientType) === 'request-body') { const method = (opts.method || 'GET').toUpperCase(); // Inject authenticated request body. if (METHODS_SUPPORTING_REQUEST_BODY.indexOf(method) !== -1) { // Get content-type. let contentType; const headers = opts.headers || {}; for (const key in headers) { if (key.toLowerCase() === 'content-type' && headers[key]) { contentType = headers[key].toLowerCase(); break; } } if (contentType === 'application/x-www-form-urlencoded') { opts.data = opts.data || ''; const data = querystring.parse(opts.data); Object.assign(data, { client_id: this.clientAuthentication.clientId, client_secret: this.clientAuthentication.clientSecret || '', }); opts.data = querystring.stringify(data); } else if (contentType === 'application/json') { opts.data = opts.data || {}; Object.assign(opts.data, { client_id: this.clientAuthentication.clientId, client_secret: this.clientAuthentication.clientSecret || '', }); } else { throw new Error(`${contentType} content-types are not supported with ` + `${this.clientAuthentication.confidentialClientType} ` + 'client authentication'); } } else { throw new Error(`${method} HTTP method does not support ` + `${this.clientAuthentication.confidentialClientType} ` + 'client authentication'); } } } } exports.OAuthClientAuthHandler = OAuthClientAuthHandler; /** * Converts an OAuth error response to a native JavaScript Error. * @param resp The OAuth error response to convert to a native Error object. * @param err The optional original error. If provided, the error properties * will be copied to the new error. * @return The converted native Error object. */ function getErrorFromOAuthErrorResponse(resp, err) { // Error response. const errorCode = resp.error; const errorDescription = resp.error_description; const errorUri = resp.error_uri; let message = `Error code ${errorCode}`; if (typeof errorDescription !== 'undefined') { message += `: ${errorDescription}`; } if (typeof errorUri !== 'undefined') { message += ` - ${errorUri}`; } const newError = new Error(message); // Copy properties from original error to newly generated error. if (err) { const keys = Object.keys(err); if (err.stack) { // Copy error.stack if available. keys.push('stack'); } keys.forEach(key => { // Do not overwrite the message field. if (key !== 'message') { Object.defineProperty(newError, key, { // eslint-disable-next-line @typescript-eslint/no-explicit-any value: err[key], writable: false, enumerable: true, }); } }); } return newError; } exports.getErrorFromOAuthErrorResponse = getErrorFromOAuthErrorResponse; //# sourceMappingURL=oauth2common.js.map /***/ }), /***/ 98790: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2015 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.UserRefreshClient = void 0; const oauth2client_1 = __webpack_require__(3936); class UserRefreshClient extends oauth2client_1.OAuth2Client { constructor(optionsOrClientId, clientSecret, refreshToken, eagerRefreshThresholdMillis, forceRefreshOnFailure) { const opts = optionsOrClientId && typeof optionsOrClientId === 'object' ? optionsOrClientId : { clientId: optionsOrClientId, clientSecret, refreshToken, eagerRefreshThresholdMillis, forceRefreshOnFailure, }; super({ clientId: opts.clientId, clientSecret: opts.clientSecret, eagerRefreshThresholdMillis: opts.eagerRefreshThresholdMillis, forceRefreshOnFailure: opts.forceRefreshOnFailure, }); this._refreshToken = opts.refreshToken; this.credentials.refresh_token = opts.refreshToken; } /** * Refreshes the access token. * @param refreshToken An ignored refreshToken.. * @param callback Optional callback. */ async refreshTokenNoCache( // eslint-disable-next-line @typescript-eslint/no-unused-vars refreshToken) { return super.refreshTokenNoCache(this._refreshToken); } /** * Create a UserRefreshClient credentials instance using the given input * options. * @param json The input object. */ fromJSON(json) { if (!json) { throw new Error('Must pass in a JSON object containing the user refresh token'); } if (json.type !== 'authorized_user') { throw new Error('The incoming JSON object does not have the "authorized_user" type'); } if (!json.client_id) { throw new Error('The incoming JSON object does not contain a client_id field'); } if (!json.client_secret) { throw new Error('The incoming JSON object does not contain a client_secret field'); } if (!json.refresh_token) { throw new Error('The incoming JSON object does not contain a refresh_token field'); } this._clientId = json.client_id; this._clientSecret = json.client_secret; this._refreshToken = json.refresh_token; this.credentials.refresh_token = json.refresh_token; this.quotaProjectId = json.quota_project_id; } fromStream(inputStream, callback) { if (callback) { this.fromStreamAsync(inputStream).then(() => callback(), callback); } else { return this.fromStreamAsync(inputStream); } } async fromStreamAsync(inputStream) { return new Promise((resolve, reject) => { if (!inputStream) { return reject(new Error('Must pass in a stream containing the user refresh token.')); } let s = ''; inputStream .setEncoding('utf8') .on('error', reject) .on('data', chunk => (s += chunk)) .on('end', () => { try { const data = JSON.parse(s); this.fromJSON(data); return resolve(); } catch (err) { return reject(err); } }); }); } } exports.UserRefreshClient = UserRefreshClient; //# sourceMappingURL=refreshclient.js.map /***/ }), /***/ 86308: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StsCredentials = void 0; const querystring = __webpack_require__(71191); const transporters_1 = __webpack_require__(72649); const oauth2common_1 = __webpack_require__(19510); /** * Implements the OAuth 2.0 token exchange based on * https://tools.ietf.org/html/rfc8693 */ class StsCredentials extends oauth2common_1.OAuthClientAuthHandler { /** * Initializes an STS credentials instance. * @param tokenExchangeEndpoint The token exchange endpoint. * @param clientAuthentication The client authentication credentials if * available. */ constructor(tokenExchangeEndpoint, clientAuthentication) { super(clientAuthentication); this.tokenExchangeEndpoint = tokenExchangeEndpoint; this.transporter = new transporters_1.DefaultTransporter(); } /** * Exchanges the provided token for another type of token based on the * rfc8693 spec. * @param stsCredentialsOptions The token exchange options used to populate * the token exchange request. * @param additionalHeaders Optional additional headers to pass along the * request. * @param options Optional additional GCP-specific non-spec defined options * to send with the request. * Example: `&options=${encodeUriComponent(JSON.stringified(options))}` * @return A promise that resolves with the token exchange response containing * the requested token and its expiration time. */ async exchangeToken(stsCredentialsOptions, additionalHeaders, // eslint-disable-next-line @typescript-eslint/no-explicit-any options) { var _a, _b, _c; const values = { grant_type: stsCredentialsOptions.grantType, resource: stsCredentialsOptions.resource, audience: stsCredentialsOptions.audience, scope: (_a = stsCredentialsOptions.scope) === null || _a === void 0 ? void 0 : _a.join(' '), requested_token_type: stsCredentialsOptions.requestedTokenType, subject_token: stsCredentialsOptions.subjectToken, subject_token_type: stsCredentialsOptions.subjectTokenType, actor_token: (_b = stsCredentialsOptions.actingParty) === null || _b === void 0 ? void 0 : _b.actorToken, actor_token_type: (_c = stsCredentialsOptions.actingParty) === null || _c === void 0 ? void 0 : _c.actorTokenType, // Non-standard GCP-specific options. options: options && JSON.stringify(options), }; // Remove undefined fields. Object.keys(values).forEach(key => { // eslint-disable-next-line @typescript-eslint/no-explicit-any if (typeof values[key] === 'undefined') { // eslint-disable-next-line @typescript-eslint/no-explicit-any delete values[key]; } }); const headers = { 'Content-Type': 'application/x-www-form-urlencoded', }; // Inject additional STS headers if available. Object.assign(headers, additionalHeaders || {}); const opts = { url: this.tokenExchangeEndpoint, method: 'POST', headers, data: querystring.stringify(values), responseType: 'json', }; // Apply OAuth client authentication. this.applyClientAuthenticationOptions(opts); try { const response = await this.transporter.request(opts); // Successful response. const stsSuccessfulResponse = response.data; stsSuccessfulResponse.res = response; return stsSuccessfulResponse; } catch (error) { // Translate error to OAuthError. if (error.response) { throw oauth2common_1.getErrorFromOAuthErrorResponse(error.response.data, // Preserve other fields from the original error. error); } // Request could fail before the server responds. throw error; } } } exports.StsCredentials = StsCredentials; //# sourceMappingURL=stscredentials.js.map /***/ }), /***/ 14693: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /* global window */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BrowserCrypto = void 0; // This file implements crypto functions we need using in-browser // SubtleCrypto interface `window.crypto.subtle`. const base64js = __webpack_require__(26463); // Not all browsers support `TextEncoder`. The following `require` will // provide a fast UTF8-only replacement for those browsers that don't support // text encoding natively. // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof process === 'undefined' && typeof TextEncoder === 'undefined') { __webpack_require__(21917); } const crypto_1 = __webpack_require__(78043); class BrowserCrypto { constructor() { if (typeof window === 'undefined' || window.crypto === undefined || window.crypto.subtle === undefined) { throw new Error("SubtleCrypto not found. Make sure it's an https:// website."); } } async sha256DigestBase64(str) { // SubtleCrypto digest() method is async, so we must make // this method async as well. // To calculate SHA256 digest using SubtleCrypto, we first // need to convert an input string to an ArrayBuffer: // eslint-disable-next-line node/no-unsupported-features/node-builtins const inputBuffer = new TextEncoder().encode(str); // Result is ArrayBuffer as well. const outputBuffer = await window.crypto.subtle.digest('SHA-256', inputBuffer); return base64js.fromByteArray(new Uint8Array(outputBuffer)); } randomBytesBase64(count) { const array = new Uint8Array(count); window.crypto.getRandomValues(array); return base64js.fromByteArray(array); } static padBase64(base64) { // base64js requires padding, so let's add some '=' while (base64.length % 4 !== 0) { base64 += '='; } return base64; } async verify(pubkey, data, signature) { const algo = { name: 'RSASSA-PKCS1-v1_5', hash: { name: 'SHA-256' }, }; // eslint-disable-next-line node/no-unsupported-features/node-builtins const dataArray = new TextEncoder().encode(data); const signatureArray = base64js.toByteArray(BrowserCrypto.padBase64(signature)); const cryptoKey = await window.crypto.subtle.importKey('jwk', pubkey, algo, true, ['verify']); // SubtleCrypto's verify method is async so we must make // this method async as well. const result = await window.crypto.subtle.verify(algo, cryptoKey, signatureArray, dataArray); return result; } async sign(privateKey, data) { const algo = { name: 'RSASSA-PKCS1-v1_5', hash: { name: 'SHA-256' }, }; // eslint-disable-next-line node/no-unsupported-features/node-builtins const dataArray = new TextEncoder().encode(data); const cryptoKey = await window.crypto.subtle.importKey('jwk', privateKey, algo, true, ['sign']); // SubtleCrypto's sign method is async so we must make // this method async as well. const result = await window.crypto.subtle.sign(algo, cryptoKey, dataArray); return base64js.fromByteArray(new Uint8Array(result)); } decodeBase64StringUtf8(base64) { const uint8array = base64js.toByteArray(BrowserCrypto.padBase64(base64)); // eslint-disable-next-line node/no-unsupported-features/node-builtins const result = new TextDecoder().decode(uint8array); return result; } encodeBase64StringUtf8(text) { // eslint-disable-next-line node/no-unsupported-features/node-builtins const uint8array = new TextEncoder().encode(text); const result = base64js.fromByteArray(uint8array); return result; } /** * Computes the SHA-256 hash of the provided string. * @param str The plain text string to hash. * @return A promise that resolves with the SHA-256 hash of the provided * string in hexadecimal encoding. */ async sha256DigestHex(str) { // SubtleCrypto digest() method is async, so we must make // this method async as well. // To calculate SHA256 digest using SubtleCrypto, we first // need to convert an input string to an ArrayBuffer: // eslint-disable-next-line node/no-unsupported-features/node-builtins const inputBuffer = new TextEncoder().encode(str); // Result is ArrayBuffer as well. const outputBuffer = await window.crypto.subtle.digest('SHA-256', inputBuffer); return crypto_1.fromArrayBufferToHex(outputBuffer); } /** * Computes the HMAC hash of a message using the provided crypto key and the * SHA-256 algorithm. * @param key The secret crypto key in utf-8 or ArrayBuffer format. * @param msg The plain text message. * @return A promise that resolves with the HMAC-SHA256 hash in ArrayBuffer * format. */ async signWithHmacSha256(key, msg) { // Convert key, if provided in ArrayBuffer format, to string. const rawKey = typeof key === 'string' ? key : String.fromCharCode(...new Uint16Array(key)); // eslint-disable-next-line node/no-unsupported-features/node-builtins const enc = new TextEncoder(); const cryptoKey = await window.crypto.subtle.importKey('raw', enc.encode(rawKey), { name: 'HMAC', hash: { name: 'SHA-256', }, }, false, ['sign']); return window.crypto.subtle.sign('HMAC', cryptoKey, enc.encode(msg)); } } exports.BrowserCrypto = BrowserCrypto; //# sourceMappingURL=crypto.js.map /***/ }), /***/ 78043: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /* global window */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fromArrayBufferToHex = exports.hasBrowserCrypto = exports.createCrypto = void 0; const crypto_1 = __webpack_require__(14693); const crypto_2 = __webpack_require__(30757); function createCrypto() { if (hasBrowserCrypto()) { return new crypto_1.BrowserCrypto(); } return new crypto_2.NodeCrypto(); } exports.createCrypto = createCrypto; function hasBrowserCrypto() { return (typeof window !== 'undefined' && typeof window.crypto !== 'undefined' && typeof window.crypto.subtle !== 'undefined'); } exports.hasBrowserCrypto = hasBrowserCrypto; /** * Converts an ArrayBuffer to a hexadecimal string. * @param arrayBuffer The ArrayBuffer to convert to hexadecimal string. * @return The hexadecimal encoding of the ArrayBuffer. */ function fromArrayBufferToHex(arrayBuffer) { // Convert buffer to byte array. const byteArray = Array.from(new Uint8Array(arrayBuffer)); // Convert bytes to hex string. return byteArray .map(byte => { return byte.toString(16).padStart(2, '0'); }) .join(''); } exports.fromArrayBufferToHex = fromArrayBufferToHex; //# sourceMappingURL=crypto.js.map /***/ }), /***/ 30757: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NodeCrypto = void 0; const crypto = __webpack_require__(76417); class NodeCrypto { async sha256DigestBase64(str) { return crypto.createHash('sha256').update(str).digest('base64'); } randomBytesBase64(count) { return crypto.randomBytes(count).toString('base64'); } async verify(pubkey, data, signature) { const verifier = crypto.createVerify('sha256'); verifier.update(data); verifier.end(); return verifier.verify(pubkey, signature, 'base64'); } async sign(privateKey, data) { const signer = crypto.createSign('RSA-SHA256'); signer.update(data); signer.end(); return signer.sign(privateKey, 'base64'); } decodeBase64StringUtf8(base64) { return Buffer.from(base64, 'base64').toString('utf-8'); } encodeBase64StringUtf8(text) { return Buffer.from(text, 'utf-8').toString('base64'); } /** * Computes the SHA-256 hash of the provided string. * @param str The plain text string to hash. * @return A promise that resolves with the SHA-256 hash of the provided * string in hexadecimal encoding. */ async sha256DigestHex(str) { return crypto.createHash('sha256').update(str).digest('hex'); } /** * Computes the HMAC hash of a message using the provided crypto key and the * SHA-256 algorithm. * @param key The secret crypto key in utf-8 or ArrayBuffer format. * @param msg The plain text message. * @return A promise that resolves with the HMAC-SHA256 hash in ArrayBuffer * format. */ async signWithHmacSha256(key, msg) { const cryptoKey = typeof key === 'string' ? key : toBuffer(key); return toArrayBuffer(crypto.createHmac('sha256', cryptoKey).update(msg).digest()); } } exports.NodeCrypto = NodeCrypto; /** * Converts a Node.js Buffer to an ArrayBuffer. * https://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer * @param buffer The Buffer input to covert. * @return The ArrayBuffer representation of the input. */ function toArrayBuffer(buffer) { return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength); } /** * Converts an ArrayBuffer to a Node.js Buffer. * @param arrayBuffer The ArrayBuffer input to covert. * @return The Buffer representation of the input. */ function toBuffer(arrayBuffer) { return Buffer.from(arrayBuffer); } //# sourceMappingURL=crypto.js.map /***/ }), /***/ 20810: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GoogleAuth = exports.auth = void 0; // Copyright 2017 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. const googleauth_1 = __webpack_require__(20695); Object.defineProperty(exports, "GoogleAuth", ({ enumerable: true, get: function () { return googleauth_1.GoogleAuth; } })); var computeclient_1 = __webpack_require__(96875); Object.defineProperty(exports, "Compute", ({ enumerable: true, get: function () { return computeclient_1.Compute; } })); var envDetect_1 = __webpack_require__(21380); Object.defineProperty(exports, "GCPEnv", ({ enumerable: true, get: function () { return envDetect_1.GCPEnv; } })); var iam_1 = __webpack_require__(39735); Object.defineProperty(exports, "IAMAuth", ({ enumerable: true, get: function () { return iam_1.IAMAuth; } })); var idtokenclient_1 = __webpack_require__(80298); Object.defineProperty(exports, "IdTokenClient", ({ enumerable: true, get: function () { return idtokenclient_1.IdTokenClient; } })); var jwtaccess_1 = __webpack_require__(68740); Object.defineProperty(exports, "JWTAccess", ({ enumerable: true, get: function () { return jwtaccess_1.JWTAccess; } })); var jwtclient_1 = __webpack_require__(13959); Object.defineProperty(exports, "JWT", ({ enumerable: true, get: function () { return jwtclient_1.JWT; } })); var impersonated_1 = __webpack_require__(91103); Object.defineProperty(exports, "Impersonated", ({ enumerable: true, get: function () { return impersonated_1.Impersonated; } })); var oauth2client_1 = __webpack_require__(3936); Object.defineProperty(exports, "CodeChallengeMethod", ({ enumerable: true, get: function () { return oauth2client_1.CodeChallengeMethod; } })); Object.defineProperty(exports, "OAuth2Client", ({ enumerable: true, get: function () { return oauth2client_1.OAuth2Client; } })); var loginticket_1 = __webpack_require__(74524); Object.defineProperty(exports, "LoginTicket", ({ enumerable: true, get: function () { return loginticket_1.LoginTicket; } })); var refreshclient_1 = __webpack_require__(98790); Object.defineProperty(exports, "UserRefreshClient", ({ enumerable: true, get: function () { return refreshclient_1.UserRefreshClient; } })); var awsclient_1 = __webpack_require__(71569); Object.defineProperty(exports, "AwsClient", ({ enumerable: true, get: function () { return awsclient_1.AwsClient; } })); var identitypoolclient_1 = __webpack_require__(20117); Object.defineProperty(exports, "IdentityPoolClient", ({ enumerable: true, get: function () { return identitypoolclient_1.IdentityPoolClient; } })); var externalclient_1 = __webpack_require__(94381); Object.defineProperty(exports, "ExternalAccountClient", ({ enumerable: true, get: function () { return externalclient_1.ExternalAccountClient; } })); var baseexternalclient_1 = __webpack_require__(40810); Object.defineProperty(exports, "BaseExternalAccountClient", ({ enumerable: true, get: function () { return baseexternalclient_1.BaseExternalAccountClient; } })); var downscopedclient_1 = __webpack_require__(6270); Object.defineProperty(exports, "DownscopedClient", ({ enumerable: true, get: function () { return downscopedclient_1.DownscopedClient; } })); var transporters_1 = __webpack_require__(72649); Object.defineProperty(exports, "DefaultTransporter", ({ enumerable: true, get: function () { return transporters_1.DefaultTransporter; } })); const auth = new googleauth_1.GoogleAuth(); exports.auth = auth; //# sourceMappingURL=index.js.map /***/ }), /***/ 16608: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2017 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validate = void 0; // Accepts an options object passed from the user to the API. In the // previous version of the API, it referred to a `Request` options object. // Now it refers to an Axiox Request Config object. This is here to help // ensure users don't pass invalid options when they upgrade from 0.x to 1.x. // eslint-disable-next-line @typescript-eslint/no-explicit-any function validate(options) { const vpairs = [ { invalid: 'uri', expected: 'url' }, { invalid: 'json', expected: 'data' }, { invalid: 'qs', expected: 'params' }, ]; for (const pair of vpairs) { if (options[pair.invalid]) { const e = `'${pair.invalid}' is not a valid configuration option. Please use '${pair.expected}' instead. This library is using Axios for requests. Please see https://github.com/axios/axios to learn more about the valid request options.`; throw new Error(e); } } } exports.validate = validate; //# sourceMappingURL=options.js.map /***/ }), /***/ 72649: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DefaultTransporter = void 0; const gaxios_1 = __webpack_require__(59555); const options_1 = __webpack_require__(16608); // eslint-disable-next-line @typescript-eslint/no-var-requires const pkg = __webpack_require__(85477); const PRODUCT_NAME = 'google-api-nodejs-client'; class DefaultTransporter { /** * Configures request options before making a request. * @param opts GaxiosOptions options. * @return Configured options. */ configure(opts = {}) { opts.headers = opts.headers || {}; if (typeof window === 'undefined') { // set transporter user agent if not in browser const uaValue = opts.headers['User-Agent']; if (!uaValue) { opts.headers['User-Agent'] = DefaultTransporter.USER_AGENT; } else if (!uaValue.includes(`${PRODUCT_NAME}/`)) { opts.headers['User-Agent'] = `${uaValue} ${DefaultTransporter.USER_AGENT}`; } // track google-auth-library-nodejs version: const authVersion = `auth/${pkg.version}`; if (opts.headers['x-goog-api-client'] && !opts.headers['x-goog-api-client'].includes(authVersion)) { opts.headers['x-goog-api-client'] = `${opts.headers['x-goog-api-client']} ${authVersion}`; } else if (!opts.headers['x-goog-api-client']) { const nodeVersion = process.version.replace(/^v/, ''); opts.headers['x-goog-api-client'] = `gl-node/${nodeVersion} ${authVersion}`; } } return opts; } request(opts, callback) { // ensure the user isn't passing in request-style options opts = this.configure(opts); try { options_1.validate(opts); } catch (e) { if (callback) { return callback(e); } else { throw e; } } if (callback) { gaxios_1.request(opts).then(r => { callback(null, r); }, e => { callback(this.processError(e)); }); } else { return gaxios_1.request(opts).catch(e => { throw this.processError(e); }); } } /** * Changes the error to include details from the body. */ processError(e) { const res = e.response; const err = e; const body = res ? res.data : null; if (res && body && body.error && res.status !== 200) { if (typeof body.error === 'string') { err.message = body.error; err.code = res.status.toString(); } else if (Array.isArray(body.error.errors)) { err.message = body.error.errors .map((err2) => err2.message) .join('\n'); err.code = body.error.code; err.errors = body.error.errors; } else { err.message = body.error.message; err.code = body.error.code || res.status; } } else if (res && res.status >= 400) { // Consider all 4xx and 5xx responses errors. err.message = body; err.code = res.status.toString(); } return err; } } exports.DefaultTransporter = DefaultTransporter; /** * Default user agent. */ DefaultTransporter.USER_AGENT = `${PRODUCT_NAME}/${pkg.version}`; //# sourceMappingURL=transporters.js.map /***/ }), /***/ 83555: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ (function(global, factory) { /* global define, require, module */ /* AMD */ if (typeof define === 'function' && define.amd) define(["protobufjs/minimal"], factory); /* CommonJS */ else if ( true && module && module.exports) module.exports = factory(__webpack_require__(96916)); })(this, function($protobuf) { "use strict"; // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots.iam_protos || ($protobuf.roots.iam_protos = {}); $root.google = (function() { /** * Namespace google. * @exports google * @namespace */ var google = {}; google.iam = (function() { /** * Namespace iam. * @memberof google * @namespace */ var iam = {}; iam.v1 = (function() { /** * Namespace v1. * @memberof google.iam * @namespace */ var v1 = {}; v1.IAMPolicy = (function() { /** * Constructs a new IAMPolicy service. * @memberof google.iam.v1 * @classdesc Represents a IAMPolicy * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; /** * Creates new IAMPolicy service using the specified rpc implementation. * @function create * @memberof google.iam.v1.IAMPolicy * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. */ IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link google.iam.v1.IAMPolicy#setIamPolicy}. * @memberof google.iam.v1.IAMPolicy * @typedef SetIamPolicyCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.iam.v1.Policy} [response] Policy */ /** * Calls SetIamPolicy. * @function setIamPolicy * @memberof google.iam.v1.IAMPolicy * @instance * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy * @returns {undefined} * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "SetIamPolicy" }); /** * Calls SetIamPolicy. * @function setIamPolicy * @memberof google.iam.v1.IAMPolicy * @instance * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.iam.v1.IAMPolicy#getIamPolicy}. * @memberof google.iam.v1.IAMPolicy * @typedef GetIamPolicyCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.iam.v1.Policy} [response] Policy */ /** * Calls GetIamPolicy. * @function getIamPolicy * @memberof google.iam.v1.IAMPolicy * @instance * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy * @returns {undefined} * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "GetIamPolicy" }); /** * Calls GetIamPolicy. * @function getIamPolicy * @memberof google.iam.v1.IAMPolicy * @instance * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.iam.v1.IAMPolicy#testIamPermissions}. * @memberof google.iam.v1.IAMPolicy * @typedef TestIamPermissionsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse */ /** * Calls TestIamPermissions. * @function testIamPermissions * @memberof google.iam.v1.IAMPolicy * @instance * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); }, "name", { value: "TestIamPermissions" }); /** * Calls TestIamPermissions. * @function testIamPermissions * @memberof google.iam.v1.IAMPolicy * @instance * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ return IAMPolicy; })(); v1.SetIamPolicyRequest = (function() { /** * Properties of a SetIamPolicyRequest. * @memberof google.iam.v1 * @interface ISetIamPolicyRequest * @property {string|null} [resource] SetIamPolicyRequest resource * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy */ /** * Constructs a new SetIamPolicyRequest. * @memberof google.iam.v1 * @classdesc Represents a SetIamPolicyRequest. * @implements ISetIamPolicyRequest * @constructor * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set */ function SetIamPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SetIamPolicyRequest resource. * @member {string} resource * @memberof google.iam.v1.SetIamPolicyRequest * @instance */ SetIamPolicyRequest.prototype.resource = ""; /** * SetIamPolicyRequest policy. * @member {google.iam.v1.IPolicy|null|undefined} policy * @memberof google.iam.v1.SetIamPolicyRequest * @instance */ SetIamPolicyRequest.prototype.policy = null; /** * Creates a new SetIamPolicyRequest instance using the specified properties. * @function create * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance */ SetIamPolicyRequest.create = function create(properties) { return new SetIamPolicyRequest(properties); }; /** * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. * @function encode * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SetIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SetIamPolicyRequest message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SetIamPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.resource = reader.string(); break; case 2: message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SetIamPolicyRequest message. * @function verify * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SetIamPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.resource != null && message.hasOwnProperty("resource")) if (!$util.isString(message.resource)) return "resource: string expected"; if (message.policy != null && message.hasOwnProperty("policy")) { var error = $root.google.iam.v1.Policy.verify(message.policy); if (error) return "policy." + error; } return null; }; /** * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {Object.} object Plain object * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest */ SetIamPolicyRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) return object; var message = new $root.google.iam.v1.SetIamPolicyRequest(); if (object.resource != null) message.resource = String(object.resource); if (object.policy != null) { if (typeof object.policy !== "object") throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); } return message; }; /** * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.SetIamPolicyRequest * @static * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ SetIamPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.resource = ""; object.policy = null; } if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; if (message.policy != null && message.hasOwnProperty("policy")) object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); return object; }; /** * Converts this SetIamPolicyRequest to JSON. * @function toJSON * @memberof google.iam.v1.SetIamPolicyRequest * @instance * @returns {Object.} JSON object */ SetIamPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return SetIamPolicyRequest; })(); v1.GetIamPolicyRequest = (function() { /** * Properties of a GetIamPolicyRequest. * @memberof google.iam.v1 * @interface IGetIamPolicyRequest * @property {string|null} [resource] GetIamPolicyRequest resource * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options */ /** * Constructs a new GetIamPolicyRequest. * @memberof google.iam.v1 * @classdesc Represents a GetIamPolicyRequest. * @implements IGetIamPolicyRequest * @constructor * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set */ function GetIamPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetIamPolicyRequest resource. * @member {string} resource * @memberof google.iam.v1.GetIamPolicyRequest * @instance */ GetIamPolicyRequest.prototype.resource = ""; /** * GetIamPolicyRequest options. * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options * @memberof google.iam.v1.GetIamPolicyRequest * @instance */ GetIamPolicyRequest.prototype.options = null; /** * Creates a new GetIamPolicyRequest instance using the specified properties. * @function create * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance */ GetIamPolicyRequest.create = function create(properties) { return new GetIamPolicyRequest(properties); }; /** * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. * @function encode * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetIamPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetIamPolicyRequest message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetIamPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.resource = reader.string(); break; case 2: message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetIamPolicyRequest message. * @function verify * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetIamPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.resource != null && message.hasOwnProperty("resource")) if (!$util.isString(message.resource)) return "resource: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {Object.} object Plain object * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest */ GetIamPolicyRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) return object; var message = new $root.google.iam.v1.GetIamPolicyRequest(); if (object.resource != null) message.resource = String(object.resource); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.GetIamPolicyRequest * @static * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetIamPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.resource = ""; object.options = null; } if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); return object; }; /** * Converts this GetIamPolicyRequest to JSON. * @function toJSON * @memberof google.iam.v1.GetIamPolicyRequest * @instance * @returns {Object.} JSON object */ GetIamPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetIamPolicyRequest; })(); v1.TestIamPermissionsRequest = (function() { /** * Properties of a TestIamPermissionsRequest. * @memberof google.iam.v1 * @interface ITestIamPermissionsRequest * @property {string|null} [resource] TestIamPermissionsRequest resource * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions */ /** * Constructs a new TestIamPermissionsRequest. * @memberof google.iam.v1 * @classdesc Represents a TestIamPermissionsRequest. * @implements ITestIamPermissionsRequest * @constructor * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set */ function TestIamPermissionsRequest(properties) { this.permissions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * TestIamPermissionsRequest resource. * @member {string} resource * @memberof google.iam.v1.TestIamPermissionsRequest * @instance */ TestIamPermissionsRequest.prototype.resource = ""; /** * TestIamPermissionsRequest permissions. * @member {Array.} permissions * @memberof google.iam.v1.TestIamPermissionsRequest * @instance */ TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; /** * Creates a new TestIamPermissionsRequest instance using the specified properties. * @function create * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance */ TestIamPermissionsRequest.create = function create(properties) { return new TestIamPermissionsRequest(properties); }; /** * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. * @function encode * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ TestIamPermissionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); if (message.permissions != null && message.permissions.length) for (var i = 0; i < message.permissions.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); return writer; }; /** * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TestIamPermissionsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.resource = reader.string(); break; case 2: if (!(message.permissions && message.permissions.length)) message.permissions = []; message.permissions.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a TestIamPermissionsRequest message. * @function verify * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ TestIamPermissionsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.resource != null && message.hasOwnProperty("resource")) if (!$util.isString(message.resource)) return "resource: string expected"; if (message.permissions != null && message.hasOwnProperty("permissions")) { if (!Array.isArray(message.permissions)) return "permissions: array expected"; for (var i = 0; i < message.permissions.length; ++i) if (!$util.isString(message.permissions[i])) return "permissions: string[] expected"; } return null; }; /** * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {Object.} object Plain object * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest */ TestIamPermissionsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) return object; var message = new $root.google.iam.v1.TestIamPermissionsRequest(); if (object.resource != null) message.resource = String(object.resource); if (object.permissions) { if (!Array.isArray(object.permissions)) throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); message.permissions = []; for (var i = 0; i < object.permissions.length; ++i) message.permissions[i] = String(object.permissions[i]); } return message; }; /** * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.TestIamPermissionsRequest * @static * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ TestIamPermissionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.permissions = []; if (options.defaults) object.resource = ""; if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; if (message.permissions && message.permissions.length) { object.permissions = []; for (var j = 0; j < message.permissions.length; ++j) object.permissions[j] = message.permissions[j]; } return object; }; /** * Converts this TestIamPermissionsRequest to JSON. * @function toJSON * @memberof google.iam.v1.TestIamPermissionsRequest * @instance * @returns {Object.} JSON object */ TestIamPermissionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return TestIamPermissionsRequest; })(); v1.TestIamPermissionsResponse = (function() { /** * Properties of a TestIamPermissionsResponse. * @memberof google.iam.v1 * @interface ITestIamPermissionsResponse * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions */ /** * Constructs a new TestIamPermissionsResponse. * @memberof google.iam.v1 * @classdesc Represents a TestIamPermissionsResponse. * @implements ITestIamPermissionsResponse * @constructor * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set */ function TestIamPermissionsResponse(properties) { this.permissions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * TestIamPermissionsResponse permissions. * @member {Array.} permissions * @memberof google.iam.v1.TestIamPermissionsResponse * @instance */ TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; /** * Creates a new TestIamPermissionsResponse instance using the specified properties. * @function create * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance */ TestIamPermissionsResponse.create = function create(properties) { return new TestIamPermissionsResponse(properties); }; /** * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. * @function encode * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ TestIamPermissionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.permissions != null && message.permissions.length) for (var i = 0; i < message.permissions.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); return writer; }; /** * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TestIamPermissionsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.permissions && message.permissions.length)) message.permissions = []; message.permissions.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a TestIamPermissionsResponse message. * @function verify * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ TestIamPermissionsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.permissions != null && message.hasOwnProperty("permissions")) { if (!Array.isArray(message.permissions)) return "permissions: array expected"; for (var i = 0; i < message.permissions.length; ++i) if (!$util.isString(message.permissions[i])) return "permissions: string[] expected"; } return null; }; /** * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {Object.} object Plain object * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse */ TestIamPermissionsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) return object; var message = new $root.google.iam.v1.TestIamPermissionsResponse(); if (object.permissions) { if (!Array.isArray(object.permissions)) throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); message.permissions = []; for (var i = 0; i < object.permissions.length; ++i) message.permissions[i] = String(object.permissions[i]); } return message; }; /** * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.TestIamPermissionsResponse * @static * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ TestIamPermissionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.permissions = []; if (message.permissions && message.permissions.length) { object.permissions = []; for (var j = 0; j < message.permissions.length; ++j) object.permissions[j] = message.permissions[j]; } return object; }; /** * Converts this TestIamPermissionsResponse to JSON. * @function toJSON * @memberof google.iam.v1.TestIamPermissionsResponse * @instance * @returns {Object.} JSON object */ TestIamPermissionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return TestIamPermissionsResponse; })(); v1.GetPolicyOptions = (function() { /** * Properties of a GetPolicyOptions. * @memberof google.iam.v1 * @interface IGetPolicyOptions * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion */ /** * Constructs a new GetPolicyOptions. * @memberof google.iam.v1 * @classdesc Represents a GetPolicyOptions. * @implements IGetPolicyOptions * @constructor * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set */ function GetPolicyOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetPolicyOptions requestedPolicyVersion. * @member {number} requestedPolicyVersion * @memberof google.iam.v1.GetPolicyOptions * @instance */ GetPolicyOptions.prototype.requestedPolicyVersion = 0; /** * Creates a new GetPolicyOptions instance using the specified properties. * @function create * @memberof google.iam.v1.GetPolicyOptions * @static * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance */ GetPolicyOptions.create = function create(properties) { return new GetPolicyOptions(properties); }; /** * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. * @function encode * @memberof google.iam.v1.GetPolicyOptions * @static * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetPolicyOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); return writer; }; /** * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.GetPolicyOptions * @static * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetPolicyOptions message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.GetPolicyOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetPolicyOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.requestedPolicyVersion = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.GetPolicyOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetPolicyOptions message. * @function verify * @memberof google.iam.v1.GetPolicyOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetPolicyOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) if (!$util.isInteger(message.requestedPolicyVersion)) return "requestedPolicyVersion: integer expected"; return null; }; /** * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.GetPolicyOptions * @static * @param {Object.} object Plain object * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions */ GetPolicyOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.GetPolicyOptions) return object; var message = new $root.google.iam.v1.GetPolicyOptions(); if (object.requestedPolicyVersion != null) message.requestedPolicyVersion = object.requestedPolicyVersion | 0; return message; }; /** * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.GetPolicyOptions * @static * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetPolicyOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.requestedPolicyVersion = 0; if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) object.requestedPolicyVersion = message.requestedPolicyVersion; return object; }; /** * Converts this GetPolicyOptions to JSON. * @function toJSON * @memberof google.iam.v1.GetPolicyOptions * @instance * @returns {Object.} JSON object */ GetPolicyOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetPolicyOptions; })(); v1.Policy = (function() { /** * Properties of a Policy. * @memberof google.iam.v1 * @interface IPolicy * @property {number|null} [version] Policy version * @property {Array.|null} [bindings] Policy bindings * @property {Uint8Array|null} [etag] Policy etag */ /** * Constructs a new Policy. * @memberof google.iam.v1 * @classdesc Represents a Policy. * @implements IPolicy * @constructor * @param {google.iam.v1.IPolicy=} [properties] Properties to set */ function Policy(properties) { this.bindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Policy version. * @member {number} version * @memberof google.iam.v1.Policy * @instance */ Policy.prototype.version = 0; /** * Policy bindings. * @member {Array.} bindings * @memberof google.iam.v1.Policy * @instance */ Policy.prototype.bindings = $util.emptyArray; /** * Policy etag. * @member {Uint8Array} etag * @memberof google.iam.v1.Policy * @instance */ Policy.prototype.etag = $util.newBuffer([]); /** * Creates a new Policy instance using the specified properties. * @function create * @memberof google.iam.v1.Policy * @static * @param {google.iam.v1.IPolicy=} [properties] Properties to set * @returns {google.iam.v1.Policy} Policy instance */ Policy.create = function create(properties) { return new Policy(properties); }; /** * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. * @function encode * @memberof google.iam.v1.Policy * @static * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Policy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); if (message.bindings != null && message.bindings.length) for (var i = 0; i < message.bindings.length; ++i) $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.Policy * @static * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Policy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Policy message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.Policy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.Policy} Policy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Policy.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.version = reader.int32(); break; case 4: if (!(message.bindings && message.bindings.length)) message.bindings = []; message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); break; case 3: message.etag = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Policy message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.Policy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.Policy} Policy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Policy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Policy message. * @function verify * @memberof google.iam.v1.Policy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Policy.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.version != null && message.hasOwnProperty("version")) if (!$util.isInteger(message.version)) return "version: integer expected"; if (message.bindings != null && message.hasOwnProperty("bindings")) { if (!Array.isArray(message.bindings)) return "bindings: array expected"; for (var i = 0; i < message.bindings.length; ++i) { var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); if (error) return "bindings." + error; } } if (message.etag != null && message.hasOwnProperty("etag")) if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) return "etag: buffer expected"; return null; }; /** * Creates a Policy message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.Policy * @static * @param {Object.} object Plain object * @returns {google.iam.v1.Policy} Policy */ Policy.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.Policy) return object; var message = new $root.google.iam.v1.Policy(); if (object.version != null) message.version = object.version | 0; if (object.bindings) { if (!Array.isArray(object.bindings)) throw TypeError(".google.iam.v1.Policy.bindings: array expected"); message.bindings = []; for (var i = 0; i < object.bindings.length; ++i) { if (typeof object.bindings[i] !== "object") throw TypeError(".google.iam.v1.Policy.bindings: object expected"); message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); } } if (object.etag != null) if (typeof object.etag === "string") $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); else if (object.etag.length) message.etag = object.etag; return message; }; /** * Creates a plain object from a Policy message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.Policy * @static * @param {google.iam.v1.Policy} message Policy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Policy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.bindings = []; if (options.defaults) { object.version = 0; if (options.bytes === String) object.etag = ""; else { object.etag = []; if (options.bytes !== Array) object.etag = $util.newBuffer(object.etag); } } if (message.version != null && message.hasOwnProperty("version")) object.version = message.version; if (message.etag != null && message.hasOwnProperty("etag")) object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; if (message.bindings && message.bindings.length) { object.bindings = []; for (var j = 0; j < message.bindings.length; ++j) object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); } return object; }; /** * Converts this Policy to JSON. * @function toJSON * @memberof google.iam.v1.Policy * @instance * @returns {Object.} JSON object */ Policy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Policy; })(); v1.Binding = (function() { /** * Properties of a Binding. * @memberof google.iam.v1 * @interface IBinding * @property {string|null} [role] Binding role * @property {Array.|null} [members] Binding members * @property {google.type.IExpr|null} [condition] Binding condition */ /** * Constructs a new Binding. * @memberof google.iam.v1 * @classdesc Represents a Binding. * @implements IBinding * @constructor * @param {google.iam.v1.IBinding=} [properties] Properties to set */ function Binding(properties) { this.members = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Binding role. * @member {string} role * @memberof google.iam.v1.Binding * @instance */ Binding.prototype.role = ""; /** * Binding members. * @member {Array.} members * @memberof google.iam.v1.Binding * @instance */ Binding.prototype.members = $util.emptyArray; /** * Binding condition. * @member {google.type.IExpr|null|undefined} condition * @memberof google.iam.v1.Binding * @instance */ Binding.prototype.condition = null; /** * Creates a new Binding instance using the specified properties. * @function create * @memberof google.iam.v1.Binding * @static * @param {google.iam.v1.IBinding=} [properties] Properties to set * @returns {google.iam.v1.Binding} Binding instance */ Binding.create = function create(properties) { return new Binding(properties); }; /** * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. * @function encode * @memberof google.iam.v1.Binding * @static * @param {google.iam.v1.IBinding} message Binding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Binding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); if (message.members != null && message.members.length) for (var i = 0; i < message.members.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.Binding * @static * @param {google.iam.v1.IBinding} message Binding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Binding.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Binding message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.Binding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.Binding} Binding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Binding.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.role = reader.string(); break; case 2: if (!(message.members && message.members.length)) message.members = []; message.members.push(reader.string()); break; case 3: message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Binding message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.Binding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.Binding} Binding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Binding.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Binding message. * @function verify * @memberof google.iam.v1.Binding * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Binding.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.role != null && message.hasOwnProperty("role")) if (!$util.isString(message.role)) return "role: string expected"; if (message.members != null && message.hasOwnProperty("members")) { if (!Array.isArray(message.members)) return "members: array expected"; for (var i = 0; i < message.members.length; ++i) if (!$util.isString(message.members[i])) return "members: string[] expected"; } if (message.condition != null && message.hasOwnProperty("condition")) { var error = $root.google.type.Expr.verify(message.condition); if (error) return "condition." + error; } return null; }; /** * Creates a Binding message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.Binding * @static * @param {Object.} object Plain object * @returns {google.iam.v1.Binding} Binding */ Binding.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.Binding) return object; var message = new $root.google.iam.v1.Binding(); if (object.role != null) message.role = String(object.role); if (object.members) { if (!Array.isArray(object.members)) throw TypeError(".google.iam.v1.Binding.members: array expected"); message.members = []; for (var i = 0; i < object.members.length; ++i) message.members[i] = String(object.members[i]); } if (object.condition != null) { if (typeof object.condition !== "object") throw TypeError(".google.iam.v1.Binding.condition: object expected"); message.condition = $root.google.type.Expr.fromObject(object.condition); } return message; }; /** * Creates a plain object from a Binding message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.Binding * @static * @param {google.iam.v1.Binding} message Binding * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Binding.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.members = []; if (options.defaults) { object.role = ""; object.condition = null; } if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; if (message.members && message.members.length) { object.members = []; for (var j = 0; j < message.members.length; ++j) object.members[j] = message.members[j]; } if (message.condition != null && message.hasOwnProperty("condition")) object.condition = $root.google.type.Expr.toObject(message.condition, options); return object; }; /** * Converts this Binding to JSON. * @function toJSON * @memberof google.iam.v1.Binding * @instance * @returns {Object.} JSON object */ Binding.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Binding; })(); v1.PolicyDelta = (function() { /** * Properties of a PolicyDelta. * @memberof google.iam.v1 * @interface IPolicyDelta * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas */ /** * Constructs a new PolicyDelta. * @memberof google.iam.v1 * @classdesc Represents a PolicyDelta. * @implements IPolicyDelta * @constructor * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set */ function PolicyDelta(properties) { this.bindingDeltas = []; this.auditConfigDeltas = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * PolicyDelta bindingDeltas. * @member {Array.} bindingDeltas * @memberof google.iam.v1.PolicyDelta * @instance */ PolicyDelta.prototype.bindingDeltas = $util.emptyArray; /** * PolicyDelta auditConfigDeltas. * @member {Array.} auditConfigDeltas * @memberof google.iam.v1.PolicyDelta * @instance */ PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; /** * Creates a new PolicyDelta instance using the specified properties. * @function create * @memberof google.iam.v1.PolicyDelta * @static * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance */ PolicyDelta.create = function create(properties) { return new PolicyDelta(properties); }; /** * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. * @function encode * @memberof google.iam.v1.PolicyDelta * @static * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PolicyDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.bindingDeltas != null && message.bindingDeltas.length) for (var i = 0; i < message.bindingDeltas.length; ++i) $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) for (var i = 0; i < message.auditConfigDeltas.length; ++i) $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.PolicyDelta * @static * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a PolicyDelta message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.PolicyDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.PolicyDelta} PolicyDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PolicyDelta.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.bindingDeltas && message.bindingDeltas.length)) message.bindingDeltas = []; message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); break; case 2: if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) message.auditConfigDeltas = []; message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.PolicyDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.PolicyDelta} PolicyDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PolicyDelta.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a PolicyDelta message. * @function verify * @memberof google.iam.v1.PolicyDelta * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PolicyDelta.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { if (!Array.isArray(message.bindingDeltas)) return "bindingDeltas: array expected"; for (var i = 0; i < message.bindingDeltas.length; ++i) { var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); if (error) return "bindingDeltas." + error; } } if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { if (!Array.isArray(message.auditConfigDeltas)) return "auditConfigDeltas: array expected"; for (var i = 0; i < message.auditConfigDeltas.length; ++i) { var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); if (error) return "auditConfigDeltas." + error; } } return null; }; /** * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.PolicyDelta * @static * @param {Object.} object Plain object * @returns {google.iam.v1.PolicyDelta} PolicyDelta */ PolicyDelta.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.PolicyDelta) return object; var message = new $root.google.iam.v1.PolicyDelta(); if (object.bindingDeltas) { if (!Array.isArray(object.bindingDeltas)) throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); message.bindingDeltas = []; for (var i = 0; i < object.bindingDeltas.length; ++i) { if (typeof object.bindingDeltas[i] !== "object") throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); } } if (object.auditConfigDeltas) { if (!Array.isArray(object.auditConfigDeltas)) throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); message.auditConfigDeltas = []; for (var i = 0; i < object.auditConfigDeltas.length; ++i) { if (typeof object.auditConfigDeltas[i] !== "object") throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); } } return message; }; /** * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.PolicyDelta * @static * @param {google.iam.v1.PolicyDelta} message PolicyDelta * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ PolicyDelta.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.bindingDeltas = []; object.auditConfigDeltas = []; } if (message.bindingDeltas && message.bindingDeltas.length) { object.bindingDeltas = []; for (var j = 0; j < message.bindingDeltas.length; ++j) object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); } if (message.auditConfigDeltas && message.auditConfigDeltas.length) { object.auditConfigDeltas = []; for (var j = 0; j < message.auditConfigDeltas.length; ++j) object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); } return object; }; /** * Converts this PolicyDelta to JSON. * @function toJSON * @memberof google.iam.v1.PolicyDelta * @instance * @returns {Object.} JSON object */ PolicyDelta.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return PolicyDelta; })(); v1.BindingDelta = (function() { /** * Properties of a BindingDelta. * @memberof google.iam.v1 * @interface IBindingDelta * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action * @property {string|null} [role] BindingDelta role * @property {string|null} [member] BindingDelta member * @property {google.type.IExpr|null} [condition] BindingDelta condition */ /** * Constructs a new BindingDelta. * @memberof google.iam.v1 * @classdesc Represents a BindingDelta. * @implements IBindingDelta * @constructor * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set */ function BindingDelta(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * BindingDelta action. * @member {google.iam.v1.BindingDelta.Action} action * @memberof google.iam.v1.BindingDelta * @instance */ BindingDelta.prototype.action = 0; /** * BindingDelta role. * @member {string} role * @memberof google.iam.v1.BindingDelta * @instance */ BindingDelta.prototype.role = ""; /** * BindingDelta member. * @member {string} member * @memberof google.iam.v1.BindingDelta * @instance */ BindingDelta.prototype.member = ""; /** * BindingDelta condition. * @member {google.type.IExpr|null|undefined} condition * @memberof google.iam.v1.BindingDelta * @instance */ BindingDelta.prototype.condition = null; /** * Creates a new BindingDelta instance using the specified properties. * @function create * @memberof google.iam.v1.BindingDelta * @static * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set * @returns {google.iam.v1.BindingDelta} BindingDelta instance */ BindingDelta.create = function create(properties) { return new BindingDelta(properties); }; /** * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. * @function encode * @memberof google.iam.v1.BindingDelta * @static * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BindingDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); if (message.member != null && Object.hasOwnProperty.call(message, "member")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.BindingDelta * @static * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a BindingDelta message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.BindingDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.BindingDelta} BindingDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BindingDelta.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.action = reader.int32(); break; case 2: message.role = reader.string(); break; case 3: message.member = reader.string(); break; case 4: message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a BindingDelta message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.BindingDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.BindingDelta} BindingDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BindingDelta.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a BindingDelta message. * @function verify * @memberof google.iam.v1.BindingDelta * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ BindingDelta.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.action != null && message.hasOwnProperty("action")) switch (message.action) { default: return "action: enum value expected"; case 0: case 1: case 2: break; } if (message.role != null && message.hasOwnProperty("role")) if (!$util.isString(message.role)) return "role: string expected"; if (message.member != null && message.hasOwnProperty("member")) if (!$util.isString(message.member)) return "member: string expected"; if (message.condition != null && message.hasOwnProperty("condition")) { var error = $root.google.type.Expr.verify(message.condition); if (error) return "condition." + error; } return null; }; /** * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.BindingDelta * @static * @param {Object.} object Plain object * @returns {google.iam.v1.BindingDelta} BindingDelta */ BindingDelta.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.BindingDelta) return object; var message = new $root.google.iam.v1.BindingDelta(); switch (object.action) { case "ACTION_UNSPECIFIED": case 0: message.action = 0; break; case "ADD": case 1: message.action = 1; break; case "REMOVE": case 2: message.action = 2; break; } if (object.role != null) message.role = String(object.role); if (object.member != null) message.member = String(object.member); if (object.condition != null) { if (typeof object.condition !== "object") throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); message.condition = $root.google.type.Expr.fromObject(object.condition); } return message; }; /** * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.BindingDelta * @static * @param {google.iam.v1.BindingDelta} message BindingDelta * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ BindingDelta.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; object.role = ""; object.member = ""; object.condition = null; } if (message.action != null && message.hasOwnProperty("action")) object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; if (message.member != null && message.hasOwnProperty("member")) object.member = message.member; if (message.condition != null && message.hasOwnProperty("condition")) object.condition = $root.google.type.Expr.toObject(message.condition, options); return object; }; /** * Converts this BindingDelta to JSON. * @function toJSON * @memberof google.iam.v1.BindingDelta * @instance * @returns {Object.} JSON object */ BindingDelta.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Action enum. * @name google.iam.v1.BindingDelta.Action * @enum {number} * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value * @property {number} ADD=1 ADD value * @property {number} REMOVE=2 REMOVE value */ BindingDelta.Action = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; values[valuesById[1] = "ADD"] = 1; values[valuesById[2] = "REMOVE"] = 2; return values; })(); return BindingDelta; })(); v1.AuditConfigDelta = (function() { /** * Properties of an AuditConfigDelta. * @memberof google.iam.v1 * @interface IAuditConfigDelta * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action * @property {string|null} [service] AuditConfigDelta service * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember * @property {string|null} [logType] AuditConfigDelta logType */ /** * Constructs a new AuditConfigDelta. * @memberof google.iam.v1 * @classdesc Represents an AuditConfigDelta. * @implements IAuditConfigDelta * @constructor * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set */ function AuditConfigDelta(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AuditConfigDelta action. * @member {google.iam.v1.AuditConfigDelta.Action} action * @memberof google.iam.v1.AuditConfigDelta * @instance */ AuditConfigDelta.prototype.action = 0; /** * AuditConfigDelta service. * @member {string} service * @memberof google.iam.v1.AuditConfigDelta * @instance */ AuditConfigDelta.prototype.service = ""; /** * AuditConfigDelta exemptedMember. * @member {string} exemptedMember * @memberof google.iam.v1.AuditConfigDelta * @instance */ AuditConfigDelta.prototype.exemptedMember = ""; /** * AuditConfigDelta logType. * @member {string} logType * @memberof google.iam.v1.AuditConfigDelta * @instance */ AuditConfigDelta.prototype.logType = ""; /** * Creates a new AuditConfigDelta instance using the specified properties. * @function create * @memberof google.iam.v1.AuditConfigDelta * @static * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance */ AuditConfigDelta.create = function create(properties) { return new AuditConfigDelta(properties); }; /** * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. * @function encode * @memberof google.iam.v1.AuditConfigDelta * @static * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AuditConfigDelta.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); if (message.service != null && Object.hasOwnProperty.call(message, "service")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); return writer; }; /** * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.AuditConfigDelta * @static * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an AuditConfigDelta message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.AuditConfigDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AuditConfigDelta.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.action = reader.int32(); break; case 2: message.service = reader.string(); break; case 3: message.exemptedMember = reader.string(); break; case 4: message.logType = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.AuditConfigDelta * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an AuditConfigDelta message. * @function verify * @memberof google.iam.v1.AuditConfigDelta * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AuditConfigDelta.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.action != null && message.hasOwnProperty("action")) switch (message.action) { default: return "action: enum value expected"; case 0: case 1: case 2: break; } if (message.service != null && message.hasOwnProperty("service")) if (!$util.isString(message.service)) return "service: string expected"; if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) if (!$util.isString(message.exemptedMember)) return "exemptedMember: string expected"; if (message.logType != null && message.hasOwnProperty("logType")) if (!$util.isString(message.logType)) return "logType: string expected"; return null; }; /** * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.AuditConfigDelta * @static * @param {Object.} object Plain object * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta */ AuditConfigDelta.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.AuditConfigDelta) return object; var message = new $root.google.iam.v1.AuditConfigDelta(); switch (object.action) { case "ACTION_UNSPECIFIED": case 0: message.action = 0; break; case "ADD": case 1: message.action = 1; break; case "REMOVE": case 2: message.action = 2; break; } if (object.service != null) message.service = String(object.service); if (object.exemptedMember != null) message.exemptedMember = String(object.exemptedMember); if (object.logType != null) message.logType = String(object.logType); return message; }; /** * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.AuditConfigDelta * @static * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ AuditConfigDelta.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; object.service = ""; object.exemptedMember = ""; object.logType = ""; } if (message.action != null && message.hasOwnProperty("action")) object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) object.exemptedMember = message.exemptedMember; if (message.logType != null && message.hasOwnProperty("logType")) object.logType = message.logType; return object; }; /** * Converts this AuditConfigDelta to JSON. * @function toJSON * @memberof google.iam.v1.AuditConfigDelta * @instance * @returns {Object.} JSON object */ AuditConfigDelta.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Action enum. * @name google.iam.v1.AuditConfigDelta.Action * @enum {number} * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value * @property {number} ADD=1 ADD value * @property {number} REMOVE=2 REMOVE value */ AuditConfigDelta.Action = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; values[valuesById[1] = "ADD"] = 1; values[valuesById[2] = "REMOVE"] = 2; return values; })(); return AuditConfigDelta; })(); v1.logging = (function() { /** * Namespace logging. * @memberof google.iam.v1 * @namespace */ var logging = {}; logging.AuditData = (function() { /** * Properties of an AuditData. * @memberof google.iam.v1.logging * @interface IAuditData * @property {google.iam.v1.IPolicyDelta|null} [policyDelta] AuditData policyDelta */ /** * Constructs a new AuditData. * @memberof google.iam.v1.logging * @classdesc Represents an AuditData. * @implements IAuditData * @constructor * @param {google.iam.v1.logging.IAuditData=} [properties] Properties to set */ function AuditData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * AuditData policyDelta. * @member {google.iam.v1.IPolicyDelta|null|undefined} policyDelta * @memberof google.iam.v1.logging.AuditData * @instance */ AuditData.prototype.policyDelta = null; /** * Creates a new AuditData instance using the specified properties. * @function create * @memberof google.iam.v1.logging.AuditData * @static * @param {google.iam.v1.logging.IAuditData=} [properties] Properties to set * @returns {google.iam.v1.logging.AuditData} AuditData instance */ AuditData.create = function create(properties) { return new AuditData(properties); }; /** * Encodes the specified AuditData message. Does not implicitly {@link google.iam.v1.logging.AuditData.verify|verify} messages. * @function encode * @memberof google.iam.v1.logging.AuditData * @static * @param {google.iam.v1.logging.IAuditData} message AuditData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AuditData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.policyDelta != null && Object.hasOwnProperty.call(message, "policyDelta")) $root.google.iam.v1.PolicyDelta.encode(message.policyDelta, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified AuditData message, length delimited. Does not implicitly {@link google.iam.v1.logging.AuditData.verify|verify} messages. * @function encodeDelimited * @memberof google.iam.v1.logging.AuditData * @static * @param {google.iam.v1.logging.IAuditData} message AuditData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ AuditData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an AuditData message from the specified reader or buffer. * @function decode * @memberof google.iam.v1.logging.AuditData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.iam.v1.logging.AuditData} AuditData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AuditData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.logging.AuditData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: message.policyDelta = $root.google.iam.v1.PolicyDelta.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an AuditData message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.iam.v1.logging.AuditData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.iam.v1.logging.AuditData} AuditData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AuditData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an AuditData message. * @function verify * @memberof google.iam.v1.logging.AuditData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AuditData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.policyDelta != null && message.hasOwnProperty("policyDelta")) { var error = $root.google.iam.v1.PolicyDelta.verify(message.policyDelta); if (error) return "policyDelta." + error; } return null; }; /** * Creates an AuditData message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.iam.v1.logging.AuditData * @static * @param {Object.} object Plain object * @returns {google.iam.v1.logging.AuditData} AuditData */ AuditData.fromObject = function fromObject(object) { if (object instanceof $root.google.iam.v1.logging.AuditData) return object; var message = new $root.google.iam.v1.logging.AuditData(); if (object.policyDelta != null) { if (typeof object.policyDelta !== "object") throw TypeError(".google.iam.v1.logging.AuditData.policyDelta: object expected"); message.policyDelta = $root.google.iam.v1.PolicyDelta.fromObject(object.policyDelta); } return message; }; /** * Creates a plain object from an AuditData message. Also converts values to other types if specified. * @function toObject * @memberof google.iam.v1.logging.AuditData * @static * @param {google.iam.v1.logging.AuditData} message AuditData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ AuditData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.policyDelta = null; if (message.policyDelta != null && message.hasOwnProperty("policyDelta")) object.policyDelta = $root.google.iam.v1.PolicyDelta.toObject(message.policyDelta, options); return object; }; /** * Converts this AuditData to JSON. * @function toJSON * @memberof google.iam.v1.logging.AuditData * @instance * @returns {Object.} JSON object */ AuditData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return AuditData; })(); return logging; })(); return v1; })(); return iam; })(); google.api = (function() { /** * Namespace api. * @memberof google * @namespace */ var api = {}; api.Http = (function() { /** * Properties of a Http. * @memberof google.api * @interface IHttp * @property {Array.|null} [rules] Http rules * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** * Constructs a new Http. * @memberof google.api * @classdesc Represents a Http. * @implements IHttp * @constructor * @param {google.api.IHttp=} [properties] Properties to set */ function Http(properties) { this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Http rules. * @member {Array.} rules * @memberof google.api.Http * @instance */ Http.prototype.rules = $util.emptyArray; /** * Http fullyDecodeReservedExpansion. * @member {boolean} fullyDecodeReservedExpansion * @memberof google.api.Http * @instance */ Http.prototype.fullyDecodeReservedExpansion = false; /** * Creates a new Http instance using the specified properties. * @function create * @memberof google.api.Http * @static * @param {google.api.IHttp=} [properties] Properties to set * @returns {google.api.Http} Http instance */ Http.create = function create(properties) { return new Http(properties); }; /** * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode * @memberof google.api.Http * @static * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.rules != null && message.rules.length) for (var i = 0; i < message.rules.length; ++i) $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Http * @static * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Http message from the specified reader or buffer. * @function decode * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Http.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.rules && message.rules.length)) message.rules = []; message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Http message. * @function verify * @memberof google.api.Http * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.rules != null && message.hasOwnProperty("rules")) { if (!Array.isArray(message.rules)) return "rules: array expected"; for (var i = 0; i < message.rules.length; ++i) { var error = $root.google.api.HttpRule.verify(message.rules[i]); if (error) return "rules." + error; } } if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) if (typeof message.fullyDecodeReservedExpansion !== "boolean") return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Http * @static * @param {Object.} object Plain object * @returns {google.api.Http} Http */ Http.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Http) return object; var message = new $root.google.api.Http(); if (object.rules) { if (!Array.isArray(object.rules)) throw TypeError(".google.api.Http.rules: array expected"); message.rules = []; for (var i = 0; i < object.rules.length; ++i) { if (typeof object.rules[i] !== "object") throw TypeError(".google.api.Http.rules: object expected"); message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); } } if (object.fullyDecodeReservedExpansion != null) message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Http * @static * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.rules = []; if (options.defaults) object.fullyDecodeReservedExpansion = false; if (message.rules && message.rules.length) { object.rules = []; for (var j = 0; j < message.rules.length; ++j) object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** * Converts this Http to JSON. * @function toJSON * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Http; })(); api.HttpRule = (function() { /** * Properties of a HttpRule. * @memberof google.api * @interface IHttpRule * @property {string|null} [selector] HttpRule selector * @property {string|null} [get] HttpRule get * @property {string|null} [put] HttpRule put * @property {string|null} [post] HttpRule post * @property {string|null} ["delete"] HttpRule delete * @property {string|null} [patch] HttpRule patch * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom * @property {string|null} [body] HttpRule body * @property {string|null} [responseBody] HttpRule responseBody * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ /** * Constructs a new HttpRule. * @memberof google.api * @classdesc Represents a HttpRule. * @implements IHttpRule * @constructor * @param {google.api.IHttpRule=} [properties] Properties to set */ function HttpRule(properties) { this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * HttpRule selector. * @member {string} selector * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.selector = ""; /** * HttpRule get. * @member {string} get * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.get = ""; /** * HttpRule put. * @member {string} put * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.put = ""; /** * HttpRule post. * @member {string} post * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.post = ""; /** * HttpRule delete. * @member {string} delete * @memberof google.api.HttpRule * @instance */ HttpRule.prototype["delete"] = ""; /** * HttpRule patch. * @member {string} patch * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.patch = ""; /** * HttpRule custom. * @member {google.api.ICustomHttpPattern|null|undefined} custom * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.custom = null; /** * HttpRule body. * @member {string} body * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.body = ""; /** * HttpRule responseBody. * @member {string} responseBody * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.responseBody = ""; /** * HttpRule additionalBindings. * @member {Array.} additionalBindings * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.additionalBindings = $util.emptyArray; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * HttpRule pattern. * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern * @memberof google.api.HttpRule * @instance */ Object.defineProperty(HttpRule.prototype, "pattern", { get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new HttpRule instance using the specified properties. * @function create * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule=} [properties] Properties to set * @returns {google.api.HttpRule} HttpRule instance */ HttpRule.create = function create(properties) { return new HttpRule(properties); }; /** * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.additionalBindings != null && message.additionalBindings.length) for (var i = 0; i < message.additionalBindings.length; ++i) $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a HttpRule message from the specified reader or buffer. * @function decode * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.selector = reader.string(); break; case 2: message.get = reader.string(); break; case 3: message.put = reader.string(); break; case 4: message.post = reader.string(); break; case 5: message["delete"] = reader.string(); break; case 6: message.patch = reader.string(); break; case 8: message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); break; case 7: message.body = reader.string(); break; case 12: message.responseBody = reader.string(); break; case 11: if (!(message.additionalBindings && message.additionalBindings.length)) message.additionalBindings = []; message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a HttpRule message. * @function verify * @memberof google.api.HttpRule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.selector != null && message.hasOwnProperty("selector")) if (!$util.isString(message.selector)) return "selector: string expected"; if (message.get != null && message.hasOwnProperty("get")) { properties.pattern = 1; if (!$util.isString(message.get)) return "get: string expected"; } if (message.put != null && message.hasOwnProperty("put")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.put)) return "put: string expected"; } if (message.post != null && message.hasOwnProperty("post")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.post)) return "post: string expected"; } if (message["delete"] != null && message.hasOwnProperty("delete")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message["delete"])) return "delete: string expected"; } if (message.patch != null && message.hasOwnProperty("patch")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.patch)) return "patch: string expected"; } if (message.custom != null && message.hasOwnProperty("custom")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; { var error = $root.google.api.CustomHttpPattern.verify(message.custom); if (error) return "custom." + error; } } if (message.body != null && message.hasOwnProperty("body")) if (!$util.isString(message.body)) return "body: string expected"; if (message.responseBody != null && message.hasOwnProperty("responseBody")) if (!$util.isString(message.responseBody)) return "responseBody: string expected"; if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { if (!Array.isArray(message.additionalBindings)) return "additionalBindings: array expected"; for (var i = 0; i < message.additionalBindings.length; ++i) { var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); if (error) return "additionalBindings." + error; } } return null; }; /** * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object * @returns {google.api.HttpRule} HttpRule */ HttpRule.fromObject = function fromObject(object) { if (object instanceof $root.google.api.HttpRule) return object; var message = new $root.google.api.HttpRule(); if (object.selector != null) message.selector = String(object.selector); if (object.get != null) message.get = String(object.get); if (object.put != null) message.put = String(object.put); if (object.post != null) message.post = String(object.post); if (object["delete"] != null) message["delete"] = String(object["delete"]); if (object.patch != null) message.patch = String(object.patch); if (object.custom != null) { if (typeof object.custom !== "object") throw TypeError(".google.api.HttpRule.custom: object expected"); message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); } if (object.body != null) message.body = String(object.body); if (object.responseBody != null) message.responseBody = String(object.responseBody); if (object.additionalBindings) { if (!Array.isArray(object.additionalBindings)) throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); message.additionalBindings = []; for (var i = 0; i < object.additionalBindings.length; ++i) { if (typeof object.additionalBindings[i] !== "object") throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); } } return message; }; /** * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject * @memberof google.api.HttpRule * @static * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.additionalBindings = []; if (options.defaults) { object.selector = ""; object.body = ""; object.responseBody = ""; } if (message.selector != null && message.hasOwnProperty("selector")) object.selector = message.selector; if (message.get != null && message.hasOwnProperty("get")) { object.get = message.get; if (options.oneofs) object.pattern = "get"; } if (message.put != null && message.hasOwnProperty("put")) { object.put = message.put; if (options.oneofs) object.pattern = "put"; } if (message.post != null && message.hasOwnProperty("post")) { object.post = message.post; if (options.oneofs) object.pattern = "post"; } if (message["delete"] != null && message.hasOwnProperty("delete")) { object["delete"] = message["delete"]; if (options.oneofs) object.pattern = "delete"; } if (message.patch != null && message.hasOwnProperty("patch")) { object.patch = message.patch; if (options.oneofs) object.pattern = "patch"; } if (message.body != null && message.hasOwnProperty("body")) object.body = message.body; if (message.custom != null && message.hasOwnProperty("custom")) { object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); if (options.oneofs) object.pattern = "custom"; } if (message.additionalBindings && message.additionalBindings.length) { object.additionalBindings = []; for (var j = 0; j < message.additionalBindings.length; ++j) object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); } if (message.responseBody != null && message.hasOwnProperty("responseBody")) object.responseBody = message.responseBody; return object; }; /** * Converts this HttpRule to JSON. * @function toJSON * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return HttpRule; })(); api.CustomHttpPattern = (function() { /** * Properties of a CustomHttpPattern. * @memberof google.api * @interface ICustomHttpPattern * @property {string|null} [kind] CustomHttpPattern kind * @property {string|null} [path] CustomHttpPattern path */ /** * Constructs a new CustomHttpPattern. * @memberof google.api * @classdesc Represents a CustomHttpPattern. * @implements ICustomHttpPattern * @constructor * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CustomHttpPattern kind. * @member {string} kind * @memberof google.api.CustomHttpPattern * @instance */ CustomHttpPattern.prototype.kind = ""; /** * CustomHttpPattern path. * @member {string} path * @memberof google.api.CustomHttpPattern * @instance */ CustomHttpPattern.prototype.path = ""; /** * Creates a new CustomHttpPattern instance using the specified properties. * @function create * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern=} [properties] Properties to set * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ CustomHttpPattern.create = function create(properties) { return new CustomHttpPattern(properties); }; /** * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomHttpPattern.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.kind = reader.string(); break; case 2: message.path = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CustomHttpPattern message. * @function verify * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.kind != null && message.hasOwnProperty("kind")) if (!$util.isString(message.kind)) return "kind: string expected"; if (message.path != null && message.hasOwnProperty("path")) if (!$util.isString(message.path)) return "path: string expected"; return null; }; /** * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ CustomHttpPattern.fromObject = function fromObject(object) { if (object instanceof $root.google.api.CustomHttpPattern) return object; var message = new $root.google.api.CustomHttpPattern(); if (object.kind != null) message.kind = String(object.kind); if (object.path != null) message.path = String(object.path); return message; }; /** * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject * @memberof google.api.CustomHttpPattern * @static * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.kind = ""; object.path = ""; } if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; if (message.path != null && message.hasOwnProperty("path")) object.path = message.path; return object; }; /** * Converts this CustomHttpPattern to JSON. * @function toJSON * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CustomHttpPattern; })(); /** * FieldBehavior enum. * @name google.api.FieldBehavior * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value * @property {number} INPUT_ONLY=4 INPUT_ONLY value * @property {number} IMMUTABLE=5 IMMUTABLE value */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; values[valuesById[1] = "OPTIONAL"] = 1; values[valuesById[2] = "REQUIRED"] = 2; values[valuesById[3] = "OUTPUT_ONLY"] = 3; values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; return values; })(); api.ResourceDescriptor = (function() { /** * Properties of a ResourceDescriptor. * @memberof google.api * @interface IResourceDescriptor * @property {string|null} [type] ResourceDescriptor type * @property {Array.|null} [pattern] ResourceDescriptor pattern * @property {string|null} [nameField] ResourceDescriptor nameField * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history * @property {string|null} [plural] ResourceDescriptor plural * @property {string|null} [singular] ResourceDescriptor singular */ /** * Constructs a new ResourceDescriptor. * @memberof google.api * @classdesc Represents a ResourceDescriptor. * @implements IResourceDescriptor * @constructor * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ function ResourceDescriptor(properties) { this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ResourceDescriptor type. * @member {string} type * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.type = ""; /** * ResourceDescriptor pattern. * @member {Array.} pattern * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.pattern = $util.emptyArray; /** * ResourceDescriptor nameField. * @member {string} nameField * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.nameField = ""; /** * ResourceDescriptor history. * @member {google.api.ResourceDescriptor.History} history * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.history = 0; /** * ResourceDescriptor plural. * @member {string} plural * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.plural = ""; /** * ResourceDescriptor singular. * @member {string} singular * @memberof google.api.ResourceDescriptor * @instance */ ResourceDescriptor.prototype.singular = ""; /** * Creates a new ResourceDescriptor instance using the specified properties. * @function create * @memberof google.api.ResourceDescriptor * @static * @param {google.api.IResourceDescriptor=} [properties] Properties to set * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ ResourceDescriptor.create = function create(properties) { return new ResourceDescriptor(properties); }; /** * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode * @memberof google.api.ResourceDescriptor * @static * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.pattern != null && message.pattern.length) for (var i = 0; i < message.pattern.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited * @memberof google.api.ResourceDescriptor * @static * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type = reader.string(); break; case 2: if (!(message.pattern && message.pattern.length)) message.pattern = []; message.pattern.push(reader.string()); break; case 3: message.nameField = reader.string(); break; case 4: message.history = reader.int32(); break; case 5: message.plural = reader.string(); break; case 6: message.singular = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ResourceDescriptor message. * @function verify * @memberof google.api.ResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.pattern != null && message.hasOwnProperty("pattern")) { if (!Array.isArray(message.pattern)) return "pattern: array expected"; for (var i = 0; i < message.pattern.length; ++i) if (!$util.isString(message.pattern[i])) return "pattern: string[] expected"; } if (message.nameField != null && message.hasOwnProperty("nameField")) if (!$util.isString(message.nameField)) return "nameField: string expected"; if (message.history != null && message.hasOwnProperty("history")) switch (message.history) { default: return "history: enum value expected"; case 0: case 1: case 2: break; } if (message.plural != null && message.hasOwnProperty("plural")) if (!$util.isString(message.plural)) return "plural: string expected"; if (message.singular != null && message.hasOwnProperty("singular")) if (!$util.isString(message.singular)) return "singular: string expected"; return null; }; /** * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ ResourceDescriptor.fromObject = function fromObject(object) { if (object instanceof $root.google.api.ResourceDescriptor) return object; var message = new $root.google.api.ResourceDescriptor(); if (object.type != null) message.type = String(object.type); if (object.pattern) { if (!Array.isArray(object.pattern)) throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); message.pattern = []; for (var i = 0; i < object.pattern.length; ++i) message.pattern[i] = String(object.pattern[i]); } if (object.nameField != null) message.nameField = String(object.nameField); switch (object.history) { case "HISTORY_UNSPECIFIED": case 0: message.history = 0; break; case "ORIGINALLY_SINGLE_PATTERN": case 1: message.history = 1; break; case "FUTURE_MULTI_PATTERN": case 2: message.history = 2; break; } if (object.plural != null) message.plural = String(object.plural); if (object.singular != null) message.singular = String(object.singular); return message; }; /** * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject * @memberof google.api.ResourceDescriptor * @static * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.pattern = []; if (options.defaults) { object.type = ""; object.nameField = ""; object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; object.plural = ""; object.singular = ""; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; if (message.pattern && message.pattern.length) { object.pattern = []; for (var j = 0; j < message.pattern.length; ++j) object.pattern[j] = message.pattern[j]; } if (message.nameField != null && message.hasOwnProperty("nameField")) object.nameField = message.nameField; if (message.history != null && message.hasOwnProperty("history")) object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; if (message.plural != null && message.hasOwnProperty("plural")) object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) object.singular = message.singular; return object; }; /** * Converts this ResourceDescriptor to JSON. * @function toJSON * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * History enum. * @name google.api.ResourceDescriptor.History * @enum {number} * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value */ ResourceDescriptor.History = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; return values; })(); return ResourceDescriptor; })(); api.ResourceReference = (function() { /** * Properties of a ResourceReference. * @memberof google.api * @interface IResourceReference * @property {string|null} [type] ResourceReference type * @property {string|null} [childType] ResourceReference childType */ /** * Constructs a new ResourceReference. * @memberof google.api * @classdesc Represents a ResourceReference. * @implements IResourceReference * @constructor * @param {google.api.IResourceReference=} [properties] Properties to set */ function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ResourceReference type. * @member {string} type * @memberof google.api.ResourceReference * @instance */ ResourceReference.prototype.type = ""; /** * ResourceReference childType. * @member {string} childType * @memberof google.api.ResourceReference * @instance */ ResourceReference.prototype.childType = ""; /** * Creates a new ResourceReference instance using the specified properties. * @function create * @memberof google.api.ResourceReference * @static * @param {google.api.IResourceReference=} [properties] Properties to set * @returns {google.api.ResourceReference} ResourceReference instance */ ResourceReference.create = function create(properties) { return new ResourceReference(properties); }; /** * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode * @memberof google.api.ResourceReference * @static * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited * @memberof google.api.ResourceReference * @static * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ResourceReference message from the specified reader or buffer. * @function decode * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ResourceReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type = reader.string(); break; case 2: message.childType = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ResourceReference message. * @function verify * @memberof google.api.ResourceReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.childType != null && message.hasOwnProperty("childType")) if (!$util.isString(message.childType)) return "childType: string expected"; return null; }; /** * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object * @returns {google.api.ResourceReference} ResourceReference */ ResourceReference.fromObject = function fromObject(object) { if (object instanceof $root.google.api.ResourceReference) return object; var message = new $root.google.api.ResourceReference(); if (object.type != null) message.type = String(object.type); if (object.childType != null) message.childType = String(object.childType); return message; }; /** * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject * @memberof google.api.ResourceReference * @static * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.type = ""; object.childType = ""; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; if (message.childType != null && message.hasOwnProperty("childType")) object.childType = message.childType; return object; }; /** * Converts this ResourceReference to JSON. * @function toJSON * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ResourceReference; })(); return api; })(); google.protobuf = (function() { /** * Namespace protobuf. * @memberof google * @namespace */ var protobuf = {}; protobuf.FileDescriptorSet = (function() { /** * Properties of a FileDescriptorSet. * @memberof google.protobuf * @interface IFileDescriptorSet * @property {Array.|null} [file] FileDescriptorSet file */ /** * Constructs a new FileDescriptorSet. * @memberof google.protobuf * @classdesc Represents a FileDescriptorSet. * @implements IFileDescriptorSet * @constructor * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set */ function FileDescriptorSet(properties) { this.file = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileDescriptorSet file. * @member {Array.} file * @memberof google.protobuf.FileDescriptorSet * @instance */ FileDescriptorSet.prototype.file = $util.emptyArray; /** * Creates a new FileDescriptorSet instance using the specified properties. * @function create * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance */ FileDescriptorSet.create = function create(properties) { return new FileDescriptorSet(properties); }; /** * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encode * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.file != null && message.file.length) for (var i = 0; i < message.file.length; ++i) $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileDescriptorSet message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorSet.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.file && message.file.length)) message.file = []; message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileDescriptorSet message. * @function verify * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileDescriptorSet.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.file != null && message.hasOwnProperty("file")) { if (!Array.isArray(message.file)) return "file: array expected"; for (var i = 0; i < message.file.length; ++i) { var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); if (error) return "file." + error; } } return null; }; /** * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet */ FileDescriptorSet.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileDescriptorSet) return object; var message = new $root.google.protobuf.FileDescriptorSet(); if (object.file) { if (!Array.isArray(object.file)) throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); message.file = []; for (var i = 0; i < object.file.length; ++i) { if (typeof object.file[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); } } return message; }; /** * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileDescriptorSet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.file = []; if (message.file && message.file.length) { object.file = []; for (var j = 0; j < message.file.length; ++j) object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); } return object; }; /** * Converts this FileDescriptorSet to JSON. * @function toJSON * @memberof google.protobuf.FileDescriptorSet * @instance * @returns {Object.} JSON object */ FileDescriptorSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FileDescriptorSet; })(); protobuf.FileDescriptorProto = (function() { /** * Properties of a FileDescriptorProto. * @memberof google.protobuf * @interface IFileDescriptorProto * @property {string|null} [name] FileDescriptorProto name * @property {string|null} ["package"] FileDescriptorProto package * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service * @property {Array.|null} [extension] FileDescriptorProto extension * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo * @property {string|null} [syntax] FileDescriptorProto syntax */ /** * Constructs a new FileDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FileDescriptorProto. * @implements IFileDescriptorProto * @constructor * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set */ function FileDescriptorProto(properties) { this.dependency = []; this.publicDependency = []; this.weakDependency = []; this.messageType = []; this.enumType = []; this.service = []; this.extension = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileDescriptorProto name. * @member {string} name * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.name = ""; /** * FileDescriptorProto package. * @member {string} package * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype["package"] = ""; /** * FileDescriptorProto dependency. * @member {Array.} dependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.dependency = $util.emptyArray; /** * FileDescriptorProto publicDependency. * @member {Array.} publicDependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.publicDependency = $util.emptyArray; /** * FileDescriptorProto weakDependency. * @member {Array.} weakDependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; /** * FileDescriptorProto messageType. * @member {Array.} messageType * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.messageType = $util.emptyArray; /** * FileDescriptorProto enumType. * @member {Array.} enumType * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.enumType = $util.emptyArray; /** * FileDescriptorProto service. * @member {Array.} service * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.service = $util.emptyArray; /** * FileDescriptorProto extension. * @member {Array.} extension * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.extension = $util.emptyArray; /** * FileDescriptorProto options. * @member {google.protobuf.IFileOptions|null|undefined} options * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.options = null; /** * FileDescriptorProto sourceCodeInfo. * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.sourceCodeInfo = null; /** * FileDescriptorProto syntax. * @member {string} syntax * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.syntax = ""; /** * Creates a new FileDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance */ FileDescriptorProto.create = function create(properties) { return new FileDescriptorProto(properties); }; /** * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); if (message.messageType != null && message.messageType.length) for (var i = 0; i < message.messageType.length; ++i) $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.enumType != null && message.enumType.length) for (var i = 0; i < message.enumType.length; ++i) $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.service != null && message.service.length) for (var i = 0; i < message.service.length; ++i) $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; /** * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message["package"] = reader.string(); break; case 3: if (!(message.dependency && message.dependency.length)) message.dependency = []; message.dependency.push(reader.string()); break; case 10: if (!(message.publicDependency && message.publicDependency.length)) message.publicDependency = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.publicDependency.push(reader.int32()); } else message.publicDependency.push(reader.int32()); break; case 11: if (!(message.weakDependency && message.weakDependency.length)) message.weakDependency = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.weakDependency.push(reader.int32()); } else message.weakDependency.push(reader.int32()); break; case 4: if (!(message.messageType && message.messageType.length)) message.messageType = []; message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; case 5: if (!(message.enumType && message.enumType.length)) message.enumType = []; message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: if (!(message.service && message.service.length)) message.service = []; message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: if (!(message.extension && message.extension.length)) message.extension = []; message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); break; case 9: message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileDescriptorProto message. * @function verify * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message["package"] != null && message.hasOwnProperty("package")) if (!$util.isString(message["package"])) return "package: string expected"; if (message.dependency != null && message.hasOwnProperty("dependency")) { if (!Array.isArray(message.dependency)) return "dependency: array expected"; for (var i = 0; i < message.dependency.length; ++i) if (!$util.isString(message.dependency[i])) return "dependency: string[] expected"; } if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { if (!Array.isArray(message.publicDependency)) return "publicDependency: array expected"; for (var i = 0; i < message.publicDependency.length; ++i) if (!$util.isInteger(message.publicDependency[i])) return "publicDependency: integer[] expected"; } if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { if (!Array.isArray(message.weakDependency)) return "weakDependency: array expected"; for (var i = 0; i < message.weakDependency.length; ++i) if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; for (var i = 0; i < message.messageType.length; ++i) { var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); if (error) return "messageType." + error; } } if (message.enumType != null && message.hasOwnProperty("enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } } if (message.service != null && message.hasOwnProperty("service")) { if (!Array.isArray(message.service)) return "service: array expected"; for (var i = 0; i < message.service.length; ++i) { var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); if (error) return "service." + error; } } if (message.extension != null && message.hasOwnProperty("extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FileOptions.verify(message.options); if (error) return "options." + error; } if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); if (error) return "sourceCodeInfo." + error; } if (message.syntax != null && message.hasOwnProperty("syntax")) if (!$util.isString(message.syntax)) return "syntax: string expected"; return null; }; /** * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto */ FileDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileDescriptorProto) return object; var message = new $root.google.protobuf.FileDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object["package"] != null) message["package"] = String(object["package"]); if (object.dependency) { if (!Array.isArray(object.dependency)) throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); message.dependency = []; for (var i = 0; i < object.dependency.length; ++i) message.dependency[i] = String(object.dependency[i]); } if (object.publicDependency) { if (!Array.isArray(object.publicDependency)) throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); message.publicDependency = []; for (var i = 0; i < object.publicDependency.length; ++i) message.publicDependency[i] = object.publicDependency[i] | 0; } if (object.weakDependency) { if (!Array.isArray(object.weakDependency)) throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); message.weakDependency = []; for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); message.messageType = []; for (var i = 0; i < object.messageType.length; ++i) { if (typeof object.messageType[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); } } if (object.enumType) { if (!Array.isArray(object.enumType)) throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { if (typeof object.enumType[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); } } if (object.service) { if (!Array.isArray(object.service)) throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); message.service = []; for (var i = 0; i < object.service.length; ++i) { if (typeof object.service[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); } } if (object.extension) { if (!Array.isArray(object.extension)) throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { if (typeof object.extension[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FileOptions.fromObject(object.options); } if (object.sourceCodeInfo != null) { if (typeof object.sourceCodeInfo !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); } if (object.syntax != null) message.syntax = String(object.syntax); return message; }; /** * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.dependency = []; object.messageType = []; object.enumType = []; object.service = []; object.extension = []; object.publicDependency = []; object.weakDependency = []; } if (options.defaults) { object.name = ""; object["package"] = ""; object.options = null; object.sourceCodeInfo = null; object.syntax = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message["package"] != null && message.hasOwnProperty("package")) object["package"] = message["package"]; if (message.dependency && message.dependency.length) { object.dependency = []; for (var j = 0; j < message.dependency.length; ++j) object.dependency[j] = message.dependency[j]; } if (message.messageType && message.messageType.length) { object.messageType = []; for (var j = 0; j < message.messageType.length; ++j) object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); } if (message.enumType && message.enumType.length) { object.enumType = []; for (var j = 0; j < message.enumType.length; ++j) object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); } if (message.service && message.service.length) { object.service = []; for (var j = 0; j < message.service.length; ++j) object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); } if (message.extension && message.extension.length) { object.extension = []; for (var j = 0; j < message.extension.length; ++j) object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); if (message.publicDependency && message.publicDependency.length) { object.publicDependency = []; for (var j = 0; j < message.publicDependency.length; ++j) object.publicDependency[j] = message.publicDependency[j]; } if (message.weakDependency && message.weakDependency.length) { object.weakDependency = []; for (var j = 0; j < message.weakDependency.length; ++j) object.weakDependency[j] = message.weakDependency[j]; } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; return object; }; /** * Converts this FileDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.FileDescriptorProto * @instance * @returns {Object.} JSON object */ FileDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FileDescriptorProto; })(); protobuf.DescriptorProto = (function() { /** * Properties of a DescriptorProto. * @memberof google.protobuf * @interface IDescriptorProto * @property {string|null} [name] DescriptorProto name * @property {Array.|null} [field] DescriptorProto field * @property {Array.|null} [extension] DescriptorProto extension * @property {Array.|null} [nestedType] DescriptorProto nestedType * @property {Array.|null} [enumType] DescriptorProto enumType * @property {Array.|null} [extensionRange] DescriptorProto extensionRange * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName */ /** * Constructs a new DescriptorProto. * @memberof google.protobuf * @classdesc Represents a DescriptorProto. * @implements IDescriptorProto * @constructor * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set */ function DescriptorProto(properties) { this.field = []; this.extension = []; this.nestedType = []; this.enumType = []; this.extensionRange = []; this.oneofDecl = []; this.reservedRange = []; this.reservedName = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DescriptorProto name. * @member {string} name * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.name = ""; /** * DescriptorProto field. * @member {Array.} field * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.field = $util.emptyArray; /** * DescriptorProto extension. * @member {Array.} extension * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.extension = $util.emptyArray; /** * DescriptorProto nestedType. * @member {Array.} nestedType * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.nestedType = $util.emptyArray; /** * DescriptorProto enumType. * @member {Array.} enumType * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.enumType = $util.emptyArray; /** * DescriptorProto extensionRange. * @member {Array.} extensionRange * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.extensionRange = $util.emptyArray; /** * DescriptorProto oneofDecl. * @member {Array.} oneofDecl * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.oneofDecl = $util.emptyArray; /** * DescriptorProto options. * @member {google.protobuf.IMessageOptions|null|undefined} options * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.options = null; /** * DescriptorProto reservedRange. * @member {Array.} reservedRange * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.reservedRange = $util.emptyArray; /** * DescriptorProto reservedName. * @member {Array.} reservedName * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.reservedName = $util.emptyArray; /** * Creates a new DescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto} DescriptorProto instance */ DescriptorProto.create = function create(properties) { return new DescriptorProto(properties); }; /** * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.nestedType != null && message.nestedType.length) for (var i = 0; i < message.nestedType.length; ++i) $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.enumType != null && message.enumType.length) for (var i = 0; i < message.enumType.length; ++i) $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.extensionRange != null && message.extensionRange.length) for (var i = 0; i < message.extensionRange.length; ++i) $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); return writer; }; /** * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto} DescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.field && message.field.length)) message.field = []; message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: if (!(message.extension && message.extension.length)) message.extension = []; message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: if (!(message.nestedType && message.nestedType.length)) message.nestedType = []; message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; case 4: if (!(message.enumType && message.enumType.length)) message.enumType = []; message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: if (!(message.extensionRange && message.extensionRange.length)) message.extensionRange = []; message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); break; case 8: if (!(message.oneofDecl && message.oneofDecl.length)) message.oneofDecl = []; message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); break; case 9: if (!(message.reservedRange && message.reservedRange.length)) message.reservedRange = []; message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); break; case 10: if (!(message.reservedName && message.reservedName.length)) message.reservedName = []; message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto} DescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DescriptorProto message. * @function verify * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.field != null && message.hasOwnProperty("field")) { if (!Array.isArray(message.field)) return "field: array expected"; for (var i = 0; i < message.field.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); if (error) return "field." + error; } } if (message.extension != null && message.hasOwnProperty("extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.nestedType != null && message.hasOwnProperty("nestedType")) { if (!Array.isArray(message.nestedType)) return "nestedType: array expected"; for (var i = 0; i < message.nestedType.length; ++i) { var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); if (error) return "nestedType." + error; } } if (message.enumType != null && message.hasOwnProperty("enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } } if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { if (!Array.isArray(message.extensionRange)) return "extensionRange: array expected"; for (var i = 0; i < message.extensionRange.length; ++i) { var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); if (error) return "extensionRange." + error; } } if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { if (!Array.isArray(message.oneofDecl)) return "oneofDecl: array expected"; for (var i = 0; i < message.oneofDecl.length; ++i) { var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); if (error) return "oneofDecl." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MessageOptions.verify(message.options); if (error) return "options." + error; } if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } } if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } return null; }; /** * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto} DescriptorProto */ DescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto) return object; var message = new $root.google.protobuf.DescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.field) { if (!Array.isArray(object.field)) throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); message.field = []; for (var i = 0; i < object.field.length; ++i) { if (typeof object.field[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); } } if (object.extension) { if (!Array.isArray(object.extension)) throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { if (typeof object.extension[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); } } if (object.nestedType) { if (!Array.isArray(object.nestedType)) throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); message.nestedType = []; for (var i = 0; i < object.nestedType.length; ++i) { if (typeof object.nestedType[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); } } if (object.enumType) { if (!Array.isArray(object.enumType)) throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { if (typeof object.enumType[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); } } if (object.extensionRange) { if (!Array.isArray(object.extensionRange)) throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); message.extensionRange = []; for (var i = 0; i < object.extensionRange.length; ++i) { if (typeof object.extensionRange[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); } } if (object.oneofDecl) { if (!Array.isArray(object.oneofDecl)) throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); message.oneofDecl = []; for (var i = 0; i < object.oneofDecl.length; ++i) { if (typeof object.oneofDecl[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); } if (object.reservedRange) { if (!Array.isArray(object.reservedRange)) throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { if (typeof object.reservedRange[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); } } if (object.reservedName) { if (!Array.isArray(object.reservedName)) throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); message.reservedName = []; for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } return message; }; /** * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.DescriptorProto} message DescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.field = []; object.nestedType = []; object.enumType = []; object.extensionRange = []; object.extension = []; object.oneofDecl = []; object.reservedRange = []; object.reservedName = []; } if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.field && message.field.length) { object.field = []; for (var j = 0; j < message.field.length; ++j) object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); } if (message.nestedType && message.nestedType.length) { object.nestedType = []; for (var j = 0; j < message.nestedType.length; ++j) object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); } if (message.enumType && message.enumType.length) { object.enumType = []; for (var j = 0; j < message.enumType.length; ++j) object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); } if (message.extensionRange && message.extensionRange.length) { object.extensionRange = []; for (var j = 0; j < message.extensionRange.length; ++j) object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); } if (message.extension && message.extension.length) { object.extension = []; for (var j = 0; j < message.extension.length; ++j) object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); if (message.oneofDecl && message.oneofDecl.length) { object.oneofDecl = []; for (var j = 0; j < message.oneofDecl.length; ++j) object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); } if (message.reservedRange && message.reservedRange.length) { object.reservedRange = []; for (var j = 0; j < message.reservedRange.length; ++j) object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } return object; }; /** * Converts this DescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto * @instance * @returns {Object.} JSON object */ DescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; DescriptorProto.ExtensionRange = (function() { /** * Properties of an ExtensionRange. * @memberof google.protobuf.DescriptorProto * @interface IExtensionRange * @property {number|null} [start] ExtensionRange start * @property {number|null} [end] ExtensionRange end * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options */ /** * Constructs a new ExtensionRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents an ExtensionRange. * @implements IExtensionRange * @constructor * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set */ function ExtensionRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ExtensionRange start. * @member {number} start * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.start = 0; /** * ExtensionRange end. * @member {number} end * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.end = 0; /** * ExtensionRange options. * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.options = null; /** * Creates a new ExtensionRange instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance */ ExtensionRange.create = function create(properties) { return new ExtensionRange(properties); }; /** * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ExtensionRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; case 3: message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ExtensionRange message. * @function verify * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ExtensionRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange */ ExtensionRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) return object; var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ExtensionRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; object.options = null; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); return object; }; /** * Converts this ExtensionRange to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance * @returns {Object.} JSON object */ ExtensionRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ExtensionRange; })(); DescriptorProto.ReservedRange = (function() { /** * Properties of a ReservedRange. * @memberof google.protobuf.DescriptorProto * @interface IReservedRange * @property {number|null} [start] ReservedRange start * @property {number|null} [end] ReservedRange end */ /** * Constructs a new ReservedRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents a ReservedRange. * @implements IReservedRange * @constructor * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set */ function ReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ReservedRange start. * @member {number} start * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ ReservedRange.prototype.start = 0; /** * ReservedRange end. * @member {number} end * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ ReservedRange.prototype.end = 0; /** * Creates a new ReservedRange instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance */ ReservedRange.create = function create(properties) { return new ReservedRange(properties); }; /** * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ReservedRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ReservedRange message. * @function verify * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange */ ReservedRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) return object; var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this ReservedRange to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance * @returns {Object.} JSON object */ ReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ReservedRange; })(); return DescriptorProto; })(); protobuf.ExtensionRangeOptions = (function() { /** * Properties of an ExtensionRangeOptions. * @memberof google.protobuf * @interface IExtensionRangeOptions * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption */ /** * Constructs a new ExtensionRangeOptions. * @memberof google.protobuf * @classdesc Represents an ExtensionRangeOptions. * @implements IExtensionRangeOptions * @constructor * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set */ function ExtensionRangeOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ExtensionRangeOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.ExtensionRangeOptions * @instance */ ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new ExtensionRangeOptions instance using the specified properties. * @function create * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance */ ExtensionRangeOptions.create = function create(properties) { return new ExtensionRangeOptions(properties); }; /** * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ExtensionRangeOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRangeOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ExtensionRangeOptions message. * @function verify * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ExtensionRangeOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions */ ExtensionRangeOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ExtensionRangeOptions) return object; var message = new $root.google.protobuf.ExtensionRangeOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ExtensionRangeOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this ExtensionRangeOptions to JSON. * @function toJSON * @memberof google.protobuf.ExtensionRangeOptions * @instance * @returns {Object.} JSON object */ ExtensionRangeOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ExtensionRangeOptions; })(); protobuf.FieldDescriptorProto = (function() { /** * Properties of a FieldDescriptorProto. * @memberof google.protobuf * @interface IFieldDescriptorProto * @property {string|null} [name] FieldDescriptorProto name * @property {number|null} [number] FieldDescriptorProto number * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type * @property {string|null} [typeName] FieldDescriptorProto typeName * @property {string|null} [extendee] FieldDescriptorProto extendee * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex * @property {string|null} [jsonName] FieldDescriptorProto jsonName * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional */ /** * Constructs a new FieldDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FieldDescriptorProto. * @implements IFieldDescriptorProto * @constructor * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set */ function FieldDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldDescriptorProto name. * @member {string} name * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.name = ""; /** * FieldDescriptorProto number. * @member {number} number * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.number = 0; /** * FieldDescriptorProto label. * @member {google.protobuf.FieldDescriptorProto.Label} label * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.label = 1; /** * FieldDescriptorProto type. * @member {google.protobuf.FieldDescriptorProto.Type} type * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.type = 1; /** * FieldDescriptorProto typeName. * @member {string} typeName * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.typeName = ""; /** * FieldDescriptorProto extendee. * @member {string} extendee * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.extendee = ""; /** * FieldDescriptorProto defaultValue. * @member {string} defaultValue * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.defaultValue = ""; /** * FieldDescriptorProto oneofIndex. * @member {number} oneofIndex * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.oneofIndex = 0; /** * FieldDescriptorProto jsonName. * @member {string} jsonName * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.jsonName = ""; /** * FieldDescriptorProto options. * @member {google.protobuf.IFieldOptions|null|undefined} options * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.options = null; /** * FieldDescriptorProto proto3Optional. * @member {boolean} proto3Optional * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.proto3Optional = false; /** * Creates a new FieldDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance */ FieldDescriptorProto.create = function create(properties) { return new FieldDescriptorProto(properties); }; /** * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); return writer; }; /** * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 3: message.number = reader.int32(); break; case 4: message.label = reader.int32(); break; case 5: message.type = reader.int32(); break; case 6: message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: message.defaultValue = reader.string(); break; case 9: message.oneofIndex = reader.int32(); break; case 10: message.jsonName = reader.string(); break; case 8: message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); break; case 17: message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldDescriptorProto message. * @function verify * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; if (message.label != null && message.hasOwnProperty("label")) switch (message.label) { default: return "label: enum value expected"; case 1: case 2: case 3: break; } if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: return "type: enum value expected"; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: break; } if (message.typeName != null && message.hasOwnProperty("typeName")) if (!$util.isString(message.typeName)) return "typeName: string expected"; if (message.extendee != null && message.hasOwnProperty("extendee")) if (!$util.isString(message.extendee)) return "extendee: string expected"; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) if (!$util.isString(message.defaultValue)) return "defaultValue: string expected"; if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) if (!$util.isInteger(message.oneofIndex)) return "oneofIndex: integer expected"; if (message.jsonName != null && message.hasOwnProperty("jsonName")) if (!$util.isString(message.jsonName)) return "jsonName: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FieldOptions.verify(message.options); if (error) return "options." + error; } if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) if (typeof message.proto3Optional !== "boolean") return "proto3Optional: boolean expected"; return null; }; /** * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto */ FieldDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldDescriptorProto) return object; var message = new $root.google.protobuf.FieldDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.number != null) message.number = object.number | 0; switch (object.label) { case "LABEL_OPTIONAL": case 1: message.label = 1; break; case "LABEL_REQUIRED": case 2: message.label = 2; break; case "LABEL_REPEATED": case 3: message.label = 3; break; } switch (object.type) { case "TYPE_DOUBLE": case 1: message.type = 1; break; case "TYPE_FLOAT": case 2: message.type = 2; break; case "TYPE_INT64": case 3: message.type = 3; break; case "TYPE_UINT64": case 4: message.type = 4; break; case "TYPE_INT32": case 5: message.type = 5; break; case "TYPE_FIXED64": case 6: message.type = 6; break; case "TYPE_FIXED32": case 7: message.type = 7; break; case "TYPE_BOOL": case 8: message.type = 8; break; case "TYPE_STRING": case 9: message.type = 9; break; case "TYPE_GROUP": case 10: message.type = 10; break; case "TYPE_MESSAGE": case 11: message.type = 11; break; case "TYPE_BYTES": case 12: message.type = 12; break; case "TYPE_UINT32": case 13: message.type = 13; break; case "TYPE_ENUM": case 14: message.type = 14; break; case "TYPE_SFIXED32": case 15: message.type = 15; break; case "TYPE_SFIXED64": case 16: message.type = 16; break; case "TYPE_SINT32": case 17: message.type = 17; break; case "TYPE_SINT64": case 18: message.type = 18; break; } if (object.typeName != null) message.typeName = String(object.typeName); if (object.extendee != null) message.extendee = String(object.extendee); if (object.defaultValue != null) message.defaultValue = String(object.defaultValue); if (object.oneofIndex != null) message.oneofIndex = object.oneofIndex | 0; if (object.jsonName != null) message.jsonName = String(object.jsonName); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); } if (object.proto3Optional != null) message.proto3Optional = Boolean(object.proto3Optional); return message; }; /** * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.extendee = ""; object.number = 0; object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; object.type = options.enums === String ? "TYPE_DOUBLE" : 1; object.typeName = ""; object.defaultValue = ""; object.options = null; object.oneofIndex = 0; object.jsonName = ""; object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.extendee != null && message.hasOwnProperty("extendee")) object.extendee = message.extendee; if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) object.defaultValue = message.defaultValue; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) object.oneofIndex = message.oneofIndex; if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) object.proto3Optional = message.proto3Optional; return object; }; /** * Converts this FieldDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.FieldDescriptorProto * @instance * @returns {Object.} JSON object */ FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type * @enum {number} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value * @property {number} TYPE_UINT64=4 TYPE_UINT64 value * @property {number} TYPE_INT32=5 TYPE_INT32 value * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value * @property {number} TYPE_BOOL=8 TYPE_BOOL value * @property {number} TYPE_STRING=9 TYPE_STRING value * @property {number} TYPE_GROUP=10 TYPE_GROUP value * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value * @property {number} TYPE_BYTES=12 TYPE_BYTES value * @property {number} TYPE_UINT32=13 TYPE_UINT32 value * @property {number} TYPE_ENUM=14 TYPE_ENUM value * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value * @property {number} TYPE_SINT32=17 TYPE_SINT32 value * @property {number} TYPE_SINT64=18 TYPE_SINT64 value */ FieldDescriptorProto.Type = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "TYPE_DOUBLE"] = 1; values[valuesById[2] = "TYPE_FLOAT"] = 2; values[valuesById[3] = "TYPE_INT64"] = 3; values[valuesById[4] = "TYPE_UINT64"] = 4; values[valuesById[5] = "TYPE_INT32"] = 5; values[valuesById[6] = "TYPE_FIXED64"] = 6; values[valuesById[7] = "TYPE_FIXED32"] = 7; values[valuesById[8] = "TYPE_BOOL"] = 8; values[valuesById[9] = "TYPE_STRING"] = 9; values[valuesById[10] = "TYPE_GROUP"] = 10; values[valuesById[11] = "TYPE_MESSAGE"] = 11; values[valuesById[12] = "TYPE_BYTES"] = 12; values[valuesById[13] = "TYPE_UINT32"] = 13; values[valuesById[14] = "TYPE_ENUM"] = 14; values[valuesById[15] = "TYPE_SFIXED32"] = 15; values[valuesById[16] = "TYPE_SFIXED64"] = 16; values[valuesById[17] = "TYPE_SINT32"] = 17; values[valuesById[18] = "TYPE_SINT64"] = 18; return values; })(); /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value */ FieldDescriptorProto.Label = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "LABEL_OPTIONAL"] = 1; values[valuesById[2] = "LABEL_REQUIRED"] = 2; values[valuesById[3] = "LABEL_REPEATED"] = 3; return values; })(); return FieldDescriptorProto; })(); protobuf.OneofDescriptorProto = (function() { /** * Properties of an OneofDescriptorProto. * @memberof google.protobuf * @interface IOneofDescriptorProto * @property {string|null} [name] OneofDescriptorProto name * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options */ /** * Constructs a new OneofDescriptorProto. * @memberof google.protobuf * @classdesc Represents an OneofDescriptorProto. * @implements IOneofDescriptorProto * @constructor * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ function OneofDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OneofDescriptorProto name. * @member {string} name * @memberof google.protobuf.OneofDescriptorProto * @instance */ OneofDescriptorProto.prototype.name = ""; /** * OneofDescriptorProto options. * @member {google.protobuf.IOneofOptions|null|undefined} options * @memberof google.protobuf.OneofDescriptorProto * @instance */ OneofDescriptorProto.prototype.options = null; /** * Creates a new OneofDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance */ OneofDescriptorProto.create = function create(properties) { return new OneofDescriptorProto(properties); }; /** * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OneofDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OneofDescriptorProto message. * @function verify * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OneofDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.OneofOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ OneofDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; var message = new $root.google.protobuf.OneofDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OneofDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); return object; }; /** * Converts this OneofDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.OneofDescriptorProto * @instance * @returns {Object.} JSON object */ OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OneofDescriptorProto; })(); protobuf.EnumDescriptorProto = (function() { /** * Properties of an EnumDescriptorProto. * @memberof google.protobuf * @interface IEnumDescriptorProto * @property {string|null} [name] EnumDescriptorProto name * @property {Array.|null} [value] EnumDescriptorProto value * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName */ /** * Constructs a new EnumDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumDescriptorProto. * @implements IEnumDescriptorProto * @constructor * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ function EnumDescriptorProto(properties) { this.value = []; this.reservedRange = []; this.reservedName = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumDescriptorProto name. * @member {string} name * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.name = ""; /** * EnumDescriptorProto value. * @member {Array.} value * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.value = $util.emptyArray; /** * EnumDescriptorProto options. * @member {google.protobuf.IEnumOptions|null|undefined} options * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.options = null; /** * EnumDescriptorProto reservedRange. * @member {Array.} reservedRange * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; /** * EnumDescriptorProto reservedName. * @member {Array.} reservedName * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ EnumDescriptorProto.create = function create(properties) { return new EnumDescriptorProto(properties); }; /** * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); return writer; }; /** * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.value && message.value.length)) message.value = []; message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); break; case 4: if (!(message.reservedRange && message.reservedRange.length)) message.reservedRange = []; message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); break; case 5: if (!(message.reservedName && message.reservedName.length)) message.reservedName = []; message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumDescriptorProto message. * @function verify * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.value != null && message.hasOwnProperty("value")) { if (!Array.isArray(message.value)) return "value: array expected"; for (var i = 0; i < message.value.length; ++i) { var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); if (error) return "value." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumOptions.verify(message.options); if (error) return "options." + error; } if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } } if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } return null; }; /** * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ EnumDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; var message = new $root.google.protobuf.EnumDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.value) { if (!Array.isArray(object.value)) throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); message.value = []; for (var i = 0; i < object.value.length; ++i) { if (typeof object.value[i] !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); } if (object.reservedRange) { if (!Array.isArray(object.reservedRange)) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { if (typeof object.reservedRange[i] !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); } } if (object.reservedName) { if (!Array.isArray(object.reservedName)) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); message.reservedName = []; for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } return message; }; /** * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.value = []; object.reservedRange = []; object.reservedName = []; } if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.value && message.value.length) { object.value = []; for (var j = 0; j < message.value.length; ++j) object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); if (message.reservedRange && message.reservedRange.length) { object.reservedRange = []; for (var j = 0; j < message.reservedRange.length; ++j) object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } return object; }; /** * Converts this EnumDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.EnumDescriptorProto * @instance * @returns {Object.} JSON object */ EnumDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; EnumDescriptorProto.EnumReservedRange = (function() { /** * Properties of an EnumReservedRange. * @memberof google.protobuf.EnumDescriptorProto * @interface IEnumReservedRange * @property {number|null} [start] EnumReservedRange start * @property {number|null} [end] EnumReservedRange end */ /** * Constructs a new EnumReservedRange. * @memberof google.protobuf.EnumDescriptorProto * @classdesc Represents an EnumReservedRange. * @implements IEnumReservedRange * @constructor * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set */ function EnumReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumReservedRange start. * @member {number} start * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ EnumReservedRange.prototype.start = 0; /** * EnumReservedRange end. * @member {number} end * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ EnumReservedRange.prototype.end = 0; /** * Creates a new EnumReservedRange instance using the specified properties. * @function create * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance */ EnumReservedRange.create = function create(properties) { return new EnumReservedRange(properties); }; /** * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumReservedRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumReservedRange message. * @function verify * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange */ EnumReservedRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) return object; var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this EnumReservedRange to JSON. * @function toJSON * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance * @returns {Object.} JSON object */ EnumReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumReservedRange; })(); return EnumDescriptorProto; })(); protobuf.EnumValueDescriptorProto = (function() { /** * Properties of an EnumValueDescriptorProto. * @memberof google.protobuf * @interface IEnumValueDescriptorProto * @property {string|null} [name] EnumValueDescriptorProto name * @property {number|null} [number] EnumValueDescriptorProto number * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options */ /** * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumValueDescriptorProto. * @implements IEnumValueDescriptorProto * @constructor * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumValueDescriptorProto name. * @member {string} name * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.name = ""; /** * EnumValueDescriptorProto number. * @member {number} number * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.number = 0; /** * EnumValueDescriptorProto options. * @member {google.protobuf.IEnumValueOptions|null|undefined} options * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.options = null; /** * Creates a new EnumValueDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ EnumValueDescriptorProto.create = function create(properties) { return new EnumValueDescriptorProto(properties); }; /** * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.number = reader.int32(); break; case 3: message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumValueDescriptorProto message. * @function verify * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumValueDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumValueOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ EnumValueDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; var message = new $root.google.protobuf.EnumValueDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.number != null) message.number = object.number | 0; if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.number = 0; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); return object; }; /** * Converts this EnumValueDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumValueDescriptorProto; })(); protobuf.ServiceDescriptorProto = (function() { /** * Properties of a ServiceDescriptorProto. * @memberof google.protobuf * @interface IServiceDescriptorProto * @property {string|null} [name] ServiceDescriptorProto name * @property {Array.|null} [method] ServiceDescriptorProto method * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options */ /** * Constructs a new ServiceDescriptorProto. * @memberof google.protobuf * @classdesc Represents a ServiceDescriptorProto. * @implements IServiceDescriptorProto * @constructor * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ function ServiceDescriptorProto(properties) { this.method = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ServiceDescriptorProto name. * @member {string} name * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.name = ""; /** * ServiceDescriptorProto method. * @member {Array.} method * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.method = $util.emptyArray; /** * ServiceDescriptorProto options. * @member {google.protobuf.IServiceOptions|null|undefined} options * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.options = null; /** * Creates a new ServiceDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance */ ServiceDescriptorProto.create = function create(properties) { return new ServiceDescriptorProto(properties); }; /** * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ServiceDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.method && message.method.length)) message.method = []; message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ServiceDescriptorProto message. * @function verify * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ServiceDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.method != null && message.hasOwnProperty("method")) { if (!Array.isArray(message.method)) return "method: array expected"; for (var i = 0; i < message.method.length; ++i) { var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); if (error) return "method." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ServiceOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto */ ServiceDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ServiceDescriptorProto) return object; var message = new $root.google.protobuf.ServiceDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.method) { if (!Array.isArray(object.method)) throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); message.method = []; for (var i = 0; i < object.method.length; ++i) { if (typeof object.method[i] !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ServiceDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.method = []; if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.method && message.method.length) { object.method = []; for (var j = 0; j < message.method.length; ++j) object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; /** * Converts this ServiceDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.ServiceDescriptorProto * @instance * @returns {Object.} JSON object */ ServiceDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ServiceDescriptorProto; })(); protobuf.MethodDescriptorProto = (function() { /** * Properties of a MethodDescriptorProto. * @memberof google.protobuf * @interface IMethodDescriptorProto * @property {string|null} [name] MethodDescriptorProto name * @property {string|null} [inputType] MethodDescriptorProto inputType * @property {string|null} [outputType] MethodDescriptorProto outputType * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming */ /** * Constructs a new MethodDescriptorProto. * @memberof google.protobuf * @classdesc Represents a MethodDescriptorProto. * @implements IMethodDescriptorProto * @constructor * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ function MethodDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MethodDescriptorProto name. * @member {string} name * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.name = ""; /** * MethodDescriptorProto inputType. * @member {string} inputType * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.inputType = ""; /** * MethodDescriptorProto outputType. * @member {string} outputType * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.outputType = ""; /** * MethodDescriptorProto options. * @member {google.protobuf.IMethodOptions|null|undefined} options * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.options = null; /** * MethodDescriptorProto clientStreaming. * @member {boolean} clientStreaming * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.clientStreaming = false; /** * MethodDescriptorProto serverStreaming. * @member {boolean} serverStreaming * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.serverStreaming = false; /** * Creates a new MethodDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ MethodDescriptorProto.create = function create(properties) { return new MethodDescriptorProto(properties); }; /** * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; /** * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.inputType = reader.string(); break; case 3: message.outputType = reader.string(); break; case 4: message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); break; case 5: message.clientStreaming = reader.bool(); break; case 6: message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MethodDescriptorProto message. * @function verify * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MethodDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.inputType != null && message.hasOwnProperty("inputType")) if (!$util.isString(message.inputType)) return "inputType: string expected"; if (message.outputType != null && message.hasOwnProperty("outputType")) if (!$util.isString(message.outputType)) return "outputType: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MethodOptions.verify(message.options); if (error) return "options." + error; } if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) if (typeof message.clientStreaming !== "boolean") return "clientStreaming: boolean expected"; if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) if (typeof message.serverStreaming !== "boolean") return "serverStreaming: boolean expected"; return null; }; /** * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ MethodDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MethodDescriptorProto) return object; var message = new $root.google.protobuf.MethodDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.inputType != null) message.inputType = String(object.inputType); if (object.outputType != null) message.outputType = String(object.outputType); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); } if (object.clientStreaming != null) message.clientStreaming = Boolean(object.clientStreaming); if (object.serverStreaming != null) message.serverStreaming = Boolean(object.serverStreaming); return message; }; /** * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.inputType = ""; object.outputType = ""; object.options = null; object.clientStreaming = false; object.serverStreaming = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.inputType != null && message.hasOwnProperty("inputType")) object.inputType = message.inputType; if (message.outputType != null && message.hasOwnProperty("outputType")) object.outputType = message.outputType; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) object.clientStreaming = message.clientStreaming; if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) object.serverStreaming = message.serverStreaming; return object; }; /** * Converts this MethodDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MethodDescriptorProto; })(); protobuf.FileOptions = (function() { /** * Properties of a FileOptions. * @memberof google.protobuf * @interface IFileOptions * @property {string|null} [javaPackage] FileOptions javaPackage * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor * @property {string|null} [goPackage] FileOptions goPackage * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices * @property {boolean|null} [deprecated] FileOptions deprecated * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix * @property {string|null} [csharpNamespace] FileOptions csharpNamespace * @property {string|null} [swiftPrefix] FileOptions swiftPrefix * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix * @property {string|null} [phpNamespace] FileOptions phpNamespace * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition */ /** * Constructs a new FileOptions. * @memberof google.protobuf * @classdesc Represents a FileOptions. * @implements IFileOptions * @constructor * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ function FileOptions(properties) { this.uninterpretedOption = []; this[".google.api.resourceDefinition"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileOptions javaPackage. * @member {string} javaPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaPackage = ""; /** * FileOptions javaOuterClassname. * @member {string} javaOuterClassname * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaOuterClassname = ""; /** * FileOptions javaMultipleFiles. * @member {boolean} javaMultipleFiles * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaMultipleFiles = false; /** * FileOptions javaGenerateEqualsAndHash. * @member {boolean} javaGenerateEqualsAndHash * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaGenerateEqualsAndHash = false; /** * FileOptions javaStringCheckUtf8. * @member {boolean} javaStringCheckUtf8 * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaStringCheckUtf8 = false; /** * FileOptions optimizeFor. * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.optimizeFor = 1; /** * FileOptions goPackage. * @member {string} goPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.goPackage = ""; /** * FileOptions ccGenericServices. * @member {boolean} ccGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.ccGenericServices = false; /** * FileOptions javaGenericServices. * @member {boolean} javaGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaGenericServices = false; /** * FileOptions pyGenericServices. * @member {boolean} pyGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.pyGenericServices = false; /** * FileOptions phpGenericServices. * @member {boolean} phpGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpGenericServices = false; /** * FileOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.deprecated = false; /** * FileOptions ccEnableArenas. * @member {boolean} ccEnableArenas * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. * @member {string} objcClassPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.objcClassPrefix = ""; /** * FileOptions csharpNamespace. * @member {string} csharpNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.csharpNamespace = ""; /** * FileOptions swiftPrefix. * @member {string} swiftPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.swiftPrefix = ""; /** * FileOptions phpClassPrefix. * @member {string} phpClassPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpClassPrefix = ""; /** * FileOptions phpNamespace. * @member {string} phpNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpNamespace = ""; /** * FileOptions phpMetadataNamespace. * @member {string} phpMetadataNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpMetadataNamespace = ""; /** * FileOptions rubyPackage. * @member {string} rubyPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.rubyPackage = ""; /** * FileOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; /** * FileOptions .google.api.resourceDefinition. * @member {Array.} .google.api.resourceDefinition * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; /** * Creates a new FileOptions instance using the specified properties. * @function create * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions=} [properties] Properties to set * @returns {google.protobuf.FileOptions} FileOptions instance */ FileOptions.create = function create(properties) { return new FileOptions(properties); }; /** * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; /** * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileOptions} FileOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.javaPackage = reader.string(); break; case 8: message.javaOuterClassname = reader.string(); break; case 10: message.javaMultipleFiles = reader.bool(); break; case 20: message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: message.javaStringCheckUtf8 = reader.bool(); break; case 9: message.optimizeFor = reader.int32(); break; case 11: message.goPackage = reader.string(); break; case 16: message.ccGenericServices = reader.bool(); break; case 17: message.javaGenericServices = reader.bool(); break; case 18: message.pyGenericServices = reader.bool(); break; case 42: message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: message.ccEnableArenas = reader.bool(); break; case 36: message.objcClassPrefix = reader.string(); break; case 37: message.csharpNamespace = reader.string(); break; case 39: message.swiftPrefix = reader.string(); break; case 40: message.phpClassPrefix = reader.string(); break; case 41: message.phpNamespace = reader.string(); break; case 44: message.phpMetadataNamespace = reader.string(); break; case 45: message.rubyPackage = reader.string(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1053: if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) message[".google.api.resourceDefinition"] = []; message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileOptions} FileOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileOptions message. * @function verify * @memberof google.protobuf.FileOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) if (!$util.isString(message.javaPackage)) return "javaPackage: string expected"; if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) if (!$util.isString(message.javaOuterClassname)) return "javaOuterClassname: string expected"; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) if (typeof message.javaMultipleFiles !== "boolean") return "javaMultipleFiles: boolean expected"; if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) if (typeof message.javaGenerateEqualsAndHash !== "boolean") return "javaGenerateEqualsAndHash: boolean expected"; if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) if (typeof message.javaStringCheckUtf8 !== "boolean") return "javaStringCheckUtf8: boolean expected"; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) switch (message.optimizeFor) { default: return "optimizeFor: enum value expected"; case 1: case 2: case 3: break; } if (message.goPackage != null && message.hasOwnProperty("goPackage")) if (!$util.isString(message.goPackage)) return "goPackage: string expected"; if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) if (typeof message.ccGenericServices !== "boolean") return "ccGenericServices: boolean expected"; if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) if (typeof message.javaGenericServices !== "boolean") return "javaGenericServices: boolean expected"; if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) if (typeof message.pyGenericServices !== "boolean") return "pyGenericServices: boolean expected"; if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) if (typeof message.phpGenericServices !== "boolean") return "phpGenericServices: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) if (typeof message.ccEnableArenas !== "boolean") return "ccEnableArenas: boolean expected"; if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) if (!$util.isString(message.objcClassPrefix)) return "objcClassPrefix: string expected"; if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) if (!$util.isString(message.csharpNamespace)) return "csharpNamespace: string expected"; if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) if (!$util.isString(message.swiftPrefix)) return "swiftPrefix: string expected"; if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) if (!$util.isString(message.phpClassPrefix)) return "phpClassPrefix: string expected"; if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) if (!$util.isString(message.phpNamespace)) return "phpNamespace: string expected"; if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) if (!$util.isString(message.phpMetadataNamespace)) return "phpMetadataNamespace: string expected"; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) if (!$util.isString(message.rubyPackage)) return "rubyPackage: string expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { if (!Array.isArray(message[".google.api.resourceDefinition"])) return ".google.api.resourceDefinition: array expected"; for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); if (error) return ".google.api.resourceDefinition." + error; } } return null; }; /** * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileOptions} FileOptions */ FileOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileOptions) return object; var message = new $root.google.protobuf.FileOptions(); if (object.javaPackage != null) message.javaPackage = String(object.javaPackage); if (object.javaOuterClassname != null) message.javaOuterClassname = String(object.javaOuterClassname); if (object.javaMultipleFiles != null) message.javaMultipleFiles = Boolean(object.javaMultipleFiles); if (object.javaGenerateEqualsAndHash != null) message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { case "SPEED": case 1: message.optimizeFor = 1; break; case "CODE_SIZE": case 2: message.optimizeFor = 2; break; case "LITE_RUNTIME": case 3: message.optimizeFor = 3; break; } if (object.goPackage != null) message.goPackage = String(object.goPackage); if (object.ccGenericServices != null) message.ccGenericServices = Boolean(object.ccGenericServices); if (object.javaGenericServices != null) message.javaGenericServices = Boolean(object.javaGenericServices); if (object.pyGenericServices != null) message.pyGenericServices = Boolean(object.pyGenericServices); if (object.phpGenericServices != null) message.phpGenericServices = Boolean(object.phpGenericServices); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.ccEnableArenas != null) message.ccEnableArenas = Boolean(object.ccEnableArenas); if (object.objcClassPrefix != null) message.objcClassPrefix = String(object.objcClassPrefix); if (object.csharpNamespace != null) message.csharpNamespace = String(object.csharpNamespace); if (object.swiftPrefix != null) message.swiftPrefix = String(object.swiftPrefix); if (object.phpClassPrefix != null) message.phpClassPrefix = String(object.phpClassPrefix); if (object.phpNamespace != null) message.phpNamespace = String(object.phpNamespace); if (object.phpMetadataNamespace != null) message.phpMetadataNamespace = String(object.phpMetadataNamespace); if (object.rubyPackage != null) message.rubyPackage = String(object.rubyPackage); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.resourceDefinition"]) { if (!Array.isArray(object[".google.api.resourceDefinition"])) throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); message[".google.api.resourceDefinition"] = []; for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { if (typeof object[".google.api.resourceDefinition"][i] !== "object") throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); } } return message; }; /** * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; object[".google.api.resourceDefinition"] = []; } if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; object.optimizeFor = options.enums === String ? "SPEED" : 1; object.javaMultipleFiles = false; object.goPackage = ""; object.ccGenericServices = false; object.javaGenericServices = false; object.pyGenericServices = false; object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; object.phpClassPrefix = ""; object.phpNamespace = ""; object.phpGenericServices = false; object.phpMetadataNamespace = ""; object.rubyPackage = ""; } if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) object.javaPackage = message.javaPackage; if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) object.goPackage = message.goPackage; if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) object.ccGenericServices = message.ccGenericServices; if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) object.javaGenericServices = message.javaGenericServices; if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) object.pyGenericServices = message.pyGenericServices; if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) object.javaStringCheckUtf8 = message.javaStringCheckUtf8; if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) object.ccEnableArenas = message.ccEnableArenas; if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) object.objcClassPrefix = message.objcClassPrefix; if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) object.csharpNamespace = message.csharpNamespace; if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) object.swiftPrefix = message.swiftPrefix; if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) object.phpClassPrefix = message.phpClassPrefix; if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) object.phpNamespace = message.phpNamespace; if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) object.phpGenericServices = message.phpGenericServices; if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) object.phpMetadataNamespace = message.phpMetadataNamespace; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) object.rubyPackage = message.rubyPackage; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { object[".google.api.resourceDefinition"] = []; for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); } return object; }; /** * Converts this FileOptions to JSON. * @function toJSON * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value */ FileOptions.OptimizeMode = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "SPEED"] = 1; values[valuesById[2] = "CODE_SIZE"] = 2; values[valuesById[3] = "LITE_RUNTIME"] = 3; return values; })(); return FileOptions; })(); protobuf.MessageOptions = (function() { /** * Properties of a MessageOptions. * @memberof google.protobuf * @interface IMessageOptions * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor * @property {boolean|null} [deprecated] MessageOptions deprecated * @property {boolean|null} [mapEntry] MessageOptions mapEntry * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ /** * Constructs a new MessageOptions. * @memberof google.protobuf * @classdesc Represents a MessageOptions. * @implements IMessageOptions * @constructor * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ function MessageOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MessageOptions messageSetWireFormat. * @member {boolean} messageSetWireFormat * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.messageSetWireFormat = false; /** * MessageOptions noStandardDescriptorAccessor. * @member {boolean} noStandardDescriptorAccessor * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.noStandardDescriptorAccessor = false; /** * MessageOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.deprecated = false; /** * MessageOptions mapEntry. * @member {boolean} mapEntry * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.mapEntry = false; /** * MessageOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; /** * MessageOptions .google.api.resource. * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype[".google.api.resource"] = null; /** * Creates a new MessageOptions instance using the specified properties. * @function create * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions=} [properties] Properties to set * @returns {google.protobuf.MessageOptions} MessageOptions instance */ MessageOptions.create = function create(properties) { return new MessageOptions(properties); }; /** * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; /** * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MessageOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessageOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.messageSetWireFormat = reader.bool(); break; case 2: message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: message.mapEntry = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1053: message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MessageOptions message. * @function verify * @memberof google.protobuf.MessageOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MessageOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) if (typeof message.messageSetWireFormat !== "boolean") return "messageSetWireFormat: boolean expected"; if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) if (typeof message.noStandardDescriptorAccessor !== "boolean") return "noStandardDescriptorAccessor: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) if (typeof message.mapEntry !== "boolean") return "mapEntry: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); if (error) return ".google.api.resource." + error; } return null; }; /** * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.MessageOptions} MessageOptions */ MessageOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MessageOptions) return object; var message = new $root.google.protobuf.MessageOptions(); if (object.messageSetWireFormat != null) message.messageSetWireFormat = Boolean(object.messageSetWireFormat); if (object.noStandardDescriptorAccessor != null) message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.mapEntry != null) message.mapEntry = Boolean(object.mapEntry); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.resource"] != null) { if (typeof object[".google.api.resource"] !== "object") throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); } return message; }; /** * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.messageSetWireFormat = false; object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) object.mapEntry = message.mapEntry; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); return object; }; /** * Converts this MessageOptions to JSON. * @function toJSON * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MessageOptions; })(); protobuf.FieldOptions = (function() { /** * Properties of a FieldOptions. * @memberof google.protobuf * @interface IFieldOptions * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype * @property {boolean|null} [packed] FieldOptions packed * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype * @property {boolean|null} [lazy] FieldOptions lazy * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** * Constructs a new FieldOptions. * @memberof google.protobuf * @classdesc Represents a FieldOptions. * @implements IFieldOptions * @constructor * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ function FieldOptions(properties) { this.uninterpretedOption = []; this[".google.api.fieldBehavior"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldOptions ctype. * @member {google.protobuf.FieldOptions.CType} ctype * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.ctype = 0; /** * FieldOptions packed. * @member {boolean} packed * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.packed = false; /** * FieldOptions jstype. * @member {google.protobuf.FieldOptions.JSType} jstype * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.jstype = 0; /** * FieldOptions lazy. * @member {boolean} lazy * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.lazy = false; /** * FieldOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.deprecated = false; /** * FieldOptions weak. * @member {boolean} weak * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.weak = false; /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** * FieldOptions .google.api.fieldBehavior. * @member {Array.} .google.api.fieldBehavior * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** * FieldOptions .google.api.resourceReference. * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype[".google.api.resourceReference"] = null; /** * Creates a new FieldOptions instance using the specified properties. * @function create * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions=} [properties] Properties to set * @returns {google.protobuf.FieldOptions} FieldOptions instance */ FieldOptions.create = function create(properties) { return new FieldOptions(properties); }; /** * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; /** * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.ctype = reader.int32(); break; case 2: message.packed = reader.bool(); break; case 6: message.jstype = reader.int32(); break; case 5: message.lazy = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 10: message.weak = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1052: if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message[".google.api.fieldBehavior"].push(reader.int32()); } else message[".google.api.fieldBehavior"].push(reader.int32()); break; case 1055: message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldOptions message. * @function verify * @memberof google.protobuf.FieldOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.ctype != null && message.hasOwnProperty("ctype")) switch (message.ctype) { default: return "ctype: enum value expected"; case 0: case 1: case 2: break; } if (message.packed != null && message.hasOwnProperty("packed")) if (typeof message.packed !== "boolean") return "packed: boolean expected"; if (message.jstype != null && message.hasOwnProperty("jstype")) switch (message.jstype) { default: return "jstype: enum value expected"; case 0: case 1: case 2: break; } if (message.lazy != null && message.hasOwnProperty("lazy")) if (typeof message.lazy !== "boolean") return "lazy: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.weak != null && message.hasOwnProperty("weak")) if (typeof message.weak !== "boolean") return "weak: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) switch (message[".google.api.fieldBehavior"][i]) { default: return ".google.api.fieldBehavior: enum value[] expected"; case 0: case 1: case 2: case 3: case 4: case 5: break; } } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); if (error) return ".google.api.resourceReference." + error; } return null; }; /** * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldOptions} FieldOptions */ FieldOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldOptions) return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { case "STRING": case 0: message.ctype = 0; break; case "CORD": case 1: message.ctype = 1; break; case "STRING_PIECE": case 2: message.ctype = 2; break; } if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { case "JS_NORMAL": case 0: message.jstype = 0; break; case "JS_STRING": case 1: message.jstype = 1; break; case "JS_NUMBER": case 2: message.jstype = 2; break; } if (object.lazy != null) message.lazy = Boolean(object.lazy); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.weak != null) message.weak = Boolean(object.weak); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); message[".google.api.fieldBehavior"] = []; for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) switch (object[".google.api.fieldBehavior"][i]) { default: case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: message[".google.api.fieldBehavior"][i] = 0; break; case "OPTIONAL": case 1: message[".google.api.fieldBehavior"][i] = 1; break; case "REQUIRED": case 2: message[".google.api.fieldBehavior"][i] = 2; break; case "OUTPUT_ONLY": case 3: message[".google.api.fieldBehavior"][i] = 3; break; case "INPUT_ONLY": case 4: message[".google.api.fieldBehavior"][i] = 4; break; case "IMMUTABLE": case 5: message[".google.api.fieldBehavior"][i] = 5; break; } } if (object[".google.api.resourceReference"] != null) { if (typeof object[".google.api.resourceReference"] !== "object") throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); } return message; }; /** * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; object[".google.api.fieldBehavior"] = []; } if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; object.packed = false; object.deprecated = false; object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { object[".google.api.fieldBehavior"] = []; for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); return object; }; /** * Converts this FieldOptions to JSON. * @function toJSON * @memberof google.protobuf.FieldOptions * @instance * @returns {Object.} JSON object */ FieldOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * CType enum. * @name google.protobuf.FieldOptions.CType * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value */ FieldOptions.CType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STRING"] = 0; values[valuesById[1] = "CORD"] = 1; values[valuesById[2] = "STRING_PIECE"] = 2; return values; })(); /** * JSType enum. * @name google.protobuf.FieldOptions.JSType * @enum {number} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value */ FieldOptions.JSType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "JS_NORMAL"] = 0; values[valuesById[1] = "JS_STRING"] = 1; values[valuesById[2] = "JS_NUMBER"] = 2; return values; })(); return FieldOptions; })(); protobuf.OneofOptions = (function() { /** * Properties of an OneofOptions. * @memberof google.protobuf * @interface IOneofOptions * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** * Constructs a new OneofOptions. * @memberof google.protobuf * @classdesc Represents an OneofOptions. * @implements IOneofOptions * @constructor * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ function OneofOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OneofOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.OneofOptions * @instance */ OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new OneofOptions instance using the specified properties. * @function create * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions=} [properties] Properties to set * @returns {google.protobuf.OneofOptions} OneofOptions instance */ OneofOptions.create = function create(properties) { return new OneofOptions(properties); }; /** * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OneofOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OneofOptions message. * @function verify * @memberof google.protobuf.OneofOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OneofOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.OneofOptions} OneofOptions */ OneofOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.OneofOptions) return object; var message = new $root.google.protobuf.OneofOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OneofOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this OneofOptions to JSON. * @function toJSON * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OneofOptions; })(); protobuf.EnumOptions = (function() { /** * Properties of an EnumOptions. * @memberof google.protobuf * @interface IEnumOptions * @property {boolean|null} [allowAlias] EnumOptions allowAlias * @property {boolean|null} [deprecated] EnumOptions deprecated * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** * Constructs a new EnumOptions. * @memberof google.protobuf * @classdesc Represents an EnumOptions. * @implements IEnumOptions * @constructor * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ function EnumOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumOptions allowAlias. * @member {boolean} allowAlias * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.allowAlias = false; /** * EnumOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.deprecated = false; /** * EnumOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new EnumOptions instance using the specified properties. * @function create * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions=} [properties] Properties to set * @returns {google.protobuf.EnumOptions} EnumOptions instance */ EnumOptions.create = function create(properties) { return new EnumOptions(properties); }; /** * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumOptions message. * @function verify * @memberof google.protobuf.EnumOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) if (typeof message.allowAlias !== "boolean") return "allowAlias: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumOptions} EnumOptions */ EnumOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumOptions) return object; var message = new $root.google.protobuf.EnumOptions(); if (object.allowAlias != null) message.allowAlias = Boolean(object.allowAlias); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.allowAlias = false; object.deprecated = false; } if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) object.allowAlias = message.allowAlias; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this EnumOptions to JSON. * @function toJSON * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumOptions; })(); protobuf.EnumValueOptions = (function() { /** * Properties of an EnumValueOptions. * @memberof google.protobuf * @interface IEnumValueOptions * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** * Constructs a new EnumValueOptions. * @memberof google.protobuf * @classdesc Represents an EnumValueOptions. * @implements IEnumValueOptions * @constructor * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ function EnumValueOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumValueOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.EnumValueOptions * @instance */ EnumValueOptions.prototype.deprecated = false; /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.EnumValueOptions * @instance */ EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new EnumValueOptions instance using the specified properties. * @function create * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ EnumValueOptions.create = function create(properties) { return new EnumValueOptions(properties); }; /** * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumValueOptions message. * @function verify * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumValueOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ EnumValueOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumValueOptions) return object; var message = new $root.google.protobuf.EnumValueOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumValueOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) object.deprecated = false; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this EnumValueOptions to JSON. * @function toJSON * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumValueOptions; })(); protobuf.ServiceOptions = (function() { /** * Properties of a ServiceOptions. * @memberof google.protobuf * @interface IServiceOptions * @property {boolean|null} [deprecated] ServiceOptions deprecated * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes */ /** * Constructs a new ServiceOptions. * @memberof google.protobuf * @classdesc Represents a ServiceOptions. * @implements IServiceOptions * @constructor * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ function ServiceOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ServiceOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype.deprecated = false; /** * ServiceOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** * ServiceOptions .google.api.defaultHost. * @member {string} .google.api.defaultHost * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** * ServiceOptions .google.api.oauthScopes. * @member {string} .google.api.oauthScopes * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype[".google.api.oauthScopes"] = ""; /** * Creates a new ServiceOptions instance using the specified properties. * @function create * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions=} [properties] Properties to set * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ ServiceOptions.create = function create(properties) { return new ServiceOptions(properties); }; /** * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; /** * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 33: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1049: message[".google.api.defaultHost"] = reader.string(); break; case 1050: message[".google.api.oauthScopes"] = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ServiceOptions message. * @function verify * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ServiceOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) if (!$util.isString(message[".google.api.defaultHost"])) return ".google.api.defaultHost: string expected"; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) if (!$util.isString(message[".google.api.oauthScopes"])) return ".google.api.oauthScopes: string expected"; return null; }; /** * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.ServiceOptions} ServiceOptions */ ServiceOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ServiceOptions) return object; var message = new $root.google.protobuf.ServiceOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.defaultHost"] != null) message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); if (object[".google.api.oauthScopes"] != null) message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; /** * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.deprecated = false; object[".google.api.defaultHost"] = ""; object[".google.api.oauthScopes"] = ""; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; /** * Converts this ServiceOptions to JSON. * @function toJSON * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ServiceOptions; })(); protobuf.MethodOptions = (function() { /** * Properties of a MethodOptions. * @memberof google.protobuf * @interface IMethodOptions * @property {boolean|null} [deprecated] MethodOptions deprecated * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature */ /** * Constructs a new MethodOptions. * @memberof google.protobuf * @classdesc Represents a MethodOptions. * @implements IMethodOptions * @constructor * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ function MethodOptions(properties) { this.uninterpretedOption = []; this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MethodOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.deprecated = false; /** * MethodOptions idempotencyLevel. * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.idempotencyLevel = 0; /** * MethodOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** * MethodOptions .google.api.http. * @member {google.api.IHttpRule|null|undefined} .google.api.http * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.api.http"] = null; /** * MethodOptions .google.api.methodSignature. * @member {Array.} .google.api.methodSignature * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** * Creates a new MethodOptions instance using the specified properties. * @function create * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions=} [properties] Properties to set * @returns {google.protobuf.MethodOptions} MethodOptions instance */ MethodOptions.create = function create(properties) { return new MethodOptions(properties); }; /** * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; /** * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MethodOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 33: message.deprecated = reader.bool(); break; case 34: message.idempotencyLevel = reader.int32(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 72295728: message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; case 1051: if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) message[".google.api.methodSignature"] = []; message[".google.api.methodSignature"].push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MethodOptions message. * @function verify * @memberof google.protobuf.MethodOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) switch (message.idempotencyLevel) { default: return "idempotencyLevel: enum value expected"; case 0: case 1: case 2: break; } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); if (error) return ".google.api.http." + error; } if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { if (!Array.isArray(message[".google.api.methodSignature"])) return ".google.api.methodSignature: array expected"; for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) if (!$util.isString(message[".google.api.methodSignature"][i])) return ".google.api.methodSignature: string[] expected"; } return null; }; /** * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.MethodOptions} MethodOptions */ MethodOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MethodOptions) return object; var message = new $root.google.protobuf.MethodOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; break; case "NO_SIDE_EFFECTS": case 1: message.idempotencyLevel = 1; break; case "IDEMPOTENT": case 2: message.idempotencyLevel = 2; break; } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.http"] != null) { if (typeof object[".google.api.http"] !== "object") throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); } if (object[".google.api.methodSignature"]) { if (!Array.isArray(object[".google.api.methodSignature"])) throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); message[".google.api.methodSignature"] = []; for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } return message; }; /** * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; object[".google.api.methodSignature"] = []; } if (options.defaults) { object.deprecated = false; object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; object[".google.api.http"] = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { object[".google.api.methodSignature"] = []; for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; } if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; /** * Converts this MethodOptions to JSON. * @function toJSON * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel * @enum {number} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value */ MethodOptions.IdempotencyLevel = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; values[valuesById[2] = "IDEMPOTENT"] = 2; return values; })(); return MethodOptions; })(); protobuf.UninterpretedOption = (function() { /** * Properties of an UninterpretedOption. * @memberof google.protobuf * @interface IUninterpretedOption * @property {Array.|null} [name] UninterpretedOption name * @property {string|null} [identifierValue] UninterpretedOption identifierValue * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue * @property {number|null} [doubleValue] UninterpretedOption doubleValue * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue */ /** * Constructs a new UninterpretedOption. * @memberof google.protobuf * @classdesc Represents an UninterpretedOption. * @implements IUninterpretedOption * @constructor * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ function UninterpretedOption(properties) { this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UninterpretedOption name. * @member {Array.} name * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.name = $util.emptyArray; /** * UninterpretedOption identifierValue. * @member {string} identifierValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.identifierValue = ""; /** * UninterpretedOption positiveIntValue. * @member {number|Long} positiveIntValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * UninterpretedOption negativeIntValue. * @member {number|Long} negativeIntValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * UninterpretedOption doubleValue. * @member {number} doubleValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.doubleValue = 0; /** * UninterpretedOption stringValue. * @member {Uint8Array} stringValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** * UninterpretedOption aggregateValue. * @member {string} aggregateValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.aggregateValue = ""; /** * Creates a new UninterpretedOption instance using the specified properties. * @function create * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ UninterpretedOption.create = function create(properties) { return new UninterpretedOption(properties); }; /** * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: if (!(message.name && message.name.length)) message.name = []; message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; case 3: message.identifierValue = reader.string(); break; case 4: message.positiveIntValue = reader.uint64(); break; case 5: message.negativeIntValue = reader.int64(); break; case 6: message.doubleValue = reader.double(); break; case 7: message.stringValue = reader.bytes(); break; case 8: message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UninterpretedOption message. * @function verify * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UninterpretedOption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) { if (!Array.isArray(message.name)) return "name: array expected"; for (var i = 0; i < message.name.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); if (error) return "name." + error; } } if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) if (!$util.isString(message.identifierValue)) return "identifierValue: string expected"; if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) return "positiveIntValue: integer|Long expected"; if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) return "negativeIntValue: integer|Long expected"; if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; if (message.stringValue != null && message.hasOwnProperty("stringValue")) if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) return "stringValue: buffer expected"; if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) if (!$util.isString(message.aggregateValue)) return "aggregateValue: string expected"; return null; }; /** * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ UninterpretedOption.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.UninterpretedOption) return object; var message = new $root.google.protobuf.UninterpretedOption(); if (object.name) { if (!Array.isArray(object.name)) throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); message.name = []; for (var i = 0; i < object.name.length; ++i) { if (typeof object.name[i] !== "object") throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); } } if (object.identifierValue != null) message.identifierValue = String(object.identifierValue); if (object.positiveIntValue != null) if ($util.Long) (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; else if (typeof object.positiveIntValue === "string") message.positiveIntValue = parseInt(object.positiveIntValue, 10); else if (typeof object.positiveIntValue === "number") message.positiveIntValue = object.positiveIntValue; else if (typeof object.positiveIntValue === "object") message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); if (object.negativeIntValue != null) if ($util.Long) (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; else if (typeof object.negativeIntValue === "string") message.negativeIntValue = parseInt(object.negativeIntValue, 10); else if (typeof object.negativeIntValue === "number") message.negativeIntValue = object.negativeIntValue; else if (typeof object.negativeIntValue === "object") message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); if (object.doubleValue != null) message.doubleValue = Number(object.doubleValue); if (object.stringValue != null) if (typeof object.stringValue === "string") $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); else if (object.stringValue.length) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); return message; }; /** * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.name = []; if (options.defaults) { object.identifierValue = ""; if ($util.Long) { var long = new $util.Long(0, 0, true); object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.positiveIntValue = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.negativeIntValue = options.longs === String ? "0" : 0; object.doubleValue = 0; if (options.bytes === String) object.stringValue = ""; else { object.stringValue = []; if (options.bytes !== Array) object.stringValue = $util.newBuffer(object.stringValue); } object.aggregateValue = ""; } if (message.name && message.name.length) { object.name = []; for (var j = 0; j < message.name.length; ++j) object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); } if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) object.identifierValue = message.identifierValue; if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) if (typeof message.positiveIntValue === "number") object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; else object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) if (typeof message.negativeIntValue === "number") object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; else object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; if (message.stringValue != null && message.hasOwnProperty("stringValue")) object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) object.aggregateValue = message.aggregateValue; return object; }; /** * Converts this UninterpretedOption to JSON. * @function toJSON * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; UninterpretedOption.NamePart = (function() { /** * Properties of a NamePart. * @memberof google.protobuf.UninterpretedOption * @interface INamePart * @property {string} namePart NamePart namePart * @property {boolean} isExtension NamePart isExtension */ /** * Constructs a new NamePart. * @memberof google.protobuf.UninterpretedOption * @classdesc Represents a NamePart. * @implements INamePart * @constructor * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set */ function NamePart(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * NamePart namePart. * @member {string} namePart * @memberof google.protobuf.UninterpretedOption.NamePart * @instance */ NamePart.prototype.namePart = ""; /** * NamePart isExtension. * @member {boolean} isExtension * @memberof google.protobuf.UninterpretedOption.NamePart * @instance */ NamePart.prototype.isExtension = false; /** * Creates a new NamePart instance using the specified properties. * @function create * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance */ NamePart.create = function create(properties) { return new NamePart(properties); }; /** * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encode * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NamePart.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); return writer; }; /** * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NamePart.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a NamePart message from the specified reader or buffer. * @function decode * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NamePart.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.namePart = reader.string(); break; case 2: message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); break; } } if (!message.hasOwnProperty("namePart")) throw $util.ProtocolError("missing required 'namePart'", { instance: message }); if (!message.hasOwnProperty("isExtension")) throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; /** * Decodes a NamePart message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NamePart.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a NamePart message. * @function verify * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ NamePart.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (!$util.isString(message.namePart)) return "namePart: string expected"; if (typeof message.isExtension !== "boolean") return "isExtension: boolean expected"; return null; }; /** * Creates a NamePart message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart */ NamePart.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) return object; var message = new $root.google.protobuf.UninterpretedOption.NamePart(); if (object.namePart != null) message.namePart = String(object.namePart); if (object.isExtension != null) message.isExtension = Boolean(object.isExtension); return message; }; /** * Creates a plain object from a NamePart message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ NamePart.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.namePart = ""; object.isExtension = false; } if (message.namePart != null && message.hasOwnProperty("namePart")) object.namePart = message.namePart; if (message.isExtension != null && message.hasOwnProperty("isExtension")) object.isExtension = message.isExtension; return object; }; /** * Converts this NamePart to JSON. * @function toJSON * @memberof google.protobuf.UninterpretedOption.NamePart * @instance * @returns {Object.} JSON object */ NamePart.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return NamePart; })(); return UninterpretedOption; })(); protobuf.SourceCodeInfo = (function() { /** * Properties of a SourceCodeInfo. * @memberof google.protobuf * @interface ISourceCodeInfo * @property {Array.|null} [location] SourceCodeInfo location */ /** * Constructs a new SourceCodeInfo. * @memberof google.protobuf * @classdesc Represents a SourceCodeInfo. * @implements ISourceCodeInfo * @constructor * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ function SourceCodeInfo(properties) { this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SourceCodeInfo location. * @member {Array.} location * @memberof google.protobuf.SourceCodeInfo * @instance */ SourceCodeInfo.prototype.location = $util.emptyArray; /** * Creates a new SourceCodeInfo instance using the specified properties. * @function create * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ SourceCodeInfo.create = function create(properties) { return new SourceCodeInfo(properties); }; /** * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.location != null && message.location.length) for (var i = 0; i < message.location.length; ++i) $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.location && message.location.length)) message.location = []; message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SourceCodeInfo message. * @function verify * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SourceCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.location != null && message.hasOwnProperty("location")) { if (!Array.isArray(message.location)) return "location: array expected"; for (var i = 0; i < message.location.length; ++i) { var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); if (error) return "location." + error; } } return null; }; /** * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ SourceCodeInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; var message = new $root.google.protobuf.SourceCodeInfo(); if (object.location) { if (!Array.isArray(object.location)) throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); message.location = []; for (var i = 0; i < object.location.length; ++i) { if (typeof object.location[i] !== "object") throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); } } return message; }; /** * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.location = []; if (message.location && message.location.length) { object.location = []; for (var j = 0; j < message.location.length; ++j) object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); } return object; }; /** * Converts this SourceCodeInfo to JSON. * @function toJSON * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; SourceCodeInfo.Location = (function() { /** * Properties of a Location. * @memberof google.protobuf.SourceCodeInfo * @interface ILocation * @property {Array.|null} [path] Location path * @property {Array.|null} [span] Location span * @property {string|null} [leadingComments] Location leadingComments * @property {string|null} [trailingComments] Location trailingComments * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments */ /** * Constructs a new Location. * @memberof google.protobuf.SourceCodeInfo * @classdesc Represents a Location. * @implements ILocation * @constructor * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ function Location(properties) { this.path = []; this.span = []; this.leadingDetachedComments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Location path. * @member {Array.} path * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.path = $util.emptyArray; /** * Location span. * @member {Array.} span * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.span = $util.emptyArray; /** * Location leadingComments. * @member {string} leadingComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.leadingComments = ""; /** * Location trailingComments. * @member {string} trailingComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.trailingComments = ""; /** * Location leadingDetachedComments. * @member {Array.} leadingDetachedComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.leadingDetachedComments = $util.emptyArray; /** * Creates a new Location instance using the specified properties. * @function create * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ Location.create = function create(properties) { return new Location(properties); }; /** * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encode * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } if (message.span != null && message.span.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); for (var i = 0; i < message.span.length; ++i) writer.int32(message.span[i]); writer.ldelim(); } if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); return writer; }; /** * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Location message from the specified reader or buffer. * @function decode * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.path && message.path.length)) message.path = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.path.push(reader.int32()); } else message.path.push(reader.int32()); break; case 2: if (!(message.span && message.span.length)) message.span = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.span.push(reader.int32()); } else message.span.push(reader.int32()); break; case 3: message.leadingComments = reader.string(); break; case 4: message.trailingComments = reader.string(); break; case 6: if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) message.leadingDetachedComments = []; message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Location message. * @function verify * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Location.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { if (!Array.isArray(message.path)) return "path: array expected"; for (var i = 0; i < message.path.length; ++i) if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } if (message.span != null && message.hasOwnProperty("span")) { if (!Array.isArray(message.span)) return "span: array expected"; for (var i = 0; i < message.span.length; ++i) if (!$util.isInteger(message.span[i])) return "span: integer[] expected"; } if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) if (!$util.isString(message.leadingComments)) return "leadingComments: string expected"; if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) if (!$util.isString(message.trailingComments)) return "trailingComments: string expected"; if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { if (!Array.isArray(message.leadingDetachedComments)) return "leadingDetachedComments: array expected"; for (var i = 0; i < message.leadingDetachedComments.length; ++i) if (!$util.isString(message.leadingDetachedComments[i])) return "leadingDetachedComments: string[] expected"; } return null; }; /** * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo.Location} Location */ Location.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; var message = new $root.google.protobuf.SourceCodeInfo.Location(); if (object.path) { if (!Array.isArray(object.path)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } if (object.span) { if (!Array.isArray(object.span)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); message.span = []; for (var i = 0; i < object.span.length; ++i) message.span[i] = object.span[i] | 0; } if (object.leadingComments != null) message.leadingComments = String(object.leadingComments); if (object.trailingComments != null) message.trailingComments = String(object.trailingComments); if (object.leadingDetachedComments) { if (!Array.isArray(object.leadingDetachedComments)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); message.leadingDetachedComments = []; for (var i = 0; i < object.leadingDetachedComments.length; ++i) message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); } return message; }; /** * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.path = []; object.span = []; object.leadingDetachedComments = []; } if (options.defaults) { object.leadingComments = ""; object.trailingComments = ""; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } if (message.span && message.span.length) { object.span = []; for (var j = 0; j < message.span.length; ++j) object.span[j] = message.span[j]; } if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) object.leadingComments = message.leadingComments; if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) object.trailingComments = message.trailingComments; if (message.leadingDetachedComments && message.leadingDetachedComments.length) { object.leadingDetachedComments = []; for (var j = 0; j < message.leadingDetachedComments.length; ++j) object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; } return object; }; /** * Converts this Location to JSON. * @function toJSON * @memberof google.protobuf.SourceCodeInfo.Location * @instance * @returns {Object.} JSON object */ Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Location; })(); return SourceCodeInfo; })(); protobuf.GeneratedCodeInfo = (function() { /** * Properties of a GeneratedCodeInfo. * @memberof google.protobuf * @interface IGeneratedCodeInfo * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf * @classdesc Represents a GeneratedCodeInfo. * @implements IGeneratedCodeInfo * @constructor * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ function GeneratedCodeInfo(properties) { this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GeneratedCodeInfo annotation. * @member {Array.} annotation * @memberof google.protobuf.GeneratedCodeInfo * @instance */ GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ GeneratedCodeInfo.create = function create(properties) { return new GeneratedCodeInfo(properties); }; /** * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.annotation != null && message.annotation.length) for (var i = 0; i < message.annotation.length; ++i) $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.annotation && message.annotation.length)) message.annotation = []; message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GeneratedCodeInfo message. * @function verify * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GeneratedCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.annotation != null && message.hasOwnProperty("annotation")) { if (!Array.isArray(message.annotation)) return "annotation: array expected"; for (var i = 0; i < message.annotation.length; ++i) { var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); if (error) return "annotation." + error; } } return null; }; /** * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ GeneratedCodeInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; var message = new $root.google.protobuf.GeneratedCodeInfo(); if (object.annotation) { if (!Array.isArray(object.annotation)) throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); message.annotation = []; for (var i = 0; i < object.annotation.length; ++i) { if (typeof object.annotation[i] !== "object") throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); } } return message; }; /** * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GeneratedCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.annotation = []; if (message.annotation && message.annotation.length) { object.annotation = []; for (var j = 0; j < message.annotation.length; ++j) object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); } return object; }; /** * Converts this GeneratedCodeInfo to JSON. * @function toJSON * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; GeneratedCodeInfo.Annotation = (function() { /** * Properties of an Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @interface IAnnotation * @property {Array.|null} [path] Annotation path * @property {string|null} [sourceFile] Annotation sourceFile * @property {number|null} [begin] Annotation begin * @property {number|null} [end] Annotation end */ /** * Constructs a new Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @classdesc Represents an Annotation. * @implements IAnnotation * @constructor * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set */ function Annotation(properties) { this.path = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Annotation path. * @member {Array.} path * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.path = $util.emptyArray; /** * Annotation sourceFile. * @member {string} sourceFile * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.sourceFile = ""; /** * Annotation begin. * @member {number} begin * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.begin = 0; /** * Annotation end. * @member {number} end * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.end = 0; /** * Creates a new Annotation instance using the specified properties. * @function create * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance */ Annotation.create = function create(properties) { return new Annotation(properties); }; /** * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encode * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; /** * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Annotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Annotation message from the specified reader or buffer. * @function decode * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Annotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.path && message.path.length)) message.path = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.path.push(reader.int32()); } else message.path.push(reader.int32()); break; case 2: message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); break; case 4: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Annotation message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Annotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Annotation message. * @function verify * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Annotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { if (!Array.isArray(message.path)) return "path: array expected"; for (var i = 0; i < message.path.length; ++i) if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) if (!$util.isString(message.sourceFile)) return "sourceFile: string expected"; if (message.begin != null && message.hasOwnProperty("begin")) if (!$util.isInteger(message.begin)) return "begin: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation */ Annotation.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) return object; var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); if (object.path) { if (!Array.isArray(object.path)) throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } if (object.sourceFile != null) message.sourceFile = String(object.sourceFile); if (object.begin != null) message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from an Annotation message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Annotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.path = []; if (options.defaults) { object.sourceFile = ""; object.begin = 0; object.end = 0; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) object.sourceFile = message.sourceFile; if (message.begin != null && message.hasOwnProperty("begin")) object.begin = message.begin; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this Annotation to JSON. * @function toJSON * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance * @returns {Object.} JSON object */ Annotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Annotation; })(); return GeneratedCodeInfo; })(); return protobuf; })(); google.type = (function() { /** * Namespace type. * @memberof google * @namespace */ var type = {}; type.Expr = (function() { /** * Properties of an Expr. * @memberof google.type * @interface IExpr * @property {string|null} [expression] Expr expression * @property {string|null} [title] Expr title * @property {string|null} [description] Expr description * @property {string|null} [location] Expr location */ /** * Constructs a new Expr. * @memberof google.type * @classdesc Represents an Expr. * @implements IExpr * @constructor * @param {google.type.IExpr=} [properties] Properties to set */ function Expr(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Expr expression. * @member {string} expression * @memberof google.type.Expr * @instance */ Expr.prototype.expression = ""; /** * Expr title. * @member {string} title * @memberof google.type.Expr * @instance */ Expr.prototype.title = ""; /** * Expr description. * @member {string} description * @memberof google.type.Expr * @instance */ Expr.prototype.description = ""; /** * Expr location. * @member {string} location * @memberof google.type.Expr * @instance */ Expr.prototype.location = ""; /** * Creates a new Expr instance using the specified properties. * @function create * @memberof google.type.Expr * @static * @param {google.type.IExpr=} [properties] Properties to set * @returns {google.type.Expr} Expr instance */ Expr.create = function create(properties) { return new Expr(properties); }; /** * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. * @function encode * @memberof google.type.Expr * @static * @param {google.type.IExpr} message Expr message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Expr.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); if (message.title != null && Object.hasOwnProperty.call(message, "title")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); return writer; }; /** * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. * @function encodeDelimited * @memberof google.type.Expr * @static * @param {google.type.IExpr} message Expr message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Expr.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Expr message from the specified reader or buffer. * @function decode * @memberof google.type.Expr * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.type.Expr} Expr * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Expr.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.expression = reader.string(); break; case 2: message.title = reader.string(); break; case 3: message.description = reader.string(); break; case 4: message.location = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Expr message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.type.Expr * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.type.Expr} Expr * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Expr.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Expr message. * @function verify * @memberof google.type.Expr * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Expr.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.expression != null && message.hasOwnProperty("expression")) if (!$util.isString(message.expression)) return "expression: string expected"; if (message.title != null && message.hasOwnProperty("title")) if (!$util.isString(message.title)) return "title: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; if (message.location != null && message.hasOwnProperty("location")) if (!$util.isString(message.location)) return "location: string expected"; return null; }; /** * Creates an Expr message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.type.Expr * @static * @param {Object.} object Plain object * @returns {google.type.Expr} Expr */ Expr.fromObject = function fromObject(object) { if (object instanceof $root.google.type.Expr) return object; var message = new $root.google.type.Expr(); if (object.expression != null) message.expression = String(object.expression); if (object.title != null) message.title = String(object.title); if (object.description != null) message.description = String(object.description); if (object.location != null) message.location = String(object.location); return message; }; /** * Creates a plain object from an Expr message. Also converts values to other types if specified. * @function toObject * @memberof google.type.Expr * @static * @param {google.type.Expr} message Expr * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Expr.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.expression = ""; object.title = ""; object.description = ""; object.location = ""; } if (message.expression != null && message.hasOwnProperty("expression")) object.expression = message.expression; if (message.title != null && message.hasOwnProperty("title")) object.title = message.title; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.location != null && message.hasOwnProperty("location")) object.location = message.location; return object; }; /** * Converts this Expr to JSON. * @function toJSON * @memberof google.type.Expr * @instance * @returns {Object.} JSON object */ Expr.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Expr; })(); return type; })(); return google; })(); return $root; }); /***/ }), /***/ 22560: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); /** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ (function(global, factory) { /* global define, require, module */ /* AMD */ if (typeof define === 'function' && define.amd) define(["protobufjs/minimal"], factory); /* CommonJS */ else if ( true && module && module.exports) module.exports = factory(__webpack_require__(96916)); })(this, function($protobuf) { "use strict"; // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots.locations_protos || ($protobuf.roots.locations_protos = {}); $root.google = (function() { /** * Namespace google. * @exports google * @namespace */ var google = {}; google.cloud = (function() { /** * Namespace cloud. * @memberof google * @namespace */ var cloud = {}; cloud.location = (function() { /** * Namespace location. * @memberof google.cloud * @namespace */ var location = {}; location.Locations = (function() { /** * Constructs a new Locations service. * @memberof google.cloud.location * @classdesc Represents a Locations * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function Locations(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (Locations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Locations; /** * Creates new Locations service using the specified rpc implementation. * @function create * @memberof google.cloud.location.Locations * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {Locations} RPC service. Useful where requests and/or responses are streamed. */ Locations.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link google.cloud.location.Locations#listLocations}. * @memberof google.cloud.location.Locations * @typedef ListLocationsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.cloud.location.ListLocationsResponse} [response] ListLocationsResponse */ /** * Calls ListLocations. * @function listLocations * @memberof google.cloud.location.Locations * @instance * @param {google.cloud.location.IListLocationsRequest} request ListLocationsRequest message or plain object * @param {google.cloud.location.Locations.ListLocationsCallback} callback Node-style callback called with the error, if any, and ListLocationsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(Locations.prototype.listLocations = function listLocations(request, callback) { return this.rpcCall(listLocations, $root.google.cloud.location.ListLocationsRequest, $root.google.cloud.location.ListLocationsResponse, request, callback); }, "name", { value: "ListLocations" }); /** * Calls ListLocations. * @function listLocations * @memberof google.cloud.location.Locations * @instance * @param {google.cloud.location.IListLocationsRequest} request ListLocationsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.cloud.location.Locations#getLocation}. * @memberof google.cloud.location.Locations * @typedef GetLocationCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.cloud.location.Location} [response] Location */ /** * Calls GetLocation. * @function getLocation * @memberof google.cloud.location.Locations * @instance * @param {google.cloud.location.IGetLocationRequest} request GetLocationRequest message or plain object * @param {google.cloud.location.Locations.GetLocationCallback} callback Node-style callback called with the error, if any, and Location * @returns {undefined} * @variation 1 */ Object.defineProperty(Locations.prototype.getLocation = function getLocation(request, callback) { return this.rpcCall(getLocation, $root.google.cloud.location.GetLocationRequest, $root.google.cloud.location.Location, request, callback); }, "name", { value: "GetLocation" }); /** * Calls GetLocation. * @function getLocation * @memberof google.cloud.location.Locations * @instance * @param {google.cloud.location.IGetLocationRequest} request GetLocationRequest message or plain object * @returns {Promise} Promise * @variation 2 */ return Locations; })(); location.ListLocationsRequest = (function() { /** * Properties of a ListLocationsRequest. * @memberof google.cloud.location * @interface IListLocationsRequest * @property {string|null} [name] ListLocationsRequest name * @property {string|null} [filter] ListLocationsRequest filter * @property {number|null} [pageSize] ListLocationsRequest pageSize * @property {string|null} [pageToken] ListLocationsRequest pageToken */ /** * Constructs a new ListLocationsRequest. * @memberof google.cloud.location * @classdesc Represents a ListLocationsRequest. * @implements IListLocationsRequest * @constructor * @param {google.cloud.location.IListLocationsRequest=} [properties] Properties to set */ function ListLocationsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListLocationsRequest name. * @member {string} name * @memberof google.cloud.location.ListLocationsRequest * @instance */ ListLocationsRequest.prototype.name = ""; /** * ListLocationsRequest filter. * @member {string} filter * @memberof google.cloud.location.ListLocationsRequest * @instance */ ListLocationsRequest.prototype.filter = ""; /** * ListLocationsRequest pageSize. * @member {number} pageSize * @memberof google.cloud.location.ListLocationsRequest * @instance */ ListLocationsRequest.prototype.pageSize = 0; /** * ListLocationsRequest pageToken. * @member {string} pageToken * @memberof google.cloud.location.ListLocationsRequest * @instance */ ListLocationsRequest.prototype.pageToken = ""; /** * Creates a new ListLocationsRequest instance using the specified properties. * @function create * @memberof google.cloud.location.ListLocationsRequest * @static * @param {google.cloud.location.IListLocationsRequest=} [properties] Properties to set * @returns {google.cloud.location.ListLocationsRequest} ListLocationsRequest instance */ ListLocationsRequest.create = function create(properties) { return new ListLocationsRequest(properties); }; /** * Encodes the specified ListLocationsRequest message. Does not implicitly {@link google.cloud.location.ListLocationsRequest.verify|verify} messages. * @function encode * @memberof google.cloud.location.ListLocationsRequest * @static * @param {google.cloud.location.IListLocationsRequest} message ListLocationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLocationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** * Encodes the specified ListLocationsRequest message, length delimited. Does not implicitly {@link google.cloud.location.ListLocationsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.cloud.location.ListLocationsRequest * @static * @param {google.cloud.location.IListLocationsRequest} message ListLocationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLocationsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListLocationsRequest message from the specified reader or buffer. * @function decode * @memberof google.cloud.location.ListLocationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.cloud.location.ListLocationsRequest} ListLocationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLocationsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.location.ListLocationsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.filter = reader.string(); break; case 3: message.pageSize = reader.int32(); break; case 4: message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListLocationsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.cloud.location.ListLocationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.cloud.location.ListLocationsRequest} ListLocationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLocationsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListLocationsRequest message. * @function verify * @memberof google.cloud.location.ListLocationsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListLocationsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; }; /** * Creates a ListLocationsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.location.ListLocationsRequest * @static * @param {Object.} object Plain object * @returns {google.cloud.location.ListLocationsRequest} ListLocationsRequest */ ListLocationsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.location.ListLocationsRequest) return object; var message = new $root.google.cloud.location.ListLocationsRequest(); if (object.name != null) message.name = String(object.name); if (object.filter != null) message.filter = String(object.filter); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); return message; }; /** * Creates a plain object from a ListLocationsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.cloud.location.ListLocationsRequest * @static * @param {google.cloud.location.ListLocationsRequest} message ListLocationsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListLocationsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.filter = ""; object.pageSize = 0; object.pageToken = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; return object; }; /** * Converts this ListLocationsRequest to JSON. * @function toJSON * @memberof google.cloud.location.ListLocationsRequest * @instance * @returns {Object.} JSON object */ ListLocationsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListLocationsRequest; })(); location.ListLocationsResponse = (function() { /** * Properties of a ListLocationsResponse. * @memberof google.cloud.location * @interface IListLocationsResponse * @property {Array.|null} [locations] ListLocationsResponse locations * @property {string|null} [nextPageToken] ListLocationsResponse nextPageToken */ /** * Constructs a new ListLocationsResponse. * @memberof google.cloud.location * @classdesc Represents a ListLocationsResponse. * @implements IListLocationsResponse * @constructor * @param {google.cloud.location.IListLocationsResponse=} [properties] Properties to set */ function ListLocationsResponse(properties) { this.locations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListLocationsResponse locations. * @member {Array.} locations * @memberof google.cloud.location.ListLocationsResponse * @instance */ ListLocationsResponse.prototype.locations = $util.emptyArray; /** * ListLocationsResponse nextPageToken. * @member {string} nextPageToken * @memberof google.cloud.location.ListLocationsResponse * @instance */ ListLocationsResponse.prototype.nextPageToken = ""; /** * Creates a new ListLocationsResponse instance using the specified properties. * @function create * @memberof google.cloud.location.ListLocationsResponse * @static * @param {google.cloud.location.IListLocationsResponse=} [properties] Properties to set * @returns {google.cloud.location.ListLocationsResponse} ListLocationsResponse instance */ ListLocationsResponse.create = function create(properties) { return new ListLocationsResponse(properties); }; /** * Encodes the specified ListLocationsResponse message. Does not implicitly {@link google.cloud.location.ListLocationsResponse.verify|verify} messages. * @function encode * @memberof google.cloud.location.ListLocationsResponse * @static * @param {google.cloud.location.IListLocationsResponse} message ListLocationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLocationsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.locations != null && message.locations.length) for (var i = 0; i < message.locations.length; ++i) $root.google.cloud.location.Location.encode(message.locations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListLocationsResponse message, length delimited. Does not implicitly {@link google.cloud.location.ListLocationsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.cloud.location.ListLocationsResponse * @static * @param {google.cloud.location.IListLocationsResponse} message ListLocationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListLocationsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListLocationsResponse message from the specified reader or buffer. * @function decode * @memberof google.cloud.location.ListLocationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.cloud.location.ListLocationsResponse} ListLocationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLocationsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.location.ListLocationsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.locations && message.locations.length)) message.locations = []; message.locations.push($root.google.cloud.location.Location.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListLocationsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.cloud.location.ListLocationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.cloud.location.ListLocationsResponse} ListLocationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListLocationsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListLocationsResponse message. * @function verify * @memberof google.cloud.location.ListLocationsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListLocationsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.locations != null && message.hasOwnProperty("locations")) { if (!Array.isArray(message.locations)) return "locations: array expected"; for (var i = 0; i < message.locations.length; ++i) { var error = $root.google.cloud.location.Location.verify(message.locations[i]); if (error) return "locations." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListLocationsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.location.ListLocationsResponse * @static * @param {Object.} object Plain object * @returns {google.cloud.location.ListLocationsResponse} ListLocationsResponse */ ListLocationsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.location.ListLocationsResponse) return object; var message = new $root.google.cloud.location.ListLocationsResponse(); if (object.locations) { if (!Array.isArray(object.locations)) throw TypeError(".google.cloud.location.ListLocationsResponse.locations: array expected"); message.locations = []; for (var i = 0; i < object.locations.length; ++i) { if (typeof object.locations[i] !== "object") throw TypeError(".google.cloud.location.ListLocationsResponse.locations: object expected"); message.locations[i] = $root.google.cloud.location.Location.fromObject(object.locations[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListLocationsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.cloud.location.ListLocationsResponse * @static * @param {google.cloud.location.ListLocationsResponse} message ListLocationsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListLocationsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.locations = []; if (options.defaults) object.nextPageToken = ""; if (message.locations && message.locations.length) { object.locations = []; for (var j = 0; j < message.locations.length; ++j) object.locations[j] = $root.google.cloud.location.Location.toObject(message.locations[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListLocationsResponse to JSON. * @function toJSON * @memberof google.cloud.location.ListLocationsResponse * @instance * @returns {Object.} JSON object */ ListLocationsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListLocationsResponse; })(); location.GetLocationRequest = (function() { /** * Properties of a GetLocationRequest. * @memberof google.cloud.location * @interface IGetLocationRequest * @property {string|null} [name] GetLocationRequest name */ /** * Constructs a new GetLocationRequest. * @memberof google.cloud.location * @classdesc Represents a GetLocationRequest. * @implements IGetLocationRequest * @constructor * @param {google.cloud.location.IGetLocationRequest=} [properties] Properties to set */ function GetLocationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetLocationRequest name. * @member {string} name * @memberof google.cloud.location.GetLocationRequest * @instance */ GetLocationRequest.prototype.name = ""; /** * Creates a new GetLocationRequest instance using the specified properties. * @function create * @memberof google.cloud.location.GetLocationRequest * @static * @param {google.cloud.location.IGetLocationRequest=} [properties] Properties to set * @returns {google.cloud.location.GetLocationRequest} GetLocationRequest instance */ GetLocationRequest.create = function create(properties) { return new GetLocationRequest(properties); }; /** * Encodes the specified GetLocationRequest message. Does not implicitly {@link google.cloud.location.GetLocationRequest.verify|verify} messages. * @function encode * @memberof google.cloud.location.GetLocationRequest * @static * @param {google.cloud.location.IGetLocationRequest} message GetLocationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetLocationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified GetLocationRequest message, length delimited. Does not implicitly {@link google.cloud.location.GetLocationRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.cloud.location.GetLocationRequest * @static * @param {google.cloud.location.IGetLocationRequest} message GetLocationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetLocationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetLocationRequest message from the specified reader or buffer. * @function decode * @memberof google.cloud.location.GetLocationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.cloud.location.GetLocationRequest} GetLocationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetLocationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.location.GetLocationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetLocationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.cloud.location.GetLocationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.cloud.location.GetLocationRequest} GetLocationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetLocationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetLocationRequest message. * @function verify * @memberof google.cloud.location.GetLocationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetLocationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a GetLocationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.location.GetLocationRequest * @static * @param {Object.} object Plain object * @returns {google.cloud.location.GetLocationRequest} GetLocationRequest */ GetLocationRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.location.GetLocationRequest) return object; var message = new $root.google.cloud.location.GetLocationRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a GetLocationRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.cloud.location.GetLocationRequest * @static * @param {google.cloud.location.GetLocationRequest} message GetLocationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetLocationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this GetLocationRequest to JSON. * @function toJSON * @memberof google.cloud.location.GetLocationRequest * @instance * @returns {Object.} JSON object */ GetLocationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetLocationRequest; })(); location.Location = (function() { /** * Properties of a Location. * @memberof google.cloud.location * @interface ILocation * @property {string|null} [name] Location name * @property {string|null} [locationId] Location locationId * @property {string|null} [displayName] Location displayName * @property {Object.|null} [labels] Location labels * @property {google.protobuf.IAny|null} [metadata] Location metadata */ /** * Constructs a new Location. * @memberof google.cloud.location * @classdesc Represents a Location. * @implements ILocation * @constructor * @param {google.cloud.location.ILocation=} [properties] Properties to set */ function Location(properties) { this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Location name. * @member {string} name * @memberof google.cloud.location.Location * @instance */ Location.prototype.name = ""; /** * Location locationId. * @member {string} locationId * @memberof google.cloud.location.Location * @instance */ Location.prototype.locationId = ""; /** * Location displayName. * @member {string} displayName * @memberof google.cloud.location.Location * @instance */ Location.prototype.displayName = ""; /** * Location labels. * @member {Object.} labels * @memberof google.cloud.location.Location * @instance */ Location.prototype.labels = $util.emptyObject; /** * Location metadata. * @member {google.protobuf.IAny|null|undefined} metadata * @memberof google.cloud.location.Location * @instance */ Location.prototype.metadata = null; /** * Creates a new Location instance using the specified properties. * @function create * @memberof google.cloud.location.Location * @static * @param {google.cloud.location.ILocation=} [properties] Properties to set * @returns {google.cloud.location.Location} Location instance */ Location.create = function create(properties) { return new Location(properties); }; /** * Encodes the specified Location message. Does not implicitly {@link google.cloud.location.Location.verify|verify} messages. * @function encode * @memberof google.cloud.location.Location * @static * @param {google.cloud.location.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.locationId); if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); return writer; }; /** * Encodes the specified Location message, length delimited. Does not implicitly {@link google.cloud.location.Location.verify|verify} messages. * @function encodeDelimited * @memberof google.cloud.location.Location * @static * @param {google.cloud.location.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Location message from the specified reader or buffer. * @function decode * @memberof google.cloud.location.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.cloud.location.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.location.Location(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 4: message.locationId = reader.string(); break; case 5: message.displayName = reader.string(); break; case 2: if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; while (reader.pos < end2) { var tag2 = reader.uint32(); switch (tag2 >>> 3) { case 1: key = reader.string(); break; case 2: value = reader.string(); break; default: reader.skipType(tag2 & 7); break; } } message.labels[key] = value; break; case 3: message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.cloud.location.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.cloud.location.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Location message. * @function verify * @memberof google.cloud.location.Location * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Location.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.locationId != null && message.hasOwnProperty("locationId")) if (!$util.isString(message.locationId)) return "locationId: string expected"; if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); for (var i = 0; i < key.length; ++i) if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } if (message.metadata != null && message.hasOwnProperty("metadata")) { var error = $root.google.protobuf.Any.verify(message.metadata); if (error) return "metadata." + error; } return null; }; /** * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.location.Location * @static * @param {Object.} object Plain object * @returns {google.cloud.location.Location} Location */ Location.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.location.Location) return object; var message = new $root.google.cloud.location.Location(); if (object.name != null) message.name = String(object.name); if (object.locationId != null) message.locationId = String(object.locationId); if (object.displayName != null) message.displayName = String(object.displayName); if (object.labels) { if (typeof object.labels !== "object") throw TypeError(".google.cloud.location.Location.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } if (object.metadata != null) { if (typeof object.metadata !== "object") throw TypeError(".google.cloud.location.Location.metadata: object expected"); message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); } return message; }; /** * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject * @memberof google.cloud.location.Location * @static * @param {google.cloud.location.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { object.name = ""; object.metadata = null; object.locationId = ""; object.displayName = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.metadata != null && message.hasOwnProperty("metadata")) object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); if (message.locationId != null && message.hasOwnProperty("locationId")) object.locationId = message.locationId; if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; return object; }; /** * Converts this Location to JSON. * @function toJSON * @memberof google.cloud.location.Location * @instance * @returns {Object.} JSON object */ Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Location; })(); return location; })(); return cloud; })(); google.api = (function() { /** * Namespace api. * @memberof google * @namespace */ var api = {}; api.Http = (function() { /** * Properties of a Http. * @memberof google.api * @interface IHttp * @property {Array.|null} [rules] Http rules * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** * Constructs a new Http. * @memberof google.api * @classdesc Represents a Http. * @implements IHttp * @constructor * @param {google.api.IHttp=} [properties] Properties to set */ function Http(properties) { this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Http rules. * @member {Array.} rules * @memberof google.api.Http * @instance */ Http.prototype.rules = $util.emptyArray; /** * Http fullyDecodeReservedExpansion. * @member {boolean} fullyDecodeReservedExpansion * @memberof google.api.Http * @instance */ Http.prototype.fullyDecodeReservedExpansion = false; /** * Creates a new Http instance using the specified properties. * @function create * @memberof google.api.Http * @static * @param {google.api.IHttp=} [properties] Properties to set * @returns {google.api.Http} Http instance */ Http.create = function create(properties) { return new Http(properties); }; /** * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode * @memberof google.api.Http * @static * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.rules != null && message.rules.length) for (var i = 0; i < message.rules.length; ++i) $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Http * @static * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Http message from the specified reader or buffer. * @function decode * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Http.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.rules && message.rules.length)) message.rules = []; message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Http message. * @function verify * @memberof google.api.Http * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.rules != null && message.hasOwnProperty("rules")) { if (!Array.isArray(message.rules)) return "rules: array expected"; for (var i = 0; i < message.rules.length; ++i) { var error = $root.google.api.HttpRule.verify(message.rules[i]); if (error) return "rules." + error; } } if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) if (typeof message.fullyDecodeReservedExpansion !== "boolean") return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Http * @static * @param {Object.} object Plain object * @returns {google.api.Http} Http */ Http.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Http) return object; var message = new $root.google.api.Http(); if (object.rules) { if (!Array.isArray(object.rules)) throw TypeError(".google.api.Http.rules: array expected"); message.rules = []; for (var i = 0; i < object.rules.length; ++i) { if (typeof object.rules[i] !== "object") throw TypeError(".google.api.Http.rules: object expected"); message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); } } if (object.fullyDecodeReservedExpansion != null) message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Http * @static * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.rules = []; if (options.defaults) object.fullyDecodeReservedExpansion = false; if (message.rules && message.rules.length) { object.rules = []; for (var j = 0; j < message.rules.length; ++j) object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** * Converts this Http to JSON. * @function toJSON * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Http; })(); api.HttpRule = (function() { /** * Properties of a HttpRule. * @memberof google.api * @interface IHttpRule * @property {string|null} [selector] HttpRule selector * @property {string|null} [get] HttpRule get * @property {string|null} [put] HttpRule put * @property {string|null} [post] HttpRule post * @property {string|null} ["delete"] HttpRule delete * @property {string|null} [patch] HttpRule patch * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom * @property {string|null} [body] HttpRule body * @property {string|null} [responseBody] HttpRule responseBody * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ /** * Constructs a new HttpRule. * @memberof google.api * @classdesc Represents a HttpRule. * @implements IHttpRule * @constructor * @param {google.api.IHttpRule=} [properties] Properties to set */ function HttpRule(properties) { this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * HttpRule selector. * @member {string} selector * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.selector = ""; /** * HttpRule get. * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.get = null; /** * HttpRule put. * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.put = null; /** * HttpRule post. * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.post = null; /** * HttpRule delete. * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ HttpRule.prototype["delete"] = null; /** * HttpRule patch. * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.patch = null; /** * HttpRule custom. * @member {google.api.ICustomHttpPattern|null|undefined} custom * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.custom = null; /** * HttpRule body. * @member {string} body * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.body = ""; /** * HttpRule responseBody. * @member {string} responseBody * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.responseBody = ""; /** * HttpRule additionalBindings. * @member {Array.} additionalBindings * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.additionalBindings = $util.emptyArray; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * HttpRule pattern. * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern * @memberof google.api.HttpRule * @instance */ Object.defineProperty(HttpRule.prototype, "pattern", { get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new HttpRule instance using the specified properties. * @function create * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule=} [properties] Properties to set * @returns {google.api.HttpRule} HttpRule instance */ HttpRule.create = function create(properties) { return new HttpRule(properties); }; /** * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.additionalBindings != null && message.additionalBindings.length) for (var i = 0; i < message.additionalBindings.length; ++i) $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a HttpRule message from the specified reader or buffer. * @function decode * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.selector = reader.string(); break; case 2: message.get = reader.string(); break; case 3: message.put = reader.string(); break; case 4: message.post = reader.string(); break; case 5: message["delete"] = reader.string(); break; case 6: message.patch = reader.string(); break; case 8: message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); break; case 7: message.body = reader.string(); break; case 12: message.responseBody = reader.string(); break; case 11: if (!(message.additionalBindings && message.additionalBindings.length)) message.additionalBindings = []; message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a HttpRule message. * @function verify * @memberof google.api.HttpRule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.selector != null && message.hasOwnProperty("selector")) if (!$util.isString(message.selector)) return "selector: string expected"; if (message.get != null && message.hasOwnProperty("get")) { properties.pattern = 1; if (!$util.isString(message.get)) return "get: string expected"; } if (message.put != null && message.hasOwnProperty("put")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.put)) return "put: string expected"; } if (message.post != null && message.hasOwnProperty("post")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.post)) return "post: string expected"; } if (message["delete"] != null && message.hasOwnProperty("delete")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message["delete"])) return "delete: string expected"; } if (message.patch != null && message.hasOwnProperty("patch")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.patch)) return "patch: string expected"; } if (message.custom != null && message.hasOwnProperty("custom")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; { var error = $root.google.api.CustomHttpPattern.verify(message.custom); if (error) return "custom." + error; } } if (message.body != null && message.hasOwnProperty("body")) if (!$util.isString(message.body)) return "body: string expected"; if (message.responseBody != null && message.hasOwnProperty("responseBody")) if (!$util.isString(message.responseBody)) return "responseBody: string expected"; if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { if (!Array.isArray(message.additionalBindings)) return "additionalBindings: array expected"; for (var i = 0; i < message.additionalBindings.length; ++i) { var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); if (error) return "additionalBindings." + error; } } return null; }; /** * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object * @returns {google.api.HttpRule} HttpRule */ HttpRule.fromObject = function fromObject(object) { if (object instanceof $root.google.api.HttpRule) return object; var message = new $root.google.api.HttpRule(); if (object.selector != null) message.selector = String(object.selector); if (object.get != null) message.get = String(object.get); if (object.put != null) message.put = String(object.put); if (object.post != null) message.post = String(object.post); if (object["delete"] != null) message["delete"] = String(object["delete"]); if (object.patch != null) message.patch = String(object.patch); if (object.custom != null) { if (typeof object.custom !== "object") throw TypeError(".google.api.HttpRule.custom: object expected"); message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); } if (object.body != null) message.body = String(object.body); if (object.responseBody != null) message.responseBody = String(object.responseBody); if (object.additionalBindings) { if (!Array.isArray(object.additionalBindings)) throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); message.additionalBindings = []; for (var i = 0; i < object.additionalBindings.length; ++i) { if (typeof object.additionalBindings[i] !== "object") throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); } } return message; }; /** * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject * @memberof google.api.HttpRule * @static * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.additionalBindings = []; if (options.defaults) { object.selector = ""; object.body = ""; object.responseBody = ""; } if (message.selector != null && message.hasOwnProperty("selector")) object.selector = message.selector; if (message.get != null && message.hasOwnProperty("get")) { object.get = message.get; if (options.oneofs) object.pattern = "get"; } if (message.put != null && message.hasOwnProperty("put")) { object.put = message.put; if (options.oneofs) object.pattern = "put"; } if (message.post != null && message.hasOwnProperty("post")) { object.post = message.post; if (options.oneofs) object.pattern = "post"; } if (message["delete"] != null && message.hasOwnProperty("delete")) { object["delete"] = message["delete"]; if (options.oneofs) object.pattern = "delete"; } if (message.patch != null && message.hasOwnProperty("patch")) { object.patch = message.patch; if (options.oneofs) object.pattern = "patch"; } if (message.body != null && message.hasOwnProperty("body")) object.body = message.body; if (message.custom != null && message.hasOwnProperty("custom")) { object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); if (options.oneofs) object.pattern = "custom"; } if (message.additionalBindings && message.additionalBindings.length) { object.additionalBindings = []; for (var j = 0; j < message.additionalBindings.length; ++j) object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); } if (message.responseBody != null && message.hasOwnProperty("responseBody")) object.responseBody = message.responseBody; return object; }; /** * Converts this HttpRule to JSON. * @function toJSON * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return HttpRule; })(); api.CustomHttpPattern = (function() { /** * Properties of a CustomHttpPattern. * @memberof google.api * @interface ICustomHttpPattern * @property {string|null} [kind] CustomHttpPattern kind * @property {string|null} [path] CustomHttpPattern path */ /** * Constructs a new CustomHttpPattern. * @memberof google.api * @classdesc Represents a CustomHttpPattern. * @implements ICustomHttpPattern * @constructor * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CustomHttpPattern kind. * @member {string} kind * @memberof google.api.CustomHttpPattern * @instance */ CustomHttpPattern.prototype.kind = ""; /** * CustomHttpPattern path. * @member {string} path * @memberof google.api.CustomHttpPattern * @instance */ CustomHttpPattern.prototype.path = ""; /** * Creates a new CustomHttpPattern instance using the specified properties. * @function create * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern=} [properties] Properties to set * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ CustomHttpPattern.create = function create(properties) { return new CustomHttpPattern(properties); }; /** * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomHttpPattern.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.kind = reader.string(); break; case 2: message.path = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CustomHttpPattern message. * @function verify * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.kind != null && message.hasOwnProperty("kind")) if (!$util.isString(message.kind)) return "kind: string expected"; if (message.path != null && message.hasOwnProperty("path")) if (!$util.isString(message.path)) return "path: string expected"; return null; }; /** * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ CustomHttpPattern.fromObject = function fromObject(object) { if (object instanceof $root.google.api.CustomHttpPattern) return object; var message = new $root.google.api.CustomHttpPattern(); if (object.kind != null) message.kind = String(object.kind); if (object.path != null) message.path = String(object.path); return message; }; /** * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject * @memberof google.api.CustomHttpPattern * @static * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.kind = ""; object.path = ""; } if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; if (message.path != null && message.hasOwnProperty("path")) object.path = message.path; return object; }; /** * Converts this CustomHttpPattern to JSON. * @function toJSON * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CustomHttpPattern; })(); return api; })(); google.protobuf = (function() { /** * Namespace protobuf. * @memberof google * @namespace */ var protobuf = {}; protobuf.FileDescriptorSet = (function() { /** * Properties of a FileDescriptorSet. * @memberof google.protobuf * @interface IFileDescriptorSet * @property {Array.|null} [file] FileDescriptorSet file */ /** * Constructs a new FileDescriptorSet. * @memberof google.protobuf * @classdesc Represents a FileDescriptorSet. * @implements IFileDescriptorSet * @constructor * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set */ function FileDescriptorSet(properties) { this.file = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileDescriptorSet file. * @member {Array.} file * @memberof google.protobuf.FileDescriptorSet * @instance */ FileDescriptorSet.prototype.file = $util.emptyArray; /** * Creates a new FileDescriptorSet instance using the specified properties. * @function create * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance */ FileDescriptorSet.create = function create(properties) { return new FileDescriptorSet(properties); }; /** * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encode * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.file != null && message.file.length) for (var i = 0; i < message.file.length; ++i) $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileDescriptorSet message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorSet.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.file && message.file.length)) message.file = []; message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileDescriptorSet message. * @function verify * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileDescriptorSet.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.file != null && message.hasOwnProperty("file")) { if (!Array.isArray(message.file)) return "file: array expected"; for (var i = 0; i < message.file.length; ++i) { var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); if (error) return "file." + error; } } return null; }; /** * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet */ FileDescriptorSet.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileDescriptorSet) return object; var message = new $root.google.protobuf.FileDescriptorSet(); if (object.file) { if (!Array.isArray(object.file)) throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); message.file = []; for (var i = 0; i < object.file.length; ++i) { if (typeof object.file[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); } } return message; }; /** * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileDescriptorSet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.file = []; if (message.file && message.file.length) { object.file = []; for (var j = 0; j < message.file.length; ++j) object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); } return object; }; /** * Converts this FileDescriptorSet to JSON. * @function toJSON * @memberof google.protobuf.FileDescriptorSet * @instance * @returns {Object.} JSON object */ FileDescriptorSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FileDescriptorSet; })(); protobuf.FileDescriptorProto = (function() { /** * Properties of a FileDescriptorProto. * @memberof google.protobuf * @interface IFileDescriptorProto * @property {string|null} [name] FileDescriptorProto name * @property {string|null} ["package"] FileDescriptorProto package * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service * @property {Array.|null} [extension] FileDescriptorProto extension * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo * @property {string|null} [syntax] FileDescriptorProto syntax */ /** * Constructs a new FileDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FileDescriptorProto. * @implements IFileDescriptorProto * @constructor * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set */ function FileDescriptorProto(properties) { this.dependency = []; this.publicDependency = []; this.weakDependency = []; this.messageType = []; this.enumType = []; this.service = []; this.extension = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileDescriptorProto name. * @member {string} name * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.name = ""; /** * FileDescriptorProto package. * @member {string} package * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype["package"] = ""; /** * FileDescriptorProto dependency. * @member {Array.} dependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.dependency = $util.emptyArray; /** * FileDescriptorProto publicDependency. * @member {Array.} publicDependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.publicDependency = $util.emptyArray; /** * FileDescriptorProto weakDependency. * @member {Array.} weakDependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; /** * FileDescriptorProto messageType. * @member {Array.} messageType * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.messageType = $util.emptyArray; /** * FileDescriptorProto enumType. * @member {Array.} enumType * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.enumType = $util.emptyArray; /** * FileDescriptorProto service. * @member {Array.} service * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.service = $util.emptyArray; /** * FileDescriptorProto extension. * @member {Array.} extension * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.extension = $util.emptyArray; /** * FileDescriptorProto options. * @member {google.protobuf.IFileOptions|null|undefined} options * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.options = null; /** * FileDescriptorProto sourceCodeInfo. * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.sourceCodeInfo = null; /** * FileDescriptorProto syntax. * @member {string} syntax * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.syntax = ""; /** * Creates a new FileDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance */ FileDescriptorProto.create = function create(properties) { return new FileDescriptorProto(properties); }; /** * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); if (message.messageType != null && message.messageType.length) for (var i = 0; i < message.messageType.length; ++i) $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.enumType != null && message.enumType.length) for (var i = 0; i < message.enumType.length; ++i) $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.service != null && message.service.length) for (var i = 0; i < message.service.length; ++i) $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; /** * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message["package"] = reader.string(); break; case 3: if (!(message.dependency && message.dependency.length)) message.dependency = []; message.dependency.push(reader.string()); break; case 10: if (!(message.publicDependency && message.publicDependency.length)) message.publicDependency = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.publicDependency.push(reader.int32()); } else message.publicDependency.push(reader.int32()); break; case 11: if (!(message.weakDependency && message.weakDependency.length)) message.weakDependency = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.weakDependency.push(reader.int32()); } else message.weakDependency.push(reader.int32()); break; case 4: if (!(message.messageType && message.messageType.length)) message.messageType = []; message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; case 5: if (!(message.enumType && message.enumType.length)) message.enumType = []; message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: if (!(message.service && message.service.length)) message.service = []; message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: if (!(message.extension && message.extension.length)) message.extension = []; message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); break; case 9: message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileDescriptorProto message. * @function verify * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message["package"] != null && message.hasOwnProperty("package")) if (!$util.isString(message["package"])) return "package: string expected"; if (message.dependency != null && message.hasOwnProperty("dependency")) { if (!Array.isArray(message.dependency)) return "dependency: array expected"; for (var i = 0; i < message.dependency.length; ++i) if (!$util.isString(message.dependency[i])) return "dependency: string[] expected"; } if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { if (!Array.isArray(message.publicDependency)) return "publicDependency: array expected"; for (var i = 0; i < message.publicDependency.length; ++i) if (!$util.isInteger(message.publicDependency[i])) return "publicDependency: integer[] expected"; } if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { if (!Array.isArray(message.weakDependency)) return "weakDependency: array expected"; for (var i = 0; i < message.weakDependency.length; ++i) if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; for (var i = 0; i < message.messageType.length; ++i) { var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); if (error) return "messageType." + error; } } if (message.enumType != null && message.hasOwnProperty("enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } } if (message.service != null && message.hasOwnProperty("service")) { if (!Array.isArray(message.service)) return "service: array expected"; for (var i = 0; i < message.service.length; ++i) { var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); if (error) return "service." + error; } } if (message.extension != null && message.hasOwnProperty("extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FileOptions.verify(message.options); if (error) return "options." + error; } if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); if (error) return "sourceCodeInfo." + error; } if (message.syntax != null && message.hasOwnProperty("syntax")) if (!$util.isString(message.syntax)) return "syntax: string expected"; return null; }; /** * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto */ FileDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileDescriptorProto) return object; var message = new $root.google.protobuf.FileDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object["package"] != null) message["package"] = String(object["package"]); if (object.dependency) { if (!Array.isArray(object.dependency)) throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); message.dependency = []; for (var i = 0; i < object.dependency.length; ++i) message.dependency[i] = String(object.dependency[i]); } if (object.publicDependency) { if (!Array.isArray(object.publicDependency)) throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); message.publicDependency = []; for (var i = 0; i < object.publicDependency.length; ++i) message.publicDependency[i] = object.publicDependency[i] | 0; } if (object.weakDependency) { if (!Array.isArray(object.weakDependency)) throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); message.weakDependency = []; for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); message.messageType = []; for (var i = 0; i < object.messageType.length; ++i) { if (typeof object.messageType[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); } } if (object.enumType) { if (!Array.isArray(object.enumType)) throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { if (typeof object.enumType[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); } } if (object.service) { if (!Array.isArray(object.service)) throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); message.service = []; for (var i = 0; i < object.service.length; ++i) { if (typeof object.service[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); } } if (object.extension) { if (!Array.isArray(object.extension)) throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { if (typeof object.extension[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FileOptions.fromObject(object.options); } if (object.sourceCodeInfo != null) { if (typeof object.sourceCodeInfo !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); } if (object.syntax != null) message.syntax = String(object.syntax); return message; }; /** * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.dependency = []; object.messageType = []; object.enumType = []; object.service = []; object.extension = []; object.publicDependency = []; object.weakDependency = []; } if (options.defaults) { object.name = ""; object["package"] = ""; object.options = null; object.sourceCodeInfo = null; object.syntax = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message["package"] != null && message.hasOwnProperty("package")) object["package"] = message["package"]; if (message.dependency && message.dependency.length) { object.dependency = []; for (var j = 0; j < message.dependency.length; ++j) object.dependency[j] = message.dependency[j]; } if (message.messageType && message.messageType.length) { object.messageType = []; for (var j = 0; j < message.messageType.length; ++j) object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); } if (message.enumType && message.enumType.length) { object.enumType = []; for (var j = 0; j < message.enumType.length; ++j) object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); } if (message.service && message.service.length) { object.service = []; for (var j = 0; j < message.service.length; ++j) object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); } if (message.extension && message.extension.length) { object.extension = []; for (var j = 0; j < message.extension.length; ++j) object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); if (message.publicDependency && message.publicDependency.length) { object.publicDependency = []; for (var j = 0; j < message.publicDependency.length; ++j) object.publicDependency[j] = message.publicDependency[j]; } if (message.weakDependency && message.weakDependency.length) { object.weakDependency = []; for (var j = 0; j < message.weakDependency.length; ++j) object.weakDependency[j] = message.weakDependency[j]; } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; return object; }; /** * Converts this FileDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.FileDescriptorProto * @instance * @returns {Object.} JSON object */ FileDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FileDescriptorProto; })(); protobuf.DescriptorProto = (function() { /** * Properties of a DescriptorProto. * @memberof google.protobuf * @interface IDescriptorProto * @property {string|null} [name] DescriptorProto name * @property {Array.|null} [field] DescriptorProto field * @property {Array.|null} [extension] DescriptorProto extension * @property {Array.|null} [nestedType] DescriptorProto nestedType * @property {Array.|null} [enumType] DescriptorProto enumType * @property {Array.|null} [extensionRange] DescriptorProto extensionRange * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName */ /** * Constructs a new DescriptorProto. * @memberof google.protobuf * @classdesc Represents a DescriptorProto. * @implements IDescriptorProto * @constructor * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set */ function DescriptorProto(properties) { this.field = []; this.extension = []; this.nestedType = []; this.enumType = []; this.extensionRange = []; this.oneofDecl = []; this.reservedRange = []; this.reservedName = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DescriptorProto name. * @member {string} name * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.name = ""; /** * DescriptorProto field. * @member {Array.} field * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.field = $util.emptyArray; /** * DescriptorProto extension. * @member {Array.} extension * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.extension = $util.emptyArray; /** * DescriptorProto nestedType. * @member {Array.} nestedType * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.nestedType = $util.emptyArray; /** * DescriptorProto enumType. * @member {Array.} enumType * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.enumType = $util.emptyArray; /** * DescriptorProto extensionRange. * @member {Array.} extensionRange * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.extensionRange = $util.emptyArray; /** * DescriptorProto oneofDecl. * @member {Array.} oneofDecl * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.oneofDecl = $util.emptyArray; /** * DescriptorProto options. * @member {google.protobuf.IMessageOptions|null|undefined} options * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.options = null; /** * DescriptorProto reservedRange. * @member {Array.} reservedRange * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.reservedRange = $util.emptyArray; /** * DescriptorProto reservedName. * @member {Array.} reservedName * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.reservedName = $util.emptyArray; /** * Creates a new DescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto} DescriptorProto instance */ DescriptorProto.create = function create(properties) { return new DescriptorProto(properties); }; /** * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.nestedType != null && message.nestedType.length) for (var i = 0; i < message.nestedType.length; ++i) $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.enumType != null && message.enumType.length) for (var i = 0; i < message.enumType.length; ++i) $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.extensionRange != null && message.extensionRange.length) for (var i = 0; i < message.extensionRange.length; ++i) $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); return writer; }; /** * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto} DescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.field && message.field.length)) message.field = []; message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: if (!(message.extension && message.extension.length)) message.extension = []; message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: if (!(message.nestedType && message.nestedType.length)) message.nestedType = []; message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; case 4: if (!(message.enumType && message.enumType.length)) message.enumType = []; message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: if (!(message.extensionRange && message.extensionRange.length)) message.extensionRange = []; message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); break; case 8: if (!(message.oneofDecl && message.oneofDecl.length)) message.oneofDecl = []; message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); break; case 9: if (!(message.reservedRange && message.reservedRange.length)) message.reservedRange = []; message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); break; case 10: if (!(message.reservedName && message.reservedName.length)) message.reservedName = []; message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto} DescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DescriptorProto message. * @function verify * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.field != null && message.hasOwnProperty("field")) { if (!Array.isArray(message.field)) return "field: array expected"; for (var i = 0; i < message.field.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); if (error) return "field." + error; } } if (message.extension != null && message.hasOwnProperty("extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.nestedType != null && message.hasOwnProperty("nestedType")) { if (!Array.isArray(message.nestedType)) return "nestedType: array expected"; for (var i = 0; i < message.nestedType.length; ++i) { var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); if (error) return "nestedType." + error; } } if (message.enumType != null && message.hasOwnProperty("enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } } if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { if (!Array.isArray(message.extensionRange)) return "extensionRange: array expected"; for (var i = 0; i < message.extensionRange.length; ++i) { var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); if (error) return "extensionRange." + error; } } if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { if (!Array.isArray(message.oneofDecl)) return "oneofDecl: array expected"; for (var i = 0; i < message.oneofDecl.length; ++i) { var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); if (error) return "oneofDecl." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MessageOptions.verify(message.options); if (error) return "options." + error; } if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } } if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } return null; }; /** * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto} DescriptorProto */ DescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto) return object; var message = new $root.google.protobuf.DescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.field) { if (!Array.isArray(object.field)) throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); message.field = []; for (var i = 0; i < object.field.length; ++i) { if (typeof object.field[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); } } if (object.extension) { if (!Array.isArray(object.extension)) throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { if (typeof object.extension[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); } } if (object.nestedType) { if (!Array.isArray(object.nestedType)) throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); message.nestedType = []; for (var i = 0; i < object.nestedType.length; ++i) { if (typeof object.nestedType[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); } } if (object.enumType) { if (!Array.isArray(object.enumType)) throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { if (typeof object.enumType[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); } } if (object.extensionRange) { if (!Array.isArray(object.extensionRange)) throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); message.extensionRange = []; for (var i = 0; i < object.extensionRange.length; ++i) { if (typeof object.extensionRange[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); } } if (object.oneofDecl) { if (!Array.isArray(object.oneofDecl)) throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); message.oneofDecl = []; for (var i = 0; i < object.oneofDecl.length; ++i) { if (typeof object.oneofDecl[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); } if (object.reservedRange) { if (!Array.isArray(object.reservedRange)) throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { if (typeof object.reservedRange[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); } } if (object.reservedName) { if (!Array.isArray(object.reservedName)) throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); message.reservedName = []; for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } return message; }; /** * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.DescriptorProto} message DescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.field = []; object.nestedType = []; object.enumType = []; object.extensionRange = []; object.extension = []; object.oneofDecl = []; object.reservedRange = []; object.reservedName = []; } if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.field && message.field.length) { object.field = []; for (var j = 0; j < message.field.length; ++j) object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); } if (message.nestedType && message.nestedType.length) { object.nestedType = []; for (var j = 0; j < message.nestedType.length; ++j) object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); } if (message.enumType && message.enumType.length) { object.enumType = []; for (var j = 0; j < message.enumType.length; ++j) object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); } if (message.extensionRange && message.extensionRange.length) { object.extensionRange = []; for (var j = 0; j < message.extensionRange.length; ++j) object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); } if (message.extension && message.extension.length) { object.extension = []; for (var j = 0; j < message.extension.length; ++j) object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); if (message.oneofDecl && message.oneofDecl.length) { object.oneofDecl = []; for (var j = 0; j < message.oneofDecl.length; ++j) object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); } if (message.reservedRange && message.reservedRange.length) { object.reservedRange = []; for (var j = 0; j < message.reservedRange.length; ++j) object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } return object; }; /** * Converts this DescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto * @instance * @returns {Object.} JSON object */ DescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; DescriptorProto.ExtensionRange = (function() { /** * Properties of an ExtensionRange. * @memberof google.protobuf.DescriptorProto * @interface IExtensionRange * @property {number|null} [start] ExtensionRange start * @property {number|null} [end] ExtensionRange end * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options */ /** * Constructs a new ExtensionRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents an ExtensionRange. * @implements IExtensionRange * @constructor * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set */ function ExtensionRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ExtensionRange start. * @member {number} start * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.start = 0; /** * ExtensionRange end. * @member {number} end * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.end = 0; /** * ExtensionRange options. * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.options = null; /** * Creates a new ExtensionRange instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance */ ExtensionRange.create = function create(properties) { return new ExtensionRange(properties); }; /** * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ExtensionRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; case 3: message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ExtensionRange message. * @function verify * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ExtensionRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange */ ExtensionRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) return object; var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ExtensionRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; object.options = null; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); return object; }; /** * Converts this ExtensionRange to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance * @returns {Object.} JSON object */ ExtensionRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ExtensionRange; })(); DescriptorProto.ReservedRange = (function() { /** * Properties of a ReservedRange. * @memberof google.protobuf.DescriptorProto * @interface IReservedRange * @property {number|null} [start] ReservedRange start * @property {number|null} [end] ReservedRange end */ /** * Constructs a new ReservedRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents a ReservedRange. * @implements IReservedRange * @constructor * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set */ function ReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ReservedRange start. * @member {number} start * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ ReservedRange.prototype.start = 0; /** * ReservedRange end. * @member {number} end * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ ReservedRange.prototype.end = 0; /** * Creates a new ReservedRange instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance */ ReservedRange.create = function create(properties) { return new ReservedRange(properties); }; /** * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ReservedRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ReservedRange message. * @function verify * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange */ ReservedRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) return object; var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this ReservedRange to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance * @returns {Object.} JSON object */ ReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ReservedRange; })(); return DescriptorProto; })(); protobuf.ExtensionRangeOptions = (function() { /** * Properties of an ExtensionRangeOptions. * @memberof google.protobuf * @interface IExtensionRangeOptions * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption */ /** * Constructs a new ExtensionRangeOptions. * @memberof google.protobuf * @classdesc Represents an ExtensionRangeOptions. * @implements IExtensionRangeOptions * @constructor * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set */ function ExtensionRangeOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ExtensionRangeOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.ExtensionRangeOptions * @instance */ ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new ExtensionRangeOptions instance using the specified properties. * @function create * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance */ ExtensionRangeOptions.create = function create(properties) { return new ExtensionRangeOptions(properties); }; /** * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ExtensionRangeOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRangeOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ExtensionRangeOptions message. * @function verify * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ExtensionRangeOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions */ ExtensionRangeOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ExtensionRangeOptions) return object; var message = new $root.google.protobuf.ExtensionRangeOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ExtensionRangeOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this ExtensionRangeOptions to JSON. * @function toJSON * @memberof google.protobuf.ExtensionRangeOptions * @instance * @returns {Object.} JSON object */ ExtensionRangeOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ExtensionRangeOptions; })(); protobuf.FieldDescriptorProto = (function() { /** * Properties of a FieldDescriptorProto. * @memberof google.protobuf * @interface IFieldDescriptorProto * @property {string|null} [name] FieldDescriptorProto name * @property {number|null} [number] FieldDescriptorProto number * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type * @property {string|null} [typeName] FieldDescriptorProto typeName * @property {string|null} [extendee] FieldDescriptorProto extendee * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex * @property {string|null} [jsonName] FieldDescriptorProto jsonName * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional */ /** * Constructs a new FieldDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FieldDescriptorProto. * @implements IFieldDescriptorProto * @constructor * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set */ function FieldDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldDescriptorProto name. * @member {string} name * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.name = ""; /** * FieldDescriptorProto number. * @member {number} number * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.number = 0; /** * FieldDescriptorProto label. * @member {google.protobuf.FieldDescriptorProto.Label} label * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.label = 1; /** * FieldDescriptorProto type. * @member {google.protobuf.FieldDescriptorProto.Type} type * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.type = 1; /** * FieldDescriptorProto typeName. * @member {string} typeName * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.typeName = ""; /** * FieldDescriptorProto extendee. * @member {string} extendee * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.extendee = ""; /** * FieldDescriptorProto defaultValue. * @member {string} defaultValue * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.defaultValue = ""; /** * FieldDescriptorProto oneofIndex. * @member {number} oneofIndex * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.oneofIndex = 0; /** * FieldDescriptorProto jsonName. * @member {string} jsonName * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.jsonName = ""; /** * FieldDescriptorProto options. * @member {google.protobuf.IFieldOptions|null|undefined} options * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.options = null; /** * FieldDescriptorProto proto3Optional. * @member {boolean} proto3Optional * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.proto3Optional = false; /** * Creates a new FieldDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance */ FieldDescriptorProto.create = function create(properties) { return new FieldDescriptorProto(properties); }; /** * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); return writer; }; /** * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 3: message.number = reader.int32(); break; case 4: message.label = reader.int32(); break; case 5: message.type = reader.int32(); break; case 6: message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: message.defaultValue = reader.string(); break; case 9: message.oneofIndex = reader.int32(); break; case 10: message.jsonName = reader.string(); break; case 8: message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); break; case 17: message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldDescriptorProto message. * @function verify * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; if (message.label != null && message.hasOwnProperty("label")) switch (message.label) { default: return "label: enum value expected"; case 1: case 2: case 3: break; } if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: return "type: enum value expected"; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: break; } if (message.typeName != null && message.hasOwnProperty("typeName")) if (!$util.isString(message.typeName)) return "typeName: string expected"; if (message.extendee != null && message.hasOwnProperty("extendee")) if (!$util.isString(message.extendee)) return "extendee: string expected"; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) if (!$util.isString(message.defaultValue)) return "defaultValue: string expected"; if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) if (!$util.isInteger(message.oneofIndex)) return "oneofIndex: integer expected"; if (message.jsonName != null && message.hasOwnProperty("jsonName")) if (!$util.isString(message.jsonName)) return "jsonName: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FieldOptions.verify(message.options); if (error) return "options." + error; } if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) if (typeof message.proto3Optional !== "boolean") return "proto3Optional: boolean expected"; return null; }; /** * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto */ FieldDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldDescriptorProto) return object; var message = new $root.google.protobuf.FieldDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.number != null) message.number = object.number | 0; switch (object.label) { case "LABEL_OPTIONAL": case 1: message.label = 1; break; case "LABEL_REQUIRED": case 2: message.label = 2; break; case "LABEL_REPEATED": case 3: message.label = 3; break; } switch (object.type) { case "TYPE_DOUBLE": case 1: message.type = 1; break; case "TYPE_FLOAT": case 2: message.type = 2; break; case "TYPE_INT64": case 3: message.type = 3; break; case "TYPE_UINT64": case 4: message.type = 4; break; case "TYPE_INT32": case 5: message.type = 5; break; case "TYPE_FIXED64": case 6: message.type = 6; break; case "TYPE_FIXED32": case 7: message.type = 7; break; case "TYPE_BOOL": case 8: message.type = 8; break; case "TYPE_STRING": case 9: message.type = 9; break; case "TYPE_GROUP": case 10: message.type = 10; break; case "TYPE_MESSAGE": case 11: message.type = 11; break; case "TYPE_BYTES": case 12: message.type = 12; break; case "TYPE_UINT32": case 13: message.type = 13; break; case "TYPE_ENUM": case 14: message.type = 14; break; case "TYPE_SFIXED32": case 15: message.type = 15; break; case "TYPE_SFIXED64": case 16: message.type = 16; break; case "TYPE_SINT32": case 17: message.type = 17; break; case "TYPE_SINT64": case 18: message.type = 18; break; } if (object.typeName != null) message.typeName = String(object.typeName); if (object.extendee != null) message.extendee = String(object.extendee); if (object.defaultValue != null) message.defaultValue = String(object.defaultValue); if (object.oneofIndex != null) message.oneofIndex = object.oneofIndex | 0; if (object.jsonName != null) message.jsonName = String(object.jsonName); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); } if (object.proto3Optional != null) message.proto3Optional = Boolean(object.proto3Optional); return message; }; /** * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.extendee = ""; object.number = 0; object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; object.type = options.enums === String ? "TYPE_DOUBLE" : 1; object.typeName = ""; object.defaultValue = ""; object.options = null; object.oneofIndex = 0; object.jsonName = ""; object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.extendee != null && message.hasOwnProperty("extendee")) object.extendee = message.extendee; if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) object.defaultValue = message.defaultValue; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) object.oneofIndex = message.oneofIndex; if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) object.proto3Optional = message.proto3Optional; return object; }; /** * Converts this FieldDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.FieldDescriptorProto * @instance * @returns {Object.} JSON object */ FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type * @enum {number} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value * @property {number} TYPE_UINT64=4 TYPE_UINT64 value * @property {number} TYPE_INT32=5 TYPE_INT32 value * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value * @property {number} TYPE_BOOL=8 TYPE_BOOL value * @property {number} TYPE_STRING=9 TYPE_STRING value * @property {number} TYPE_GROUP=10 TYPE_GROUP value * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value * @property {number} TYPE_BYTES=12 TYPE_BYTES value * @property {number} TYPE_UINT32=13 TYPE_UINT32 value * @property {number} TYPE_ENUM=14 TYPE_ENUM value * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value * @property {number} TYPE_SINT32=17 TYPE_SINT32 value * @property {number} TYPE_SINT64=18 TYPE_SINT64 value */ FieldDescriptorProto.Type = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "TYPE_DOUBLE"] = 1; values[valuesById[2] = "TYPE_FLOAT"] = 2; values[valuesById[3] = "TYPE_INT64"] = 3; values[valuesById[4] = "TYPE_UINT64"] = 4; values[valuesById[5] = "TYPE_INT32"] = 5; values[valuesById[6] = "TYPE_FIXED64"] = 6; values[valuesById[7] = "TYPE_FIXED32"] = 7; values[valuesById[8] = "TYPE_BOOL"] = 8; values[valuesById[9] = "TYPE_STRING"] = 9; values[valuesById[10] = "TYPE_GROUP"] = 10; values[valuesById[11] = "TYPE_MESSAGE"] = 11; values[valuesById[12] = "TYPE_BYTES"] = 12; values[valuesById[13] = "TYPE_UINT32"] = 13; values[valuesById[14] = "TYPE_ENUM"] = 14; values[valuesById[15] = "TYPE_SFIXED32"] = 15; values[valuesById[16] = "TYPE_SFIXED64"] = 16; values[valuesById[17] = "TYPE_SINT32"] = 17; values[valuesById[18] = "TYPE_SINT64"] = 18; return values; })(); /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value */ FieldDescriptorProto.Label = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "LABEL_OPTIONAL"] = 1; values[valuesById[2] = "LABEL_REQUIRED"] = 2; values[valuesById[3] = "LABEL_REPEATED"] = 3; return values; })(); return FieldDescriptorProto; })(); protobuf.OneofDescriptorProto = (function() { /** * Properties of an OneofDescriptorProto. * @memberof google.protobuf * @interface IOneofDescriptorProto * @property {string|null} [name] OneofDescriptorProto name * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options */ /** * Constructs a new OneofDescriptorProto. * @memberof google.protobuf * @classdesc Represents an OneofDescriptorProto. * @implements IOneofDescriptorProto * @constructor * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ function OneofDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OneofDescriptorProto name. * @member {string} name * @memberof google.protobuf.OneofDescriptorProto * @instance */ OneofDescriptorProto.prototype.name = ""; /** * OneofDescriptorProto options. * @member {google.protobuf.IOneofOptions|null|undefined} options * @memberof google.protobuf.OneofDescriptorProto * @instance */ OneofDescriptorProto.prototype.options = null; /** * Creates a new OneofDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance */ OneofDescriptorProto.create = function create(properties) { return new OneofDescriptorProto(properties); }; /** * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OneofDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OneofDescriptorProto message. * @function verify * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OneofDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.OneofOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ OneofDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; var message = new $root.google.protobuf.OneofDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OneofDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); return object; }; /** * Converts this OneofDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.OneofDescriptorProto * @instance * @returns {Object.} JSON object */ OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OneofDescriptorProto; })(); protobuf.EnumDescriptorProto = (function() { /** * Properties of an EnumDescriptorProto. * @memberof google.protobuf * @interface IEnumDescriptorProto * @property {string|null} [name] EnumDescriptorProto name * @property {Array.|null} [value] EnumDescriptorProto value * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName */ /** * Constructs a new EnumDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumDescriptorProto. * @implements IEnumDescriptorProto * @constructor * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ function EnumDescriptorProto(properties) { this.value = []; this.reservedRange = []; this.reservedName = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumDescriptorProto name. * @member {string} name * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.name = ""; /** * EnumDescriptorProto value. * @member {Array.} value * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.value = $util.emptyArray; /** * EnumDescriptorProto options. * @member {google.protobuf.IEnumOptions|null|undefined} options * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.options = null; /** * EnumDescriptorProto reservedRange. * @member {Array.} reservedRange * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; /** * EnumDescriptorProto reservedName. * @member {Array.} reservedName * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ EnumDescriptorProto.create = function create(properties) { return new EnumDescriptorProto(properties); }; /** * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); return writer; }; /** * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.value && message.value.length)) message.value = []; message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); break; case 4: if (!(message.reservedRange && message.reservedRange.length)) message.reservedRange = []; message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); break; case 5: if (!(message.reservedName && message.reservedName.length)) message.reservedName = []; message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumDescriptorProto message. * @function verify * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.value != null && message.hasOwnProperty("value")) { if (!Array.isArray(message.value)) return "value: array expected"; for (var i = 0; i < message.value.length; ++i) { var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); if (error) return "value." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumOptions.verify(message.options); if (error) return "options." + error; } if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } } if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } return null; }; /** * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ EnumDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; var message = new $root.google.protobuf.EnumDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.value) { if (!Array.isArray(object.value)) throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); message.value = []; for (var i = 0; i < object.value.length; ++i) { if (typeof object.value[i] !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); } if (object.reservedRange) { if (!Array.isArray(object.reservedRange)) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { if (typeof object.reservedRange[i] !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); } } if (object.reservedName) { if (!Array.isArray(object.reservedName)) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); message.reservedName = []; for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } return message; }; /** * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.value = []; object.reservedRange = []; object.reservedName = []; } if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.value && message.value.length) { object.value = []; for (var j = 0; j < message.value.length; ++j) object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); if (message.reservedRange && message.reservedRange.length) { object.reservedRange = []; for (var j = 0; j < message.reservedRange.length; ++j) object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } return object; }; /** * Converts this EnumDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.EnumDescriptorProto * @instance * @returns {Object.} JSON object */ EnumDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; EnumDescriptorProto.EnumReservedRange = (function() { /** * Properties of an EnumReservedRange. * @memberof google.protobuf.EnumDescriptorProto * @interface IEnumReservedRange * @property {number|null} [start] EnumReservedRange start * @property {number|null} [end] EnumReservedRange end */ /** * Constructs a new EnumReservedRange. * @memberof google.protobuf.EnumDescriptorProto * @classdesc Represents an EnumReservedRange. * @implements IEnumReservedRange * @constructor * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set */ function EnumReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumReservedRange start. * @member {number} start * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ EnumReservedRange.prototype.start = 0; /** * EnumReservedRange end. * @member {number} end * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ EnumReservedRange.prototype.end = 0; /** * Creates a new EnumReservedRange instance using the specified properties. * @function create * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance */ EnumReservedRange.create = function create(properties) { return new EnumReservedRange(properties); }; /** * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumReservedRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumReservedRange message. * @function verify * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange */ EnumReservedRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) return object; var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this EnumReservedRange to JSON. * @function toJSON * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance * @returns {Object.} JSON object */ EnumReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumReservedRange; })(); return EnumDescriptorProto; })(); protobuf.EnumValueDescriptorProto = (function() { /** * Properties of an EnumValueDescriptorProto. * @memberof google.protobuf * @interface IEnumValueDescriptorProto * @property {string|null} [name] EnumValueDescriptorProto name * @property {number|null} [number] EnumValueDescriptorProto number * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options */ /** * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumValueDescriptorProto. * @implements IEnumValueDescriptorProto * @constructor * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumValueDescriptorProto name. * @member {string} name * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.name = ""; /** * EnumValueDescriptorProto number. * @member {number} number * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.number = 0; /** * EnumValueDescriptorProto options. * @member {google.protobuf.IEnumValueOptions|null|undefined} options * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.options = null; /** * Creates a new EnumValueDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ EnumValueDescriptorProto.create = function create(properties) { return new EnumValueDescriptorProto(properties); }; /** * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.number = reader.int32(); break; case 3: message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumValueDescriptorProto message. * @function verify * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumValueDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumValueOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ EnumValueDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; var message = new $root.google.protobuf.EnumValueDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.number != null) message.number = object.number | 0; if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.number = 0; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); return object; }; /** * Converts this EnumValueDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumValueDescriptorProto; })(); protobuf.ServiceDescriptorProto = (function() { /** * Properties of a ServiceDescriptorProto. * @memberof google.protobuf * @interface IServiceDescriptorProto * @property {string|null} [name] ServiceDescriptorProto name * @property {Array.|null} [method] ServiceDescriptorProto method * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options */ /** * Constructs a new ServiceDescriptorProto. * @memberof google.protobuf * @classdesc Represents a ServiceDescriptorProto. * @implements IServiceDescriptorProto * @constructor * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ function ServiceDescriptorProto(properties) { this.method = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ServiceDescriptorProto name. * @member {string} name * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.name = ""; /** * ServiceDescriptorProto method. * @member {Array.} method * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.method = $util.emptyArray; /** * ServiceDescriptorProto options. * @member {google.protobuf.IServiceOptions|null|undefined} options * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.options = null; /** * Creates a new ServiceDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance */ ServiceDescriptorProto.create = function create(properties) { return new ServiceDescriptorProto(properties); }; /** * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ServiceDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.method && message.method.length)) message.method = []; message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ServiceDescriptorProto message. * @function verify * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ServiceDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.method != null && message.hasOwnProperty("method")) { if (!Array.isArray(message.method)) return "method: array expected"; for (var i = 0; i < message.method.length; ++i) { var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); if (error) return "method." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ServiceOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto */ ServiceDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ServiceDescriptorProto) return object; var message = new $root.google.protobuf.ServiceDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.method) { if (!Array.isArray(object.method)) throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); message.method = []; for (var i = 0; i < object.method.length; ++i) { if (typeof object.method[i] !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ServiceDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.method = []; if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.method && message.method.length) { object.method = []; for (var j = 0; j < message.method.length; ++j) object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; /** * Converts this ServiceDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.ServiceDescriptorProto * @instance * @returns {Object.} JSON object */ ServiceDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ServiceDescriptorProto; })(); protobuf.MethodDescriptorProto = (function() { /** * Properties of a MethodDescriptorProto. * @memberof google.protobuf * @interface IMethodDescriptorProto * @property {string|null} [name] MethodDescriptorProto name * @property {string|null} [inputType] MethodDescriptorProto inputType * @property {string|null} [outputType] MethodDescriptorProto outputType * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming */ /** * Constructs a new MethodDescriptorProto. * @memberof google.protobuf * @classdesc Represents a MethodDescriptorProto. * @implements IMethodDescriptorProto * @constructor * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ function MethodDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MethodDescriptorProto name. * @member {string} name * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.name = ""; /** * MethodDescriptorProto inputType. * @member {string} inputType * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.inputType = ""; /** * MethodDescriptorProto outputType. * @member {string} outputType * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.outputType = ""; /** * MethodDescriptorProto options. * @member {google.protobuf.IMethodOptions|null|undefined} options * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.options = null; /** * MethodDescriptorProto clientStreaming. * @member {boolean} clientStreaming * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.clientStreaming = false; /** * MethodDescriptorProto serverStreaming. * @member {boolean} serverStreaming * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.serverStreaming = false; /** * Creates a new MethodDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ MethodDescriptorProto.create = function create(properties) { return new MethodDescriptorProto(properties); }; /** * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; /** * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.inputType = reader.string(); break; case 3: message.outputType = reader.string(); break; case 4: message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); break; case 5: message.clientStreaming = reader.bool(); break; case 6: message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MethodDescriptorProto message. * @function verify * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MethodDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.inputType != null && message.hasOwnProperty("inputType")) if (!$util.isString(message.inputType)) return "inputType: string expected"; if (message.outputType != null && message.hasOwnProperty("outputType")) if (!$util.isString(message.outputType)) return "outputType: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MethodOptions.verify(message.options); if (error) return "options." + error; } if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) if (typeof message.clientStreaming !== "boolean") return "clientStreaming: boolean expected"; if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) if (typeof message.serverStreaming !== "boolean") return "serverStreaming: boolean expected"; return null; }; /** * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ MethodDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MethodDescriptorProto) return object; var message = new $root.google.protobuf.MethodDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.inputType != null) message.inputType = String(object.inputType); if (object.outputType != null) message.outputType = String(object.outputType); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); } if (object.clientStreaming != null) message.clientStreaming = Boolean(object.clientStreaming); if (object.serverStreaming != null) message.serverStreaming = Boolean(object.serverStreaming); return message; }; /** * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.inputType = ""; object.outputType = ""; object.options = null; object.clientStreaming = false; object.serverStreaming = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.inputType != null && message.hasOwnProperty("inputType")) object.inputType = message.inputType; if (message.outputType != null && message.hasOwnProperty("outputType")) object.outputType = message.outputType; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) object.clientStreaming = message.clientStreaming; if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) object.serverStreaming = message.serverStreaming; return object; }; /** * Converts this MethodDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MethodDescriptorProto; })(); protobuf.FileOptions = (function() { /** * Properties of a FileOptions. * @memberof google.protobuf * @interface IFileOptions * @property {string|null} [javaPackage] FileOptions javaPackage * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor * @property {string|null} [goPackage] FileOptions goPackage * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices * @property {boolean|null} [deprecated] FileOptions deprecated * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix * @property {string|null} [csharpNamespace] FileOptions csharpNamespace * @property {string|null} [swiftPrefix] FileOptions swiftPrefix * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix * @property {string|null} [phpNamespace] FileOptions phpNamespace * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption */ /** * Constructs a new FileOptions. * @memberof google.protobuf * @classdesc Represents a FileOptions. * @implements IFileOptions * @constructor * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ function FileOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileOptions javaPackage. * @member {string} javaPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaPackage = ""; /** * FileOptions javaOuterClassname. * @member {string} javaOuterClassname * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaOuterClassname = ""; /** * FileOptions javaMultipleFiles. * @member {boolean} javaMultipleFiles * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaMultipleFiles = false; /** * FileOptions javaGenerateEqualsAndHash. * @member {boolean} javaGenerateEqualsAndHash * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaGenerateEqualsAndHash = false; /** * FileOptions javaStringCheckUtf8. * @member {boolean} javaStringCheckUtf8 * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaStringCheckUtf8 = false; /** * FileOptions optimizeFor. * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.optimizeFor = 1; /** * FileOptions goPackage. * @member {string} goPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.goPackage = ""; /** * FileOptions ccGenericServices. * @member {boolean} ccGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.ccGenericServices = false; /** * FileOptions javaGenericServices. * @member {boolean} javaGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaGenericServices = false; /** * FileOptions pyGenericServices. * @member {boolean} pyGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.pyGenericServices = false; /** * FileOptions phpGenericServices. * @member {boolean} phpGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpGenericServices = false; /** * FileOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.deprecated = false; /** * FileOptions ccEnableArenas. * @member {boolean} ccEnableArenas * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. * @member {string} objcClassPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.objcClassPrefix = ""; /** * FileOptions csharpNamespace. * @member {string} csharpNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.csharpNamespace = ""; /** * FileOptions swiftPrefix. * @member {string} swiftPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.swiftPrefix = ""; /** * FileOptions phpClassPrefix. * @member {string} phpClassPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpClassPrefix = ""; /** * FileOptions phpNamespace. * @member {string} phpNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpNamespace = ""; /** * FileOptions phpMetadataNamespace. * @member {string} phpMetadataNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpMetadataNamespace = ""; /** * FileOptions rubyPackage. * @member {string} rubyPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.rubyPackage = ""; /** * FileOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new FileOptions instance using the specified properties. * @function create * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions=} [properties] Properties to set * @returns {google.protobuf.FileOptions} FileOptions instance */ FileOptions.create = function create(properties) { return new FileOptions(properties); }; /** * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileOptions} FileOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.javaPackage = reader.string(); break; case 8: message.javaOuterClassname = reader.string(); break; case 10: message.javaMultipleFiles = reader.bool(); break; case 20: message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: message.javaStringCheckUtf8 = reader.bool(); break; case 9: message.optimizeFor = reader.int32(); break; case 11: message.goPackage = reader.string(); break; case 16: message.ccGenericServices = reader.bool(); break; case 17: message.javaGenericServices = reader.bool(); break; case 18: message.pyGenericServices = reader.bool(); break; case 42: message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: message.ccEnableArenas = reader.bool(); break; case 36: message.objcClassPrefix = reader.string(); break; case 37: message.csharpNamespace = reader.string(); break; case 39: message.swiftPrefix = reader.string(); break; case 40: message.phpClassPrefix = reader.string(); break; case 41: message.phpNamespace = reader.string(); break; case 44: message.phpMetadataNamespace = reader.string(); break; case 45: message.rubyPackage = reader.string(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileOptions} FileOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileOptions message. * @function verify * @memberof google.protobuf.FileOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) if (!$util.isString(message.javaPackage)) return "javaPackage: string expected"; if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) if (!$util.isString(message.javaOuterClassname)) return "javaOuterClassname: string expected"; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) if (typeof message.javaMultipleFiles !== "boolean") return "javaMultipleFiles: boolean expected"; if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) if (typeof message.javaGenerateEqualsAndHash !== "boolean") return "javaGenerateEqualsAndHash: boolean expected"; if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) if (typeof message.javaStringCheckUtf8 !== "boolean") return "javaStringCheckUtf8: boolean expected"; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) switch (message.optimizeFor) { default: return "optimizeFor: enum value expected"; case 1: case 2: case 3: break; } if (message.goPackage != null && message.hasOwnProperty("goPackage")) if (!$util.isString(message.goPackage)) return "goPackage: string expected"; if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) if (typeof message.ccGenericServices !== "boolean") return "ccGenericServices: boolean expected"; if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) if (typeof message.javaGenericServices !== "boolean") return "javaGenericServices: boolean expected"; if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) if (typeof message.pyGenericServices !== "boolean") return "pyGenericServices: boolean expected"; if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) if (typeof message.phpGenericServices !== "boolean") return "phpGenericServices: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) if (typeof message.ccEnableArenas !== "boolean") return "ccEnableArenas: boolean expected"; if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) if (!$util.isString(message.objcClassPrefix)) return "objcClassPrefix: string expected"; if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) if (!$util.isString(message.csharpNamespace)) return "csharpNamespace: string expected"; if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) if (!$util.isString(message.swiftPrefix)) return "swiftPrefix: string expected"; if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) if (!$util.isString(message.phpClassPrefix)) return "phpClassPrefix: string expected"; if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) if (!$util.isString(message.phpNamespace)) return "phpNamespace: string expected"; if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) if (!$util.isString(message.phpMetadataNamespace)) return "phpMetadataNamespace: string expected"; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) if (!$util.isString(message.rubyPackage)) return "rubyPackage: string expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileOptions} FileOptions */ FileOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileOptions) return object; var message = new $root.google.protobuf.FileOptions(); if (object.javaPackage != null) message.javaPackage = String(object.javaPackage); if (object.javaOuterClassname != null) message.javaOuterClassname = String(object.javaOuterClassname); if (object.javaMultipleFiles != null) message.javaMultipleFiles = Boolean(object.javaMultipleFiles); if (object.javaGenerateEqualsAndHash != null) message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { case "SPEED": case 1: message.optimizeFor = 1; break; case "CODE_SIZE": case 2: message.optimizeFor = 2; break; case "LITE_RUNTIME": case 3: message.optimizeFor = 3; break; } if (object.goPackage != null) message.goPackage = String(object.goPackage); if (object.ccGenericServices != null) message.ccGenericServices = Boolean(object.ccGenericServices); if (object.javaGenericServices != null) message.javaGenericServices = Boolean(object.javaGenericServices); if (object.pyGenericServices != null) message.pyGenericServices = Boolean(object.pyGenericServices); if (object.phpGenericServices != null) message.phpGenericServices = Boolean(object.phpGenericServices); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.ccEnableArenas != null) message.ccEnableArenas = Boolean(object.ccEnableArenas); if (object.objcClassPrefix != null) message.objcClassPrefix = String(object.objcClassPrefix); if (object.csharpNamespace != null) message.csharpNamespace = String(object.csharpNamespace); if (object.swiftPrefix != null) message.swiftPrefix = String(object.swiftPrefix); if (object.phpClassPrefix != null) message.phpClassPrefix = String(object.phpClassPrefix); if (object.phpNamespace != null) message.phpNamespace = String(object.phpNamespace); if (object.phpMetadataNamespace != null) message.phpMetadataNamespace = String(object.phpMetadataNamespace); if (object.rubyPackage != null) message.rubyPackage = String(object.rubyPackage); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; object.optimizeFor = options.enums === String ? "SPEED" : 1; object.javaMultipleFiles = false; object.goPackage = ""; object.ccGenericServices = false; object.javaGenericServices = false; object.pyGenericServices = false; object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; object.phpClassPrefix = ""; object.phpNamespace = ""; object.phpGenericServices = false; object.phpMetadataNamespace = ""; object.rubyPackage = ""; } if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) object.javaPackage = message.javaPackage; if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) object.goPackage = message.goPackage; if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) object.ccGenericServices = message.ccGenericServices; if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) object.javaGenericServices = message.javaGenericServices; if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) object.pyGenericServices = message.pyGenericServices; if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) object.javaStringCheckUtf8 = message.javaStringCheckUtf8; if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) object.ccEnableArenas = message.ccEnableArenas; if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) object.objcClassPrefix = message.objcClassPrefix; if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) object.csharpNamespace = message.csharpNamespace; if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) object.swiftPrefix = message.swiftPrefix; if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) object.phpClassPrefix = message.phpClassPrefix; if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) object.phpNamespace = message.phpNamespace; if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) object.phpGenericServices = message.phpGenericServices; if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) object.phpMetadataNamespace = message.phpMetadataNamespace; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) object.rubyPackage = message.rubyPackage; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this FileOptions to JSON. * @function toJSON * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value */ FileOptions.OptimizeMode = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "SPEED"] = 1; values[valuesById[2] = "CODE_SIZE"] = 2; values[valuesById[3] = "LITE_RUNTIME"] = 3; return values; })(); return FileOptions; })(); protobuf.MessageOptions = (function() { /** * Properties of a MessageOptions. * @memberof google.protobuf * @interface IMessageOptions * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor * @property {boolean|null} [deprecated] MessageOptions deprecated * @property {boolean|null} [mapEntry] MessageOptions mapEntry * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption */ /** * Constructs a new MessageOptions. * @memberof google.protobuf * @classdesc Represents a MessageOptions. * @implements IMessageOptions * @constructor * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ function MessageOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MessageOptions messageSetWireFormat. * @member {boolean} messageSetWireFormat * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.messageSetWireFormat = false; /** * MessageOptions noStandardDescriptorAccessor. * @member {boolean} noStandardDescriptorAccessor * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.noStandardDescriptorAccessor = false; /** * MessageOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.deprecated = false; /** * MessageOptions mapEntry. * @member {boolean} mapEntry * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.mapEntry = false; /** * MessageOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new MessageOptions instance using the specified properties. * @function create * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions=} [properties] Properties to set * @returns {google.protobuf.MessageOptions} MessageOptions instance */ MessageOptions.create = function create(properties) { return new MessageOptions(properties); }; /** * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MessageOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessageOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.messageSetWireFormat = reader.bool(); break; case 2: message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: message.mapEntry = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MessageOptions message. * @function verify * @memberof google.protobuf.MessageOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MessageOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) if (typeof message.messageSetWireFormat !== "boolean") return "messageSetWireFormat: boolean expected"; if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) if (typeof message.noStandardDescriptorAccessor !== "boolean") return "noStandardDescriptorAccessor: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) if (typeof message.mapEntry !== "boolean") return "mapEntry: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.MessageOptions} MessageOptions */ MessageOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MessageOptions) return object; var message = new $root.google.protobuf.MessageOptions(); if (object.messageSetWireFormat != null) message.messageSetWireFormat = Boolean(object.messageSetWireFormat); if (object.noStandardDescriptorAccessor != null) message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.mapEntry != null) message.mapEntry = Boolean(object.mapEntry); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.messageSetWireFormat = false; object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) object.mapEntry = message.mapEntry; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this MessageOptions to JSON. * @function toJSON * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MessageOptions; })(); protobuf.FieldOptions = (function() { /** * Properties of a FieldOptions. * @memberof google.protobuf * @interface IFieldOptions * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype * @property {boolean|null} [packed] FieldOptions packed * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype * @property {boolean|null} [lazy] FieldOptions lazy * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption */ /** * Constructs a new FieldOptions. * @memberof google.protobuf * @classdesc Represents a FieldOptions. * @implements IFieldOptions * @constructor * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ function FieldOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldOptions ctype. * @member {google.protobuf.FieldOptions.CType} ctype * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.ctype = 0; /** * FieldOptions packed. * @member {boolean} packed * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.packed = false; /** * FieldOptions jstype. * @member {google.protobuf.FieldOptions.JSType} jstype * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.jstype = 0; /** * FieldOptions lazy. * @member {boolean} lazy * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.lazy = false; /** * FieldOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.deprecated = false; /** * FieldOptions weak. * @member {boolean} weak * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.weak = false; /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new FieldOptions instance using the specified properties. * @function create * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions=} [properties] Properties to set * @returns {google.protobuf.FieldOptions} FieldOptions instance */ FieldOptions.create = function create(properties) { return new FieldOptions(properties); }; /** * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.ctype = reader.int32(); break; case 2: message.packed = reader.bool(); break; case 6: message.jstype = reader.int32(); break; case 5: message.lazy = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 10: message.weak = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldOptions message. * @function verify * @memberof google.protobuf.FieldOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.ctype != null && message.hasOwnProperty("ctype")) switch (message.ctype) { default: return "ctype: enum value expected"; case 0: case 1: case 2: break; } if (message.packed != null && message.hasOwnProperty("packed")) if (typeof message.packed !== "boolean") return "packed: boolean expected"; if (message.jstype != null && message.hasOwnProperty("jstype")) switch (message.jstype) { default: return "jstype: enum value expected"; case 0: case 1: case 2: break; } if (message.lazy != null && message.hasOwnProperty("lazy")) if (typeof message.lazy !== "boolean") return "lazy: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.weak != null && message.hasOwnProperty("weak")) if (typeof message.weak !== "boolean") return "weak: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldOptions} FieldOptions */ FieldOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldOptions) return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { case "STRING": case 0: message.ctype = 0; break; case "CORD": case 1: message.ctype = 1; break; case "STRING_PIECE": case 2: message.ctype = 2; break; } if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { case "JS_NORMAL": case 0: message.jstype = 0; break; case "JS_STRING": case 1: message.jstype = 1; break; case "JS_NUMBER": case 2: message.jstype = 2; break; } if (object.lazy != null) message.lazy = Boolean(object.lazy); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.weak != null) message.weak = Boolean(object.weak); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; object.packed = false; object.deprecated = false; object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this FieldOptions to JSON. * @function toJSON * @memberof google.protobuf.FieldOptions * @instance * @returns {Object.} JSON object */ FieldOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * CType enum. * @name google.protobuf.FieldOptions.CType * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value */ FieldOptions.CType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STRING"] = 0; values[valuesById[1] = "CORD"] = 1; values[valuesById[2] = "STRING_PIECE"] = 2; return values; })(); /** * JSType enum. * @name google.protobuf.FieldOptions.JSType * @enum {number} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value */ FieldOptions.JSType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "JS_NORMAL"] = 0; values[valuesById[1] = "JS_STRING"] = 1; values[valuesById[2] = "JS_NUMBER"] = 2; return values; })(); return FieldOptions; })(); protobuf.OneofOptions = (function() { /** * Properties of an OneofOptions. * @memberof google.protobuf * @interface IOneofOptions * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** * Constructs a new OneofOptions. * @memberof google.protobuf * @classdesc Represents an OneofOptions. * @implements IOneofOptions * @constructor * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ function OneofOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OneofOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.OneofOptions * @instance */ OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new OneofOptions instance using the specified properties. * @function create * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions=} [properties] Properties to set * @returns {google.protobuf.OneofOptions} OneofOptions instance */ OneofOptions.create = function create(properties) { return new OneofOptions(properties); }; /** * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OneofOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OneofOptions message. * @function verify * @memberof google.protobuf.OneofOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OneofOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.OneofOptions} OneofOptions */ OneofOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.OneofOptions) return object; var message = new $root.google.protobuf.OneofOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OneofOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this OneofOptions to JSON. * @function toJSON * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OneofOptions; })(); protobuf.EnumOptions = (function() { /** * Properties of an EnumOptions. * @memberof google.protobuf * @interface IEnumOptions * @property {boolean|null} [allowAlias] EnumOptions allowAlias * @property {boolean|null} [deprecated] EnumOptions deprecated * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** * Constructs a new EnumOptions. * @memberof google.protobuf * @classdesc Represents an EnumOptions. * @implements IEnumOptions * @constructor * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ function EnumOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumOptions allowAlias. * @member {boolean} allowAlias * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.allowAlias = false; /** * EnumOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.deprecated = false; /** * EnumOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new EnumOptions instance using the specified properties. * @function create * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions=} [properties] Properties to set * @returns {google.protobuf.EnumOptions} EnumOptions instance */ EnumOptions.create = function create(properties) { return new EnumOptions(properties); }; /** * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumOptions message. * @function verify * @memberof google.protobuf.EnumOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) if (typeof message.allowAlias !== "boolean") return "allowAlias: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumOptions} EnumOptions */ EnumOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumOptions) return object; var message = new $root.google.protobuf.EnumOptions(); if (object.allowAlias != null) message.allowAlias = Boolean(object.allowAlias); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.allowAlias = false; object.deprecated = false; } if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) object.allowAlias = message.allowAlias; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this EnumOptions to JSON. * @function toJSON * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumOptions; })(); protobuf.EnumValueOptions = (function() { /** * Properties of an EnumValueOptions. * @memberof google.protobuf * @interface IEnumValueOptions * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** * Constructs a new EnumValueOptions. * @memberof google.protobuf * @classdesc Represents an EnumValueOptions. * @implements IEnumValueOptions * @constructor * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ function EnumValueOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumValueOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.EnumValueOptions * @instance */ EnumValueOptions.prototype.deprecated = false; /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.EnumValueOptions * @instance */ EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new EnumValueOptions instance using the specified properties. * @function create * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ EnumValueOptions.create = function create(properties) { return new EnumValueOptions(properties); }; /** * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumValueOptions message. * @function verify * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumValueOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ EnumValueOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumValueOptions) return object; var message = new $root.google.protobuf.EnumValueOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumValueOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) object.deprecated = false; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this EnumValueOptions to JSON. * @function toJSON * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumValueOptions; })(); protobuf.ServiceOptions = (function() { /** * Properties of a ServiceOptions. * @memberof google.protobuf * @interface IServiceOptions * @property {boolean|null} [deprecated] ServiceOptions deprecated * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes */ /** * Constructs a new ServiceOptions. * @memberof google.protobuf * @classdesc Represents a ServiceOptions. * @implements IServiceOptions * @constructor * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ function ServiceOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ServiceOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype.deprecated = false; /** * ServiceOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** * ServiceOptions .google.api.defaultHost. * @member {string} .google.api.defaultHost * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** * ServiceOptions .google.api.oauthScopes. * @member {string} .google.api.oauthScopes * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype[".google.api.oauthScopes"] = ""; /** * Creates a new ServiceOptions instance using the specified properties. * @function create * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions=} [properties] Properties to set * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ ServiceOptions.create = function create(properties) { return new ServiceOptions(properties); }; /** * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; /** * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 33: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1049: message[".google.api.defaultHost"] = reader.string(); break; case 1050: message[".google.api.oauthScopes"] = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ServiceOptions message. * @function verify * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ServiceOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) if (!$util.isString(message[".google.api.defaultHost"])) return ".google.api.defaultHost: string expected"; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) if (!$util.isString(message[".google.api.oauthScopes"])) return ".google.api.oauthScopes: string expected"; return null; }; /** * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.ServiceOptions} ServiceOptions */ ServiceOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ServiceOptions) return object; var message = new $root.google.protobuf.ServiceOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.defaultHost"] != null) message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); if (object[".google.api.oauthScopes"] != null) message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; /** * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.deprecated = false; object[".google.api.defaultHost"] = ""; object[".google.api.oauthScopes"] = ""; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; /** * Converts this ServiceOptions to JSON. * @function toJSON * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ServiceOptions; })(); protobuf.MethodOptions = (function() { /** * Properties of a MethodOptions. * @memberof google.protobuf * @interface IMethodOptions * @property {boolean|null} [deprecated] MethodOptions deprecated * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature */ /** * Constructs a new MethodOptions. * @memberof google.protobuf * @classdesc Represents a MethodOptions. * @implements IMethodOptions * @constructor * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ function MethodOptions(properties) { this.uninterpretedOption = []; this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MethodOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.deprecated = false; /** * MethodOptions idempotencyLevel. * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.idempotencyLevel = 0; /** * MethodOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** * MethodOptions .google.api.http. * @member {google.api.IHttpRule|null|undefined} .google.api.http * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.api.http"] = null; /** * MethodOptions .google.api.methodSignature. * @member {Array.} .google.api.methodSignature * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** * Creates a new MethodOptions instance using the specified properties. * @function create * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions=} [properties] Properties to set * @returns {google.protobuf.MethodOptions} MethodOptions instance */ MethodOptions.create = function create(properties) { return new MethodOptions(properties); }; /** * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; /** * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MethodOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 33: message.deprecated = reader.bool(); break; case 34: message.idempotencyLevel = reader.int32(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 72295728: message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; case 1051: if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) message[".google.api.methodSignature"] = []; message[".google.api.methodSignature"].push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MethodOptions message. * @function verify * @memberof google.protobuf.MethodOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) switch (message.idempotencyLevel) { default: return "idempotencyLevel: enum value expected"; case 0: case 1: case 2: break; } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); if (error) return ".google.api.http." + error; } if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { if (!Array.isArray(message[".google.api.methodSignature"])) return ".google.api.methodSignature: array expected"; for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) if (!$util.isString(message[".google.api.methodSignature"][i])) return ".google.api.methodSignature: string[] expected"; } return null; }; /** * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.MethodOptions} MethodOptions */ MethodOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MethodOptions) return object; var message = new $root.google.protobuf.MethodOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; break; case "NO_SIDE_EFFECTS": case 1: message.idempotencyLevel = 1; break; case "IDEMPOTENT": case 2: message.idempotencyLevel = 2; break; } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.http"] != null) { if (typeof object[".google.api.http"] !== "object") throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); } if (object[".google.api.methodSignature"]) { if (!Array.isArray(object[".google.api.methodSignature"])) throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); message[".google.api.methodSignature"] = []; for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } return message; }; /** * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; object[".google.api.methodSignature"] = []; } if (options.defaults) { object.deprecated = false; object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; object[".google.api.http"] = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { object[".google.api.methodSignature"] = []; for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; } if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; /** * Converts this MethodOptions to JSON. * @function toJSON * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel * @enum {number} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value */ MethodOptions.IdempotencyLevel = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; values[valuesById[2] = "IDEMPOTENT"] = 2; return values; })(); return MethodOptions; })(); protobuf.UninterpretedOption = (function() { /** * Properties of an UninterpretedOption. * @memberof google.protobuf * @interface IUninterpretedOption * @property {Array.|null} [name] UninterpretedOption name * @property {string|null} [identifierValue] UninterpretedOption identifierValue * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue * @property {number|null} [doubleValue] UninterpretedOption doubleValue * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue */ /** * Constructs a new UninterpretedOption. * @memberof google.protobuf * @classdesc Represents an UninterpretedOption. * @implements IUninterpretedOption * @constructor * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ function UninterpretedOption(properties) { this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UninterpretedOption name. * @member {Array.} name * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.name = $util.emptyArray; /** * UninterpretedOption identifierValue. * @member {string} identifierValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.identifierValue = ""; /** * UninterpretedOption positiveIntValue. * @member {number|Long} positiveIntValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * UninterpretedOption negativeIntValue. * @member {number|Long} negativeIntValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * UninterpretedOption doubleValue. * @member {number} doubleValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.doubleValue = 0; /** * UninterpretedOption stringValue. * @member {Uint8Array} stringValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** * UninterpretedOption aggregateValue. * @member {string} aggregateValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.aggregateValue = ""; /** * Creates a new UninterpretedOption instance using the specified properties. * @function create * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ UninterpretedOption.create = function create(properties) { return new UninterpretedOption(properties); }; /** * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: if (!(message.name && message.name.length)) message.name = []; message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; case 3: message.identifierValue = reader.string(); break; case 4: message.positiveIntValue = reader.uint64(); break; case 5: message.negativeIntValue = reader.int64(); break; case 6: message.doubleValue = reader.double(); break; case 7: message.stringValue = reader.bytes(); break; case 8: message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UninterpretedOption message. * @function verify * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UninterpretedOption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) { if (!Array.isArray(message.name)) return "name: array expected"; for (var i = 0; i < message.name.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); if (error) return "name." + error; } } if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) if (!$util.isString(message.identifierValue)) return "identifierValue: string expected"; if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) return "positiveIntValue: integer|Long expected"; if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) return "negativeIntValue: integer|Long expected"; if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; if (message.stringValue != null && message.hasOwnProperty("stringValue")) if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) return "stringValue: buffer expected"; if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) if (!$util.isString(message.aggregateValue)) return "aggregateValue: string expected"; return null; }; /** * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ UninterpretedOption.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.UninterpretedOption) return object; var message = new $root.google.protobuf.UninterpretedOption(); if (object.name) { if (!Array.isArray(object.name)) throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); message.name = []; for (var i = 0; i < object.name.length; ++i) { if (typeof object.name[i] !== "object") throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); } } if (object.identifierValue != null) message.identifierValue = String(object.identifierValue); if (object.positiveIntValue != null) if ($util.Long) (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; else if (typeof object.positiveIntValue === "string") message.positiveIntValue = parseInt(object.positiveIntValue, 10); else if (typeof object.positiveIntValue === "number") message.positiveIntValue = object.positiveIntValue; else if (typeof object.positiveIntValue === "object") message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); if (object.negativeIntValue != null) if ($util.Long) (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; else if (typeof object.negativeIntValue === "string") message.negativeIntValue = parseInt(object.negativeIntValue, 10); else if (typeof object.negativeIntValue === "number") message.negativeIntValue = object.negativeIntValue; else if (typeof object.negativeIntValue === "object") message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); if (object.doubleValue != null) message.doubleValue = Number(object.doubleValue); if (object.stringValue != null) if (typeof object.stringValue === "string") $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); else if (object.stringValue.length) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); return message; }; /** * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.name = []; if (options.defaults) { object.identifierValue = ""; if ($util.Long) { var long = new $util.Long(0, 0, true); object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.positiveIntValue = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.negativeIntValue = options.longs === String ? "0" : 0; object.doubleValue = 0; if (options.bytes === String) object.stringValue = ""; else { object.stringValue = []; if (options.bytes !== Array) object.stringValue = $util.newBuffer(object.stringValue); } object.aggregateValue = ""; } if (message.name && message.name.length) { object.name = []; for (var j = 0; j < message.name.length; ++j) object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); } if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) object.identifierValue = message.identifierValue; if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) if (typeof message.positiveIntValue === "number") object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; else object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) if (typeof message.negativeIntValue === "number") object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; else object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; if (message.stringValue != null && message.hasOwnProperty("stringValue")) object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) object.aggregateValue = message.aggregateValue; return object; }; /** * Converts this UninterpretedOption to JSON. * @function toJSON * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; UninterpretedOption.NamePart = (function() { /** * Properties of a NamePart. * @memberof google.protobuf.UninterpretedOption * @interface INamePart * @property {string} namePart NamePart namePart * @property {boolean} isExtension NamePart isExtension */ /** * Constructs a new NamePart. * @memberof google.protobuf.UninterpretedOption * @classdesc Represents a NamePart. * @implements INamePart * @constructor * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set */ function NamePart(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * NamePart namePart. * @member {string} namePart * @memberof google.protobuf.UninterpretedOption.NamePart * @instance */ NamePart.prototype.namePart = ""; /** * NamePart isExtension. * @member {boolean} isExtension * @memberof google.protobuf.UninterpretedOption.NamePart * @instance */ NamePart.prototype.isExtension = false; /** * Creates a new NamePart instance using the specified properties. * @function create * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance */ NamePart.create = function create(properties) { return new NamePart(properties); }; /** * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encode * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NamePart.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); return writer; }; /** * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NamePart.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a NamePart message from the specified reader or buffer. * @function decode * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NamePart.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.namePart = reader.string(); break; case 2: message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); break; } } if (!message.hasOwnProperty("namePart")) throw $util.ProtocolError("missing required 'namePart'", { instance: message }); if (!message.hasOwnProperty("isExtension")) throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; /** * Decodes a NamePart message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NamePart.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a NamePart message. * @function verify * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ NamePart.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (!$util.isString(message.namePart)) return "namePart: string expected"; if (typeof message.isExtension !== "boolean") return "isExtension: boolean expected"; return null; }; /** * Creates a NamePart message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart */ NamePart.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) return object; var message = new $root.google.protobuf.UninterpretedOption.NamePart(); if (object.namePart != null) message.namePart = String(object.namePart); if (object.isExtension != null) message.isExtension = Boolean(object.isExtension); return message; }; /** * Creates a plain object from a NamePart message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ NamePart.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.namePart = ""; object.isExtension = false; } if (message.namePart != null && message.hasOwnProperty("namePart")) object.namePart = message.namePart; if (message.isExtension != null && message.hasOwnProperty("isExtension")) object.isExtension = message.isExtension; return object; }; /** * Converts this NamePart to JSON. * @function toJSON * @memberof google.protobuf.UninterpretedOption.NamePart * @instance * @returns {Object.} JSON object */ NamePart.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return NamePart; })(); return UninterpretedOption; })(); protobuf.SourceCodeInfo = (function() { /** * Properties of a SourceCodeInfo. * @memberof google.protobuf * @interface ISourceCodeInfo * @property {Array.|null} [location] SourceCodeInfo location */ /** * Constructs a new SourceCodeInfo. * @memberof google.protobuf * @classdesc Represents a SourceCodeInfo. * @implements ISourceCodeInfo * @constructor * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ function SourceCodeInfo(properties) { this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SourceCodeInfo location. * @member {Array.} location * @memberof google.protobuf.SourceCodeInfo * @instance */ SourceCodeInfo.prototype.location = $util.emptyArray; /** * Creates a new SourceCodeInfo instance using the specified properties. * @function create * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ SourceCodeInfo.create = function create(properties) { return new SourceCodeInfo(properties); }; /** * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.location != null && message.location.length) for (var i = 0; i < message.location.length; ++i) $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.location && message.location.length)) message.location = []; message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SourceCodeInfo message. * @function verify * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SourceCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.location != null && message.hasOwnProperty("location")) { if (!Array.isArray(message.location)) return "location: array expected"; for (var i = 0; i < message.location.length; ++i) { var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); if (error) return "location." + error; } } return null; }; /** * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ SourceCodeInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; var message = new $root.google.protobuf.SourceCodeInfo(); if (object.location) { if (!Array.isArray(object.location)) throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); message.location = []; for (var i = 0; i < object.location.length; ++i) { if (typeof object.location[i] !== "object") throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); } } return message; }; /** * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.location = []; if (message.location && message.location.length) { object.location = []; for (var j = 0; j < message.location.length; ++j) object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); } return object; }; /** * Converts this SourceCodeInfo to JSON. * @function toJSON * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; SourceCodeInfo.Location = (function() { /** * Properties of a Location. * @memberof google.protobuf.SourceCodeInfo * @interface ILocation * @property {Array.|null} [path] Location path * @property {Array.|null} [span] Location span * @property {string|null} [leadingComments] Location leadingComments * @property {string|null} [trailingComments] Location trailingComments * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments */ /** * Constructs a new Location. * @memberof google.protobuf.SourceCodeInfo * @classdesc Represents a Location. * @implements ILocation * @constructor * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ function Location(properties) { this.path = []; this.span = []; this.leadingDetachedComments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Location path. * @member {Array.} path * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.path = $util.emptyArray; /** * Location span. * @member {Array.} span * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.span = $util.emptyArray; /** * Location leadingComments. * @member {string} leadingComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.leadingComments = ""; /** * Location trailingComments. * @member {string} trailingComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.trailingComments = ""; /** * Location leadingDetachedComments. * @member {Array.} leadingDetachedComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.leadingDetachedComments = $util.emptyArray; /** * Creates a new Location instance using the specified properties. * @function create * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ Location.create = function create(properties) { return new Location(properties); }; /** * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encode * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } if (message.span != null && message.span.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); for (var i = 0; i < message.span.length; ++i) writer.int32(message.span[i]); writer.ldelim(); } if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); return writer; }; /** * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Location message from the specified reader or buffer. * @function decode * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.path && message.path.length)) message.path = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.path.push(reader.int32()); } else message.path.push(reader.int32()); break; case 2: if (!(message.span && message.span.length)) message.span = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.span.push(reader.int32()); } else message.span.push(reader.int32()); break; case 3: message.leadingComments = reader.string(); break; case 4: message.trailingComments = reader.string(); break; case 6: if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) message.leadingDetachedComments = []; message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Location message. * @function verify * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Location.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { if (!Array.isArray(message.path)) return "path: array expected"; for (var i = 0; i < message.path.length; ++i) if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } if (message.span != null && message.hasOwnProperty("span")) { if (!Array.isArray(message.span)) return "span: array expected"; for (var i = 0; i < message.span.length; ++i) if (!$util.isInteger(message.span[i])) return "span: integer[] expected"; } if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) if (!$util.isString(message.leadingComments)) return "leadingComments: string expected"; if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) if (!$util.isString(message.trailingComments)) return "trailingComments: string expected"; if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { if (!Array.isArray(message.leadingDetachedComments)) return "leadingDetachedComments: array expected"; for (var i = 0; i < message.leadingDetachedComments.length; ++i) if (!$util.isString(message.leadingDetachedComments[i])) return "leadingDetachedComments: string[] expected"; } return null; }; /** * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo.Location} Location */ Location.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; var message = new $root.google.protobuf.SourceCodeInfo.Location(); if (object.path) { if (!Array.isArray(object.path)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } if (object.span) { if (!Array.isArray(object.span)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); message.span = []; for (var i = 0; i < object.span.length; ++i) message.span[i] = object.span[i] | 0; } if (object.leadingComments != null) message.leadingComments = String(object.leadingComments); if (object.trailingComments != null) message.trailingComments = String(object.trailingComments); if (object.leadingDetachedComments) { if (!Array.isArray(object.leadingDetachedComments)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); message.leadingDetachedComments = []; for (var i = 0; i < object.leadingDetachedComments.length; ++i) message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); } return message; }; /** * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.path = []; object.span = []; object.leadingDetachedComments = []; } if (options.defaults) { object.leadingComments = ""; object.trailingComments = ""; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } if (message.span && message.span.length) { object.span = []; for (var j = 0; j < message.span.length; ++j) object.span[j] = message.span[j]; } if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) object.leadingComments = message.leadingComments; if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) object.trailingComments = message.trailingComments; if (message.leadingDetachedComments && message.leadingDetachedComments.length) { object.leadingDetachedComments = []; for (var j = 0; j < message.leadingDetachedComments.length; ++j) object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; } return object; }; /** * Converts this Location to JSON. * @function toJSON * @memberof google.protobuf.SourceCodeInfo.Location * @instance * @returns {Object.} JSON object */ Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Location; })(); return SourceCodeInfo; })(); protobuf.GeneratedCodeInfo = (function() { /** * Properties of a GeneratedCodeInfo. * @memberof google.protobuf * @interface IGeneratedCodeInfo * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf * @classdesc Represents a GeneratedCodeInfo. * @implements IGeneratedCodeInfo * @constructor * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ function GeneratedCodeInfo(properties) { this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GeneratedCodeInfo annotation. * @member {Array.} annotation * @memberof google.protobuf.GeneratedCodeInfo * @instance */ GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ GeneratedCodeInfo.create = function create(properties) { return new GeneratedCodeInfo(properties); }; /** * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.annotation != null && message.annotation.length) for (var i = 0; i < message.annotation.length; ++i) $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.annotation && message.annotation.length)) message.annotation = []; message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GeneratedCodeInfo message. * @function verify * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GeneratedCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.annotation != null && message.hasOwnProperty("annotation")) { if (!Array.isArray(message.annotation)) return "annotation: array expected"; for (var i = 0; i < message.annotation.length; ++i) { var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); if (error) return "annotation." + error; } } return null; }; /** * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ GeneratedCodeInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; var message = new $root.google.protobuf.GeneratedCodeInfo(); if (object.annotation) { if (!Array.isArray(object.annotation)) throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); message.annotation = []; for (var i = 0; i < object.annotation.length; ++i) { if (typeof object.annotation[i] !== "object") throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); } } return message; }; /** * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GeneratedCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.annotation = []; if (message.annotation && message.annotation.length) { object.annotation = []; for (var j = 0; j < message.annotation.length; ++j) object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); } return object; }; /** * Converts this GeneratedCodeInfo to JSON. * @function toJSON * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; GeneratedCodeInfo.Annotation = (function() { /** * Properties of an Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @interface IAnnotation * @property {Array.|null} [path] Annotation path * @property {string|null} [sourceFile] Annotation sourceFile * @property {number|null} [begin] Annotation begin * @property {number|null} [end] Annotation end */ /** * Constructs a new Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @classdesc Represents an Annotation. * @implements IAnnotation * @constructor * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set */ function Annotation(properties) { this.path = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Annotation path. * @member {Array.} path * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.path = $util.emptyArray; /** * Annotation sourceFile. * @member {string} sourceFile * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.sourceFile = ""; /** * Annotation begin. * @member {number} begin * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.begin = 0; /** * Annotation end. * @member {number} end * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.end = 0; /** * Creates a new Annotation instance using the specified properties. * @function create * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance */ Annotation.create = function create(properties) { return new Annotation(properties); }; /** * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encode * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; /** * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Annotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Annotation message from the specified reader or buffer. * @function decode * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Annotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.path && message.path.length)) message.path = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.path.push(reader.int32()); } else message.path.push(reader.int32()); break; case 2: message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); break; case 4: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Annotation message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Annotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Annotation message. * @function verify * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Annotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { if (!Array.isArray(message.path)) return "path: array expected"; for (var i = 0; i < message.path.length; ++i) if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) if (!$util.isString(message.sourceFile)) return "sourceFile: string expected"; if (message.begin != null && message.hasOwnProperty("begin")) if (!$util.isInteger(message.begin)) return "begin: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation */ Annotation.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) return object; var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); if (object.path) { if (!Array.isArray(object.path)) throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } if (object.sourceFile != null) message.sourceFile = String(object.sourceFile); if (object.begin != null) message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from an Annotation message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Annotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.path = []; if (options.defaults) { object.sourceFile = ""; object.begin = 0; object.end = 0; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) object.sourceFile = message.sourceFile; if (message.begin != null && message.hasOwnProperty("begin")) object.begin = message.begin; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this Annotation to JSON. * @function toJSON * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance * @returns {Object.} JSON object */ Annotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Annotation; })(); return GeneratedCodeInfo; })(); protobuf.Any = (function() { /** * Properties of an Any. * @memberof google.protobuf * @interface IAny * @property {string|null} [type_url] Any type_url * @property {Uint8Array|null} [value] Any value */ /** * Constructs a new Any. * @memberof google.protobuf * @classdesc Represents an Any. * @implements IAny * @constructor * @param {google.protobuf.IAny=} [properties] Properties to set */ function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Any type_url. * @member {string} type_url * @memberof google.protobuf.Any * @instance */ Any.prototype.type_url = ""; /** * Any value. * @member {Uint8Array} value * @memberof google.protobuf.Any * @instance */ Any.prototype.value = $util.newBuffer([]); /** * Creates a new Any instance using the specified properties. * @function create * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny=} [properties] Properties to set * @returns {google.protobuf.Any} Any instance */ Any.create = function create(properties) { return new Any(properties); }; /** * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; /** * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Any message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type_url = reader.string(); break; case 2: message.value = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Any message. * @function verify * @memberof google.protobuf.Any * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Any.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type_url != null && message.hasOwnProperty("type_url")) if (!$util.isString(message.type_url)) return "type_url: string expected"; if (message.value != null && message.hasOwnProperty("value")) if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) return "value: buffer expected"; return null; }; /** * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object * @returns {google.protobuf.Any} Any */ Any.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Any) return object; var message = new $root.google.protobuf.Any(); if (object.type_url != null) message.type_url = String(object.type_url); if (object.value != null) if (typeof object.value === "string") $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); else if (object.value.length) message.value = object.value; return message; }; /** * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Any * @static * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Any.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.type_url = ""; if (options.bytes === String) object.value = ""; else { object.value = []; if (options.bytes !== Array) object.value = $util.newBuffer(object.value); } } if (message.type_url != null && message.hasOwnProperty("type_url")) object.type_url = message.type_url; if (message.value != null && message.hasOwnProperty("value")) object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** * Converts this Any to JSON. * @function toJSON * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Any; })(); return protobuf; })(); return google; })(); return $root; }); /***/ }), /***/ 59081: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ (function(global, factory) { /* global define, require, module */ /* AMD */ if (typeof define === 'function' && define.amd) define(["protobufjs/minimal"], factory); /* CommonJS */ else if ( true && module && module.exports) module.exports = factory(__webpack_require__(96916)); })(this, function($protobuf) { "use strict"; // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots.operations_protos || ($protobuf.roots.operations_protos = {}); $root.google = (function() { /** * Namespace google. * @exports google * @namespace */ var google = {}; google.longrunning = (function() { /** * Namespace longrunning. * @memberof google * @namespace */ var longrunning = {}; longrunning.Operations = (function() { /** * Constructs a new Operations service. * @memberof google.longrunning * @classdesc Represents an Operations * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function Operations(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; /** * Creates new Operations service using the specified rpc implementation. * @function create * @memberof google.longrunning.Operations * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. */ Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** * Callback as used by {@link google.longrunning.Operations#listOperations}. * @memberof google.longrunning.Operations * @typedef ListOperationsCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse */ /** * Calls ListOperations. * @function listOperations * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); }, "name", { value: "ListOperations" }); /** * Calls ListOperations. * @function listOperations * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.longrunning.Operations#getOperation}. * @memberof google.longrunning.Operations * @typedef GetOperationCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.longrunning.Operation} [response] Operation */ /** * Calls GetOperation. * @function getOperation * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "GetOperation" }); /** * Calls GetOperation. * @function getOperation * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.longrunning.Operations#deleteOperation}. * @memberof google.longrunning.Operations * @typedef DeleteOperationCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls DeleteOperation. * @function deleteOperation * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteOperation" }); /** * Calls DeleteOperation. * @function deleteOperation * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.longrunning.Operations#cancelOperation}. * @memberof google.longrunning.Operations * @typedef CancelOperationCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** * Calls CancelOperation. * @function cancelOperation * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "CancelOperation" }); /** * Calls CancelOperation. * @function cancelOperation * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object * @returns {Promise} Promise * @variation 2 */ /** * Callback as used by {@link google.longrunning.Operations#waitOperation}. * @memberof google.longrunning.Operations * @typedef WaitOperationCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.longrunning.Operation} [response] Operation */ /** * Calls WaitOperation. * @function waitOperation * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "WaitOperation" }); /** * Calls WaitOperation. * @function waitOperation * @memberof google.longrunning.Operations * @instance * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object * @returns {Promise} Promise * @variation 2 */ return Operations; })(); longrunning.Operation = (function() { /** * Properties of an Operation. * @memberof google.longrunning * @interface IOperation * @property {string|null} [name] Operation name * @property {google.protobuf.IAny|null} [metadata] Operation metadata * @property {boolean|null} [done] Operation done * @property {google.rpc.IStatus|null} [error] Operation error * @property {google.protobuf.IAny|null} [response] Operation response */ /** * Constructs a new Operation. * @memberof google.longrunning * @classdesc Represents an Operation. * @implements IOperation * @constructor * @param {google.longrunning.IOperation=} [properties] Properties to set */ function Operation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Operation name. * @member {string} name * @memberof google.longrunning.Operation * @instance */ Operation.prototype.name = ""; /** * Operation metadata. * @member {google.protobuf.IAny|null|undefined} metadata * @memberof google.longrunning.Operation * @instance */ Operation.prototype.metadata = null; /** * Operation done. * @member {boolean} done * @memberof google.longrunning.Operation * @instance */ Operation.prototype.done = false; /** * Operation error. * @member {google.rpc.IStatus|null|undefined} error * @memberof google.longrunning.Operation * @instance */ Operation.prototype.error = null; /** * Operation response. * @member {google.protobuf.IAny|null|undefined} response * @memberof google.longrunning.Operation * @instance */ Operation.prototype.response = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Operation result. * @member {"error"|"response"|undefined} result * @memberof google.longrunning.Operation * @instance */ Object.defineProperty(Operation.prototype, "result", { get: $util.oneOfGetter($oneOfFields = ["error", "response"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new Operation instance using the specified properties. * @function create * @memberof google.longrunning.Operation * @static * @param {google.longrunning.IOperation=} [properties] Properties to set * @returns {google.longrunning.Operation} Operation instance */ Operation.create = function create(properties) { return new Operation(properties); }; /** * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. * @function encode * @memberof google.longrunning.Operation * @static * @param {google.longrunning.IOperation} message Operation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.response != null && Object.hasOwnProperty.call(message, "response")) $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. * @function encodeDelimited * @memberof google.longrunning.Operation * @static * @param {google.longrunning.IOperation} message Operation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Operation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Operation message from the specified reader or buffer. * @function decode * @memberof google.longrunning.Operation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.longrunning.Operation} Operation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Operation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); break; case 3: message.done = reader.bool(); break; case 4: message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); break; case 5: message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Operation message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.longrunning.Operation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.longrunning.Operation} Operation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Operation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Operation message. * @function verify * @memberof google.longrunning.Operation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Operation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.metadata != null && message.hasOwnProperty("metadata")) { var error = $root.google.protobuf.Any.verify(message.metadata); if (error) return "metadata." + error; } if (message.done != null && message.hasOwnProperty("done")) if (typeof message.done !== "boolean") return "done: boolean expected"; if (message.error != null && message.hasOwnProperty("error")) { properties.result = 1; { var error = $root.google.rpc.Status.verify(message.error); if (error) return "error." + error; } } if (message.response != null && message.hasOwnProperty("response")) { if (properties.result === 1) return "result: multiple values"; properties.result = 1; { var error = $root.google.protobuf.Any.verify(message.response); if (error) return "response." + error; } } return null; }; /** * Creates an Operation message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.longrunning.Operation * @static * @param {Object.} object Plain object * @returns {google.longrunning.Operation} Operation */ Operation.fromObject = function fromObject(object) { if (object instanceof $root.google.longrunning.Operation) return object; var message = new $root.google.longrunning.Operation(); if (object.name != null) message.name = String(object.name); if (object.metadata != null) { if (typeof object.metadata !== "object") throw TypeError(".google.longrunning.Operation.metadata: object expected"); message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); } if (object.done != null) message.done = Boolean(object.done); if (object.error != null) { if (typeof object.error !== "object") throw TypeError(".google.longrunning.Operation.error: object expected"); message.error = $root.google.rpc.Status.fromObject(object.error); } if (object.response != null) { if (typeof object.response !== "object") throw TypeError(".google.longrunning.Operation.response: object expected"); message.response = $root.google.protobuf.Any.fromObject(object.response); } return message; }; /** * Creates a plain object from an Operation message. Also converts values to other types if specified. * @function toObject * @memberof google.longrunning.Operation * @static * @param {google.longrunning.Operation} message Operation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Operation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.metadata = null; object.done = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.metadata != null && message.hasOwnProperty("metadata")) object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); if (message.done != null && message.hasOwnProperty("done")) object.done = message.done; if (message.error != null && message.hasOwnProperty("error")) { object.error = $root.google.rpc.Status.toObject(message.error, options); if (options.oneofs) object.result = "error"; } if (message.response != null && message.hasOwnProperty("response")) { object.response = $root.google.protobuf.Any.toObject(message.response, options); if (options.oneofs) object.result = "response"; } return object; }; /** * Converts this Operation to JSON. * @function toJSON * @memberof google.longrunning.Operation * @instance * @returns {Object.} JSON object */ Operation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Operation; })(); longrunning.GetOperationRequest = (function() { /** * Properties of a GetOperationRequest. * @memberof google.longrunning * @interface IGetOperationRequest * @property {string|null} [name] GetOperationRequest name */ /** * Constructs a new GetOperationRequest. * @memberof google.longrunning * @classdesc Represents a GetOperationRequest. * @implements IGetOperationRequest * @constructor * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set */ function GetOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GetOperationRequest name. * @member {string} name * @memberof google.longrunning.GetOperationRequest * @instance */ GetOperationRequest.prototype.name = ""; /** * Creates a new GetOperationRequest instance using the specified properties. * @function create * @memberof google.longrunning.GetOperationRequest * @static * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance */ GetOperationRequest.create = function create(properties) { return new GetOperationRequest(properties); }; /** * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. * @function encode * @memberof google.longrunning.GetOperationRequest * @static * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.longrunning.GetOperationRequest * @static * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GetOperationRequest message from the specified reader or buffer. * @function decode * @memberof google.longrunning.GetOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.longrunning.GetOperationRequest} GetOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetOperationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.longrunning.GetOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.longrunning.GetOperationRequest} GetOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GetOperationRequest message. * @function verify * @memberof google.longrunning.GetOperationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GetOperationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.longrunning.GetOperationRequest * @static * @param {Object.} object Plain object * @returns {google.longrunning.GetOperationRequest} GetOperationRequest */ GetOperationRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.longrunning.GetOperationRequest) return object; var message = new $root.google.longrunning.GetOperationRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.longrunning.GetOperationRequest * @static * @param {google.longrunning.GetOperationRequest} message GetOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GetOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this GetOperationRequest to JSON. * @function toJSON * @memberof google.longrunning.GetOperationRequest * @instance * @returns {Object.} JSON object */ GetOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return GetOperationRequest; })(); longrunning.ListOperationsRequest = (function() { /** * Properties of a ListOperationsRequest. * @memberof google.longrunning * @interface IListOperationsRequest * @property {string|null} [name] ListOperationsRequest name * @property {string|null} [filter] ListOperationsRequest filter * @property {number|null} [pageSize] ListOperationsRequest pageSize * @property {string|null} [pageToken] ListOperationsRequest pageToken */ /** * Constructs a new ListOperationsRequest. * @memberof google.longrunning * @classdesc Represents a ListOperationsRequest. * @implements IListOperationsRequest * @constructor * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set */ function ListOperationsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListOperationsRequest name. * @member {string} name * @memberof google.longrunning.ListOperationsRequest * @instance */ ListOperationsRequest.prototype.name = ""; /** * ListOperationsRequest filter. * @member {string} filter * @memberof google.longrunning.ListOperationsRequest * @instance */ ListOperationsRequest.prototype.filter = ""; /** * ListOperationsRequest pageSize. * @member {number} pageSize * @memberof google.longrunning.ListOperationsRequest * @instance */ ListOperationsRequest.prototype.pageSize = 0; /** * ListOperationsRequest pageToken. * @member {string} pageToken * @memberof google.longrunning.ListOperationsRequest * @instance */ ListOperationsRequest.prototype.pageToken = ""; /** * Creates a new ListOperationsRequest instance using the specified properties. * @function create * @memberof google.longrunning.ListOperationsRequest * @static * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance */ ListOperationsRequest.create = function create(properties) { return new ListOperationsRequest(properties); }; /** * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. * @function encode * @memberof google.longrunning.ListOperationsRequest * @static * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; /** * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.longrunning.ListOperationsRequest * @static * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListOperationsRequest message from the specified reader or buffer. * @function decode * @memberof google.longrunning.ListOperationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListOperationsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 4: message.name = reader.string(); break; case 1: message.filter = reader.string(); break; case 2: message.pageSize = reader.int32(); break; case 3: message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.longrunning.ListOperationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListOperationsRequest message. * @function verify * @memberof google.longrunning.ListOperationsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListOperationsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; }; /** * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.longrunning.ListOperationsRequest * @static * @param {Object.} object Plain object * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest */ ListOperationsRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.longrunning.ListOperationsRequest) return object; var message = new $root.google.longrunning.ListOperationsRequest(); if (object.name != null) message.name = String(object.name); if (object.filter != null) message.filter = String(object.filter); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); return message; }; /** * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.longrunning.ListOperationsRequest * @static * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListOperationsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.filter = ""; object.pageSize = 0; object.pageToken = ""; object.name = ""; } if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this ListOperationsRequest to JSON. * @function toJSON * @memberof google.longrunning.ListOperationsRequest * @instance * @returns {Object.} JSON object */ ListOperationsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListOperationsRequest; })(); longrunning.ListOperationsResponse = (function() { /** * Properties of a ListOperationsResponse. * @memberof google.longrunning * @interface IListOperationsResponse * @property {Array.|null} [operations] ListOperationsResponse operations * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken */ /** * Constructs a new ListOperationsResponse. * @memberof google.longrunning * @classdesc Represents a ListOperationsResponse. * @implements IListOperationsResponse * @constructor * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set */ function ListOperationsResponse(properties) { this.operations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ListOperationsResponse operations. * @member {Array.} operations * @memberof google.longrunning.ListOperationsResponse * @instance */ ListOperationsResponse.prototype.operations = $util.emptyArray; /** * ListOperationsResponse nextPageToken. * @member {string} nextPageToken * @memberof google.longrunning.ListOperationsResponse * @instance */ ListOperationsResponse.prototype.nextPageToken = ""; /** * Creates a new ListOperationsResponse instance using the specified properties. * @function create * @memberof google.longrunning.ListOperationsResponse * @static * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance */ ListOperationsResponse.create = function create(properties) { return new ListOperationsResponse(properties); }; /** * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. * @function encode * @memberof google.longrunning.ListOperationsResponse * @static * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListOperationsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. * @function encodeDelimited * @memberof google.longrunning.ListOperationsResponse * @static * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ListOperationsResponse message from the specified reader or buffer. * @function decode * @memberof google.longrunning.ListOperationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListOperationsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.operations && message.operations.length)) message.operations = []; message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.longrunning.ListOperationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ListOperationsResponse message. * @function verify * @memberof google.longrunning.ListOperationsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ListOperationsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.operations != null && message.hasOwnProperty("operations")) { if (!Array.isArray(message.operations)) return "operations: array expected"; for (var i = 0; i < message.operations.length; ++i) { var error = $root.google.longrunning.Operation.verify(message.operations[i]); if (error) return "operations." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; }; /** * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.longrunning.ListOperationsResponse * @static * @param {Object.} object Plain object * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse */ ListOperationsResponse.fromObject = function fromObject(object) { if (object instanceof $root.google.longrunning.ListOperationsResponse) return object; var message = new $root.google.longrunning.ListOperationsResponse(); if (object.operations) { if (!Array.isArray(object.operations)) throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); message.operations = []; for (var i = 0; i < object.operations.length; ++i) { if (typeof object.operations[i] !== "object") throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); return message; }; /** * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. * @function toObject * @memberof google.longrunning.ListOperationsResponse * @static * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ListOperationsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.operations = []; if (options.defaults) object.nextPageToken = ""; if (message.operations && message.operations.length) { object.operations = []; for (var j = 0; j < message.operations.length; ++j) object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; /** * Converts this ListOperationsResponse to JSON. * @function toJSON * @memberof google.longrunning.ListOperationsResponse * @instance * @returns {Object.} JSON object */ ListOperationsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ListOperationsResponse; })(); longrunning.CancelOperationRequest = (function() { /** * Properties of a CancelOperationRequest. * @memberof google.longrunning * @interface ICancelOperationRequest * @property {string|null} [name] CancelOperationRequest name */ /** * Constructs a new CancelOperationRequest. * @memberof google.longrunning * @classdesc Represents a CancelOperationRequest. * @implements ICancelOperationRequest * @constructor * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set */ function CancelOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CancelOperationRequest name. * @member {string} name * @memberof google.longrunning.CancelOperationRequest * @instance */ CancelOperationRequest.prototype.name = ""; /** * Creates a new CancelOperationRequest instance using the specified properties. * @function create * @memberof google.longrunning.CancelOperationRequest * @static * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance */ CancelOperationRequest.create = function create(properties) { return new CancelOperationRequest(properties); }; /** * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. * @function encode * @memberof google.longrunning.CancelOperationRequest * @static * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.longrunning.CancelOperationRequest * @static * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CancelOperationRequest message from the specified reader or buffer. * @function decode * @memberof google.longrunning.CancelOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CancelOperationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.longrunning.CancelOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CancelOperationRequest message. * @function verify * @memberof google.longrunning.CancelOperationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CancelOperationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.longrunning.CancelOperationRequest * @static * @param {Object.} object Plain object * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest */ CancelOperationRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.longrunning.CancelOperationRequest) return object; var message = new $root.google.longrunning.CancelOperationRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.longrunning.CancelOperationRequest * @static * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CancelOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this CancelOperationRequest to JSON. * @function toJSON * @memberof google.longrunning.CancelOperationRequest * @instance * @returns {Object.} JSON object */ CancelOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CancelOperationRequest; })(); longrunning.DeleteOperationRequest = (function() { /** * Properties of a DeleteOperationRequest. * @memberof google.longrunning * @interface IDeleteOperationRequest * @property {string|null} [name] DeleteOperationRequest name */ /** * Constructs a new DeleteOperationRequest. * @memberof google.longrunning * @classdesc Represents a DeleteOperationRequest. * @implements IDeleteOperationRequest * @constructor * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set */ function DeleteOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DeleteOperationRequest name. * @member {string} name * @memberof google.longrunning.DeleteOperationRequest * @instance */ DeleteOperationRequest.prototype.name = ""; /** * Creates a new DeleteOperationRequest instance using the specified properties. * @function create * @memberof google.longrunning.DeleteOperationRequest * @static * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance */ DeleteOperationRequest.create = function create(properties) { return new DeleteOperationRequest(properties); }; /** * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. * @function encode * @memberof google.longrunning.DeleteOperationRequest * @static * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.longrunning.DeleteOperationRequest * @static * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DeleteOperationRequest message from the specified reader or buffer. * @function decode * @memberof google.longrunning.DeleteOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteOperationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.longrunning.DeleteOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DeleteOperationRequest message. * @function verify * @memberof google.longrunning.DeleteOperationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DeleteOperationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; return null; }; /** * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.longrunning.DeleteOperationRequest * @static * @param {Object.} object Plain object * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest */ DeleteOperationRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.longrunning.DeleteOperationRequest) return object; var message = new $root.google.longrunning.DeleteOperationRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.longrunning.DeleteOperationRequest * @static * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DeleteOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.name = ""; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** * Converts this DeleteOperationRequest to JSON. * @function toJSON * @memberof google.longrunning.DeleteOperationRequest * @instance * @returns {Object.} JSON object */ DeleteOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return DeleteOperationRequest; })(); longrunning.WaitOperationRequest = (function() { /** * Properties of a WaitOperationRequest. * @memberof google.longrunning * @interface IWaitOperationRequest * @property {string|null} [name] WaitOperationRequest name * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout */ /** * Constructs a new WaitOperationRequest. * @memberof google.longrunning * @classdesc Represents a WaitOperationRequest. * @implements IWaitOperationRequest * @constructor * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set */ function WaitOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * WaitOperationRequest name. * @member {string} name * @memberof google.longrunning.WaitOperationRequest * @instance */ WaitOperationRequest.prototype.name = ""; /** * WaitOperationRequest timeout. * @member {google.protobuf.IDuration|null|undefined} timeout * @memberof google.longrunning.WaitOperationRequest * @instance */ WaitOperationRequest.prototype.timeout = null; /** * Creates a new WaitOperationRequest instance using the specified properties. * @function create * @memberof google.longrunning.WaitOperationRequest * @static * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance */ WaitOperationRequest.create = function create(properties) { return new WaitOperationRequest(properties); }; /** * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. * @function encode * @memberof google.longrunning.WaitOperationRequest * @static * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. * @function encodeDelimited * @memberof google.longrunning.WaitOperationRequest * @static * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a WaitOperationRequest message from the specified reader or buffer. * @function decode * @memberof google.longrunning.WaitOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WaitOperationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.longrunning.WaitOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a WaitOperationRequest message. * @function verify * @memberof google.longrunning.WaitOperationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ WaitOperationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.timeout != null && message.hasOwnProperty("timeout")) { var error = $root.google.protobuf.Duration.verify(message.timeout); if (error) return "timeout." + error; } return null; }; /** * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.longrunning.WaitOperationRequest * @static * @param {Object.} object Plain object * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest */ WaitOperationRequest.fromObject = function fromObject(object) { if (object instanceof $root.google.longrunning.WaitOperationRequest) return object; var message = new $root.google.longrunning.WaitOperationRequest(); if (object.name != null) message.name = String(object.name); if (object.timeout != null) { if (typeof object.timeout !== "object") throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); } return message; }; /** * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. * @function toObject * @memberof google.longrunning.WaitOperationRequest * @static * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ WaitOperationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.timeout = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.timeout != null && message.hasOwnProperty("timeout")) object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); return object; }; /** * Converts this WaitOperationRequest to JSON. * @function toJSON * @memberof google.longrunning.WaitOperationRequest * @instance * @returns {Object.} JSON object */ WaitOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return WaitOperationRequest; })(); longrunning.OperationInfo = (function() { /** * Properties of an OperationInfo. * @memberof google.longrunning * @interface IOperationInfo * @property {string|null} [responseType] OperationInfo responseType * @property {string|null} [metadataType] OperationInfo metadataType */ /** * Constructs a new OperationInfo. * @memberof google.longrunning * @classdesc Represents an OperationInfo. * @implements IOperationInfo * @constructor * @param {google.longrunning.IOperationInfo=} [properties] Properties to set */ function OperationInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OperationInfo responseType. * @member {string} responseType * @memberof google.longrunning.OperationInfo * @instance */ OperationInfo.prototype.responseType = ""; /** * OperationInfo metadataType. * @member {string} metadataType * @memberof google.longrunning.OperationInfo * @instance */ OperationInfo.prototype.metadataType = ""; /** * Creates a new OperationInfo instance using the specified properties. * @function create * @memberof google.longrunning.OperationInfo * @static * @param {google.longrunning.IOperationInfo=} [properties] Properties to set * @returns {google.longrunning.OperationInfo} OperationInfo instance */ OperationInfo.create = function create(properties) { return new OperationInfo(properties); }; /** * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. * @function encode * @memberof google.longrunning.OperationInfo * @static * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; /** * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.longrunning.OperationInfo * @static * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OperationInfo message from the specified reader or buffer. * @function decode * @memberof google.longrunning.OperationInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.longrunning.OperationInfo} OperationInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OperationInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.responseType = reader.string(); break; case 2: message.metadataType = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OperationInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.longrunning.OperationInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.longrunning.OperationInfo} OperationInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OperationInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OperationInfo message. * @function verify * @memberof google.longrunning.OperationInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OperationInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.responseType != null && message.hasOwnProperty("responseType")) if (!$util.isString(message.responseType)) return "responseType: string expected"; if (message.metadataType != null && message.hasOwnProperty("metadataType")) if (!$util.isString(message.metadataType)) return "metadataType: string expected"; return null; }; /** * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.longrunning.OperationInfo * @static * @param {Object.} object Plain object * @returns {google.longrunning.OperationInfo} OperationInfo */ OperationInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.longrunning.OperationInfo) return object; var message = new $root.google.longrunning.OperationInfo(); if (object.responseType != null) message.responseType = String(object.responseType); if (object.metadataType != null) message.metadataType = String(object.metadataType); return message; }; /** * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.longrunning.OperationInfo * @static * @param {google.longrunning.OperationInfo} message OperationInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OperationInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.responseType = ""; object.metadataType = ""; } if (message.responseType != null && message.hasOwnProperty("responseType")) object.responseType = message.responseType; if (message.metadataType != null && message.hasOwnProperty("metadataType")) object.metadataType = message.metadataType; return object; }; /** * Converts this OperationInfo to JSON. * @function toJSON * @memberof google.longrunning.OperationInfo * @instance * @returns {Object.} JSON object */ OperationInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OperationInfo; })(); return longrunning; })(); google.api = (function() { /** * Namespace api. * @memberof google * @namespace */ var api = {}; api.Http = (function() { /** * Properties of a Http. * @memberof google.api * @interface IHttp * @property {Array.|null} [rules] Http rules * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** * Constructs a new Http. * @memberof google.api * @classdesc Represents a Http. * @implements IHttp * @constructor * @param {google.api.IHttp=} [properties] Properties to set */ function Http(properties) { this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Http rules. * @member {Array.} rules * @memberof google.api.Http * @instance */ Http.prototype.rules = $util.emptyArray; /** * Http fullyDecodeReservedExpansion. * @member {boolean} fullyDecodeReservedExpansion * @memberof google.api.Http * @instance */ Http.prototype.fullyDecodeReservedExpansion = false; /** * Creates a new Http instance using the specified properties. * @function create * @memberof google.api.Http * @static * @param {google.api.IHttp=} [properties] Properties to set * @returns {google.api.Http} Http instance */ Http.create = function create(properties) { return new Http(properties); }; /** * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode * @memberof google.api.Http * @static * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.rules != null && message.rules.length) for (var i = 0; i < message.rules.length; ++i) $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited * @memberof google.api.Http * @static * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Http message from the specified reader or buffer. * @function decode * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Http.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.rules && message.rules.length)) message.rules = []; message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Http message. * @function verify * @memberof google.api.Http * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.rules != null && message.hasOwnProperty("rules")) { if (!Array.isArray(message.rules)) return "rules: array expected"; for (var i = 0; i < message.rules.length; ++i) { var error = $root.google.api.HttpRule.verify(message.rules[i]); if (error) return "rules." + error; } } if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) if (typeof message.fullyDecodeReservedExpansion !== "boolean") return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.Http * @static * @param {Object.} object Plain object * @returns {google.api.Http} Http */ Http.fromObject = function fromObject(object) { if (object instanceof $root.google.api.Http) return object; var message = new $root.google.api.Http(); if (object.rules) { if (!Array.isArray(object.rules)) throw TypeError(".google.api.Http.rules: array expected"); message.rules = []; for (var i = 0; i < object.rules.length; ++i) { if (typeof object.rules[i] !== "object") throw TypeError(".google.api.Http.rules: object expected"); message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); } } if (object.fullyDecodeReservedExpansion != null) message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject * @memberof google.api.Http * @static * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.rules = []; if (options.defaults) object.fullyDecodeReservedExpansion = false; if (message.rules && message.rules.length) { object.rules = []; for (var j = 0; j < message.rules.length; ++j) object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** * Converts this Http to JSON. * @function toJSON * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Http; })(); api.HttpRule = (function() { /** * Properties of a HttpRule. * @memberof google.api * @interface IHttpRule * @property {string|null} [selector] HttpRule selector * @property {string|null} [get] HttpRule get * @property {string|null} [put] HttpRule put * @property {string|null} [post] HttpRule post * @property {string|null} ["delete"] HttpRule delete * @property {string|null} [patch] HttpRule patch * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom * @property {string|null} [body] HttpRule body * @property {string|null} [responseBody] HttpRule responseBody * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ /** * Constructs a new HttpRule. * @memberof google.api * @classdesc Represents a HttpRule. * @implements IHttpRule * @constructor * @param {google.api.IHttpRule=} [properties] Properties to set */ function HttpRule(properties) { this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * HttpRule selector. * @member {string} selector * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.selector = ""; /** * HttpRule get. * @member {string} get * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.get = ""; /** * HttpRule put. * @member {string} put * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.put = ""; /** * HttpRule post. * @member {string} post * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.post = ""; /** * HttpRule delete. * @member {string} delete * @memberof google.api.HttpRule * @instance */ HttpRule.prototype["delete"] = ""; /** * HttpRule patch. * @member {string} patch * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.patch = ""; /** * HttpRule custom. * @member {google.api.ICustomHttpPattern|null|undefined} custom * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.custom = null; /** * HttpRule body. * @member {string} body * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.body = ""; /** * HttpRule responseBody. * @member {string} responseBody * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.responseBody = ""; /** * HttpRule additionalBindings. * @member {Array.} additionalBindings * @memberof google.api.HttpRule * @instance */ HttpRule.prototype.additionalBindings = $util.emptyArray; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * HttpRule pattern. * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern * @memberof google.api.HttpRule * @instance */ Object.defineProperty(HttpRule.prototype, "pattern", { get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new HttpRule instance using the specified properties. * @function create * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule=} [properties] Properties to set * @returns {google.api.HttpRule} HttpRule instance */ HttpRule.create = function create(properties) { return new HttpRule(properties); }; /** * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.additionalBindings != null && message.additionalBindings.length) for (var i = 0; i < message.additionalBindings.length; ++i) $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited * @memberof google.api.HttpRule * @static * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a HttpRule message from the specified reader or buffer. * @function decode * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.selector = reader.string(); break; case 2: message.get = reader.string(); break; case 3: message.put = reader.string(); break; case 4: message.post = reader.string(); break; case 5: message["delete"] = reader.string(); break; case 6: message.patch = reader.string(); break; case 8: message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); break; case 7: message.body = reader.string(); break; case 12: message.responseBody = reader.string(); break; case 11: if (!(message.additionalBindings && message.additionalBindings.length)) message.additionalBindings = []; message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a HttpRule message. * @function verify * @memberof google.api.HttpRule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.selector != null && message.hasOwnProperty("selector")) if (!$util.isString(message.selector)) return "selector: string expected"; if (message.get != null && message.hasOwnProperty("get")) { properties.pattern = 1; if (!$util.isString(message.get)) return "get: string expected"; } if (message.put != null && message.hasOwnProperty("put")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.put)) return "put: string expected"; } if (message.post != null && message.hasOwnProperty("post")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.post)) return "post: string expected"; } if (message["delete"] != null && message.hasOwnProperty("delete")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message["delete"])) return "delete: string expected"; } if (message.patch != null && message.hasOwnProperty("patch")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; if (!$util.isString(message.patch)) return "patch: string expected"; } if (message.custom != null && message.hasOwnProperty("custom")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; { var error = $root.google.api.CustomHttpPattern.verify(message.custom); if (error) return "custom." + error; } } if (message.body != null && message.hasOwnProperty("body")) if (!$util.isString(message.body)) return "body: string expected"; if (message.responseBody != null && message.hasOwnProperty("responseBody")) if (!$util.isString(message.responseBody)) return "responseBody: string expected"; if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { if (!Array.isArray(message.additionalBindings)) return "additionalBindings: array expected"; for (var i = 0; i < message.additionalBindings.length; ++i) { var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); if (error) return "additionalBindings." + error; } } return null; }; /** * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object * @returns {google.api.HttpRule} HttpRule */ HttpRule.fromObject = function fromObject(object) { if (object instanceof $root.google.api.HttpRule) return object; var message = new $root.google.api.HttpRule(); if (object.selector != null) message.selector = String(object.selector); if (object.get != null) message.get = String(object.get); if (object.put != null) message.put = String(object.put); if (object.post != null) message.post = String(object.post); if (object["delete"] != null) message["delete"] = String(object["delete"]); if (object.patch != null) message.patch = String(object.patch); if (object.custom != null) { if (typeof object.custom !== "object") throw TypeError(".google.api.HttpRule.custom: object expected"); message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); } if (object.body != null) message.body = String(object.body); if (object.responseBody != null) message.responseBody = String(object.responseBody); if (object.additionalBindings) { if (!Array.isArray(object.additionalBindings)) throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); message.additionalBindings = []; for (var i = 0; i < object.additionalBindings.length; ++i) { if (typeof object.additionalBindings[i] !== "object") throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); } } return message; }; /** * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject * @memberof google.api.HttpRule * @static * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.additionalBindings = []; if (options.defaults) { object.selector = ""; object.body = ""; object.responseBody = ""; } if (message.selector != null && message.hasOwnProperty("selector")) object.selector = message.selector; if (message.get != null && message.hasOwnProperty("get")) { object.get = message.get; if (options.oneofs) object.pattern = "get"; } if (message.put != null && message.hasOwnProperty("put")) { object.put = message.put; if (options.oneofs) object.pattern = "put"; } if (message.post != null && message.hasOwnProperty("post")) { object.post = message.post; if (options.oneofs) object.pattern = "post"; } if (message["delete"] != null && message.hasOwnProperty("delete")) { object["delete"] = message["delete"]; if (options.oneofs) object.pattern = "delete"; } if (message.patch != null && message.hasOwnProperty("patch")) { object.patch = message.patch; if (options.oneofs) object.pattern = "patch"; } if (message.body != null && message.hasOwnProperty("body")) object.body = message.body; if (message.custom != null && message.hasOwnProperty("custom")) { object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); if (options.oneofs) object.pattern = "custom"; } if (message.additionalBindings && message.additionalBindings.length) { object.additionalBindings = []; for (var j = 0; j < message.additionalBindings.length; ++j) object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); } if (message.responseBody != null && message.hasOwnProperty("responseBody")) object.responseBody = message.responseBody; return object; }; /** * Converts this HttpRule to JSON. * @function toJSON * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return HttpRule; })(); api.CustomHttpPattern = (function() { /** * Properties of a CustomHttpPattern. * @memberof google.api * @interface ICustomHttpPattern * @property {string|null} [kind] CustomHttpPattern kind * @property {string|null} [path] CustomHttpPattern path */ /** * Constructs a new CustomHttpPattern. * @memberof google.api * @classdesc Represents a CustomHttpPattern. * @implements ICustomHttpPattern * @constructor * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * CustomHttpPattern kind. * @member {string} kind * @memberof google.api.CustomHttpPattern * @instance */ CustomHttpPattern.prototype.kind = ""; /** * CustomHttpPattern path. * @member {string} path * @memberof google.api.CustomHttpPattern * @instance */ CustomHttpPattern.prototype.path = ""; /** * Creates a new CustomHttpPattern instance using the specified properties. * @function create * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern=} [properties] Properties to set * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ CustomHttpPattern.create = function create(properties) { return new CustomHttpPattern(properties); }; /** * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited * @memberof google.api.CustomHttpPattern * @static * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomHttpPattern.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.kind = reader.string(); break; case 2: message.path = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a CustomHttpPattern message. * @function verify * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.kind != null && message.hasOwnProperty("kind")) if (!$util.isString(message.kind)) return "kind: string expected"; if (message.path != null && message.hasOwnProperty("path")) if (!$util.isString(message.path)) return "path: string expected"; return null; }; /** * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ CustomHttpPattern.fromObject = function fromObject(object) { if (object instanceof $root.google.api.CustomHttpPattern) return object; var message = new $root.google.api.CustomHttpPattern(); if (object.kind != null) message.kind = String(object.kind); if (object.path != null) message.path = String(object.path); return message; }; /** * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject * @memberof google.api.CustomHttpPattern * @static * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.kind = ""; object.path = ""; } if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; if (message.path != null && message.hasOwnProperty("path")) object.path = message.path; return object; }; /** * Converts this CustomHttpPattern to JSON. * @function toJSON * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return CustomHttpPattern; })(); return api; })(); google.protobuf = (function() { /** * Namespace protobuf. * @memberof google * @namespace */ var protobuf = {}; protobuf.FileDescriptorSet = (function() { /** * Properties of a FileDescriptorSet. * @memberof google.protobuf * @interface IFileDescriptorSet * @property {Array.|null} [file] FileDescriptorSet file */ /** * Constructs a new FileDescriptorSet. * @memberof google.protobuf * @classdesc Represents a FileDescriptorSet. * @implements IFileDescriptorSet * @constructor * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set */ function FileDescriptorSet(properties) { this.file = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileDescriptorSet file. * @member {Array.} file * @memberof google.protobuf.FileDescriptorSet * @instance */ FileDescriptorSet.prototype.file = $util.emptyArray; /** * Creates a new FileDescriptorSet instance using the specified properties. * @function create * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance */ FileDescriptorSet.create = function create(properties) { return new FileDescriptorSet(properties); }; /** * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encode * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.file != null && message.file.length) for (var i = 0; i < message.file.length; ++i) $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileDescriptorSet message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorSet.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.file && message.file.length)) message.file = []; message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileDescriptorSet message. * @function verify * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileDescriptorSet.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.file != null && message.hasOwnProperty("file")) { if (!Array.isArray(message.file)) return "file: array expected"; for (var i = 0; i < message.file.length; ++i) { var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); if (error) return "file." + error; } } return null; }; /** * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet */ FileDescriptorSet.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileDescriptorSet) return object; var message = new $root.google.protobuf.FileDescriptorSet(); if (object.file) { if (!Array.isArray(object.file)) throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); message.file = []; for (var i = 0; i < object.file.length; ++i) { if (typeof object.file[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); } } return message; }; /** * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileDescriptorSet * @static * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileDescriptorSet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.file = []; if (message.file && message.file.length) { object.file = []; for (var j = 0; j < message.file.length; ++j) object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); } return object; }; /** * Converts this FileDescriptorSet to JSON. * @function toJSON * @memberof google.protobuf.FileDescriptorSet * @instance * @returns {Object.} JSON object */ FileDescriptorSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FileDescriptorSet; })(); protobuf.FileDescriptorProto = (function() { /** * Properties of a FileDescriptorProto. * @memberof google.protobuf * @interface IFileDescriptorProto * @property {string|null} [name] FileDescriptorProto name * @property {string|null} ["package"] FileDescriptorProto package * @property {Array.|null} [dependency] FileDescriptorProto dependency * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency * @property {Array.|null} [messageType] FileDescriptorProto messageType * @property {Array.|null} [enumType] FileDescriptorProto enumType * @property {Array.|null} [service] FileDescriptorProto service * @property {Array.|null} [extension] FileDescriptorProto extension * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo * @property {string|null} [syntax] FileDescriptorProto syntax */ /** * Constructs a new FileDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FileDescriptorProto. * @implements IFileDescriptorProto * @constructor * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set */ function FileDescriptorProto(properties) { this.dependency = []; this.publicDependency = []; this.weakDependency = []; this.messageType = []; this.enumType = []; this.service = []; this.extension = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileDescriptorProto name. * @member {string} name * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.name = ""; /** * FileDescriptorProto package. * @member {string} package * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype["package"] = ""; /** * FileDescriptorProto dependency. * @member {Array.} dependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.dependency = $util.emptyArray; /** * FileDescriptorProto publicDependency. * @member {Array.} publicDependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.publicDependency = $util.emptyArray; /** * FileDescriptorProto weakDependency. * @member {Array.} weakDependency * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.weakDependency = $util.emptyArray; /** * FileDescriptorProto messageType. * @member {Array.} messageType * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.messageType = $util.emptyArray; /** * FileDescriptorProto enumType. * @member {Array.} enumType * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.enumType = $util.emptyArray; /** * FileDescriptorProto service. * @member {Array.} service * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.service = $util.emptyArray; /** * FileDescriptorProto extension. * @member {Array.} extension * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.extension = $util.emptyArray; /** * FileDescriptorProto options. * @member {google.protobuf.IFileOptions|null|undefined} options * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.options = null; /** * FileDescriptorProto sourceCodeInfo. * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.sourceCodeInfo = null; /** * FileDescriptorProto syntax. * @member {string} syntax * @memberof google.protobuf.FileDescriptorProto * @instance */ FileDescriptorProto.prototype.syntax = ""; /** * Creates a new FileDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance */ FileDescriptorProto.create = function create(properties) { return new FileDescriptorProto(properties); }; /** * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); if (message.messageType != null && message.messageType.length) for (var i = 0; i < message.messageType.length; ++i) $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.enumType != null && message.enumType.length) for (var i = 0; i < message.enumType.length; ++i) $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.service != null && message.service.length) for (var i = 0; i < message.service.length; ++i) $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; /** * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message["package"] = reader.string(); break; case 3: if (!(message.dependency && message.dependency.length)) message.dependency = []; message.dependency.push(reader.string()); break; case 10: if (!(message.publicDependency && message.publicDependency.length)) message.publicDependency = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.publicDependency.push(reader.int32()); } else message.publicDependency.push(reader.int32()); break; case 11: if (!(message.weakDependency && message.weakDependency.length)) message.weakDependency = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.weakDependency.push(reader.int32()); } else message.weakDependency.push(reader.int32()); break; case 4: if (!(message.messageType && message.messageType.length)) message.messageType = []; message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; case 5: if (!(message.enumType && message.enumType.length)) message.enumType = []; message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; case 6: if (!(message.service && message.service.length)) message.service = []; message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); break; case 7: if (!(message.extension && message.extension.length)) message.extension = []; message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 8: message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); break; case 9: message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); break; case 12: message.syntax = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileDescriptorProto message. * @function verify * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message["package"] != null && message.hasOwnProperty("package")) if (!$util.isString(message["package"])) return "package: string expected"; if (message.dependency != null && message.hasOwnProperty("dependency")) { if (!Array.isArray(message.dependency)) return "dependency: array expected"; for (var i = 0; i < message.dependency.length; ++i) if (!$util.isString(message.dependency[i])) return "dependency: string[] expected"; } if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { if (!Array.isArray(message.publicDependency)) return "publicDependency: array expected"; for (var i = 0; i < message.publicDependency.length; ++i) if (!$util.isInteger(message.publicDependency[i])) return "publicDependency: integer[] expected"; } if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { if (!Array.isArray(message.weakDependency)) return "weakDependency: array expected"; for (var i = 0; i < message.weakDependency.length; ++i) if (!$util.isInteger(message.weakDependency[i])) return "weakDependency: integer[] expected"; } if (message.messageType != null && message.hasOwnProperty("messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; for (var i = 0; i < message.messageType.length; ++i) { var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); if (error) return "messageType." + error; } } if (message.enumType != null && message.hasOwnProperty("enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } } if (message.service != null && message.hasOwnProperty("service")) { if (!Array.isArray(message.service)) return "service: array expected"; for (var i = 0; i < message.service.length; ++i) { var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); if (error) return "service." + error; } } if (message.extension != null && message.hasOwnProperty("extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FileOptions.verify(message.options); if (error) return "options." + error; } if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); if (error) return "sourceCodeInfo." + error; } if (message.syntax != null && message.hasOwnProperty("syntax")) if (!$util.isString(message.syntax)) return "syntax: string expected"; return null; }; /** * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto */ FileDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileDescriptorProto) return object; var message = new $root.google.protobuf.FileDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object["package"] != null) message["package"] = String(object["package"]); if (object.dependency) { if (!Array.isArray(object.dependency)) throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); message.dependency = []; for (var i = 0; i < object.dependency.length; ++i) message.dependency[i] = String(object.dependency[i]); } if (object.publicDependency) { if (!Array.isArray(object.publicDependency)) throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); message.publicDependency = []; for (var i = 0; i < object.publicDependency.length; ++i) message.publicDependency[i] = object.publicDependency[i] | 0; } if (object.weakDependency) { if (!Array.isArray(object.weakDependency)) throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); message.weakDependency = []; for (var i = 0; i < object.weakDependency.length; ++i) message.weakDependency[i] = object.weakDependency[i] | 0; } if (object.messageType) { if (!Array.isArray(object.messageType)) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); message.messageType = []; for (var i = 0; i < object.messageType.length; ++i) { if (typeof object.messageType[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); } } if (object.enumType) { if (!Array.isArray(object.enumType)) throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { if (typeof object.enumType[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); } } if (object.service) { if (!Array.isArray(object.service)) throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); message.service = []; for (var i = 0; i < object.service.length; ++i) { if (typeof object.service[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); } } if (object.extension) { if (!Array.isArray(object.extension)) throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { if (typeof object.extension[i] !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FileOptions.fromObject(object.options); } if (object.sourceCodeInfo != null) { if (typeof object.sourceCodeInfo !== "object") throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); } if (object.syntax != null) message.syntax = String(object.syntax); return message; }; /** * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileDescriptorProto * @static * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.dependency = []; object.messageType = []; object.enumType = []; object.service = []; object.extension = []; object.publicDependency = []; object.weakDependency = []; } if (options.defaults) { object.name = ""; object["package"] = ""; object.options = null; object.sourceCodeInfo = null; object.syntax = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message["package"] != null && message.hasOwnProperty("package")) object["package"] = message["package"]; if (message.dependency && message.dependency.length) { object.dependency = []; for (var j = 0; j < message.dependency.length; ++j) object.dependency[j] = message.dependency[j]; } if (message.messageType && message.messageType.length) { object.messageType = []; for (var j = 0; j < message.messageType.length; ++j) object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); } if (message.enumType && message.enumType.length) { object.enumType = []; for (var j = 0; j < message.enumType.length; ++j) object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); } if (message.service && message.service.length) { object.service = []; for (var j = 0; j < message.service.length; ++j) object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); } if (message.extension && message.extension.length) { object.extension = []; for (var j = 0; j < message.extension.length; ++j) object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); if (message.publicDependency && message.publicDependency.length) { object.publicDependency = []; for (var j = 0; j < message.publicDependency.length; ++j) object.publicDependency[j] = message.publicDependency[j]; } if (message.weakDependency && message.weakDependency.length) { object.weakDependency = []; for (var j = 0; j < message.weakDependency.length; ++j) object.weakDependency[j] = message.weakDependency[j]; } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; return object; }; /** * Converts this FileDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.FileDescriptorProto * @instance * @returns {Object.} JSON object */ FileDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return FileDescriptorProto; })(); protobuf.DescriptorProto = (function() { /** * Properties of a DescriptorProto. * @memberof google.protobuf * @interface IDescriptorProto * @property {string|null} [name] DescriptorProto name * @property {Array.|null} [field] DescriptorProto field * @property {Array.|null} [extension] DescriptorProto extension * @property {Array.|null} [nestedType] DescriptorProto nestedType * @property {Array.|null} [enumType] DescriptorProto enumType * @property {Array.|null} [extensionRange] DescriptorProto extensionRange * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options * @property {Array.|null} [reservedRange] DescriptorProto reservedRange * @property {Array.|null} [reservedName] DescriptorProto reservedName */ /** * Constructs a new DescriptorProto. * @memberof google.protobuf * @classdesc Represents a DescriptorProto. * @implements IDescriptorProto * @constructor * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set */ function DescriptorProto(properties) { this.field = []; this.extension = []; this.nestedType = []; this.enumType = []; this.extensionRange = []; this.oneofDecl = []; this.reservedRange = []; this.reservedName = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * DescriptorProto name. * @member {string} name * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.name = ""; /** * DescriptorProto field. * @member {Array.} field * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.field = $util.emptyArray; /** * DescriptorProto extension. * @member {Array.} extension * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.extension = $util.emptyArray; /** * DescriptorProto nestedType. * @member {Array.} nestedType * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.nestedType = $util.emptyArray; /** * DescriptorProto enumType. * @member {Array.} enumType * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.enumType = $util.emptyArray; /** * DescriptorProto extensionRange. * @member {Array.} extensionRange * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.extensionRange = $util.emptyArray; /** * DescriptorProto oneofDecl. * @member {Array.} oneofDecl * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.oneofDecl = $util.emptyArray; /** * DescriptorProto options. * @member {google.protobuf.IMessageOptions|null|undefined} options * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.options = null; /** * DescriptorProto reservedRange. * @member {Array.} reservedRange * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.reservedRange = $util.emptyArray; /** * DescriptorProto reservedName. * @member {Array.} reservedName * @memberof google.protobuf.DescriptorProto * @instance */ DescriptorProto.prototype.reservedName = $util.emptyArray; /** * Creates a new DescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto} DescriptorProto instance */ DescriptorProto.create = function create(properties) { return new DescriptorProto(properties); }; /** * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.nestedType != null && message.nestedType.length) for (var i = 0; i < message.nestedType.length; ++i) $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.enumType != null && message.enumType.length) for (var i = 0; i < message.enumType.length; ++i) $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.extensionRange != null && message.extensionRange.length) for (var i = 0; i < message.extensionRange.length; ++i) $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); return writer; }; /** * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a DescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto} DescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.field && message.field.length)) message.field = []; message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 6: if (!(message.extension && message.extension.length)) message.extension = []; message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); break; case 3: if (!(message.nestedType && message.nestedType.length)) message.nestedType = []; message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; case 4: if (!(message.enumType && message.enumType.length)) message.enumType = []; message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; case 5: if (!(message.extensionRange && message.extensionRange.length)) message.extensionRange = []; message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); break; case 8: if (!(message.oneofDecl && message.oneofDecl.length)) message.oneofDecl = []; message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); break; case 7: message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); break; case 9: if (!(message.reservedRange && message.reservedRange.length)) message.reservedRange = []; message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); break; case 10: if (!(message.reservedName && message.reservedName.length)) message.reservedName = []; message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto} DescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a DescriptorProto message. * @function verify * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.field != null && message.hasOwnProperty("field")) { if (!Array.isArray(message.field)) return "field: array expected"; for (var i = 0; i < message.field.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); if (error) return "field." + error; } } if (message.extension != null && message.hasOwnProperty("extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); if (error) return "extension." + error; } } if (message.nestedType != null && message.hasOwnProperty("nestedType")) { if (!Array.isArray(message.nestedType)) return "nestedType: array expected"; for (var i = 0; i < message.nestedType.length; ++i) { var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); if (error) return "nestedType." + error; } } if (message.enumType != null && message.hasOwnProperty("enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); if (error) return "enumType." + error; } } if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { if (!Array.isArray(message.extensionRange)) return "extensionRange: array expected"; for (var i = 0; i < message.extensionRange.length; ++i) { var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); if (error) return "extensionRange." + error; } } if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { if (!Array.isArray(message.oneofDecl)) return "oneofDecl: array expected"; for (var i = 0; i < message.oneofDecl.length; ++i) { var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); if (error) return "oneofDecl." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MessageOptions.verify(message.options); if (error) return "options." + error; } if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } } if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } return null; }; /** * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto} DescriptorProto */ DescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto) return object; var message = new $root.google.protobuf.DescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.field) { if (!Array.isArray(object.field)) throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); message.field = []; for (var i = 0; i < object.field.length; ++i) { if (typeof object.field[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); } } if (object.extension) { if (!Array.isArray(object.extension)) throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); message.extension = []; for (var i = 0; i < object.extension.length; ++i) { if (typeof object.extension[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); } } if (object.nestedType) { if (!Array.isArray(object.nestedType)) throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); message.nestedType = []; for (var i = 0; i < object.nestedType.length; ++i) { if (typeof object.nestedType[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); } } if (object.enumType) { if (!Array.isArray(object.enumType)) throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); message.enumType = []; for (var i = 0; i < object.enumType.length; ++i) { if (typeof object.enumType[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); } } if (object.extensionRange) { if (!Array.isArray(object.extensionRange)) throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); message.extensionRange = []; for (var i = 0; i < object.extensionRange.length; ++i) { if (typeof object.extensionRange[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); } } if (object.oneofDecl) { if (!Array.isArray(object.oneofDecl)) throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); message.oneofDecl = []; for (var i = 0; i < object.oneofDecl.length; ++i) { if (typeof object.oneofDecl[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); } if (object.reservedRange) { if (!Array.isArray(object.reservedRange)) throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { if (typeof object.reservedRange[i] !== "object") throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); } } if (object.reservedName) { if (!Array.isArray(object.reservedName)) throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); message.reservedName = []; for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } return message; }; /** * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto * @static * @param {google.protobuf.DescriptorProto} message DescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ DescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.field = []; object.nestedType = []; object.enumType = []; object.extensionRange = []; object.extension = []; object.oneofDecl = []; object.reservedRange = []; object.reservedName = []; } if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.field && message.field.length) { object.field = []; for (var j = 0; j < message.field.length; ++j) object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); } if (message.nestedType && message.nestedType.length) { object.nestedType = []; for (var j = 0; j < message.nestedType.length; ++j) object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); } if (message.enumType && message.enumType.length) { object.enumType = []; for (var j = 0; j < message.enumType.length; ++j) object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); } if (message.extensionRange && message.extensionRange.length) { object.extensionRange = []; for (var j = 0; j < message.extensionRange.length; ++j) object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); } if (message.extension && message.extension.length) { object.extension = []; for (var j = 0; j < message.extension.length; ++j) object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); if (message.oneofDecl && message.oneofDecl.length) { object.oneofDecl = []; for (var j = 0; j < message.oneofDecl.length; ++j) object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); } if (message.reservedRange && message.reservedRange.length) { object.reservedRange = []; for (var j = 0; j < message.reservedRange.length; ++j) object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } return object; }; /** * Converts this DescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto * @instance * @returns {Object.} JSON object */ DescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; DescriptorProto.ExtensionRange = (function() { /** * Properties of an ExtensionRange. * @memberof google.protobuf.DescriptorProto * @interface IExtensionRange * @property {number|null} [start] ExtensionRange start * @property {number|null} [end] ExtensionRange end * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options */ /** * Constructs a new ExtensionRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents an ExtensionRange. * @implements IExtensionRange * @constructor * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set */ function ExtensionRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ExtensionRange start. * @member {number} start * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.start = 0; /** * ExtensionRange end. * @member {number} end * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.end = 0; /** * ExtensionRange options. * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ ExtensionRange.prototype.options = null; /** * Creates a new ExtensionRange instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance */ ExtensionRange.create = function create(properties) { return new ExtensionRange(properties); }; /** * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ExtensionRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; case 3: message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ExtensionRange message. * @function verify * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ExtensionRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange */ ExtensionRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) return object; var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ExtensionRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; object.options = null; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); return object; }; /** * Converts this ExtensionRange to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance * @returns {Object.} JSON object */ ExtensionRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ExtensionRange; })(); DescriptorProto.ReservedRange = (function() { /** * Properties of a ReservedRange. * @memberof google.protobuf.DescriptorProto * @interface IReservedRange * @property {number|null} [start] ReservedRange start * @property {number|null} [end] ReservedRange end */ /** * Constructs a new ReservedRange. * @memberof google.protobuf.DescriptorProto * @classdesc Represents a ReservedRange. * @implements IReservedRange * @constructor * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set */ function ReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ReservedRange start. * @member {number} start * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ ReservedRange.prototype.start = 0; /** * ReservedRange end. * @member {number} end * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ ReservedRange.prototype.end = 0; /** * Creates a new ReservedRange instance using the specified properties. * @function create * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance */ ReservedRange.create = function create(properties) { return new ReservedRange(properties); }; /** * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encode * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ReservedRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ReservedRange message. * @function verify * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange */ ReservedRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) return object; var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this ReservedRange to JSON. * @function toJSON * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance * @returns {Object.} JSON object */ ReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ReservedRange; })(); return DescriptorProto; })(); protobuf.ExtensionRangeOptions = (function() { /** * Properties of an ExtensionRangeOptions. * @memberof google.protobuf * @interface IExtensionRangeOptions * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption */ /** * Constructs a new ExtensionRangeOptions. * @memberof google.protobuf * @classdesc Represents an ExtensionRangeOptions. * @implements IExtensionRangeOptions * @constructor * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set */ function ExtensionRangeOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ExtensionRangeOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.ExtensionRangeOptions * @instance */ ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new ExtensionRangeOptions instance using the specified properties. * @function create * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance */ ExtensionRangeOptions.create = function create(properties) { return new ExtensionRangeOptions(properties); }; /** * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an ExtensionRangeOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRangeOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an ExtensionRangeOptions message. * @function verify * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ExtensionRangeOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions */ ExtensionRangeOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ExtensionRangeOptions) return object; var message = new $root.google.protobuf.ExtensionRangeOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ExtensionRangeOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this ExtensionRangeOptions to JSON. * @function toJSON * @memberof google.protobuf.ExtensionRangeOptions * @instance * @returns {Object.} JSON object */ ExtensionRangeOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ExtensionRangeOptions; })(); protobuf.FieldDescriptorProto = (function() { /** * Properties of a FieldDescriptorProto. * @memberof google.protobuf * @interface IFieldDescriptorProto * @property {string|null} [name] FieldDescriptorProto name * @property {number|null} [number] FieldDescriptorProto number * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type * @property {string|null} [typeName] FieldDescriptorProto typeName * @property {string|null} [extendee] FieldDescriptorProto extendee * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex * @property {string|null} [jsonName] FieldDescriptorProto jsonName * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional */ /** * Constructs a new FieldDescriptorProto. * @memberof google.protobuf * @classdesc Represents a FieldDescriptorProto. * @implements IFieldDescriptorProto * @constructor * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set */ function FieldDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldDescriptorProto name. * @member {string} name * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.name = ""; /** * FieldDescriptorProto number. * @member {number} number * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.number = 0; /** * FieldDescriptorProto label. * @member {google.protobuf.FieldDescriptorProto.Label} label * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.label = 1; /** * FieldDescriptorProto type. * @member {google.protobuf.FieldDescriptorProto.Type} type * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.type = 1; /** * FieldDescriptorProto typeName. * @member {string} typeName * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.typeName = ""; /** * FieldDescriptorProto extendee. * @member {string} extendee * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.extendee = ""; /** * FieldDescriptorProto defaultValue. * @member {string} defaultValue * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.defaultValue = ""; /** * FieldDescriptorProto oneofIndex. * @member {number} oneofIndex * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.oneofIndex = 0; /** * FieldDescriptorProto jsonName. * @member {string} jsonName * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.jsonName = ""; /** * FieldDescriptorProto options. * @member {google.protobuf.IFieldOptions|null|undefined} options * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.options = null; /** * FieldDescriptorProto proto3Optional. * @member {boolean} proto3Optional * @memberof google.protobuf.FieldDescriptorProto * @instance */ FieldDescriptorProto.prototype.proto3Optional = false; /** * Creates a new FieldDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance */ FieldDescriptorProto.create = function create(properties) { return new FieldDescriptorProto(properties); }; /** * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); return writer; }; /** * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 3: message.number = reader.int32(); break; case 4: message.label = reader.int32(); break; case 5: message.type = reader.int32(); break; case 6: message.typeName = reader.string(); break; case 2: message.extendee = reader.string(); break; case 7: message.defaultValue = reader.string(); break; case 9: message.oneofIndex = reader.int32(); break; case 10: message.jsonName = reader.string(); break; case 8: message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); break; case 17: message.proto3Optional = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldDescriptorProto message. * @function verify * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; if (message.label != null && message.hasOwnProperty("label")) switch (message.label) { default: return "label: enum value expected"; case 1: case 2: case 3: break; } if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: return "type: enum value expected"; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: break; } if (message.typeName != null && message.hasOwnProperty("typeName")) if (!$util.isString(message.typeName)) return "typeName: string expected"; if (message.extendee != null && message.hasOwnProperty("extendee")) if (!$util.isString(message.extendee)) return "extendee: string expected"; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) if (!$util.isString(message.defaultValue)) return "defaultValue: string expected"; if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) if (!$util.isInteger(message.oneofIndex)) return "oneofIndex: integer expected"; if (message.jsonName != null && message.hasOwnProperty("jsonName")) if (!$util.isString(message.jsonName)) return "jsonName: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.FieldOptions.verify(message.options); if (error) return "options." + error; } if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) if (typeof message.proto3Optional !== "boolean") return "proto3Optional: boolean expected"; return null; }; /** * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto */ FieldDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldDescriptorProto) return object; var message = new $root.google.protobuf.FieldDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.number != null) message.number = object.number | 0; switch (object.label) { case "LABEL_OPTIONAL": case 1: message.label = 1; break; case "LABEL_REQUIRED": case 2: message.label = 2; break; case "LABEL_REPEATED": case 3: message.label = 3; break; } switch (object.type) { case "TYPE_DOUBLE": case 1: message.type = 1; break; case "TYPE_FLOAT": case 2: message.type = 2; break; case "TYPE_INT64": case 3: message.type = 3; break; case "TYPE_UINT64": case 4: message.type = 4; break; case "TYPE_INT32": case 5: message.type = 5; break; case "TYPE_FIXED64": case 6: message.type = 6; break; case "TYPE_FIXED32": case 7: message.type = 7; break; case "TYPE_BOOL": case 8: message.type = 8; break; case "TYPE_STRING": case 9: message.type = 9; break; case "TYPE_GROUP": case 10: message.type = 10; break; case "TYPE_MESSAGE": case 11: message.type = 11; break; case "TYPE_BYTES": case 12: message.type = 12; break; case "TYPE_UINT32": case 13: message.type = 13; break; case "TYPE_ENUM": case 14: message.type = 14; break; case "TYPE_SFIXED32": case 15: message.type = 15; break; case "TYPE_SFIXED64": case 16: message.type = 16; break; case "TYPE_SINT32": case 17: message.type = 17; break; case "TYPE_SINT64": case 18: message.type = 18; break; } if (object.typeName != null) message.typeName = String(object.typeName); if (object.extendee != null) message.extendee = String(object.extendee); if (object.defaultValue != null) message.defaultValue = String(object.defaultValue); if (object.oneofIndex != null) message.oneofIndex = object.oneofIndex | 0; if (object.jsonName != null) message.jsonName = String(object.jsonName); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); } if (object.proto3Optional != null) message.proto3Optional = Boolean(object.proto3Optional); return message; }; /** * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldDescriptorProto * @static * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.extendee = ""; object.number = 0; object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; object.type = options.enums === String ? "TYPE_DOUBLE" : 1; object.typeName = ""; object.defaultValue = ""; object.options = null; object.oneofIndex = 0; object.jsonName = ""; object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.extendee != null && message.hasOwnProperty("extendee")) object.extendee = message.extendee; if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) object.defaultValue = message.defaultValue; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) object.oneofIndex = message.oneofIndex; if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) object.proto3Optional = message.proto3Optional; return object; }; /** * Converts this FieldDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.FieldDescriptorProto * @instance * @returns {Object.} JSON object */ FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type * @enum {number} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value * @property {number} TYPE_UINT64=4 TYPE_UINT64 value * @property {number} TYPE_INT32=5 TYPE_INT32 value * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value * @property {number} TYPE_BOOL=8 TYPE_BOOL value * @property {number} TYPE_STRING=9 TYPE_STRING value * @property {number} TYPE_GROUP=10 TYPE_GROUP value * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value * @property {number} TYPE_BYTES=12 TYPE_BYTES value * @property {number} TYPE_UINT32=13 TYPE_UINT32 value * @property {number} TYPE_ENUM=14 TYPE_ENUM value * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value * @property {number} TYPE_SINT32=17 TYPE_SINT32 value * @property {number} TYPE_SINT64=18 TYPE_SINT64 value */ FieldDescriptorProto.Type = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "TYPE_DOUBLE"] = 1; values[valuesById[2] = "TYPE_FLOAT"] = 2; values[valuesById[3] = "TYPE_INT64"] = 3; values[valuesById[4] = "TYPE_UINT64"] = 4; values[valuesById[5] = "TYPE_INT32"] = 5; values[valuesById[6] = "TYPE_FIXED64"] = 6; values[valuesById[7] = "TYPE_FIXED32"] = 7; values[valuesById[8] = "TYPE_BOOL"] = 8; values[valuesById[9] = "TYPE_STRING"] = 9; values[valuesById[10] = "TYPE_GROUP"] = 10; values[valuesById[11] = "TYPE_MESSAGE"] = 11; values[valuesById[12] = "TYPE_BYTES"] = 12; values[valuesById[13] = "TYPE_UINT32"] = 13; values[valuesById[14] = "TYPE_ENUM"] = 14; values[valuesById[15] = "TYPE_SFIXED32"] = 15; values[valuesById[16] = "TYPE_SFIXED64"] = 16; values[valuesById[17] = "TYPE_SINT32"] = 17; values[valuesById[18] = "TYPE_SINT64"] = 18; return values; })(); /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value */ FieldDescriptorProto.Label = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "LABEL_OPTIONAL"] = 1; values[valuesById[2] = "LABEL_REQUIRED"] = 2; values[valuesById[3] = "LABEL_REPEATED"] = 3; return values; })(); return FieldDescriptorProto; })(); protobuf.OneofDescriptorProto = (function() { /** * Properties of an OneofDescriptorProto. * @memberof google.protobuf * @interface IOneofDescriptorProto * @property {string|null} [name] OneofDescriptorProto name * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options */ /** * Constructs a new OneofDescriptorProto. * @memberof google.protobuf * @classdesc Represents an OneofDescriptorProto. * @implements IOneofDescriptorProto * @constructor * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ function OneofDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OneofDescriptorProto name. * @member {string} name * @memberof google.protobuf.OneofDescriptorProto * @instance */ OneofDescriptorProto.prototype.name = ""; /** * OneofDescriptorProto options. * @member {google.protobuf.IOneofOptions|null|undefined} options * @memberof google.protobuf.OneofDescriptorProto * @instance */ OneofDescriptorProto.prototype.options = null; /** * Creates a new OneofDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance */ OneofDescriptorProto.create = function create(properties) { return new OneofDescriptorProto(properties); }; /** * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OneofDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OneofDescriptorProto message. * @function verify * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OneofDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.OneofOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ OneofDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; var message = new $root.google.protobuf.OneofDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.OneofDescriptorProto * @static * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OneofDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); return object; }; /** * Converts this OneofDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.OneofDescriptorProto * @instance * @returns {Object.} JSON object */ OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OneofDescriptorProto; })(); protobuf.EnumDescriptorProto = (function() { /** * Properties of an EnumDescriptorProto. * @memberof google.protobuf * @interface IEnumDescriptorProto * @property {string|null} [name] EnumDescriptorProto name * @property {Array.|null} [value] EnumDescriptorProto value * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName */ /** * Constructs a new EnumDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumDescriptorProto. * @implements IEnumDescriptorProto * @constructor * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ function EnumDescriptorProto(properties) { this.value = []; this.reservedRange = []; this.reservedName = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumDescriptorProto name. * @member {string} name * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.name = ""; /** * EnumDescriptorProto value. * @member {Array.} value * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.value = $util.emptyArray; /** * EnumDescriptorProto options. * @member {google.protobuf.IEnumOptions|null|undefined} options * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.options = null; /** * EnumDescriptorProto reservedRange. * @member {Array.} reservedRange * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; /** * EnumDescriptorProto reservedName. * @member {Array.} reservedName * @memberof google.protobuf.EnumDescriptorProto * @instance */ EnumDescriptorProto.prototype.reservedName = $util.emptyArray; /** * Creates a new EnumDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ EnumDescriptorProto.create = function create(properties) { return new EnumDescriptorProto(properties); }; /** * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.reservedName != null && message.reservedName.length) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); return writer; }; /** * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.value && message.value.length)) message.value = []; message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); break; case 4: if (!(message.reservedRange && message.reservedRange.length)) message.reservedRange = []; message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); break; case 5: if (!(message.reservedName && message.reservedName.length)) message.reservedName = []; message.reservedName.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumDescriptorProto message. * @function verify * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.value != null && message.hasOwnProperty("value")) { if (!Array.isArray(message.value)) return "value: array expected"; for (var i = 0; i < message.value.length; ++i) { var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); if (error) return "value." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumOptions.verify(message.options); if (error) return "options." + error; } if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } } if (message.reservedName != null && message.hasOwnProperty("reservedName")) { if (!Array.isArray(message.reservedName)) return "reservedName: array expected"; for (var i = 0; i < message.reservedName.length; ++i) if (!$util.isString(message.reservedName[i])) return "reservedName: string[] expected"; } return null; }; /** * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ EnumDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; var message = new $root.google.protobuf.EnumDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.value) { if (!Array.isArray(object.value)) throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); message.value = []; for (var i = 0; i < object.value.length; ++i) { if (typeof object.value[i] !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); } if (object.reservedRange) { if (!Array.isArray(object.reservedRange)) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); message.reservedRange = []; for (var i = 0; i < object.reservedRange.length; ++i) { if (typeof object.reservedRange[i] !== "object") throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); } } if (object.reservedName) { if (!Array.isArray(object.reservedName)) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); message.reservedName = []; for (var i = 0; i < object.reservedName.length; ++i) message.reservedName[i] = String(object.reservedName[i]); } return message; }; /** * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumDescriptorProto * @static * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.value = []; object.reservedRange = []; object.reservedName = []; } if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.value && message.value.length) { object.value = []; for (var j = 0; j < message.value.length; ++j) object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); if (message.reservedRange && message.reservedRange.length) { object.reservedRange = []; for (var j = 0; j < message.reservedRange.length; ++j) object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; for (var j = 0; j < message.reservedName.length; ++j) object.reservedName[j] = message.reservedName[j]; } return object; }; /** * Converts this EnumDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.EnumDescriptorProto * @instance * @returns {Object.} JSON object */ EnumDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; EnumDescriptorProto.EnumReservedRange = (function() { /** * Properties of an EnumReservedRange. * @memberof google.protobuf.EnumDescriptorProto * @interface IEnumReservedRange * @property {number|null} [start] EnumReservedRange start * @property {number|null} [end] EnumReservedRange end */ /** * Constructs a new EnumReservedRange. * @memberof google.protobuf.EnumDescriptorProto * @classdesc Represents an EnumReservedRange. * @implements IEnumReservedRange * @constructor * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set */ function EnumReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumReservedRange start. * @member {number} start * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ EnumReservedRange.prototype.start = 0; /** * EnumReservedRange end. * @member {number} end * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ EnumReservedRange.prototype.end = 0; /** * Creates a new EnumReservedRange instance using the specified properties. * @function create * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance */ EnumReservedRange.create = function create(properties) { return new EnumReservedRange(properties); }; /** * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; /** * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumReservedRange message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.start = reader.int32(); break; case 2: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumReservedRange message. * @function verify * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) if (!$util.isInteger(message.start)) return "start: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange */ EnumReservedRange.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) return object; var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); if (object.start != null) message.start = object.start | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } if (message.start != null && message.hasOwnProperty("start")) object.start = message.start; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this EnumReservedRange to JSON. * @function toJSON * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance * @returns {Object.} JSON object */ EnumReservedRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumReservedRange; })(); return EnumDescriptorProto; })(); protobuf.EnumValueDescriptorProto = (function() { /** * Properties of an EnumValueDescriptorProto. * @memberof google.protobuf * @interface IEnumValueDescriptorProto * @property {string|null} [name] EnumValueDescriptorProto name * @property {number|null} [number] EnumValueDescriptorProto number * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options */ /** * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf * @classdesc Represents an EnumValueDescriptorProto. * @implements IEnumValueDescriptorProto * @constructor * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumValueDescriptorProto name. * @member {string} name * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.name = ""; /** * EnumValueDescriptorProto number. * @member {number} number * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.number = 0; /** * EnumValueDescriptorProto options. * @member {google.protobuf.IEnumValueOptions|null|undefined} options * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ EnumValueDescriptorProto.prototype.options = null; /** * Creates a new EnumValueDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ EnumValueDescriptorProto.create = function create(properties) { return new EnumValueDescriptorProto(properties); }; /** * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.number = reader.int32(); break; case 3: message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumValueDescriptorProto message. * @function verify * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumValueDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.number != null && message.hasOwnProperty("number")) if (!$util.isInteger(message.number)) return "number: integer expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.EnumValueOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ EnumValueDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; var message = new $root.google.protobuf.EnumValueDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.number != null) message.number = object.number | 0; if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.number = 0; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); return object; }; /** * Converts this EnumValueDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumValueDescriptorProto; })(); protobuf.ServiceDescriptorProto = (function() { /** * Properties of a ServiceDescriptorProto. * @memberof google.protobuf * @interface IServiceDescriptorProto * @property {string|null} [name] ServiceDescriptorProto name * @property {Array.|null} [method] ServiceDescriptorProto method * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options */ /** * Constructs a new ServiceDescriptorProto. * @memberof google.protobuf * @classdesc Represents a ServiceDescriptorProto. * @implements IServiceDescriptorProto * @constructor * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ function ServiceDescriptorProto(properties) { this.method = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ServiceDescriptorProto name. * @member {string} name * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.name = ""; /** * ServiceDescriptorProto method. * @member {Array.} method * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.method = $util.emptyArray; /** * ServiceDescriptorProto options. * @member {google.protobuf.IServiceOptions|null|undefined} options * @memberof google.protobuf.ServiceDescriptorProto * @instance */ ServiceDescriptorProto.prototype.options = null; /** * Creates a new ServiceDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance */ ServiceDescriptorProto.create = function create(properties) { return new ServiceDescriptorProto(properties); }; /** * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ServiceDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: if (!(message.method && message.method.length)) message.method = []; message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); break; case 3: message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ServiceDescriptorProto message. * @function verify * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ServiceDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.method != null && message.hasOwnProperty("method")) { if (!Array.isArray(message.method)) return "method: array expected"; for (var i = 0; i < message.method.length; ++i) { var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); if (error) return "method." + error; } } if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.ServiceOptions.verify(message.options); if (error) return "options." + error; } return null; }; /** * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto */ ServiceDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ServiceDescriptorProto) return object; var message = new $root.google.protobuf.ServiceDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.method) { if (!Array.isArray(object.method)) throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); message.method = []; for (var i = 0; i < object.method.length; ++i) { if (typeof object.method[i] !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); } } if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); } return message; }; /** * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ServiceDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.method = []; if (options.defaults) { object.name = ""; object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.method && message.method.length) { object.method = []; for (var j = 0; j < message.method.length; ++j) object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); } if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; /** * Converts this ServiceDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.ServiceDescriptorProto * @instance * @returns {Object.} JSON object */ ServiceDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ServiceDescriptorProto; })(); protobuf.MethodDescriptorProto = (function() { /** * Properties of a MethodDescriptorProto. * @memberof google.protobuf * @interface IMethodDescriptorProto * @property {string|null} [name] MethodDescriptorProto name * @property {string|null} [inputType] MethodDescriptorProto inputType * @property {string|null} [outputType] MethodDescriptorProto outputType * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming */ /** * Constructs a new MethodDescriptorProto. * @memberof google.protobuf * @classdesc Represents a MethodDescriptorProto. * @implements IMethodDescriptorProto * @constructor * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ function MethodDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MethodDescriptorProto name. * @member {string} name * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.name = ""; /** * MethodDescriptorProto inputType. * @member {string} inputType * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.inputType = ""; /** * MethodDescriptorProto outputType. * @member {string} outputType * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.outputType = ""; /** * MethodDescriptorProto options. * @member {google.protobuf.IMethodOptions|null|undefined} options * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.options = null; /** * MethodDescriptorProto clientStreaming. * @member {boolean} clientStreaming * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.clientStreaming = false; /** * MethodDescriptorProto serverStreaming. * @member {boolean} serverStreaming * @memberof google.protobuf.MethodDescriptorProto * @instance */ MethodDescriptorProto.prototype.serverStreaming = false; /** * Creates a new MethodDescriptorProto instance using the specified properties. * @function create * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ MethodDescriptorProto.create = function create(properties) { return new MethodDescriptorProto(properties); }; /** * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; /** * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; case 2: message.inputType = reader.string(); break; case 3: message.outputType = reader.string(); break; case 4: message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); break; case 5: message.clientStreaming = reader.bool(); break; case 6: message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MethodDescriptorProto message. * @function verify * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MethodDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; if (message.inputType != null && message.hasOwnProperty("inputType")) if (!$util.isString(message.inputType)) return "inputType: string expected"; if (message.outputType != null && message.hasOwnProperty("outputType")) if (!$util.isString(message.outputType)) return "outputType: string expected"; if (message.options != null && message.hasOwnProperty("options")) { var error = $root.google.protobuf.MethodOptions.verify(message.options); if (error) return "options." + error; } if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) if (typeof message.clientStreaming !== "boolean") return "clientStreaming: boolean expected"; if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) if (typeof message.serverStreaming !== "boolean") return "serverStreaming: boolean expected"; return null; }; /** * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} object Plain object * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ MethodDescriptorProto.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MethodDescriptorProto) return object; var message = new $root.google.protobuf.MethodDescriptorProto(); if (object.name != null) message.name = String(object.name); if (object.inputType != null) message.inputType = String(object.inputType); if (object.outputType != null) message.outputType = String(object.outputType); if (object.options != null) { if (typeof object.options !== "object") throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); } if (object.clientStreaming != null) message.clientStreaming = Boolean(object.clientStreaming); if (object.serverStreaming != null) message.serverStreaming = Boolean(object.serverStreaming); return message; }; /** * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MethodDescriptorProto * @static * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; object.inputType = ""; object.outputType = ""; object.options = null; object.clientStreaming = false; object.serverStreaming = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.inputType != null && message.hasOwnProperty("inputType")) object.inputType = message.inputType; if (message.outputType != null && message.hasOwnProperty("outputType")) object.outputType = message.outputType; if (message.options != null && message.hasOwnProperty("options")) object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) object.clientStreaming = message.clientStreaming; if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) object.serverStreaming = message.serverStreaming; return object; }; /** * Converts this MethodDescriptorProto to JSON. * @function toJSON * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MethodDescriptorProto; })(); protobuf.FileOptions = (function() { /** * Properties of a FileOptions. * @memberof google.protobuf * @interface IFileOptions * @property {string|null} [javaPackage] FileOptions javaPackage * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor * @property {string|null} [goPackage] FileOptions goPackage * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices * @property {boolean|null} [deprecated] FileOptions deprecated * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix * @property {string|null} [csharpNamespace] FileOptions csharpNamespace * @property {string|null} [swiftPrefix] FileOptions swiftPrefix * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix * @property {string|null} [phpNamespace] FileOptions phpNamespace * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace * @property {string|null} [rubyPackage] FileOptions rubyPackage * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption */ /** * Constructs a new FileOptions. * @memberof google.protobuf * @classdesc Represents a FileOptions. * @implements IFileOptions * @constructor * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ function FileOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FileOptions javaPackage. * @member {string} javaPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaPackage = ""; /** * FileOptions javaOuterClassname. * @member {string} javaOuterClassname * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaOuterClassname = ""; /** * FileOptions javaMultipleFiles. * @member {boolean} javaMultipleFiles * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaMultipleFiles = false; /** * FileOptions javaGenerateEqualsAndHash. * @member {boolean} javaGenerateEqualsAndHash * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaGenerateEqualsAndHash = false; /** * FileOptions javaStringCheckUtf8. * @member {boolean} javaStringCheckUtf8 * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaStringCheckUtf8 = false; /** * FileOptions optimizeFor. * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.optimizeFor = 1; /** * FileOptions goPackage. * @member {string} goPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.goPackage = ""; /** * FileOptions ccGenericServices. * @member {boolean} ccGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.ccGenericServices = false; /** * FileOptions javaGenericServices. * @member {boolean} javaGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.javaGenericServices = false; /** * FileOptions pyGenericServices. * @member {boolean} pyGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.pyGenericServices = false; /** * FileOptions phpGenericServices. * @member {boolean} phpGenericServices * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpGenericServices = false; /** * FileOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.deprecated = false; /** * FileOptions ccEnableArenas. * @member {boolean} ccEnableArenas * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. * @member {string} objcClassPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.objcClassPrefix = ""; /** * FileOptions csharpNamespace. * @member {string} csharpNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.csharpNamespace = ""; /** * FileOptions swiftPrefix. * @member {string} swiftPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.swiftPrefix = ""; /** * FileOptions phpClassPrefix. * @member {string} phpClassPrefix * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpClassPrefix = ""; /** * FileOptions phpNamespace. * @member {string} phpNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpNamespace = ""; /** * FileOptions phpMetadataNamespace. * @member {string} phpMetadataNamespace * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.phpMetadataNamespace = ""; /** * FileOptions rubyPackage. * @member {string} rubyPackage * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.rubyPackage = ""; /** * FileOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.FileOptions * @instance */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new FileOptions instance using the specified properties. * @function create * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions=} [properties] Properties to set * @returns {google.protobuf.FileOptions} FileOptions instance */ FileOptions.create = function create(properties) { return new FileOptions(properties); }; /** * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FileOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FileOptions} FileOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.javaPackage = reader.string(); break; case 8: message.javaOuterClassname = reader.string(); break; case 10: message.javaMultipleFiles = reader.bool(); break; case 20: message.javaGenerateEqualsAndHash = reader.bool(); break; case 27: message.javaStringCheckUtf8 = reader.bool(); break; case 9: message.optimizeFor = reader.int32(); break; case 11: message.goPackage = reader.string(); break; case 16: message.ccGenericServices = reader.bool(); break; case 17: message.javaGenericServices = reader.bool(); break; case 18: message.pyGenericServices = reader.bool(); break; case 42: message.phpGenericServices = reader.bool(); break; case 23: message.deprecated = reader.bool(); break; case 31: message.ccEnableArenas = reader.bool(); break; case 36: message.objcClassPrefix = reader.string(); break; case 37: message.csharpNamespace = reader.string(); break; case 39: message.swiftPrefix = reader.string(); break; case 40: message.phpClassPrefix = reader.string(); break; case 41: message.phpNamespace = reader.string(); break; case 44: message.phpMetadataNamespace = reader.string(); break; case 45: message.rubyPackage = reader.string(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FileOptions} FileOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FileOptions message. * @function verify * @memberof google.protobuf.FileOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FileOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) if (!$util.isString(message.javaPackage)) return "javaPackage: string expected"; if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) if (!$util.isString(message.javaOuterClassname)) return "javaOuterClassname: string expected"; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) if (typeof message.javaMultipleFiles !== "boolean") return "javaMultipleFiles: boolean expected"; if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) if (typeof message.javaGenerateEqualsAndHash !== "boolean") return "javaGenerateEqualsAndHash: boolean expected"; if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) if (typeof message.javaStringCheckUtf8 !== "boolean") return "javaStringCheckUtf8: boolean expected"; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) switch (message.optimizeFor) { default: return "optimizeFor: enum value expected"; case 1: case 2: case 3: break; } if (message.goPackage != null && message.hasOwnProperty("goPackage")) if (!$util.isString(message.goPackage)) return "goPackage: string expected"; if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) if (typeof message.ccGenericServices !== "boolean") return "ccGenericServices: boolean expected"; if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) if (typeof message.javaGenericServices !== "boolean") return "javaGenericServices: boolean expected"; if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) if (typeof message.pyGenericServices !== "boolean") return "pyGenericServices: boolean expected"; if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) if (typeof message.phpGenericServices !== "boolean") return "phpGenericServices: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) if (typeof message.ccEnableArenas !== "boolean") return "ccEnableArenas: boolean expected"; if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) if (!$util.isString(message.objcClassPrefix)) return "objcClassPrefix: string expected"; if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) if (!$util.isString(message.csharpNamespace)) return "csharpNamespace: string expected"; if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) if (!$util.isString(message.swiftPrefix)) return "swiftPrefix: string expected"; if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) if (!$util.isString(message.phpClassPrefix)) return "phpClassPrefix: string expected"; if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) if (!$util.isString(message.phpNamespace)) return "phpNamespace: string expected"; if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) if (!$util.isString(message.phpMetadataNamespace)) return "phpMetadataNamespace: string expected"; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) if (!$util.isString(message.rubyPackage)) return "rubyPackage: string expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.FileOptions} FileOptions */ FileOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FileOptions) return object; var message = new $root.google.protobuf.FileOptions(); if (object.javaPackage != null) message.javaPackage = String(object.javaPackage); if (object.javaOuterClassname != null) message.javaOuterClassname = String(object.javaOuterClassname); if (object.javaMultipleFiles != null) message.javaMultipleFiles = Boolean(object.javaMultipleFiles); if (object.javaGenerateEqualsAndHash != null) message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { case "SPEED": case 1: message.optimizeFor = 1; break; case "CODE_SIZE": case 2: message.optimizeFor = 2; break; case "LITE_RUNTIME": case 3: message.optimizeFor = 3; break; } if (object.goPackage != null) message.goPackage = String(object.goPackage); if (object.ccGenericServices != null) message.ccGenericServices = Boolean(object.ccGenericServices); if (object.javaGenericServices != null) message.javaGenericServices = Boolean(object.javaGenericServices); if (object.pyGenericServices != null) message.pyGenericServices = Boolean(object.pyGenericServices); if (object.phpGenericServices != null) message.phpGenericServices = Boolean(object.phpGenericServices); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.ccEnableArenas != null) message.ccEnableArenas = Boolean(object.ccEnableArenas); if (object.objcClassPrefix != null) message.objcClassPrefix = String(object.objcClassPrefix); if (object.csharpNamespace != null) message.csharpNamespace = String(object.csharpNamespace); if (object.swiftPrefix != null) message.swiftPrefix = String(object.swiftPrefix); if (object.phpClassPrefix != null) message.phpClassPrefix = String(object.phpClassPrefix); if (object.phpNamespace != null) message.phpNamespace = String(object.phpNamespace); if (object.phpMetadataNamespace != null) message.phpMetadataNamespace = String(object.phpMetadataNamespace); if (object.rubyPackage != null) message.rubyPackage = String(object.rubyPackage); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FileOptions * @static * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FileOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.javaPackage = ""; object.javaOuterClassname = ""; object.optimizeFor = options.enums === String ? "SPEED" : 1; object.javaMultipleFiles = false; object.goPackage = ""; object.ccGenericServices = false; object.javaGenericServices = false; object.pyGenericServices = false; object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; object.phpClassPrefix = ""; object.phpNamespace = ""; object.phpGenericServices = false; object.phpMetadataNamespace = ""; object.rubyPackage = ""; } if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) object.javaPackage = message.javaPackage; if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) object.goPackage = message.goPackage; if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) object.ccGenericServices = message.ccGenericServices; if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) object.javaGenericServices = message.javaGenericServices; if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) object.pyGenericServices = message.pyGenericServices; if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) object.javaStringCheckUtf8 = message.javaStringCheckUtf8; if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) object.ccEnableArenas = message.ccEnableArenas; if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) object.objcClassPrefix = message.objcClassPrefix; if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) object.csharpNamespace = message.csharpNamespace; if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) object.swiftPrefix = message.swiftPrefix; if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) object.phpClassPrefix = message.phpClassPrefix; if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) object.phpNamespace = message.phpNamespace; if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) object.phpGenericServices = message.phpGenericServices; if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) object.phpMetadataNamespace = message.phpMetadataNamespace; if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) object.rubyPackage = message.rubyPackage; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this FileOptions to JSON. * @function toJSON * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value */ FileOptions.OptimizeMode = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[1] = "SPEED"] = 1; values[valuesById[2] = "CODE_SIZE"] = 2; values[valuesById[3] = "LITE_RUNTIME"] = 3; return values; })(); return FileOptions; })(); protobuf.MessageOptions = (function() { /** * Properties of a MessageOptions. * @memberof google.protobuf * @interface IMessageOptions * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor * @property {boolean|null} [deprecated] MessageOptions deprecated * @property {boolean|null} [mapEntry] MessageOptions mapEntry * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption */ /** * Constructs a new MessageOptions. * @memberof google.protobuf * @classdesc Represents a MessageOptions. * @implements IMessageOptions * @constructor * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ function MessageOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MessageOptions messageSetWireFormat. * @member {boolean} messageSetWireFormat * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.messageSetWireFormat = false; /** * MessageOptions noStandardDescriptorAccessor. * @member {boolean} noStandardDescriptorAccessor * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.noStandardDescriptorAccessor = false; /** * MessageOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.deprecated = false; /** * MessageOptions mapEntry. * @member {boolean} mapEntry * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.mapEntry = false; /** * MessageOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.MessageOptions * @instance */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new MessageOptions instance using the specified properties. * @function create * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions=} [properties] Properties to set * @returns {google.protobuf.MessageOptions} MessageOptions instance */ MessageOptions.create = function create(properties) { return new MessageOptions(properties); }; /** * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MessageOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessageOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.messageSetWireFormat = reader.bool(); break; case 2: message.noStandardDescriptorAccessor = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 7: message.mapEntry = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MessageOptions} MessageOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MessageOptions message. * @function verify * @memberof google.protobuf.MessageOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MessageOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) if (typeof message.messageSetWireFormat !== "boolean") return "messageSetWireFormat: boolean expected"; if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) if (typeof message.noStandardDescriptorAccessor !== "boolean") return "noStandardDescriptorAccessor: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) if (typeof message.mapEntry !== "boolean") return "mapEntry: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.MessageOptions} MessageOptions */ MessageOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MessageOptions) return object; var message = new $root.google.protobuf.MessageOptions(); if (object.messageSetWireFormat != null) message.messageSetWireFormat = Boolean(object.messageSetWireFormat); if (object.noStandardDescriptorAccessor != null) message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.mapEntry != null) message.mapEntry = Boolean(object.mapEntry); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MessageOptions * @static * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.messageSetWireFormat = false; object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) object.mapEntry = message.mapEntry; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this MessageOptions to JSON. * @function toJSON * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return MessageOptions; })(); protobuf.FieldOptions = (function() { /** * Properties of a FieldOptions. * @memberof google.protobuf * @interface IFieldOptions * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype * @property {boolean|null} [packed] FieldOptions packed * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype * @property {boolean|null} [lazy] FieldOptions lazy * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption */ /** * Constructs a new FieldOptions. * @memberof google.protobuf * @classdesc Represents a FieldOptions. * @implements IFieldOptions * @constructor * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ function FieldOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * FieldOptions ctype. * @member {google.protobuf.FieldOptions.CType} ctype * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.ctype = 0; /** * FieldOptions packed. * @member {boolean} packed * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.packed = false; /** * FieldOptions jstype. * @member {google.protobuf.FieldOptions.JSType} jstype * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.jstype = 0; /** * FieldOptions lazy. * @member {boolean} lazy * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.lazy = false; /** * FieldOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.deprecated = false; /** * FieldOptions weak. * @member {boolean} weak * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.weak = false; /** * FieldOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.FieldOptions * @instance */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new FieldOptions instance using the specified properties. * @function create * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions=} [properties] Properties to set * @returns {google.protobuf.FieldOptions} FieldOptions instance */ FieldOptions.create = function create(properties) { return new FieldOptions(properties); }; /** * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a FieldOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.ctype = reader.int32(); break; case 2: message.packed = reader.bool(); break; case 6: message.jstype = reader.int32(); break; case 5: message.lazy = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 10: message.weak = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.FieldOptions} FieldOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FieldOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a FieldOptions message. * @function verify * @memberof google.protobuf.FieldOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ FieldOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.ctype != null && message.hasOwnProperty("ctype")) switch (message.ctype) { default: return "ctype: enum value expected"; case 0: case 1: case 2: break; } if (message.packed != null && message.hasOwnProperty("packed")) if (typeof message.packed !== "boolean") return "packed: boolean expected"; if (message.jstype != null && message.hasOwnProperty("jstype")) switch (message.jstype) { default: return "jstype: enum value expected"; case 0: case 1: case 2: break; } if (message.lazy != null && message.hasOwnProperty("lazy")) if (typeof message.lazy !== "boolean") return "lazy: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.weak != null && message.hasOwnProperty("weak")) if (typeof message.weak !== "boolean") return "weak: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.FieldOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.FieldOptions} FieldOptions */ FieldOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.FieldOptions) return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { case "STRING": case 0: message.ctype = 0; break; case "CORD": case 1: message.ctype = 1; break; case "STRING_PIECE": case 2: message.ctype = 2; break; } if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { case "JS_NORMAL": case 0: message.jstype = 0; break; case "JS_STRING": case 1: message.jstype = 1; break; case "JS_NUMBER": case 2: message.jstype = 2; break; } if (object.lazy != null) message.lazy = Boolean(object.lazy); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.weak != null) message.weak = Boolean(object.weak); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.FieldOptions * @static * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ FieldOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; object.packed = false; object.deprecated = false; object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this FieldOptions to JSON. * @function toJSON * @memberof google.protobuf.FieldOptions * @instance * @returns {Object.} JSON object */ FieldOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * CType enum. * @name google.protobuf.FieldOptions.CType * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value */ FieldOptions.CType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STRING"] = 0; values[valuesById[1] = "CORD"] = 1; values[valuesById[2] = "STRING_PIECE"] = 2; return values; })(); /** * JSType enum. * @name google.protobuf.FieldOptions.JSType * @enum {number} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value */ FieldOptions.JSType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "JS_NORMAL"] = 0; values[valuesById[1] = "JS_STRING"] = 1; values[valuesById[2] = "JS_NUMBER"] = 2; return values; })(); return FieldOptions; })(); protobuf.OneofOptions = (function() { /** * Properties of an OneofOptions. * @memberof google.protobuf * @interface IOneofOptions * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** * Constructs a new OneofOptions. * @memberof google.protobuf * @classdesc Represents an OneofOptions. * @implements IOneofOptions * @constructor * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ function OneofOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * OneofOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.OneofOptions * @instance */ OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new OneofOptions instance using the specified properties. * @function create * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions=} [properties] Properties to set * @returns {google.protobuf.OneofOptions} OneofOptions instance */ OneofOptions.create = function create(properties) { return new OneofOptions(properties); }; /** * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an OneofOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.OneofOptions} OneofOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an OneofOptions message. * @function verify * @memberof google.protobuf.OneofOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ OneofOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.OneofOptions} OneofOptions */ OneofOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.OneofOptions) return object; var message = new $root.google.protobuf.OneofOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.OneofOptions * @static * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ OneofOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this OneofOptions to JSON. * @function toJSON * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return OneofOptions; })(); protobuf.EnumOptions = (function() { /** * Properties of an EnumOptions. * @memberof google.protobuf * @interface IEnumOptions * @property {boolean|null} [allowAlias] EnumOptions allowAlias * @property {boolean|null} [deprecated] EnumOptions deprecated * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** * Constructs a new EnumOptions. * @memberof google.protobuf * @classdesc Represents an EnumOptions. * @implements IEnumOptions * @constructor * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ function EnumOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumOptions allowAlias. * @member {boolean} allowAlias * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.allowAlias = false; /** * EnumOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.deprecated = false; /** * EnumOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.EnumOptions * @instance */ EnumOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new EnumOptions instance using the specified properties. * @function create * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions=} [properties] Properties to set * @returns {google.protobuf.EnumOptions} EnumOptions instance */ EnumOptions.create = function create(properties) { return new EnumOptions(properties); }; /** * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: message.allowAlias = reader.bool(); break; case 3: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumOptions} EnumOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumOptions message. * @function verify * @memberof google.protobuf.EnumOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) if (typeof message.allowAlias !== "boolean") return "allowAlias: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumOptions} EnumOptions */ EnumOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumOptions) return object; var message = new $root.google.protobuf.EnumOptions(); if (object.allowAlias != null) message.allowAlias = Boolean(object.allowAlias); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumOptions * @static * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.allowAlias = false; object.deprecated = false; } if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) object.allowAlias = message.allowAlias; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this EnumOptions to JSON. * @function toJSON * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumOptions; })(); protobuf.EnumValueOptions = (function() { /** * Properties of an EnumValueOptions. * @memberof google.protobuf * @interface IEnumValueOptions * @property {boolean|null} [deprecated] EnumValueOptions deprecated * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** * Constructs a new EnumValueOptions. * @memberof google.protobuf * @classdesc Represents an EnumValueOptions. * @implements IEnumValueOptions * @constructor * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ function EnumValueOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * EnumValueOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.EnumValueOptions * @instance */ EnumValueOptions.prototype.deprecated = false; /** * EnumValueOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.EnumValueOptions * @instance */ EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** * Creates a new EnumValueOptions instance using the specified properties. * @function create * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ EnumValueOptions.create = function create(properties) { return new EnumValueOptions(properties); }; /** * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; }; /** * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.EnumValueOptions} EnumValueOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an EnumValueOptions message. * @function verify * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ EnumValueOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } return null; }; /** * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ EnumValueOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.EnumValueOptions) return object; var message = new $root.google.protobuf.EnumValueOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } return message; }; /** * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.EnumValueOptions * @static * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ EnumValueOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) object.deprecated = false; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } return object; }; /** * Converts this EnumValueOptions to JSON. * @function toJSON * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return EnumValueOptions; })(); protobuf.ServiceOptions = (function() { /** * Properties of a ServiceOptions. * @memberof google.protobuf * @interface IServiceOptions * @property {boolean|null} [deprecated] ServiceOptions deprecated * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes */ /** * Constructs a new ServiceOptions. * @memberof google.protobuf * @classdesc Represents a ServiceOptions. * @implements IServiceOptions * @constructor * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ function ServiceOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * ServiceOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype.deprecated = false; /** * ServiceOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** * ServiceOptions .google.api.defaultHost. * @member {string} .google.api.defaultHost * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** * ServiceOptions .google.api.oauthScopes. * @member {string} .google.api.oauthScopes * @memberof google.protobuf.ServiceOptions * @instance */ ServiceOptions.prototype[".google.api.oauthScopes"] = ""; /** * Creates a new ServiceOptions instance using the specified properties. * @function create * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions=} [properties] Properties to set * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ ServiceOptions.create = function create(properties) { return new ServiceOptions(properties); }; /** * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; /** * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 33: message.deprecated = reader.bool(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1049: message[".google.api.defaultHost"] = reader.string(); break; case 1050: message[".google.api.oauthScopes"] = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a ServiceOptions message. * @function verify * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ ServiceOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) if (!$util.isString(message[".google.api.defaultHost"])) return ".google.api.defaultHost: string expected"; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) if (!$util.isString(message[".google.api.oauthScopes"])) return ".google.api.oauthScopes: string expected"; return null; }; /** * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.ServiceOptions} ServiceOptions */ ServiceOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.ServiceOptions) return object; var message = new $root.google.protobuf.ServiceOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.api.defaultHost"] != null) message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); if (object[".google.api.oauthScopes"] != null) message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; /** * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.ServiceOptions * @static * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; if (options.defaults) { object.deprecated = false; object[".google.api.defaultHost"] = ""; object[".google.api.oauthScopes"] = ""; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; /** * Converts this ServiceOptions to JSON. * @function toJSON * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return ServiceOptions; })(); protobuf.MethodOptions = (function() { /** * Properties of a MethodOptions. * @memberof google.protobuf * @interface IMethodOptions * @property {boolean|null} [deprecated] MethodOptions deprecated * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature */ /** * Constructs a new MethodOptions. * @memberof google.protobuf * @classdesc Represents a MethodOptions. * @implements IMethodOptions * @constructor * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ function MethodOptions(properties) { this.uninterpretedOption = []; this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * MethodOptions deprecated. * @member {boolean} deprecated * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.deprecated = false; /** * MethodOptions idempotencyLevel. * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.idempotencyLevel = 0; /** * MethodOptions uninterpretedOption. * @member {Array.} uninterpretedOption * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** * MethodOptions .google.longrunning.operationInfo. * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.longrunning.operationInfo"] = null; /** * MethodOptions .google.api.http. * @member {google.api.IHttpRule|null|undefined} .google.api.http * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.api.http"] = null; /** * MethodOptions .google.api.methodSignature. * @member {Array.} .google.api.methodSignature * @memberof google.protobuf.MethodOptions * @instance */ MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** * Creates a new MethodOptions instance using the specified properties. * @function create * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions=} [properties] Properties to set * @returns {google.protobuf.MethodOptions} MethodOptions instance */ MethodOptions.create = function create(properties) { return new MethodOptions(properties); }; /** * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; /** * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a MethodOptions message from the specified reader or buffer. * @function decode * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 33: message.deprecated = reader.bool(); break; case 34: message.idempotencyLevel = reader.int32(); break; case 999: if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; case 1049: message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); break; case 72295728: message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; case 1051: if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) message[".google.api.methodSignature"] = []; message[".google.api.methodSignature"].push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a MethodOptions message. * @function verify * @memberof google.protobuf.MethodOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) switch (message.idempotencyLevel) { default: return "idempotencyLevel: enum value expected"; case 0: case 1: case 2: break; } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) return "uninterpretedOption." + error; } } if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); if (error) return ".google.longrunning.operationInfo." + error; } if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); if (error) return ".google.api.http." + error; } if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { if (!Array.isArray(message[".google.api.methodSignature"])) return ".google.api.methodSignature: array expected"; for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) if (!$util.isString(message[".google.api.methodSignature"][i])) return ".google.api.methodSignature: string[] expected"; } return null; }; /** * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object * @returns {google.protobuf.MethodOptions} MethodOptions */ MethodOptions.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.MethodOptions) return object; var message = new $root.google.protobuf.MethodOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; break; case "NO_SIDE_EFFECTS": case 1: message.idempotencyLevel = 1; break; case "IDEMPOTENT": case 2: message.idempotencyLevel = 2; break; } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } if (object[".google.longrunning.operationInfo"] != null) { if (typeof object[".google.longrunning.operationInfo"] !== "object") throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); } if (object[".google.api.http"] != null) { if (typeof object[".google.api.http"] !== "object") throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); } if (object[".google.api.methodSignature"]) { if (!Array.isArray(object[".google.api.methodSignature"])) throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); message[".google.api.methodSignature"] = []; for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } return message; }; /** * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.MethodOptions * @static * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; object[".google.api.methodSignature"] = []; } if (options.defaults) { object.deprecated = false; object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; object[".google.longrunning.operationInfo"] = null; object[".google.api.http"] = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { object[".google.api.methodSignature"] = []; for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; } if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; /** * Converts this MethodOptions to JSON. * @function toJSON * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel * @enum {number} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value */ MethodOptions.IdempotencyLevel = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; values[valuesById[2] = "IDEMPOTENT"] = 2; return values; })(); return MethodOptions; })(); protobuf.UninterpretedOption = (function() { /** * Properties of an UninterpretedOption. * @memberof google.protobuf * @interface IUninterpretedOption * @property {Array.|null} [name] UninterpretedOption name * @property {string|null} [identifierValue] UninterpretedOption identifierValue * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue * @property {number|null} [doubleValue] UninterpretedOption doubleValue * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue */ /** * Constructs a new UninterpretedOption. * @memberof google.protobuf * @classdesc Represents an UninterpretedOption. * @implements IUninterpretedOption * @constructor * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ function UninterpretedOption(properties) { this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * UninterpretedOption name. * @member {Array.} name * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.name = $util.emptyArray; /** * UninterpretedOption identifierValue. * @member {string} identifierValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.identifierValue = ""; /** * UninterpretedOption positiveIntValue. * @member {number|Long} positiveIntValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * UninterpretedOption negativeIntValue. * @member {number|Long} negativeIntValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * UninterpretedOption doubleValue. * @member {number} doubleValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.doubleValue = 0; /** * UninterpretedOption stringValue. * @member {Uint8Array} stringValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** * UninterpretedOption aggregateValue. * @member {string} aggregateValue * @memberof google.protobuf.UninterpretedOption * @instance */ UninterpretedOption.prototype.aggregateValue = ""; /** * Creates a new UninterpretedOption instance using the specified properties. * @function create * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ UninterpretedOption.create = function create(properties) { return new UninterpretedOption(properties); }; /** * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: if (!(message.name && message.name.length)) message.name = []; message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; case 3: message.identifierValue = reader.string(); break; case 4: message.positiveIntValue = reader.uint64(); break; case 5: message.negativeIntValue = reader.int64(); break; case 6: message.doubleValue = reader.double(); break; case 7: message.stringValue = reader.bytes(); break; case 8: message.aggregateValue = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an UninterpretedOption message. * @function verify * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UninterpretedOption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) { if (!Array.isArray(message.name)) return "name: array expected"; for (var i = 0; i < message.name.length; ++i) { var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); if (error) return "name." + error; } } if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) if (!$util.isString(message.identifierValue)) return "identifierValue: string expected"; if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) return "positiveIntValue: integer|Long expected"; if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) return "negativeIntValue: integer|Long expected"; if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; if (message.stringValue != null && message.hasOwnProperty("stringValue")) if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) return "stringValue: buffer expected"; if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) if (!$util.isString(message.aggregateValue)) return "aggregateValue: string expected"; return null; }; /** * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ UninterpretedOption.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.UninterpretedOption) return object; var message = new $root.google.protobuf.UninterpretedOption(); if (object.name) { if (!Array.isArray(object.name)) throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); message.name = []; for (var i = 0; i < object.name.length; ++i) { if (typeof object.name[i] !== "object") throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); } } if (object.identifierValue != null) message.identifierValue = String(object.identifierValue); if (object.positiveIntValue != null) if ($util.Long) (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; else if (typeof object.positiveIntValue === "string") message.positiveIntValue = parseInt(object.positiveIntValue, 10); else if (typeof object.positiveIntValue === "number") message.positiveIntValue = object.positiveIntValue; else if (typeof object.positiveIntValue === "object") message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); if (object.negativeIntValue != null) if ($util.Long) (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; else if (typeof object.negativeIntValue === "string") message.negativeIntValue = parseInt(object.negativeIntValue, 10); else if (typeof object.negativeIntValue === "number") message.negativeIntValue = object.negativeIntValue; else if (typeof object.negativeIntValue === "object") message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); if (object.doubleValue != null) message.doubleValue = Number(object.doubleValue); if (object.stringValue != null) if (typeof object.stringValue === "string") $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); else if (object.stringValue.length) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); return message; }; /** * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.UninterpretedOption * @static * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.name = []; if (options.defaults) { object.identifierValue = ""; if ($util.Long) { var long = new $util.Long(0, 0, true); object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.positiveIntValue = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.negativeIntValue = options.longs === String ? "0" : 0; object.doubleValue = 0; if (options.bytes === String) object.stringValue = ""; else { object.stringValue = []; if (options.bytes !== Array) object.stringValue = $util.newBuffer(object.stringValue); } object.aggregateValue = ""; } if (message.name && message.name.length) { object.name = []; for (var j = 0; j < message.name.length; ++j) object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); } if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) object.identifierValue = message.identifierValue; if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) if (typeof message.positiveIntValue === "number") object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; else object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) if (typeof message.negativeIntValue === "number") object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; else object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; if (message.stringValue != null && message.hasOwnProperty("stringValue")) object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) object.aggregateValue = message.aggregateValue; return object; }; /** * Converts this UninterpretedOption to JSON. * @function toJSON * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; UninterpretedOption.NamePart = (function() { /** * Properties of a NamePart. * @memberof google.protobuf.UninterpretedOption * @interface INamePart * @property {string} namePart NamePart namePart * @property {boolean} isExtension NamePart isExtension */ /** * Constructs a new NamePart. * @memberof google.protobuf.UninterpretedOption * @classdesc Represents a NamePart. * @implements INamePart * @constructor * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set */ function NamePart(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * NamePart namePart. * @member {string} namePart * @memberof google.protobuf.UninterpretedOption.NamePart * @instance */ NamePart.prototype.namePart = ""; /** * NamePart isExtension. * @member {boolean} isExtension * @memberof google.protobuf.UninterpretedOption.NamePart * @instance */ NamePart.prototype.isExtension = false; /** * Creates a new NamePart instance using the specified properties. * @function create * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance */ NamePart.create = function create(properties) { return new NamePart(properties); }; /** * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encode * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NamePart.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); return writer; }; /** * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ NamePart.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a NamePart message from the specified reader or buffer. * @function decode * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NamePart.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.namePart = reader.string(); break; case 2: message.isExtension = reader.bool(); break; default: reader.skipType(tag & 7); break; } } if (!message.hasOwnProperty("namePart")) throw $util.ProtocolError("missing required 'namePart'", { instance: message }); if (!message.hasOwnProperty("isExtension")) throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; /** * Decodes a NamePart message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ NamePart.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a NamePart message. * @function verify * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ NamePart.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (!$util.isString(message.namePart)) return "namePart: string expected"; if (typeof message.isExtension !== "boolean") return "isExtension: boolean expected"; return null; }; /** * Creates a NamePart message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} object Plain object * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart */ NamePart.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) return object; var message = new $root.google.protobuf.UninterpretedOption.NamePart(); if (object.namePart != null) message.namePart = String(object.namePart); if (object.isExtension != null) message.isExtension = Boolean(object.isExtension); return message; }; /** * Creates a plain object from a NamePart message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ NamePart.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.namePart = ""; object.isExtension = false; } if (message.namePart != null && message.hasOwnProperty("namePart")) object.namePart = message.namePart; if (message.isExtension != null && message.hasOwnProperty("isExtension")) object.isExtension = message.isExtension; return object; }; /** * Converts this NamePart to JSON. * @function toJSON * @memberof google.protobuf.UninterpretedOption.NamePart * @instance * @returns {Object.} JSON object */ NamePart.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return NamePart; })(); return UninterpretedOption; })(); protobuf.SourceCodeInfo = (function() { /** * Properties of a SourceCodeInfo. * @memberof google.protobuf * @interface ISourceCodeInfo * @property {Array.|null} [location] SourceCodeInfo location */ /** * Constructs a new SourceCodeInfo. * @memberof google.protobuf * @classdesc Represents a SourceCodeInfo. * @implements ISourceCodeInfo * @constructor * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ function SourceCodeInfo(properties) { this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SourceCodeInfo location. * @member {Array.} location * @memberof google.protobuf.SourceCodeInfo * @instance */ SourceCodeInfo.prototype.location = $util.emptyArray; /** * Creates a new SourceCodeInfo instance using the specified properties. * @function create * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ SourceCodeInfo.create = function create(properties) { return new SourceCodeInfo(properties); }; /** * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.location != null && message.location.length) for (var i = 0; i < message.location.length; ++i) $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.location && message.location.length)) message.location = []; message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SourceCodeInfo message. * @function verify * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SourceCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.location != null && message.hasOwnProperty("location")) { if (!Array.isArray(message.location)) return "location: array expected"; for (var i = 0; i < message.location.length; ++i) { var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); if (error) return "location." + error; } } return null; }; /** * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ SourceCodeInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; var message = new $root.google.protobuf.SourceCodeInfo(); if (object.location) { if (!Array.isArray(object.location)) throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); message.location = []; for (var i = 0; i < object.location.length; ++i) { if (typeof object.location[i] !== "object") throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); } } return message; }; /** * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.SourceCodeInfo * @static * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.location = []; if (message.location && message.location.length) { object.location = []; for (var j = 0; j < message.location.length; ++j) object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); } return object; }; /** * Converts this SourceCodeInfo to JSON. * @function toJSON * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; SourceCodeInfo.Location = (function() { /** * Properties of a Location. * @memberof google.protobuf.SourceCodeInfo * @interface ILocation * @property {Array.|null} [path] Location path * @property {Array.|null} [span] Location span * @property {string|null} [leadingComments] Location leadingComments * @property {string|null} [trailingComments] Location trailingComments * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments */ /** * Constructs a new Location. * @memberof google.protobuf.SourceCodeInfo * @classdesc Represents a Location. * @implements ILocation * @constructor * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ function Location(properties) { this.path = []; this.span = []; this.leadingDetachedComments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Location path. * @member {Array.} path * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.path = $util.emptyArray; /** * Location span. * @member {Array.} span * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.span = $util.emptyArray; /** * Location leadingComments. * @member {string} leadingComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.leadingComments = ""; /** * Location trailingComments. * @member {string} trailingComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.trailingComments = ""; /** * Location leadingDetachedComments. * @member {Array.} leadingDetachedComments * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ Location.prototype.leadingDetachedComments = $util.emptyArray; /** * Creates a new Location instance using the specified properties. * @function create * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ Location.create = function create(properties) { return new Location(properties); }; /** * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encode * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } if (message.span != null && message.span.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); for (var i = 0; i < message.span.length; ++i) writer.int32(message.span[i]); writer.ldelim(); } if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); return writer; }; /** * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Location message from the specified reader or buffer. * @function decode * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.path && message.path.length)) message.path = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.path.push(reader.int32()); } else message.path.push(reader.int32()); break; case 2: if (!(message.span && message.span.length)) message.span = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.span.push(reader.int32()); } else message.span.push(reader.int32()); break; case 3: message.leadingComments = reader.string(); break; case 4: message.trailingComments = reader.string(); break; case 6: if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) message.leadingDetachedComments = []; message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Location message. * @function verify * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Location.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { if (!Array.isArray(message.path)) return "path: array expected"; for (var i = 0; i < message.path.length; ++i) if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } if (message.span != null && message.hasOwnProperty("span")) { if (!Array.isArray(message.span)) return "span: array expected"; for (var i = 0; i < message.span.length; ++i) if (!$util.isInteger(message.span[i])) return "span: integer[] expected"; } if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) if (!$util.isString(message.leadingComments)) return "leadingComments: string expected"; if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) if (!$util.isString(message.trailingComments)) return "trailingComments: string expected"; if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { if (!Array.isArray(message.leadingDetachedComments)) return "leadingDetachedComments: array expected"; for (var i = 0; i < message.leadingDetachedComments.length; ++i) if (!$util.isString(message.leadingDetachedComments[i])) return "leadingDetachedComments: string[] expected"; } return null; }; /** * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} object Plain object * @returns {google.protobuf.SourceCodeInfo.Location} Location */ Location.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; var message = new $root.google.protobuf.SourceCodeInfo.Location(); if (object.path) { if (!Array.isArray(object.path)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } if (object.span) { if (!Array.isArray(object.span)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); message.span = []; for (var i = 0; i < object.span.length; ++i) message.span[i] = object.span[i] | 0; } if (object.leadingComments != null) message.leadingComments = String(object.leadingComments); if (object.trailingComments != null) message.trailingComments = String(object.trailingComments); if (object.leadingDetachedComments) { if (!Array.isArray(object.leadingDetachedComments)) throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); message.leadingDetachedComments = []; for (var i = 0; i < object.leadingDetachedComments.length; ++i) message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); } return message; }; /** * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {google.protobuf.SourceCodeInfo.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { object.path = []; object.span = []; object.leadingDetachedComments = []; } if (options.defaults) { object.leadingComments = ""; object.trailingComments = ""; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } if (message.span && message.span.length) { object.span = []; for (var j = 0; j < message.span.length; ++j) object.span[j] = message.span[j]; } if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) object.leadingComments = message.leadingComments; if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) object.trailingComments = message.trailingComments; if (message.leadingDetachedComments && message.leadingDetachedComments.length) { object.leadingDetachedComments = []; for (var j = 0; j < message.leadingDetachedComments.length; ++j) object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; } return object; }; /** * Converts this Location to JSON. * @function toJSON * @memberof google.protobuf.SourceCodeInfo.Location * @instance * @returns {Object.} JSON object */ Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Location; })(); return SourceCodeInfo; })(); protobuf.GeneratedCodeInfo = (function() { /** * Properties of a GeneratedCodeInfo. * @memberof google.protobuf * @interface IGeneratedCodeInfo * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf * @classdesc Represents a GeneratedCodeInfo. * @implements IGeneratedCodeInfo * @constructor * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ function GeneratedCodeInfo(properties) { this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * GeneratedCodeInfo annotation. * @member {Array.} annotation * @memberof google.protobuf.GeneratedCodeInfo * @instance */ GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ GeneratedCodeInfo.create = function create(properties) { return new GeneratedCodeInfo(properties); }; /** * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.annotation != null && message.annotation.length) for (var i = 0; i < message.annotation.length; ++i) $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.annotation && message.annotation.length)) message.annotation = []; message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a GeneratedCodeInfo message. * @function verify * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GeneratedCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.annotation != null && message.hasOwnProperty("annotation")) { if (!Array.isArray(message.annotation)) return "annotation: array expected"; for (var i = 0; i < message.annotation.length; ++i) { var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); if (error) return "annotation." + error; } } return null; }; /** * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ GeneratedCodeInfo.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; var message = new $root.google.protobuf.GeneratedCodeInfo(); if (object.annotation) { if (!Array.isArray(object.annotation)) throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); message.annotation = []; for (var i = 0; i < object.annotation.length; ++i) { if (typeof object.annotation[i] !== "object") throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); } } return message; }; /** * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ GeneratedCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.annotation = []; if (message.annotation && message.annotation.length) { object.annotation = []; for (var j = 0; j < message.annotation.length; ++j) object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); } return object; }; /** * Converts this GeneratedCodeInfo to JSON. * @function toJSON * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; GeneratedCodeInfo.Annotation = (function() { /** * Properties of an Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @interface IAnnotation * @property {Array.|null} [path] Annotation path * @property {string|null} [sourceFile] Annotation sourceFile * @property {number|null} [begin] Annotation begin * @property {number|null} [end] Annotation end */ /** * Constructs a new Annotation. * @memberof google.protobuf.GeneratedCodeInfo * @classdesc Represents an Annotation. * @implements IAnnotation * @constructor * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set */ function Annotation(properties) { this.path = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Annotation path. * @member {Array.} path * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.path = $util.emptyArray; /** * Annotation sourceFile. * @member {string} sourceFile * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.sourceFile = ""; /** * Annotation begin. * @member {number} begin * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.begin = 0; /** * Annotation end. * @member {number} end * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ Annotation.prototype.end = 0; /** * Creates a new Annotation instance using the specified properties. * @function create * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance */ Annotation.create = function create(properties) { return new Annotation(properties); }; /** * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encode * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; /** * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Annotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Annotation message from the specified reader or buffer. * @function decode * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Annotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: if (!(message.path && message.path.length)) message.path = []; if ((tag & 7) === 2) { var end2 = reader.uint32() + reader.pos; while (reader.pos < end2) message.path.push(reader.int32()); } else message.path.push(reader.int32()); break; case 2: message.sourceFile = reader.string(); break; case 3: message.begin = reader.int32(); break; case 4: message.end = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Annotation message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Annotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Annotation message. * @function verify * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Annotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { if (!Array.isArray(message.path)) return "path: array expected"; for (var i = 0; i < message.path.length; ++i) if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) if (!$util.isString(message.sourceFile)) return "sourceFile: string expected"; if (message.begin != null && message.hasOwnProperty("begin")) if (!$util.isInteger(message.begin)) return "begin: integer expected"; if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; }; /** * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} object Plain object * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation */ Annotation.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) return object; var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); if (object.path) { if (!Array.isArray(object.path)) throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); message.path = []; for (var i = 0; i < object.path.length; ++i) message.path[i] = object.path[i] | 0; } if (object.sourceFile != null) message.sourceFile = String(object.sourceFile); if (object.begin != null) message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; return message; }; /** * Creates a plain object from an Annotation message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Annotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.path = []; if (options.defaults) { object.sourceFile = ""; object.begin = 0; object.end = 0; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) object.sourceFile = message.sourceFile; if (message.begin != null && message.hasOwnProperty("begin")) object.begin = message.begin; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; return object; }; /** * Converts this Annotation to JSON. * @function toJSON * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance * @returns {Object.} JSON object */ Annotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Annotation; })(); return GeneratedCodeInfo; })(); protobuf.Any = (function() { /** * Properties of an Any. * @memberof google.protobuf * @interface IAny * @property {string|null} [type_url] Any type_url * @property {Uint8Array|null} [value] Any value */ /** * Constructs a new Any. * @memberof google.protobuf * @classdesc Represents an Any. * @implements IAny * @constructor * @param {google.protobuf.IAny=} [properties] Properties to set */ function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Any type_url. * @member {string} type_url * @memberof google.protobuf.Any * @instance */ Any.prototype.type_url = ""; /** * Any value. * @member {Uint8Array} value * @memberof google.protobuf.Any * @instance */ Any.prototype.value = $util.newBuffer([]); /** * Creates a new Any instance using the specified properties. * @function create * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny=} [properties] Properties to set * @returns {google.protobuf.Any} Any instance */ Any.create = function create(properties) { return new Any(properties); }; /** * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; /** * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Any * @static * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Any message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.type_url = reader.string(); break; case 2: message.value = reader.bytes(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Any message. * @function verify * @memberof google.protobuf.Any * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Any.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.type_url != null && message.hasOwnProperty("type_url")) if (!$util.isString(message.type_url)) return "type_url: string expected"; if (message.value != null && message.hasOwnProperty("value")) if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) return "value: buffer expected"; return null; }; /** * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object * @returns {google.protobuf.Any} Any */ Any.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Any) return object; var message = new $root.google.protobuf.Any(); if (object.type_url != null) message.type_url = String(object.type_url); if (object.value != null) if (typeof object.value === "string") $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); else if (object.value.length) message.value = object.value; return message; }; /** * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Any * @static * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Any.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.type_url = ""; if (options.bytes === String) object.value = ""; else { object.value = []; if (options.bytes !== Array) object.value = $util.newBuffer(object.value); } } if (message.type_url != null && message.hasOwnProperty("type_url")) object.type_url = message.type_url; if (message.value != null && message.hasOwnProperty("value")) object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** * Converts this Any to JSON. * @function toJSON * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Any; })(); protobuf.Duration = (function() { /** * Properties of a Duration. * @memberof google.protobuf * @interface IDuration * @property {number|Long|null} [seconds] Duration seconds * @property {number|null} [nanos] Duration nanos */ /** * Constructs a new Duration. * @memberof google.protobuf * @classdesc Represents a Duration. * @implements IDuration * @constructor * @param {google.protobuf.IDuration=} [properties] Properties to set */ function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Duration seconds. * @member {number|Long} seconds * @memberof google.protobuf.Duration * @instance */ Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Duration nanos. * @member {number} nanos * @memberof google.protobuf.Duration * @instance */ Duration.prototype.nanos = 0; /** * Creates a new Duration instance using the specified properties. * @function create * @memberof google.protobuf.Duration * @static * @param {google.protobuf.IDuration=} [properties] Properties to set * @returns {google.protobuf.Duration} Duration instance */ Duration.create = function create(properties) { return new Duration(properties); }; /** * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode * @memberof google.protobuf.Duration * @static * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Duration * @static * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Duration message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Duration.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.seconds = reader.int64(); break; case 2: message.nanos = reader.int32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Duration message. * @function verify * @memberof google.protobuf.Duration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Duration.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.seconds != null && message.hasOwnProperty("seconds")) if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) return "seconds: integer|Long expected"; if (message.nanos != null && message.hasOwnProperty("nanos")) if (!$util.isInteger(message.nanos)) return "nanos: integer expected"; return null; }; /** * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object * @returns {google.protobuf.Duration} Duration */ Duration.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Duration) return object; var message = new $root.google.protobuf.Duration(); if (object.seconds != null) if ($util.Long) (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; else if (typeof object.seconds === "string") message.seconds = parseInt(object.seconds, 10); else if (typeof object.seconds === "number") message.seconds = object.seconds; else if (typeof object.seconds === "object") message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); if (object.nanos != null) message.nanos = object.nanos | 0; return message; }; /** * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Duration * @static * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.seconds = options.longs === String ? "0" : 0; object.nanos = 0; } if (message.seconds != null && message.hasOwnProperty("seconds")) if (typeof message.seconds === "number") object.seconds = options.longs === String ? String(message.seconds) : message.seconds; else object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; if (message.nanos != null && message.hasOwnProperty("nanos")) object.nanos = message.nanos; return object; }; /** * Converts this Duration to JSON. * @function toJSON * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Duration; })(); protobuf.Empty = (function() { /** * Properties of an Empty. * @memberof google.protobuf * @interface IEmpty */ /** * Constructs a new Empty. * @memberof google.protobuf * @classdesc Represents an Empty. * @implements IEmpty * @constructor * @param {google.protobuf.IEmpty=} [properties] Properties to set */ function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Creates a new Empty instance using the specified properties. * @function create * @memberof google.protobuf.Empty * @static * @param {google.protobuf.IEmpty=} [properties] Properties to set * @returns {google.protobuf.Empty} Empty instance */ Empty.create = function create(properties) { return new Empty(properties); }; /** * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode * @memberof google.protobuf.Empty * @static * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited * @memberof google.protobuf.Empty * @static * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes an Empty message from the specified reader or buffer. * @function decode * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Empty.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies an Empty message. * @function verify * @memberof google.protobuf.Empty * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Empty.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object * @returns {google.protobuf.Empty} Empty */ Empty.fromObject = function fromObject(object) { if (object instanceof $root.google.protobuf.Empty) return object; return new $root.google.protobuf.Empty(); }; /** * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject * @memberof google.protobuf.Empty * @static * @param {google.protobuf.Empty} message Empty * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Empty.toObject = function toObject() { return {}; }; /** * Converts this Empty to JSON. * @function toJSON * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Empty; })(); return protobuf; })(); google.rpc = (function() { /** * Namespace rpc. * @memberof google * @namespace */ var rpc = {}; rpc.Status = (function() { /** * Properties of a Status. * @memberof google.rpc * @interface IStatus * @property {number|null} [code] Status code * @property {string|null} [message] Status message * @property {Array.|null} [details] Status details */ /** * Constructs a new Status. * @memberof google.rpc * @classdesc Represents a Status. * @implements IStatus * @constructor * @param {google.rpc.IStatus=} [properties] Properties to set */ function Status(properties) { this.details = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * Status code. * @member {number} code * @memberof google.rpc.Status * @instance */ Status.prototype.code = 0; /** * Status message. * @member {string} message * @memberof google.rpc.Status * @instance */ Status.prototype.message = ""; /** * Status details. * @member {Array.} details * @memberof google.rpc.Status * @instance */ Status.prototype.details = $util.emptyArray; /** * Creates a new Status instance using the specified properties. * @function create * @memberof google.rpc.Status * @static * @param {google.rpc.IStatus=} [properties] Properties to set * @returns {google.rpc.Status} Status instance */ Status.create = function create(properties) { return new Status(properties); }; /** * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encode * @memberof google.rpc.Status * @static * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.details != null && message.details.length) for (var i = 0; i < message.details.length; ++i) $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encodeDelimited * @memberof google.rpc.Status * @static * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ Status.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a Status message from the specified reader or buffer. * @function decode * @memberof google.rpc.Status * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {google.rpc.Status} Status * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Status.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.code = reader.int32(); break; case 2: message.message = reader.string(); break; case 3: if (!(message.details && message.details.length)) message.details = []; message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a Status message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof google.rpc.Status * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {google.rpc.Status} Status * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Status.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a Status message. * @function verify * @memberof google.rpc.Status * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Status.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.code != null && message.hasOwnProperty("code")) if (!$util.isInteger(message.code)) return "code: integer expected"; if (message.message != null && message.hasOwnProperty("message")) if (!$util.isString(message.message)) return "message: string expected"; if (message.details != null && message.hasOwnProperty("details")) { if (!Array.isArray(message.details)) return "details: array expected"; for (var i = 0; i < message.details.length; ++i) { var error = $root.google.protobuf.Any.verify(message.details[i]); if (error) return "details." + error; } } return null; }; /** * Creates a Status message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.rpc.Status * @static * @param {Object.} object Plain object * @returns {google.rpc.Status} Status */ Status.fromObject = function fromObject(object) { if (object instanceof $root.google.rpc.Status) return object; var message = new $root.google.rpc.Status(); if (object.code != null) message.code = object.code | 0; if (object.message != null) message.message = String(object.message); if (object.details) { if (!Array.isArray(object.details)) throw TypeError(".google.rpc.Status.details: array expected"); message.details = []; for (var i = 0; i < object.details.length; ++i) { if (typeof object.details[i] !== "object") throw TypeError(".google.rpc.Status.details: object expected"); message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); } } return message; }; /** * Creates a plain object from a Status message. Also converts values to other types if specified. * @function toObject * @memberof google.rpc.Status * @static * @param {google.rpc.Status} message Status * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Status.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.details = []; if (options.defaults) { object.code = 0; object.message = ""; } if (message.code != null && message.hasOwnProperty("code")) object.code = message.code; if (message.message != null && message.hasOwnProperty("message")) object.message = message.message; if (message.details && message.details.length) { object.details = []; for (var j = 0; j < message.details.length; ++j) object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); } return object; }; /** * Converts this Status to JSON. * @function toJSON * @memberof google.rpc.Status * @instance * @returns {Object.} JSON object */ Status.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; return Status; })(); return rpc; })(); return google; })(); return $root; }); /***/ }), /***/ 55398: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createAPICaller = void 0; const normalApiCaller_1 = __webpack_require__(56513); function createAPICaller(settings, descriptor) { if (!descriptor) { return new normalApiCaller_1.NormalApiCaller(); } return descriptor.getApiCaller(settings); } exports.createAPICaller = createAPICaller; //# sourceMappingURL=apiCaller.js.map /***/ }), /***/ 41283: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BundleApiCaller = void 0; const call_1 = __webpack_require__(53047); const googleError_1 = __webpack_require__(6634); /** * An implementation of APICaller for bundled calls. * Uses BundleExecutor to do bundling. */ class BundleApiCaller { constructor(bundler) { this.bundler = bundler; } init(callback) { if (callback) { return new call_1.OngoingCall(callback); } return new call_1.OngoingCallPromise(); } wrap(func) { return func; } call(apiCall, argument, settings, status) { if (!settings.isBundling) { throw new googleError_1.GoogleError('Bundling enabled with no isBundling!'); } status.call((argument, callback) => { this.bundler.schedule(apiCall, argument, callback); return status; }, argument); } fail(canceller, err) { canceller.callback(err); } result(canceller) { return canceller.promise; } } exports.BundleApiCaller = BundleApiCaller; //# sourceMappingURL=bundleApiCaller.js.map /***/ }), /***/ 94847: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BundleDescriptor = void 0; const normalApiCaller_1 = __webpack_require__(56513); const bundleApiCaller_1 = __webpack_require__(41283); const bundleExecutor_1 = __webpack_require__(59491); const util_1 = __webpack_require__(26969); /** * A descriptor for calls that can be bundled into one call. */ class BundleDescriptor { /** * Describes the structure of bundled call. * * requestDiscriminatorFields may include '.' as a separator, which is used to * indicate object traversal. This allows fields in nested objects to be used * to determine what request to bundle. * * @property {String} bundledField * @property {String} requestDiscriminatorFields * @property {String} subresponseField * @property {Function} byteLengthFunction * * @param {String} bundledField - the repeated field in the request message * that will have its elements aggregated by bundling. * @param {String} requestDiscriminatorFields - a list of fields in the * target request message class that are used to detemrine which request * messages should be bundled together. * @param {String} subresponseField - an optional field, when present it * indicates the field in the response message that should be used to * demultiplex the response into multiple response messages. * @param {Function} byteLengthFunction - a function to obtain the byte * length to be consumed for the bundled field messages. Because Node.JS * protobuf.js/gRPC uses builtin Objects for the user-visible data and * internally they are encoded/decoded in protobuf manner, this function * is actually necessary to calculate the byte length. * @constructor */ constructor(bundledField, requestDiscriminatorFields, subresponseField, byteLengthFunction) { if (!byteLengthFunction && typeof subresponseField === 'function') { byteLengthFunction = subresponseField; subresponseField = null; } this.bundledField = bundledField; this.requestDiscriminatorFields = requestDiscriminatorFields.map(util_1.snakeToCamelCase); this.subresponseField = subresponseField; this.byteLengthFunction = byteLengthFunction; } getApiCaller(settings) { if (settings.isBundling === false) { return new normalApiCaller_1.NormalApiCaller(); } return new bundleApiCaller_1.BundleApiCaller(new bundleExecutor_1.BundleExecutor(settings.bundleOptions, this)); } } exports.BundleDescriptor = BundleDescriptor; //# sourceMappingURL=bundleDescriptor.js.map /***/ }), /***/ 59491: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BundleExecutor = void 0; const status_1 = __webpack_require__(53501); const googleError_1 = __webpack_require__(6634); const warnings_1 = __webpack_require__(16328); const bundlingUtils_1 = __webpack_require__(16255); const task_1 = __webpack_require__(43302); function noop() { } /** * BundleExecutor stores several timers for each bundle (calls are bundled based * on the options passed, each bundle has unique ID that is calculated based on * field values). Each timer fires and sends a call after certain amount of * time, and if a new request comes to the same bundle, the timer can be * restarted. */ class BundleExecutor { /** * Organizes requests for an api service that requires to bundle them. * * @param {BundleOptions} bundleOptions - configures strategy this instance * uses when executing bundled functions. * @param {BundleDescriptor} bundleDescriptor - the description of the bundling. * @constructor */ constructor(bundleOptions, bundleDescriptor) { this._options = bundleOptions; this._descriptor = bundleDescriptor; this._tasks = {}; this._timers = {}; this._invocations = {}; this._invocationId = 0; } /** * Schedule a method call. * * @param {function} apiCall - the function for an API call. * @param {Object} request - the request object to be bundled with others. * @param {APICallback} callback - the callback to be called when the method finished. * @return {function()} - the function to cancel the scheduled invocation. */ schedule(apiCall, request, callback) { const bundleId = bundlingUtils_1.computeBundleId(request, this._descriptor.requestDiscriminatorFields); callback = (callback || noop); if (bundleId === undefined) { warnings_1.warn('bundling_schedule_bundleid_undefined', 'The request does not have enough information for request bundling. ' + `Invoking immediately. Request: ${JSON.stringify(request)} ` + `discriminator fields: ${this._descriptor.requestDiscriminatorFields}`); return apiCall(request, callback); } if (request[this._descriptor.bundledField] === undefined) { warnings_1.warn('bundling_no_bundled_field', `Request does not contain field ${this._descriptor.bundledField} that must present for bundling. ` + `Invoking immediately. Request: ${JSON.stringify(request)}`); return apiCall(request, callback); } if (!(bundleId in this._tasks)) { this._tasks[bundleId] = new task_1.Task(apiCall, request, this._descriptor.bundledField, this._descriptor.subresponseField); } let task = this._tasks[bundleId]; callback.id = String(this._invocationId++); this._invocations[callback.id] = bundleId; const bundledField = request[this._descriptor.bundledField]; const elementCount = bundledField.length; let requestBytes = 0; // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; bundledField.forEach(obj => { requestBytes += this._descriptor.byteLengthFunction(obj); }); const countLimit = this._options.elementCountLimit || 0; const byteLimit = this._options.requestByteLimit || 0; if ((countLimit > 0 && elementCount > countLimit) || (byteLimit > 0 && requestBytes >= byteLimit)) { let message; if (countLimit > 0 && elementCount > countLimit) { message = 'The number of elements ' + elementCount + ' exceeds the limit ' + this._options.elementCountLimit; } else { message = 'The required bytes ' + requestBytes + ' exceeds the limit ' + this._options.requestByteLimit; } const error = new googleError_1.GoogleError(message); error.code = status_1.Status.INVALID_ARGUMENT; callback(error); return { cancel: noop, }; } const existingCount = task.getElementCount(); const existingBytes = task.getRequestByteSize(); if ((countLimit > 0 && elementCount + existingCount >= countLimit) || (byteLimit > 0 && requestBytes + existingBytes >= byteLimit)) { this._runNow(bundleId); this._tasks[bundleId] = new task_1.Task(apiCall, request, this._descriptor.bundledField, this._descriptor.subresponseField); task = this._tasks[bundleId]; } task.extend(bundledField, requestBytes, callback); const ret = { cancel() { self._cancel(callback.id); }, }; const countThreshold = this._options.elementCountThreshold || 0; const sizeThreshold = this._options.requestByteThreshold || 0; if ((countThreshold > 0 && task.getElementCount() >= countThreshold) || (sizeThreshold > 0 && task.getRequestByteSize() >= sizeThreshold)) { this._runNow(bundleId); return ret; } if (!(bundleId in this._timers) && this._options.delayThreshold > 0) { this._timers[bundleId] = setTimeout(() => { delete this._timers[bundleId]; this._runNow(bundleId); }, this._options.delayThreshold); } return ret; } /** * Clears scheduled timeout if it exists. * * @param {String} bundleId - the id for the task whose timeout needs to be * cleared. * @private */ _maybeClearTimeout(bundleId) { if (bundleId in this._timers) { const timerId = this._timers[bundleId]; delete this._timers[bundleId]; clearTimeout(timerId); } } /** * Cancels an event. * * @param {String} id - The id for the event in the task. * @private */ _cancel(id) { if (!(id in this._invocations)) { return; } const bundleId = this._invocations[id]; if (!(bundleId in this._tasks)) { return; } const task = this._tasks[bundleId]; delete this._invocations[id]; if (task.cancel(id)) { this._maybeClearTimeout(bundleId); delete this._tasks[bundleId]; } } /** * Invokes a task. * * @param {String} bundleId - The id for the task. * @private */ _runNow(bundleId) { if (!(bundleId in this._tasks)) { warnings_1.warn('bundle_runnow_bundleid_unknown', `No such bundleid: ${bundleId}`); return; } this._maybeClearTimeout(bundleId); const task = this._tasks[bundleId]; delete this._tasks[bundleId]; task.run().forEach(id => { delete this._invocations[id]; }); } } exports.BundleExecutor = BundleExecutor; //# sourceMappingURL=bundleExecutor.js.map /***/ }), /***/ 16255: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.computeBundleId = void 0; /** * Compute the identifier of the `obj`. The objects of the same ID * will be bundled together. * * @param {RequestType} obj - The request object. * @param {String[]} discriminatorFields - The array of field names. * A field name may include '.' as a separator, which is used to * indicate object traversal. * @return {String|undefined} - the identifier string, or undefined if any * discriminator fields do not exist. */ function computeBundleId(obj, discriminatorFields) { const ids = []; let hasIds = false; for (const field of discriminatorFields) { const id = at(obj, field); if (id === undefined) { ids.push(null); } else { hasIds = true; ids.push(id); } } if (!hasIds) { return undefined; } return JSON.stringify(ids); } exports.computeBundleId = computeBundleId; /** * Given an object field path that may contain dots, dig into the obj and find * the value at the given path. * @example * const obj = { * a: { * b: 5 * } * } * const id = at(obj, 'a.b'); * // id = 5 * @param field Path to the property with `.` notation * @param obj The object to traverse * @returns the value at the given path */ function at(obj, field) { const pathParts = field.split('.'); // eslint-disable-next-line @typescript-eslint/no-explicit-any let currentObj = obj; for (const pathPart of pathParts) { currentObj = currentObj === null || currentObj === void 0 ? void 0 : currentObj[pathPart]; } return currentObj; } //# sourceMappingURL=bundlingUtils.js.map /***/ }), /***/ 43302: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Task = exports.deepCopyForResponse = void 0; const status_1 = __webpack_require__(53501); const googleError_1 = __webpack_require__(6634); /** * Creates a deep copy of the object with the consideration of subresponse * fields for bundling. * * @param {Object} obj - The source object. * @param {Object?} subresponseInfo - The information to copy the subset of * the field for the response. Do nothing if it's null. * @param {String} subresponseInfo.field - The field name. * @param {number} subresponseInfo.start - The offset where the copying * element should starts with. * @param {number} subresponseInfo.end - The ending index where the copying * region of the elements ends. * @return {Object} The copied object. * @private */ function deepCopyForResponse( // eslint-disable-next-line @typescript-eslint/no-explicit-any obj, subresponseInfo) { // eslint-disable-next-line @typescript-eslint/no-explicit-any let result; if (obj === null) { return null; } if (obj === undefined) { return undefined; } if (Array.isArray(obj)) { result = []; obj.forEach(element => { result.push(deepCopyForResponse(element, null)); }); return result; } // Some objects (such as ByteBuffer) have copy method. if (obj.copy !== undefined) { return obj.copy(); } // ArrayBuffer should be copied through slice(). if (obj instanceof ArrayBuffer) { return obj.slice(0); } if (typeof obj === 'object') { result = {}; Object.keys(obj).forEach(key => { if (subresponseInfo && key === subresponseInfo.field && Array.isArray(obj[key])) { // Note that subresponses are not deep-copied. This is safe because // those subresponses are not shared among callbacks. result[key] = obj[key].slice(subresponseInfo.start, subresponseInfo.end); } else { result[key] = deepCopyForResponse(obj[key], null); } }); return result; } return obj; } exports.deepCopyForResponse = deepCopyForResponse; class Task { /** * A task coordinates the execution of a single bundle. * * @param {function} apiCall - The function to conduct calling API. * @param {Object} bundlingRequest - The base request object to be used * for the actual API call. * @param {string} bundledField - The name of the field in bundlingRequest * to be bundled. * @param {string=} subresponseField - The name of the field in the response * to be passed to the callback. * @constructor * @private */ constructor(apiCall, bundlingRequest, bundledField, subresponseField) { this._apiCall = apiCall; this._request = bundlingRequest; this._bundledField = bundledField; this._subresponseField = subresponseField; this._data = []; } /** * Returns the number of elements in a task. * @return {number} The number of elements. */ getElementCount() { let count = 0; for (let i = 0; i < this._data.length; ++i) { count += this._data[i].elements.length; } return count; } /** * Returns the total byte size of the elements in a task. * @return {number} The byte size. */ getRequestByteSize() { let size = 0; for (let i = 0; i < this._data.length; ++i) { size += this._data[i].bytes; } return size; } /** * Invokes the actual API call with current elements. * @return {string[]} - the list of ids for invocations to be run. */ run() { if (this._data.length === 0) { return []; } const request = this._request; const elements = []; const ids = []; for (let i = 0; i < this._data.length; ++i) { elements.push(...this._data[i].elements); ids.push(this._data[i].callback.id); } request[this._bundledField] = elements; // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; this.callCanceller = this._apiCall(request, (err, response) => { const responses = []; if (err) { self._data.forEach(() => { responses.push(undefined); }); } else { let subresponseInfo = null; if (self._subresponseField) { subresponseInfo = { field: self._subresponseField, start: 0, }; } self._data.forEach(data => { if (subresponseInfo) { subresponseInfo.end = subresponseInfo.start + data.elements.length; } responses.push(deepCopyForResponse(response, subresponseInfo)); if (subresponseInfo) { subresponseInfo.start = subresponseInfo.end; } }); } for (let i = 0; i < self._data.length; ++i) { if (self._data[i].cancelled) { const error = new googleError_1.GoogleError('cancelled'); error.code = status_1.Status.CANCELLED; self._data[i].callback(error); } else { self._data[i].callback(err, responses[i]); } } }); return ids; } /** * Appends the list of elements into the task. * @param {Object[]} elements - the new list of elements. * @param {number} bytes - the byte size required to encode elements in the API. * @param {APICallback} callback - the callback of the method call. */ extend(elements, bytes, callback) { this._data.push({ elements, bytes, callback, }); } /** * Cancels a part of elements. * @param {string} id - The identifier of the part of elements. * @return {boolean} Whether the entire task will be canceled or not. */ cancel(id) { if (this.callCanceller) { let allCancelled = true; this._data.forEach(d => { if (d.callback.id === id) { d.cancelled = true; } if (!d.cancelled) { allCancelled = false; } }); if (allCancelled) { this.callCanceller.cancel(); } return allCancelled; } for (let i = 0; i < this._data.length; ++i) { if (this._data[i].callback.id === id) { const error = new googleError_1.GoogleError('cancelled'); error.code = status_1.Status.CANCELLED; this._data[i].callback(error); this._data.splice(i, 1); break; } } return this._data.length === 0; } } exports.Task = Task; //# sourceMappingURL=task.js.map /***/ }), /***/ 53047: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OngoingCallPromise = exports.OngoingCall = void 0; const status_1 = __webpack_require__(53501); const googleError_1 = __webpack_require__(6634); class OngoingCall { /** * OngoingCall manages callback, API calls, and cancellation * of the API calls. * @param {APICallback=} callback * The callback to be called asynchronously when the API call * finishes. * @constructor * @property {APICallback} callback * The callback function to be called. * @private */ constructor(callback) { this.callback = callback; this.completed = false; } /** * Cancels the ongoing promise. */ cancel() { if (this.completed) { return; } this.completed = true; if (this.cancelFunc) { this.cancelFunc(); } else { const error = new googleError_1.GoogleError('cancelled'); error.code = status_1.Status.CANCELLED; this.callback(error); } } /** * Call calls the specified function. Result will be used to fulfill * the promise. * * @param {SimpleCallbackFunction} func * A function for an API call. * @param {Object} argument * A request object. */ call(func, argument) { if (this.completed) { return; } const canceller = func(argument, (err, response, next, rawResponse) => { this.completed = true; setImmediate(this.callback, err, response, next, rawResponse); }); this.cancelFunc = () => canceller.cancel(); } } exports.OngoingCall = OngoingCall; class OngoingCallPromise extends OngoingCall { /** * GaxPromise is GRPCCallbackWrapper, but it holds a promise when * the API call finishes. * @constructor * @private */ constructor() { let resolveCallback; let rejectCallback; const callback = (err, response, next, rawResponse) => { if (err) { // If gRPC metadata exist, parsed google.rpc.status details. if (err.metadata) { rejectCallback(googleError_1.GoogleError.parseGRPCStatusDetails(err)); } else { rejectCallback(err); } } else if (response !== undefined) { resolveCallback([response, next || null, rawResponse || null]); } else { throw new googleError_1.GoogleError('Neither error nor response are defined'); } }; const promise = new Promise((resolve, reject) => { resolveCallback = resolve; rejectCallback = reject; }); super(callback); this.promise = promise; this.promise.cancel = () => { this.cancel(); }; } } exports.OngoingCallPromise = OngoingCallPromise; //# sourceMappingURL=call.js.map /***/ }), /***/ 79712: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createApiCall = void 0; /** * Provides function wrappers that implement page streaming and retrying. */ const apiCaller_1 = __webpack_require__(55398); const retries_1 = __webpack_require__(69742); const timeout_1 = __webpack_require__(4531); /** * Converts an rpc call into an API call governed by the settings. * * In typical usage, `func` will be a promise to a callable used to make an rpc * request. This will mostly likely be a bound method from a request stub used * to make an rpc call. It is not a direct function but a Promise instance, * because of its asynchronism (typically, obtaining the auth information). * * The result is a function which manages the API call with the given settings * and the options on the invocation. * * @param {Promise|GRPCCall} func - is either a promise to be used to make * a bare RPC call, or just a bare RPC call. * @param {CallSettings} settings - provides the settings for this call * @param {Descriptor} descriptor - optionally specify the descriptor for * the method call. * @return {GaxCall} func - a bound method on a request stub used * to make an rpc call. */ function createApiCall(func, settings, descriptor) { // we want to be able to accept both promise resolving to a function and a // function. Currently client librares are only calling this method with a // promise, but it will change. const funcPromise = typeof func === 'function' ? Promise.resolve(func) : func; // the following apiCaller will be used for all calls of this function... const apiCaller = apiCaller_1.createAPICaller(settings, descriptor); return (request, callOptions, callback) => { const thisSettings = settings.merge(callOptions); let currentApiCaller = apiCaller; // special case: if bundling is disabled for this one call, // use default API caller instead if (settings.isBundling && !thisSettings.isBundling) { currentApiCaller = apiCaller_1.createAPICaller(settings, undefined); } const ongoingCall = currentApiCaller.init(callback); funcPromise .then((func) => { var _a; // Initially, the function is just what gRPC server stub contains. func = currentApiCaller.wrap(func); const streaming = (_a = currentApiCaller.descriptor) === null || _a === void 0 ? void 0 : _a.streaming; const retry = thisSettings.retry; if (!streaming && retry && retry.retryCodes && retry.retryCodes.length > 0) { retry.backoffSettings.initialRpcTimeoutMillis = retry.backoffSettings.initialRpcTimeoutMillis || thisSettings.timeout; return retries_1.retryable(func, thisSettings.retry, thisSettings.otherArgs, thisSettings.apiName); } return timeout_1.addTimeoutArg(func, thisSettings.timeout, thisSettings.otherArgs); }) .then((apiCall) => { // After adding retries / timeouts, the call function becomes simpler: // it only accepts request and callback. currentApiCaller.call(apiCall, request, thisSettings, ongoingCall); }) .catch(err => { currentApiCaller.fail(ongoingCall, err); }); // Calls normally return a "cancellable promise" that can be used to `await` for the actual result, // or to cancel the ongoing call. return currentApiCaller.result(ongoingCall); }; } exports.createApiCall = createApiCall; //# sourceMappingURL=createApiCall.js.map /***/ }), /***/ 13627: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); var longRunningDescriptor_1 = __webpack_require__(8096); Object.defineProperty(exports, "LongrunningDescriptor", ({ enumerable: true, get: function () { return longRunningDescriptor_1.LongRunningDescriptor; } })); var pageDescriptor_1 = __webpack_require__(71172); Object.defineProperty(exports, "PageDescriptor", ({ enumerable: true, get: function () { return pageDescriptor_1.PageDescriptor; } })); var streamDescriptor_1 = __webpack_require__(65880); Object.defineProperty(exports, "StreamDescriptor", ({ enumerable: true, get: function () { return streamDescriptor_1.StreamDescriptor; } })); var bundleDescriptor_1 = __webpack_require__(94847); Object.defineProperty(exports, "BundleDescriptor", ({ enumerable: true, get: function () { return bundleDescriptor_1.BundleDescriptor; } })); //# sourceMappingURL=descriptor.js.map /***/ }), /***/ 90418: /***/ ((module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fallback = exports.protobuf = exports.createApiCall = exports.lro = exports.GrpcClient = exports.defaultToObjectOptions = exports.version = exports.routingHeader = void 0; const protobuf = __webpack_require__(85881); exports.protobuf = protobuf; const gax = __webpack_require__(80978); const routingHeader = __webpack_require__(8827); exports.routingHeader = routingHeader; const status_1 = __webpack_require__(53501); const google_auth_library_1 = __webpack_require__(20810); const objectHash = __webpack_require__(36935); const operationsClient_1 = __webpack_require__(82450); const createApiCall_1 = __webpack_require__(79712); const fallbackProto = __webpack_require__(20108); const fallbackRest = __webpack_require__(21088); const featureDetection_1 = __webpack_require__(11154); const fallbackServiceStub_1 = __webpack_require__(38255); const _1 = __webpack_require__(12263); var pathTemplate_1 = __webpack_require__(20513); Object.defineProperty(exports, "PathTemplate", ({ enumerable: true, get: function () { return pathTemplate_1.PathTemplate; } })); var gax_1 = __webpack_require__(80978); Object.defineProperty(exports, "CallSettings", ({ enumerable: true, get: function () { return gax_1.CallSettings; } })); Object.defineProperty(exports, "constructSettings", ({ enumerable: true, get: function () { return gax_1.constructSettings; } })); Object.defineProperty(exports, "RetryOptions", ({ enumerable: true, get: function () { return gax_1.RetryOptions; } })); exports.version = __webpack_require__(56156).version + '-fallback'; var descriptor_1 = __webpack_require__(13627); Object.defineProperty(exports, "BundleDescriptor", ({ enumerable: true, get: function () { return descriptor_1.BundleDescriptor; } })); Object.defineProperty(exports, "LongrunningDescriptor", ({ enumerable: true, get: function () { return descriptor_1.LongrunningDescriptor; } })); Object.defineProperty(exports, "PageDescriptor", ({ enumerable: true, get: function () { return descriptor_1.PageDescriptor; } })); Object.defineProperty(exports, "StreamDescriptor", ({ enumerable: true, get: function () { return descriptor_1.StreamDescriptor; } })); var streaming_1 = __webpack_require__(67389); Object.defineProperty(exports, "StreamType", ({ enumerable: true, get: function () { return streaming_1.StreamType; } })); exports.defaultToObjectOptions = { keepCase: false, longs: String, enums: String, defaults: true, oneofs: true, }; const CLIENT_VERSION_HEADER = 'x-goog-api-client'; class GrpcClient { /** * gRPC-fallback version of GrpcClient * Implements GrpcClient API for a browser using grpc-fallback protocol (sends serialized protobuf to HTTP/1 $rpc endpoint). * * @param {Object=} options.auth - An instance of OAuth2Client to use in browser, or an instance of GoogleAuth from google-auth-library * to use in Node.js. Required for browser, optional for Node.js. * @constructor */ constructor(options = {}) { if (!featureDetection_1.isNodeJS()) { if (!options.auth) { throw new Error(JSON.stringify(options) + 'You need to pass auth instance to use gRPC-fallback client in browser or other non-Node.js environments. Use OAuth2Client from google-auth-library.'); } this.auth = options.auth; } else { this.auth = options.auth || new google_auth_library_1.GoogleAuth(options); } this.fallback = options.fallback !== 'rest' ? 'proto' : 'rest'; this.grpcVersion = __webpack_require__(56156).version; } /** * In rare cases users might need to deallocate all memory consumed by loaded protos. * This method will delete the proto cache content. */ static clearProtoCache() { GrpcClient.protoCache.clear(); } /** * gRPC-fallback version of loadProto * Loads the protobuf root object from a JSON object created from a proto file * @param {Object} jsonObject - A JSON version of a protofile created usin protobuf.js * @returns {Object} Root namespace of proto JSON */ loadProto(jsonObject) { const rootObject = protobuf.Root.fromJSON(jsonObject); return rootObject; } loadProtoJSON(json, ignoreCache = false) { const hash = objectHash(json).toString(); const cached = GrpcClient.protoCache.get(hash); if (cached && !ignoreCache) { return cached; } const root = protobuf.Root.fromJSON(json); GrpcClient.protoCache.set(hash, root); return root; } static getServiceMethods(service) { const methods = {}; for (const [methodName, methodObject] of Object.entries(service.methods)) { const methodNameLowerCamelCase = methodName[0].toLowerCase() + methodName.substring(1); methods[methodNameLowerCamelCase] = methodObject; } return methods; } /** * gRPC-fallback version of constructSettings * A wrapper of {@link constructSettings} function under the gRPC context. * * Most of parameters are common among constructSettings, please take a look. * @param {string} serviceName - The fullly-qualified name of the service. * @param {Object} clientConfig - A dictionary of the client config. * @param {Object} configOverrides - A dictionary of overriding configs. * @param {Object} headers - A dictionary of additional HTTP header name to * its value. * @return {Object} A mapping of method names to CallSettings. */ constructSettings(serviceName, clientConfig, configOverrides, headers) { function buildMetadata(abTests, moreHeaders) { const metadata = {}; if (!headers) { headers = {}; } // Since gRPC expects each header to be an array, // we are doing the same for fallback here. for (const key in headers) { metadata[key] = Array.isArray(headers[key]) ? headers[key] : [headers[key]]; } // gRPC-fallback request must have 'grpc-web/' in 'x-goog-api-client' const clientVersions = []; if (metadata[CLIENT_VERSION_HEADER] && metadata[CLIENT_VERSION_HEADER][0]) { clientVersions.push(...metadata[CLIENT_VERSION_HEADER][0].split(' ')); } clientVersions.push(`grpc-web/${exports.version}`); metadata[CLIENT_VERSION_HEADER] = [clientVersions.join(' ')]; if (!moreHeaders) { return metadata; } for (const key in moreHeaders) { if (key.toLowerCase() !== CLIENT_VERSION_HEADER) { const value = moreHeaders[key]; if (Array.isArray(value)) { if (metadata[key] === undefined) { metadata[key] = value; } else { if (Array.isArray(metadata[key])) { metadata[key].push(...value); } else { throw new Error(`Can not add value ${value} to the call metadata.`); } } } else { metadata[key] = [value]; } } } return metadata; } return gax.constructSettings(serviceName, clientConfig, configOverrides, status_1.Status, { metadataBuilder: buildMetadata }); } /** * gRPC-fallback version of createStub * Creates a gRPC-fallback stub with authentication headers built from supplied OAuth2Client instance * * @param {function} CreateStub - The constructor function of the stub. * @param {Object} service - A protobufjs Service object (as returned by lookupService) * @param {Object} opts - Connection options, as described below. * @param {string} opts.servicePath - The hostname of the API endpoint service. * @param {number} opts.port - The port of the service. * @return {Promise} A promise which resolves to a gRPC-fallback service stub, which is a protobuf.js service stub instance modified to match the gRPC stub API */ async createStub(service, opts, // For consistency with createStub in grpc.ts, customServicePath is defined: // eslint-disable-next-line @typescript-eslint/no-unused-vars customServicePath) { if (!this.authClient) { if (this.auth && 'getClient' in this.auth) { this.authClient = await this.auth.getClient(); } else if (this.auth && 'getRequestHeaders' in this.auth) { this.authClient = this.auth; } } if (!this.authClient) { throw new Error('No authentication was provided'); } service.resolveAll(); const methods = GrpcClient.getServiceMethods(service); const protocol = opts.protocol || 'https'; let servicePath = opts.servicePath; if (!servicePath && service.options && service.options['(google.api.default_host)']) { servicePath = service.options['(google.api.default_host)']; } if (!servicePath) { throw new Error(`Cannot determine service API path for service ${service.name}.`); } let servicePort; const match = servicePath.match(/^(.*):(\d+)$/); if (match) { servicePath = match[1]; servicePort = parseInt(match[2]); } if (opts.port) { servicePort = opts.port; } else if (!servicePort) { servicePort = 443; } const encoder = this.fallback === 'rest' ? fallbackRest.encodeRequest : fallbackProto.encodeRequest; const decoder = this.fallback === 'rest' ? fallbackRest.decodeResponse : fallbackProto.decodeResponse; const serviceStub = fallbackServiceStub_1.generateServiceStub(methods, protocol, servicePath, servicePort, this.authClient, encoder, decoder); return serviceStub; } } exports.GrpcClient = GrpcClient; GrpcClient.protoCache = new Map(); /** * gRPC-fallback version of lro * * @param {Object=} options.auth - An instance of google-auth-library. * @return {Object} A OperationsClientBuilder that will return a OperationsClient */ function lro(options) { options = Object.assign({ scopes: [] }, options); const gaxGrpc = new GrpcClient(options); return new operationsClient_1.OperationsClientBuilder(gaxGrpc); } exports.lro = lro; /** * gRPC-fallback version of createApiCall * * Converts an rpc call into an API call governed by the settings. * * In typical usage, `func` will be a promise to a callable used to make an rpc * request. This will mostly likely be a bound method from a request stub used * to make an rpc call. It is not a direct function but a Promise instance, * because of its asynchronism (typically, obtaining the auth information). * * The result is a function which manages the API call with the given settings * and the options on the invocation. * * Throws exception on unsupported streaming calls * * @param {Promise|GRPCCall} func - is either a promise to be used to make * a bare RPC call, or just a bare RPC call. * @param {CallSettings} settings - provides the settings for this call * @param {Descriptor} descriptor - optionally specify the descriptor for * the method call. * @return {GaxCall} func - a bound method on a request stub used * to make an rpc call. */ function createApiCall(func, settings, descriptor) { if (descriptor && 'streaming' in descriptor && descriptor.type !== _1.StreamType.SERVER_STREAMING) { return () => { throw new Error('The gRPC-fallback client library (e.g. browser version of the library) currently does not support client-streaming or bidi-stream calls.'); }; } return createApiCall_1.createApiCall(func, settings, descriptor); } exports.createApiCall = createApiCall; exports.protobufMinimal = __webpack_require__(96916); // Different environments or bundlers may or may not respect "browser" field // in package.json (e.g. Electron does not respect it, but if you run the code // through webpack first, it will follow the "browser" field). // To make it safer and more compatible, let's make sure that if you do // const gax = require("google-gax"); // you can always ask for gax.fallback, regardless of "browser" field being // understood or not. const fallback = module.exports; exports.fallback = fallback; //# sourceMappingURL=fallback.js.map /***/ }), /***/ 20108: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decodeResponse = exports.encodeRequest = void 0; // proto-over-HTTP request encoding and decoding const fallback_1 = __webpack_require__(90418); const googleError_1 = __webpack_require__(6634); function encodeRequest(rpc, protocol, servicePath, servicePort, request) { const protoNamespaces = []; let currNamespace = rpc.parent; while (currNamespace.name !== '') { protoNamespaces.unshift(currNamespace.name); currNamespace = currNamespace.parent; } const protoServiceName = protoNamespaces.join('.'); const rpcName = rpc.name; const headers = { 'Content-Type': 'application/x-protobuf', }; const method = 'post'; const requestMessage = rpc.resolvedRequestType.fromObject(request); const body = rpc.resolvedRequestType.encode(requestMessage).finish(); const url = `${protocol}://${servicePath}:${servicePort}/$rpc/${protoServiceName}/${rpcName}`; return { method, url, headers, body, }; } exports.encodeRequest = encodeRequest; function decodeResponse(rpc, ok, response) { if (!ok) { const statusDecoder = new googleError_1.GoogleErrorDecoder(); const error = statusDecoder.decodeErrorFromBuffer(response); throw error; } const buffer = response instanceof ArrayBuffer ? new Uint8Array(response) : response; const message = rpc.resolvedResponseType.decode(buffer); return rpc.resolvedResponseType.toObject(message, fallback_1.defaultToObjectOptions); } exports.decodeResponse = decodeResponse; //# sourceMappingURL=fallbackProto.js.map /***/ }), /***/ 21088: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decodeResponse = exports.encodeRequest = void 0; // proto-over-HTTP request encoding and decoding const serializer = __webpack_require__(2027); const fallback_1 = __webpack_require__(90418); const featureDetection_1 = __webpack_require__(11154); const googleError_1 = __webpack_require__(6634); const transcoding_1 = __webpack_require__(86707); if (!featureDetection_1.hasTextEncoder() || !featureDetection_1.hasTextDecoder()) { if (featureDetection_1.isNodeJS()) { // Node.js 10 does not have global TextDecoder // TODO(@alexander-fenster): remove this logic after Node.js 10 is EOL. // eslint-disable-next-line @typescript-eslint/no-var-requires const util = __webpack_require__(31669); Object.assign(global, { TextDecoder: util.TextDecoder, TextEncoder: util.TextEncoder, }); } else { __webpack_require__(21917); } } function encodeRequest(rpc, protocol, servicePath, servicePort, request) { const headers = { 'Content-Type': 'application/json', }; const message = rpc.resolvedRequestType.fromObject(request); const json = serializer.toProto3JSON(message); if (!json) { throw new Error(`Cannot send null request to RPC ${rpc.name}.`); } if (typeof json !== 'object' || Array.isArray(json)) { throw new Error(`Request to RPC ${rpc.name} must be an object.`); } const transcoded = transcoding_1.transcode(json, rpc.parsedOptions, rpc.resolvedRequestType.fields); if (!transcoded) { throw new Error(`Cannot build HTTP request for ${JSON.stringify(json)}, method: ${rpc.name}`); } const method = transcoded.httpMethod; const body = JSON.stringify(transcoded.data); const url = `${protocol}://${servicePath}:${servicePort}/${transcoded.url.replace(/^\//, '')}?${transcoded.queryString}`; return { method, url, headers, body, }; } exports.encodeRequest = encodeRequest; function decodeResponse(rpc, ok, response) { // eslint-disable-next-line node/no-unsupported-features/node-builtins const decodedString = new TextDecoder().decode(response); const json = JSON.parse(decodedString); if (!ok) { const error = googleError_1.GoogleError.parseHttpError(json); throw error; } const message = serializer.fromProto3JSON(rpc.resolvedResponseType, json); if (!message) { throw new Error(`Received null response from RPC ${rpc.name}`); } return rpc.resolvedResponseType.toObject(message, fallback_1.defaultToObjectOptions); } exports.decodeResponse = decodeResponse; //# sourceMappingURL=fallbackRest.js.map /***/ }), /***/ 38255: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.generateServiceStub = void 0; /* global window */ /* global AbortController */ const node_fetch_1 = __webpack_require__(80467); const abort_controller_1 = __webpack_require__(61659); const featureDetection_1 = __webpack_require__(11154); const streamArrayParser_1 = __webpack_require__(25735); const stream_1 = __webpack_require__(92413); function generateServiceStub(rpcs, protocol, servicePath, servicePort, authClient, requestEncoder, responseDecoder) { const fetch = featureDetection_1.hasWindowFetch() ? window.fetch : node_fetch_1.default; const serviceStub = {}; for (const [rpcName, rpc] of Object.entries(rpcs)) { serviceStub[rpcName] = (request, options, _metadata, callback) => { // We cannot use async-await in this function because we need to return the canceller object as soon as possible. // Using plain old promises instead. const cancelController = featureDetection_1.hasAbortController() ? new AbortController() : new abort_controller_1.AbortController(); const cancelSignal = cancelController.signal; let cancelRequested = false; const fetchParameters = requestEncoder(rpc, protocol, servicePath, servicePort, request); const url = fetchParameters.url; const headers = fetchParameters.headers; for (const key of Object.keys(options)) { headers[key] = options[key][0]; } const streamArrayParser = new streamArrayParser_1.StreamArrayParser(rpc); authClient .getRequestHeaders() .then(authHeader => { const fetchRequest = { headers: { ...authHeader, ...headers, }, body: fetchParameters.body, method: fetchParameters.method, signal: cancelSignal, }; if (fetchParameters.method === 'get' || fetchParameters.method === 'delete') { delete fetchRequest['body']; } return fetch(url, fetchRequest); }) .then((response) => { if (response.ok && rpc.responseStream) { stream_1.pipeline(response.body, streamArrayParser, (err) => { if (err && (!cancelRequested || (err instanceof Error && err.name !== 'AbortError'))) { callback(err); } }); return; } else { return Promise.all([ Promise.resolve(response.ok), response.arrayBuffer(), ]) .then(([ok, buffer]) => { const response = responseDecoder(rpc, ok, buffer); callback(null, response); }) .catch((err) => { if (!cancelRequested || err.name !== 'AbortError') { callback(err); } }); } }); if (rpc.responseStream) { return streamArrayParser; } return { cancel: () => { cancelRequested = true; cancelController.abort(); }, }; }; } return serviceStub; } exports.generateServiceStub = generateServiceStub; //# sourceMappingURL=fallbackServiceStub.js.map /***/ }), /***/ 11154: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.hasAbortController = exports.isNodeJS = exports.hasTextDecoder = exports.hasTextEncoder = exports.hasWindowFetch = void 0; /* global window */ const features = { windowFetch: typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.fetch) && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function', // eslint-disable-next-line node/no-unsupported-features/node-builtins textEncoder: typeof TextEncoder !== 'undefined', // eslint-disable-next-line node/no-unsupported-features/node-builtins textDecoder: typeof TextDecoder !== 'undefined', nodeJS: typeof process !== 'undefined' && ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node), abortController: typeof AbortController !== 'undefined', }; function hasWindowFetch() { return features.windowFetch; } exports.hasWindowFetch = hasWindowFetch; function hasTextEncoder() { return features.textEncoder; } exports.hasTextEncoder = hasTextEncoder; function hasTextDecoder() { return features.textDecoder; } exports.hasTextDecoder = hasTextDecoder; function isNodeJS() { return features.nodeJS; } exports.isNodeJS = isNodeJS; function hasAbortController() { return features.abortController; } exports.hasAbortController = hasAbortController; //# sourceMappingURL=featureDetection.js.map /***/ }), /***/ 80978: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.constructSettings = exports.createBundleOptions = exports.createMaxRetriesBackoffSettings = exports.createDefaultBackoffSettings = exports.createBackoffSettings = exports.createRetryOptions = exports.CallSettings = exports.RetryOptions = void 0; /** * Encapsulates the overridable settings for a particular API call. * * ``CallOptions`` is an optional arg for all GAX API calls. It is used to * configure the settings of a specific API call. * * When provided, its values override the GAX service defaults for that * particular call. * * Typically the API clients will accept this as the second to the last * argument. See the examples below. * @typedef {Object} CallOptions * @property {number=} timeout - The client-side timeout for API calls. * @property {RetryOptions=} retry - determines whether and how to retry * on transient errors. When set to null, the call will not retry. * @property {boolean=} autoPaginate - If set to false and the call is * configured for paged iteration, page unrolling is not performed, instead * the callback will be called with the response object. * @property {Object=} pageToken - If set and the call is configured for * paged iteration, paged iteration is not performed and requested with this * pageToken. * @property {number} maxResults - If set and the call is configured for * paged iteration, the call will stop when the number of response elements * reaches to the specified size. By default, it will unroll the page to * the end of the list. * @property {boolean=} isBundling - If set to false and the call is configured * for bundling, bundling is not performed. * @property {BackoffSettings=} longrunning - BackoffSettings used for polling. * @example * // suppress bundling for bundled method. * api.bundlingMethod( * param, {optParam: aValue, isBundling: false}, function(err, response) { * // handle response. * }); * @example * // suppress streaming for page-streaming method. * api.pageStreamingMethod( * param, {optParam: aValue, autoPaginate: false}, function(err, page) { * // not returning a stream, but callback is called with the paged response. * }); */ /** * Per-call configurable settings for retrying upon transient failure. * @typedef {Object} RetryOptions * @property {String[]} retryCodes * @property {BackoffSettings} backoffSettings */ class RetryOptions { constructor(retryCodes, backoffSettings) { this.retryCodes = retryCodes; this.backoffSettings = backoffSettings; } } exports.RetryOptions = RetryOptions; class CallSettings { /** * @param {Object} settings - An object containing parameters of this settings. * @param {number} settings.timeout - The client-side timeout for API calls. * This parameter is ignored for retrying calls. * @param {RetryOptions} settings.retry - The configuration for retrying upon * transient error. If set to null, this call will not retry. * @param {boolean} settings.autoPaginate - If there is no `pageDescriptor`, * this attrbute has no meaning. Otherwise, determines whether a page * streamed response should make the page structure transparent to the user by * flattening the repeated field in the returned generator. * @param {number} settings.pageToken - If there is no `pageDescriptor`, * this attribute has no meaning. Otherwise, determines the page token used * in the page streaming request. * @param {Object} settings.otherArgs - Additional arguments to be passed to * the API calls. * * @constructor */ constructor(settings) { var _a; settings = settings || {}; this.timeout = settings.timeout || 30 * 1000; this.retry = settings.retry; this.autoPaginate = 'autoPaginate' in settings ? settings.autoPaginate : true; this.pageToken = settings.pageToken; this.maxResults = settings.maxResults; this.otherArgs = settings.otherArgs || {}; this.bundleOptions = settings.bundleOptions; this.isBundling = 'isBundling' in settings ? settings.isBundling : true; this.longrunning = 'longrunning' in settings ? settings.longrunning : undefined; this.apiName = (_a = settings.apiName) !== null && _a !== void 0 ? _a : undefined; this.retryRequestOptions = settings.retryRequestOptions; } /** * Returns a new CallSettings merged from this and a CallOptions object. * * @param {CallOptions} options - an instance whose values override * those in this object. If null, ``merge`` returns a copy of this * object * @return {CallSettings} The merged CallSettings instance. */ merge(options) { if (!options) { return new CallSettings(this); } let timeout = this.timeout; let retry = this.retry; let autoPaginate = this.autoPaginate; let pageToken = this.pageToken; let pageSize = this.pageSize; let maxResults = this.maxResults; let otherArgs = this.otherArgs; let isBundling = this.isBundling; let longrunning = this.longrunning; let apiName = this.apiName; let retryRequestOptions = this.retryRequestOptions; // If a method-specific timeout is set in the service config, and the retry codes for that // method are non-null, then that timeout value will be used to // override backoff settings. if (retry !== undefined && retry !== null && retry.retryCodes !== null && retry.retryCodes.length > 0) { retry.backoffSettings.initialRpcTimeoutMillis = timeout; retry.backoffSettings.maxRpcTimeoutMillis = timeout; retry.backoffSettings.totalTimeoutMillis = timeout; } // If the user provides a timeout to the method, that timeout value will be used // to override the backoff settings. if ('timeout' in options) { timeout = options.timeout; if (retry !== undefined && retry !== null && retry.retryCodes.length > 0) { retry.backoffSettings.initialRpcTimeoutMillis = timeout; retry.backoffSettings.maxRpcTimeoutMillis = timeout; retry.backoffSettings.totalTimeoutMillis = timeout; } } if ('retry' in options) { retry = mergeRetryOptions(retry || {}, options.retry); } if ('autoPaginate' in options && !options.autoPaginate) { autoPaginate = false; } if ('pageToken' in options) { autoPaginate = false; pageToken = options.pageToken; } if ('pageSize' in options) { pageSize = options.pageSize; } if ('maxResults' in options) { maxResults = options.maxResults; } if ('otherArgs' in options) { otherArgs = {}; for (const key in this.otherArgs) { otherArgs[key] = this.otherArgs[key]; } for (const optionsKey in options.otherArgs) { otherArgs[optionsKey] = options.otherArgs[optionsKey]; } } if ('isBundling' in options) { isBundling = options.isBundling; } if ('maxRetries' in options) { retry.backoffSettings.maxRetries = options.maxRetries; delete retry.backoffSettings.totalTimeoutMillis; } if ('longrunning' in options) { longrunning = options.longrunning; } if ('apiName' in options) { apiName = options.apiName; } if ('retryRequestOptions' in options) { retryRequestOptions = options.retryRequestOptions; } return new CallSettings({ timeout, retry, bundleOptions: this.bundleOptions, longrunning, autoPaginate, pageToken, pageSize, maxResults, otherArgs, isBundling, apiName, retryRequestOptions, }); } } exports.CallSettings = CallSettings; /** * Per-call configurable settings for retrying upon transient failure. * * @param {number[]} retryCodes - a list of Google API canonical error codes * upon which a retry should be attempted. * @param {BackoffSettings} backoffSettings - configures the retry * exponential backoff algorithm. * @return {RetryOptions} A new RetryOptions object. * */ function createRetryOptions(retryCodes, backoffSettings) { return { retryCodes, backoffSettings, }; } exports.createRetryOptions = createRetryOptions; /** * Parameters to the exponential backoff algorithm for retrying. * * @param {number} initialRetryDelayMillis - the initial delay time, * in milliseconds, between the completion of the first failed request and the * initiation of the first retrying request. * @param {number} retryDelayMultiplier - the multiplier by which to * increase the delay time between the completion of failed requests, and the * initiation of the subsequent retrying request. * @param {number} maxRetryDelayMillis - the maximum delay time, in * milliseconds, between requests. When this value is reached, * ``retryDelayMultiplier`` will no longer be used to increase delay time. * @param {number} initialRpcTimeoutMillis - the initial timeout parameter * to the request. * @param {number} rpcTimeoutMultiplier - the multiplier by which to * increase the timeout parameter between failed requests. * @param {number} maxRpcTimeoutMillis - the maximum timeout parameter, in * milliseconds, for a request. When this value is reached, * ``rpcTimeoutMultiplier`` will no longer be used to increase the timeout. * @param {number} totalTimeoutMillis - the total time, in milliseconds, * starting from when the initial request is sent, after which an error will * be returned, regardless of the retrying attempts made meanwhile. * @return {BackoffSettings} a new settings. * */ function createBackoffSettings(initialRetryDelayMillis, retryDelayMultiplier, maxRetryDelayMillis, initialRpcTimeoutMillis, rpcTimeoutMultiplier, maxRpcTimeoutMillis, totalTimeoutMillis) { return { initialRetryDelayMillis, retryDelayMultiplier, maxRetryDelayMillis, initialRpcTimeoutMillis, rpcTimeoutMultiplier, maxRpcTimeoutMillis, totalTimeoutMillis, }; } exports.createBackoffSettings = createBackoffSettings; function createDefaultBackoffSettings() { return createBackoffSettings(100, 1.3, 60000, null, null, null, null); } exports.createDefaultBackoffSettings = createDefaultBackoffSettings; /** * Parameters to the exponential backoff algorithm for retrying. * This function is unsupported, and intended for internal use only. * * @param {number} initialRetryDelayMillis - the initial delay time, * in milliseconds, between the completion of the first failed request and the * initiation of the first retrying request. * @param {number} retryDelayMultiplier - the multiplier by which to * increase the delay time between the completion of failed requests, and the * initiation of the subsequent retrying request. * @param {number} maxRetryDelayMillis - the maximum delay time, in * milliseconds, between requests. When this value is reached, * ``retryDelayMultiplier`` will no longer be used to increase delay time. * @param {number} initialRpcTimeoutMillis - the initial timeout parameter * to the request. * @param {number} rpcTimeoutMultiplier - the multiplier by which to * increase the timeout parameter between failed requests. * @param {number} maxRpcTimeoutMillis - the maximum timeout parameter, in * milliseconds, for a request. When this value is reached, * ``rpcTimeoutMultiplier`` will no longer be used to increase the timeout. * @param {number} maxRetries - the maximum number of retrying attempts that * will be made. If reached, an error will be returned. * @return {BackoffSettings} a new settings. * */ function createMaxRetriesBackoffSettings(initialRetryDelayMillis, retryDelayMultiplier, maxRetryDelayMillis, initialRpcTimeoutMillis, rpcTimeoutMultiplier, maxRpcTimeoutMillis, maxRetries) { return { initialRetryDelayMillis, retryDelayMultiplier, maxRetryDelayMillis, initialRpcTimeoutMillis, rpcTimeoutMultiplier, maxRpcTimeoutMillis, maxRetries, }; } exports.createMaxRetriesBackoffSettings = createMaxRetriesBackoffSettings; /** * Creates a new {@link BundleOptions}. * * @private * @param {Object} options - An object to hold optional parameters. See * properties for the content of options. * @return {BundleOptions} - A new options. */ function createBundleOptions(options) { const params = [ 'element_count_threshold', 'element_count_limit', 'request_byte_threshold', 'request_byte_limit', 'delay_threshold_millis', ]; params.forEach(param => { if (param in options && typeof options[param] !== 'number') { throw new Error(`${param} should be a number`); } }); const elementCountThreshold = options.element_count_threshold || 0; const elementCountLimit = options.element_count_limit || 0; const requestByteThreshold = options.request_byte_threshold || 0; const requestByteLimit = options.request_byte_limit || 0; const delayThreshold = options.delay_threshold_millis || 0; if (elementCountThreshold === 0 && requestByteThreshold === 0 && delayThreshold === 0) { throw new Error('one threshold should be > 0'); } return { elementCountThreshold, elementCountLimit, requestByteThreshold, requestByteLimit, delayThreshold, }; } exports.createBundleOptions = createBundleOptions; /** * Helper for {@link constructSettings} * * @private * * @param {Object} methodConfig - A dictionary representing a single * `methods` entry of the standard API client config file. (See * {@link constructSettings} for information on this yaml.) * @param {?Object} retryCodes - A dictionary parsed from the * `retry_codes_def` entry of the standard API client config * file. (See {@link constructSettings} for information on this yaml.) * @param {Object} retryParams - A dictionary parsed from the * `retry_params` entry of the standard API client config * file. (See {@link constructSettings} for information on this yaml.) * @param {Object} retryNames - A dictionary mapping the string names * used in the standard API client config file to API response * status codes. * @return {?RetryOptions} The new retry options. */ function constructRetry(methodConfig, retryCodes, retryParams, retryNames) { if (!methodConfig) { return null; } let codes = null; if (retryCodes && 'retry_codes_name' in methodConfig) { const retryCodesName = methodConfig['retry_codes_name']; codes = (retryCodes[retryCodesName] || []).map(name => { return Number(retryNames[name]); }); } let backoffSettings = null; if (retryParams && 'retry_params_name' in methodConfig) { const params = retryParams[methodConfig.retry_params_name]; backoffSettings = createBackoffSettings(params.initial_retry_delay_millis, params.retry_delay_multiplier, params.max_retry_delay_millis, params.initial_rpc_timeout_millis, params.rpc_timeout_multiplier, params.max_rpc_timeout_millis, params.total_timeout_millis); } return createRetryOptions(codes, backoffSettings); } /** * Helper for {@link constructSettings} * * Takes two retry options, and merges them into a single RetryOption instance. * * @private * * @param {RetryOptions} retry - The base RetryOptions. * @param {RetryOptions} overrides - The RetryOptions used for overriding * `retry`. Use the values if it is not null. If entire `overrides` is null, * ignore the base retry and return null. * @return {?RetryOptions} The merged RetryOptions. */ function mergeRetryOptions(retry, overrides) { if (!overrides) { return null; } if (!overrides.retryCodes && !overrides.backoffSettings) { return retry; } const codes = overrides.retryCodes ? overrides.retryCodes : retry.retryCodes; const backoffSettings = overrides.backoffSettings ? overrides.backoffSettings : retry.backoffSettings; return createRetryOptions(codes, backoffSettings); } /** * Constructs a dictionary mapping method names to {@link CallSettings}. * * The `clientConfig` parameter is parsed from a client configuration JSON * file of the form: * * { * "interfaces": { * "google.fake.v1.ServiceName": { * "retry_codes": { * "idempotent": ["UNAVAILABLE", "DEADLINE_EXCEEDED"], * "non_idempotent": [] * }, * "retry_params": { * "default": { * "initial_retry_delay_millis": 100, * "retry_delay_multiplier": 1.2, * "max_retry_delay_millis": 1000, * "initial_rpc_timeout_millis": 2000, * "rpc_timeout_multiplier": 1.5, * "max_rpc_timeout_millis": 30000, * "total_timeout_millis": 45000 * } * }, * "methods": { * "CreateFoo": { * "retry_codes_name": "idempotent", * "retry_params_name": "default" * }, * "Publish": { * "retry_codes_name": "non_idempotent", * "retry_params_name": "default", * "bundling": { * "element_count_threshold": 40, * "element_count_limit": 200, * "request_byte_threshold": 90000, * "request_byte_limit": 100000, * "delay_threshold_millis": 100 * } * } * } * } * } * } * * @param {String} serviceName - The fully-qualified name of this * service, used as a key into the client config file (in the * example above, this value should be 'google.fake.v1.ServiceName'). * @param {Object} clientConfig - A dictionary parsed from the * standard API client config file. * @param {Object} configOverrides - A dictionary in the same structure of * client_config to override the settings. * @param {Object.} retryNames - A dictionary mapping the strings * referring to response status codes to objects representing * those codes. * @param {Object} otherArgs - the non-request arguments to be passed to the API * calls. * @return {Object} A mapping from method name to CallSettings, or null if the * service is not found in the config. */ function constructSettings(serviceName, clientConfig, configOverrides, retryNames, otherArgs) { otherArgs = otherArgs || {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any const defaults = {}; const serviceConfig = (clientConfig.interfaces || {})[serviceName]; if (!serviceConfig) { return null; } // users can override the config from client side, like bundling options. // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/main/src/gax.ts#L546 // The way to override bundling options: // // const customConfig = {"interfaces": {"service": {"methods": {"methodName": {"bundling": {..}}}}}} // const client = new Client({ projectId, customConfig }); const overrides = (configOverrides.interfaces || {})[serviceName] || {}; const methods = serviceConfig.methods; const overridingMethods = overrides.methods || {}; for (const methodName in methods) { const methodConfig = methods[methodName]; const jsName = methodName[0].toLowerCase() + methodName.slice(1); let retry = constructRetry(methodConfig, serviceConfig.retry_codes, serviceConfig.retry_params, retryNames); let bundlingConfig = methodConfig.bundling; let timeout = methodConfig.timeout_millis; if (methodName in overridingMethods) { const overridingMethod = overridingMethods[methodName]; if (overridingMethod) { if ('bundling' in overridingMethod) { bundlingConfig = overridingMethod.bundling; } if ('timeout_millis' in overridingMethod) { timeout = overridingMethod.timeout_millis; } } retry = mergeRetryOptions(retry, constructRetry(overridingMethod, overrides.retry_codes, overrides.retry_params, retryNames)); } const apiName = serviceName; defaults[jsName] = new CallSettings({ timeout, retry, bundleOptions: bundlingConfig ? createBundleOptions(bundlingConfig) : null, otherArgs, apiName, }); } return defaults; } exports.constructSettings = constructSettings; //# sourceMappingURL=gax.js.map /***/ }), /***/ 6634: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GoogleErrorDecoder = exports.GoogleError = void 0; const status_1 = __webpack_require__(53501); const protobuf = __webpack_require__(85881); class GoogleError extends Error { // Parse details field in google.rpc.status wire over gRPC medatadata. // Promote google.rpc.ErrorInfo if exist. static parseGRPCStatusDetails(err) { const decoder = new GoogleErrorDecoder(); try { if (err.metadata && err.metadata.get('grpc-status-details-bin')) { const statusDetailsObj = decoder.decodeGRPCStatusDetails(err.metadata.get('grpc-status-details-bin')); if (statusDetailsObj && statusDetailsObj.details && statusDetailsObj.details.length > 0) { err.statusDetails = statusDetailsObj.details; } if (statusDetailsObj && statusDetailsObj.errorInfo) { err.reason = statusDetailsObj.errorInfo.reason; err.domain = statusDetailsObj.errorInfo.domain; err.errorInfoMetadata = statusDetailsObj.errorInfo.metadata; } } } catch (decodeErr) { // ignoring the error } return err; } // Parse http JSON error and promote google.rpc.ErrorInfo if exist. // eslint-disable-next-line @typescript-eslint/no-explicit-any static parseHttpError(json) { const error = Object.assign(new GoogleError(json['error']['message']), json.error); // Map Http Status Code to gRPC Status Code if (json['error']['code']) { error.code = status_1.rpcCodeFromHttpStatusCode(json['error']['code']); } // Keep consistency with gRPC statusDetails fields. gRPC details has been occupied before. // Rename "detials" to "statusDetails". error.statusDetails = json['error']['details']; delete error.details; // Promote the ErrorInfo fields as error's top-level. const errorInfo = !json['error']['details'] ? undefined : json['error']['details'].find((item) => item['@type'] === 'type.googleapis.com/google.rpc.ErrorInfo'); if (errorInfo) { error.reason = errorInfo.reason; error.domain = errorInfo.domain; // error.metadata has been occupied for gRPC metadata, so we use // errorInfoMetadat to represent ErrorInfo' metadata field. Keep // consistency with gRPC ErrorInfo metadata field name. error.errorInfoMetadata = errorInfo.metadata; } return error; } } exports.GoogleError = GoogleError; class GoogleErrorDecoder { constructor() { // eslint-disable-next-line @typescript-eslint/no-var-requires const errorProtoJson = __webpack_require__(57054); this.root = protobuf.Root.fromJSON(errorProtoJson); this.anyType = this.root.lookupType('google.protobuf.Any'); this.statusType = this.root.lookupType('google.rpc.Status'); } decodeProtobufAny(anyValue) { const match = anyValue.type_url.match(/^type.googleapis.com\/(.*)/); if (!match) { throw new Error(`Unknown type encoded in google.protobuf.any: ${anyValue.type_url}`); } const typeName = match[1]; const type = this.root.lookupType(typeName); if (!type) { throw new Error(`Cannot lookup type ${typeName}`); } return type.decode(anyValue.value); } // Decodes gRPC-fallback error which is an instance of google.rpc.Status. decodeRpcStatus(buffer) { const uint8array = new Uint8Array(buffer); const status = this.statusType.decode(uint8array); // google.rpc.Status contains an array of google.protobuf.Any // which need a special treatment const details = []; let errorInfo; for (const detail of status.details) { try { const decodedDetail = this.decodeProtobufAny(detail); details.push(decodedDetail); if (detail.type_url === 'type.googleapis.com/google.rpc.ErrorInfo') { errorInfo = decodedDetail; } } catch (err) { // cannot decode detail, likely because of the unknown type - just skip it } } const result = { code: status.code, message: status.message, statusDetails: details, reason: errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.reason, domain: errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.domain, errorInfoMetadata: errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.metadata, }; return result; } // Construct an Error from a StatusObject. // Adapted from https://github.com/grpc/grpc-node/blob/main/packages/grpc-js/src/call.ts#L79 callErrorFromStatus(status) { status.message = `${status.code} ${status_1.Status[status.code]}: ${status.message}`; return Object.assign(new GoogleError(status.message), status); } // Decodes gRPC-fallback error which is an instance of google.rpc.Status, // and puts it into the object similar to gRPC ServiceError object. decodeErrorFromBuffer(buffer) { return this.callErrorFromStatus(this.decodeRpcStatus(buffer)); } // Decodes gRPC metadata error details which is an instance of google.rpc.Status. decodeGRPCStatusDetails(bufferArr) { const details = []; let errorInfo; bufferArr.forEach(buffer => { const uint8array = new Uint8Array(buffer); const rpcStatus = this.statusType.decode(uint8array); for (const detail of rpcStatus.details) { try { const decodedDetail = this.decodeProtobufAny(detail); details.push(decodedDetail); if (detail.type_url === 'type.googleapis.com/google.rpc.ErrorInfo') { errorInfo = decodedDetail; } } catch (err) { // cannot decode detail, likely because of the unknown type - just skip it } } }); const result = { details, errorInfo, }; return result; } } exports.GoogleErrorDecoder = GoogleErrorDecoder; //# sourceMappingURL=googleError.js.map /***/ }), /***/ 68976: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GoogleProtoFilesRoot = exports.GrpcClient = exports.ClientStub = void 0; const grpcProtoLoader = __webpack_require__(98171); const child_process_1 = __webpack_require__(63129); const fs = __webpack_require__(35747); const google_auth_library_1 = __webpack_require__(20810); const grpc = __webpack_require__(7025); const os = __webpack_require__(12087); const path_1 = __webpack_require__(85622); const path = __webpack_require__(85622); const protobuf = __webpack_require__(85881); const objectHash = __webpack_require__(36935); const gax = __webpack_require__(80978); const googleProtoFilesDir = __webpack_require__.ab + "protos"; // INCLUDE_DIRS is passed to @grpc/proto-loader const INCLUDE_DIRS = []; INCLUDE_DIRS.push(googleProtoFilesDir); // COMMON_PROTO_FILES logic is here for protobufjs loads (see // GoogleProtoFilesRoot below) const commonProtoFiles = __webpack_require__(9397); // use the correct path separator for the OS we are running on const COMMON_PROTO_FILES = commonProtoFiles.map(file => file.replace(/[/\\]/g, path.sep)); /* * Async version of readFile. * * @returns {Promise} Contents of file at path. */ async function readFileAsync(path) { return new Promise((resolve, reject) => { fs.readFile(path, 'utf8', (err, content) => { if (err) return reject(err); else resolve(content); }); }); } /* * Async version of execFile. * * @returns {Promise} stdout from command execution. */ async function execFileAsync(command, args) { return new Promise((resolve, reject) => { child_process_1.execFile(command, args, (err, stdout) => { if (err) return reject(err); else resolve(stdout); }); }); } class ClientStub extends grpc.Client { } exports.ClientStub = ClientStub; class GrpcClient { /** * A class which keeps the context of gRPC and auth for the gRPC. * * @param {Object=} options - The optional parameters. It will be directly * passed to google-auth-library library, so parameters like keyFile or * credentials will be valid. * @param {Object=} options.auth - An instance of google-auth-library. * When specified, this auth instance will be used instead of creating * a new one. * @param {Object=} options.grpc - When specified, this will be used * for the 'grpc' module in this context. By default, it will load the grpc * module in the standard way. * @constructor */ constructor(options = {}) { var _a; this.auth = options.auth || new google_auth_library_1.GoogleAuth(options); this.fallback = false; const minimumVersion = 10; const major = Number((_a = process.version.match(/^v(\d+)/)) === null || _a === void 0 ? void 0 : _a[1]); if (Number.isNaN(major) || major < minimumVersion) { const errorMessage = `Node.js v${minimumVersion}.0.0 is a minimum requirement. To learn about legacy version support visit: ` + 'https://github.com/googleapis/google-cloud-node#supported-nodejs-versions'; throw new Error(errorMessage); } if ('grpc' in options) { this.grpc = options.grpc; this.grpcVersion = ''; } else { this.grpc = grpc; this.grpcVersion = __webpack_require__(68160)/* .version */ .i8; } } /** * Key for proto cache map. We are doing our best to make sure we respect * the options, so if the same proto file is loaded with different set of * options, the cache won't be used. Since some of the options are * Functions (e.g. `enums: String` - see below in `loadProto()`), * they will be omitted from the cache key. If the cache breaks anything * for you, use the `ignoreCache` parameter of `loadProto()` to disable it. */ static protoCacheKey(filename, options) { if (!filename || (Array.isArray(filename) && (filename.length === 0 || !filename[0]))) { return undefined; } return JSON.stringify(filename) + ' ' + JSON.stringify(options); } /** * In rare cases users might need to deallocate all memory consumed by loaded protos. * This method will delete the proto cache content. */ static clearProtoCache() { GrpcClient.protoCache.clear(); } /** * Creates a gRPC credentials. It asks the auth data if necessary. * @private * @param {Object} opts - options values for configuring credentials. * @param {Object=} opts.sslCreds - when specified, this is used instead * of default channel credentials. * @return {Promise} The promise which will be resolved to the gRPC credential. */ async _getCredentials(opts) { if (opts.sslCreds) { return opts.sslCreds; } const grpc = this.grpc; const sslCreds = opts.cert && opts.key ? grpc.credentials.createSsl(null, Buffer.from(opts.key), Buffer.from(opts.cert)) : grpc.credentials.createSsl(); const client = await this.auth.getClient(); const credentials = grpc.credentials.combineChannelCredentials(sslCreds, grpc.credentials.createFromGoogleCredential(client)); return credentials; } static defaultOptions() { // This set of @grpc/proto-loader options // 'closely approximates the existing behavior of grpc.load' const includeDirs = INCLUDE_DIRS.slice(); const options = { keepCase: false, longs: String, enums: String, defaults: true, oneofs: true, includeDirs, }; return options; } /** * Loads the gRPC service from the proto file(s) at the given path and with the * given options. Caches the loaded protos so the subsequent loads don't do * any disk reads. * @param filename The path to the proto file(s). * @param options Options for loading the proto file. * @param ignoreCache Defaults to `false`. Set it to `true` if the caching logic * incorrectly decides that the options object is the same, or if you want to * re-read the protos from disk for any other reason. */ loadFromProto(filename, options, ignoreCache = false) { const cacheKey = GrpcClient.protoCacheKey(filename, options); let grpcPackage = cacheKey ? GrpcClient.protoCache.get(cacheKey) : undefined; if (ignoreCache || !grpcPackage) { const packageDef = grpcProtoLoader.loadSync(filename, options); grpcPackage = this.grpc.loadPackageDefinition(packageDef); if (cacheKey) { GrpcClient.protoCache.set(cacheKey, grpcPackage); } } return grpcPackage; } /** * Load gRPC proto service from a filename looking in googleapis common protos * when necessary. Caches the loaded protos so the subsequent loads don't do * any disk reads. * @param {String} protoPath - The directory to search for the protofile. * @param {String|String[]} filename - The filename(s) of the proto(s) to be loaded. * If omitted, protoPath will be treated as a file path to load. * @param ignoreCache Defaults to `false`. Set it to `true` if the caching logic * incorrectly decides that the options object is the same, or if you want to * re-read the protos from disk for any other reason. * @return {Object} The gRPC loaded result (the toplevel namespace * object). */ loadProto(protoPath, filename, ignoreCache = false) { if (!filename) { filename = path.basename(protoPath); protoPath = path.dirname(protoPath); } if (Array.isArray(filename) && filename.length === 0) { return {}; } const options = GrpcClient.defaultOptions(); options.includeDirs.unshift(protoPath); return this.loadFromProto(filename, options, ignoreCache); } static _resolveFile(protoPath, filename) { if (fs.existsSync(path.join(protoPath, filename))) { return path.join(protoPath, filename); } else if (COMMON_PROTO_FILES.indexOf(filename) > -1) { return path.join(googleProtoFilesDir, filename); } throw new Error(filename + ' could not be found in ' + protoPath); } loadProtoJSON(json, ignoreCache = false) { const hash = objectHash(json).toString(); const cached = GrpcClient.protoCache.get(hash); if (cached && !ignoreCache) { return cached; } const options = GrpcClient.defaultOptions(); const packageDefinition = grpcProtoLoader.fromJSON(json, options); const grpcPackage = this.grpc.loadPackageDefinition(packageDefinition); GrpcClient.protoCache.set(hash, grpcPackage); return grpcPackage; } metadataBuilder(headers) { const Metadata = this.grpc.Metadata; const baseMetadata = new Metadata(); for (const key in headers) { const value = headers[key]; if (Array.isArray(value)) { value.forEach(v => baseMetadata.add(key, v)); } else { baseMetadata.set(key, `${value}`); } } return function buildMetadata(abTests, moreHeaders) { // TODO: bring the A/B testing info into the metadata. let copied = false; let metadata = baseMetadata; if (moreHeaders) { for (const key in moreHeaders) { if (key.toLowerCase() !== 'x-goog-api-client') { if (!copied) { copied = true; metadata = metadata.clone(); } const value = moreHeaders[key]; if (Array.isArray(value)) { value.forEach(v => metadata.add(key, v)); } else { metadata.set(key, `${value}`); } } } } return metadata; }; } /** * A wrapper of {@link constructSettings} function under the gRPC context. * * Most of parameters are common among constructSettings, please take a look. * @param {string} serviceName - The fullly-qualified name of the service. * @param {Object} clientConfig - A dictionary of the client config. * @param {Object} configOverrides - A dictionary of overriding configs. * @param {Object} headers - A dictionary of additional HTTP header name to * its value. * @return {Object} A mapping of method names to CallSettings. */ constructSettings(serviceName, clientConfig, configOverrides, headers) { return gax.constructSettings(serviceName, clientConfig, configOverrides, this.grpc.status, { metadataBuilder: this.metadataBuilder(headers) }); } /** * Creates a gRPC stub with current gRPC and auth. * @param {function} CreateStub - The constructor function of the stub. * @param {Object} options - The optional arguments to customize * gRPC connection. This options will be passed to the constructor of * gRPC client too. * @param {string} options.servicePath - The name of the server of the service. * @param {number} options.port - The port of the service. * @param {grpcTypes.ClientCredentials=} options.sslCreds - The credentials to be used * to set up gRPC connection. * @param {string} defaultServicePath - The default service path. * @return {Promise} A promise which resolves to a gRPC stub instance. */ async createStub(CreateStub, options, customServicePath) { // The following options are understood by grpc-gcp and need a special treatment // (should be passed without a `grpc.` prefix) const grpcGcpOptions = [ 'grpc.callInvocationTransformer', 'grpc.channelFactoryOverride', 'grpc.gcpApiConfig', ]; const [cert, key] = await this._detectClientCertificate(options); const servicePath = this._mtlsServicePath(options.servicePath, customServicePath, cert && key); const opts = Object.assign({}, options, { cert, key, servicePath }); const serviceAddress = servicePath + ':' + opts.port; const creds = await this._getCredentials(opts); const grpcOptions = {}; // @grpc/grpc-js limits max receive/send message length starting from v0.8.0 // https://github.com/grpc/grpc-node/releases/tag/%40grpc%2Fgrpc-js%400.8.0 // To keep the existing behavior and avoid libraries breakage, we pass -1 there as suggested. grpcOptions['grpc.max_receive_message_length'] = -1; grpcOptions['grpc.max_send_message_length'] = -1; grpcOptions['grpc.initial_reconnect_backoff_ms'] = 1000; Object.keys(opts).forEach(key => { const value = options[key]; // the older versions had a bug which required users to call an option // grpc.grpc.* to make it actually pass to gRPC as grpc.*, let's handle // this here until the next major release if (key.startsWith('grpc.grpc.')) { key = key.replace(/^grpc\./, ''); } if (key.startsWith('grpc.')) { if (grpcGcpOptions.includes(key)) { key = key.replace(/^grpc\./, ''); } grpcOptions[key] = value; } if (key.startsWith('grpc-node.')) { grpcOptions[key] = value; } }); const stub = new CreateStub(serviceAddress, creds, grpcOptions); return stub; } /** * Detect mTLS client certificate based on logic described in * https://google.aip.dev/auth/4114. * * @param {object} [options] - The configuration object. * @returns {Promise} Resolves array of strings representing cert and key. */ async _detectClientCertificate(opts) { var _a; const certRegex = /(?-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----)/s; const keyRegex = /(?-----BEGIN PRIVATE KEY-----.*?-----END PRIVATE KEY-----)/s; // If GOOGLE_API_USE_CLIENT_CERTIFICATE is true...: if (typeof process !== 'undefined' && ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.GOOGLE_API_USE_CLIENT_CERTIFICATE) === 'true') { if ((opts === null || opts === void 0 ? void 0 : opts.cert) && (opts === null || opts === void 0 ? void 0 : opts.key)) { return [opts.cert, opts.key]; } // If context aware metadata exists, run the cert provider command, // parse the output to extract cert and key, and use this cert/key. const metadataPath = path_1.join(os.homedir(), '.secureConnect', 'context_aware_metadata.json'); const metadata = JSON.parse(await readFileAsync(metadataPath)); if (!metadata.cert_provider_command) { throw Error('no cert_provider_command found'); } const stdout = await execFileAsync(metadata.cert_provider_command[0], metadata.cert_provider_command.slice(1)); const matchCert = stdout.toString().match(certRegex); const matchKey = stdout.toString().match(keyRegex); if (!((matchCert === null || matchCert === void 0 ? void 0 : matchCert.groups) && (matchKey === null || matchKey === void 0 ? void 0 : matchKey.groups))) { throw Error('unable to parse certificate and key'); } else { return [matchCert.groups.cert, matchKey.groups.key]; } } // If GOOGLE_API_USE_CLIENT_CERTIFICATE is not set or false, // use no cert or key: return [undefined, undefined]; } /** * Return service path, taking into account mTLS logic. * See: https://google.aip.dev/auth/4114 * * @param {string|undefined} servicePath - The path of the service. * @param {string|undefined} customServicePath - Did the user provide a custom service URL. * @param {boolean} hasCertificate - Was a certificate found. * @returns {string} The DNS address for this service. */ _mtlsServicePath(servicePath, customServicePath, hasCertificate) { var _a, _b; // If user provides a custom service path, return the current service // path and do not attempt to add mtls subdomain: if (customServicePath || !servicePath) return servicePath; if (typeof process !== 'undefined' && ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.GOOGLE_API_USE_MTLS_ENDPOINT) === 'never') { // It was explicitly asked that mtls endpoint not be used: return servicePath; } else if ((typeof process !== 'undefined' && ((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.GOOGLE_API_USE_MTLS_ENDPOINT) === 'always') || hasCertificate) { // Either auto-detect or explicit setting of endpoint: return servicePath.replace('googleapis.com', 'mtls.googleapis.com'); } return servicePath; } /** * Creates a 'bytelength' function for a given proto message class. * * See {@link BundleDescriptor} about the meaning of the return value. * * @param {function} message - a constructor function that is generated by * protobuf.js. Assumes 'encoder' field in the message. * @return {function(Object):number} - a function to compute the byte length * for an object. */ static createByteLengthFunction(message) { return function getByteLength(obj) { return message.encode(obj).finish().length; }; } } exports.GrpcClient = GrpcClient; GrpcClient.protoCache = new Map(); class GoogleProtoFilesRoot extends protobuf.Root { constructor(...args) { super(...args); } // Causes the loading of an included proto to check if it is a common // proto. If it is a common proto, use the bundled proto. resolvePath(originPath, includePath) { originPath = path.normalize(originPath); includePath = path.normalize(includePath); // Fully qualified paths don't need to be resolved. if (path.isAbsolute(includePath)) { if (!fs.existsSync(includePath)) { throw new Error('The include `' + includePath + '` was not found.'); } return includePath; } if (COMMON_PROTO_FILES.indexOf(includePath) > -1) { return path.join(googleProtoFilesDir, includePath); } return GoogleProtoFilesRoot._findIncludePath(originPath, includePath); } static _findIncludePath(originPath, includePath) { originPath = path.normalize(originPath); includePath = path.normalize(includePath); let current = originPath; let found = fs.existsSync(path.join(current, includePath)); while (!found && current.length > 0) { current = current.substring(0, current.lastIndexOf(path.sep)); found = fs.existsSync(path.join(current, includePath)); } if (!found) { throw new Error('The include `' + includePath + '` was not found.'); } return path.join(current, includePath); } } exports.GoogleProtoFilesRoot = GoogleProtoFilesRoot; //# sourceMappingURL=grpc.js.map /***/ }), /***/ 28118: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** Object.defineProperty(exports, "__esModule", ({ value: true })); exports.IamClient = void 0; const grpc_1 = __webpack_require__(68976); const fallback_1 = __webpack_require__(90418); const createApiCall_1 = __webpack_require__(79712); const routingHeader = __webpack_require__(8827); const gapicConfig = __webpack_require__(80784); const fallback = __webpack_require__(90418); let version = __webpack_require__(56156).version; const jsonProtos = __webpack_require__(57518); /** * Google Cloud IAM Client. * This is manually written for providing methods [setIamPolicy, getIamPolicy, testIamPerssion] to the generated client. */ class IamClient { constructor(gaxGrpc, // eslint-disable-next-line @typescript-eslint/no-explicit-any options) { this._terminated = false; this.descriptors = { page: {}, stream: {}, longrunning: {} }; this.innerApiCalls = {}; this.gaxGrpc = gaxGrpc; // Ensure that options include the service address and port. const opts = Object.assign({ servicePath: options.servicePath, port: options.port, clientConfig: options.clientConfig, apiEndpoint: options.apiEndpoint, fallback: options.fallback, }, options); version = opts.fallback ? fallback.version : version; this._gaxGrpc = opts.fallback ? new fallback_1.GrpcClient(opts) : new grpc_1.GrpcClient(opts); opts.scopes = this.constructor.scopes; // Save options to use in initialize() method. this._opts = opts; // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. const clientHeader = [`gax/${version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${version}`); } if (!opts.fallback) { clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // Put together the default options sent with requests. this._defaults = gaxGrpc.constructSettings('google.iam.v1.IAMPolicy', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') }); this.innerApiCalls = {}; } /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize() { // If the client stub promise is already initialized, return immediately. if (this.iamPolicyStub) { return this.iamPolicyStub; } // Put together the "service stub" for // google.iam.v1.IAMPolicy. this.iamPolicyStub = this.gaxGrpc.createStub(this._opts.fallback ? this._protos.lookupService('google.iam.v1.IAMPolicy') : this._protos.google.iam.v1.IAMPolicy, this._opts); // Iterate over each of the methods that the service provides // and create an API call method for each. const iamPolicyStubMethods = [ 'getIamPolicy', 'setIamPolicy', 'testIamPermissions', ]; for (const methodName of iamPolicyStubMethods) { const innerCallPromise = this.iamPolicyStub.then(stub => (...args) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; return func.apply(stub, args); }, (err) => () => { throw err; }); this.innerApiCalls[methodName] = createApiCall_1.createApiCall(innerCallPromise, this._defaults[methodName], this.descriptors.page[methodName]); } return this.iamPolicyStub; } /** * The DNS address for this API service. */ static get servicePath() { return 'cloudkms.googleapis.com'; } /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. */ static get apiEndpoint() { return 'cloudkms.googleapis.com'; } /** * The port for this API service. */ static get port() { return 443; } /** * The scopes needed to make gRPC calls for every method defined * in this service. */ static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/cloudkms', ]; } getProjectId(callback) { if (this.auth && 'getProjectId' in this.auth) { return this.auth.getProjectId(callback); } if (callback) { callback(new Error('Cannot determine project ID.')); } else { return Promise.reject('Cannot determine project ID.'); } } getIamPolicy(request, optionsOrCallback, callback) { let options; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = routingHeader.fromParams({ resource: request.resource, }); this.initialize(); return this.innerApiCalls.getIamPolicy(request, options, callback); } setIamPolicy(request, optionsOrCallback, callback) { let options; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = routingHeader.fromParams({ resource: request.resource, }); this.initialize(); return this.innerApiCalls.setIamPolicy(request, options, callback); } testIamPermissions(request, optionsOrCallback, callback) { let options; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = routingHeader.fromParams({ resource: request.resource, }); this.initialize(); return this.innerApiCalls.testIamPermissions(request, options, callback); } /** * Terminate the GRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. */ close() { this.initialize(); if (!this._terminated) { return this.iamPolicyStub.then(stub => { this._terminated = true; stub.close(); }); } return Promise.resolve(); } } exports.IamClient = IamClient; //# sourceMappingURL=iamService.js.map /***/ }), /***/ 12263: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.serializer = exports.fallback = exports.protobuf = exports.version = exports.createByteLengthFunction = exports.LocationProtos = exports.IamProtos = exports.operationsProtos = exports.lro = exports.routingHeader = exports.grpc = void 0; const grpc = __webpack_require__(7025); exports.grpc = grpc; const grpc_1 = __webpack_require__(68976); const IamProtos = __webpack_require__(83555); exports.IamProtos = IamProtos; const LocationProtos = __webpack_require__(22560); exports.LocationProtos = LocationProtos; const operationsProtos = __webpack_require__(59081); exports.operationsProtos = operationsProtos; const operationsClient = __webpack_require__(82450); const routingHeader = __webpack_require__(8827); exports.routingHeader = routingHeader; var google_auth_library_1 = __webpack_require__(20810); Object.defineProperty(exports, "GoogleAuth", ({ enumerable: true, get: function () { return google_auth_library_1.GoogleAuth; } })); var call_1 = __webpack_require__(53047); Object.defineProperty(exports, "OngoingCall", ({ enumerable: true, get: function () { return call_1.OngoingCall; } })); var createApiCall_1 = __webpack_require__(79712); Object.defineProperty(exports, "createApiCall", ({ enumerable: true, get: function () { return createApiCall_1.createApiCall; } })); var descriptor_1 = __webpack_require__(13627); Object.defineProperty(exports, "BundleDescriptor", ({ enumerable: true, get: function () { return descriptor_1.BundleDescriptor; } })); Object.defineProperty(exports, "LongrunningDescriptor", ({ enumerable: true, get: function () { return descriptor_1.LongrunningDescriptor; } })); Object.defineProperty(exports, "PageDescriptor", ({ enumerable: true, get: function () { return descriptor_1.PageDescriptor; } })); Object.defineProperty(exports, "StreamDescriptor", ({ enumerable: true, get: function () { return descriptor_1.StreamDescriptor; } })); var gax_1 = __webpack_require__(80978); Object.defineProperty(exports, "CallSettings", ({ enumerable: true, get: function () { return gax_1.CallSettings; } })); Object.defineProperty(exports, "constructSettings", ({ enumerable: true, get: function () { return gax_1.constructSettings; } })); Object.defineProperty(exports, "RetryOptions", ({ enumerable: true, get: function () { return gax_1.RetryOptions; } })); Object.defineProperty(exports, "createRetryOptions", ({ enumerable: true, get: function () { return gax_1.createRetryOptions; } })); Object.defineProperty(exports, "createBundleOptions", ({ enumerable: true, get: function () { return gax_1.createBundleOptions; } })); Object.defineProperty(exports, "createBackoffSettings", ({ enumerable: true, get: function () { return gax_1.createBackoffSettings; } })); Object.defineProperty(exports, "createDefaultBackoffSettings", ({ enumerable: true, get: function () { return gax_1.createDefaultBackoffSettings; } })); Object.defineProperty(exports, "createMaxRetriesBackoffSettings", ({ enumerable: true, get: function () { return gax_1.createMaxRetriesBackoffSettings; } })); var googleError_1 = __webpack_require__(6634); Object.defineProperty(exports, "GoogleError", ({ enumerable: true, get: function () { return googleError_1.GoogleError; } })); var grpc_2 = __webpack_require__(68976); Object.defineProperty(exports, "ClientStub", ({ enumerable: true, get: function () { return grpc_2.ClientStub; } })); Object.defineProperty(exports, "GoogleProtoFilesRoot", ({ enumerable: true, get: function () { return grpc_2.GoogleProtoFilesRoot; } })); Object.defineProperty(exports, "GrpcClient", ({ enumerable: true, get: function () { return grpc_2.GrpcClient; } })); var longrunning_1 = __webpack_require__(83481); Object.defineProperty(exports, "Operation", ({ enumerable: true, get: function () { return longrunning_1.Operation; } })); Object.defineProperty(exports, "operation", ({ enumerable: true, get: function () { return longrunning_1.operation; } })); var pathTemplate_1 = __webpack_require__(20513); Object.defineProperty(exports, "PathTemplate", ({ enumerable: true, get: function () { return pathTemplate_1.PathTemplate; } })); var status_1 = __webpack_require__(53501); Object.defineProperty(exports, "Status", ({ enumerable: true, get: function () { return status_1.Status; } })); var streaming_1 = __webpack_require__(67389); Object.defineProperty(exports, "StreamType", ({ enumerable: true, get: function () { return streaming_1.StreamType; } })); function lro(options) { options = Object.assign({ scopes: lro.ALL_SCOPES }, options); const gaxGrpc = new grpc_1.GrpcClient(options); return new operationsClient.OperationsClientBuilder(gaxGrpc); } exports.lro = lro; lro.SERVICE_ADDRESS = operationsClient.SERVICE_ADDRESS; lro.ALL_SCOPES = operationsClient.ALL_SCOPES; var operationsClient_1 = __webpack_require__(82450); Object.defineProperty(exports, "OperationsClient", ({ enumerable: true, get: function () { return operationsClient_1.OperationsClient; } })); var iamService_1 = __webpack_require__(28118); Object.defineProperty(exports, "IamClient", ({ enumerable: true, get: function () { return iamService_1.IamClient; } })); var locationService_1 = __webpack_require__(58591); Object.defineProperty(exports, "LocationsClient", ({ enumerable: true, get: function () { return locationService_1.LocationsClient; } })); exports.createByteLengthFunction = grpc_1.GrpcClient.createByteLengthFunction; exports.version = __webpack_require__(56156).version; const protobuf = __webpack_require__(85881); exports.protobuf = protobuf; exports.protobufMinimal = __webpack_require__(96916); const fallback = __webpack_require__(90418); exports.fallback = fallback; var grpc_js_1 = __webpack_require__(7025); Object.defineProperty(exports, "ChannelCredentials", ({ enumerable: true, get: function () { return grpc_js_1.ChannelCredentials; } })); var warnings_1 = __webpack_require__(16328); Object.defineProperty(exports, "warn", ({ enumerable: true, get: function () { return warnings_1.warn; } })); const serializer = __webpack_require__(2027); exports.serializer = serializer; //# sourceMappingURL=index.js.map /***/ }), /***/ 58591: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LocationsClient = void 0; /* global window */ const gax = __webpack_require__(80978); const warnings_1 = __webpack_require__(16328); const grpc_1 = __webpack_require__(68976); const createApiCall_1 = __webpack_require__(79712); const routingHeader = __webpack_require__(8827); const pageDescriptor_1 = __webpack_require__(71172); const jsonProtos = __webpack_require__(75022); /** * This file defines retry strategy and timeouts for all API methods in this library. */ const gapicConfig = __webpack_require__(35845); const version = __webpack_require__(56156).version; /** * Google Cloud Locations Client. * This is manually written for providing methods [listLocations, getLocations] to the generated client. */ class LocationsClient { /** * Construct an instance of LocationsClient. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` * if you need to override this behavior. */ constructor(gaxGrpc, // eslint-disable-next-line @typescript-eslint/no-explicit-any opts) { var _a, _b; this._terminated = false; this.descriptors = { page: {}, stream: {}, longrunning: {}, batching: {}, }; // Ensure that options include all the required fields. this.gaxGrpc = gaxGrpc; const staticMembers = this.constructor; const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; } // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new grpc_1.GrpcClient(opts); // Save options to use in initialize() method. this._opts = opts; // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth; // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } // Determine the client header string. const clientHeader = [`gax/${version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { clientHeader.push(`gl-web/${version}`); } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } else if (opts.fallback === 'rest') { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // Some of the methods on this service return "paged" results, // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { listLocations: new pageDescriptor_1.PageDescriptor('pageToken', 'nextPageToken', 'locations'), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings('google.cloud.location.Locations', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') }); // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. this.warn = warnings_1.warn; } /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize() { // If the client stub promise is already initialized, return immediately. if (this.locationsStub) { return this.locationsStub; } // Put together the "service stub" for // google.cloud.location.Locations. this.locationsStub = this.gaxGrpc.createStub(this._opts.fallback ? this._protos.lookupService('google.cloud.location.Locations') : // eslint-disable-next-line @typescript-eslint/no-explicit-any this._protos.google.cloud.location.Locations, this._opts, this._providedCustomServicePath); // Iterate over each of the methods that the service provides // and create an API call method for each. const locationsStubMethods = ['listLocations', 'getLocation']; for (const methodName of locationsStubMethods) { const callPromise = this.locationsStub.then(stub => (...args) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; return func.apply(stub, args); }, (err) => () => { throw err; }); const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = createApiCall_1.createApiCall(callPromise, this._defaults[methodName], descriptor); this.innerApiCalls[methodName] = apiCall; } return this.locationsStub; } /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ static get servicePath() { return 'cloud.googleapis.com'; } /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. * @returns {string} The DNS address for this service. */ static get apiEndpoint() { return 'cloud.googleapis.com'; } /** * The port for this API service. * @returns {number} The default port for this service. */ static get port() { return 443; } /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes() { return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(callback) { if (callback) { this.auth.getProjectId(callback); return; } return this.auth.getProjectId(); } /** * Gets information about a location. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Resource name for the location. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Location]{@link google.cloud.location.Location}. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#regular-methods) * for more details and examples. * @example * const [response] = await client.getLocation(request); */ getLocation(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.getLocation(request, options, callback); } /** * Lists information about the supported locations for this service. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * The resource that owns the locations collection, if applicable. * @param {string} request.filter * The standard list filter. * @param {number} request.pageSize * The standard list page size. * @param {string} request.pageToken * The standard list page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [Location]{@link google.cloud.location.Location}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. * We recommend using `listLocationsAsync()` * method described below for async iteration which you can stop as needed. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination) * for more details and examples. */ listLocations(request, optionsOrCallback, callback) { request = request || {}; let options; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = routingHeader.fromParams({ name: request.name || '', }); this.initialize(); return this.innerApiCalls.listLocations(request, options, callback); } /** * Equivalent to `listLocations`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.name * The resource that owns the locations collection, if applicable. * @param {string} request.filter * The standard list filter. * @param {number} request.pageSize * The standard list page size. * @param {string} request.pageToken * The standard list page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). * When you iterate the returned iterable, each element will be an object representing * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination) * for more details and examples. * @example * const iterable = client.listLocationsAsync(request); * for await (const response of iterable) { * // process response * } */ listLocationsAsync(request, options) { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = routingHeader.fromParams({ name: request.name || '', }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listLocations.asyncIterate(this.innerApiCalls['listLocations'], request, callSettings); } /** * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. * @returns {Promise} A promise that resolves when the client is closed. */ close() { this.initialize(); if (!this._terminated) { return this.locationsStub.then(stub => { this._terminated = true; stub.close(); }); } return Promise.resolve(); } } exports.LocationsClient = LocationsClient; //# sourceMappingURL=locationService.js.map /***/ }), /***/ 74729: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LongrunningApiCaller = void 0; const call_1 = __webpack_require__(53047); const gax_1 = __webpack_require__(80978); const longrunning_1 = __webpack_require__(83481); class LongrunningApiCaller { /** * Creates an API caller that performs polling on a long running operation. * * @private * @constructor * @param {LongRunningDescriptor} longrunningDescriptor - Holds the * decoders used for unpacking responses and the operationsClient * used for polling the operation. */ constructor(longrunningDescriptor) { this.longrunningDescriptor = longrunningDescriptor; } init(callback) { if (callback) { return new call_1.OngoingCall(callback); } return new call_1.OngoingCallPromise(); } wrap(func) { return func; } call(apiCall, argument, settings, canceller) { canceller.call((argument, callback) => { return this._wrapOperation(apiCall, settings, argument, callback); }, argument); } _wrapOperation(apiCall, settings, argument, callback) { let backoffSettings = settings.longrunning; if (!backoffSettings) { backoffSettings = gax_1.createDefaultBackoffSettings(); } const longrunningDescriptor = this.longrunningDescriptor; return apiCall(argument, (err, rawResponse) => { if (err) { callback(err, null, null, rawResponse); return; } const operation = new longrunning_1.Operation(rawResponse, longrunningDescriptor, backoffSettings, settings); callback(null, operation, rawResponse); }); } fail(canceller, err) { canceller.callback(err); } result(canceller) { return canceller.promise; } } exports.LongrunningApiCaller = LongrunningApiCaller; //# sourceMappingURL=longRunningApiCaller.js.map /***/ }), /***/ 8096: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LongRunningDescriptor = void 0; const longRunningApiCaller_1 = __webpack_require__(74729); /** * A descriptor for long-running operations. */ class LongRunningDescriptor { constructor(operationsClient, responseDecoder, metadataDecoder) { this.operationsClient = operationsClient; this.responseDecoder = responseDecoder; this.metadataDecoder = metadataDecoder; } getApiCaller() { return new longRunningApiCaller_1.LongrunningApiCaller(this); } } exports.LongRunningDescriptor = LongRunningDescriptor; //# sourceMappingURL=longRunningDescriptor.js.map /***/ }), /***/ 83481: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.operation = exports.Operation = void 0; const events_1 = __webpack_require__(28614); const status_1 = __webpack_require__(53501); const googleError_1 = __webpack_require__(6634); const operationProtos = __webpack_require__(59081); class Operation extends events_1.EventEmitter { /** * Wrapper for a google.longrunnung.Operation. * * @constructor * * @param {google.longrunning.Operation} grpcOp - The operation to be wrapped. * @param {LongRunningDescriptor} longrunningDescriptor - This defines the * operations service client and unpacking mechanisms for the operation. * @param {BackoffSettings} backoffSettings - The backoff settings used in * in polling the operation. * @param {CallOptions} callOptions - CallOptions used in making get operation * requests. */ constructor(grpcOp, longrunningDescriptor, backoffSettings, callOptions) { super(); this.completeListeners = 0; this.hasActiveListeners = false; this.latestResponse = grpcOp; this.name = this.latestResponse.name; this.done = this.latestResponse.done; this.error = this.latestResponse.error; this.longrunningDescriptor = longrunningDescriptor; this.result = null; this.metadata = null; this.backoffSettings = backoffSettings; this._unpackResponse(grpcOp); this._listenForEvents(); this._callOptions = callOptions; } /** * Begin listening for events on the operation. This method keeps track of how * many "complete" listeners are registered and removed, making sure polling * is handled automatically. * * As long as there is one active "complete" listener, the connection is open. * When there are no more listeners, the polling stops. * * @private */ _listenForEvents() { this.on('newListener', event => { if (event === 'complete') { this.completeListeners++; if (!this.hasActiveListeners) { this.hasActiveListeners = true; this.startPolling_(); } } }); this.on('removeListener', event => { if (event === 'complete' && --this.completeListeners === 0) { this.hasActiveListeners = false; } }); } /** * Cancels current polling api call and cancels the operation. * * @return {Promise} the promise of the OperationsClient#cancelOperation api * request. */ cancel() { if (this.currentCallPromise_) { this.currentCallPromise_.cancel(); } const operationsClient = this.longrunningDescriptor.operationsClient; const cancelRequest = new operationProtos.google.longrunning.CancelOperationRequest(); cancelRequest.name = this.latestResponse.name; return operationsClient.cancelOperation(cancelRequest); } getOperation(callback) { // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; const operationsClient = this.longrunningDescriptor.operationsClient; function promisifyResponse() { if (!callback) { return new Promise((resolve, reject) => { if (self.latestResponse.error) { const error = new googleError_1.GoogleError(self.latestResponse.error.message); error.code = self.latestResponse.error.code; reject(error); } else { resolve([self.result, self.metadata, self.latestResponse]); } }); } return; } if (this.latestResponse.done) { this._unpackResponse(this.latestResponse, callback); return promisifyResponse(); } const request = new operationProtos.google.longrunning.GetOperationRequest(); request.name = this.latestResponse.name; this.currentCallPromise_ = operationsClient.getOperationInternal(request, this._callOptions); const noCallbackPromise = this.currentCallPromise_.then(responses => { self.latestResponse = responses[0]; self._unpackResponse(responses[0], callback); return promisifyResponse(); }); if (!callback) { return noCallbackPromise; } } _unpackResponse(op, callback) { const responseDecoder = this.longrunningDescriptor.responseDecoder; const metadataDecoder = this.longrunningDescriptor.metadataDecoder; let response; let metadata; if (op.done) { if (op.result === 'error') { const error = new googleError_1.GoogleError(op.error.message); error.code = op.error.code; this.error = error; if (callback) { callback(error); } return; } if (responseDecoder && op.response) { this.response = op.response; response = responseDecoder(op.response.value); this.result = response; this.done = true; } } if (metadataDecoder && op.metadata) { metadata = metadataDecoder(op.metadata.value); this.metadata = metadata; } if (callback) { callback(null, response, metadata, op); } } /** * Poll `getOperation` to check the operation's status. This runs a loop to * ping using the backoff strategy specified at initialization. * * Note: This method is automatically called once a "complete" event handler * is registered on the operation. * * @private */ startPolling_() { // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; let now = new Date(); const delayMult = this.backoffSettings.retryDelayMultiplier; const maxDelay = this.backoffSettings.maxRetryDelayMillis; let delay = this.backoffSettings.initialRetryDelayMillis; let deadline = Infinity; if (this.backoffSettings.totalTimeoutMillis) { deadline = now.getTime() + this.backoffSettings.totalTimeoutMillis; } let previousMetadataBytes; if (this.latestResponse.metadata) { previousMetadataBytes = this.latestResponse.metadata.value; } // eslint-disable-next-line @typescript-eslint/no-explicit-any function emit(event, ...args) { self.emit(event, ...args); } // Helper function to replace nodejs buffer's equals() function arrayEquals(a, b) { if (a.byteLength !== b.byteLength) { return false; } for (let i = 0; i < a.byteLength; ++i) { if (a[i] !== b[i]) return false; } return true; } function retry() { if (!self.hasActiveListeners) { return; } if (now.getTime() >= deadline) { const error = new googleError_1.GoogleError('Total timeout exceeded before any response was received'); error.code = status_1.Status.DEADLINE_EXCEEDED; setImmediate(emit, 'error', error); return; } self.getOperation((err, result, metadata, rawResponse) => { if (err) { setImmediate(emit, 'error', err); return; } if (!result) { if (rawResponse.metadata && (!previousMetadataBytes || (rawResponse && !arrayEquals(rawResponse.metadata.value, previousMetadataBytes)))) { setImmediate(emit, 'progress', metadata, rawResponse); previousMetadataBytes = rawResponse.metadata.value; } // special case: some APIs fail to set either result or error // but set done = true (e.g. speech with silent file). // Some APIs just use this for the normal completion // (e.g. nodejs-contact-center-insights), so let's just return // an empty response in this case. if (rawResponse.done) { setImmediate(emit, 'complete', {}, metadata, rawResponse); return; } setTimeout(() => { now = new Date(); delay = Math.min(delay * delayMult, maxDelay); retry(); }, delay); return; } setImmediate(emit, 'complete', result, metadata, rawResponse); }); } retry(); } /** * Wraps the `complete` and `error` events in a Promise. * * @return {promise} - Promise that resolves on operation completion and rejects * on operation error. */ promise() { return new Promise((resolve, reject) => { this.on('error', reject).on('complete', (result, metadata, rawResponse) => { resolve([result, metadata, rawResponse]); }); }); } } exports.Operation = Operation; /** * Method used to create Operation objects. * * @constructor * * @param {google.longrunning.Operation} op - The operation to be wrapped. * @param {LongRunningDescriptor} longrunningDescriptor - This defines the * operations service client and unpacking mechanisms for the operation. * @param {BackoffSettings} backoffSettings - The backoff settings used in * in polling the operation. * @param {CallOptions=} callOptions - CallOptions used in making get operation * requests. */ function operation(op, longrunningDescriptor, backoffSettings, callOptions) { return new Operation(op, longrunningDescriptor, backoffSettings, callOptions); } exports.operation = operation; //# sourceMappingURL=longrunning.js.map /***/ }), /***/ 56513: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NormalApiCaller = void 0; const call_1 = __webpack_require__(53047); /** * Creates an API caller for regular unary methods. */ class NormalApiCaller { init(callback) { if (callback) { return new call_1.OngoingCall(callback); } return new call_1.OngoingCallPromise(); } wrap(func) { return func; } call(apiCall, argument, settings, canceller) { canceller.call(apiCall, argument); } fail(canceller, err) { canceller.callback(err); } result(canceller) { return canceller.promise; } } exports.NormalApiCaller = NormalApiCaller; //# sourceMappingURL=normalApiCaller.js.map /***/ }), /***/ 69742: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.retryable = void 0; const status_1 = __webpack_require__(53501); const googleError_1 = __webpack_require__(6634); const timeout_1 = __webpack_require__(4531); /** * Creates a function equivalent to func, but that retries on certain * exceptions. * * @private * * @param {GRPCCall} func - A function. * @param {RetryOptions} retry - Configures the exceptions upon which the * function eshould retry, and the parameters to the exponential backoff retry * algorithm. * @param {GRPCCallOtherArgs} otherArgs - the additional arguments to be passed to func. * @return {SimpleCallbackFunction} A function that will retry. */ function retryable(func, retry, otherArgs, apiName) { const delayMult = retry.backoffSettings.retryDelayMultiplier; const maxDelay = retry.backoffSettings.maxRetryDelayMillis; const timeoutMult = retry.backoffSettings.rpcTimeoutMultiplier; const maxTimeout = retry.backoffSettings.maxRpcTimeoutMillis; let delay = retry.backoffSettings.initialRetryDelayMillis; let timeout = retry.backoffSettings.initialRpcTimeoutMillis; /** * Equivalent to ``func``, but retries upon transient failure. * * Retrying is done through an exponential backoff algorithm configured * by the options in ``retry``. * @param {RequestType} argument The request object. * @param {APICallback} callback The callback. * @return {GRPCCall} */ return (argument, callback) => { let canceller; let timeoutId; let now = new Date(); let deadline; if (retry.backoffSettings.totalTimeoutMillis) { deadline = now.getTime() + retry.backoffSettings.totalTimeoutMillis; } let retries = 0; const maxRetries = retry.backoffSettings.maxRetries; // TODO: define A/B testing values for retry behaviors. /** Repeat the API call as long as necessary. */ function repeat() { timeoutId = null; if (deadline && now.getTime() >= deadline) { const error = new googleError_1.GoogleError(`Total timeout of API ${apiName} exceeded ${retry.backoffSettings.totalTimeoutMillis} milliseconds before any response was received.`); error.code = status_1.Status.DEADLINE_EXCEEDED; callback(error); return; } if (retries && retries >= maxRetries) { const error = new googleError_1.GoogleError('Exceeded maximum number of retries before any ' + 'response was received'); error.code = status_1.Status.DEADLINE_EXCEEDED; callback(error); return; } retries++; const toCall = timeout_1.addTimeoutArg(func, timeout, otherArgs); canceller = toCall(argument, (err, response, next, rawResponse) => { if (!err) { callback(null, response, next, rawResponse); return; } canceller = null; if (retry.retryCodes.indexOf(err.code) < 0) { err.note = 'Exception occurred in retry method that was ' + 'not classified as transient'; callback(err); } else { const toSleep = Math.random() * delay; timeoutId = setTimeout(() => { now = new Date(); delay = Math.min(delay * delayMult, maxDelay); const timeoutCal = timeout && timeoutMult ? timeout * timeoutMult : 0; const rpcTimeout = maxTimeout ? maxTimeout : 0; const newDeadline = deadline ? deadline - now.getTime() : 0; timeout = Math.min(timeoutCal, rpcTimeout, newDeadline); repeat(); }, toSleep); } }); } if (maxRetries && deadline) { const error = new googleError_1.GoogleError('Cannot set both totalTimeoutMillis and maxRetries ' + 'in backoffSettings.'); error.code = status_1.Status.INVALID_ARGUMENT; callback(error); } else { repeat(); } return { cancel() { if (timeoutId) { clearTimeout(timeoutId); } if (canceller) { canceller.cancel(); } else { const error = new googleError_1.GoogleError('cancelled'); error.code = status_1.Status.CANCELLED; callback(error); } }, }; }; } exports.retryable = retryable; //# sourceMappingURL=retries.js.map /***/ }), /***/ 4531: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addTimeoutArg = void 0; /** * Updates func so that it gets called with the timeout as its final arg. * * This converts a function, func, into another function with updated deadline. * * @private * * @param {GRPCCall} func - a function to be updated. * @param {number} timeout - to be added to the original function as it final * positional arg. * @param {Object} otherArgs - the additional arguments to be passed to func. * @param {Object=} abTests - the A/B testing key/value pairs. * @return {function(Object, APICallback)} * the function with other arguments and the timeout. */ function addTimeoutArg(func, timeout, otherArgs, abTests) { // TODO: this assumes the other arguments consist of metadata and options, // which is specific to gRPC calls. Remove the hidden dependency on gRPC. return (argument, callback) => { const now = new Date(); const options = otherArgs.options || {}; options.deadline = new Date(now.getTime() + timeout); const metadata = otherArgs.metadataBuilder ? otherArgs.metadataBuilder(abTests, otherArgs.headers || {}) : null; return func(argument, metadata, options, callback); }; } exports.addTimeoutArg = addTimeoutArg; //# sourceMappingURL=timeout.js.map /***/ }), /***/ 82450: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OperationsClientBuilder = exports.OperationsClient = exports.ALL_SCOPES = exports.SERVICE_ADDRESS = void 0; const createApiCall_1 = __webpack_require__(79712); const descriptor_1 = __webpack_require__(13627); const gax = __webpack_require__(80978); const configData = __webpack_require__(86065); const protoJson = __webpack_require__(36934); exports.SERVICE_ADDRESS = 'longrunning.googleapis.com'; const version = __webpack_require__(56156).version; const DEFAULT_SERVICE_PORT = 443; const CODE_GEN_NAME_VERSION = 'gapic/0.7.1'; /** * The scopes needed to make gRPC calls to all of the methods defined in * this service. */ exports.ALL_SCOPES = []; /** * Manages long-running operations with an API service. * * When an API method normally takes long time to complete, it can be designed * to return {@link Operation} to the client, and the client can use this * interface to receive the real response asynchronously by polling the * operation resource, or pass the operation resource to another API (such as * Google Cloud Pub/Sub API) to receive the response. Any API service that * returns long-running operations should implement the `Operations` interface * so developers can have a consistent client experience. * * This will be created through a builder function which can be obtained by the * module. See the following example of how to initialize the module and how to * access to the builder. * @see {@link operationsClient} * * @class */ class OperationsClient { constructor(gaxGrpc, // eslint-disable-next-line @typescript-eslint/no-explicit-any operationsProtos, options) { const opts = Object.assign({ servicePath: exports.SERVICE_ADDRESS, port: DEFAULT_SERVICE_PORT, clientConfig: {}, }, options); const googleApiClient = ['gl-node/' + process.versions.node]; if (opts.libName && opts.libVersion) { googleApiClient.push(opts.libName + '/' + opts.libVersion); } googleApiClient.push(CODE_GEN_NAME_VERSION, 'gax/' + version); if (opts.fallback) { googleApiClient.push('gl-web/' + version); } else { googleApiClient.push('grpc/' + gaxGrpc.grpcVersion); } const defaults = gaxGrpc.constructSettings('google.longrunning.Operations', configData, opts.clientConfig || {}, { 'x-goog-api-client': googleApiClient.join(' ') }); this.auth = gaxGrpc.auth; // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; this.descriptor = { listOperations: new descriptor_1.PageDescriptor('pageToken', 'nextPageToken', 'operations'), }; // Put together the "service stub" for // google.longrunning.Operations. this.operationsStub = gaxGrpc.createStub(opts.fallback ? operationsProtos.lookupService('google.longrunning.Operations') : operationsProtos.google.longrunning.Operations, opts); const operationsStubMethods = [ 'getOperation', 'listOperations', 'cancelOperation', 'deleteOperation', ]; for (const methodName of operationsStubMethods) { const innerCallPromise = this.operationsStub.then(stub => (...args) => { const func = stub[methodName]; return func.apply(stub, args); }, err => () => { throw err; }); this.innerApiCalls[methodName] = createApiCall_1.createApiCall(innerCallPromise, defaults[methodName], this.descriptor[methodName]); } } /** Closes this operations client. */ close() { this.operationsStub.then(stub => stub.close()); } getProjectId(callback) { if (this.auth && 'getProjectId' in this.auth) { return this.auth.getProjectId(callback); } if (callback) { callback(new Error('Cannot determine project ID.')); } else { return Promise.reject('Cannot determine project ID.'); } } // Service calls getOperationInternal(request, options, callback) { request = request || {}; options = options || {}; return this.innerApiCalls.getOperation(request, options, callback); } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param {Object} request - The request object that will be sent. * @param {string} request.name - The name of the operation resource. * @param {Object=} options * Optional parameters. You can override the default settings for this call, * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the * details. * @param {function(?Error, ?Object)=} callback * The function which will be called with the result of the API call. * * The second parameter to the callback is an object representing * [google.longrunning.Operation]{@link * external:"google.longrunning.Operation"}. * @return {Promise} - The promise which resolves to an array. * The first element of the array is an object representing * [google.longrunning.Operation]{@link * external:"google.longrunning.Operation"}. The promise has a method named * "cancel" which cancels the ongoing API call. * * @example * * const client = longrunning.operationsClient(); * const name = ''; * const [response] = await client.getOperation({name}); * // doThingsWith(response) */ getOperation(request, optionsOrCallback, callback) { let options; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } request = request || {}; options = options || {}; return this.innerApiCalls.getOperation(request, options, callback); } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * NOTE: the `name` binding below allows API services to override the binding * to use different resource name schemes. * * @param {Object} request - The request object that will be sent. * @param {string} request.name - The name of the operation collection. * @param {string} request.filter - The standard list filter. * @param {number=} request.pageSize * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this * parameter does not affect the return value. If page streaming is * performed per-page, this determines the maximum number of * resources in a page. * @param {Object=} options * Optional parameters. You can override the default settings for this call, * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the * details. * @param {function(?Error, ?Array, ?Object, ?Object)=} callback * The function which will be called with the result of the API call. * * The second parameter to the callback is Array of * [google.longrunning.Operation]{@link * external:"google.longrunning.Operation"}. * * When autoPaginate: false is specified through options, it contains the * result in a single response. If the response indicates the next page * exists, the third parameter is set to be used for the next request object. * The fourth parameter keeps the raw response object of an object * representing [google.longrunning.ListOperationsResponse]{@link * external:"google.longrunning.ListOperationsResponse"}. * @return {Promise} - The promise which resolves to an array. * The first element of the array is Array of * [google.longrunning.Operation]{@link * external:"google.longrunning.Operation"}. * * When autoPaginate: false is specified through options, the array has * three elements. The first element is Array of * [google.longrunning.Operation]{@link * external:"google.longrunning.Operation"} in a single response. The second * element is the next request object if the response indicates the next page * exists, or null. The third element is an object representing * [google.longrunning.ListOperationsResponse]{@link * external:"google.longrunning.ListOperationsResponse"}. * * The promise has a method named "cancel" which cancels the ongoing API * call. * * @example * * const client = longrunning.operationsClient(); * const request = { * name: '', * filter: '' * }; * // Iterate over all elements. * const [resources] = await client.listOperations(request); * for (const resource of resources) { * console.log(resources); * } * * // Or obtain the paged response. * const options = {autoPaginate: false}; * let nextRequest = request; * while(nextRequest) { * const response = await client.listOperations(nextRequest, options); * const resources = response[0]; * nextRequest = response[1]; * const rawResponse = response[2]; * for (const resource of resources) { * // doThingsWith(resource); * } * }; */ listOperations(request, optionsOrCallback, callback) { let options; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } request = request || {}; options = options || {}; return this.innerApiCalls.listOperations(request, options, callback); } /** * Equivalent to {@link listOperations}, but returns a NodeJS Stream object. * * This fetches the paged responses for {@link listOperations} continuously * and invokes the callback registered for 'data' event for each element in * the responses. * * The returned object has 'end' method when no more elements are required. * * autoPaginate option will be ignored. * * @see {@link https://nodejs.org/api/stream.html} * * @param {Object} request - The request object that will be sent. * @param {string} request.name - The name of the operation collection. * @param {string} request.filter - The standard list filter. * @param {number=} request.pageSize - * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this * parameter does not affect the return value. If page streaming is * performed per-page, this determines the maximum number of * resources in a page. * @param {Object=} options * Optional parameters. You can override the default settings for this call, * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the * details. * @return {Stream} - An object stream which emits an object representing [google.longrunning.Operation]{@link external:"google.longrunning.Operation"} on 'data' event. * * @example * * const client = longrunning.operationsClient(); * const request = { * name: '', * filter: '' * }; * client.listOperationsStream(request) * .on('data', element => { * // doThingsWith(element) * }) * .on('error', err => { * console.error(err); * }); */ listOperationsStream(request, options) { const callSettings = new gax.CallSettings(options); return this.descriptor.listOperations.createStream(this.innerApiCalls.listOperations, request, callSettings); } /** * Equivalent to {@link listOperations}, but returns an iterable object. * * for-await-of syntax is used with the iterable to recursively get response element on-demand. * * @param {Object} request - The request object that will be sent. * @param {string} request.name - The name of the operation collection. * @param {string} request.filter - The standard list filter. * @param {number=} request.pageSize - * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this * parameter does not affect the return value. If page streaming is * performed per-page, this determines the maximum number of * resources in a page. * @param {Object=} options * Optional parameters. You can override the default settings for this call, * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the * details. * @returns {Object} * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. */ listOperationsAsync(request, options) { request = request || {}; options = options || {}; const callSettings = new gax.CallSettings(options); return this.descriptor.listOperations.asyncIterate(this.innerApiCalls.listOperations, request, callSettings); } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not * guaranteed. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use * {@link Operations.GetOperation} or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with * an {@link Operation.error} value with a {@link google.rpc.Status.code} of * 1, corresponding to `Code.CANCELLED`. * * @param {Object} request - The request object that will be sent. * @param {string} request.name - The name of the operation resource to be cancelled. * @param {Object=} options * Optional parameters. You can override the default settings for this call, * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the * details. * @param {function(?Error)=} callback * The function which will be called with the result of the API call. * @return {Promise} - The promise which resolves when API call finishes. * The promise has a method named "cancel" which cancels the ongoing API * call. * * @example * * const client = longrunning.operationsClient(); * await client.cancelOperation({name: ''}); */ cancelOperation(request, optionsOrCallback, callback) { let options; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } request = request || {}; options = options || {}; return this.innerApiCalls.cancelOperation(request, options, callback); } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param {Object} request - The request object that will be sent. * @param {string} request.name - The name of the operation resource to be deleted. * @param {Object=} options * Optional parameters. You can override the default settings for this call, * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the * details. * @param {function(?Error)=} callback * The function which will be called with the result of the API call. * @return {Promise} - The promise which resolves when API call finishes. * The promise has a method named "cancel" which cancels the ongoing API * call. * * @example * * const client = longrunning.operationsClient(); * await client.deleteOperation({name: ''}); */ deleteOperation(request, optionsOrCallback, callback) { let options; if (optionsOrCallback instanceof Function && callback === undefined) { callback = optionsOrCallback; options = {}; } else { options = optionsOrCallback; } request = request || {}; options = options || {}; return this.innerApiCalls.deleteOperation(request, options, callback); } } exports.OperationsClient = OperationsClient; class OperationsClientBuilder { /** * Builds a new Operations Client * @param gaxGrpc {GrpcClient} */ constructor(gaxGrpc) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const operationsProtos = gaxGrpc.loadProtoJSON(protoJson); /** * Build a new instance of {@link OperationsClient}. * * @param {Object=} opts - The optional parameters. * @param {String=} opts.servicePath - Domain name of the API remote host. * @param {number=} opts.port - The port on which to connect to the remote host. * @param {grpc.ClientCredentials=} opts.sslCreds - A ClientCredentials for use with an SSL-enabled channel. * @param {Object=} opts.clientConfig - The customized config to build the call settings. See {@link gax.constructSettings} for the format. */ this.operationsClient = opts => { if (gaxGrpc.fallback) { opts.fallback = true; } return new OperationsClient(gaxGrpc, operationsProtos, opts); }; Object.assign(this.operationsClient, OperationsClient); } } exports.OperationsClientBuilder = OperationsClientBuilder; //# sourceMappingURL=operationsClient.js.map /***/ }), /***/ 71172: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PageDescriptor = void 0; const ended = __webpack_require__(66634); const stream_1 = __webpack_require__(92413); const normalApiCaller_1 = __webpack_require__(56513); const pagedApiCaller_1 = __webpack_require__(37441); const maxAttemptsEmptyResponse = 10; /** * A descriptor for methods that support pagination. */ class PageDescriptor { constructor(requestPageTokenField, responsePageTokenField, resourceField) { this.requestPageTokenField = requestPageTokenField; this.responsePageTokenField = responsePageTokenField; this.resourceField = resourceField; } /** * Creates a new object Stream which emits the resource on 'data' event. */ createStream(apiCall, request, options) { const stream = new stream_1.PassThrough({ objectMode: true }); options = Object.assign({}, options, { autoPaginate: false }); const maxResults = 'maxResults' in options ? options.maxResults : -1; let pushCount = 0; let started = false; function callback(err, resources, next, apiResp) { if (err) { stream.emit('error', err); return; } // emit full api response with every page. stream.emit('response', apiResp); for (let i = 0; i < resources.length; ++i) { if (ended(stream)) { return; } if (resources[i] === null) { continue; } stream.push(resources[i]); pushCount++; if (pushCount === maxResults) { stream.end(); } } if (ended(stream)) { return; } if (!next) { stream.end(); return; } // When pageToken is specified in the original options, it will overwrite // the page token field in the next request. Therefore it must be cleared. if ('pageToken' in options) { delete options.pageToken; } if (stream.isPaused()) { request = next; started = false; } else { setImmediate(apiCall, next, options, callback); } } stream.on('resume', () => { if (!started) { started = true; apiCall(request, options, callback); } }); return stream; } /** * Create an async iterable which can be recursively called for data on-demand. */ asyncIterate(apiCall, request, options) { options = Object.assign({}, options, { autoPaginate: false }); const iterable = this.createIterator(apiCall, request, options); return iterable; } createIterator(apiCall, request, options) { const asyncIterable = { [Symbol.asyncIterator]() { let nextPageRequest = request; const cache = []; return { async next() { if (cache.length > 0) { return Promise.resolve({ done: false, value: cache.shift(), }); } let attempts = 0; while (cache.length === 0 && nextPageRequest) { let result; [result, nextPageRequest] = (await apiCall(nextPageRequest, options)); // For pagination response with protobuf map type, use tuple as representation. if (result && !Array.isArray(result)) { for (const [key, value] of Object.entries(result)) { cache.push([key, value]); } } else { cache.push(...result); } if (cache.length === 0) { ++attempts; if (attempts > maxAttemptsEmptyResponse) { break; } } } if (cache.length === 0) { return Promise.resolve({ done: true, value: undefined }); } return Promise.resolve({ done: false, value: cache.shift() }); }, }; }, }; return asyncIterable; } getApiCaller(settings) { if (!settings.autoPaginate) { return new normalApiCaller_1.NormalApiCaller(); } return new pagedApiCaller_1.PagedApiCaller(this); } } exports.PageDescriptor = PageDescriptor; //# sourceMappingURL=pageDescriptor.js.map /***/ }), /***/ 37441: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PagedApiCaller = void 0; const call_1 = __webpack_require__(53047); const googleError_1 = __webpack_require__(6634); const resourceCollector_1 = __webpack_require__(50389); class PagedApiCaller { /** * Creates an API caller that returns a stream to performs page-streaming. * * @private * @constructor * @param {PageDescriptor} pageDescriptor - indicates the structure * of page streaming to be performed. */ constructor(pageDescriptor) { this.pageDescriptor = pageDescriptor; } /** * This function translates between regular gRPC calls (that accepts a request and returns a response, * and does not know anything about pages and page tokens) and the users' callback (that expects * to see resources from one page, a request to get the next page, and the raw response from the server). * * It generates a function that can be passed as a callback function to a gRPC call, will understand * pagination-specific fields in the response, and call the users' callback after having those fields * parsed. * * @param request Request object. It needs to be passed to all subsequent next page requests * (the main content of the request object stays unchanged, only the next page token changes) * @param callback The user's callback that expects the page content, next page request, and raw response. */ generateParseResponseCallback(request, callback) { const resourceFieldName = this.pageDescriptor.resourceField; const responsePageTokenFieldName = this.pageDescriptor.responsePageTokenField; const requestPageTokenFieldName = this.pageDescriptor.requestPageTokenField; return (err, response) => { if (err) { callback(err); return; } if (!request) { callback(new googleError_1.GoogleError('Undefined request in pagination method callback.')); return; } if (!response) { callback(new googleError_1.GoogleError('Undefined response in pagination method callback.')); return; } const resources = response[resourceFieldName] || []; const pageToken = response[responsePageTokenFieldName]; let nextPageRequest = null; if (pageToken) { nextPageRequest = Object.assign({}, request); nextPageRequest[requestPageTokenFieldName] = pageToken; } callback(err, resources, nextPageRequest, response); }; } /** * Adds a special ability to understand pagination-specific fields to the existing gRPC call. * The original gRPC call just calls callback(err, result). * The wrapped one will call callback(err, resources, nextPageRequest, rawResponse) instead. * * @param func gRPC call (normally, a service stub call). The gRPC call is expected to accept four parameters: * request, metadata, call options, and callback. */ wrap(func) { // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; return function wrappedCall(argument, metadata, options, callback) { return func(argument, metadata, options, self.generateParseResponseCallback(argument, callback)); }; } /** * Makes it possible to use both callback-based and promise-based calls. * Returns an OngoingCall or OngoingCallPromise object. * Regardless of which one is returned, it always has a `.callback` to call. * * @param settings Call settings. Can only be used to replace Promise with another promise implementation. * @param [callback] Callback to be called, if any. */ init(callback) { if (callback) { return new call_1.OngoingCall(callback); } return new call_1.OngoingCallPromise(); } /** * Implements auto-pagination logic. * * @param apiCall A function that performs gRPC request and calls its callback with a response or an error. * It's supposed to be a gRPC service stub function wrapped into several layers of wrappers that make it * accept just two parameters: (request, callback). * @param request A request object that came from the user. * @param settings Call settings. We are interested in `maxResults`, autoPaginate`, `pageToken`, and `pageSize` * (they are all optional). * @param ongoingCall An instance of OngoingCall or OngoingCallPromise that can be used for call cancellation, * and is used to return results to the user. */ call(apiCall, request, settings, ongoingCall) { request = Object.assign({}, request); // If settings object contain pageToken or pageSize, override the corresponding fields in the request object. if (settings.pageToken) { request[this.pageDescriptor.requestPageTokenField] = settings.pageToken; } if (settings.pageSize) { request[this.pageDescriptor.requestPageSizeField] = settings.pageSize; } if (!settings.autoPaginate) { // they don't want auto-pagination this time - okay, just call once ongoingCall.call(apiCall, request); return; } const maxResults = settings.maxResults || -1; const resourceCollector = new resourceCollector_1.ResourceCollector(apiCall, maxResults); resourceCollector.processAllPages(request).then(resources => ongoingCall.callback(null, resources), err => ongoingCall.callback(err)); } fail(ongoingCall, err) { ongoingCall.callback(err); } result(ongoingCall) { return ongoingCall.promise; } } exports.PagedApiCaller = PagedApiCaller; //# sourceMappingURL=pagedApiCaller.js.map /***/ }), /***/ 50389: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ResourceCollector = void 0; /** * ResourceCollector class implements asynchronous logic of calling the API call that supports pagination, * page by page, collecting all resources (up to `maxResults`) in the array. * * Usage: * const resourceCollector = new ResourceCollector(apiCall, maxResults); // -1 for unlimited * resourceCollector.processAllPages(request).then(resources => ...); */ class ResourceCollector { constructor(apiCall, maxResults = -1) { this.apiCall = apiCall; this.resources = []; this.maxResults = maxResults; } callback(err, resources, nextPageRequest) { if (err) { // Something went wrong with this request - failing everything this.rejectCallback(err); return; } // Process one page for (const resource of resources) { this.resources.push(resource); if (this.resources.length === this.maxResults) { nextPageRequest = null; break; } } // All done? if (!nextPageRequest) { this.resolveCallback(this.resources); return; } // Schedule the next call const callback = (...args) => this.callback(...args); setImmediate(this.apiCall, nextPageRequest, callback); } processAllPages(firstRequest) { return new Promise((resolve, reject) => { this.resolveCallback = resolve; this.rejectCallback = reject; // Schedule the first call const callback = (...args) => this.callback(...args); setImmediate(this.apiCall, firstRequest, callback); }); } } exports.ResourceCollector = ResourceCollector; //# sourceMappingURL=resourceCollector.js.map /***/ }), /***/ 20513: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PathTemplate = void 0; class PathTemplate { /** * @param {String} data the of the template * * @constructor */ constructor(data) { this.bindings = {}; this.data = data; this.segments = this.parsePathTemplate(data); this.size = this.segments.length; } /** * Matches a fully-qualified path template string. * * @param {String} path a fully-qualified path template string * @return {Object} contains const names matched to binding values * @throws {TypeError} if path can't be matched to this template */ match(path) { let pathSegments = path.split('/'); const bindings = {}; if (pathSegments.length !== this.segments.length) { // if the path contains a wildcard, then the length may differ by 1. if (!this.data.includes('**')) { throw new TypeError(`This path ${path} does not match path template ${this.data}, the number of parameters is not same.`); } else if (pathSegments.length !== this.segments.length + 1) { throw new TypeError(`This path ${path} does not match path template ${this.data}, the number of parameters is not same with one wildcard.`); } } for (let index = 0; index < this.segments.length && pathSegments.length > 0; index++) { if (this.segments[index] !== pathSegments[0]) { if (!this.segments[index].includes('*')) { throw new TypeError(`segment does not match, ${this.segments[index]} and ${pathSegments[index]}.`); } else { let segment = this.segments[index]; const matches = segment.match(/\{[$0-9a-zA-Z_]+=.*?\}/g); if (!matches) { throw new Error(`Error processing path template segment ${segment}`); } const variables = matches.map(str => str.replace(/^\{/, '').replace(/=.*/, '')); if (segment.includes('**')) { bindings[variables[0]] = pathSegments[0] + '/' + pathSegments[1]; pathSegments = pathSegments.slice(2); } else { // atomic resource if (variables.length === 1) { bindings[variables[0]] = pathSegments[0]; } else { // non-slash resource // segment: {blurb_id=*}.{legacy_user=*} to match pathSegments: ['bar.user2'] // split the match pathSegments[0] -> value: ['bar', 'user2'] // compare the length of two arrays, and compare array items const value = pathSegments[0].split(/[-_.~]/); if (value.length !== variables.length) { throw new Error(`segment ${segment} does not match ${pathSegments[0]}`); } for (const v of variables) { bindings[v] = value[0]; segment = segment.replace(`{${v}=*}`, `${value[0]}`); value.shift(); } // segment: {blurb_id=*}.{legacy_user=*} matching pathSegments: ['bar~user2'] should fail if (segment !== pathSegments[0]) { throw new TypeError(`non slash resource pattern ${this.segments[index]} and ${pathSegments[0]} should have same separator`); } } pathSegments.shift(); } } } else { pathSegments.shift(); } } return bindings; } /** * Renders a path template using the provided bindings. * * @param {Object} bindings a mapping of const names to binding strings * @return {String} a rendered representation of the path template * @throws {TypeError} if a key is missing, or if a sub-template cannot be * parsed */ render(bindings) { if (Object.keys(bindings).length !== Object.keys(this.bindings).length) { throw new TypeError(`The number of variables ${Object.keys(bindings).length} does not match the number of needed variables ${Object.keys(this.bindings).length}`); } let path = this.inspect(); for (const key of Object.keys(bindings)) { const b = bindings[key].toString(); if (!this.bindings[key]) { throw new TypeError(`render fails for not matching ${bindings[key]}`); } const variable = this.bindings[key]; if (variable === '*') { if (!b.match(/[^/{}]+/)) { throw new TypeError(`render fails for not matching ${b}`); } path = path.replace(`{${key}=*}`, `${b}`); } else if (variable === '**') { if (!b.match(/[^{}]+/)) { throw new TypeError(`render fails for not matching ${b}`); } path = path.replace(`{${key}=**}`, `${b}`); } } return path; } /** * Renders the path template. * * @return {string} contains const names matched to binding values */ inspect() { return this.segments.join('/'); } /** * Parse the path template. * * @return {string[]} return segments of the input path. * For example: 'buckets/{hello}'' will give back ['buckets', {hello=*}] */ parsePathTemplate(data) { const pathSegments = splitPathTemplate(data); let index = 0; let wildCardCount = 0; const segments = []; let matches; pathSegments.forEach(segment => { // * or ** -> segments.push('{$0=*}'); // -> bindings['$0'] = '*' if (segment === '*' || segment === '**') { this.bindings[`$${index}`] = segment; segments.push(`{$${index}=${segment}}`); index = index + 1; if (segment === '**') { ++wildCardCount; } } else if ((matches = segment.match(/\{[0-9a-zA-Z-.~_]+(?:=.*?)?\}/g))) { for (const subsegment of matches) { const pairMatch = subsegment.match(/^\{([0-9a-zA-Z-.~_]+)(?:=(.*?))?\}$/); if (!pairMatch) { throw new Error(`Cannot process path template segment ${subsegment}`); } const key = pairMatch[1]; let value = pairMatch[2]; if (!value) { value = '*'; segment = segment.replace(key, key + '=*'); this.bindings[key] = value; } else if (value === '*') { this.bindings[key] = value; } else if (value === '**') { ++wildCardCount; this.bindings[key] = value; } } segments.push(segment); } else if (segment.match(/[0-9a-zA-Z-.~_]+/)) { segments.push(segment); } }); if (wildCardCount > 1) { throw new TypeError('Can not have more than one wildcard.'); } return segments; } } exports.PathTemplate = PathTemplate; /** * Split the path template by `/`. * It can not be simply splitted by `/` because there might be `/` in the segments. * For example: 'a/b/{a=hello/world}' we do not want to break the brackets pair * so above path will be splitted as ['a', 'b', '{a=hello/world}'] */ function splitPathTemplate(data) { let left = 0; let right = 0; let bracketCount = 0; const segments = []; while (right >= left && right < data.length) { if (data.charAt(right) === '{') { bracketCount = bracketCount + 1; } else if (data.charAt(right) === '}') { bracketCount = bracketCount - 1; } else if (data.charAt(right) === '/') { if (right === data.length - 1) { throw new TypeError('Invalid path, it can not be ended by /'); } if (bracketCount === 0) { // complete bracket, to avoid the case a/b/**/*/{a=hello/world} segments.push(data.substring(left, right)); left = right + 1; } } if (right === data.length - 1) { if (bracketCount !== 0) { throw new TypeError('Brackets are invalid.'); } segments.push(data.substring(left)); } right = right + 1; } return segments; } //# sourceMappingURL=pathTemplate.js.map /***/ }), /***/ 8827: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fromParams = void 0; const querystring = __webpack_require__(71191); /** * Helpers for constructing routing headers. * * These headers are used by Google infrastructure to determine how to route * requests, especially for services that are regional. * * Generally, these headers are specified as gRPC metadata. */ /** * Constructs the routing header from the given params * * @param {Object} params - the request header parameters. * @return {string} the routing header value. */ function fromParams(params) { return querystring.stringify(params); } exports.fromParams = fromParams; //# sourceMappingURL=routingHeader.js.map /***/ }), /***/ 53501: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.rpcCodeFromHttpStatusCode = exports.HttpCodeToRpcCodeMap = exports.Status = void 0; // The following is a copy of the Status enum defined in @grpc/grpc-js, // src/constants.ts. We need to use some of these statuses here and there, // but we don't want to include the whole @grpc/grpc-js into the browser // bundle just to have this small enum. var Status; (function (Status) { Status[Status["OK"] = 0] = "OK"; Status[Status["CANCELLED"] = 1] = "CANCELLED"; Status[Status["UNKNOWN"] = 2] = "UNKNOWN"; Status[Status["INVALID_ARGUMENT"] = 3] = "INVALID_ARGUMENT"; Status[Status["DEADLINE_EXCEEDED"] = 4] = "DEADLINE_EXCEEDED"; Status[Status["NOT_FOUND"] = 5] = "NOT_FOUND"; Status[Status["ALREADY_EXISTS"] = 6] = "ALREADY_EXISTS"; Status[Status["PERMISSION_DENIED"] = 7] = "PERMISSION_DENIED"; Status[Status["RESOURCE_EXHAUSTED"] = 8] = "RESOURCE_EXHAUSTED"; Status[Status["FAILED_PRECONDITION"] = 9] = "FAILED_PRECONDITION"; Status[Status["ABORTED"] = 10] = "ABORTED"; Status[Status["OUT_OF_RANGE"] = 11] = "OUT_OF_RANGE"; Status[Status["UNIMPLEMENTED"] = 12] = "UNIMPLEMENTED"; Status[Status["INTERNAL"] = 13] = "INTERNAL"; Status[Status["UNAVAILABLE"] = 14] = "UNAVAILABLE"; Status[Status["DATA_LOSS"] = 15] = "DATA_LOSS"; Status[Status["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED"; })(Status = exports.Status || (exports.Status = {})); exports.HttpCodeToRpcCodeMap = new Map([ [400, Status.INVALID_ARGUMENT], [401, Status.UNAUTHENTICATED], [403, Status.PERMISSION_DENIED], [404, Status.NOT_FOUND], [409, Status.ABORTED], [416, Status.OUT_OF_RANGE], [429, Status.RESOURCE_EXHAUSTED], [499, Status.CANCELLED], [501, Status.UNIMPLEMENTED], [503, Status.UNAVAILABLE], [504, Status.DEADLINE_EXCEEDED], ]); // Maps HTTP status codes to gRPC status codes above. function rpcCodeFromHttpStatusCode(httpStatusCode) { if (exports.HttpCodeToRpcCodeMap.has(httpStatusCode)) { return exports.HttpCodeToRpcCodeMap.get(httpStatusCode); } // All 2xx if (httpStatusCode >= 200 && httpStatusCode < 300) { return Status.OK; } // All other 4xx if (httpStatusCode >= 400 && httpStatusCode < 500) { return Status.FAILED_PRECONDITION; } // All other 5xx if (httpStatusCode >= 500 && httpStatusCode < 600) { return Status.INTERNAL; } // Everything else return Status.UNKNOWN; } exports.rpcCodeFromHttpStatusCode = rpcCodeFromHttpStatusCode; //# sourceMappingURL=status.js.map /***/ }), /***/ 25735: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StreamArrayParser = void 0; const abort_controller_1 = __webpack_require__(61659); const stream_1 = __webpack_require__(92413); const fallbackRest_1 = __webpack_require__(21088); const featureDetection_1 = __webpack_require__(11154); class StreamArrayParser extends stream_1.Transform { /** * StreamArrayParser processes array of valid JSON objects in random chunks * through readable stream, and produces a stream of plain Javascript objects * where it converted from the corresponding protobuf message instance. * * The default JSON parser decodes the input stream under the * following rules: * 1. The stream represents a valid JSON array (must start with a "[" and * close with the corresponding "]"). Each element of this array is assumed to * be either an array or an object, and will be decoded as a JS object and * delivered. * 2. All JSON elements in the buffer will be decoded and delivered in a * stream. * * @private * @constructor * @param {protobuf.Method} rpc - the protobuf method produce array of JSON. * @param {Object} options - the options pass to Transform Stream. See more * details * https://nodejs.org/api/stream.html#stream_new_stream_transform_options. */ constructor(rpc, options) { super(Object.assign({}, options, { readableObjectMode: true })); this._done = false; this._prevBlock = Buffer.from(''); this._isInString = false; this._isSkipped = false; this._level = 0; this.rpc = rpc; this.cancelController = featureDetection_1.hasAbortController() ? // eslint-disable-next-line no-undef new AbortController() : new abort_controller_1.AbortController(); this.cancelSignal = this.cancelController.signal; this.cancelRequested = false; } _transform(chunk, _, callback) { let objectStart = 0; let curIndex = 0; if (this._level === 0 && curIndex === 0) { if (String.fromCharCode(chunk[0]) !== '[') { this.emit('error', new Error(`Internal Error: API service stream data must start with a '[' and close with the corresponding ']', but it start with ${String.fromCharCode(chunk[0])}`)); } curIndex++; this._level++; } while (curIndex < chunk.length) { const curValue = String.fromCharCode(chunk[curIndex]); if (!this._isSkipped) { switch (curValue) { case '{': // Check if it's in string, we ignore the curly brace in string. // Otherwise the object level++. if (!this._isInString) { this._level++; } if (!this._isInString && this._level === 2) { objectStart = curIndex; } break; case '"': // Flip the string status this._isInString = !this._isInString; break; case '}': // check if it's in string // if true, do nothing // if false and level = 0, push data if (!this._isInString) { this._level--; } if (!this._isInString && this._level === 1) { // find a object const objBuff = Buffer.concat([ this._prevBlock, chunk.slice(objectStart, curIndex + 1), ]); try { // HTTP reponse.ok is true. const msgObj = fallbackRest_1.decodeResponse(this.rpc, true, objBuff); this.push(msgObj); } catch (err) { this.emit('error', err); } objectStart = curIndex + 1; this._prevBlock = Buffer.from(''); } break; case ']': if (!this._isInString && this._level === 1) { this._done = true; this.push(null); } break; case '\\': // Escaping escape character. this._isSkipped = true; break; default: break; } } else { this._isSkipped = false; } curIndex++; } if (this._level > 1) { this._prevBlock = Buffer.concat([ this._prevBlock, chunk.slice(objectStart, curIndex), ]); } callback(); } _flush(callback) { callback(); } cancel() { this._done = true; this.cancelRequested = true; this.cancelController.abort(); this.end(); } } exports.StreamArrayParser = StreamArrayParser; //# sourceMappingURL=streamArrayParser.js.map /***/ }), /***/ 65880: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StreamDescriptor = void 0; const streamingApiCaller_1 = __webpack_require__(32936); /** * A descriptor for streaming calls. */ class StreamDescriptor { constructor(streamType) { this.type = streamType; this.streaming = true; } getApiCaller(settings) { // Right now retrying does not work with gRPC-streaming, because retryable // assumes an API call returns an event emitter while gRPC-streaming methods // return Stream. // TODO: support retrying. settings.retry = null; return new streamingApiCaller_1.StreamingApiCaller(this); } } exports.StreamDescriptor = StreamDescriptor; //# sourceMappingURL=streamDescriptor.js.map /***/ }), /***/ 67389: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StreamProxy = exports.StreamType = void 0; const streamArrayParser_1 = __webpack_require__(25735); // eslint-disable-next-line @typescript-eslint/no-var-requires const duplexify = __webpack_require__(76599); // eslint-disable-next-line @typescript-eslint/no-var-requires const retryRequest = __webpack_require__(63515); /** * The type of gRPC streaming. * @enum {number} */ var StreamType; (function (StreamType) { /** Client sends a single request, server streams responses. */ StreamType[StreamType["SERVER_STREAMING"] = 1] = "SERVER_STREAMING"; /** Client streams requests, server returns a single response. */ StreamType[StreamType["CLIENT_STREAMING"] = 2] = "CLIENT_STREAMING"; /** Both client and server stream objects. */ StreamType[StreamType["BIDI_STREAMING"] = 3] = "BIDI_STREAMING"; })(StreamType = exports.StreamType || (exports.StreamType = {})); class StreamProxy extends duplexify { /** * StreamProxy is a proxy to gRPC-streaming method. * * @private * @constructor * @param {StreamType} type - the type of gRPC stream. * @param {ApiCallback} callback - the callback for further API call. */ constructor(type, callback) { super(undefined, undefined, { objectMode: true, readable: type !== StreamType.CLIENT_STREAMING, writable: type !== StreamType.SERVER_STREAMING, }); this.type = type; this._callback = callback; this._isCancelCalled = false; this._responseHasSent = false; } cancel() { if (this.stream) { this.stream.cancel(); } else { this._isCancelCalled = true; } } /** * Forward events from an API request stream to the user's stream. * @param {Stream} stream - The API request stream. */ forwardEvents(stream) { const eventsToForward = ['metadata', 'response', 'status']; if (stream instanceof streamArrayParser_1.StreamArrayParser) { eventsToForward.push('data', 'end', 'error'); } eventsToForward.forEach(event => { stream.on(event, this.emit.bind(this, event)); }); // gRPC is guaranteed emit the 'status' event but not 'metadata', and 'status' is the last event to emit. // Emit the 'response' event if stream has no 'metadata' event. // This avoids the stream swallowing the other events, such as 'end'. stream.on('status', () => { if (!this._responseHasSent) { stream.emit('response', { code: 200, details: '', message: 'OK', }); } }); // We also want to supply the status data as 'response' event to support // the behavior of google-cloud-node expects. // see: // https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1775#issuecomment-259141029 // https://github.com/GoogleCloudPlatform/google-cloud-node/blob/116436fa789d8b0f7fc5100b19b424e3ec63e6bf/packages/common/src/grpc-service.js#L355 stream.on('metadata', metadata => { // Create a response object with succeeds. // TODO: unify this logic with the decoration of gRPC response when it's // added. see: https://github.com/googleapis/gax-nodejs/issues/65 stream.emit('response', { code: 200, details: '', message: 'OK', metadata, }); this._responseHasSent = true; }); } /** * Specifies the target stream. * @param {ApiCall} apiCall - the API function to be called. * @param {Object} argument - the argument to be passed to the apiCall. */ setStream(apiCall, argument, retryRequestOptions = {}) { if (this.type === StreamType.SERVER_STREAMING) { const retryStream = retryRequest(null, { objectMode: true, request: () => { if (this._isCancelCalled) { if (this.stream) { this.stream.cancel(); } return; } const stream = apiCall(argument, this._callback); this.stream = stream; this.forwardEvents(stream); return stream; }, retries: retryRequestOptions.retries, currentRetryAttempt: retryRequestOptions.currentRetryAttempt, noResponseRetries: retryRequestOptions.noResponseRetries, shouldRetryFn: retryRequestOptions.shouldRetryFn, }); this.setReadable(retryStream); return; } const stream = apiCall(argument, this._callback); this.stream = stream; this.forwardEvents(stream); if (this.type === StreamType.CLIENT_STREAMING) { this.setWritable(stream); } if (this.type === StreamType.BIDI_STREAMING) { this.setReadable(stream); this.setWritable(stream); } if (this._isCancelCalled && this.stream) { this.stream.cancel(); } } } exports.StreamProxy = StreamProxy; //# sourceMappingURL=streaming.js.map /***/ }), /***/ 32936: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StreamingApiCaller = void 0; const warnings_1 = __webpack_require__(16328); const streaming_1 = __webpack_require__(67389); class StreamingApiCaller { /** * An API caller for methods of gRPC streaming. * @private * @constructor * @param {StreamDescriptor} descriptor - the descriptor of the method structure. */ constructor(descriptor) { this.descriptor = descriptor; } init(callback) { return new streaming_1.StreamProxy(this.descriptor.type, callback); } wrap(func) { switch (this.descriptor.type) { case streaming_1.StreamType.SERVER_STREAMING: return (argument, metadata, options) => { return func(argument, metadata, options); }; case streaming_1.StreamType.CLIENT_STREAMING: return (argument, metadata, options, callback) => { return func(metadata, options, callback); }; case streaming_1.StreamType.BIDI_STREAMING: return (argument, metadata, options) => { return func(metadata, options); }; default: warnings_1.warn('streaming_wrap_unknown_stream_type', `Unknown stream type: ${this.descriptor.type}`); } return func; } call(apiCall, argument, settings, stream) { stream.setStream(apiCall, argument, settings.retryRequestOptions); } fail(stream, err) { stream.emit('error', err); } result(stream) { return stream; } } exports.StreamingApiCaller = StreamingApiCaller; //# sourceMappingURL=streamingApiCaller.js.map /***/ }), /***/ 86707: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.transcode = exports.getFieldNameOnBehavior = exports.isRequiredField = exports.isProto3OptionalField = exports.requestChangeCaseAndCleanup = exports.flattenObject = exports.match = exports.applyPattern = exports.encodeWithoutSlashes = exports.encodeWithSlashes = exports.buildQueryStringComponents = exports.deleteField = exports.deepCopy = exports.getField = void 0; const util_1 = __webpack_require__(26969); const httpOptionName = '(google.api.http)'; const fieldBehaviorOptionName = '(google.api.field_behavior)'; const proto3OptionalName = 'proto3_optional'; // List of methods as defined in google/api/http.proto (see HttpRule) const supportedHttpMethods = ['get', 'post', 'put', 'patch', 'delete']; function getField(request, field) { const parts = field.split('.'); let value = request; for (const part of parts) { if (typeof value !== 'object') { return undefined; } value = value[part]; } if (typeof value === 'object' && !Array.isArray(value) && value !== null) { return undefined; } return value; } exports.getField = getField; function deepCopy(request) { if (typeof request !== 'object' || request === null) { return request; } const copy = Object.assign({}, request); for (const key in copy) { if (Array.isArray(copy[key])) { copy[key] = copy[key].map(deepCopy); } else if (typeof copy[key] === 'object' && copy[key] !== null) { copy[key] = deepCopy(copy[key]); } } return copy; } exports.deepCopy = deepCopy; function deleteField(request, field) { const parts = field.split('.'); while (parts.length > 1) { if (typeof request !== 'object') { return; } const part = parts.shift(); request = request[part]; } const part = parts.shift(); if (typeof request !== 'object') { return; } delete request[part]; } exports.deleteField = deleteField; function buildQueryStringComponents(request, prefix = '') { const resultList = []; for (const key in request) { if (Array.isArray(request[key])) { for (const value of request[key]) { resultList.push(`${prefix}${encodeWithoutSlashes(key)}=${encodeWithoutSlashes(value.toString())}`); } } else if (typeof request[key] === 'object' && request[key] !== null) { resultList.push(...buildQueryStringComponents(request[key], `${key}.`)); } else { resultList.push(`${prefix}${encodeWithoutSlashes(key)}=${encodeWithoutSlashes(request[key] === null ? 'null' : request[key].toString())}`); } } return resultList; } exports.buildQueryStringComponents = buildQueryStringComponents; function encodeWithSlashes(str) { return str .split('') .map(c => (c.match(/[-_.~0-9a-zA-Z]/) ? c : encodeURIComponent(c))) .join(''); } exports.encodeWithSlashes = encodeWithSlashes; function encodeWithoutSlashes(str) { return str .split('') .map(c => (c.match(/[-_.~0-9a-zA-Z/]/) ? c : encodeURIComponent(c))) .join(''); } exports.encodeWithoutSlashes = encodeWithoutSlashes; function escapeRegExp(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } function applyPattern(pattern, fieldValue) { if (!pattern || pattern === '*') { return encodeWithSlashes(fieldValue); } if (!pattern.includes('*') && pattern !== fieldValue) { return undefined; } // since we're converting the pattern to a regex, make necessary precautions: const regex = new RegExp('^' + escapeRegExp(pattern) .replace(/\\\*\\\*/g, '(.+)') .replace(/\\\*/g, '([^/]+)') + '$'); if (!fieldValue.match(regex)) { return undefined; } return encodeWithoutSlashes(fieldValue); } exports.applyPattern = applyPattern; function match(request, pattern) { let url = pattern; const matchedFields = []; for (;;) { const match = url.match(/^(.*)\{([^}=]+)(?:=([^}]*))?\}(.*)/); if (!match) { break; } const [, before, field, pattern, after] = match; matchedFields.push(field); const fieldValue = getField(request, field); if (typeof fieldValue === 'undefined') { return undefined; } const appliedPattern = applyPattern(pattern, fieldValue === null ? 'null' : fieldValue.toString()); if (typeof appliedPattern === 'undefined') { return undefined; } url = before + appliedPattern + after; } return { matchedFields, url }; } exports.match = match; function flattenObject(request) { const result = {}; for (const key in request) { if (typeof request[key] === 'undefined') { continue; } if (Array.isArray(request[key])) { // According to the http.proto comments, a repeated field may only // contain primitive types, so no extra recursion here. result[key] = request[key]; continue; } if (typeof request[key] === 'object' && request[key] !== null) { const nested = flattenObject(request[key]); for (const nestedKey in nested) { result[`${key}.${nestedKey}`] = nested[nestedKey]; } continue; } result[key] = request[key]; } return result; } exports.flattenObject = flattenObject; function requestChangeCaseAndCleanup(request, caseChangeFunc) { if (!request || typeof request !== 'object') { return request; } const convertedRequest = {}; for (const field in request) { // cleaning up inherited properties if (!Object.prototype.hasOwnProperty.call(request, field)) { continue; } const convertedField = caseChangeFunc(field); const value = request[field]; if (Array.isArray(value)) { convertedRequest[convertedField] = value.map(v => requestChangeCaseAndCleanup(v, caseChangeFunc)); } else { convertedRequest[convertedField] = requestChangeCaseAndCleanup(value, caseChangeFunc); } } return convertedRequest; } exports.requestChangeCaseAndCleanup = requestChangeCaseAndCleanup; function isProto3OptionalField(field) { return field && field.options && field.options[proto3OptionalName]; } exports.isProto3OptionalField = isProto3OptionalField; function isRequiredField(field) { return (field && field.options && field.options[fieldBehaviorOptionName] === 'REQUIRED'); } exports.isRequiredField = isRequiredField; function getFieldNameOnBehavior(fields) { const requiredFields = new Set(); const optionalFields = new Set(); for (const fieldName in fields) { const field = fields[fieldName]; if (isRequiredField(field)) { requiredFields.add(fieldName); } if (isProto3OptionalField(field)) { optionalFields.add(fieldName); } } return { requiredFields, optionalFields }; } exports.getFieldNameOnBehavior = getFieldNameOnBehavior; function transcode(request, parsedOptions, requestFields) { const { requiredFields, optionalFields } = getFieldNameOnBehavior(requestFields); // all fields annotated as REQUIRED MUST be emitted in the body. for (const requiredField of requiredFields) { if (!(requiredField in request) || request[requiredField] === 'undefined') { throw new Error(`Required field ${requiredField} is not present in the request.`); } } // request is supposed to have keys in camelCase. const snakeRequest = requestChangeCaseAndCleanup(request, util_1.camelToSnakeCase); const httpRules = []; for (const option of parsedOptions) { if (!(httpOptionName in option)) { continue; } const httpRule = option[httpOptionName]; httpRules.push(httpRule); if (httpRule === null || httpRule === void 0 ? void 0 : httpRule.additional_bindings) { const additionalBindings = Array.isArray(httpRule.additional_bindings) ? httpRule.additional_bindings : [httpRule.additional_bindings]; httpRules.push(...additionalBindings); } } for (const httpRule of httpRules) { for (const httpMethod of supportedHttpMethods) { if (!(httpMethod in httpRule)) { continue; } const pathTemplate = httpRule[httpMethod]; const matchResult = match(snakeRequest, pathTemplate); if (typeof matchResult === 'undefined') { continue; } const { url, matchedFields } = matchResult; if (httpRule.body === '*') { // all fields except the matched fields go to request data const data = deepCopy(snakeRequest); for (const field of matchedFields) { deleteField(data, field); } // Remove unset proto3 optional field from the request body. for (const key in data) { if (optionalFields.has(util_1.snakeToCamelCase(key)) && (!(key in snakeRequest) || snakeRequest[key] === 'undefined')) { delete data[key]; } } // HTTP endpoint expects camelCase but we have snake_case at this point const camelCaseData = requestChangeCaseAndCleanup(data, util_1.snakeToCamelCase); return { httpMethod, url, queryString: '', data: camelCaseData }; } // one field possibly goes to request data, others go to query string const body = httpRule.body; let data = ''; const queryStringObject = deepCopy(request); // use camel case for query string if (body) { deleteField(queryStringObject, util_1.snakeToCamelCase(body)); // Unset optional field should not add in body request. data = optionalFields.has(body) && snakeRequest[body] === 'undefined' ? '' : snakeRequest[body]; } for (const field of matchedFields) { deleteField(queryStringObject, util_1.snakeToCamelCase(field)); } // Unset proto3 optional field does not appear in the query params. for (const key in queryStringObject) { if (optionalFields.has(key) && request[key] === 'undefined') { delete queryStringObject[key]; } } const queryStringComponents = buildQueryStringComponents(queryStringObject); const queryString = queryStringComponents.join('&'); let camelCaseData; if (typeof data === 'string') { camelCaseData = data; } else { camelCaseData = requestChangeCaseAndCleanup(data, util_1.snakeToCamelCase); } return { httpMethod, url, queryString, data: camelCaseData }; } } return undefined; } exports.transcode = transcode; //# sourceMappingURL=transcoding.js.map /***/ }), /***/ 26969: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.snakeToCamelCase = exports.camelToSnakeCase = void 0; /** * Converts a given string from camelCase (used by protobuf.js and in JSON) * to snake_case (normally used in proto definitions). */ function camelToSnakeCase(str) { // Keep the first position capitalization, otherwise decapitalize with underscore. return str.replace(/(?!^)[A-Z]/g, letter => `_${letter.toLowerCase()}`); } exports.camelToSnakeCase = camelToSnakeCase; /** * Capitalizes the first character of the given string. */ function capitalize(str) { if (str.length === 0) { return str; } return str[0].toUpperCase() + str.slice(1); } /** * Converts a given string from snake_case (normally used in proto definitions) to * camelCase (used by protobuf.js) */ function snakeToCamelCase(str) { // split on spaces, non-alphanumeric, or capital letters const splitted = str .split(/(?=[A-Z])|(?:(?!\.)[\s\W_])+/) .filter(w => w.length > 0) // Keep the capitalization for the first split. .map((word, index) => (index === 0 ? word : word.toLowerCase())); if (splitted.length === 0) { return str; } return [splitted[0], ...splitted.slice(1).map(capitalize)].join(''); } exports.snakeToCamelCase = snakeToCamelCase; //# sourceMappingURL=util.js.map /***/ }), /***/ 16328: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.warn = void 0; const featureDetection_1 = __webpack_require__(11154); const emittedWarnings = new Set(); // warnType is the type of warning (e.g. 'DeprecationWarning', 'ExperimentalWarning', etc.) function warn(code, message, warnType) { // Only show a given warning once if (emittedWarnings.has(code)) { return; } emittedWarnings.add(code); if (!featureDetection_1.isNodeJS()) { console.warn(message); } else if (typeof warnType !== 'undefined') { process.emitWarning(message, { type: warnType, }); } else { process.emitWarning(message); } } exports.warn = warn; //# sourceMappingURL=warnings.js.map /***/ }), /***/ 36935: /***/ ((module, exports, __webpack_require__) => { "use strict"; var crypto = __webpack_require__(76417); /** * Exported function * * Options: * * - `algorithm` hash algo to be used by this instance: *'sha1', 'md5' * - `excludeValues` {true|*false} hash object keys, values ignored * - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64' * - `ignoreUnknown` {true|*false} ignore unknown object types * - `replacer` optional function that replaces values before hashing * - `respectFunctionProperties` {*true|false} consider function properties when hashing * - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing * - `respectType` {*true|false} Respect special properties (prototype, constructor) * when hashing to distinguish between types * - `unorderedArrays` {true|*false} Sort all arrays before hashing * - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing * * = default * * @param {object} object value to hash * @param {object} options hashing options * @return {string} hash value * @api public */ exports = module.exports = objectHash; function objectHash(object, options){ options = applyDefaults(object, options); return hash(object, options); } /** * Exported sugar methods * * @param {object} object value to hash * @return {string} hash value * @api public */ exports.sha1 = function(object){ return objectHash(object); }; exports.keys = function(object){ return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'}); }; exports.MD5 = function(object){ return objectHash(object, {algorithm: 'md5', encoding: 'hex'}); }; exports.keysMD5 = function(object){ return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true}); }; // Internals var hashes = crypto.getHashes ? crypto.getHashes().slice() : ['sha1', 'md5']; hashes.push('passthrough'); var encodings = ['buffer', 'hex', 'binary', 'base64']; function applyDefaults(object, sourceOptions){ sourceOptions = sourceOptions || {}; // create a copy rather than mutating var options = {}; options.algorithm = sourceOptions.algorithm || 'sha1'; options.encoding = sourceOptions.encoding || 'hex'; options.excludeValues = sourceOptions.excludeValues ? true : false; options.algorithm = options.algorithm.toLowerCase(); options.encoding = options.encoding.toLowerCase(); options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false options.respectType = sourceOptions.respectType === false ? false : true; // default to true options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true; options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true; options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true options.replacer = sourceOptions.replacer || undefined; options.excludeKeys = sourceOptions.excludeKeys || undefined; if(typeof object === 'undefined') { throw new Error('Object argument required.'); } // if there is a case-insensitive match in the hashes list, accept it // (i.e. SHA256 for sha256) for (var i = 0; i < hashes.length; ++i) { if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) { options.algorithm = hashes[i]; } } if(hashes.indexOf(options.algorithm) === -1){ throw new Error('Algorithm "' + options.algorithm + '" not supported. ' + 'supported values: ' + hashes.join(', ')); } if(encodings.indexOf(options.encoding) === -1 && options.algorithm !== 'passthrough'){ throw new Error('Encoding "' + options.encoding + '" not supported. ' + 'supported values: ' + encodings.join(', ')); } return options; } /** Check if the given function is a native function */ function isNativeFunction(f) { if ((typeof f) !== 'function') { return false; } var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i; return exp.exec(Function.prototype.toString.call(f)) != null; } function hash(object, options) { var hashingStream; if (options.algorithm !== 'passthrough') { hashingStream = crypto.createHash(options.algorithm); } else { hashingStream = new PassThrough(); } if (typeof hashingStream.write === 'undefined') { hashingStream.write = hashingStream.update; hashingStream.end = hashingStream.update; } var hasher = typeHasher(options, hashingStream); hasher.dispatch(object); if (!hashingStream.update) { hashingStream.end(''); } if (hashingStream.digest) { return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding); } var buf = hashingStream.read(); if (options.encoding === 'buffer') { return buf; } return buf.toString(options.encoding); } /** * Expose streaming API * * @param {object} object Value to serialize * @param {object} options Options, as for hash() * @param {object} stream A stream to write the serializiation to * @api public */ exports.writeToStream = function(object, options, stream) { if (typeof stream === 'undefined') { stream = options; options = {}; } options = applyDefaults(object, options); return typeHasher(options, stream).dispatch(object); }; function typeHasher(options, writeTo, context){ context = context || []; var write = function(str) { if (writeTo.update) { return writeTo.update(str, 'utf8'); } else { return writeTo.write(str, 'utf8'); } }; return { dispatch: function(value){ if (options.replacer) { value = options.replacer(value); } var type = typeof value; if (value === null) { type = 'null'; } //console.log("[DEBUG] Dispatch: ", value, "->", type, " -> ", "_" + type); return this['_' + type](value); }, _object: function(object) { var pattern = (/\[object (.*)\]/i); var objString = Object.prototype.toString.call(object); var objType = pattern.exec(objString); if (!objType) { // object type did not match [object ...] objType = 'unknown:[' + objString + ']'; } else { objType = objType[1]; // take only the class name } objType = objType.toLowerCase(); var objectNumber = null; if ((objectNumber = context.indexOf(object)) >= 0) { return this.dispatch('[CIRCULAR:' + objectNumber + ']'); } else { context.push(object); } if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) { write('buffer:'); return write(object); } if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') { if(this['_' + objType]) { this['_' + objType](object); } else if (options.ignoreUnknown) { return write('[' + objType + ']'); } else { throw new Error('Unknown object type "' + objType + '"'); } }else{ var keys = Object.keys(object); if (options.unorderedObjects) { keys = keys.sort(); } // Make sure to incorporate special properties, so // Types with different prototypes will produce // a different hash and objects derived from // different functions (`new Foo`, `new Bar`) will // produce different hashes. // We never do this for native functions since some // seem to break because of that. if (options.respectType !== false && !isNativeFunction(object)) { keys.splice(0, 0, 'prototype', '__proto__', 'constructor'); } if (options.excludeKeys) { keys = keys.filter(function(key) { return !options.excludeKeys(key); }); } write('object:' + keys.length + ':'); var self = this; return keys.forEach(function(key){ self.dispatch(key); write(':'); if(!options.excludeValues) { self.dispatch(object[key]); } write(','); }); } }, _array: function(arr, unordered){ unordered = typeof unordered !== 'undefined' ? unordered : options.unorderedArrays !== false; // default to options.unorderedArrays var self = this; write('array:' + arr.length + ':'); if (!unordered || arr.length <= 1) { return arr.forEach(function(entry) { return self.dispatch(entry); }); } // the unordered case is a little more complicated: // since there is no canonical ordering on objects, // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false, // we first serialize each entry using a PassThrough stream // before sorting. // also: we can’t use the same context array for all entries // since the order of hashing should *not* matter. instead, // we keep track of the additions to a copy of the context array // and add all of them to the global context array when we’re done var contextAdditions = []; var entries = arr.map(function(entry) { var strm = new PassThrough(); var localContext = context.slice(); // make copy var hasher = typeHasher(options, strm, localContext); hasher.dispatch(entry); // take only what was added to localContext and append it to contextAdditions contextAdditions = contextAdditions.concat(localContext.slice(context.length)); return strm.read().toString(); }); context = context.concat(contextAdditions); entries.sort(); return this._array(entries, false); }, _date: function(date){ return write('date:' + date.toJSON()); }, _symbol: function(sym){ return write('symbol:' + sym.toString()); }, _error: function(err){ return write('error:' + err.toString()); }, _boolean: function(bool){ return write('bool:' + bool.toString()); }, _string: function(string){ write('string:' + string.length + ':'); write(string.toString()); }, _function: function(fn){ write('fn:'); if (isNativeFunction(fn)) { this.dispatch('[native]'); } else { this.dispatch(fn.toString()); } if (options.respectFunctionNames !== false) { // Make sure we can still distinguish native functions // by their name, otherwise String and Function will // have the same hash this.dispatch("function-name:" + String(fn.name)); } if (options.respectFunctionProperties) { this._object(fn); } }, _number: function(number){ return write('number:' + number.toString()); }, _xml: function(xml){ return write('xml:' + xml.toString()); }, _null: function() { return write('Null'); }, _undefined: function() { return write('Undefined'); }, _regexp: function(regex){ return write('regex:' + regex.toString()); }, _uint8array: function(arr){ write('uint8array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint8clampedarray: function(arr){ write('uint8clampedarray:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int8array: function(arr){ write('uint8array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint16array: function(arr){ write('uint16array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int16array: function(arr){ write('uint16array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint32array: function(arr){ write('uint32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int32array: function(arr){ write('uint32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _float32array: function(arr){ write('float32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _float64array: function(arr){ write('float64array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _arraybuffer: function(arr){ write('arraybuffer:'); return this.dispatch(new Uint8Array(arr)); }, _url: function(url) { return write('url:' + url.toString(), 'utf8'); }, _map: function(map) { write('map:'); var arr = Array.from(map); return this._array(arr, options.unorderedSets !== false); }, _set: function(set) { write('set:'); var arr = Array.from(set); return this._array(arr, options.unorderedSets !== false); }, _file: function(file) { write('file:'); return this.dispatch([file.name, file.size, file.type, file.lastModfied]); }, _blob: function() { if (options.ignoreUnknown) { return write('[blob]'); } throw Error('Hashing Blob objects is currently not supported\n' + '(see https://github.com/puleos/object-hash/issues/26)\n' + 'Use "options.replacer" or "options.ignoreUnknown"\n'); }, _domwindow: function() { return write('domwindow'); }, _bigint: function(number){ return write('bigint:' + number.toString()); }, /* Node.js standard native objects */ _process: function() { return write('process'); }, _timer: function() { return write('timer'); }, _pipe: function() { return write('pipe'); }, _tcp: function() { return write('tcp'); }, _udp: function() { return write('udp'); }, _tty: function() { return write('tty'); }, _statwatcher: function() { return write('statwatcher'); }, _securecontext: function() { return write('securecontext'); }, _connection: function() { return write('connection'); }, _zlib: function() { return write('zlib'); }, _context: function() { return write('context'); }, _nodescript: function() { return write('nodescript'); }, _httpparser: function() { return write('httpparser'); }, _dataview: function() { return write('dataview'); }, _signal: function() { return write('signal'); }, _fsevent: function() { return write('fsevent'); }, _tlswrap: function() { return write('tlswrap'); }, }; } // Mini-implementation of stream.PassThrough // We are far from having need for the full implementation, and we can // make assumptions like "many writes, then only one final read" // and we can ignore encoding specifics function PassThrough() { return { buf: '', write: function(b) { this.buf += b; }, end: function(b) { this.buf += b; }, read: function() { return this.buf; } }; } /***/ }), /***/ 92098: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2018 Google LLC * * Distributed under MIT license. * See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getPem = void 0; const fs = __webpack_require__(35747); const forge = __webpack_require__(57655); const util_1 = __webpack_require__(31669); const readFile = util_1.promisify(fs.readFile); function getPem(filename, callback) { if (callback) { getPemAsync(filename) .then(pem => callback(null, pem)) .catch(err => callback(err, null)); } else { return getPemAsync(filename); } } exports.getPem = getPem; function getPemAsync(filename) { return readFile(filename, { encoding: 'base64' }).then(keyp12 => { return convertToPem(keyp12); }); } /** * Converts a P12 in base64 encoding to a pem. * @param p12base64 String containing base64 encoded p12. * @returns a string containing the pem. */ function convertToPem(p12base64) { const p12Der = forge.util.decode64(p12base64); const p12Asn1 = forge.asn1.fromDer(p12Der); const p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, 'notasecret'); const bags = p12.getBags({ friendlyName: 'privatekey' }); if (bags.friendlyName) { const privateKey = bags.friendlyName[0].key; const pem = forge.pki.privateKeyToPem(privateKey); return pem.replace(/\r\n/g, '\n'); } else { throw new Error('Unable to get friendly name.'); } } //# sourceMappingURL=index.js.map /***/ }), /***/ 26457: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const types_1 = __webpack_require__(64597); function createRejection(error, ...beforeErrorGroups) { const promise = (async () => { if (error instanceof types_1.RequestError) { try { for (const hooks of beforeErrorGroups) { if (hooks) { for (const hook of hooks) { // eslint-disable-next-line no-await-in-loop error = await hook(error); } } } } catch (error_) { error = error_; } } throw error; })(); const returnPromise = () => promise; promise.json = returnPromise; promise.text = returnPromise; promise.buffer = returnPromise; promise.on = returnPromise; return promise; } exports.default = createRejection; /***/ }), /***/ 36056: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const events_1 = __webpack_require__(28614); const is_1 = __webpack_require__(68977); const PCancelable = __webpack_require__(19072); const types_1 = __webpack_require__(64597); const parse_body_1 = __webpack_require__(88220); const core_1 = __webpack_require__(99873); const proxy_events_1 = __webpack_require__(53021); const get_buffer_1 = __webpack_require__(34500); const is_response_ok_1 = __webpack_require__(49298); const proxiedRequestEvents = [ 'request', 'response', 'redirect', 'uploadProgress', 'downloadProgress' ]; function asPromise(normalizedOptions) { let globalRequest; let globalResponse; const emitter = new events_1.EventEmitter(); const promise = new PCancelable((resolve, reject, onCancel) => { const makeRequest = (retryCount) => { const request = new core_1.default(undefined, normalizedOptions); request.retryCount = retryCount; request._noPipe = true; onCancel(() => request.destroy()); onCancel.shouldReject = false; onCancel(() => reject(new types_1.CancelError(request))); globalRequest = request; request.once('response', async (response) => { var _a; response.retryCount = retryCount; if (response.request.aborted) { // Canceled while downloading - will throw a `CancelError` or `TimeoutError` error return; } // Download body let rawBody; try { rawBody = await get_buffer_1.default(request); response.rawBody = rawBody; } catch (_b) { // The same error is caught below. // See request.once('error') return; } if (request._isAboutToError) { return; } // Parse body const contentEncoding = ((_a = response.headers['content-encoding']) !== null && _a !== void 0 ? _a : '').toLowerCase(); const isCompressed = ['gzip', 'deflate', 'br'].includes(contentEncoding); const { options } = request; if (isCompressed && !options.decompress) { response.body = rawBody; } else { try { response.body = parse_body_1.default(response, options.responseType, options.parseJson, options.encoding); } catch (error) { // Fallback to `utf8` response.body = rawBody.toString(); if (is_response_ok_1.isResponseOk(response)) { request._beforeError(error); return; } } } try { for (const [index, hook] of options.hooks.afterResponse.entries()) { // @ts-expect-error TS doesn't notice that CancelableRequest is a Promise // eslint-disable-next-line no-await-in-loop response = await hook(response, async (updatedOptions) => { const typedOptions = core_1.default.normalizeArguments(undefined, { ...updatedOptions, retry: { calculateDelay: () => 0 }, throwHttpErrors: false, resolveBodyOnly: false }, options); // Remove any further hooks for that request, because we'll call them anyway. // The loop continues. We don't want duplicates (asPromise recursion). typedOptions.hooks.afterResponse = typedOptions.hooks.afterResponse.slice(0, index); for (const hook of typedOptions.hooks.beforeRetry) { // eslint-disable-next-line no-await-in-loop await hook(typedOptions); } const promise = asPromise(typedOptions); onCancel(() => { promise.catch(() => { }); promise.cancel(); }); return promise; }); } } catch (error) { request._beforeError(new types_1.RequestError(error.message, error, request)); return; } if (!is_response_ok_1.isResponseOk(response)) { request._beforeError(new types_1.HTTPError(response)); return; } globalResponse = response; resolve(request.options.resolveBodyOnly ? response.body : response); }); const onError = (error) => { if (promise.isCanceled) { return; } const { options } = request; if (error instanceof types_1.HTTPError && !options.throwHttpErrors) { const { response } = error; resolve(request.options.resolveBodyOnly ? response.body : response); return; } reject(error); }; request.once('error', onError); const previousBody = request.options.body; request.once('retry', (newRetryCount, error) => { var _a, _b; if (previousBody === ((_a = error.request) === null || _a === void 0 ? void 0 : _a.options.body) && is_1.default.nodeStream((_b = error.request) === null || _b === void 0 ? void 0 : _b.options.body)) { onError(error); return; } makeRequest(newRetryCount); }); proxy_events_1.default(request, emitter, proxiedRequestEvents); }; makeRequest(0); }); promise.on = (event, fn) => { emitter.on(event, fn); return promise; }; const shortcut = (responseType) => { const newPromise = (async () => { // Wait until downloading has ended await promise; const { options } = globalResponse.request; return parse_body_1.default(globalResponse, responseType, options.parseJson, options.encoding); })(); Object.defineProperties(newPromise, Object.getOwnPropertyDescriptors(promise)); return newPromise; }; promise.json = () => { const { headers } = globalRequest.options; if (!globalRequest.writableFinished && headers.accept === undefined) { headers.accept = 'application/json'; } return shortcut('json'); }; promise.buffer = () => shortcut('buffer'); promise.text = () => shortcut('text'); return promise; } exports.default = asPromise; __exportStar(__webpack_require__(64597), exports); /***/ }), /***/ 41048: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const is_1 = __webpack_require__(68977); const normalizeArguments = (options, defaults) => { if (is_1.default.null_(options.encoding)) { throw new TypeError('To get a Buffer, set `options.responseType` to `buffer` instead'); } is_1.assert.any([is_1.default.string, is_1.default.undefined], options.encoding); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.resolveBodyOnly); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.methodRewriting); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.isStream); is_1.assert.any([is_1.default.string, is_1.default.undefined], options.responseType); // `options.responseType` if (options.responseType === undefined) { options.responseType = 'text'; } // `options.retry` const { retry } = options; if (defaults) { options.retry = { ...defaults.retry }; } else { options.retry = { calculateDelay: retryObject => retryObject.computedValue, limit: 0, methods: [], statusCodes: [], errorCodes: [], maxRetryAfter: undefined }; } if (is_1.default.object(retry)) { options.retry = { ...options.retry, ...retry }; options.retry.methods = [...new Set(options.retry.methods.map(method => method.toUpperCase()))]; options.retry.statusCodes = [...new Set(options.retry.statusCodes)]; options.retry.errorCodes = [...new Set(options.retry.errorCodes)]; } else if (is_1.default.number(retry)) { options.retry.limit = retry; } if (is_1.default.undefined(options.retry.maxRetryAfter)) { options.retry.maxRetryAfter = Math.min( // TypeScript is not smart enough to handle `.filter(x => is.number(x))`. // eslint-disable-next-line unicorn/no-fn-reference-in-iterator ...[options.timeout.request, options.timeout.connect].filter(is_1.default.number)); } // `options.pagination` if (is_1.default.object(options.pagination)) { if (defaults) { options.pagination = { ...defaults.pagination, ...options.pagination }; } const { pagination } = options; if (!is_1.default.function_(pagination.transform)) { throw new Error('`options.pagination.transform` must be implemented'); } if (!is_1.default.function_(pagination.shouldContinue)) { throw new Error('`options.pagination.shouldContinue` must be implemented'); } if (!is_1.default.function_(pagination.filter)) { throw new TypeError('`options.pagination.filter` must be implemented'); } if (!is_1.default.function_(pagination.paginate)) { throw new Error('`options.pagination.paginate` must be implemented'); } } // JSON mode if (options.responseType === 'json' && options.headers.accept === undefined) { options.headers.accept = 'application/json'; } return options; }; exports.default = normalizeArguments; /***/ }), /***/ 88220: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const types_1 = __webpack_require__(64597); const parseBody = (response, responseType, parseJson, encoding) => { const { rawBody } = response; try { if (responseType === 'text') { return rawBody.toString(encoding); } if (responseType === 'json') { return rawBody.length === 0 ? '' : parseJson(rawBody.toString()); } if (responseType === 'buffer') { return rawBody; } throw new types_1.ParseError({ message: `Unknown body type '${responseType}'`, name: 'Error' }, response); } catch (error) { throw new types_1.ParseError(error, response); } }; exports.default = parseBody; /***/ }), /***/ 64597: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CancelError = exports.ParseError = void 0; const core_1 = __webpack_require__(99873); /** An error to be thrown when server response code is 2xx, and parsing body fails. Includes a `response` property. */ class ParseError extends core_1.RequestError { constructor(error, response) { const { options } = response.request; super(`${error.message} in "${options.url.toString()}"`, error, response.request); this.name = 'ParseError'; } } exports.ParseError = ParseError; /** An error to be thrown when the request is aborted with `.cancel()`. */ class CancelError extends core_1.RequestError { constructor(request) { super('Promise was canceled', {}, request); this.name = 'CancelError'; } get isCanceled() { return true; } } exports.CancelError = CancelError; __exportStar(__webpack_require__(99873), exports); /***/ }), /***/ 93462: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.retryAfterStatusCodes = void 0; exports.retryAfterStatusCodes = new Set([413, 429, 503]); const calculateRetryDelay = ({ attemptCount, retryOptions, error, retryAfter }) => { if (attemptCount > retryOptions.limit) { return 0; } const hasMethod = retryOptions.methods.includes(error.options.method); const hasErrorCode = retryOptions.errorCodes.includes(error.code); const hasStatusCode = error.response && retryOptions.statusCodes.includes(error.response.statusCode); if (!hasMethod || (!hasErrorCode && !hasStatusCode)) { return 0; } if (error.response) { if (retryAfter) { if (retryOptions.maxRetryAfter === undefined || retryAfter > retryOptions.maxRetryAfter) { return 0; } return retryAfter; } if (error.response.statusCode === 413) { return 0; } } const noise = Math.random() * 100; return ((2 ** (attemptCount - 1)) * 1000) + noise; }; exports.default = calculateRetryDelay; /***/ }), /***/ 99873: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.UnsupportedProtocolError = exports.ReadError = exports.TimeoutError = exports.UploadError = exports.CacheError = exports.HTTPError = exports.MaxRedirectsError = exports.RequestError = exports.setNonEnumerableProperties = exports.knownHookEvents = exports.withoutBody = exports.kIsNormalizedAlready = void 0; const util_1 = __webpack_require__(31669); const stream_1 = __webpack_require__(92413); const fs_1 = __webpack_require__(35747); const url_1 = __webpack_require__(78835); const http = __webpack_require__(98605); const http_1 = __webpack_require__(98605); const https = __webpack_require__(57211); const http_timer_1 = __webpack_require__(76234); const cacheable_lookup_1 = __webpack_require__(2286); const CacheableRequest = __webpack_require__(69016); const decompressResponse = __webpack_require__(22490); // @ts-expect-error Missing types const http2wrapper = __webpack_require__(54645); const lowercaseKeys = __webpack_require__(9662); const is_1 = __webpack_require__(68977); const get_body_size_1 = __webpack_require__(94564); const is_form_data_1 = __webpack_require__(90040); const proxy_events_1 = __webpack_require__(53021); const timed_out_1 = __webpack_require__(52454); const url_to_options_1 = __webpack_require__(8026); const options_to_url_1 = __webpack_require__(9219); const weakable_map_1 = __webpack_require__(7288); const get_buffer_1 = __webpack_require__(34500); const dns_ip_version_1 = __webpack_require__(94993); const is_response_ok_1 = __webpack_require__(49298); const deprecation_warning_1 = __webpack_require__(397); const normalize_arguments_1 = __webpack_require__(41048); const calculate_retry_delay_1 = __webpack_require__(93462); let globalDnsCache; const kRequest = Symbol('request'); const kResponse = Symbol('response'); const kResponseSize = Symbol('responseSize'); const kDownloadedSize = Symbol('downloadedSize'); const kBodySize = Symbol('bodySize'); const kUploadedSize = Symbol('uploadedSize'); const kServerResponsesPiped = Symbol('serverResponsesPiped'); const kUnproxyEvents = Symbol('unproxyEvents'); const kIsFromCache = Symbol('isFromCache'); const kCancelTimeouts = Symbol('cancelTimeouts'); const kStartedReading = Symbol('startedReading'); const kStopReading = Symbol('stopReading'); const kTriggerRead = Symbol('triggerRead'); const kBody = Symbol('body'); const kJobs = Symbol('jobs'); const kOriginalResponse = Symbol('originalResponse'); const kRetryTimeout = Symbol('retryTimeout'); exports.kIsNormalizedAlready = Symbol('isNormalizedAlready'); const supportsBrotli = is_1.default.string(process.versions.brotli); exports.withoutBody = new Set(['GET', 'HEAD']); exports.knownHookEvents = [ 'init', 'beforeRequest', 'beforeRedirect', 'beforeError', 'beforeRetry', // Promise-Only 'afterResponse' ]; function validateSearchParameters(searchParameters) { // eslint-disable-next-line guard-for-in for (const key in searchParameters) { const value = searchParameters[key]; if (!is_1.default.string(value) && !is_1.default.number(value) && !is_1.default.boolean(value) && !is_1.default.null_(value) && !is_1.default.undefined(value)) { throw new TypeError(`The \`searchParams\` value '${String(value)}' must be a string, number, boolean or null`); } } } function isClientRequest(clientRequest) { return is_1.default.object(clientRequest) && !('statusCode' in clientRequest); } const cacheableStore = new weakable_map_1.default(); const waitForOpenFile = async (file) => new Promise((resolve, reject) => { const onError = (error) => { reject(error); }; // Node.js 12 has incomplete types if (!file.pending) { resolve(); } file.once('error', onError); file.once('ready', () => { file.off('error', onError); resolve(); }); }); const redirectCodes = new Set([300, 301, 302, 303, 304, 307, 308]); const nonEnumerableProperties = [ 'context', 'body', 'json', 'form' ]; exports.setNonEnumerableProperties = (sources, to) => { // Non enumerable properties shall not be merged const properties = {}; for (const source of sources) { if (!source) { continue; } for (const name of nonEnumerableProperties) { if (!(name in source)) { continue; } properties[name] = { writable: true, configurable: true, enumerable: false, // @ts-expect-error TS doesn't see the check above value: source[name] }; } } Object.defineProperties(to, properties); }; /** An error to be thrown when a request fails. Contains a `code` property with error class code, like `ECONNREFUSED`. */ class RequestError extends Error { constructor(message, error, self) { var _a; super(message); Error.captureStackTrace(this, this.constructor); this.name = 'RequestError'; this.code = error.code; if (self instanceof Request) { Object.defineProperty(this, 'request', { enumerable: false, value: self }); Object.defineProperty(this, 'response', { enumerable: false, value: self[kResponse] }); Object.defineProperty(this, 'options', { // This fails because of TS 3.7.2 useDefineForClassFields // Ref: https://github.com/microsoft/TypeScript/issues/34972 enumerable: false, value: self.options }); } else { Object.defineProperty(this, 'options', { // This fails because of TS 3.7.2 useDefineForClassFields // Ref: https://github.com/microsoft/TypeScript/issues/34972 enumerable: false, value: self }); } this.timings = (_a = this.request) === null || _a === void 0 ? void 0 : _a.timings; // Recover the original stacktrace if (is_1.default.string(error.stack) && is_1.default.string(this.stack)) { const indexOfMessage = this.stack.indexOf(this.message) + this.message.length; const thisStackTrace = this.stack.slice(indexOfMessage).split('\n').reverse(); const errorStackTrace = error.stack.slice(error.stack.indexOf(error.message) + error.message.length).split('\n').reverse(); // Remove duplicated traces while (errorStackTrace.length !== 0 && errorStackTrace[0] === thisStackTrace[0]) { thisStackTrace.shift(); } this.stack = `${this.stack.slice(0, indexOfMessage)}${thisStackTrace.reverse().join('\n')}${errorStackTrace.reverse().join('\n')}`; } } } exports.RequestError = RequestError; /** An error to be thrown when the server redirects you more than ten times. Includes a `response` property. */ class MaxRedirectsError extends RequestError { constructor(request) { super(`Redirected ${request.options.maxRedirects} times. Aborting.`, {}, request); this.name = 'MaxRedirectsError'; } } exports.MaxRedirectsError = MaxRedirectsError; /** An error to be thrown when the server response code is not 2xx nor 3xx if `options.followRedirect` is `true`, but always except for 304. Includes a `response` property. */ class HTTPError extends RequestError { constructor(response) { super(`Response code ${response.statusCode} (${response.statusMessage})`, {}, response.request); this.name = 'HTTPError'; } } exports.HTTPError = HTTPError; /** An error to be thrown when a cache method fails. For example, if the database goes down or there's a filesystem error. */ class CacheError extends RequestError { constructor(error, request) { super(error.message, error, request); this.name = 'CacheError'; } } exports.CacheError = CacheError; /** An error to be thrown when the request body is a stream and an error occurs while reading from that stream. */ class UploadError extends RequestError { constructor(error, request) { super(error.message, error, request); this.name = 'UploadError'; } } exports.UploadError = UploadError; /** An error to be thrown when the request is aborted due to a timeout. Includes an `event` and `timings` property. */ class TimeoutError extends RequestError { constructor(error, timings, request) { super(error.message, error, request); this.name = 'TimeoutError'; this.event = error.event; this.timings = timings; } } exports.TimeoutError = TimeoutError; /** An error to be thrown when reading from response stream fails. */ class ReadError extends RequestError { constructor(error, request) { super(error.message, error, request); this.name = 'ReadError'; } } exports.ReadError = ReadError; /** An error to be thrown when given an unsupported protocol. */ class UnsupportedProtocolError extends RequestError { constructor(options) { super(`Unsupported protocol "${options.url.protocol}"`, {}, options); this.name = 'UnsupportedProtocolError'; } } exports.UnsupportedProtocolError = UnsupportedProtocolError; const proxiedRequestEvents = [ 'socket', 'connect', 'continue', 'information', 'upgrade', 'timeout' ]; class Request extends stream_1.Duplex { constructor(url, options = {}, defaults) { super({ // This must be false, to enable throwing after destroy // It is used for retry logic in Promise API autoDestroy: false, // It needs to be zero because we're just proxying the data to another stream highWaterMark: 0 }); this[kDownloadedSize] = 0; this[kUploadedSize] = 0; this.requestInitialized = false; this[kServerResponsesPiped] = new Set(); this.redirects = []; this[kStopReading] = false; this[kTriggerRead] = false; this[kJobs] = []; this.retryCount = 0; // TODO: Remove this when targeting Node.js >= 12 this._progressCallbacks = []; const unlockWrite = () => this._unlockWrite(); const lockWrite = () => this._lockWrite(); this.on('pipe', (source) => { source.prependListener('data', unlockWrite); source.on('data', lockWrite); source.prependListener('end', unlockWrite); source.on('end', lockWrite); }); this.on('unpipe', (source) => { source.off('data', unlockWrite); source.off('data', lockWrite); source.off('end', unlockWrite); source.off('end', lockWrite); }); this.on('pipe', source => { if (source instanceof http_1.IncomingMessage) { this.options.headers = { ...source.headers, ...this.options.headers }; } }); const { json, body, form } = options; if (json || body || form) { this._lockWrite(); } if (exports.kIsNormalizedAlready in options) { this.options = options; } else { try { // @ts-expect-error Common TypeScript bug saying that `this.constructor` is not accessible this.options = this.constructor.normalizeArguments(url, options, defaults); } catch (error) { // TODO: Move this to `_destroy()` if (is_1.default.nodeStream(options.body)) { options.body.destroy(); } this.destroy(error); return; } } (async () => { var _a; try { if (this.options.body instanceof fs_1.ReadStream) { await waitForOpenFile(this.options.body); } const { url: normalizedURL } = this.options; if (!normalizedURL) { throw new TypeError('Missing `url` property'); } this.requestUrl = normalizedURL.toString(); decodeURI(this.requestUrl); await this._finalizeBody(); await this._makeRequest(); if (this.destroyed) { (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroy(); return; } // Queued writes etc. for (const job of this[kJobs]) { job(); } // Prevent memory leak this[kJobs].length = 0; this.requestInitialized = true; } catch (error) { if (error instanceof RequestError) { this._beforeError(error); return; } // This is a workaround for https://github.com/nodejs/node/issues/33335 if (!this.destroyed) { this.destroy(error); } } })(); } static normalizeArguments(url, options, defaults) { var _a, _b, _c, _d, _e; const rawOptions = options; if (is_1.default.object(url) && !is_1.default.urlInstance(url)) { options = { ...defaults, ...url, ...options }; } else { if (url && options && options.url !== undefined) { throw new TypeError('The `url` option is mutually exclusive with the `input` argument'); } options = { ...defaults, ...options }; if (url !== undefined) { options.url = url; } if (is_1.default.urlInstance(options.url)) { options.url = new url_1.URL(options.url.toString()); } } // TODO: Deprecate URL options in Got 12. // Support extend-specific options if (options.cache === false) { options.cache = undefined; } if (options.dnsCache === false) { options.dnsCache = undefined; } // Nice type assertions is_1.assert.any([is_1.default.string, is_1.default.undefined], options.method); is_1.assert.any([is_1.default.object, is_1.default.undefined], options.headers); is_1.assert.any([is_1.default.string, is_1.default.urlInstance, is_1.default.undefined], options.prefixUrl); is_1.assert.any([is_1.default.object, is_1.default.undefined], options.cookieJar); is_1.assert.any([is_1.default.object, is_1.default.string, is_1.default.undefined], options.searchParams); is_1.assert.any([is_1.default.object, is_1.default.string, is_1.default.undefined], options.cache); is_1.assert.any([is_1.default.object, is_1.default.number, is_1.default.undefined], options.timeout); is_1.assert.any([is_1.default.object, is_1.default.undefined], options.context); is_1.assert.any([is_1.default.object, is_1.default.undefined], options.hooks); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.decompress); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.ignoreInvalidCookies); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.followRedirect); is_1.assert.any([is_1.default.number, is_1.default.undefined], options.maxRedirects); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.throwHttpErrors); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.http2); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.allowGetBody); is_1.assert.any([is_1.default.string, is_1.default.undefined], options.localAddress); is_1.assert.any([dns_ip_version_1.isDnsLookupIpVersion, is_1.default.undefined], options.dnsLookupIpVersion); is_1.assert.any([is_1.default.object, is_1.default.undefined], options.https); is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.rejectUnauthorized); if (options.https) { is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.https.rejectUnauthorized); is_1.assert.any([is_1.default.function_, is_1.default.undefined], options.https.checkServerIdentity); is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.certificateAuthority); is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.key); is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.certificate); is_1.assert.any([is_1.default.string, is_1.default.undefined], options.https.passphrase); is_1.assert.any([is_1.default.string, is_1.default.buffer, is_1.default.array, is_1.default.undefined], options.https.pfx); } is_1.assert.any([is_1.default.object, is_1.default.undefined], options.cacheOptions); // `options.method` if (is_1.default.string(options.method)) { options.method = options.method.toUpperCase(); } else { options.method = 'GET'; } // `options.headers` if (options.headers === (defaults === null || defaults === void 0 ? void 0 : defaults.headers)) { options.headers = { ...options.headers }; } else { options.headers = lowercaseKeys({ ...(defaults === null || defaults === void 0 ? void 0 : defaults.headers), ...options.headers }); } // Disallow legacy `url.Url` if ('slashes' in options) { throw new TypeError('The legacy `url.Url` has been deprecated. Use `URL` instead.'); } // `options.auth` if ('auth' in options) { throw new TypeError('Parameter `auth` is deprecated. Use `username` / `password` instead.'); } // `options.searchParams` if ('searchParams' in options) { if (options.searchParams && options.searchParams !== (defaults === null || defaults === void 0 ? void 0 : defaults.searchParams)) { let searchParameters; if (is_1.default.string(options.searchParams) || (options.searchParams instanceof url_1.URLSearchParams)) { searchParameters = new url_1.URLSearchParams(options.searchParams); } else { validateSearchParameters(options.searchParams); searchParameters = new url_1.URLSearchParams(); // eslint-disable-next-line guard-for-in for (const key in options.searchParams) { const value = options.searchParams[key]; if (value === null) { searchParameters.append(key, ''); } else if (value !== undefined) { searchParameters.append(key, value); } } } // `normalizeArguments()` is also used to merge options (_a = defaults === null || defaults === void 0 ? void 0 : defaults.searchParams) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => { // Only use default if one isn't already defined if (!searchParameters.has(key)) { searchParameters.append(key, value); } }); options.searchParams = searchParameters; } } // `options.username` & `options.password` options.username = (_b = options.username) !== null && _b !== void 0 ? _b : ''; options.password = (_c = options.password) !== null && _c !== void 0 ? _c : ''; // `options.prefixUrl` & `options.url` if (is_1.default.undefined(options.prefixUrl)) { options.prefixUrl = (_d = defaults === null || defaults === void 0 ? void 0 : defaults.prefixUrl) !== null && _d !== void 0 ? _d : ''; } else { options.prefixUrl = options.prefixUrl.toString(); if (options.prefixUrl !== '' && !options.prefixUrl.endsWith('/')) { options.prefixUrl += '/'; } } if (is_1.default.string(options.url)) { if (options.url.startsWith('/')) { throw new Error('`input` must not start with a slash when using `prefixUrl`'); } options.url = options_to_url_1.default(options.prefixUrl + options.url, options); } else if ((is_1.default.undefined(options.url) && options.prefixUrl !== '') || options.protocol) { options.url = options_to_url_1.default(options.prefixUrl, options); } if (options.url) { if ('port' in options) { delete options.port; } // Make it possible to change `options.prefixUrl` let { prefixUrl } = options; Object.defineProperty(options, 'prefixUrl', { set: (value) => { const url = options.url; if (!url.href.startsWith(value)) { throw new Error(`Cannot change \`prefixUrl\` from ${prefixUrl} to ${value}: ${url.href}`); } options.url = new url_1.URL(value + url.href.slice(prefixUrl.length)); prefixUrl = value; }, get: () => prefixUrl }); // Support UNIX sockets let { protocol } = options.url; if (protocol === 'unix:') { protocol = 'http:'; options.url = new url_1.URL(`http://unix${options.url.pathname}${options.url.search}`); } // Set search params if (options.searchParams) { // eslint-disable-next-line @typescript-eslint/no-base-to-string options.url.search = options.searchParams.toString(); } // Protocol check if (protocol !== 'http:' && protocol !== 'https:') { throw new UnsupportedProtocolError(options); } // Update `username` if (options.username === '') { options.username = options.url.username; } else { options.url.username = options.username; } // Update `password` if (options.password === '') { options.password = options.url.password; } else { options.url.password = options.password; } } // `options.cookieJar` const { cookieJar } = options; if (cookieJar) { let { setCookie, getCookieString } = cookieJar; is_1.assert.function_(setCookie); is_1.assert.function_(getCookieString); /* istanbul ignore next: Horrible `tough-cookie` v3 check */ if (setCookie.length === 4 && getCookieString.length === 0) { setCookie = util_1.promisify(setCookie.bind(options.cookieJar)); getCookieString = util_1.promisify(getCookieString.bind(options.cookieJar)); options.cookieJar = { setCookie, getCookieString: getCookieString }; } } // `options.cache` const { cache } = options; if (cache) { if (!cacheableStore.has(cache)) { cacheableStore.set(cache, new CacheableRequest(((requestOptions, handler) => { const result = requestOptions[kRequest](requestOptions, handler); // TODO: remove this when `cacheable-request` supports async request functions. if (is_1.default.promise(result)) { // @ts-expect-error // We only need to implement the error handler in order to support HTTP2 caching. // The result will be a promise anyway. result.once = (event, handler) => { if (event === 'error') { result.catch(handler); } else if (event === 'abort') { // The empty catch is needed here in case when // it rejects before it's `await`ed in `_makeRequest`. (async () => { try { const request = (await result); request.once('abort', handler); } catch (_a) { } })(); } else { /* istanbul ignore next: safety check */ throw new Error(`Unknown HTTP2 promise event: ${event}`); } return result; }; } return result; }), cache)); } } // `options.cacheOptions` options.cacheOptions = { ...options.cacheOptions }; // `options.dnsCache` if (options.dnsCache === true) { if (!globalDnsCache) { globalDnsCache = new cacheable_lookup_1.default(); } options.dnsCache = globalDnsCache; } else if (!is_1.default.undefined(options.dnsCache) && !options.dnsCache.lookup) { throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${is_1.default(options.dnsCache)}`); } // `options.timeout` if (is_1.default.number(options.timeout)) { options.timeout = { request: options.timeout }; } else if (defaults && options.timeout !== defaults.timeout) { options.timeout = { ...defaults.timeout, ...options.timeout }; } else { options.timeout = { ...options.timeout }; } // `options.context` if (!options.context) { options.context = {}; } // `options.hooks` const areHooksDefault = options.hooks === (defaults === null || defaults === void 0 ? void 0 : defaults.hooks); options.hooks = { ...options.hooks }; for (const event of exports.knownHookEvents) { if (event in options.hooks) { if (is_1.default.array(options.hooks[event])) { // See https://github.com/microsoft/TypeScript/issues/31445#issuecomment-576929044 options.hooks[event] = [...options.hooks[event]]; } else { throw new TypeError(`Parameter \`${event}\` must be an Array, got ${is_1.default(options.hooks[event])}`); } } else { options.hooks[event] = []; } } if (defaults && !areHooksDefault) { for (const event of exports.knownHookEvents) { const defaultHooks = defaults.hooks[event]; if (defaultHooks.length > 0) { // See https://github.com/microsoft/TypeScript/issues/31445#issuecomment-576929044 options.hooks[event] = [ ...defaults.hooks[event], ...options.hooks[event] ]; } } } // DNS options if ('family' in options) { deprecation_warning_1.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'); } // HTTPS options if (defaults === null || defaults === void 0 ? void 0 : defaults.https) { options.https = { ...defaults.https, ...options.https }; } if ('rejectUnauthorized' in options) { deprecation_warning_1.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'); } if ('checkServerIdentity' in options) { deprecation_warning_1.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'); } if ('ca' in options) { deprecation_warning_1.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'); } if ('key' in options) { deprecation_warning_1.default('"options.key" was never documented, please use "options.https.key"'); } if ('cert' in options) { deprecation_warning_1.default('"options.cert" was never documented, please use "options.https.certificate"'); } if ('passphrase' in options) { deprecation_warning_1.default('"options.passphrase" was never documented, please use "options.https.passphrase"'); } if ('pfx' in options) { deprecation_warning_1.default('"options.pfx" was never documented, please use "options.https.pfx"'); } // Other options if ('followRedirects' in options) { throw new TypeError('The `followRedirects` option does not exist. Use `followRedirect` instead.'); } if (options.agent) { for (const key in options.agent) { if (key !== 'http' && key !== 'https' && key !== 'http2') { throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${key}\``); } } } options.maxRedirects = (_e = options.maxRedirects) !== null && _e !== void 0 ? _e : 0; // Set non-enumerable properties exports.setNonEnumerableProperties([defaults, rawOptions], options); return normalize_arguments_1.default(options, defaults); } _lockWrite() { const onLockedWrite = () => { throw new TypeError('The payload has been already provided'); }; this.write = onLockedWrite; this.end = onLockedWrite; } _unlockWrite() { this.write = super.write; this.end = super.end; } async _finalizeBody() { const { options } = this; const { headers } = options; const isForm = !is_1.default.undefined(options.form); const isJSON = !is_1.default.undefined(options.json); const isBody = !is_1.default.undefined(options.body); const hasPayload = isForm || isJSON || isBody; const cannotHaveBody = exports.withoutBody.has(options.method) && !(options.method === 'GET' && options.allowGetBody); this._cannotHaveBody = cannotHaveBody; if (hasPayload) { if (cannotHaveBody) { throw new TypeError(`The \`${options.method}\` method cannot be used with a body`); } if ([isBody, isForm, isJSON].filter(isTrue => isTrue).length > 1) { throw new TypeError('The `body`, `json` and `form` options are mutually exclusive'); } if (isBody && !(options.body instanceof stream_1.Readable) && !is_1.default.string(options.body) && !is_1.default.buffer(options.body) && !is_form_data_1.default(options.body)) { throw new TypeError('The `body` option must be a stream.Readable, string or Buffer'); } if (isForm && !is_1.default.object(options.form)) { throw new TypeError('The `form` option must be an Object'); } { // Serialize body const noContentType = !is_1.default.string(headers['content-type']); if (isBody) { // Special case for https://github.com/form-data/form-data if (is_form_data_1.default(options.body) && noContentType) { headers['content-type'] = `multipart/form-data; boundary=${options.body.getBoundary()}`; } this[kBody] = options.body; } else if (isForm) { if (noContentType) { headers['content-type'] = 'application/x-www-form-urlencoded'; } this[kBody] = (new url_1.URLSearchParams(options.form)).toString(); } else { if (noContentType) { headers['content-type'] = 'application/json'; } this[kBody] = options.stringifyJson(options.json); } const uploadBodySize = await get_body_size_1.default(this[kBody], options.headers); // See https://tools.ietf.org/html/rfc7230#section-3.3.2 // A user agent SHOULD send a Content-Length in a request message when // no Transfer-Encoding is sent and the request method defines a meaning // for an enclosed payload body. For example, a Content-Length header // field is normally sent in a POST request even when the value is 0 // (indicating an empty payload body). A user agent SHOULD NOT send a // Content-Length header field when the request message does not contain // a payload body and the method semantics do not anticipate such a // body. if (is_1.default.undefined(headers['content-length']) && is_1.default.undefined(headers['transfer-encoding'])) { if (!cannotHaveBody && !is_1.default.undefined(uploadBodySize)) { headers['content-length'] = String(uploadBodySize); } } } } else if (cannotHaveBody) { this._lockWrite(); } else { this._unlockWrite(); } this[kBodySize] = Number(headers['content-length']) || undefined; } async _onResponseBase(response) { const { options } = this; const { url } = options; this[kOriginalResponse] = response; if (options.decompress) { response = decompressResponse(response); } const statusCode = response.statusCode; const typedResponse = response; typedResponse.statusMessage = typedResponse.statusMessage ? typedResponse.statusMessage : http.STATUS_CODES[statusCode]; typedResponse.url = options.url.toString(); typedResponse.requestUrl = this.requestUrl; typedResponse.redirectUrls = this.redirects; typedResponse.request = this; typedResponse.isFromCache = response.fromCache || false; typedResponse.ip = this.ip; typedResponse.retryCount = this.retryCount; this[kIsFromCache] = typedResponse.isFromCache; this[kResponseSize] = Number(response.headers['content-length']) || undefined; this[kResponse] = response; response.once('end', () => { this[kResponseSize] = this[kDownloadedSize]; this.emit('downloadProgress', this.downloadProgress); }); response.once('error', (error) => { // Force clean-up, because some packages don't do this. // TODO: Fix decompress-response response.destroy(); this._beforeError(new ReadError(error, this)); }); response.once('aborted', () => { this._beforeError(new ReadError({ name: 'Error', message: 'The server aborted pending request', code: 'ECONNRESET' }, this)); }); this.emit('downloadProgress', this.downloadProgress); const rawCookies = response.headers['set-cookie']; if (is_1.default.object(options.cookieJar) && rawCookies) { let promises = rawCookies.map(async (rawCookie) => options.cookieJar.setCookie(rawCookie, url.toString())); if (options.ignoreInvalidCookies) { promises = promises.map(async (p) => p.catch(() => { })); } try { await Promise.all(promises); } catch (error) { this._beforeError(error); return; } } if (options.followRedirect && response.headers.location && redirectCodes.has(statusCode)) { // We're being redirected, we don't care about the response. // It'd be best to abort the request, but we can't because // we would have to sacrifice the TCP connection. We don't want that. response.resume(); if (this[kRequest]) { this[kCancelTimeouts](); // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete this[kRequest]; this[kUnproxyEvents](); } const shouldBeGet = statusCode === 303 && options.method !== 'GET' && options.method !== 'HEAD'; if (shouldBeGet || !options.methodRewriting) { // Server responded with "see other", indicating that the resource exists at another location, // and the client should request it from that location via GET or HEAD. options.method = 'GET'; if ('body' in options) { delete options.body; } if ('json' in options) { delete options.json; } if ('form' in options) { delete options.form; } this[kBody] = undefined; delete options.headers['content-length']; } if (this.redirects.length >= options.maxRedirects) { this._beforeError(new MaxRedirectsError(this)); return; } try { // Do not remove. See https://github.com/sindresorhus/got/pull/214 const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString(); // Handles invalid URLs. See https://github.com/sindresorhus/got/issues/604 const redirectUrl = new url_1.URL(redirectBuffer, url); const redirectString = redirectUrl.toString(); decodeURI(redirectString); // Redirecting to a different site, clear sensitive data. if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) { if ('host' in options.headers) { delete options.headers.host; } if ('cookie' in options.headers) { delete options.headers.cookie; } if ('authorization' in options.headers) { delete options.headers.authorization; } if (options.username || options.password) { options.username = ''; options.password = ''; } } else { redirectUrl.username = options.username; redirectUrl.password = options.password; } this.redirects.push(redirectString); options.url = redirectUrl; for (const hook of options.hooks.beforeRedirect) { // eslint-disable-next-line no-await-in-loop await hook(options, typedResponse); } this.emit('redirect', typedResponse, options); await this._makeRequest(); } catch (error) { this._beforeError(error); return; } return; } if (options.isStream && options.throwHttpErrors && !is_response_ok_1.isResponseOk(typedResponse)) { this._beforeError(new HTTPError(typedResponse)); return; } response.on('readable', () => { if (this[kTriggerRead]) { this._read(); } }); this.on('resume', () => { response.resume(); }); this.on('pause', () => { response.pause(); }); response.once('end', () => { this.push(null); }); this.emit('response', response); for (const destination of this[kServerResponsesPiped]) { if (destination.headersSent) { continue; } // eslint-disable-next-line guard-for-in for (const key in response.headers) { const isAllowed = options.decompress ? key !== 'content-encoding' : true; const value = response.headers[key]; if (isAllowed) { destination.setHeader(key, value); } } destination.statusCode = statusCode; } } async _onResponse(response) { try { await this._onResponseBase(response); } catch (error) { /* istanbul ignore next: better safe than sorry */ this._beforeError(error); } } _onRequest(request) { const { options } = this; const { timeout, url } = options; http_timer_1.default(request); this[kCancelTimeouts] = timed_out_1.default(request, timeout, url); const responseEventName = options.cache ? 'cacheableResponse' : 'response'; request.once(responseEventName, (response) => { void this._onResponse(response); }); request.once('error', (error) => { var _a; // Force clean-up, because some packages (e.g. nock) don't do this. request.destroy(); // Node.js <= 12.18.2 mistakenly emits the response `end` first. (_a = request.res) === null || _a === void 0 ? void 0 : _a.removeAllListeners('end'); error = error instanceof timed_out_1.TimeoutError ? new TimeoutError(error, this.timings, this) : new RequestError(error.message, error, this); this._beforeError(error); }); this[kUnproxyEvents] = proxy_events_1.default(request, this, proxiedRequestEvents); this[kRequest] = request; this.emit('uploadProgress', this.uploadProgress); // Send body const body = this[kBody]; const currentRequest = this.redirects.length === 0 ? this : request; if (is_1.default.nodeStream(body)) { body.pipe(currentRequest); body.once('error', (error) => { this._beforeError(new UploadError(error, this)); }); } else { this._unlockWrite(); if (!is_1.default.undefined(body)) { this._writeRequest(body, undefined, () => { }); currentRequest.end(); this._lockWrite(); } else if (this._cannotHaveBody || this._noPipe) { currentRequest.end(); this._lockWrite(); } } this.emit('request', request); } async _createCacheableRequest(url, options) { return new Promise((resolve, reject) => { // TODO: Remove `utils/url-to-options.ts` when `cacheable-request` is fixed Object.assign(options, url_to_options_1.default(url)); // `http-cache-semantics` checks this // TODO: Fix this ignore. // @ts-expect-error delete options.url; let request; // This is ugly const cacheRequest = cacheableStore.get(options.cache)(options, async (response) => { // TODO: Fix `cacheable-response` response._readableState.autoDestroy = false; if (request) { (await request).emit('cacheableResponse', response); } resolve(response); }); // Restore options options.url = url; cacheRequest.once('error', reject); cacheRequest.once('request', async (requestOrPromise) => { request = requestOrPromise; resolve(request); }); }); } async _makeRequest() { var _a, _b, _c, _d, _e; const { options } = this; const { headers } = options; for (const key in headers) { if (is_1.default.undefined(headers[key])) { // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete headers[key]; } else if (is_1.default.null_(headers[key])) { throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${key}\` header`); } } if (options.decompress && is_1.default.undefined(headers['accept-encoding'])) { headers['accept-encoding'] = supportsBrotli ? 'gzip, deflate, br' : 'gzip, deflate'; } // Set cookies if (options.cookieJar) { const cookieString = await options.cookieJar.getCookieString(options.url.toString()); if (is_1.default.nonEmptyString(cookieString)) { options.headers.cookie = cookieString; } } for (const hook of options.hooks.beforeRequest) { // eslint-disable-next-line no-await-in-loop const result = await hook(options); if (!is_1.default.undefined(result)) { // @ts-expect-error Skip the type mismatch to support abstract responses options.request = () => result; break; } } if (options.body && this[kBody] !== options.body) { this[kBody] = options.body; } const { agent, request, timeout, url } = options; if (options.dnsCache && !('lookup' in options)) { options.lookup = options.dnsCache.lookup; } // UNIX sockets if (url.hostname === 'unix') { const matches = /(?.+?):(?.+)/.exec(`${url.pathname}${url.search}`); if (matches === null || matches === void 0 ? void 0 : matches.groups) { const { socketPath, path } = matches.groups; Object.assign(options, { socketPath, path, host: '' }); } } const isHttps = url.protocol === 'https:'; // Fallback function let fallbackFn; if (options.http2) { fallbackFn = http2wrapper.auto; } else { fallbackFn = isHttps ? https.request : http.request; } const realFn = (_a = options.request) !== null && _a !== void 0 ? _a : fallbackFn; // Cache support const fn = options.cache ? this._createCacheableRequest : realFn; // Pass an agent directly when HTTP2 is disabled if (agent && !options.http2) { options.agent = agent[isHttps ? 'https' : 'http']; } // Prepare plain HTTP request options options[kRequest] = realFn; delete options.request; // TODO: Fix this ignore. // @ts-expect-error delete options.timeout; const requestOptions = options; requestOptions.shared = (_b = options.cacheOptions) === null || _b === void 0 ? void 0 : _b.shared; requestOptions.cacheHeuristic = (_c = options.cacheOptions) === null || _c === void 0 ? void 0 : _c.cacheHeuristic; requestOptions.immutableMinTimeToLive = (_d = options.cacheOptions) === null || _d === void 0 ? void 0 : _d.immutableMinTimeToLive; requestOptions.ignoreCargoCult = (_e = options.cacheOptions) === null || _e === void 0 ? void 0 : _e.ignoreCargoCult; // If `dnsLookupIpVersion` is not present do not override `family` if (options.dnsLookupIpVersion !== undefined) { try { requestOptions.family = dns_ip_version_1.dnsLookupIpVersionToFamily(options.dnsLookupIpVersion); } catch (_f) { throw new Error('Invalid `dnsLookupIpVersion` option value'); } } // HTTPS options remapping if (options.https) { if ('rejectUnauthorized' in options.https) { requestOptions.rejectUnauthorized = options.https.rejectUnauthorized; } if (options.https.checkServerIdentity) { requestOptions.checkServerIdentity = options.https.checkServerIdentity; } if (options.https.certificateAuthority) { requestOptions.ca = options.https.certificateAuthority; } if (options.https.certificate) { requestOptions.cert = options.https.certificate; } if (options.https.key) { requestOptions.key = options.https.key; } if (options.https.passphrase) { requestOptions.passphrase = options.https.passphrase; } if (options.https.pfx) { requestOptions.pfx = options.https.pfx; } } try { let requestOrResponse = await fn(url, requestOptions); if (is_1.default.undefined(requestOrResponse)) { requestOrResponse = fallbackFn(url, requestOptions); } // Restore options options.request = request; options.timeout = timeout; options.agent = agent; // HTTPS options restore if (options.https) { if ('rejectUnauthorized' in options.https) { delete requestOptions.rejectUnauthorized; } if (options.https.checkServerIdentity) { // @ts-expect-error - This one will be removed when we remove the alias. delete requestOptions.checkServerIdentity; } if (options.https.certificateAuthority) { delete requestOptions.ca; } if (options.https.certificate) { delete requestOptions.cert; } if (options.https.key) { delete requestOptions.key; } if (options.https.passphrase) { delete requestOptions.passphrase; } if (options.https.pfx) { delete requestOptions.pfx; } } if (isClientRequest(requestOrResponse)) { this._onRequest(requestOrResponse); // Emit the response after the stream has been ended } else if (this.writable) { this.once('finish', () => { void this._onResponse(requestOrResponse); }); this._unlockWrite(); this.end(); this._lockWrite(); } else { void this._onResponse(requestOrResponse); } } catch (error) { if (error instanceof CacheableRequest.CacheError) { throw new CacheError(error, this); } throw new RequestError(error.message, error, this); } } async _error(error) { try { for (const hook of this.options.hooks.beforeError) { // eslint-disable-next-line no-await-in-loop error = await hook(error); } } catch (error_) { error = new RequestError(error_.message, error_, this); } this.destroy(error); } _beforeError(error) { if (this[kStopReading]) { return; } const { options } = this; const retryCount = this.retryCount + 1; this[kStopReading] = true; if (!(error instanceof RequestError)) { error = new RequestError(error.message, error, this); } const typedError = error; const { response } = typedError; void (async () => { if (response && !response.body) { response.setEncoding(this._readableState.encoding); try { response.rawBody = await get_buffer_1.default(response); response.body = response.rawBody.toString(); } catch (_a) { } } if (this.listenerCount('retry') !== 0) { let backoff; try { let retryAfter; if (response && 'retry-after' in response.headers) { retryAfter = Number(response.headers['retry-after']); if (Number.isNaN(retryAfter)) { retryAfter = Date.parse(response.headers['retry-after']) - Date.now(); if (retryAfter <= 0) { retryAfter = 1; } } else { retryAfter *= 1000; } } backoff = await options.retry.calculateDelay({ attemptCount: retryCount, retryOptions: options.retry, error: typedError, retryAfter, computedValue: calculate_retry_delay_1.default({ attemptCount: retryCount, retryOptions: options.retry, error: typedError, retryAfter, computedValue: 0 }) }); } catch (error_) { void this._error(new RequestError(error_.message, error_, this)); return; } if (backoff) { const retry = async () => { try { for (const hook of this.options.hooks.beforeRetry) { // eslint-disable-next-line no-await-in-loop await hook(this.options, typedError, retryCount); } } catch (error_) { void this._error(new RequestError(error_.message, error, this)); return; } // Something forced us to abort the retry if (this.destroyed) { return; } this.destroy(); this.emit('retry', retryCount, error); }; this[kRetryTimeout] = setTimeout(retry, backoff); return; } } void this._error(typedError); })(); } _read() { this[kTriggerRead] = true; const response = this[kResponse]; if (response && !this[kStopReading]) { // We cannot put this in the `if` above // because `.read()` also triggers the `end` event if (response.readableLength) { this[kTriggerRead] = false; } let data; while ((data = response.read()) !== null) { this[kDownloadedSize] += data.length; this[kStartedReading] = true; const progress = this.downloadProgress; if (progress.percent < 1) { this.emit('downloadProgress', progress); } this.push(data); } } } // Node.js 12 has incorrect types, so the encoding must be a string _write(chunk, encoding, callback) { const write = () => { this._writeRequest(chunk, encoding, callback); }; if (this.requestInitialized) { write(); } else { this[kJobs].push(write); } } _writeRequest(chunk, encoding, callback) { if (this[kRequest].destroyed) { // Probably the `ClientRequest` instance will throw return; } this._progressCallbacks.push(() => { this[kUploadedSize] += Buffer.byteLength(chunk, encoding); const progress = this.uploadProgress; if (progress.percent < 1) { this.emit('uploadProgress', progress); } }); // TODO: What happens if it's from cache? Then this[kRequest] won't be defined. this[kRequest].write(chunk, encoding, (error) => { if (!error && this._progressCallbacks.length > 0) { this._progressCallbacks.shift()(); } callback(error); }); } _final(callback) { const endRequest = () => { // FIX: Node.js 10 calls the write callback AFTER the end callback! while (this._progressCallbacks.length !== 0) { this._progressCallbacks.shift()(); } // We need to check if `this[kRequest]` is present, // because it isn't when we use cache. if (!(kRequest in this)) { callback(); return; } if (this[kRequest].destroyed) { callback(); return; } this[kRequest].end((error) => { if (!error) { this[kBodySize] = this[kUploadedSize]; this.emit('uploadProgress', this.uploadProgress); this[kRequest].emit('upload-complete'); } callback(error); }); }; if (this.requestInitialized) { endRequest(); } else { this[kJobs].push(endRequest); } } _destroy(error, callback) { var _a; this[kStopReading] = true; // Prevent further retries clearTimeout(this[kRetryTimeout]); if (kRequest in this) { this[kCancelTimeouts](); // TODO: Remove the next `if` when these get fixed: // - https://github.com/nodejs/node/issues/32851 if (!((_a = this[kResponse]) === null || _a === void 0 ? void 0 : _a.complete)) { this[kRequest].destroy(); } } if (error !== null && !is_1.default.undefined(error) && !(error instanceof RequestError)) { error = new RequestError(error.message, error, this); } callback(error); } get _isAboutToError() { return this[kStopReading]; } /** The remote IP address. */ get ip() { var _a; return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress; } /** Indicates whether the request has been aborted or not. */ get aborted() { var _a, _b, _c; return ((_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroyed) !== null && _b !== void 0 ? _b : this.destroyed) && !((_c = this[kOriginalResponse]) === null || _c === void 0 ? void 0 : _c.complete); } get socket() { var _a, _b; return (_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.socket) !== null && _b !== void 0 ? _b : undefined; } /** Progress event for downloading (receiving a response). */ get downloadProgress() { let percent; if (this[kResponseSize]) { percent = this[kDownloadedSize] / this[kResponseSize]; } else if (this[kResponseSize] === this[kDownloadedSize]) { percent = 1; } else { percent = 0; } return { percent, transferred: this[kDownloadedSize], total: this[kResponseSize] }; } /** Progress event for uploading (sending a request). */ get uploadProgress() { let percent; if (this[kBodySize]) { percent = this[kUploadedSize] / this[kBodySize]; } else if (this[kBodySize] === this[kUploadedSize]) { percent = 1; } else { percent = 0; } return { percent, transferred: this[kUploadedSize], total: this[kBodySize] }; } /** The object contains the following properties: - `start` - Time when the request started. - `socket` - Time when a socket was assigned to the request. - `lookup` - Time when the DNS lookup finished. - `connect` - Time when the socket successfully connected. - `secureConnect` - Time when the socket securely connected. - `upload` - Time when the request finished uploading. - `response` - Time when the request fired `response` event. - `end` - Time when the response fired `end` event. - `error` - Time when the request fired `error` event. - `abort` - Time when the request fired `abort` event. - `phases` - `wait` - `timings.socket - timings.start` - `dns` - `timings.lookup - timings.socket` - `tcp` - `timings.connect - timings.lookup` - `tls` - `timings.secureConnect - timings.connect` - `request` - `timings.upload - (timings.secureConnect || timings.connect)` - `firstByte` - `timings.response - timings.upload` - `download` - `timings.end - timings.response` - `total` - `(timings.end || timings.error || timings.abort) - timings.start` If something has not been measured yet, it will be `undefined`. __Note__: The time is a `number` representing the milliseconds elapsed since the UNIX epoch. */ get timings() { var _a; return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings; } /** Whether the response was retrieved from the cache. */ get isFromCache() { return this[kIsFromCache]; } pipe(destination, options) { if (this[kStartedReading]) { throw new Error('Failed to pipe. The response has been emitted already.'); } if (destination instanceof http_1.ServerResponse) { this[kServerResponsesPiped].add(destination); } return super.pipe(destination, options); } unpipe(destination) { if (destination instanceof http_1.ServerResponse) { this[kServerResponsesPiped].delete(destination); } super.unpipe(destination); return this; } } exports.default = Request; /***/ }), /***/ 94993: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.dnsLookupIpVersionToFamily = exports.isDnsLookupIpVersion = void 0; const conversionTable = { auto: 0, ipv4: 4, ipv6: 6 }; exports.isDnsLookupIpVersion = (value) => { return value in conversionTable; }; exports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => { if (exports.isDnsLookupIpVersion(dnsLookupIpVersion)) { return conversionTable[dnsLookupIpVersion]; } throw new Error('Invalid DNS lookup IP version'); }; /***/ }), /***/ 94564: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs_1 = __webpack_require__(35747); const util_1 = __webpack_require__(31669); const is_1 = __webpack_require__(68977); const is_form_data_1 = __webpack_require__(90040); const statAsync = util_1.promisify(fs_1.stat); exports.default = async (body, headers) => { if (headers && 'content-length' in headers) { return Number(headers['content-length']); } if (!body) { return 0; } if (is_1.default.string(body)) { return Buffer.byteLength(body); } if (is_1.default.buffer(body)) { return body.length; } if (is_form_data_1.default(body)) { return util_1.promisify(body.getLength.bind(body))(); } if (body instanceof fs_1.ReadStream) { const { size } = await statAsync(body.path); if (size === 0) { return undefined; } return size; } return undefined; }; /***/ }), /***/ 34500: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // TODO: Update https://github.com/sindresorhus/get-stream const getBuffer = async (stream) => { const chunks = []; let length = 0; for await (const chunk of stream) { chunks.push(chunk); length += Buffer.byteLength(chunk); } if (Buffer.isBuffer(chunks[0])) { return Buffer.concat(chunks, length); } return Buffer.from(chunks.join('')); }; exports.default = getBuffer; /***/ }), /***/ 90040: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const is_1 = __webpack_require__(68977); exports.default = (body) => is_1.default.nodeStream(body) && is_1.default.function_(body.getBoundary); /***/ }), /***/ 49298: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isResponseOk = void 0; exports.isResponseOk = (response) => { const { statusCode } = response; const limitStatusCode = response.request.options.followRedirect ? 299 : 399; return (statusCode >= 200 && statusCode <= limitStatusCode) || statusCode === 304; }; /***/ }), /***/ 9219: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); /* istanbul ignore file: deprecated */ const url_1 = __webpack_require__(78835); const keys = [ 'protocol', 'host', 'hostname', 'port', 'pathname', 'search' ]; exports.default = (origin, options) => { var _a, _b; if (options.path) { if (options.pathname) { throw new TypeError('Parameters `path` and `pathname` are mutually exclusive.'); } if (options.search) { throw new TypeError('Parameters `path` and `search` are mutually exclusive.'); } if (options.searchParams) { throw new TypeError('Parameters `path` and `searchParams` are mutually exclusive.'); } } if (options.search && options.searchParams) { throw new TypeError('Parameters `search` and `searchParams` are mutually exclusive.'); } if (!origin) { if (!options.protocol) { throw new TypeError('No URL protocol specified'); } origin = `${options.protocol}//${(_b = (_a = options.hostname) !== null && _a !== void 0 ? _a : options.host) !== null && _b !== void 0 ? _b : ''}`; } const url = new url_1.URL(origin); if (options.path) { const searchIndex = options.path.indexOf('?'); if (searchIndex === -1) { options.pathname = options.path; } else { options.pathname = options.path.slice(0, searchIndex); options.search = options.path.slice(searchIndex + 1); } delete options.path; } for (const key of keys) { if (options[key]) { url[key] = options[key].toString(); } } return url; }; /***/ }), /***/ 53021: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function default_1(from, to, events) { const fns = {}; for (const event of events) { fns[event] = (...args) => { to.emit(event, ...args); }; from.on(event, fns[event]); } return () => { for (const event of events) { from.off(event, fns[event]); } }; } exports.default = default_1; /***/ }), /***/ 52454: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TimeoutError = void 0; const net = __webpack_require__(11631); const unhandle_1 = __webpack_require__(81593); const reentry = Symbol('reentry'); const noop = () => { }; class TimeoutError extends Error { constructor(threshold, event) { super(`Timeout awaiting '${event}' for ${threshold}ms`); this.event = event; this.name = 'TimeoutError'; this.code = 'ETIMEDOUT'; } } exports.TimeoutError = TimeoutError; exports.default = (request, delays, options) => { if (reentry in request) { return noop; } request[reentry] = true; const cancelers = []; const { once, unhandleAll } = unhandle_1.default(); const addTimeout = (delay, callback, event) => { var _a; const timeout = setTimeout(callback, delay, delay, event); (_a = timeout.unref) === null || _a === void 0 ? void 0 : _a.call(timeout); const cancel = () => { clearTimeout(timeout); }; cancelers.push(cancel); return cancel; }; const { host, hostname } = options; const timeoutHandler = (delay, event) => { request.destroy(new TimeoutError(delay, event)); }; const cancelTimeouts = () => { for (const cancel of cancelers) { cancel(); } unhandleAll(); }; request.once('error', error => { cancelTimeouts(); // Save original behavior /* istanbul ignore next */ if (request.listenerCount('error') === 0) { throw error; } }); request.once('close', cancelTimeouts); once(request, 'response', (response) => { once(response, 'end', cancelTimeouts); }); if (typeof delays.request !== 'undefined') { addTimeout(delays.request, timeoutHandler, 'request'); } if (typeof delays.socket !== 'undefined') { const socketTimeoutHandler = () => { timeoutHandler(delays.socket, 'socket'); }; request.setTimeout(delays.socket, socketTimeoutHandler); // `request.setTimeout(0)` causes a memory leak. // We can just remove the listener and forget about the timer - it's unreffed. // See https://github.com/sindresorhus/got/issues/690 cancelers.push(() => { request.removeListener('timeout', socketTimeoutHandler); }); } once(request, 'socket', (socket) => { var _a; const { socketPath } = request; /* istanbul ignore next: hard to test */ if (socket.connecting) { const hasPath = Boolean(socketPath !== null && socketPath !== void 0 ? socketPath : net.isIP((_a = hostname !== null && hostname !== void 0 ? hostname : host) !== null && _a !== void 0 ? _a : '') !== 0); if (typeof delays.lookup !== 'undefined' && !hasPath && typeof socket.address().address === 'undefined') { const cancelTimeout = addTimeout(delays.lookup, timeoutHandler, 'lookup'); once(socket, 'lookup', cancelTimeout); } if (typeof delays.connect !== 'undefined') { const timeConnect = () => addTimeout(delays.connect, timeoutHandler, 'connect'); if (hasPath) { once(socket, 'connect', timeConnect()); } else { once(socket, 'lookup', (error) => { if (error === null) { once(socket, 'connect', timeConnect()); } }); } } if (typeof delays.secureConnect !== 'undefined' && options.protocol === 'https:') { once(socket, 'connect', () => { const cancelTimeout = addTimeout(delays.secureConnect, timeoutHandler, 'secureConnect'); once(socket, 'secureConnect', cancelTimeout); }); } } if (typeof delays.send !== 'undefined') { const timeRequest = () => addTimeout(delays.send, timeoutHandler, 'send'); /* istanbul ignore next: hard to test */ if (socket.connecting) { once(socket, 'connect', () => { once(request, 'upload-complete', timeRequest()); }); } else { once(request, 'upload-complete', timeRequest()); } } }); if (typeof delays.response !== 'undefined') { once(request, 'upload-complete', () => { const cancelTimeout = addTimeout(delays.response, timeoutHandler, 'response'); once(request, 'response', cancelTimeout); }); } return cancelTimeouts; }; /***/ }), /***/ 81593: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // When attaching listeners, it's very easy to forget about them. // Especially if you do error handling and set timeouts. // So instead of checking if it's proper to throw an error on every timeout ever, // use this simple tool which will remove all listeners you have attached. exports.default = () => { const handlers = []; return { once(origin, event, fn) { origin.once(event, fn); handlers.push({ origin, event, fn }); }, unhandleAll() { for (const handler of handlers) { const { origin, event, fn } = handler; origin.removeListener(event, fn); } handlers.length = 0; } }; }; /***/ }), /***/ 8026: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const is_1 = __webpack_require__(68977); exports.default = (url) => { // Cast to URL url = url; const options = { protocol: url.protocol, hostname: is_1.default.string(url.hostname) && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, host: url.host, hash: url.hash, search: url.search, pathname: url.pathname, href: url.href, path: `${url.pathname || ''}${url.search || ''}` }; if (is_1.default.string(url.port) && url.port.length > 0) { options.port = Number(url.port); } if (url.username || url.password) { options.auth = `${url.username || ''}:${url.password || ''}`; } return options; }; /***/ }), /***/ 7288: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class WeakableMap { constructor() { this.weakMap = new WeakMap(); this.map = new Map(); } set(key, value) { if (typeof key === 'object') { this.weakMap.set(key, value); } else { this.map.set(key, value); } } get(key) { if (typeof key === 'object') { return this.weakMap.get(key); } return this.map.get(key); } has(key) { if (typeof key === 'object') { return this.weakMap.has(key); } return this.map.has(key); } } exports.default = WeakableMap; /***/ }), /***/ 34337: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaultHandler = void 0; const is_1 = __webpack_require__(68977); const as_promise_1 = __webpack_require__(36056); const create_rejection_1 = __webpack_require__(26457); const core_1 = __webpack_require__(99873); const deep_freeze_1 = __webpack_require__(70285); const errors = { RequestError: as_promise_1.RequestError, CacheError: as_promise_1.CacheError, ReadError: as_promise_1.ReadError, HTTPError: as_promise_1.HTTPError, MaxRedirectsError: as_promise_1.MaxRedirectsError, TimeoutError: as_promise_1.TimeoutError, ParseError: as_promise_1.ParseError, CancelError: as_promise_1.CancelError, UnsupportedProtocolError: as_promise_1.UnsupportedProtocolError, UploadError: as_promise_1.UploadError }; // The `delay` package weighs 10KB (!) const delay = async (ms) => new Promise(resolve => { setTimeout(resolve, ms); }); const { normalizeArguments } = core_1.default; const mergeOptions = (...sources) => { let mergedOptions; for (const source of sources) { mergedOptions = normalizeArguments(undefined, source, mergedOptions); } return mergedOptions; }; const getPromiseOrStream = (options) => options.isStream ? new core_1.default(undefined, options) : as_promise_1.default(options); const isGotInstance = (value) => ('defaults' in value && 'options' in value.defaults); const aliases = [ 'get', 'post', 'put', 'patch', 'head', 'delete' ]; exports.defaultHandler = (options, next) => next(options); const callInitHooks = (hooks, options) => { if (hooks) { for (const hook of hooks) { hook(options); } } }; const create = (defaults) => { // Proxy properties from next handlers defaults._rawHandlers = defaults.handlers; defaults.handlers = defaults.handlers.map(fn => ((options, next) => { // This will be assigned by assigning result let root; const result = fn(options, newOptions => { root = next(newOptions); return root; }); if (result !== root && !options.isStream && root) { const typedResult = result; const { then: promiseThen, catch: promiseCatch, finally: promiseFianlly } = typedResult; Object.setPrototypeOf(typedResult, Object.getPrototypeOf(root)); Object.defineProperties(typedResult, Object.getOwnPropertyDescriptors(root)); // These should point to the new promise // eslint-disable-next-line promise/prefer-await-to-then typedResult.then = promiseThen; typedResult.catch = promiseCatch; typedResult.finally = promiseFianlly; } return result; })); // Got interface const got = ((url, options = {}, _defaults) => { var _a, _b; let iteration = 0; const iterateHandlers = (newOptions) => { return defaults.handlers[iteration++](newOptions, iteration === defaults.handlers.length ? getPromiseOrStream : iterateHandlers); }; // TODO: Remove this in Got 12. if (is_1.default.plainObject(url)) { const mergedOptions = { ...url, ...options }; core_1.setNonEnumerableProperties([url, options], mergedOptions); options = mergedOptions; url = undefined; } try { // Call `init` hooks let initHookError; try { callInitHooks(defaults.options.hooks.init, options); callInitHooks((_a = options.hooks) === null || _a === void 0 ? void 0 : _a.init, options); } catch (error) { initHookError = error; } // Normalize options & call handlers const normalizedOptions = normalizeArguments(url, options, _defaults !== null && _defaults !== void 0 ? _defaults : defaults.options); normalizedOptions[core_1.kIsNormalizedAlready] = true; if (initHookError) { throw new as_promise_1.RequestError(initHookError.message, initHookError, normalizedOptions); } return iterateHandlers(normalizedOptions); } catch (error) { if (options.isStream) { throw error; } else { return create_rejection_1.default(error, defaults.options.hooks.beforeError, (_b = options.hooks) === null || _b === void 0 ? void 0 : _b.beforeError); } } }); got.extend = (...instancesOrOptions) => { const optionsArray = [defaults.options]; let handlers = [...defaults._rawHandlers]; let isMutableDefaults; for (const value of instancesOrOptions) { if (isGotInstance(value)) { optionsArray.push(value.defaults.options); handlers.push(...value.defaults._rawHandlers); isMutableDefaults = value.defaults.mutableDefaults; } else { optionsArray.push(value); if ('handlers' in value) { handlers.push(...value.handlers); } isMutableDefaults = value.mutableDefaults; } } handlers = handlers.filter(handler => handler !== exports.defaultHandler); if (handlers.length === 0) { handlers.push(exports.defaultHandler); } return create({ options: mergeOptions(...optionsArray), handlers, mutableDefaults: Boolean(isMutableDefaults) }); }; // Pagination const paginateEach = (async function* (url, options) { // TODO: Remove this `@ts-expect-error` when upgrading to TypeScript 4. // Error: Argument of type 'Merge> | undefined' is not assignable to parameter of type 'Options | undefined'. // @ts-expect-error let normalizedOptions = normalizeArguments(url, options, defaults.options); normalizedOptions.resolveBodyOnly = false; const pagination = normalizedOptions.pagination; if (!is_1.default.object(pagination)) { throw new TypeError('`options.pagination` must be implemented'); } const all = []; let { countLimit } = pagination; let numberOfRequests = 0; while (numberOfRequests < pagination.requestLimit) { if (numberOfRequests !== 0) { // eslint-disable-next-line no-await-in-loop await delay(pagination.backoff); } // @ts-expect-error FIXME! // TODO: Throw when result is not an instance of Response // eslint-disable-next-line no-await-in-loop const result = (await got(undefined, undefined, normalizedOptions)); // eslint-disable-next-line no-await-in-loop const parsed = await pagination.transform(result); const current = []; for (const item of parsed) { if (pagination.filter(item, all, current)) { if (!pagination.shouldContinue(item, all, current)) { return; } yield item; if (pagination.stackAllItems) { all.push(item); } current.push(item); if (--countLimit <= 0) { return; } } } const optionsToMerge = pagination.paginate(result, all, current); if (optionsToMerge === false) { return; } if (optionsToMerge === result.request.options) { normalizedOptions = result.request.options; } else if (optionsToMerge !== undefined) { normalizedOptions = normalizeArguments(undefined, optionsToMerge, normalizedOptions); } numberOfRequests++; } }); got.paginate = paginateEach; got.paginate.all = (async (url, options) => { const results = []; for await (const item of paginateEach(url, options)) { results.push(item); } return results; }); // For those who like very descriptive names got.paginate.each = paginateEach; // Stream API got.stream = ((url, options) => got(url, { ...options, isStream: true })); // Shortcuts for (const method of aliases) { got[method] = ((url, options) => got(url, { ...options, method })); got.stream[method] = ((url, options) => { return got(url, { ...options, method, isStream: true }); }); } Object.assign(got, errors); Object.defineProperty(got, 'defaults', { value: defaults.mutableDefaults ? defaults : deep_freeze_1.default(defaults), writable: defaults.mutableDefaults, configurable: defaults.mutableDefaults, enumerable: true }); got.mergeOptions = mergeOptions; return got; }; exports.default = create; __exportStar(__webpack_require__(72613), exports); /***/ }), /***/ 93061: /***/ (function(module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); const url_1 = __webpack_require__(78835); const create_1 = __webpack_require__(34337); const defaults = { options: { method: 'GET', retry: { limit: 2, methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ], statusCodes: [ 408, 413, 429, 500, 502, 503, 504, 521, 522, 524 ], errorCodes: [ 'ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN' ], maxRetryAfter: undefined, calculateDelay: ({ computedValue }) => computedValue }, timeout: {}, headers: { 'user-agent': 'got (https://github.com/sindresorhus/got)' }, hooks: { init: [], beforeRequest: [], beforeRedirect: [], beforeRetry: [], beforeError: [], afterResponse: [] }, cache: undefined, dnsCache: undefined, decompress: true, throwHttpErrors: true, followRedirect: true, isStream: false, responseType: 'text', resolveBodyOnly: false, maxRedirects: 10, prefixUrl: '', methodRewriting: true, ignoreInvalidCookies: false, context: {}, // TODO: Set this to `true` when Got 12 gets released http2: false, allowGetBody: false, https: undefined, pagination: { transform: (response) => { if (response.request.options.responseType === 'json') { return response.body; } return JSON.parse(response.body); }, paginate: response => { if (!Reflect.has(response.headers, 'link')) { return false; } const items = response.headers.link.split(','); let next; for (const item of items) { const parsed = item.split(';'); if (parsed[1].includes('next')) { next = parsed[0].trimStart().trim(); next = next.slice(1, -1); break; } } if (next) { const options = { url: new url_1.URL(next) }; return options; } return false; }, filter: () => true, shouldContinue: () => true, countLimit: Infinity, backoff: 0, requestLimit: 10000, stackAllItems: true }, parseJson: (text) => JSON.parse(text), stringifyJson: (object) => JSON.stringify(object), cacheOptions: {} }, handlers: [create_1.defaultHandler], mutableDefaults: false }; const got = create_1.default(defaults); exports.default = got; // For CommonJS default export support module.exports = got; module.exports.default = got; module.exports.__esModule = true; // Workaround for TS issue: https://github.com/sindresorhus/got/pull/1267 __exportStar(__webpack_require__(34337), exports); __exportStar(__webpack_require__(36056), exports); /***/ }), /***/ 72613: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), /***/ 70285: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const is_1 = __webpack_require__(68977); function deepFreeze(object) { for (const value of Object.values(object)) { if (is_1.default.plainObject(value) || is_1.default.array(value)) { deepFreeze(value); } } return Object.freeze(object); } exports.default = deepFreeze; /***/ }), /***/ 397: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const alreadyWarned = new Set(); exports.default = (message) => { if (alreadyWarned.has(message)) { return; } alreadyWarned.add(message); // @ts-expect-error Missing types. process.emitWarning(`Got: ${message}`, { type: 'DeprecationWarning' }); }; /***/ }), /***/ 68977: /***/ ((module, exports) => { "use strict"; /// /// /// Object.defineProperty(exports, "__esModule", ({ value: true })); const typedArrayTypeNames = [ 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array', 'BigInt64Array', 'BigUint64Array' ]; function isTypedArrayName(name) { return typedArrayTypeNames.includes(name); } const objectTypeNames = [ 'Function', 'Generator', 'AsyncGenerator', 'GeneratorFunction', 'AsyncGeneratorFunction', 'AsyncFunction', 'Observable', 'Array', 'Buffer', 'Object', 'RegExp', 'Date', 'Error', 'Map', 'Set', 'WeakMap', 'WeakSet', 'ArrayBuffer', 'SharedArrayBuffer', 'DataView', 'Promise', 'URL', 'HTMLElement', ...typedArrayTypeNames ]; function isObjectTypeName(name) { return objectTypeNames.includes(name); } const primitiveTypeNames = [ 'null', 'undefined', 'string', 'number', 'bigint', 'boolean', 'symbol' ]; function isPrimitiveTypeName(name) { return primitiveTypeNames.includes(name); } // eslint-disable-next-line @typescript-eslint/ban-types function isOfType(type) { return (value) => typeof value === type; } const { toString } = Object.prototype; const getObjectType = (value) => { const objectTypeName = toString.call(value).slice(8, -1); if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) { return 'HTMLElement'; } if (isObjectTypeName(objectTypeName)) { return objectTypeName; } return undefined; }; const isObjectOfType = (type) => (value) => getObjectType(value) === type; function is(value) { if (value === null) { return 'null'; } switch (typeof value) { case 'undefined': return 'undefined'; case 'string': return 'string'; case 'number': return 'number'; case 'boolean': return 'boolean'; case 'function': return 'Function'; case 'bigint': return 'bigint'; case 'symbol': return 'symbol'; default: } if (is.observable(value)) { return 'Observable'; } if (is.array(value)) { return 'Array'; } if (is.buffer(value)) { return 'Buffer'; } const tagType = getObjectType(value); if (tagType) { return tagType; } if (value instanceof String || value instanceof Boolean || value instanceof Number) { throw new TypeError('Please don\'t use object wrappers for primitive types'); } return 'Object'; } is.undefined = isOfType('undefined'); is.string = isOfType('string'); const isNumberType = isOfType('number'); is.number = (value) => isNumberType(value) && !is.nan(value); is.bigint = isOfType('bigint'); // eslint-disable-next-line @typescript-eslint/ban-types is.function_ = isOfType('function'); is.null_ = (value) => value === null; is.class_ = (value) => is.function_(value) && value.toString().startsWith('class '); is.boolean = (value) => value === true || value === false; is.symbol = isOfType('symbol'); is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value)); is.array = (value, assertion) => { if (!Array.isArray(value)) { return false; } if (!is.function_(assertion)) { return true; } return value.every(assertion); }; is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; }; is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value)); is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); }; is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); }; is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw); is.nativePromise = (value) => isObjectOfType('Promise')(value); const hasPromiseAPI = (value) => { var _a, _b; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) && is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch); }; is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); is.generatorFunction = isObjectOfType('GeneratorFunction'); is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction'; is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction'; // eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); is.regExp = isObjectOfType('RegExp'); is.date = isObjectOfType('Date'); is.error = isObjectOfType('Error'); is.map = (value) => isObjectOfType('Map')(value); is.set = (value) => isObjectOfType('Set')(value); is.weakMap = (value) => isObjectOfType('WeakMap')(value); is.weakSet = (value) => isObjectOfType('WeakSet')(value); is.int8Array = isObjectOfType('Int8Array'); is.uint8Array = isObjectOfType('Uint8Array'); is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray'); is.int16Array = isObjectOfType('Int16Array'); is.uint16Array = isObjectOfType('Uint16Array'); is.int32Array = isObjectOfType('Int32Array'); is.uint32Array = isObjectOfType('Uint32Array'); is.float32Array = isObjectOfType('Float32Array'); is.float64Array = isObjectOfType('Float64Array'); is.bigInt64Array = isObjectOfType('BigInt64Array'); is.bigUint64Array = isObjectOfType('BigUint64Array'); is.arrayBuffer = isObjectOfType('ArrayBuffer'); is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer'); is.dataView = isObjectOfType('DataView'); is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype; is.urlInstance = (value) => isObjectOfType('URL')(value); is.urlString = (value) => { if (!is.string(value)) { return false; } try { new URL(value); // eslint-disable-line no-new return true; } catch (_a) { return false; } }; // TODO: Use the `not` operator with a type guard here when it's available. // Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);` is.truthy = (value) => Boolean(value); // Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);` is.falsy = (value) => !value; is.nan = (value) => Number.isNaN(value); is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value); is.integer = (value) => Number.isInteger(value); is.safeInteger = (value) => Number.isSafeInteger(value); is.plainObject = (value) => { // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js if (toString.call(value) !== '[object Object]') { return false; } const prototype = Object.getPrototypeOf(value); return prototype === null || prototype === Object.getPrototypeOf({}); }; is.typedArray = (value) => isTypedArrayName(getObjectType(value)); const isValidLength = (value) => is.safeInteger(value) && value >= 0; is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); is.inRange = (value, range) => { if (is.number(range)) { return value >= Math.min(0, range) && value <= Math.max(range, 0); } if (is.array(range) && range.length === 2) { return value >= Math.min(...range) && value <= Math.max(...range); } throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); }; const NODE_TYPE_ELEMENT = 1; const DOM_PROPERTIES_TO_CHECK = [ 'innerHTML', 'ownerDocument', 'style', 'attributes', 'nodeValue' ]; is.domElement = (value) => { return is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every(property => property in value); }; is.observable = (value) => { var _a, _b, _c, _d; if (!value) { return false; } // eslint-disable-next-line no-use-extend-native/no-use-extend-native if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) { return true; } if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) { return true; } return false; }; is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value); is.infinite = (value) => value === Infinity || value === -Infinity; const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder; is.evenInteger = isAbsoluteMod2(0); is.oddInteger = isAbsoluteMod2(1); is.emptyArray = (value) => is.array(value) && value.length === 0; is.nonEmptyArray = (value) => is.array(value) && value.length > 0; is.emptyString = (value) => is.string(value) && value.length === 0; // TODO: Use `not ''` when the `not` operator is available. is.nonEmptyString = (value) => is.string(value) && value.length > 0; const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value); is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; // TODO: Use `not` operator here to remove `Map` and `Set` from type guard: // - https://github.com/Microsoft/TypeScript/pull/29317 is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; is.emptySet = (value) => is.set(value) && value.size === 0; is.nonEmptySet = (value) => is.set(value) && value.size > 0; is.emptyMap = (value) => is.map(value) && value.size === 0; is.nonEmptyMap = (value) => is.map(value) && value.size > 0; const predicateOnArray = (method, predicate, values) => { if (!is.function_(predicate)) { throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); } if (values.length === 0) { throw new TypeError('Invalid number of values'); } return method.call(values, predicate); }; is.any = (predicate, ...values) => { const predicates = is.array(predicate) ? predicate : [predicate]; return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values)); }; is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); const assertType = (condition, description, value, options = {}) => { if (!condition) { const { multipleValues } = options; const valuesMessage = multipleValues ? `received values of types ${[ ...new Set(value.map(singleValue => `\`${is(singleValue)}\``)) ].join(', ')}` : `received value of type \`${is(value)}\``; throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`); } }; exports.assert = { // Unknowns. undefined: (value) => assertType(is.undefined(value), 'undefined', value), string: (value) => assertType(is.string(value), 'string', value), number: (value) => assertType(is.number(value), 'number', value), bigint: (value) => assertType(is.bigint(value), 'bigint', value), // eslint-disable-next-line @typescript-eslint/ban-types function_: (value) => assertType(is.function_(value), 'Function', value), null_: (value) => assertType(is.null_(value), 'null', value), class_: (value) => assertType(is.class_(value), "Class" /* class_ */, value), boolean: (value) => assertType(is.boolean(value), 'boolean', value), symbol: (value) => assertType(is.symbol(value), 'symbol', value), numericString: (value) => assertType(is.numericString(value), "string with a number" /* numericString */, value), array: (value, assertion) => { const assert = assertType; assert(is.array(value), 'Array', value); if (assertion) { value.forEach(assertion); } }, buffer: (value) => assertType(is.buffer(value), 'Buffer', value), nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value), object: (value) => assertType(is.object(value), 'Object', value), iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value), asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value), generator: (value) => assertType(is.generator(value), 'Generator', value), asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value), nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value), promise: (value) => assertType(is.promise(value), 'Promise', value), generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value), asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value), // eslint-disable-next-line @typescript-eslint/ban-types asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value), // eslint-disable-next-line @typescript-eslint/ban-types boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value), regExp: (value) => assertType(is.regExp(value), 'RegExp', value), date: (value) => assertType(is.date(value), 'Date', value), error: (value) => assertType(is.error(value), 'Error', value), map: (value) => assertType(is.map(value), 'Map', value), set: (value) => assertType(is.set(value), 'Set', value), weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value), weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value), int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value), uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value), uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value), int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value), uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value), int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value), uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value), float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value), float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value), bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value), bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value), arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value), sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value), dataView: (value) => assertType(is.dataView(value), 'DataView', value), urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value), urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value), truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value), falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value), nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value), primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value), integer: (value) => assertType(is.integer(value), "integer" /* integer */, value), safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value), plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value), typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value), arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value), domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value), observable: (value) => assertType(is.observable(value), 'Observable', value), nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value), infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value), emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value), nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value), emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value), nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value), emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value), emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value), nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value), emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value), nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value), emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value), nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value), // Numbers. evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value), oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value), // Two arguments. directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance), inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value), // Variadic functions. any: (predicate, ...values) => { return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true }); }, all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true }) }; // Some few keywords are reserved, but we'll populate them for Node.js users // See https://github.com/Microsoft/TypeScript/issues/2536 Object.defineProperties(is, { class: { value: is.class_ }, function: { value: is.function_ }, null: { value: is.null_ } }); Object.defineProperties(exports.assert, { class: { value: exports.assert.class_ }, function: { value: exports.assert.function_ }, null: { value: exports.assert.null_ } }); exports.default = is; // For CommonJS default export support module.exports = is; module.exports.default = is; module.exports.assert = exports.assert; /***/ }), /***/ 76234: /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const defer_to_connect_1 = __webpack_require__(98183); const nodejsMajorVersion = Number(process.versions.node.split('.')[0]); const timer = (request) => { const timings = { start: Date.now(), socket: undefined, lookup: undefined, connect: undefined, secureConnect: undefined, upload: undefined, response: undefined, end: undefined, error: undefined, abort: undefined, phases: { wait: undefined, dns: undefined, tcp: undefined, tls: undefined, request: undefined, firstByte: undefined, download: undefined, total: undefined } }; request.timings = timings; const handleError = (origin) => { const emit = origin.emit.bind(origin); origin.emit = (event, ...args) => { // Catches the `error` event if (event === 'error') { timings.error = Date.now(); timings.phases.total = timings.error - timings.start; origin.emit = emit; } // Saves the original behavior return emit(event, ...args); }; }; handleError(request); request.prependOnceListener('abort', () => { timings.abort = Date.now(); // Let the `end` response event be responsible for setting the total phase, // unless the Node.js major version is >= 13. if (!timings.response || nodejsMajorVersion >= 13) { timings.phases.total = Date.now() - timings.start; } }); const onSocket = (socket) => { timings.socket = Date.now(); timings.phases.wait = timings.socket - timings.start; const lookupListener = () => { timings.lookup = Date.now(); timings.phases.dns = timings.lookup - timings.socket; }; socket.prependOnceListener('lookup', lookupListener); defer_to_connect_1.default(socket, { connect: () => { timings.connect = Date.now(); if (timings.lookup === undefined) { socket.removeListener('lookup', lookupListener); timings.lookup = timings.connect; timings.phases.dns = timings.lookup - timings.socket; } timings.phases.tcp = timings.connect - timings.lookup; // This callback is called before flushing any data, // so we don't need to set `timings.phases.request` here. }, secureConnect: () => { timings.secureConnect = Date.now(); timings.phases.tls = timings.secureConnect - timings.connect; } }); }; if (request.socket) { onSocket(request.socket); } else { request.prependOnceListener('socket', onSocket); } const onUpload = () => { var _a; timings.upload = Date.now(); timings.phases.request = timings.upload - (_a = timings.secureConnect, (_a !== null && _a !== void 0 ? _a : timings.connect)); }; const writableFinished = () => { if (typeof request.writableFinished === 'boolean') { return request.writableFinished; } // Node.js doesn't have `request.writableFinished` property return request.finished && request.outputSize === 0 && (!request.socket || request.socket.writableLength === 0); }; if (writableFinished()) { onUpload(); } else { request.prependOnceListener('finish', onUpload); } request.prependOnceListener('response', (response) => { timings.response = Date.now(); timings.phases.firstByte = timings.response - timings.upload; response.timings = timings; handleError(response); response.prependOnceListener('end', () => { timings.end = Date.now(); timings.phases.download = timings.end - timings.response; timings.phases.total = timings.end - timings.start; }); }); return timings; }; exports.default = timer; // For CommonJS default export support module.exports = timer; module.exports.default = timer; /***/ }), /***/ 69016: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const urlLib = __webpack_require__(78835); const normalizeUrl = __webpack_require__(17952); const getStream = __webpack_require__(21766); const CachePolicy = __webpack_require__(61002); const Response = __webpack_require__(9004); const lowercaseKeys = __webpack_require__(9662); const cloneResponse = __webpack_require__(81312); const Keyv = __webpack_require__(94432); class CacheableRequest { constructor(request, cacheAdapter) { if (typeof request !== 'function') { throw new TypeError('Parameter `request` must be a function'); } this.cache = new Keyv({ uri: typeof cacheAdapter === 'string' && cacheAdapter, store: typeof cacheAdapter !== 'string' && cacheAdapter, namespace: 'cacheable-request' }); return this.createCacheableRequest(request); } createCacheableRequest(request) { return (opts, cb) => { let url; if (typeof opts === 'string') { url = normalizeUrlObject(urlLib.parse(opts)); opts = {}; } else if (opts instanceof urlLib.URL) { url = normalizeUrlObject(urlLib.parse(opts.toString())); opts = {}; } else { const [pathname, ...searchParts] = (opts.path || '').split('?'); const search = searchParts.length > 0 ? `?${searchParts.join('?')}` : ''; url = normalizeUrlObject({ ...opts, pathname, search }); } opts = { headers: {}, method: 'GET', cache: true, strictTtl: false, automaticFailover: false, ...opts, ...urlObjectToRequestOptions(url) }; opts.headers = lowercaseKeys(opts.headers); const ee = new EventEmitter(); const normalizedUrlString = normalizeUrl( urlLib.format(url), { stripWWW: false, removeTrailingSlash: false, stripAuthentication: false } ); const key = `${opts.method}:${normalizedUrlString}`; let revalidate = false; let madeRequest = false; const makeRequest = opts => { madeRequest = true; let requestErrored = false; let requestErrorCallback; const requestErrorPromise = new Promise(resolve => { requestErrorCallback = () => { if (!requestErrored) { requestErrored = true; resolve(); } }; }); const handler = response => { if (revalidate && !opts.forceRefresh) { response.status = response.statusCode; const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response); if (!revalidatedPolicy.modified) { const headers = revalidatedPolicy.policy.responseHeaders(); response = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url); response.cachePolicy = revalidatedPolicy.policy; response.fromCache = true; } } if (!response.fromCache) { response.cachePolicy = new CachePolicy(opts, response, opts); response.fromCache = false; } let clonedResponse; if (opts.cache && response.cachePolicy.storable()) { clonedResponse = cloneResponse(response); (async () => { try { const bodyPromise = getStream.buffer(response); await Promise.race([ requestErrorPromise, new Promise(resolve => response.once('end', resolve)) ]); if (requestErrored) { return; } const body = await bodyPromise; const value = { cachePolicy: response.cachePolicy.toObject(), url: response.url, statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, body }; let ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined; if (opts.maxTtl) { ttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl; } await this.cache.set(key, value, ttl); } catch (error) { ee.emit('error', new CacheableRequest.CacheError(error)); } })(); } else if (opts.cache && revalidate) { (async () => { try { await this.cache.delete(key); } catch (error) { ee.emit('error', new CacheableRequest.CacheError(error)); } })(); } ee.emit('response', clonedResponse || response); if (typeof cb === 'function') { cb(clonedResponse || response); } }; try { const req = request(opts, handler); req.once('error', requestErrorCallback); req.once('abort', requestErrorCallback); ee.emit('request', req); } catch (error) { ee.emit('error', new CacheableRequest.RequestError(error)); } }; (async () => { const get = async opts => { await Promise.resolve(); const cacheEntry = opts.cache ? await this.cache.get(key) : undefined; if (typeof cacheEntry === 'undefined') { return makeRequest(opts); } const policy = CachePolicy.fromObject(cacheEntry.cachePolicy); if (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) { const headers = policy.responseHeaders(); const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url); response.cachePolicy = policy; response.fromCache = true; ee.emit('response', response); if (typeof cb === 'function') { cb(response); } } else { revalidate = cacheEntry; opts.headers = policy.revalidationHeaders(opts); makeRequest(opts); } }; const errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error)); this.cache.once('error', errorHandler); ee.on('response', () => this.cache.removeListener('error', errorHandler)); try { await get(opts); } catch (error) { if (opts.automaticFailover && !madeRequest) { makeRequest(opts); } ee.emit('error', new CacheableRequest.CacheError(error)); } })(); return ee; }; } } function urlObjectToRequestOptions(url) { const options = { ...url }; options.path = `${url.pathname || '/'}${url.search || ''}`; delete options.pathname; delete options.search; return options; } function normalizeUrlObject(url) { // If url was parsed by url.parse or new URL: // - hostname will be set // - host will be hostname[:port] // - port will be set if it was explicit in the parsed string // Otherwise, url was from request options: // - hostname or host may be set // - host shall not have port encoded return { protocol: url.protocol, auth: url.auth, hostname: url.hostname || url.host || 'localhost', port: url.port, pathname: url.pathname, search: url.search }; } CacheableRequest.RequestError = class extends Error { constructor(error) { super(error.message); this.name = 'RequestError'; Object.assign(this, error); } }; CacheableRequest.CacheError = class extends Error { constructor(error) { super(error.message); this.name = 'CacheError'; Object.assign(this, error); } }; module.exports = CacheableRequest; /***/ }), /***/ 22490: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {Transform, PassThrough} = __webpack_require__(92413); const zlib = __webpack_require__(78761); const mimicResponse = __webpack_require__(35039); module.exports = response => { const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase(); if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) { return response; } // TODO: Remove this when targeting Node.js 12. const isBrotli = contentEncoding === 'br'; if (isBrotli && typeof zlib.createBrotliDecompress !== 'function') { response.destroy(new Error('Brotli is not supported on Node.js < 12')); return response; } let isEmpty = true; const checker = new Transform({ transform(data, _encoding, callback) { isEmpty = false; callback(null, data); }, flush(callback) { callback(); } }); const finalStream = new PassThrough({ autoDestroy: false, destroy(error, callback) { response.destroy(); callback(error); } }); const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip(); decompressStream.once('error', error => { if (isEmpty && !response.readable) { finalStream.end(); return; } finalStream.destroy(error); }); mimicResponse(response, finalStream); response.pipe(checker).pipe(decompressStream).pipe(finalStream); return finalStream; }; /***/ }), /***/ 98183: /***/ ((module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function isTLSSocket(socket) { return socket.encrypted; } const deferToConnect = (socket, fn) => { let listeners; if (typeof fn === 'function') { const connect = fn; listeners = { connect }; } else { listeners = fn; } const hasConnectListener = typeof listeners.connect === 'function'; const hasSecureConnectListener = typeof listeners.secureConnect === 'function'; const hasCloseListener = typeof listeners.close === 'function'; const onConnect = () => { if (hasConnectListener) { listeners.connect(); } if (isTLSSocket(socket) && hasSecureConnectListener) { if (socket.authorized) { listeners.secureConnect(); } else if (!socket.authorizationError) { socket.once('secureConnect', listeners.secureConnect); } } if (hasCloseListener) { socket.once('close', listeners.close); } }; if (socket.writable && !socket.connecting) { onConnect(); } else if (socket.connecting) { socket.once('connect', onConnect); } else if (socket.destroyed && hasCloseListener) { listeners.close(socket._hadError); } }; exports.default = deferToConnect; // For CommonJS default export support module.exports = deferToConnect; module.exports.default = deferToConnect; /***/ }), /***/ 11460: /***/ ((__unused_webpack_module, exports) => { //TODO: handle reviver/dehydrate function like normal //and handle indentation, like normal. //if anyone needs this... please send pull request. exports.stringify = function stringify (o) { if('undefined' == typeof o) return o if(o && Buffer.isBuffer(o)) return JSON.stringify(':base64:' + o.toString('base64')) if(o && o.toJSON) o = o.toJSON() if(o && 'object' === typeof o) { var s = '' var array = Array.isArray(o) s = array ? '[' : '{' var first = true for(var k in o) { var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k]) if(Object.hasOwnProperty.call(o, k) && !ignore) { if(!first) s += ',' first = false if (array) { if(o[k] == undefined) s += 'null' else s += stringify(o[k]) } else if (o[k] !== void(0)) { s += stringify(k) + ':' + stringify(o[k]) } } } s += array ? ']' : '}' return s } else if ('string' === typeof o) { return JSON.stringify(/^:/.test(o) ? ':' + o : o) } else if ('undefined' === typeof o) { return 'null'; } else return JSON.stringify(o) } exports.parse = function (s) { return JSON.parse(s, function (key, value) { if('string' === typeof value) { if(/^:base64:/.test(value)) return Buffer.from(value.substring(8), 'base64') else return /^:/.test(value) ? value.substring(1) : value } return value }) } /***/ }), /***/ 94432: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const JSONB = __webpack_require__(11460); const loadStore = opts => { const adapters = { redis: '@keyv/redis', mongodb: '@keyv/mongo', mongo: '@keyv/mongo', sqlite: '@keyv/sqlite', postgresql: '@keyv/postgres', postgres: '@keyv/postgres', mysql: '@keyv/mysql' }; if (opts.adapter || opts.uri) { const adapter = opts.adapter || /^[^:]*/.exec(opts.uri)[0]; return new (require(adapters[adapter]))(opts); } return new Map(); }; class Keyv extends EventEmitter { constructor(uri, opts) { super(); this.opts = Object.assign( { namespace: 'keyv', serialize: JSONB.stringify, deserialize: JSONB.parse }, (typeof uri === 'string') ? { uri } : uri, opts ); if (!this.opts.store) { const adapterOpts = Object.assign({}, this.opts); this.opts.store = loadStore(adapterOpts); } if (typeof this.opts.store.on === 'function') { this.opts.store.on('error', err => this.emit('error', err)); } this.opts.store.namespace = this.opts.namespace; } _getKeyPrefix(key) { return `${this.opts.namespace}:${key}`; } get(key, opts) { const keyPrefixed = this._getKeyPrefix(key); const { store } = this.opts; return Promise.resolve() .then(() => store.get(keyPrefixed)) .then(data => { return (typeof data === 'string') ? this.opts.deserialize(data) : data; }) .then(data => { if (data === undefined) { return undefined; } if (typeof data.expires === 'number' && Date.now() > data.expires) { this.delete(key); return undefined; } return (opts && opts.raw) ? data : data.value; }); } set(key, value, ttl) { const keyPrefixed = this._getKeyPrefix(key); if (typeof ttl === 'undefined') { ttl = this.opts.ttl; } if (ttl === 0) { ttl = undefined; } const { store } = this.opts; return Promise.resolve() .then(() => { const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null; value = { value, expires }; return this.opts.serialize(value); }) .then(value => store.set(keyPrefixed, value, ttl)) .then(() => true); } delete(key) { const keyPrefixed = this._getKeyPrefix(key); const { store } = this.opts; return Promise.resolve() .then(() => store.delete(keyPrefixed)); } clear() { const { store } = this.opts; return Promise.resolve() .then(() => store.clear()); } } module.exports = Keyv; /***/ }), /***/ 35039: /***/ ((module) => { "use strict"; // We define these manually to ensure they're always copied // even if they would move up the prototype chain // https://nodejs.org/api/http.html#http_class_http_incomingmessage const knownProperties = [ 'aborted', 'complete', 'headers', 'httpVersion', 'httpVersionMinor', 'httpVersionMajor', 'method', 'rawHeaders', 'rawTrailers', 'setTimeout', 'socket', 'statusCode', 'statusMessage', 'trailers', 'url' ]; module.exports = (fromStream, toStream) => { if (toStream._readableState.autoDestroy) { throw new Error('The second stream must have the `autoDestroy` option set to `false`'); } const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties)); const properties = {}; for (const property of fromProperties) { // Don't overwrite existing properties. if (property in toStream) { continue; } properties[property] = { get() { const value = fromStream[property]; const isFunction = typeof value === 'function'; return isFunction ? value.bind(fromStream) : value; }, set(value) { fromStream[property] = value; }, enumerable: true, configurable: false }; } Object.defineProperties(toStream, properties); fromStream.once('aborted', () => { toStream.destroy(); toStream.emit('aborted'); }); fromStream.once('close', () => { if (fromStream.complete) { if (toStream.readable) { toStream.once('end', () => { toStream.emit('close'); }); } else { toStream.emit('close'); } } else { toStream.emit('close'); } }); return toStream; }; /***/ }), /***/ 76031: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Copyright 2018 Google LLC * * Distributed under MIT license. * See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GoogleToken = void 0; const fs = __webpack_require__(35747); const gaxios_1 = __webpack_require__(59555); const jws = __webpack_require__(4636); const path = __webpack_require__(85622); const util_1 = __webpack_require__(31669); const readFile = fs.readFile ? util_1.promisify(fs.readFile) : async () => { // if running in the web-browser, fs.readFile may not have been shimmed. throw new ErrorWithCode('use key rather than keyFile.', 'MISSING_CREDENTIALS'); }; const GOOGLE_TOKEN_URL = 'https://www.googleapis.com/oauth2/v4/token'; const GOOGLE_REVOKE_TOKEN_URL = 'https://accounts.google.com/o/oauth2/revoke?token='; class ErrorWithCode extends Error { constructor(message, code) { super(message); this.code = code; } } let getPem; class GoogleToken { /** * Create a GoogleToken. * * @param options Configuration object. */ constructor(options) { this.configure(options); } get accessToken() { return this.rawToken ? this.rawToken.access_token : undefined; } get idToken() { return this.rawToken ? this.rawToken.id_token : undefined; } get tokenType() { return this.rawToken ? this.rawToken.token_type : undefined; } get refreshToken() { return this.rawToken ? this.rawToken.refresh_token : undefined; } /** * Returns whether the token has expired. * * @return true if the token has expired, false otherwise. */ hasExpired() { const now = new Date().getTime(); if (this.rawToken && this.expiresAt) { return now >= this.expiresAt; } else { return true; } } /** * Returns whether the token will expire within eagerRefreshThresholdMillis * * @return true if the token will be expired within eagerRefreshThresholdMillis, false otherwise. */ isTokenExpiring() { var _a; const now = new Date().getTime(); const eagerRefreshThresholdMillis = (_a = this.eagerRefreshThresholdMillis) !== null && _a !== void 0 ? _a : 0; if (this.rawToken && this.expiresAt) { return this.expiresAt <= now + eagerRefreshThresholdMillis; } else { return true; } } getToken(callback, opts = {}) { if (typeof callback === 'object') { opts = callback; callback = undefined; } opts = Object.assign({ forceRefresh: false, }, opts); if (callback) { const cb = callback; this.getTokenAsync(opts).then(t => cb(null, t), callback); return; } return this.getTokenAsync(opts); } /** * Given a keyFile, extract the key and client email if available * @param keyFile Path to a json, pem, or p12 file that contains the key. * @returns an object with privateKey and clientEmail properties */ async getCredentials(keyFile) { const ext = path.extname(keyFile); switch (ext) { case '.json': { const key = await readFile(keyFile, 'utf8'); const body = JSON.parse(key); const privateKey = body.private_key; const clientEmail = body.client_email; if (!privateKey || !clientEmail) { throw new ErrorWithCode('private_key and client_email are required.', 'MISSING_CREDENTIALS'); } return { privateKey, clientEmail }; } case '.der': case '.crt': case '.pem': { const privateKey = await readFile(keyFile, 'utf8'); return { privateKey }; } case '.p12': case '.pfx': { // NOTE: The loading of `google-p12-pem` is deferred for performance // reasons. The `node-forge` npm module in `google-p12-pem` adds a fair // bit time to overall module loading, and is likely not frequently // used. In a future release, p12 support will be entirely removed. if (!getPem) { getPem = (await Promise.resolve().then(() => __webpack_require__(92098))).getPem; } const privateKey = await getPem(keyFile); return { privateKey }; } default: throw new ErrorWithCode('Unknown certificate type. Type is determined based on file extension. ' + 'Current supported extensions are *.json, *.pem, and *.p12.', 'UNKNOWN_CERTIFICATE_TYPE'); } } async getTokenAsync(opts) { if (this.inFlightRequest && !opts.forceRefresh) { return this.inFlightRequest; } try { return await (this.inFlightRequest = this.getTokenAsyncInner(opts)); } finally { this.inFlightRequest = undefined; } } async getTokenAsyncInner(opts) { if (this.isTokenExpiring() === false && opts.forceRefresh === false) { return Promise.resolve(this.rawToken); } if (!this.key && !this.keyFile) { throw new Error('No key or keyFile set.'); } if (!this.key && this.keyFile) { const creds = await this.getCredentials(this.keyFile); this.key = creds.privateKey; this.iss = creds.clientEmail || this.iss; if (!creds.clientEmail) { this.ensureEmail(); } } return this.requestToken(); } ensureEmail() { if (!this.iss) { throw new ErrorWithCode('email is required.', 'MISSING_CREDENTIALS'); } } revokeToken(callback) { if (callback) { this.revokeTokenAsync().then(() => callback(), callback); return; } return this.revokeTokenAsync(); } async revokeTokenAsync() { if (!this.accessToken) { throw new Error('No token to revoke.'); } const url = GOOGLE_REVOKE_TOKEN_URL + this.accessToken; await gaxios_1.request({ url }); this.configure({ email: this.iss, sub: this.sub, key: this.key, keyFile: this.keyFile, scope: this.scope, additionalClaims: this.additionalClaims, }); } /** * Configure the GoogleToken for re-use. * @param {object} options Configuration object. */ configure(options = {}) { this.keyFile = options.keyFile; this.key = options.key; this.rawToken = undefined; this.iss = options.email || options.iss; this.sub = options.sub; this.additionalClaims = options.additionalClaims; if (typeof options.scope === 'object') { this.scope = options.scope.join(' '); } else { this.scope = options.scope; } this.eagerRefreshThresholdMillis = options.eagerRefreshThresholdMillis; } /** * Request the token from Google. */ async requestToken() { const iat = Math.floor(new Date().getTime() / 1000); const additionalClaims = this.additionalClaims || {}; const payload = Object.assign({ iss: this.iss, scope: this.scope, aud: GOOGLE_TOKEN_URL, exp: iat + 3600, iat, sub: this.sub, }, additionalClaims); const signedJWT = jws.sign({ header: { alg: 'RS256' }, payload, secret: this.key, }); try { const r = await gaxios_1.request({ method: 'POST', url: GOOGLE_TOKEN_URL, data: { grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer', assertion: signedJWT, }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, responseType: 'json', }); this.rawToken = r.data; this.expiresAt = r.data.expires_in === null || r.data.expires_in === undefined ? undefined : (iat + r.data.expires_in) * 1000; return this.rawToken; } catch (e) { this.rawToken = undefined; this.tokenExpires = undefined; const body = e.response && e.response.data ? e.response.data : {}; if (body.error) { const desc = body.error_description ? `: ${body.error_description}` : ''; e.message = `${body.error}${desc}`; } throw e; } } } exports.GoogleToken = GoogleToken; //# sourceMappingURL=index.js.map /***/ }), /***/ 13679: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = { afterRequest: __webpack_require__(24391), beforeRequest: __webpack_require__(94440), browser: __webpack_require__(99850), cache: __webpack_require__(77654), content: __webpack_require__(73656), cookie: __webpack_require__(67948), creator: __webpack_require__(33412), entry: __webpack_require__(32525), har: __webpack_require__(84943), header: __webpack_require__(68344), log: __webpack_require__(69142), page: __webpack_require__(29075), pageTimings: __webpack_require__(15096), postData: __webpack_require__(73697), query: __webpack_require__(70877), request: __webpack_require__(92084), response: __webpack_require__(20702), timings: __webpack_require__(36941) } /***/ }), /***/ 74944: /***/ ((module) => { function HARError (errors) { var message = 'validation failed' this.name = 'HARError' this.message = message this.errors = errors if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, this.constructor) } else { this.stack = (new Error(message)).stack } } HARError.prototype = Error.prototype module.exports = HARError /***/ }), /***/ 75697: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var Ajv = __webpack_require__(64941) var HARError = __webpack_require__(74944) var schemas = __webpack_require__(13679) var ajv function createAjvInstance () { var ajv = new Ajv({ allErrors: true }) ajv.addMetaSchema(__webpack_require__(81030)) ajv.addSchema(schemas) return ajv } function validate (name, data) { data = data || {} // validator config ajv = ajv || createAjvInstance() var validate = ajv.getSchema(name + '.json') return new Promise(function (resolve, reject) { var valid = validate(data) !valid ? reject(new HARError(validate.errors)) : resolve(data) }) } exports.afterRequest = function (data) { return validate('afterRequest', data) } exports.beforeRequest = function (data) { return validate('beforeRequest', data) } exports.browser = function (data) { return validate('browser', data) } exports.cache = function (data) { return validate('cache', data) } exports.content = function (data) { return validate('content', data) } exports.cookie = function (data) { return validate('cookie', data) } exports.creator = function (data) { return validate('creator', data) } exports.entry = function (data) { return validate('entry', data) } exports.har = function (data) { return validate('har', data) } exports.header = function (data) { return validate('header', data) } exports.log = function (data) { return validate('log', data) } exports.page = function (data) { return validate('page', data) } exports.pageTimings = function (data) { return validate('pageTimings', data) } exports.postData = function (data) { return validate('postData', data) } exports.query = function (data) { return validate('query', data) } exports.request = function (data) { return validate('request', data) } exports.response = function (data) { return validate('response', data) } exports.timings = function (data) { return validate('timings', data) } /***/ }), /***/ 31621: /***/ ((module) => { "use strict"; module.exports = (flag, argv = process.argv) => { const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); const position = argv.indexOf(prefix + flag); const terminatorPosition = argv.indexOf('--'); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; /***/ }), /***/ 61002: /***/ ((module) => { "use strict"; // rfc7231 6.1 const statusCodeCacheableByDefault = new Set([ 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501, ]); // This implementation does not understand partial responses (206) const understoodStatuses = new Set([ 200, 203, 204, 300, 301, 302, 303, 307, 308, 404, 405, 410, 414, 501, ]); const errorStatusCodes = new Set([ 500, 502, 503, 504, ]); const hopByHopHeaders = { date: true, // included, because we add Age update Date connection: true, 'keep-alive': true, 'proxy-authenticate': true, 'proxy-authorization': true, te: true, trailer: true, 'transfer-encoding': true, upgrade: true, }; const excludedFromRevalidationUpdate = { // Since the old body is reused, it doesn't make sense to change properties of the body 'content-length': true, 'content-encoding': true, 'transfer-encoding': true, 'content-range': true, }; function toNumberOrZero(s) { const n = parseInt(s, 10); return isFinite(n) ? n : 0; } // RFC 5861 function isErrorResponse(response) { // consider undefined response as faulty if(!response) { return true } return errorStatusCodes.has(response.status); } function parseCacheControl(header) { const cc = {}; if (!header) return cc; // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives), // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale const parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing for (const part of parts) { const [k, v] = part.split(/\s*=\s*/, 2); cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting } return cc; } function formatCacheControl(cc) { let parts = []; for (const k in cc) { const v = cc[k]; parts.push(v === true ? k : k + '=' + v); } if (!parts.length) { return undefined; } return parts.join(', '); } module.exports = class CachePolicy { constructor( req, res, { shared, cacheHeuristic, immutableMinTimeToLive, ignoreCargoCult, _fromObject, } = {} ) { if (_fromObject) { this._fromObject(_fromObject); return; } if (!res || !res.headers) { throw Error('Response headers missing'); } this._assertRequestHasHeaders(req); this._responseTime = this.now(); this._isShared = shared !== false; this._cacheHeuristic = undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE this._immutableMinTtl = undefined !== immutableMinTimeToLive ? immutableMinTimeToLive : 24 * 3600 * 1000; this._status = 'status' in res ? res.status : 200; this._resHeaders = res.headers; this._rescc = parseCacheControl(res.headers['cache-control']); this._method = 'method' in req ? req.method : 'GET'; this._url = req.url; this._host = req.headers.host; this._noAuthorization = !req.headers.authorization; this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used this._reqcc = parseCacheControl(req.headers['cache-control']); // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching, // so there's no point stricly adhering to the blindly copy&pasted directives. if ( ignoreCargoCult && 'pre-check' in this._rescc && 'post-check' in this._rescc ) { delete this._rescc['pre-check']; delete this._rescc['post-check']; delete this._rescc['no-cache']; delete this._rescc['no-store']; delete this._rescc['must-revalidate']; this._resHeaders = Object.assign({}, this._resHeaders, { 'cache-control': formatCacheControl(this._rescc), }); delete this._resHeaders.expires; delete this._resHeaders.pragma; } // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive // as having the same effect as if "Cache-Control: no-cache" were present (see Section 5.2.1). if ( res.headers['cache-control'] == null && /no-cache/.test(res.headers.pragma) ) { this._rescc['no-cache'] = true; } } now() { return Date.now(); } storable() { // The "no-store" request directive indicates that a cache MUST NOT store any part of either this request or any response to it. return !!( !this._reqcc['no-store'] && // A cache MUST NOT store a response to any request, unless: // The request method is understood by the cache and defined as being cacheable, and ('GET' === this._method || 'HEAD' === this._method || ('POST' === this._method && this._hasExplicitExpiration())) && // the response status code is understood by the cache, and understoodStatuses.has(this._status) && // the "no-store" cache directive does not appear in request or response header fields, and !this._rescc['no-store'] && // the "private" response directive does not appear in the response, if the cache is shared, and (!this._isShared || !this._rescc.private) && // the Authorization header field does not appear in the request, if the cache is shared, (!this._isShared || this._noAuthorization || this._allowsStoringAuthenticated()) && // the response either: // contains an Expires header field, or (this._resHeaders.expires || // contains a max-age response directive, or // contains a s-maxage response directive and the cache is shared, or // contains a public response directive. this._rescc['max-age'] || (this._isShared && this._rescc['s-maxage']) || this._rescc.public || // has a status code that is defined as cacheable by default statusCodeCacheableByDefault.has(this._status)) ); } _hasExplicitExpiration() { // 4.2.1 Calculating Freshness Lifetime return ( (this._isShared && this._rescc['s-maxage']) || this._rescc['max-age'] || this._resHeaders.expires ); } _assertRequestHasHeaders(req) { if (!req || !req.headers) { throw Error('Request headers missing'); } } satisfiesWithoutRevalidation(req) { this._assertRequestHasHeaders(req); // When presented with a request, a cache MUST NOT reuse a stored response, unless: // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive, // unless the stored response is successfully validated (Section 4.3), and const requestCC = parseCacheControl(req.headers['cache-control']); if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) { return false; } if (requestCC['max-age'] && this.age() > requestCC['max-age']) { return false; } if ( requestCC['min-fresh'] && this.timeToLive() < 1000 * requestCC['min-fresh'] ) { return false; } // the stored response is either: // fresh, or allowed to be served stale if (this.stale()) { const allowsStale = requestCC['max-stale'] && !this._rescc['must-revalidate'] && (true === requestCC['max-stale'] || requestCC['max-stale'] > this.age() - this.maxAge()); if (!allowsStale) { return false; } } return this._requestMatches(req, false); } _requestMatches(req, allowHeadMethod) { // The presented effective request URI and that of the stored response match, and return ( (!this._url || this._url === req.url) && this._host === req.headers.host && // the request method associated with the stored response allows it to be used for the presented request, and (!req.method || this._method === req.method || (allowHeadMethod && 'HEAD' === req.method)) && // selecting header fields nominated by the stored response (if any) match those presented, and this._varyMatches(req) ); } _allowsStoringAuthenticated() { // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage. return ( this._rescc['must-revalidate'] || this._rescc.public || this._rescc['s-maxage'] ); } _varyMatches(req) { if (!this._resHeaders.vary) { return true; } // A Vary header field-value of "*" always fails to match if (this._resHeaders.vary === '*') { return false; } const fields = this._resHeaders.vary .trim() .toLowerCase() .split(/\s*,\s*/); for (const name of fields) { if (req.headers[name] !== this._reqHeaders[name]) return false; } return true; } _copyWithoutHopByHopHeaders(inHeaders) { const headers = {}; for (const name in inHeaders) { if (hopByHopHeaders[name]) continue; headers[name] = inHeaders[name]; } // 9.1. Connection if (inHeaders.connection) { const tokens = inHeaders.connection.trim().split(/\s*,\s*/); for (const name of tokens) { delete headers[name]; } } if (headers.warning) { const warnings = headers.warning.split(/,/).filter(warning => { return !/^\s*1[0-9][0-9]/.test(warning); }); if (!warnings.length) { delete headers.warning; } else { headers.warning = warnings.join(',').trim(); } } return headers; } responseHeaders() { const headers = this._copyWithoutHopByHopHeaders(this._resHeaders); const age = this.age(); // A cache SHOULD generate 113 warning if it heuristically chose a freshness // lifetime greater than 24 hours and the response's age is greater than 24 hours. if ( age > 3600 * 24 && !this._hasExplicitExpiration() && this.maxAge() > 3600 * 24 ) { headers.warning = (headers.warning ? `${headers.warning}, ` : '') + '113 - "rfc7234 5.5.4"'; } headers.age = `${Math.round(age)}`; headers.date = new Date(this.now()).toUTCString(); return headers; } /** * Value of the Date response header or current time if Date was invalid * @return timestamp */ date() { const serverDate = Date.parse(this._resHeaders.date); if (isFinite(serverDate)) { return serverDate; } return this._responseTime; } /** * Value of the Age header, in seconds, updated for the current time. * May be fractional. * * @return Number */ age() { let age = this._ageValue(); const residentTime = (this.now() - this._responseTime) / 1000; return age + residentTime; } _ageValue() { return toNumberOrZero(this._resHeaders.age); } /** * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`. * * For an up-to-date value, see `timeToLive()`. * * @return Number */ maxAge() { if (!this.storable() || this._rescc['no-cache']) { return 0; } // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default // so this implementation requires explicit opt-in via public header if ( this._isShared && (this._resHeaders['set-cookie'] && !this._rescc.public && !this._rescc.immutable) ) { return 0; } if (this._resHeaders.vary === '*') { return 0; } if (this._isShared) { if (this._rescc['proxy-revalidate']) { return 0; } // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field. if (this._rescc['s-maxage']) { return toNumberOrZero(this._rescc['s-maxage']); } } // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field. if (this._rescc['max-age']) { return toNumberOrZero(this._rescc['max-age']); } const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0; const serverDate = this.date(); if (this._resHeaders.expires) { const expires = Date.parse(this._resHeaders.expires); // A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired"). if (Number.isNaN(expires) || expires < serverDate) { return 0; } return Math.max(defaultMinTtl, (expires - serverDate) / 1000); } if (this._resHeaders['last-modified']) { const lastModified = Date.parse(this._resHeaders['last-modified']); if (isFinite(lastModified) && serverDate > lastModified) { return Math.max( defaultMinTtl, ((serverDate - lastModified) / 1000) * this._cacheHeuristic ); } } return defaultMinTtl; } timeToLive() { const age = this.maxAge() - this.age(); const staleIfErrorAge = age + toNumberOrZero(this._rescc['stale-if-error']); const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc['stale-while-revalidate']); return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1000; } stale() { return this.maxAge() <= this.age(); } _useStaleIfError() { return this.maxAge() + toNumberOrZero(this._rescc['stale-if-error']) > this.age(); } useStaleWhileRevalidate() { return this.maxAge() + toNumberOrZero(this._rescc['stale-while-revalidate']) > this.age(); } static fromObject(obj) { return new this(undefined, undefined, { _fromObject: obj }); } _fromObject(obj) { if (this._responseTime) throw Error('Reinitialized'); if (!obj || obj.v !== 1) throw Error('Invalid serialization'); this._responseTime = obj.t; this._isShared = obj.sh; this._cacheHeuristic = obj.ch; this._immutableMinTtl = obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000; this._status = obj.st; this._resHeaders = obj.resh; this._rescc = obj.rescc; this._method = obj.m; this._url = obj.u; this._host = obj.h; this._noAuthorization = obj.a; this._reqHeaders = obj.reqh; this._reqcc = obj.reqcc; } toObject() { return { v: 1, t: this._responseTime, sh: this._isShared, ch: this._cacheHeuristic, imm: this._immutableMinTtl, st: this._status, resh: this._resHeaders, rescc: this._rescc, m: this._method, u: this._url, h: this._host, a: this._noAuthorization, reqh: this._reqHeaders, reqcc: this._reqcc, }; } /** * Headers for sending to the origin server to revalidate stale response. * Allows server to return 304 to allow reuse of the previous response. * * Hop by hop headers are always stripped. * Revalidation headers may be added or removed, depending on request. */ revalidationHeaders(incomingReq) { this._assertRequestHasHeaders(incomingReq); const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers); // This implementation does not understand range requests delete headers['if-range']; if (!this._requestMatches(incomingReq, true) || !this.storable()) { // revalidation allowed via HEAD // not for the same resource, or wasn't allowed to be cached anyway delete headers['if-none-match']; delete headers['if-modified-since']; return headers; } /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */ if (this._resHeaders.etag) { headers['if-none-match'] = headers['if-none-match'] ? `${headers['if-none-match']}, ${this._resHeaders.etag}` : this._resHeaders.etag; } // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request. const forbidsWeakValidators = headers['accept-ranges'] || headers['if-match'] || headers['if-unmodified-since'] || (this._method && this._method != 'GET'); /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server. Note: This implementation does not understand partial responses (206) */ if (forbidsWeakValidators) { delete headers['if-modified-since']; if (headers['if-none-match']) { const etags = headers['if-none-match'] .split(/,/) .filter(etag => { return !/^\s*W\//.test(etag); }); if (!etags.length) { delete headers['if-none-match']; } else { headers['if-none-match'] = etags.join(',').trim(); } } } else if ( this._resHeaders['last-modified'] && !headers['if-modified-since'] ) { headers['if-modified-since'] = this._resHeaders['last-modified']; } return headers; } /** * Creates new CachePolicy with information combined from the previews response, * and the new revalidation response. * * Returns {policy, modified} where modified is a boolean indicating * whether the response body has been modified, and old cached body can't be used. * * @return {Object} {policy: CachePolicy, modified: Boolean} */ revalidatedPolicy(request, response) { this._assertRequestHasHeaders(request); if(this._useStaleIfError() && isErrorResponse(response)) { // I consider the revalidation request unsuccessful return { modified: false, matches: false, policy: this, }; } if (!response || !response.headers) { throw Error('Response headers missing'); } // These aren't going to be supported exactly, since one CachePolicy object // doesn't know about all the other cached objects. let matches = false; if (response.status !== undefined && response.status != 304) { matches = false; } else if ( response.headers.etag && !/^\s*W\//.test(response.headers.etag) ) { // "All of the stored responses with the same strong validator are selected. // If none of the stored responses contain the same strong validator, // then the cache MUST NOT use the new response to update any stored responses." matches = this._resHeaders.etag && this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag; } else if (this._resHeaders.etag && response.headers.etag) { // "If the new response contains a weak validator and that validator corresponds // to one of the cache's stored responses, // then the most recent of those matching stored responses is selected for update." matches = this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag.replace(/^\s*W\//, ''); } else if (this._resHeaders['last-modified']) { matches = this._resHeaders['last-modified'] === response.headers['last-modified']; } else { // If the new response does not include any form of validator (such as in the case where // a client generates an If-Modified-Since request from a source other than the Last-Modified // response header field), and there is only one stored response, and that stored response also // lacks a validator, then that stored response is selected for update. if ( !this._resHeaders.etag && !this._resHeaders['last-modified'] && !response.headers.etag && !response.headers['last-modified'] ) { matches = true; } } if (!matches) { return { policy: new this.constructor(request, response), // Client receiving 304 without body, even if it's invalid/mismatched has no option // but to reuse a cached body. We don't have a good way to tell clients to do // error recovery in such case. modified: response.status != 304, matches: false, }; } // use other header fields provided in the 304 (Not Modified) response to replace all instances // of the corresponding header fields in the stored response. const headers = {}; for (const k in this._resHeaders) { headers[k] = k in response.headers && !excludedFromRevalidationUpdate[k] ? response.headers[k] : this._resHeaders[k]; } const newResponse = Object.assign({}, response, { status: this._status, method: this._method, headers, }); return { policy: new this.constructor(request, newResponse, { shared: this._isShared, cacheHeuristic: this._cacheHeuristic, immutableMinTimeToLive: this._immutableMinTtl, }), modified: false, matches: true, }; } }; /***/ }), /***/ 77492: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const net_1 = __importDefault(__webpack_require__(11631)); const tls_1 = __importDefault(__webpack_require__(4016)); const url_1 = __importDefault(__webpack_require__(78835)); const debug_1 = __importDefault(__webpack_require__(38237)); const once_1 = __importDefault(__webpack_require__(81040)); const agent_base_1 = __webpack_require__(49690); const debug = (0, debug_1.default)('http-proxy-agent'); function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } /** * The `HttpProxyAgent` implements an HTTP Agent subclass that connects * to the specified "HTTP proxy server" in order to proxy HTTP requests. * * @api public */ class HttpProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); } debug('Creating new HttpProxyAgent instance: %o', opts); super(opts); const proxy = Object.assign({}, opts); // If `true`, then connect to the proxy server over TLS. // Defaults to `false`. this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); // Prefer `hostname` over `host`, and set the `port` if needed. proxy.host = proxy.hostname || proxy.host; if (typeof proxy.port === 'string') { proxy.port = parseInt(proxy.port, 10); } if (!proxy.port && proxy.host) { proxy.port = this.secureProxy ? 443 : 80; } if (proxy.host && proxy.path) { // If both a `host` and `path` are specified then it's most likely // the result of a `url.parse()` call... we need to remove the // `path` portion so that `net.connect()` doesn't attempt to open // that as a Unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { proxy, secureProxy } = this; const parsed = url_1.default.parse(req.path); if (!parsed.protocol) { parsed.protocol = 'http:'; } if (!parsed.hostname) { parsed.hostname = opts.hostname || opts.host || null; } if (parsed.port == null && typeof opts.port) { parsed.port = String(opts.port); } if (parsed.port === '80') { // if port is 80, then we can remove the port so that the // ":80" portion is not on the produced URL parsed.port = ''; } // Change the `http.ClientRequest` instance's "path" field // to the absolute path of the URL that will be requested. req.path = url_1.default.format(parsed); // Inject the `Proxy-Authorization` header if necessary. if (proxy.auth) { req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`); } // Create a socket connection to the proxy server. let socket; if (secureProxy) { debug('Creating `tls.Socket`: %o', proxy); socket = tls_1.default.connect(proxy); } else { debug('Creating `net.Socket`: %o', proxy); socket = net_1.default.connect(proxy); } // At this point, the http ClientRequest's internal `_header` field // might have already been set. If this is the case then we'll need // to re-generate the string since we just changed the `req.path`. if (req._header) { let first; let endOfHeaders; debug('Regenerating stored HTTP header string for request'); req._header = null; req._implicitHeader(); if (req.output && req.output.length > 0) { // Node < 12 debug('Patching connection write() output buffer with updated header'); first = req.output[0]; endOfHeaders = first.indexOf('\r\n\r\n') + 4; req.output[0] = req._header + first.substring(endOfHeaders); debug('Output buffer: %o', req.output); } else if (req.outputData && req.outputData.length > 0) { // Node >= 12 debug('Patching connection write() output buffer with updated header'); first = req.outputData[0].data; endOfHeaders = first.indexOf('\r\n\r\n') + 4; req.outputData[0].data = req._header + first.substring(endOfHeaders); debug('Output buffer: %o', req.outputData[0].data); } } // Wait for the socket's `connect` event, so that this `callback()` // function throws instead of the `http` request machinery. This is // important for i.e. `PacProxyAgent` which determines a failed proxy // connection via the `callback()` function throwing. yield (0, once_1.default)(socket, 'connect'); return socket; }); } } exports.default = HttpProxyAgent; //# sourceMappingURL=agent.js.map /***/ }), /***/ 23764: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(__webpack_require__(77492)); function createHttpProxyAgent(opts) { return new agent_1.default(opts); } (function (createHttpProxyAgent) { createHttpProxyAgent.HttpProxyAgent = agent_1.default; createHttpProxyAgent.prototype = agent_1.default.prototype; })(createHttpProxyAgent || (createHttpProxyAgent = {})); module.exports = createHttpProxyAgent; //# sourceMappingURL=index.js.map /***/ }), /***/ 42479: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var parser = __webpack_require__(95086); var signer = __webpack_require__(38143); var verify = __webpack_require__(51227); var utils = __webpack_require__(65689); ///--- API module.exports = { parse: parser.parseRequest, parseRequest: parser.parseRequest, sign: signer.signRequest, signRequest: signer.signRequest, createSigner: signer.createSigner, isSigner: signer.isSigner, sshKeyToPEM: utils.sshKeyToPEM, sshKeyFingerprint: utils.fingerprint, pemToRsaSSHKey: utils.pemToRsaSSHKey, verify: verify.verifySignature, verifySignature: verify.verifySignature, verifyHMAC: verify.verifyHMAC }; /***/ }), /***/ 95086: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(66631); var util = __webpack_require__(31669); var utils = __webpack_require__(65689); ///--- Globals var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var HttpSignatureError = utils.HttpSignatureError; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var validateAlgorithm = utils.validateAlgorithm; var State = { New: 0, Params: 1 }; var ParamsState = { Name: 0, Quote: 1, Value: 2, Comma: 3 }; ///--- Specific Errors function ExpiredRequestError(message) { HttpSignatureError.call(this, message, ExpiredRequestError); } util.inherits(ExpiredRequestError, HttpSignatureError); function InvalidHeaderError(message) { HttpSignatureError.call(this, message, InvalidHeaderError); } util.inherits(InvalidHeaderError, HttpSignatureError); function InvalidParamsError(message) { HttpSignatureError.call(this, message, InvalidParamsError); } util.inherits(InvalidParamsError, HttpSignatureError); function MissingHeaderError(message) { HttpSignatureError.call(this, message, MissingHeaderError); } util.inherits(MissingHeaderError, HttpSignatureError); function StrictParsingError(message) { HttpSignatureError.call(this, message, StrictParsingError); } util.inherits(StrictParsingError, HttpSignatureError); ///--- Exported API module.exports = { /** * Parses the 'Authorization' header out of an http.ServerRequest object. * * Note that this API will fully validate the Authorization header, and throw * on any error. It will not however check the signature, or the keyId format * as those are specific to your environment. You can use the options object * to pass in extra constraints. * * As a response object you can expect this: * * { * "scheme": "Signature", * "params": { * "keyId": "foo", * "algorithm": "rsa-sha256", * "headers": [ * "date" or "x-date", * "digest" * ], * "signature": "base64" * }, * "signingString": "ready to be passed to crypto.verify()" * } * * @param {Object} request an http.ServerRequest. * @param {Object} options an optional options object with: * - clockSkew: allowed clock skew in seconds (default 300). * - headers: required header names (def: date or x-date) * - algorithms: algorithms to support (default: all). * - strict: should enforce latest spec parsing * (default: false). * @return {Object} parsed out object (see above). * @throws {TypeError} on invalid input. * @throws {InvalidHeaderError} on an invalid Authorization header error. * @throws {InvalidParamsError} if the params in the scheme are invalid. * @throws {MissingHeaderError} if the params indicate a header not present, * either in the request headers from the params, * or not in the params from a required header * in options. * @throws {StrictParsingError} if old attributes are used in strict parsing * mode. * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew. */ parseRequest: function parseRequest(request, options) { assert.object(request, 'request'); assert.object(request.headers, 'request.headers'); if (options === undefined) { options = {}; } if (options.headers === undefined) { options.headers = [request.headers['x-date'] ? 'x-date' : 'date']; } assert.object(options, 'options'); assert.arrayOfString(options.headers, 'options.headers'); assert.optionalFinite(options.clockSkew, 'options.clockSkew'); var authzHeaderName = options.authorizationHeaderName || 'authorization'; if (!request.headers[authzHeaderName]) { throw new MissingHeaderError('no ' + authzHeaderName + ' header ' + 'present in the request'); } options.clockSkew = options.clockSkew || 300; var i = 0; var state = State.New; var substate = ParamsState.Name; var tmpName = ''; var tmpValue = ''; var parsed = { scheme: '', params: {}, signingString: '' }; var authz = request.headers[authzHeaderName]; for (i = 0; i < authz.length; i++) { var c = authz.charAt(i); switch (Number(state)) { case State.New: if (c !== ' ') parsed.scheme += c; else state = State.Params; break; case State.Params: switch (Number(substate)) { case ParamsState.Name: var code = c.charCodeAt(0); // restricted name of A-Z / a-z if ((code >= 0x41 && code <= 0x5a) || // A-Z (code >= 0x61 && code <= 0x7a)) { // a-z tmpName += c; } else if (c === '=') { if (tmpName.length === 0) throw new InvalidHeaderError('bad param format'); substate = ParamsState.Quote; } else { throw new InvalidHeaderError('bad param format'); } break; case ParamsState.Quote: if (c === '"') { tmpValue = ''; substate = ParamsState.Value; } else { throw new InvalidHeaderError('bad param format'); } break; case ParamsState.Value: if (c === '"') { parsed.params[tmpName] = tmpValue; substate = ParamsState.Comma; } else { tmpValue += c; } break; case ParamsState.Comma: if (c === ',') { tmpName = ''; substate = ParamsState.Name; } else { throw new InvalidHeaderError('bad param format'); } break; default: throw new Error('Invalid substate'); } break; default: throw new Error('Invalid substate'); } } if (!parsed.params.headers || parsed.params.headers === '') { if (request.headers['x-date']) { parsed.params.headers = ['x-date']; } else { parsed.params.headers = ['date']; } } else { parsed.params.headers = parsed.params.headers.split(' '); } // Minimally validate the parsed object if (!parsed.scheme || parsed.scheme !== 'Signature') throw new InvalidHeaderError('scheme was not "Signature"'); if (!parsed.params.keyId) throw new InvalidHeaderError('keyId was not specified'); if (!parsed.params.algorithm) throw new InvalidHeaderError('algorithm was not specified'); if (!parsed.params.signature) throw new InvalidHeaderError('signature was not specified'); // Check the algorithm against the official list parsed.params.algorithm = parsed.params.algorithm.toLowerCase(); try { validateAlgorithm(parsed.params.algorithm); } catch (e) { if (e instanceof InvalidAlgorithmError) throw (new InvalidParamsError(parsed.params.algorithm + ' is not ' + 'supported')); else throw (e); } // Build the signingString for (i = 0; i < parsed.params.headers.length; i++) { var h = parsed.params.headers[i].toLowerCase(); parsed.params.headers[i] = h; if (h === 'request-line') { if (!options.strict) { /* * We allow headers from the older spec drafts if strict parsing isn't * specified in options. */ parsed.signingString += request.method + ' ' + request.url + ' HTTP/' + request.httpVersion; } else { /* Strict parsing doesn't allow older draft headers. */ throw (new StrictParsingError('request-line is not a valid header ' + 'with strict parsing enabled.')); } } else if (h === '(request-target)') { parsed.signingString += '(request-target): ' + request.method.toLowerCase() + ' ' + request.url; } else { var value = request.headers[h]; if (value === undefined) throw new MissingHeaderError(h + ' was not in the request'); parsed.signingString += h + ': ' + value; } if ((i + 1) < parsed.params.headers.length) parsed.signingString += '\n'; } // Check against the constraints var date; if (request.headers.date || request.headers['x-date']) { if (request.headers['x-date']) { date = new Date(request.headers['x-date']); } else { date = new Date(request.headers.date); } var now = new Date(); var skew = Math.abs(now.getTime() - date.getTime()); if (skew > options.clockSkew * 1000) { throw new ExpiredRequestError('clock skew of ' + (skew / 1000) + 's was greater than ' + options.clockSkew + 's'); } } options.headers.forEach(function (hdr) { // Remember that we already checked any headers in the params // were in the request, so if this passes we're good. if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0) throw new MissingHeaderError(hdr + ' was not a signed header'); }); if (options.algorithms) { if (options.algorithms.indexOf(parsed.params.algorithm) === -1) throw new InvalidParamsError(parsed.params.algorithm + ' is not a supported algorithm'); } parsed.algorithm = parsed.params.algorithm.toUpperCase(); parsed.keyId = parsed.params.keyId; return parsed; } }; /***/ }), /***/ 38143: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(66631); var crypto = __webpack_require__(76417); var http = __webpack_require__(98605); var util = __webpack_require__(31669); var sshpk = __webpack_require__(87022); var jsprim = __webpack_require__(6287); var utils = __webpack_require__(65689); var sprintf = __webpack_require__(31669).format; var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var HttpSignatureError = utils.HttpSignatureError; var validateAlgorithm = utils.validateAlgorithm; ///--- Globals var AUTHZ_FMT = 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"'; ///--- Specific Errors function MissingHeaderError(message) { HttpSignatureError.call(this, message, MissingHeaderError); } util.inherits(MissingHeaderError, HttpSignatureError); function StrictParsingError(message) { HttpSignatureError.call(this, message, StrictParsingError); } util.inherits(StrictParsingError, HttpSignatureError); /* See createSigner() */ function RequestSigner(options) { assert.object(options, 'options'); var alg = []; if (options.algorithm !== undefined) { assert.string(options.algorithm, 'options.algorithm'); alg = validateAlgorithm(options.algorithm); } this.rs_alg = alg; /* * RequestSigners come in two varieties: ones with an rs_signFunc, and ones * with an rs_signer. * * rs_signFunc-based RequestSigners have to build up their entire signing * string within the rs_lines array and give it to rs_signFunc as a single * concat'd blob. rs_signer-based RequestSigners can add a line at a time to * their signing state by using rs_signer.update(), thus only needing to * buffer the hash function state and one line at a time. */ if (options.sign !== undefined) { assert.func(options.sign, 'options.sign'); this.rs_signFunc = options.sign; } else if (alg[0] === 'hmac' && options.key !== undefined) { assert.string(options.keyId, 'options.keyId'); this.rs_keyId = options.keyId; if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key)) throw (new TypeError('options.key for HMAC must be a string or Buffer')); /* * Make an rs_signer for HMACs, not a rs_signFunc -- HMACs digest their * data in chunks rather than requiring it all to be given in one go * at the end, so they are more similar to signers than signFuncs. */ this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key); this.rs_signer.sign = function () { var digest = this.digest('base64'); return ({ hashAlgorithm: alg[1], toString: function () { return (digest); } }); }; } else if (options.key !== undefined) { var key = options.key; if (typeof (key) === 'string' || Buffer.isBuffer(key)) key = sshpk.parsePrivateKey(key); assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]), 'options.key must be a sshpk.PrivateKey'); this.rs_key = key; assert.string(options.keyId, 'options.keyId'); this.rs_keyId = options.keyId; if (!PK_ALGOS[key.type]) { throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' + 'keys are not supported')); } if (alg[0] !== undefined && key.type !== alg[0]) { throw (new InvalidAlgorithmError('options.key must be a ' + alg[0].toUpperCase() + ' key, was given a ' + key.type.toUpperCase() + ' key instead')); } this.rs_signer = key.createSign(alg[1]); } else { throw (new TypeError('options.sign (func) or options.key is required')); } this.rs_headers = []; this.rs_lines = []; } /** * Adds a header to be signed, with its value, into this signer. * * @param {String} header * @param {String} value * @return {String} value written */ RequestSigner.prototype.writeHeader = function (header, value) { assert.string(header, 'header'); header = header.toLowerCase(); assert.string(value, 'value'); this.rs_headers.push(header); if (this.rs_signFunc) { this.rs_lines.push(header + ': ' + value); } else { var line = header + ': ' + value; if (this.rs_headers.length > 0) line = '\n' + line; this.rs_signer.update(line); } return (value); }; /** * Adds a default Date header, returning its value. * * @return {String} */ RequestSigner.prototype.writeDateHeader = function () { return (this.writeHeader('date', jsprim.rfc1123(new Date()))); }; /** * Adds the request target line to be signed. * * @param {String} method, HTTP method (e.g. 'get', 'post', 'put') * @param {String} path */ RequestSigner.prototype.writeTarget = function (method, path) { assert.string(method, 'method'); assert.string(path, 'path'); method = method.toLowerCase(); this.writeHeader('(request-target)', method + ' ' + path); }; /** * Calculate the value for the Authorization header on this request * asynchronously. * * @param {Func} callback (err, authz) */ RequestSigner.prototype.sign = function (cb) { assert.func(cb, 'callback'); if (this.rs_headers.length < 1) throw (new Error('At least one header must be signed')); var alg, authz; if (this.rs_signFunc) { var data = this.rs_lines.join('\n'); var self = this; this.rs_signFunc(data, function (err, sig) { if (err) { cb(err); return; } try { assert.object(sig, 'signature'); assert.string(sig.keyId, 'signature.keyId'); assert.string(sig.algorithm, 'signature.algorithm'); assert.string(sig.signature, 'signature.signature'); alg = validateAlgorithm(sig.algorithm); authz = sprintf(AUTHZ_FMT, sig.keyId, sig.algorithm, self.rs_headers.join(' '), sig.signature); } catch (e) { cb(e); return; } cb(null, authz); }); } else { try { var sigObj = this.rs_signer.sign(); } catch (e) { cb(e); return; } alg = (this.rs_alg[0] || this.rs_key.type) + '-' + sigObj.hashAlgorithm; var signature = sigObj.toString(); authz = sprintf(AUTHZ_FMT, this.rs_keyId, alg, this.rs_headers.join(' '), signature); cb(null, authz); } }; ///--- Exported API module.exports = { /** * Identifies whether a given object is a request signer or not. * * @param {Object} object, the object to identify * @returns {Boolean} */ isSigner: function (obj) { if (typeof (obj) === 'object' && obj instanceof RequestSigner) return (true); return (false); }, /** * Creates a request signer, used to asynchronously build a signature * for a request (does not have to be an http.ClientRequest). * * @param {Object} options, either: * - {String} keyId * - {String|Buffer} key * - {String} algorithm (optional, required for HMAC) * or: * - {Func} sign (data, cb) * @return {RequestSigner} */ createSigner: function createSigner(options) { return (new RequestSigner(options)); }, /** * Adds an 'Authorization' header to an http.ClientRequest object. * * Note that this API will add a Date header if it's not already set. Any * other headers in the options.headers array MUST be present, or this * will throw. * * You shouldn't need to check the return type; it's just there if you want * to be pedantic. * * The optional flag indicates whether parsing should use strict enforcement * of the version draft-cavage-http-signatures-04 of the spec or beyond. * The default is to be loose and support * older versions for compatibility. * * @param {Object} request an instance of http.ClientRequest. * @param {Object} options signing parameters object: * - {String} keyId required. * - {String} key required (either a PEM or HMAC key). * - {Array} headers optional; defaults to ['date']. * - {String} algorithm optional (unless key is HMAC); * default is the same as the sshpk default * signing algorithm for the type of key given * - {String} httpVersion optional; defaults to '1.1'. * - {Boolean} strict optional; defaults to 'false'. * @return {Boolean} true if Authorization (and optionally Date) were added. * @throws {TypeError} on bad parameter types (input). * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with * the given key. * @throws {sshpk.KeyParseError} if key was bad. * @throws {MissingHeaderError} if a header to be signed was specified but * was not present. */ signRequest: function signRequest(request, options) { assert.object(request, 'request'); assert.object(options, 'options'); assert.optionalString(options.algorithm, 'options.algorithm'); assert.string(options.keyId, 'options.keyId'); assert.optionalArrayOfString(options.headers, 'options.headers'); assert.optionalString(options.httpVersion, 'options.httpVersion'); if (!request.getHeader('Date')) request.setHeader('Date', jsprim.rfc1123(new Date())); if (!options.headers) options.headers = ['date']; if (!options.httpVersion) options.httpVersion = '1.1'; var alg = []; if (options.algorithm) { options.algorithm = options.algorithm.toLowerCase(); alg = validateAlgorithm(options.algorithm); } var i; var stringToSign = ''; for (i = 0; i < options.headers.length; i++) { if (typeof (options.headers[i]) !== 'string') throw new TypeError('options.headers must be an array of Strings'); var h = options.headers[i].toLowerCase(); if (h === 'request-line') { if (!options.strict) { /** * We allow headers from the older spec drafts if strict parsing isn't * specified in options. */ stringToSign += request.method + ' ' + request.path + ' HTTP/' + options.httpVersion; } else { /* Strict parsing doesn't allow older draft headers. */ throw (new StrictParsingError('request-line is not a valid header ' + 'with strict parsing enabled.')); } } else if (h === '(request-target)') { stringToSign += '(request-target): ' + request.method.toLowerCase() + ' ' + request.path; } else { var value = request.getHeader(h); if (value === undefined || value === '') { throw new MissingHeaderError(h + ' was not in the request'); } stringToSign += h + ': ' + value; } if ((i + 1) < options.headers.length) stringToSign += '\n'; } /* This is just for unit tests. */ if (request.hasOwnProperty('_stringToSign')) { request._stringToSign = stringToSign; } var signature; if (alg[0] === 'hmac') { if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key)) throw (new TypeError('options.key must be a string or Buffer')); var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key); hmac.update(stringToSign); signature = hmac.digest('base64'); } else { var key = options.key; if (typeof (key) === 'string' || Buffer.isBuffer(key)) key = sshpk.parsePrivateKey(options.key); assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]), 'options.key must be a sshpk.PrivateKey'); if (!PK_ALGOS[key.type]) { throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' + 'keys are not supported')); } if (alg[0] !== undefined && key.type !== alg[0]) { throw (new InvalidAlgorithmError('options.key must be a ' + alg[0].toUpperCase() + ' key, was given a ' + key.type.toUpperCase() + ' key instead')); } var signer = key.createSign(alg[1]); signer.update(stringToSign); var sigObj = signer.sign(); if (!HASH_ALGOS[sigObj.hashAlgorithm]) { throw (new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() + ' is not a supported hash algorithm')); } options.algorithm = key.type + '-' + sigObj.hashAlgorithm; signature = sigObj.toString(); assert.notStrictEqual(signature, '', 'empty signature produced'); } var authzHeaderName = options.authorizationHeaderName || 'Authorization'; request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT, options.keyId, options.algorithm, options.headers.join(' '), signature)); return true; } }; /***/ }), /***/ 65689: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2012 Joyent, Inc. All rights reserved. var assert = __webpack_require__(66631); var sshpk = __webpack_require__(87022); var util = __webpack_require__(31669); var HASH_ALGOS = { 'sha1': true, 'sha256': true, 'sha512': true }; var PK_ALGOS = { 'rsa': true, 'dsa': true, 'ecdsa': true }; function HttpSignatureError(message, caller) { if (Error.captureStackTrace) Error.captureStackTrace(this, caller || HttpSignatureError); this.message = message; this.name = caller.name; } util.inherits(HttpSignatureError, Error); function InvalidAlgorithmError(message) { HttpSignatureError.call(this, message, InvalidAlgorithmError); } util.inherits(InvalidAlgorithmError, HttpSignatureError); function validateAlgorithm(algorithm) { var alg = algorithm.toLowerCase().split('-'); if (alg.length !== 2) { throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' + 'valid algorithm')); } if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) { throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' + 'are not supported')); } if (!HASH_ALGOS[alg[1]]) { throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' + 'supported hash algorithm')); } return (alg); } ///--- API module.exports = { HASH_ALGOS: HASH_ALGOS, PK_ALGOS: PK_ALGOS, HttpSignatureError: HttpSignatureError, InvalidAlgorithmError: InvalidAlgorithmError, validateAlgorithm: validateAlgorithm, /** * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file. * * The intent of this module is to interoperate with OpenSSL only, * specifically the node crypto module's `verify` method. * * @param {String} key an OpenSSH public key. * @return {String} PEM encoded form of the RSA public key. * @throws {TypeError} on bad input. * @throws {Error} on invalid ssh key formatted data. */ sshKeyToPEM: function sshKeyToPEM(key) { assert.string(key, 'ssh_key'); var k = sshpk.parseKey(key, 'ssh'); return (k.toString('pem')); }, /** * Generates an OpenSSH fingerprint from an ssh public key. * * @param {String} key an OpenSSH public key. * @return {String} key fingerprint. * @throws {TypeError} on bad input. * @throws {Error} if what you passed doesn't look like an ssh public key. */ fingerprint: function fingerprint(key) { assert.string(key, 'ssh_key'); var k = sshpk.parseKey(key, 'ssh'); return (k.fingerprint('md5').toString('hex')); }, /** * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) * * The reverse of the above function. */ pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { assert.equal('string', typeof (pem), 'typeof pem'); var k = sshpk.parseKey(pem, 'pem'); k.comment = comment; return (k.toString('ssh')); } }; /***/ }), /***/ 51227: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(66631); var crypto = __webpack_require__(76417); var sshpk = __webpack_require__(87022); var utils = __webpack_require__(65689); var HASH_ALGOS = utils.HASH_ALGOS; var PK_ALGOS = utils.PK_ALGOS; var InvalidAlgorithmError = utils.InvalidAlgorithmError; var HttpSignatureError = utils.HttpSignatureError; var validateAlgorithm = utils.validateAlgorithm; ///--- Exported API module.exports = { /** * Verify RSA/DSA signature against public key. You are expected to pass in * an object that was returned from `parse()`. * * @param {Object} parsedSignature the object you got from `parse`. * @param {String} pubkey RSA/DSA private key PEM. * @return {Boolean} true if valid, false otherwise. * @throws {TypeError} if you pass in bad arguments. * @throws {InvalidAlgorithmError} */ verifySignature: function verifySignature(parsedSignature, pubkey) { assert.object(parsedSignature, 'parsedSignature'); if (typeof (pubkey) === 'string' || Buffer.isBuffer(pubkey)) pubkey = sshpk.parseKey(pubkey); assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), 'pubkey must be a sshpk.Key'); var alg = validateAlgorithm(parsedSignature.algorithm); if (alg[0] === 'hmac' || alg[0] !== pubkey.type) return (false); var v = pubkey.createVerify(alg[1]); v.update(parsedSignature.signingString); return (v.verify(parsedSignature.params.signature, 'base64')); }, /** * Verify HMAC against shared secret. You are expected to pass in an object * that was returned from `parse()`. * * @param {Object} parsedSignature the object you got from `parse`. * @param {String} secret HMAC shared secret. * @return {Boolean} true if valid, false otherwise. * @throws {TypeError} if you pass in bad arguments. * @throws {InvalidAlgorithmError} */ verifyHMAC: function verifyHMAC(parsedSignature, secret) { assert.object(parsedSignature, 'parsedHMAC'); assert.string(secret, 'secret'); var alg = validateAlgorithm(parsedSignature.algorithm); if (alg[0] !== 'hmac') return (false); var hashAlg = alg[1].toUpperCase(); var hmac = crypto.createHmac(hashAlg, secret); hmac.update(parsedSignature.signingString); /* * Now double-hash to avoid leaking timing information - there's * no easy constant-time compare in JS, so we use this approach * instead. See for more info: * https://www.isecpartners.com/blog/2011/february/double-hmac- * verification.aspx */ var h1 = crypto.createHmac(hashAlg, secret); h1.update(hmac.digest()); h1 = h1.digest(); var h2 = crypto.createHmac(hashAlg, secret); h2.update(new Buffer(parsedSignature.params.signature, 'base64')); h2 = h2.digest(); /* Node 0.8 returns strings from .digest(). */ if (typeof (h1) === 'string') return (h1 === h2); /* And node 0.10 lacks the .equals() method on Buffers. */ if (Buffer.isBuffer(h1) && !h1.equals) return (h1.toString('binary') === h2.toString('binary')); return (h1.equals(h2)); } }; /***/ }), /***/ 79898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const tls = __webpack_require__(4016); const http2 = __webpack_require__(97565); const QuickLRU = __webpack_require__(49273); const kCurrentStreamsCount = Symbol('currentStreamsCount'); const kRequest = Symbol('request'); const kOriginSet = Symbol('cachedOriginSet'); const kGracefullyClosing = Symbol('gracefullyClosing'); const nameKeys = [ // `http2.connect()` options 'maxDeflateDynamicTableSize', 'maxSessionMemory', 'maxHeaderListPairs', 'maxOutstandingPings', 'maxReservedRemoteStreams', 'maxSendHeaderBlockLength', 'paddingStrategy', // `tls.connect()` options 'localAddress', 'path', 'rejectUnauthorized', 'minDHSize', // `tls.createSecureContext()` options 'ca', 'cert', 'clientCertEngine', 'ciphers', 'key', 'pfx', 'servername', 'minVersion', 'maxVersion', 'secureProtocol', 'crl', 'honorCipherOrder', 'ecdhCurve', 'dhparam', 'secureOptions', 'sessionIdContext' ]; const getSortedIndex = (array, value, compare) => { let low = 0; let high = array.length; while (low < high) { const mid = (low + high) >>> 1; /* istanbul ignore next */ if (compare(array[mid], value)) { // This never gets called because we use descending sort. Better to have this anyway. low = mid + 1; } else { high = mid; } } return low; }; const compareSessions = (a, b) => { return a.remoteSettings.maxConcurrentStreams > b.remoteSettings.maxConcurrentStreams; }; // See https://tools.ietf.org/html/rfc8336 const closeCoveredSessions = (where, session) => { // Clients SHOULD NOT emit new requests on any connection whose Origin // Set is a proper subset of another connection's Origin Set, and they // SHOULD close it once all outstanding requests are satisfied. for (const coveredSession of where) { if ( // The set is a proper subset when its length is less than the other set. coveredSession[kOriginSet].length < session[kOriginSet].length && // And the other set includes all elements of the subset. coveredSession[kOriginSet].every(origin => session[kOriginSet].includes(origin)) && // Makes sure that the session can handle all requests from the covered session. coveredSession[kCurrentStreamsCount] + session[kCurrentStreamsCount] <= session.remoteSettings.maxConcurrentStreams ) { // This allows pending requests to finish and prevents making new requests. gracefullyClose(coveredSession); } } }; // This is basically inverted `closeCoveredSessions(...)`. const closeSessionIfCovered = (where, coveredSession) => { for (const session of where) { if ( coveredSession[kOriginSet].length < session[kOriginSet].length && coveredSession[kOriginSet].every(origin => session[kOriginSet].includes(origin)) && coveredSession[kCurrentStreamsCount] + session[kCurrentStreamsCount] <= session.remoteSettings.maxConcurrentStreams ) { gracefullyClose(coveredSession); } } }; const getSessions = ({agent, isFree}) => { const result = {}; // eslint-disable-next-line guard-for-in for (const normalizedOptions in agent.sessions) { const sessions = agent.sessions[normalizedOptions]; const filtered = sessions.filter(session => { const result = session[Agent.kCurrentStreamsCount] < session.remoteSettings.maxConcurrentStreams; return isFree ? result : !result; }); if (filtered.length !== 0) { result[normalizedOptions] = filtered; } } return result; }; const gracefullyClose = session => { session[kGracefullyClosing] = true; if (session[kCurrentStreamsCount] === 0) { session.close(); } }; class Agent extends EventEmitter { constructor({timeout = 60000, maxSessions = Infinity, maxFreeSessions = 10, maxCachedTlsSessions = 100} = {}) { super(); // A session is considered busy when its current streams count // is equal to or greater than the `maxConcurrentStreams` value. // A session is considered free when its current streams count // is less than the `maxConcurrentStreams` value. // SESSIONS[NORMALIZED_OPTIONS] = []; this.sessions = {}; // The queue for creating new sessions. It looks like this: // QUEUE[NORMALIZED_OPTIONS][NORMALIZED_ORIGIN] = ENTRY_FUNCTION // // The entry function has `listeners`, `completed` and `destroyed` properties. // `listeners` is an array of objects containing `resolve` and `reject` functions. // `completed` is a boolean. It's set to true after ENTRY_FUNCTION is executed. // `destroyed` is a boolean. If it's set to true, the session will be destroyed if hasn't connected yet. this.queue = {}; // Each session will use this timeout value. this.timeout = timeout; // Max sessions in total this.maxSessions = maxSessions; // Max free sessions in total // TODO: decreasing `maxFreeSessions` should close some sessions this.maxFreeSessions = maxFreeSessions; this._freeSessionsCount = 0; this._sessionsCount = 0; // We don't support push streams by default. this.settings = { enablePush: false }; // Reusing TLS sessions increases performance. this.tlsSessionCache = new QuickLRU({maxSize: maxCachedTlsSessions}); } static normalizeOrigin(url, servername) { if (typeof url === 'string') { url = new URL(url); } if (servername && url.hostname !== servername) { url.hostname = servername; } return url.origin; } normalizeOptions(options) { let normalized = ''; if (options) { for (const key of nameKeys) { if (options[key]) { normalized += `:${options[key]}`; } } } return normalized; } _tryToCreateNewSession(normalizedOptions, normalizedOrigin) { if (!(normalizedOptions in this.queue) || !(normalizedOrigin in this.queue[normalizedOptions])) { return; } const item = this.queue[normalizedOptions][normalizedOrigin]; // The entry function can be run only once. // BUG: The session may be never created when: // - the first condition is false AND // - this function is never called with the same arguments in the future. if (this._sessionsCount < this.maxSessions && !item.completed) { item.completed = true; item(); } } getSession(origin, options, listeners) { return new Promise((resolve, reject) => { if (Array.isArray(listeners)) { listeners = [...listeners]; // Resolve the current promise ASAP, we're just moving the listeners. // They will be executed at a different time. resolve(); } else { listeners = [{resolve, reject}]; } const normalizedOptions = this.normalizeOptions(options); const normalizedOrigin = Agent.normalizeOrigin(origin, options && options.servername); if (normalizedOrigin === undefined) { for (const {reject} of listeners) { reject(new TypeError('The `origin` argument needs to be a string or an URL object')); } return; } if (normalizedOptions in this.sessions) { const sessions = this.sessions[normalizedOptions]; let maxConcurrentStreams = -1; let currentStreamsCount = -1; let optimalSession; // We could just do this.sessions[normalizedOptions].find(...) but that isn't optimal. // Additionally, we are looking for session which has biggest current pending streams count. for (const session of sessions) { const sessionMaxConcurrentStreams = session.remoteSettings.maxConcurrentStreams; if (sessionMaxConcurrentStreams < maxConcurrentStreams) { break; } if (session[kOriginSet].includes(normalizedOrigin)) { const sessionCurrentStreamsCount = session[kCurrentStreamsCount]; if ( sessionCurrentStreamsCount >= sessionMaxConcurrentStreams || session[kGracefullyClosing] || // Unfortunately the `close` event isn't called immediately, // so `session.destroyed` is `true`, but `session.closed` is `false`. session.destroyed ) { continue; } // We only need set this once. if (!optimalSession) { maxConcurrentStreams = sessionMaxConcurrentStreams; } // We're looking for the session which has biggest current pending stream count, // in order to minimalize the amount of active sessions. if (sessionCurrentStreamsCount > currentStreamsCount) { optimalSession = session; currentStreamsCount = sessionCurrentStreamsCount; } } } if (optimalSession) { /* istanbul ignore next: safety check */ if (listeners.length !== 1) { for (const {reject} of listeners) { const error = new Error( `Expected the length of listeners to be 1, got ${listeners.length}.\n` + 'Please report this to https://github.com/szmarczak/http2-wrapper/' ); reject(error); } return; } listeners[0].resolve(optimalSession); return; } } if (normalizedOptions in this.queue) { if (normalizedOrigin in this.queue[normalizedOptions]) { // There's already an item in the queue, just attach ourselves to it. this.queue[normalizedOptions][normalizedOrigin].listeners.push(...listeners); // This shouldn't be executed here. // See the comment inside _tryToCreateNewSession. this._tryToCreateNewSession(normalizedOptions, normalizedOrigin); return; } } else { this.queue[normalizedOptions] = {}; } // The entry must be removed from the queue IMMEDIATELY when: // 1. the session connects successfully, // 2. an error occurs. const removeFromQueue = () => { // Our entry can be replaced. We cannot remove the new one. if (normalizedOptions in this.queue && this.queue[normalizedOptions][normalizedOrigin] === entry) { delete this.queue[normalizedOptions][normalizedOrigin]; if (Object.keys(this.queue[normalizedOptions]).length === 0) { delete this.queue[normalizedOptions]; } } }; // The main logic is here const entry = () => { const name = `${normalizedOrigin}:${normalizedOptions}`; let receivedSettings = false; try { const session = http2.connect(origin, { createConnection: this.createConnection, settings: this.settings, session: this.tlsSessionCache.get(name), ...options }); session[kCurrentStreamsCount] = 0; session[kGracefullyClosing] = false; const isFree = () => session[kCurrentStreamsCount] < session.remoteSettings.maxConcurrentStreams; let wasFree = true; session.socket.once('session', tlsSession => { this.tlsSessionCache.set(name, tlsSession); }); session.once('error', error => { // Listeners are empty when the session successfully connected. for (const {reject} of listeners) { reject(error); } // The connection got broken, purge the cache. this.tlsSessionCache.delete(name); }); session.setTimeout(this.timeout, () => { // Terminates all streams owned by this session. // TODO: Maybe the streams should have a "Session timed out" error? session.destroy(); }); session.once('close', () => { if (receivedSettings) { // 1. If it wasn't free then no need to decrease because // it has been decreased already in session.request(). // 2. `stream.once('close')` won't increment the count // because the session is already closed. if (wasFree) { this._freeSessionsCount--; } this._sessionsCount--; // This cannot be moved to the stream logic, // because there may be a session that hadn't made a single request. const where = this.sessions[normalizedOptions]; where.splice(where.indexOf(session), 1); if (where.length === 0) { delete this.sessions[normalizedOptions]; } } else { // Broken connection const error = new Error('Session closed without receiving a SETTINGS frame'); error.code = 'HTTP2WRAPPER_NOSETTINGS'; for (const {reject} of listeners) { reject(error); } removeFromQueue(); } // There may be another session awaiting. this._tryToCreateNewSession(normalizedOptions, normalizedOrigin); }); // Iterates over the queue and processes listeners. const processListeners = () => { if (!(normalizedOptions in this.queue) || !isFree()) { return; } for (const origin of session[kOriginSet]) { if (origin in this.queue[normalizedOptions]) { const {listeners} = this.queue[normalizedOptions][origin]; // Prevents session overloading. while (listeners.length !== 0 && isFree()) { // We assume `resolve(...)` calls `request(...)` *directly*, // otherwise the session will get overloaded. listeners.shift().resolve(session); } const where = this.queue[normalizedOptions]; if (where[origin].listeners.length === 0) { delete where[origin]; if (Object.keys(where).length === 0) { delete this.queue[normalizedOptions]; break; } } // We're no longer free, no point in continuing. if (!isFree()) { break; } } } }; // The Origin Set cannot shrink. No need to check if it suddenly became covered by another one. session.on('origin', () => { session[kOriginSet] = session.originSet; if (!isFree()) { // The session is full. return; } processListeners(); // Close covered sessions (if possible). closeCoveredSessions(this.sessions[normalizedOptions], session); }); session.once('remoteSettings', () => { // Fix Node.js bug preventing the process from exiting session.ref(); session.unref(); this._sessionsCount++; // The Agent could have been destroyed already. if (entry.destroyed) { const error = new Error('Agent has been destroyed'); for (const listener of listeners) { listener.reject(error); } session.destroy(); return; } session[kOriginSet] = session.originSet; { const where = this.sessions; if (normalizedOptions in where) { const sessions = where[normalizedOptions]; sessions.splice(getSortedIndex(sessions, session, compareSessions), 0, session); } else { where[normalizedOptions] = [session]; } } this._freeSessionsCount += 1; receivedSettings = true; this.emit('session', session); processListeners(); removeFromQueue(); // TODO: Close last recently used (or least used?) session if (session[kCurrentStreamsCount] === 0 && this._freeSessionsCount > this.maxFreeSessions) { session.close(); } // Check if we haven't managed to execute all listeners. if (listeners.length !== 0) { // Request for a new session with predefined listeners. this.getSession(normalizedOrigin, options, listeners); listeners.length = 0; } // `session.remoteSettings.maxConcurrentStreams` might get increased session.on('remoteSettings', () => { processListeners(); // In case the Origin Set changes closeCoveredSessions(this.sessions[normalizedOptions], session); }); }); // Shim `session.request()` in order to catch all streams session[kRequest] = session.request; session.request = (headers, streamOptions) => { if (session[kGracefullyClosing]) { throw new Error('The session is gracefully closing. No new streams are allowed.'); } const stream = session[kRequest](headers, streamOptions); // The process won't exit until the session is closed or all requests are gone. session.ref(); ++session[kCurrentStreamsCount]; if (session[kCurrentStreamsCount] === session.remoteSettings.maxConcurrentStreams) { this._freeSessionsCount--; } stream.once('close', () => { wasFree = isFree(); --session[kCurrentStreamsCount]; if (!session.destroyed && !session.closed) { closeSessionIfCovered(this.sessions[normalizedOptions], session); if (isFree() && !session.closed) { if (!wasFree) { this._freeSessionsCount++; wasFree = true; } const isEmpty = session[kCurrentStreamsCount] === 0; if (isEmpty) { session.unref(); } if ( isEmpty && ( this._freeSessionsCount > this.maxFreeSessions || session[kGracefullyClosing] ) ) { session.close(); } else { closeCoveredSessions(this.sessions[normalizedOptions], session); processListeners(); } } } }); return stream; }; } catch (error) { for (const listener of listeners) { listener.reject(error); } removeFromQueue(); } }; entry.listeners = listeners; entry.completed = false; entry.destroyed = false; this.queue[normalizedOptions][normalizedOrigin] = entry; this._tryToCreateNewSession(normalizedOptions, normalizedOrigin); }); } request(origin, options, headers, streamOptions) { return new Promise((resolve, reject) => { this.getSession(origin, options, [{ reject, resolve: session => { try { resolve(session.request(headers, streamOptions)); } catch (error) { reject(error); } } }]); }); } createConnection(origin, options) { return Agent.connect(origin, options); } static connect(origin, options) { options.ALPNProtocols = ['h2']; const port = origin.port || 443; const host = origin.hostname || origin.host; if (typeof options.servername === 'undefined') { options.servername = host; } return tls.connect(port, host, options); } closeFreeSessions() { for (const sessions of Object.values(this.sessions)) { for (const session of sessions) { if (session[kCurrentStreamsCount] === 0) { session.close(); } } } } destroy(reason) { for (const sessions of Object.values(this.sessions)) { for (const session of sessions) { session.destroy(reason); } } for (const entriesOfAuthority of Object.values(this.queue)) { for (const entry of Object.values(entriesOfAuthority)) { entry.destroyed = true; } } // New requests should NOT attach to destroyed sessions this.queue = {}; } get freeSessions() { return getSessions({agent: this, isFree: true}); } get busySessions() { return getSessions({agent: this, isFree: false}); } } Agent.kCurrentStreamsCount = kCurrentStreamsCount; Agent.kGracefullyClosing = kGracefullyClosing; module.exports = { Agent, globalAgent: new Agent() }; /***/ }), /***/ 97167: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const http = __webpack_require__(98605); const https = __webpack_require__(57211); const resolveALPN = __webpack_require__(46624); const QuickLRU = __webpack_require__(49273); const Http2ClientRequest = __webpack_require__(59632); const calculateServerName = __webpack_require__(51982); const urlToOptions = __webpack_require__(92686); const cache = new QuickLRU({maxSize: 100}); const queue = new Map(); const installSocket = (agent, socket, options) => { socket._httpMessage = {shouldKeepAlive: true}; const onFree = () => { agent.emit('free', socket, options); }; socket.on('free', onFree); const onClose = () => { agent.removeSocket(socket, options); }; socket.on('close', onClose); const onRemove = () => { agent.removeSocket(socket, options); socket.off('close', onClose); socket.off('free', onFree); socket.off('agentRemove', onRemove); }; socket.on('agentRemove', onRemove); agent.emit('free', socket, options); }; const resolveProtocol = async options => { const name = `${options.host}:${options.port}:${options.ALPNProtocols.sort()}`; if (!cache.has(name)) { if (queue.has(name)) { const result = await queue.get(name); return result.alpnProtocol; } const {path, agent} = options; options.path = options.socketPath; const resultPromise = resolveALPN(options); queue.set(name, resultPromise); try { const {socket, alpnProtocol} = await resultPromise; cache.set(name, alpnProtocol); options.path = path; if (alpnProtocol === 'h2') { // https://github.com/nodejs/node/issues/33343 socket.destroy(); } else { const {globalAgent} = https; const defaultCreateConnection = https.Agent.prototype.createConnection; if (agent) { if (agent.createConnection === defaultCreateConnection) { installSocket(agent, socket, options); } else { socket.destroy(); } } else if (globalAgent.createConnection === defaultCreateConnection) { installSocket(globalAgent, socket, options); } else { socket.destroy(); } } queue.delete(name); return alpnProtocol; } catch (error) { queue.delete(name); throw error; } } return cache.get(name); }; module.exports = async (input, options, callback) => { if (typeof input === 'string' || input instanceof URL) { input = urlToOptions(new URL(input)); } if (typeof options === 'function') { callback = options; options = undefined; } options = { ALPNProtocols: ['h2', 'http/1.1'], ...input, ...options, resolveSocket: true }; if (!Array.isArray(options.ALPNProtocols) || options.ALPNProtocols.length === 0) { throw new Error('The `ALPNProtocols` option must be an Array with at least one entry'); } options.protocol = options.protocol || 'https:'; const isHttps = options.protocol === 'https:'; options.host = options.hostname || options.host || 'localhost'; options.session = options.tlsSession; options.servername = options.servername || calculateServerName(options); options.port = options.port || (isHttps ? 443 : 80); options._defaultAgent = isHttps ? https.globalAgent : http.globalAgent; const agents = options.agent; if (agents) { if (agents.addRequest) { throw new Error('The `options.agent` object can contain only `http`, `https` or `http2` properties'); } options.agent = agents[isHttps ? 'https' : 'http']; } if (isHttps) { const protocol = await resolveProtocol(options); if (protocol === 'h2') { if (agents) { options.agent = agents.http2; } return new Http2ClientRequest(options, callback); } } return http.request(options, callback); }; module.exports.protocolCache = cache; /***/ }), /***/ 59632: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const http2 = __webpack_require__(97565); const {Writable} = __webpack_require__(92413); const {Agent, globalAgent} = __webpack_require__(79898); const IncomingMessage = __webpack_require__(82575); const urlToOptions = __webpack_require__(92686); const proxyEvents = __webpack_require__(81818); const isRequestPseudoHeader = __webpack_require__(11199); const { ERR_INVALID_ARG_TYPE, ERR_INVALID_PROTOCOL, ERR_HTTP_HEADERS_SENT, ERR_INVALID_HTTP_TOKEN, ERR_HTTP_INVALID_HEADER_VALUE, ERR_INVALID_CHAR } = __webpack_require__(7087); const { HTTP2_HEADER_STATUS, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_METHOD_CONNECT } = http2.constants; const kHeaders = Symbol('headers'); const kOrigin = Symbol('origin'); const kSession = Symbol('session'); const kOptions = Symbol('options'); const kFlushedHeaders = Symbol('flushedHeaders'); const kJobs = Symbol('jobs'); const isValidHttpToken = /^[\^`\-\w!#$%&*+.|~]+$/; const isInvalidHeaderValue = /[^\t\u0020-\u007E\u0080-\u00FF]/; class ClientRequest extends Writable { constructor(input, options, callback) { super({ autoDestroy: false }); const hasInput = typeof input === 'string' || input instanceof URL; if (hasInput) { input = urlToOptions(input instanceof URL ? input : new URL(input)); } if (typeof options === 'function' || options === undefined) { // (options, callback) callback = options; options = hasInput ? input : {...input}; } else { // (input, options, callback) options = {...input, ...options}; } if (options.h2session) { this[kSession] = options.h2session; } else if (options.agent === false) { this.agent = new Agent({maxFreeSessions: 0}); } else if (typeof options.agent === 'undefined' || options.agent === null) { if (typeof options.createConnection === 'function') { // This is a workaround - we don't have to create the session on our own. this.agent = new Agent({maxFreeSessions: 0}); this.agent.createConnection = options.createConnection; } else { this.agent = globalAgent; } } else if (typeof options.agent.request === 'function') { this.agent = options.agent; } else { throw new ERR_INVALID_ARG_TYPE('options.agent', ['Agent-like Object', 'undefined', 'false'], options.agent); } if (options.protocol && options.protocol !== 'https:') { throw new ERR_INVALID_PROTOCOL(options.protocol, 'https:'); } const port = options.port || options.defaultPort || (this.agent && this.agent.defaultPort) || 443; const host = options.hostname || options.host || 'localhost'; // Don't enforce the origin via options. It may be changed in an Agent. delete options.hostname; delete options.host; delete options.port; const {timeout} = options; options.timeout = undefined; this[kHeaders] = Object.create(null); this[kJobs] = []; this.socket = null; this.connection = null; this.method = options.method || 'GET'; this.path = options.path; this.res = null; this.aborted = false; this.reusedSocket = false; if (options.headers) { for (const [header, value] of Object.entries(options.headers)) { this.setHeader(header, value); } } if (options.auth && !('authorization' in this[kHeaders])) { this[kHeaders].authorization = 'Basic ' + Buffer.from(options.auth).toString('base64'); } options.session = options.tlsSession; options.path = options.socketPath; this[kOptions] = options; // Clients that generate HTTP/2 requests directly SHOULD use the :authority pseudo-header field instead of the Host header field. if (port === 443) { this[kOrigin] = `https://${host}`; if (!(':authority' in this[kHeaders])) { this[kHeaders][':authority'] = host; } } else { this[kOrigin] = `https://${host}:${port}`; if (!(':authority' in this[kHeaders])) { this[kHeaders][':authority'] = `${host}:${port}`; } } if (timeout) { this.setTimeout(timeout); } if (callback) { this.once('response', callback); } this[kFlushedHeaders] = false; } get method() { return this[kHeaders][HTTP2_HEADER_METHOD]; } set method(value) { if (value) { this[kHeaders][HTTP2_HEADER_METHOD] = value.toUpperCase(); } } get path() { return this[kHeaders][HTTP2_HEADER_PATH]; } set path(value) { if (value) { this[kHeaders][HTTP2_HEADER_PATH] = value; } } get _mustNotHaveABody() { return this.method === 'GET' || this.method === 'HEAD' || this.method === 'DELETE'; } _write(chunk, encoding, callback) { // https://github.com/nodejs/node/blob/654df09ae0c5e17d1b52a900a545f0664d8c7627/lib/internal/http2/util.js#L148-L156 if (this._mustNotHaveABody) { callback(new Error('The GET, HEAD and DELETE methods must NOT have a body')); /* istanbul ignore next: Node.js 12 throws directly */ return; } this.flushHeaders(); const callWrite = () => this._request.write(chunk, encoding, callback); if (this._request) { callWrite(); } else { this[kJobs].push(callWrite); } } _final(callback) { if (this.destroyed) { return; } this.flushHeaders(); const callEnd = () => { // For GET, HEAD and DELETE if (this._mustNotHaveABody) { callback(); return; } this._request.end(callback); }; if (this._request) { callEnd(); } else { this[kJobs].push(callEnd); } } abort() { if (this.res && this.res.complete) { return; } if (!this.aborted) { process.nextTick(() => this.emit('abort')); } this.aborted = true; this.destroy(); } _destroy(error, callback) { if (this.res) { this.res._dump(); } if (this._request) { this._request.destroy(); } callback(error); } async flushHeaders() { if (this[kFlushedHeaders] || this.destroyed) { return; } this[kFlushedHeaders] = true; const isConnectMethod = this.method === HTTP2_METHOD_CONNECT; // The real magic is here const onStream = stream => { this._request = stream; if (this.destroyed) { stream.destroy(); return; } // Forwards `timeout`, `continue`, `close` and `error` events to this instance. if (!isConnectMethod) { proxyEvents(stream, this, ['timeout', 'continue', 'close', 'error']); } // Wait for the `finish` event. We don't want to emit the `response` event // before `request.end()` is called. const waitForEnd = fn => { return (...args) => { if (!this.writable && !this.destroyed) { fn(...args); } else { this.once('finish', () => { fn(...args); }); } }; }; // This event tells we are ready to listen for the data. stream.once('response', waitForEnd((headers, flags, rawHeaders) => { // If we were to emit raw request stream, it would be as fast as the native approach. // Note that wrapping the raw stream in a Proxy instance won't improve the performance (already tested it). const response = new IncomingMessage(this.socket, stream.readableHighWaterMark); this.res = response; response.req = this; response.statusCode = headers[HTTP2_HEADER_STATUS]; response.headers = headers; response.rawHeaders = rawHeaders; response.once('end', () => { if (this.aborted) { response.aborted = true; response.emit('aborted'); } else { response.complete = true; // Has no effect, just be consistent with the Node.js behavior response.socket = null; response.connection = null; } }); if (isConnectMethod) { response.upgrade = true; // The HTTP1 API says the socket is detached here, // but we can't do that so we pass the original HTTP2 request. if (this.emit('connect', response, stream, Buffer.alloc(0))) { this.emit('close'); } else { // No listeners attached, destroy the original request. stream.destroy(); } } else { // Forwards data stream.on('data', chunk => { if (!response._dumped && !response.push(chunk)) { stream.pause(); } }); stream.once('end', () => { response.push(null); }); if (!this.emit('response', response)) { // No listeners attached, dump the response. response._dump(); } } })); // Emits `information` event stream.once('headers', waitForEnd( headers => this.emit('information', {statusCode: headers[HTTP2_HEADER_STATUS]}) )); stream.once('trailers', waitForEnd((trailers, flags, rawTrailers) => { const {res} = this; // Assigns trailers to the response object. res.trailers = trailers; res.rawTrailers = rawTrailers; })); const {socket} = stream.session; this.socket = socket; this.connection = socket; for (const job of this[kJobs]) { job(); } this.emit('socket', this.socket); }; // Makes a HTTP2 request if (this[kSession]) { try { onStream(this[kSession].request(this[kHeaders])); } catch (error) { this.emit('error', error); } } else { this.reusedSocket = true; try { onStream(await this.agent.request(this[kOrigin], this[kOptions], this[kHeaders])); } catch (error) { this.emit('error', error); } } } getHeader(name) { if (typeof name !== 'string') { throw new ERR_INVALID_ARG_TYPE('name', 'string', name); } return this[kHeaders][name.toLowerCase()]; } get headersSent() { return this[kFlushedHeaders]; } removeHeader(name) { if (typeof name !== 'string') { throw new ERR_INVALID_ARG_TYPE('name', 'string', name); } if (this.headersSent) { throw new ERR_HTTP_HEADERS_SENT('remove'); } delete this[kHeaders][name.toLowerCase()]; } setHeader(name, value) { if (this.headersSent) { throw new ERR_HTTP_HEADERS_SENT('set'); } if (typeof name !== 'string' || (!isValidHttpToken.test(name) && !isRequestPseudoHeader(name))) { throw new ERR_INVALID_HTTP_TOKEN('Header name', name); } if (typeof value === 'undefined') { throw new ERR_HTTP_INVALID_HEADER_VALUE(value, name); } if (isInvalidHeaderValue.test(value)) { throw new ERR_INVALID_CHAR('header content', name); } this[kHeaders][name.toLowerCase()] = value; } setNoDelay() { // HTTP2 sockets cannot be malformed, do nothing. } setSocketKeepAlive() { // HTTP2 sockets cannot be malformed, do nothing. } setTimeout(ms, callback) { const applyTimeout = () => this._request.setTimeout(ms, callback); if (this._request) { applyTimeout(); } else { this[kJobs].push(applyTimeout); } return this; } get maxHeadersCount() { if (!this.destroyed && this._request) { return this._request.session.localSettings.maxHeaderListSize; } return undefined; } set maxHeadersCount(_value) { // Updating HTTP2 settings would affect all requests, do nothing. } } module.exports = ClientRequest; /***/ }), /***/ 82575: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const {Readable} = __webpack_require__(92413); class IncomingMessage extends Readable { constructor(socket, highWaterMark) { super({ highWaterMark, autoDestroy: false }); this.statusCode = null; this.statusMessage = ''; this.httpVersion = '2.0'; this.httpVersionMajor = 2; this.httpVersionMinor = 0; this.headers = {}; this.trailers = {}; this.req = null; this.aborted = false; this.complete = false; this.upgrade = null; this.rawHeaders = []; this.rawTrailers = []; this.socket = socket; this.connection = socket; this._dumped = false; } _destroy(error) { this.req._request.destroy(error); } setTimeout(ms, callback) { this.req.setTimeout(ms, callback); return this; } _dump() { if (!this._dumped) { this._dumped = true; this.removeAllListeners('data'); this.resume(); } } _read() { if (this.req) { this.req._request.resume(); } } } module.exports = IncomingMessage; /***/ }), /***/ 54645: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const http2 = __webpack_require__(97565); const agent = __webpack_require__(79898); const ClientRequest = __webpack_require__(59632); const IncomingMessage = __webpack_require__(82575); const auto = __webpack_require__(97167); const request = (url, options, callback) => { return new ClientRequest(url, options, callback); }; const get = (url, options, callback) => { // eslint-disable-next-line unicorn/prevent-abbreviations const req = new ClientRequest(url, options, callback); req.end(); return req; }; module.exports = { ...http2, ClientRequest, IncomingMessage, ...agent, request, get, auto }; /***/ }), /***/ 51982: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const net = __webpack_require__(11631); /* istanbul ignore file: https://github.com/nodejs/node/blob/v13.0.1/lib/_http_agent.js */ module.exports = options => { let servername = options.host; const hostHeader = options.headers && options.headers.host; if (hostHeader) { if (hostHeader.startsWith('[')) { const index = hostHeader.indexOf(']'); if (index === -1) { servername = hostHeader; } else { servername = hostHeader.slice(1, -1); } } else { servername = hostHeader.split(':', 1)[0]; } } if (net.isIP(servername)) { return ''; } return servername; }; /***/ }), /***/ 7087: /***/ ((module) => { "use strict"; /* istanbul ignore file: https://github.com/nodejs/node/blob/master/lib/internal/errors.js */ const makeError = (Base, key, getMessage) => { module.exports[key] = class NodeError extends Base { constructor(...args) { super(typeof getMessage === 'string' ? getMessage : getMessage(args)); this.name = `${super.name} [${key}]`; this.code = key; } }; }; makeError(TypeError, 'ERR_INVALID_ARG_TYPE', args => { const type = args[0].includes('.') ? 'property' : 'argument'; let valid = args[1]; const isManyTypes = Array.isArray(valid); if (isManyTypes) { valid = `${valid.slice(0, -1).join(', ')} or ${valid.slice(-1)}`; } return `The "${args[0]}" ${type} must be ${isManyTypes ? 'one of' : 'of'} type ${valid}. Received ${typeof args[2]}`; }); makeError(TypeError, 'ERR_INVALID_PROTOCOL', args => { return `Protocol "${args[0]}" not supported. Expected "${args[1]}"`; }); makeError(Error, 'ERR_HTTP_HEADERS_SENT', args => { return `Cannot ${args[0]} headers after they are sent to the client`; }); makeError(TypeError, 'ERR_INVALID_HTTP_TOKEN', args => { return `${args[0]} must be a valid HTTP token [${args[1]}]`; }); makeError(TypeError, 'ERR_HTTP_INVALID_HEADER_VALUE', args => { return `Invalid value "${args[0]} for header "${args[1]}"`; }); makeError(TypeError, 'ERR_INVALID_CHAR', args => { return `Invalid character in ${args[0]} [${args[1]}]`; }); /***/ }), /***/ 11199: /***/ ((module) => { "use strict"; module.exports = header => { switch (header) { case ':method': case ':scheme': case ':authority': case ':path': return true; default: return false; } }; /***/ }), /***/ 81818: /***/ ((module) => { "use strict"; module.exports = (from, to, events) => { for (const event of events) { from.on(event, (...args) => to.emit(event, ...args)); } }; /***/ }), /***/ 92686: /***/ ((module) => { "use strict"; /* istanbul ignore file: https://github.com/nodejs/node/blob/a91293d4d9ab403046ab5eb022332e4e3d249bd3/lib/internal/url.js#L1257 */ module.exports = url => { const options = { protocol: url.protocol, hostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, host: url.host, hash: url.hash, search: url.search, pathname: url.pathname, href: url.href, path: `${url.pathname || ''}${url.search || ''}` }; if (typeof url.port === 'string' && url.port.length !== 0) { options.port = Number(url.port); } if (url.username || url.password) { options.auth = `${url.username || ''}:${url.password || ''}`; } return options; }; /***/ }), /***/ 15098: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const net_1 = __importDefault(__webpack_require__(11631)); const tls_1 = __importDefault(__webpack_require__(4016)); const url_1 = __importDefault(__webpack_require__(78835)); const assert_1 = __importDefault(__webpack_require__(42357)); const debug_1 = __importDefault(__webpack_require__(38237)); const agent_base_1 = __webpack_require__(49690); const parse_proxy_response_1 = __importDefault(__webpack_require__(595)); const debug = debug_1.default('https-proxy-agent:agent'); /** * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. * * Outgoing HTTP requests are first tunneled through the proxy server using the * `CONNECT` HTTP request method to establish a connection to the proxy server, * and then the proxy server connects to the destination target and issues the * HTTP request from the proxy server. * * `https:` requests have their socket connection upgraded to TLS once * the connection to the proxy server has been established. * * @api public */ class HttpsProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); } debug('creating new HttpsProxyAgent instance: %o', opts); super(opts); const proxy = Object.assign({}, opts); // If `true`, then connect to the proxy server over TLS. // Defaults to `false`. this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); // Prefer `hostname` over `host`, and set the `port` if needed. proxy.host = proxy.hostname || proxy.host; if (typeof proxy.port === 'string') { proxy.port = parseInt(proxy.port, 10); } if (!proxy.port && proxy.host) { proxy.port = this.secureProxy ? 443 : 80; } // ALPN is supported by Node.js >= v5. // attempt to negotiate http/1.1 for proxy servers that support http/2 if (this.secureProxy && !('ALPNProtocols' in proxy)) { proxy.ALPNProtocols = ['http 1.1']; } if (proxy.host && proxy.path) { // If both a `host` and `path` are specified then it's most likely // the result of a `url.parse()` call... we need to remove the // `path` portion so that `net.connect()` doesn't attempt to open // that as a Unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { proxy, secureProxy } = this; // Create a socket connection to the proxy server. let socket; if (secureProxy) { debug('Creating `tls.Socket`: %o', proxy); socket = tls_1.default.connect(proxy); } else { debug('Creating `net.Socket`: %o', proxy); socket = net_1.default.connect(proxy); } const headers = Object.assign({}, proxy.headers); const hostname = `${opts.host}:${opts.port}`; let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; // Inject the `Proxy-Authorization` header if necessary. if (proxy.auth) { headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; } // The `Host` header should only include the port // number when it is not the default port. let { host, port, secureEndpoint } = opts; if (!isDefaultPort(port, secureEndpoint)) { host += `:${port}`; } headers.Host = host; headers.Connection = 'close'; for (const name of Object.keys(headers)) { payload += `${name}: ${headers[name]}\r\n`; } const proxyResponsePromise = parse_proxy_response_1.default(socket); socket.write(`${payload}\r\n`); const { statusCode, buffered } = yield proxyResponsePromise; if (statusCode === 200) { req.once('socket', resume); if (opts.secureEndpoint) { const servername = opts.servername || opts.host; if (!servername) { throw new Error('Could not determine "servername"'); } // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, servername })); } return socket; } // Some other status code that's not 200... need to re-play the HTTP // header "data" events onto the socket once the HTTP machinery is // attached so that the node core `http` can parse and handle the // error status code. // Close the original socket, and a new "fake" socket is returned // instead, so that the proxy doesn't get the HTTP request // written to it (which may contain `Authorization` headers or other // sensitive data). // // See: https://hackerone.com/reports/541502 socket.destroy(); const fakeSocket = new net_1.default.Socket(); fakeSocket.readable = true; // Need to wait for the "socket" event to re-play the "data" events. req.once('socket', (s) => { debug('replaying proxy buffer for failed request'); assert_1.default(s.listenerCount('data') > 0); // Replay the "buffered" Buffer onto the fake `socket`, since at // this point the HTTP module machinery has been hooked up for // the user. s.push(buffered); s.push(null); }); return fakeSocket; }); } } exports.default = HttpsProxyAgent; function resume(socket) { socket.resume(); } function isDefaultPort(port, secure) { return Boolean((!secure && port === 80) || (secure && port === 443)); } function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } //# sourceMappingURL=agent.js.map /***/ }), /***/ 77219: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(__webpack_require__(15098)); function createHttpsProxyAgent(opts) { return new agent_1.default(opts); } (function (createHttpsProxyAgent) { createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; createHttpsProxyAgent.prototype = agent_1.default.prototype; })(createHttpsProxyAgent || (createHttpsProxyAgent = {})); module.exports = createHttpsProxyAgent; //# sourceMappingURL=index.js.map /***/ }), /***/ 595: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); const debug_1 = __importDefault(__webpack_require__(38237)); const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); function parseProxyResponse(socket) { return new Promise((resolve, reject) => { // we need to buffer any HTTP traffic that happens with the proxy before we get // the CONNECT response, so that if the response is anything other than an "200" // response code, then we can re-play the "data" events on the socket once the // HTTP parser is hooked up... let buffersLength = 0; const buffers = []; function read() { const b = socket.read(); if (b) ondata(b); else socket.once('readable', read); } function cleanup() { socket.removeListener('end', onend); socket.removeListener('error', onerror); socket.removeListener('close', onclose); socket.removeListener('readable', read); } function onclose(err) { debug('onclose had error %o', err); } function onend() { debug('onend'); } function onerror(err) { cleanup(); debug('onerror %o', err); reject(err); } function ondata(b) { buffers.push(b); buffersLength += b.length; const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf('\r\n\r\n'); if (endOfHeaders === -1) { // keep buffering debug('have not received end of HTTP headers yet...'); read(); return; } const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); const statusCode = +firstLine.split(' ')[1]; debug('got proxy server response: %o', firstLine); resolve({ statusCode, buffered }); } socket.on('error', onerror); socket.on('close', onclose); socket.on('end', onend); read(); }); } exports.default = parseProxyResponse; //# sourceMappingURL=parse-proxy-response.js.map /***/ }), /***/ 98043: /***/ ((module) => { "use strict"; module.exports = (string, count = 1, options) => { options = { indent: ' ', includeEmptyLines: false, ...options }; if (typeof string !== 'string') { throw new TypeError( `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` ); } if (typeof count !== 'number') { throw new TypeError( `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` ); } if (typeof options.indent !== 'string') { throw new TypeError( `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` ); } if (count === 0) { return string; } const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; return string.replace(regex, options.indent.repeat(count)); }; /***/ }), /***/ 52492: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var wrappy = __webpack_require__(62940) var reqs = Object.create(null) var once = __webpack_require__(1223) module.exports = wrappy(inflight) function inflight (key, cb) { if (reqs[key]) { reqs[key].push(cb) return null } else { reqs[key] = [cb] return makeres(key) } } function makeres (key) { return once(function RES () { var cbs = reqs[key] var len = cbs.length var args = slice(arguments) // XXX It's somewhat ambiguous whether a new callback added in this // pass should be queued for later execution if something in the // list of callbacks throws, or if it should just be discarded. // However, it's such an edge case that it hardly matters, and either // choice is likely as surprising as the other. // As it happens, we do go ahead and schedule it for later execution. try { for (var i = 0; i < len; i++) { cbs[i].apply(null, args) } } finally { if (cbs.length > len) { // added more in the interim. // de-zalgo, just in case, but don't call again. cbs.splice(0, len) process.nextTick(function () { RES.apply(null, args) }) } else { delete reqs[key] } } }) } function slice (args) { var length = args.length var array = [] for (var i = 0; i < length; i++) array[i] = args[i] return array } /***/ }), /***/ 44124: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { try { var util = __webpack_require__(31669); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ module.exports = __webpack_require__(8544); } /***/ }), /***/ 8544: /***/ ((module) => { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } /***/ }), /***/ 51389: /***/ ((module) => { "use strict"; module.exports = value => { const type = typeof value; return value !== null && (type === 'object' || type === 'function'); }; /***/ }), /***/ 66634: /***/ ((module) => { "use strict"; module.exports = function (stream) { var ended; if (typeof stream.ended !== 'undefined') { ended = stream.ended; } else { ended = stream._readableState.ended; } return Boolean(ended).valueOf(); }; /***/ }), /***/ 41554: /***/ ((module) => { "use strict"; const isStream = stream => stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; isStream.writable = stream => isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; isStream.readable = stream => isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; isStream.duplex = stream => isStream.writable(stream) && isStream.readable(stream); isStream.transform = stream => isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; module.exports = isStream; /***/ }), /***/ 10657: /***/ ((module) => { module.exports = isTypedArray isTypedArray.strict = isStrictTypedArray isTypedArray.loose = isLooseTypedArray var toString = Object.prototype.toString var names = { '[object Int8Array]': true , '[object Int16Array]': true , '[object Int32Array]': true , '[object Uint8Array]': true , '[object Uint8ClampedArray]': true , '[object Uint16Array]': true , '[object Uint32Array]': true , '[object Float32Array]': true , '[object Float64Array]': true } function isTypedArray(arr) { return ( isStrictTypedArray(arr) || isLooseTypedArray(arr) ) } function isStrictTypedArray(arr) { return ( arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array ) } function isLooseTypedArray(arr) { return names[toString.call(arr)] } /***/ }), /***/ 97126: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(35747) var core if (process.platform === 'win32' || global.TESTING_WINDOWS) { core = __webpack_require__(42001) } else { core = __webpack_require__(9728) } module.exports = isexe isexe.sync = sync function isexe (path, options, cb) { if (typeof options === 'function') { cb = options options = {} } if (!cb) { if (typeof Promise !== 'function') { throw new TypeError('callback not provided') } return new Promise(function (resolve, reject) { isexe(path, options || {}, function (er, is) { if (er) { reject(er) } else { resolve(is) } }) }) } core(path, options || {}, function (er, is) { // ignore EACCES because that just means we aren't allowed to run it if (er) { if (er.code === 'EACCES' || options && options.ignoreErrors) { er = null is = false } } cb(er, is) }) } function sync (path, options) { // my kingdom for a filtered catch try { return core.sync(path, options || {}) } catch (er) { if (options && options.ignoreErrors || er.code === 'EACCES') { return false } else { throw er } } } /***/ }), /***/ 9728: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = isexe isexe.sync = sync var fs = __webpack_require__(35747) function isexe (path, options, cb) { fs.stat(path, function (er, stat) { cb(er, er ? false : checkStat(stat, options)) }) } function sync (path, options) { return checkStat(fs.statSync(path), options) } function checkStat (stat, options) { return stat.isFile() && checkMode(stat, options) } function checkMode (stat, options) { var mod = stat.mode var uid = stat.uid var gid = stat.gid var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid() var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid() var u = parseInt('100', 8) var g = parseInt('010', 8) var o = parseInt('001', 8) var ug = u | g var ret = (mod & o) || (mod & g) && gid === myGid || (mod & u) && uid === myUid || (mod & ug) && myUid === 0 return ret } /***/ }), /***/ 42001: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = isexe isexe.sync = sync var fs = __webpack_require__(35747) function checkPathExt (path, options) { var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT if (!pathext) { return true } pathext = pathext.split(';') if (pathext.indexOf('') !== -1) { return true } for (var i = 0; i < pathext.length; i++) { var p = pathext[i].toLowerCase() if (p && path.substr(-p.length).toLowerCase() === p) { return true } } return false } function checkStat (stat, path, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false } return checkPathExt(path, options) } function isexe (path, options, cb) { fs.stat(path, function (er, stat) { cb(er, er ? false : checkStat(stat, path, options)) }) } function sync (path, options) { return checkStat(fs.statSync(path), path, options) } /***/ }), /***/ 64713: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = __webpack_require__(88867); /***/ }), /***/ 83362: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var stream = __webpack_require__(92413) function isStream (obj) { return obj instanceof stream.Stream } function isReadable (obj) { return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' } function isWritable (obj) { return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' } function isDuplex (obj) { return isReadable(obj) && isWritable(obj) } module.exports = isStream module.exports.isReadable = isReadable module.exports.isWritable = isWritable module.exports.isDuplex = isDuplex /***/ }), /***/ 87783: /***/ ((__unused_webpack_module, exports) => { (function(exports) { "use strict"; function isArray(obj) { if (obj !== null) { return Object.prototype.toString.call(obj) === "[object Array]"; } else { return false; } } function isObject(obj) { if (obj !== null) { return Object.prototype.toString.call(obj) === "[object Object]"; } else { return false; } } function strictDeepEqual(first, second) { // Check the scalar case first. if (first === second) { return true; } // Check if they are the same type. var firstType = Object.prototype.toString.call(first); if (firstType !== Object.prototype.toString.call(second)) { return false; } // We know that first and second have the same type so we can just check the // first type from now on. if (isArray(first) === true) { // Short circuit if they're not the same length; if (first.length !== second.length) { return false; } for (var i = 0; i < first.length; i++) { if (strictDeepEqual(first[i], second[i]) === false) { return false; } } return true; } if (isObject(first) === true) { // An object is equal if it has the same key/value pairs. var keysSeen = {}; for (var key in first) { if (hasOwnProperty.call(first, key)) { if (strictDeepEqual(first[key], second[key]) === false) { return false; } keysSeen[key] = true; } } // Now check that there aren't any keys in second that weren't // in first. for (var key2 in second) { if (hasOwnProperty.call(second, key2)) { if (keysSeen[key2] !== true) { return false; } } } return true; } return false; } function isFalse(obj) { // From the spec: // A false value corresponds to the following values: // Empty list // Empty object // Empty string // False boolean // null value // First check the scalar values. if (obj === "" || obj === false || obj === null) { return true; } else if (isArray(obj) && obj.length === 0) { // Check for an empty array. return true; } else if (isObject(obj)) { // Check for an empty object. for (var key in obj) { // If there are any keys, then // the object is not empty so the object // is not false. if (obj.hasOwnProperty(key)) { return false; } } return true; } else { return false; } } function objValues(obj) { var keys = Object.keys(obj); var values = []; for (var i = 0; i < keys.length; i++) { values.push(obj[keys[i]]); } return values; } function merge(a, b) { var merged = {}; for (var key in a) { merged[key] = a[key]; } for (var key2 in b) { merged[key2] = b[key2]; } return merged; } var trimLeft; if (typeof String.prototype.trimLeft === "function") { trimLeft = function(str) { return str.trimLeft(); }; } else { trimLeft = function(str) { return str.match(/^\s*(.*)/)[1]; }; } // Type constants used to define functions. var TYPE_NUMBER = 0; var TYPE_ANY = 1; var TYPE_STRING = 2; var TYPE_ARRAY = 3; var TYPE_OBJECT = 4; var TYPE_BOOLEAN = 5; var TYPE_EXPREF = 6; var TYPE_NULL = 7; var TYPE_ARRAY_NUMBER = 8; var TYPE_ARRAY_STRING = 9; var TOK_EOF = "EOF"; var TOK_UNQUOTEDIDENTIFIER = "UnquotedIdentifier"; var TOK_QUOTEDIDENTIFIER = "QuotedIdentifier"; var TOK_RBRACKET = "Rbracket"; var TOK_RPAREN = "Rparen"; var TOK_COMMA = "Comma"; var TOK_COLON = "Colon"; var TOK_RBRACE = "Rbrace"; var TOK_NUMBER = "Number"; var TOK_CURRENT = "Current"; var TOK_EXPREF = "Expref"; var TOK_PIPE = "Pipe"; var TOK_OR = "Or"; var TOK_AND = "And"; var TOK_EQ = "EQ"; var TOK_GT = "GT"; var TOK_LT = "LT"; var TOK_GTE = "GTE"; var TOK_LTE = "LTE"; var TOK_NE = "NE"; var TOK_FLATTEN = "Flatten"; var TOK_STAR = "Star"; var TOK_FILTER = "Filter"; var TOK_DOT = "Dot"; var TOK_NOT = "Not"; var TOK_LBRACE = "Lbrace"; var TOK_LBRACKET = "Lbracket"; var TOK_LPAREN= "Lparen"; var TOK_LITERAL= "Literal"; // The "&", "[", "<", ">" tokens // are not in basicToken because // there are two token variants // ("&&", "[?", "<=", ">="). This is specially handled // below. var basicTokens = { ".": TOK_DOT, "*": TOK_STAR, ",": TOK_COMMA, ":": TOK_COLON, "{": TOK_LBRACE, "}": TOK_RBRACE, "]": TOK_RBRACKET, "(": TOK_LPAREN, ")": TOK_RPAREN, "@": TOK_CURRENT }; var operatorStartToken = { "<": true, ">": true, "=": true, "!": true }; var skipChars = { " ": true, "\t": true, "\n": true }; function isAlpha(ch) { return (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || ch === "_"; } function isNum(ch) { return (ch >= "0" && ch <= "9") || ch === "-"; } function isAlphaNum(ch) { return (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z") || (ch >= "0" && ch <= "9") || ch === "_"; } function Lexer() { } Lexer.prototype = { tokenize: function(stream) { var tokens = []; this._current = 0; var start; var identifier; var token; while (this._current < stream.length) { if (isAlpha(stream[this._current])) { start = this._current; identifier = this._consumeUnquotedIdentifier(stream); tokens.push({type: TOK_UNQUOTEDIDENTIFIER, value: identifier, start: start}); } else if (basicTokens[stream[this._current]] !== undefined) { tokens.push({type: basicTokens[stream[this._current]], value: stream[this._current], start: this._current}); this._current++; } else if (isNum(stream[this._current])) { token = this._consumeNumber(stream); tokens.push(token); } else if (stream[this._current] === "[") { // No need to increment this._current. This happens // in _consumeLBracket token = this._consumeLBracket(stream); tokens.push(token); } else if (stream[this._current] === "\"") { start = this._current; identifier = this._consumeQuotedIdentifier(stream); tokens.push({type: TOK_QUOTEDIDENTIFIER, value: identifier, start: start}); } else if (stream[this._current] === "'") { start = this._current; identifier = this._consumeRawStringLiteral(stream); tokens.push({type: TOK_LITERAL, value: identifier, start: start}); } else if (stream[this._current] === "`") { start = this._current; var literal = this._consumeLiteral(stream); tokens.push({type: TOK_LITERAL, value: literal, start: start}); } else if (operatorStartToken[stream[this._current]] !== undefined) { tokens.push(this._consumeOperator(stream)); } else if (skipChars[stream[this._current]] !== undefined) { // Ignore whitespace. this._current++; } else if (stream[this._current] === "&") { start = this._current; this._current++; if (stream[this._current] === "&") { this._current++; tokens.push({type: TOK_AND, value: "&&", start: start}); } else { tokens.push({type: TOK_EXPREF, value: "&", start: start}); } } else if (stream[this._current] === "|") { start = this._current; this._current++; if (stream[this._current] === "|") { this._current++; tokens.push({type: TOK_OR, value: "||", start: start}); } else { tokens.push({type: TOK_PIPE, value: "|", start: start}); } } else { var error = new Error("Unknown character:" + stream[this._current]); error.name = "LexerError"; throw error; } } return tokens; }, _consumeUnquotedIdentifier: function(stream) { var start = this._current; this._current++; while (this._current < stream.length && isAlphaNum(stream[this._current])) { this._current++; } return stream.slice(start, this._current); }, _consumeQuotedIdentifier: function(stream) { var start = this._current; this._current++; var maxLength = stream.length; while (stream[this._current] !== "\"" && this._current < maxLength) { // You can escape a double quote and you can escape an escape. var current = this._current; if (stream[current] === "\\" && (stream[current + 1] === "\\" || stream[current + 1] === "\"")) { current += 2; } else { current++; } this._current = current; } this._current++; return JSON.parse(stream.slice(start, this._current)); }, _consumeRawStringLiteral: function(stream) { var start = this._current; this._current++; var maxLength = stream.length; while (stream[this._current] !== "'" && this._current < maxLength) { // You can escape a single quote and you can escape an escape. var current = this._current; if (stream[current] === "\\" && (stream[current + 1] === "\\" || stream[current + 1] === "'")) { current += 2; } else { current++; } this._current = current; } this._current++; var literal = stream.slice(start + 1, this._current - 1); return literal.replace("\\'", "'"); }, _consumeNumber: function(stream) { var start = this._current; this._current++; var maxLength = stream.length; while (isNum(stream[this._current]) && this._current < maxLength) { this._current++; } var value = parseInt(stream.slice(start, this._current)); return {type: TOK_NUMBER, value: value, start: start}; }, _consumeLBracket: function(stream) { var start = this._current; this._current++; if (stream[this._current] === "?") { this._current++; return {type: TOK_FILTER, value: "[?", start: start}; } else if (stream[this._current] === "]") { this._current++; return {type: TOK_FLATTEN, value: "[]", start: start}; } else { return {type: TOK_LBRACKET, value: "[", start: start}; } }, _consumeOperator: function(stream) { var start = this._current; var startingChar = stream[start]; this._current++; if (startingChar === "!") { if (stream[this._current] === "=") { this._current++; return {type: TOK_NE, value: "!=", start: start}; } else { return {type: TOK_NOT, value: "!", start: start}; } } else if (startingChar === "<") { if (stream[this._current] === "=") { this._current++; return {type: TOK_LTE, value: "<=", start: start}; } else { return {type: TOK_LT, value: "<", start: start}; } } else if (startingChar === ">") { if (stream[this._current] === "=") { this._current++; return {type: TOK_GTE, value: ">=", start: start}; } else { return {type: TOK_GT, value: ">", start: start}; } } else if (startingChar === "=") { if (stream[this._current] === "=") { this._current++; return {type: TOK_EQ, value: "==", start: start}; } } }, _consumeLiteral: function(stream) { this._current++; var start = this._current; var maxLength = stream.length; var literal; while(stream[this._current] !== "`" && this._current < maxLength) { // You can escape a literal char or you can escape the escape. var current = this._current; if (stream[current] === "\\" && (stream[current + 1] === "\\" || stream[current + 1] === "`")) { current += 2; } else { current++; } this._current = current; } var literalString = trimLeft(stream.slice(start, this._current)); literalString = literalString.replace("\\`", "`"); if (this._looksLikeJSON(literalString)) { literal = JSON.parse(literalString); } else { // Try to JSON parse it as "" literal = JSON.parse("\"" + literalString + "\""); } // +1 gets us to the ending "`", +1 to move on to the next char. this._current++; return literal; }, _looksLikeJSON: function(literalString) { var startingChars = "[{\""; var jsonLiterals = ["true", "false", "null"]; var numberLooking = "-0123456789"; if (literalString === "") { return false; } else if (startingChars.indexOf(literalString[0]) >= 0) { return true; } else if (jsonLiterals.indexOf(literalString) >= 0) { return true; } else if (numberLooking.indexOf(literalString[0]) >= 0) { try { JSON.parse(literalString); return true; } catch (ex) { return false; } } else { return false; } } }; var bindingPower = {}; bindingPower[TOK_EOF] = 0; bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0; bindingPower[TOK_QUOTEDIDENTIFIER] = 0; bindingPower[TOK_RBRACKET] = 0; bindingPower[TOK_RPAREN] = 0; bindingPower[TOK_COMMA] = 0; bindingPower[TOK_RBRACE] = 0; bindingPower[TOK_NUMBER] = 0; bindingPower[TOK_CURRENT] = 0; bindingPower[TOK_EXPREF] = 0; bindingPower[TOK_PIPE] = 1; bindingPower[TOK_OR] = 2; bindingPower[TOK_AND] = 3; bindingPower[TOK_EQ] = 5; bindingPower[TOK_GT] = 5; bindingPower[TOK_LT] = 5; bindingPower[TOK_GTE] = 5; bindingPower[TOK_LTE] = 5; bindingPower[TOK_NE] = 5; bindingPower[TOK_FLATTEN] = 9; bindingPower[TOK_STAR] = 20; bindingPower[TOK_FILTER] = 21; bindingPower[TOK_DOT] = 40; bindingPower[TOK_NOT] = 45; bindingPower[TOK_LBRACE] = 50; bindingPower[TOK_LBRACKET] = 55; bindingPower[TOK_LPAREN] = 60; function Parser() { } Parser.prototype = { parse: function(expression) { this._loadTokens(expression); this.index = 0; var ast = this.expression(0); if (this._lookahead(0) !== TOK_EOF) { var t = this._lookaheadToken(0); var error = new Error( "Unexpected token type: " + t.type + ", value: " + t.value); error.name = "ParserError"; throw error; } return ast; }, _loadTokens: function(expression) { var lexer = new Lexer(); var tokens = lexer.tokenize(expression); tokens.push({type: TOK_EOF, value: "", start: expression.length}); this.tokens = tokens; }, expression: function(rbp) { var leftToken = this._lookaheadToken(0); this._advance(); var left = this.nud(leftToken); var currentToken = this._lookahead(0); while (rbp < bindingPower[currentToken]) { this._advance(); left = this.led(currentToken, left); currentToken = this._lookahead(0); } return left; }, _lookahead: function(number) { return this.tokens[this.index + number].type; }, _lookaheadToken: function(number) { return this.tokens[this.index + number]; }, _advance: function() { this.index++; }, nud: function(token) { var left; var right; var expression; switch (token.type) { case TOK_LITERAL: return {type: "Literal", value: token.value}; case TOK_UNQUOTEDIDENTIFIER: return {type: "Field", name: token.value}; case TOK_QUOTEDIDENTIFIER: var node = {type: "Field", name: token.value}; if (this._lookahead(0) === TOK_LPAREN) { throw new Error("Quoted identifier not allowed for function names."); } else { return node; } break; case TOK_NOT: right = this.expression(bindingPower.Not); return {type: "NotExpression", children: [right]}; case TOK_STAR: left = {type: "Identity"}; right = null; if (this._lookahead(0) === TOK_RBRACKET) { // This can happen in a multiselect, // [a, b, *] right = {type: "Identity"}; } else { right = this._parseProjectionRHS(bindingPower.Star); } return {type: "ValueProjection", children: [left, right]}; case TOK_FILTER: return this.led(token.type, {type: "Identity"}); case TOK_LBRACE: return this._parseMultiselectHash(); case TOK_FLATTEN: left = {type: TOK_FLATTEN, children: [{type: "Identity"}]}; right = this._parseProjectionRHS(bindingPower.Flatten); return {type: "Projection", children: [left, right]}; case TOK_LBRACKET: if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) { right = this._parseIndexExpression(); return this._projectIfSlice({type: "Identity"}, right); } else if (this._lookahead(0) === TOK_STAR && this._lookahead(1) === TOK_RBRACKET) { this._advance(); this._advance(); right = this._parseProjectionRHS(bindingPower.Star); return {type: "Projection", children: [{type: "Identity"}, right]}; } else { return this._parseMultiselectList(); } break; case TOK_CURRENT: return {type: TOK_CURRENT}; case TOK_EXPREF: expression = this.expression(bindingPower.Expref); return {type: "ExpressionReference", children: [expression]}; case TOK_LPAREN: var args = []; while (this._lookahead(0) !== TOK_RPAREN) { if (this._lookahead(0) === TOK_CURRENT) { expression = {type: TOK_CURRENT}; this._advance(); } else { expression = this.expression(0); } args.push(expression); } this._match(TOK_RPAREN); return args[0]; default: this._errorToken(token); } }, led: function(tokenName, left) { var right; switch(tokenName) { case TOK_DOT: var rbp = bindingPower.Dot; if (this._lookahead(0) !== TOK_STAR) { right = this._parseDotRHS(rbp); return {type: "Subexpression", children: [left, right]}; } else { // Creating a projection. this._advance(); right = this._parseProjectionRHS(rbp); return {type: "ValueProjection", children: [left, right]}; } break; case TOK_PIPE: right = this.expression(bindingPower.Pipe); return {type: TOK_PIPE, children: [left, right]}; case TOK_OR: right = this.expression(bindingPower.Or); return {type: "OrExpression", children: [left, right]}; case TOK_AND: right = this.expression(bindingPower.And); return {type: "AndExpression", children: [left, right]}; case TOK_LPAREN: var name = left.name; var args = []; var expression, node; while (this._lookahead(0) !== TOK_RPAREN) { if (this._lookahead(0) === TOK_CURRENT) { expression = {type: TOK_CURRENT}; this._advance(); } else { expression = this.expression(0); } if (this._lookahead(0) === TOK_COMMA) { this._match(TOK_COMMA); } args.push(expression); } this._match(TOK_RPAREN); node = {type: "Function", name: name, children: args}; return node; case TOK_FILTER: var condition = this.expression(0); this._match(TOK_RBRACKET); if (this._lookahead(0) === TOK_FLATTEN) { right = {type: "Identity"}; } else { right = this._parseProjectionRHS(bindingPower.Filter); } return {type: "FilterProjection", children: [left, right, condition]}; case TOK_FLATTEN: var leftNode = {type: TOK_FLATTEN, children: [left]}; var rightNode = this._parseProjectionRHS(bindingPower.Flatten); return {type: "Projection", children: [leftNode, rightNode]}; case TOK_EQ: case TOK_NE: case TOK_GT: case TOK_GTE: case TOK_LT: case TOK_LTE: return this._parseComparator(left, tokenName); case TOK_LBRACKET: var token = this._lookaheadToken(0); if (token.type === TOK_NUMBER || token.type === TOK_COLON) { right = this._parseIndexExpression(); return this._projectIfSlice(left, right); } else { this._match(TOK_STAR); this._match(TOK_RBRACKET); right = this._parseProjectionRHS(bindingPower.Star); return {type: "Projection", children: [left, right]}; } break; default: this._errorToken(this._lookaheadToken(0)); } }, _match: function(tokenType) { if (this._lookahead(0) === tokenType) { this._advance(); } else { var t = this._lookaheadToken(0); var error = new Error("Expected " + tokenType + ", got: " + t.type); error.name = "ParserError"; throw error; } }, _errorToken: function(token) { var error = new Error("Invalid token (" + token.type + "): \"" + token.value + "\""); error.name = "ParserError"; throw error; }, _parseIndexExpression: function() { if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) { return this._parseSliceExpression(); } else { var node = { type: "Index", value: this._lookaheadToken(0).value}; this._advance(); this._match(TOK_RBRACKET); return node; } }, _projectIfSlice: function(left, right) { var indexExpr = {type: "IndexExpression", children: [left, right]}; if (right.type === "Slice") { return { type: "Projection", children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)] }; } else { return indexExpr; } }, _parseSliceExpression: function() { // [start:end:step] where each part is optional, as well as the last // colon. var parts = [null, null, null]; var index = 0; var currentToken = this._lookahead(0); while (currentToken !== TOK_RBRACKET && index < 3) { if (currentToken === TOK_COLON) { index++; this._advance(); } else if (currentToken === TOK_NUMBER) { parts[index] = this._lookaheadToken(0).value; this._advance(); } else { var t = this._lookahead(0); var error = new Error("Syntax error, unexpected token: " + t.value + "(" + t.type + ")"); error.name = "Parsererror"; throw error; } currentToken = this._lookahead(0); } this._match(TOK_RBRACKET); return { type: "Slice", children: parts }; }, _parseComparator: function(left, comparator) { var right = this.expression(bindingPower[comparator]); return {type: "Comparator", name: comparator, children: [left, right]}; }, _parseDotRHS: function(rbp) { var lookahead = this._lookahead(0); var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR]; if (exprTokens.indexOf(lookahead) >= 0) { return this.expression(rbp); } else if (lookahead === TOK_LBRACKET) { this._match(TOK_LBRACKET); return this._parseMultiselectList(); } else if (lookahead === TOK_LBRACE) { this._match(TOK_LBRACE); return this._parseMultiselectHash(); } }, _parseProjectionRHS: function(rbp) { var right; if (bindingPower[this._lookahead(0)] < 10) { right = {type: "Identity"}; } else if (this._lookahead(0) === TOK_LBRACKET) { right = this.expression(rbp); } else if (this._lookahead(0) === TOK_FILTER) { right = this.expression(rbp); } else if (this._lookahead(0) === TOK_DOT) { this._match(TOK_DOT); right = this._parseDotRHS(rbp); } else { var t = this._lookaheadToken(0); var error = new Error("Sytanx error, unexpected token: " + t.value + "(" + t.type + ")"); error.name = "ParserError"; throw error; } return right; }, _parseMultiselectList: function() { var expressions = []; while (this._lookahead(0) !== TOK_RBRACKET) { var expression = this.expression(0); expressions.push(expression); if (this._lookahead(0) === TOK_COMMA) { this._match(TOK_COMMA); if (this._lookahead(0) === TOK_RBRACKET) { throw new Error("Unexpected token Rbracket"); } } } this._match(TOK_RBRACKET); return {type: "MultiSelectList", children: expressions}; }, _parseMultiselectHash: function() { var pairs = []; var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER]; var keyToken, keyName, value, node; for (;;) { keyToken = this._lookaheadToken(0); if (identifierTypes.indexOf(keyToken.type) < 0) { throw new Error("Expecting an identifier token, got: " + keyToken.type); } keyName = keyToken.value; this._advance(); this._match(TOK_COLON); value = this.expression(0); node = {type: "KeyValuePair", name: keyName, value: value}; pairs.push(node); if (this._lookahead(0) === TOK_COMMA) { this._match(TOK_COMMA); } else if (this._lookahead(0) === TOK_RBRACE) { this._match(TOK_RBRACE); break; } } return {type: "MultiSelectHash", children: pairs}; } }; function TreeInterpreter(runtime) { this.runtime = runtime; } TreeInterpreter.prototype = { search: function(node, value) { return this.visit(node, value); }, visit: function(node, value) { var matched, current, result, first, second, field, left, right, collected, i; switch (node.type) { case "Field": if (value === null ) { return null; } else if (isObject(value)) { field = value[node.name]; if (field === undefined) { return null; } else { return field; } } else { return null; } break; case "Subexpression": result = this.visit(node.children[0], value); for (i = 1; i < node.children.length; i++) { result = this.visit(node.children[1], result); if (result === null) { return null; } } return result; case "IndexExpression": left = this.visit(node.children[0], value); right = this.visit(node.children[1], left); return right; case "Index": if (!isArray(value)) { return null; } var index = node.value; if (index < 0) { index = value.length + index; } result = value[index]; if (result === undefined) { result = null; } return result; case "Slice": if (!isArray(value)) { return null; } var sliceParams = node.children.slice(0); var computed = this.computeSliceParams(value.length, sliceParams); var start = computed[0]; var stop = computed[1]; var step = computed[2]; result = []; if (step > 0) { for (i = start; i < stop; i += step) { result.push(value[i]); } } else { for (i = start; i > stop; i += step) { result.push(value[i]); } } return result; case "Projection": // Evaluate left child. var base = this.visit(node.children[0], value); if (!isArray(base)) { return null; } collected = []; for (i = 0; i < base.length; i++) { current = this.visit(node.children[1], base[i]); if (current !== null) { collected.push(current); } } return collected; case "ValueProjection": // Evaluate left child. base = this.visit(node.children[0], value); if (!isObject(base)) { return null; } collected = []; var values = objValues(base); for (i = 0; i < values.length; i++) { current = this.visit(node.children[1], values[i]); if (current !== null) { collected.push(current); } } return collected; case "FilterProjection": base = this.visit(node.children[0], value); if (!isArray(base)) { return null; } var filtered = []; var finalResults = []; for (i = 0; i < base.length; i++) { matched = this.visit(node.children[2], base[i]); if (!isFalse(matched)) { filtered.push(base[i]); } } for (var j = 0; j < filtered.length; j++) { current = this.visit(node.children[1], filtered[j]); if (current !== null) { finalResults.push(current); } } return finalResults; case "Comparator": first = this.visit(node.children[0], value); second = this.visit(node.children[1], value); switch(node.name) { case TOK_EQ: result = strictDeepEqual(first, second); break; case TOK_NE: result = !strictDeepEqual(first, second); break; case TOK_GT: result = first > second; break; case TOK_GTE: result = first >= second; break; case TOK_LT: result = first < second; break; case TOK_LTE: result = first <= second; break; default: throw new Error("Unknown comparator: " + node.name); } return result; case TOK_FLATTEN: var original = this.visit(node.children[0], value); if (!isArray(original)) { return null; } var merged = []; for (i = 0; i < original.length; i++) { current = original[i]; if (isArray(current)) { merged.push.apply(merged, current); } else { merged.push(current); } } return merged; case "Identity": return value; case "MultiSelectList": if (value === null) { return null; } collected = []; for (i = 0; i < node.children.length; i++) { collected.push(this.visit(node.children[i], value)); } return collected; case "MultiSelectHash": if (value === null) { return null; } collected = {}; var child; for (i = 0; i < node.children.length; i++) { child = node.children[i]; collected[child.name] = this.visit(child.value, value); } return collected; case "OrExpression": matched = this.visit(node.children[0], value); if (isFalse(matched)) { matched = this.visit(node.children[1], value); } return matched; case "AndExpression": first = this.visit(node.children[0], value); if (isFalse(first) === true) { return first; } return this.visit(node.children[1], value); case "NotExpression": first = this.visit(node.children[0], value); return isFalse(first); case "Literal": return node.value; case TOK_PIPE: left = this.visit(node.children[0], value); return this.visit(node.children[1], left); case TOK_CURRENT: return value; case "Function": var resolvedArgs = []; for (i = 0; i < node.children.length; i++) { resolvedArgs.push(this.visit(node.children[i], value)); } return this.runtime.callFunction(node.name, resolvedArgs); case "ExpressionReference": var refNode = node.children[0]; // Tag the node with a specific attribute so the type // checker verify the type. refNode.jmespathType = TOK_EXPREF; return refNode; default: throw new Error("Unknown node type: " + node.type); } }, computeSliceParams: function(arrayLength, sliceParams) { var start = sliceParams[0]; var stop = sliceParams[1]; var step = sliceParams[2]; var computed = [null, null, null]; if (step === null) { step = 1; } else if (step === 0) { var error = new Error("Invalid slice, step cannot be 0"); error.name = "RuntimeError"; throw error; } var stepValueNegative = step < 0 ? true : false; if (start === null) { start = stepValueNegative ? arrayLength - 1 : 0; } else { start = this.capSliceRange(arrayLength, start, step); } if (stop === null) { stop = stepValueNegative ? -1 : arrayLength; } else { stop = this.capSliceRange(arrayLength, stop, step); } computed[0] = start; computed[1] = stop; computed[2] = step; return computed; }, capSliceRange: function(arrayLength, actualValue, step) { if (actualValue < 0) { actualValue += arrayLength; if (actualValue < 0) { actualValue = step < 0 ? -1 : 0; } } else if (actualValue >= arrayLength) { actualValue = step < 0 ? arrayLength - 1 : arrayLength; } return actualValue; } }; function Runtime(interpreter) { this._interpreter = interpreter; this.functionTable = { // name: [function, ] // The can be: // // { // args: [[type1, type2], [type1, type2]], // variadic: true|false // } // // Each arg in the arg list is a list of valid types // (if the function is overloaded and supports multiple // types. If the type is "any" then no type checking // occurs on the argument. Variadic is optional // and if not provided is assumed to be false. abs: {_func: this._functionAbs, _signature: [{types: [TYPE_NUMBER]}]}, avg: {_func: this._functionAvg, _signature: [{types: [TYPE_ARRAY_NUMBER]}]}, ceil: {_func: this._functionCeil, _signature: [{types: [TYPE_NUMBER]}]}, contains: { _func: this._functionContains, _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}, {types: [TYPE_ANY]}]}, "ends_with": { _func: this._functionEndsWith, _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]}, floor: {_func: this._functionFloor, _signature: [{types: [TYPE_NUMBER]}]}, length: { _func: this._functionLength, _signature: [{types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]}]}, map: { _func: this._functionMap, _signature: [{types: [TYPE_EXPREF]}, {types: [TYPE_ARRAY]}]}, max: { _func: this._functionMax, _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]}, "merge": { _func: this._functionMerge, _signature: [{types: [TYPE_OBJECT], variadic: true}] }, "max_by": { _func: this._functionMaxBy, _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] }, sum: {_func: this._functionSum, _signature: [{types: [TYPE_ARRAY_NUMBER]}]}, "starts_with": { _func: this._functionStartsWith, _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]}, min: { _func: this._functionMin, _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]}, "min_by": { _func: this._functionMinBy, _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] }, type: {_func: this._functionType, _signature: [{types: [TYPE_ANY]}]}, keys: {_func: this._functionKeys, _signature: [{types: [TYPE_OBJECT]}]}, values: {_func: this._functionValues, _signature: [{types: [TYPE_OBJECT]}]}, sort: {_func: this._functionSort, _signature: [{types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]}]}, "sort_by": { _func: this._functionSortBy, _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}] }, join: { _func: this._functionJoin, _signature: [ {types: [TYPE_STRING]}, {types: [TYPE_ARRAY_STRING]} ] }, reverse: { _func: this._functionReverse, _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}]}, "to_array": {_func: this._functionToArray, _signature: [{types: [TYPE_ANY]}]}, "to_string": {_func: this._functionToString, _signature: [{types: [TYPE_ANY]}]}, "to_number": {_func: this._functionToNumber, _signature: [{types: [TYPE_ANY]}]}, "not_null": { _func: this._functionNotNull, _signature: [{types: [TYPE_ANY], variadic: true}] } }; } Runtime.prototype = { callFunction: function(name, resolvedArgs) { var functionEntry = this.functionTable[name]; if (functionEntry === undefined) { throw new Error("Unknown function: " + name + "()"); } this._validateArgs(name, resolvedArgs, functionEntry._signature); return functionEntry._func.call(this, resolvedArgs); }, _validateArgs: function(name, args, signature) { // Validating the args requires validating // the correct arity and the correct type of each arg. // If the last argument is declared as variadic, then we need // a minimum number of args to be required. Otherwise it has to // be an exact amount. var pluralized; if (signature[signature.length - 1].variadic) { if (args.length < signature.length) { pluralized = signature.length === 1 ? " argument" : " arguments"; throw new Error("ArgumentError: " + name + "() " + "takes at least" + signature.length + pluralized + " but received " + args.length); } } else if (args.length !== signature.length) { pluralized = signature.length === 1 ? " argument" : " arguments"; throw new Error("ArgumentError: " + name + "() " + "takes " + signature.length + pluralized + " but received " + args.length); } var currentSpec; var actualType; var typeMatched; for (var i = 0; i < signature.length; i++) { typeMatched = false; currentSpec = signature[i].types; actualType = this._getTypeName(args[i]); for (var j = 0; j < currentSpec.length; j++) { if (this._typeMatches(actualType, currentSpec[j], args[i])) { typeMatched = true; break; } } if (!typeMatched) { throw new Error("TypeError: " + name + "() " + "expected argument " + (i + 1) + " to be type " + currentSpec + " but received type " + actualType + " instead."); } } }, _typeMatches: function(actual, expected, argValue) { if (expected === TYPE_ANY) { return true; } if (expected === TYPE_ARRAY_STRING || expected === TYPE_ARRAY_NUMBER || expected === TYPE_ARRAY) { // The expected type can either just be array, // or it can require a specific subtype (array of numbers). // // The simplest case is if "array" with no subtype is specified. if (expected === TYPE_ARRAY) { return actual === TYPE_ARRAY; } else if (actual === TYPE_ARRAY) { // Otherwise we need to check subtypes. // I think this has potential to be improved. var subtype; if (expected === TYPE_ARRAY_NUMBER) { subtype = TYPE_NUMBER; } else if (expected === TYPE_ARRAY_STRING) { subtype = TYPE_STRING; } for (var i = 0; i < argValue.length; i++) { if (!this._typeMatches( this._getTypeName(argValue[i]), subtype, argValue[i])) { return false; } } return true; } } else { return actual === expected; } }, _getTypeName: function(obj) { switch (Object.prototype.toString.call(obj)) { case "[object String]": return TYPE_STRING; case "[object Number]": return TYPE_NUMBER; case "[object Array]": return TYPE_ARRAY; case "[object Boolean]": return TYPE_BOOLEAN; case "[object Null]": return TYPE_NULL; case "[object Object]": // Check if it's an expref. If it has, it's been // tagged with a jmespathType attr of 'Expref'; if (obj.jmespathType === TOK_EXPREF) { return TYPE_EXPREF; } else { return TYPE_OBJECT; } } }, _functionStartsWith: function(resolvedArgs) { return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0; }, _functionEndsWith: function(resolvedArgs) { var searchStr = resolvedArgs[0]; var suffix = resolvedArgs[1]; return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1; }, _functionReverse: function(resolvedArgs) { var typeName = this._getTypeName(resolvedArgs[0]); if (typeName === TYPE_STRING) { var originalStr = resolvedArgs[0]; var reversedStr = ""; for (var i = originalStr.length - 1; i >= 0; i--) { reversedStr += originalStr[i]; } return reversedStr; } else { var reversedArray = resolvedArgs[0].slice(0); reversedArray.reverse(); return reversedArray; } }, _functionAbs: function(resolvedArgs) { return Math.abs(resolvedArgs[0]); }, _functionCeil: function(resolvedArgs) { return Math.ceil(resolvedArgs[0]); }, _functionAvg: function(resolvedArgs) { var sum = 0; var inputArray = resolvedArgs[0]; for (var i = 0; i < inputArray.length; i++) { sum += inputArray[i]; } return sum / inputArray.length; }, _functionContains: function(resolvedArgs) { return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0; }, _functionFloor: function(resolvedArgs) { return Math.floor(resolvedArgs[0]); }, _functionLength: function(resolvedArgs) { if (!isObject(resolvedArgs[0])) { return resolvedArgs[0].length; } else { // As far as I can tell, there's no way to get the length // of an object without O(n) iteration through the object. return Object.keys(resolvedArgs[0]).length; } }, _functionMap: function(resolvedArgs) { var mapped = []; var interpreter = this._interpreter; var exprefNode = resolvedArgs[0]; var elements = resolvedArgs[1]; for (var i = 0; i < elements.length; i++) { mapped.push(interpreter.visit(exprefNode, elements[i])); } return mapped; }, _functionMerge: function(resolvedArgs) { var merged = {}; for (var i = 0; i < resolvedArgs.length; i++) { var current = resolvedArgs[i]; for (var key in current) { merged[key] = current[key]; } } return merged; }, _functionMax: function(resolvedArgs) { if (resolvedArgs[0].length > 0) { var typeName = this._getTypeName(resolvedArgs[0][0]); if (typeName === TYPE_NUMBER) { return Math.max.apply(Math, resolvedArgs[0]); } else { var elements = resolvedArgs[0]; var maxElement = elements[0]; for (var i = 1; i < elements.length; i++) { if (maxElement.localeCompare(elements[i]) < 0) { maxElement = elements[i]; } } return maxElement; } } else { return null; } }, _functionMin: function(resolvedArgs) { if (resolvedArgs[0].length > 0) { var typeName = this._getTypeName(resolvedArgs[0][0]); if (typeName === TYPE_NUMBER) { return Math.min.apply(Math, resolvedArgs[0]); } else { var elements = resolvedArgs[0]; var minElement = elements[0]; for (var i = 1; i < elements.length; i++) { if (elements[i].localeCompare(minElement) < 0) { minElement = elements[i]; } } return minElement; } } else { return null; } }, _functionSum: function(resolvedArgs) { var sum = 0; var listToSum = resolvedArgs[0]; for (var i = 0; i < listToSum.length; i++) { sum += listToSum[i]; } return sum; }, _functionType: function(resolvedArgs) { switch (this._getTypeName(resolvedArgs[0])) { case TYPE_NUMBER: return "number"; case TYPE_STRING: return "string"; case TYPE_ARRAY: return "array"; case TYPE_OBJECT: return "object"; case TYPE_BOOLEAN: return "boolean"; case TYPE_EXPREF: return "expref"; case TYPE_NULL: return "null"; } }, _functionKeys: function(resolvedArgs) { return Object.keys(resolvedArgs[0]); }, _functionValues: function(resolvedArgs) { var obj = resolvedArgs[0]; var keys = Object.keys(obj); var values = []; for (var i = 0; i < keys.length; i++) { values.push(obj[keys[i]]); } return values; }, _functionJoin: function(resolvedArgs) { var joinChar = resolvedArgs[0]; var listJoin = resolvedArgs[1]; return listJoin.join(joinChar); }, _functionToArray: function(resolvedArgs) { if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) { return resolvedArgs[0]; } else { return [resolvedArgs[0]]; } }, _functionToString: function(resolvedArgs) { if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) { return resolvedArgs[0]; } else { return JSON.stringify(resolvedArgs[0]); } }, _functionToNumber: function(resolvedArgs) { var typeName = this._getTypeName(resolvedArgs[0]); var convertedValue; if (typeName === TYPE_NUMBER) { return resolvedArgs[0]; } else if (typeName === TYPE_STRING) { convertedValue = +resolvedArgs[0]; if (!isNaN(convertedValue)) { return convertedValue; } } return null; }, _functionNotNull: function(resolvedArgs) { for (var i = 0; i < resolvedArgs.length; i++) { if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) { return resolvedArgs[i]; } } return null; }, _functionSort: function(resolvedArgs) { var sortedArray = resolvedArgs[0].slice(0); sortedArray.sort(); return sortedArray; }, _functionSortBy: function(resolvedArgs) { var sortedArray = resolvedArgs[0].slice(0); if (sortedArray.length === 0) { return sortedArray; } var interpreter = this._interpreter; var exprefNode = resolvedArgs[1]; var requiredType = this._getTypeName( interpreter.visit(exprefNode, sortedArray[0])); if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) { throw new Error("TypeError"); } var that = this; // In order to get a stable sort out of an unstable // sort algorithm, we decorate/sort/undecorate (DSU) // by creating a new list of [index, element] pairs. // In the cmp function, if the evaluated elements are // equal, then the index will be used as the tiebreaker. // After the decorated list has been sorted, it will be // undecorated to extract the original elements. var decorated = []; for (var i = 0; i < sortedArray.length; i++) { decorated.push([i, sortedArray[i]]); } decorated.sort(function(a, b) { var exprA = interpreter.visit(exprefNode, a[1]); var exprB = interpreter.visit(exprefNode, b[1]); if (that._getTypeName(exprA) !== requiredType) { throw new Error( "TypeError: expected " + requiredType + ", received " + that._getTypeName(exprA)); } else if (that._getTypeName(exprB) !== requiredType) { throw new Error( "TypeError: expected " + requiredType + ", received " + that._getTypeName(exprB)); } if (exprA > exprB) { return 1; } else if (exprA < exprB) { return -1; } else { // If they're equal compare the items by their // order to maintain relative order of equal keys // (i.e. to get a stable sort). return a[0] - b[0]; } }); // Undecorate: extract out the original list elements. for (var j = 0; j < decorated.length; j++) { sortedArray[j] = decorated[j][1]; } return sortedArray; }, _functionMaxBy: function(resolvedArgs) { var exprefNode = resolvedArgs[1]; var resolvedArray = resolvedArgs[0]; var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]); var maxNumber = -Infinity; var maxRecord; var current; for (var i = 0; i < resolvedArray.length; i++) { current = keyFunction(resolvedArray[i]); if (current > maxNumber) { maxNumber = current; maxRecord = resolvedArray[i]; } } return maxRecord; }, _functionMinBy: function(resolvedArgs) { var exprefNode = resolvedArgs[1]; var resolvedArray = resolvedArgs[0]; var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]); var minNumber = Infinity; var minRecord; var current; for (var i = 0; i < resolvedArray.length; i++) { current = keyFunction(resolvedArray[i]); if (current < minNumber) { minNumber = current; minRecord = resolvedArray[i]; } } return minRecord; }, createKeyFunction: function(exprefNode, allowedTypes) { var that = this; var interpreter = this._interpreter; var keyFunc = function(x) { var current = interpreter.visit(exprefNode, x); if (allowedTypes.indexOf(that._getTypeName(current)) < 0) { var msg = "TypeError: expected one of " + allowedTypes + ", received " + that._getTypeName(current); throw new Error(msg); } return current; }; return keyFunc; } }; function compile(stream) { var parser = new Parser(); var ast = parser.parse(stream); return ast; } function tokenize(stream) { var lexer = new Lexer(); return lexer.tokenize(stream); } function search(data, expression) { var parser = new Parser(); // This needs to be improved. Both the interpreter and runtime depend on // each other. The runtime needs the interpreter to support exprefs. // There's likely a clean way to avoid the cyclic dependency. var runtime = new Runtime(); var interpreter = new TreeInterpreter(runtime); runtime._interpreter = interpreter; var node = parser.parse(expression); return interpreter.search(node, data); } exports.tokenize = tokenize; exports.compile = compile; exports.search = search; exports.strictDeepEqual = strictDeepEqual; })( false ? 0 : exports); /***/ }), /***/ 98286: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var yaml = __webpack_require__(40916); module.exports = yaml; /***/ }), /***/ 40916: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var loader = __webpack_require__(45190); var dumper = __webpack_require__(73034); function deprecated(name) { return function () { throw new Error('Function ' + name + ' is deprecated and cannot be used.'); }; } module.exports.Type = __webpack_require__(30967); module.exports.Schema = __webpack_require__(66514); module.exports.FAILSAFE_SCHEMA = __webpack_require__(66037); module.exports.JSON_SCHEMA = __webpack_require__(1571); module.exports.CORE_SCHEMA = __webpack_require__(92183); module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(48949); module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(56874); module.exports.load = loader.load; module.exports.loadAll = loader.loadAll; module.exports.safeLoad = loader.safeLoad; module.exports.safeLoadAll = loader.safeLoadAll; module.exports.dump = dumper.dump; module.exports.safeDump = dumper.safeDump; module.exports.YAMLException = __webpack_require__(65199); // Deprecated schema names from JS-YAML 2.0.x module.exports.MINIMAL_SCHEMA = __webpack_require__(66037); module.exports.SAFE_SCHEMA = __webpack_require__(48949); module.exports.DEFAULT_SCHEMA = __webpack_require__(56874); // Deprecated functions from JS-YAML 1.x.x module.exports.scan = deprecated('scan'); module.exports.parse = deprecated('parse'); module.exports.compose = deprecated('compose'); module.exports.addConstructor = deprecated('addConstructor'); /***/ }), /***/ 59136: /***/ ((module) => { "use strict"; function isNothing(subject) { return (typeof subject === 'undefined') || (subject === null); } function isObject(subject) { return (typeof subject === 'object') && (subject !== null); } function toArray(sequence) { if (Array.isArray(sequence)) return sequence; else if (isNothing(sequence)) return []; return [ sequence ]; } function extend(target, source) { var index, length, key, sourceKeys; if (source) { sourceKeys = Object.keys(source); for (index = 0, length = sourceKeys.length; index < length; index += 1) { key = sourceKeys[index]; target[key] = source[key]; } } return target; } function repeat(string, count) { var result = '', cycle; for (cycle = 0; cycle < count; cycle += 1) { result += string; } return result; } function isNegativeZero(number) { return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); } module.exports.isNothing = isNothing; module.exports.isObject = isObject; module.exports.toArray = toArray; module.exports.repeat = repeat; module.exports.isNegativeZero = isNegativeZero; module.exports.extend = extend; /***/ }), /***/ 73034: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable no-use-before-define*/ var common = __webpack_require__(59136); var YAMLException = __webpack_require__(65199); var DEFAULT_FULL_SCHEMA = __webpack_require__(56874); var DEFAULT_SAFE_SCHEMA = __webpack_require__(48949); var _toString = Object.prototype.toString; var _hasOwnProperty = Object.prototype.hasOwnProperty; var CHAR_TAB = 0x09; /* Tab */ var CHAR_LINE_FEED = 0x0A; /* LF */ var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ var CHAR_SPACE = 0x20; /* Space */ var CHAR_EXCLAMATION = 0x21; /* ! */ var CHAR_DOUBLE_QUOTE = 0x22; /* " */ var CHAR_SHARP = 0x23; /* # */ var CHAR_PERCENT = 0x25; /* % */ var CHAR_AMPERSAND = 0x26; /* & */ var CHAR_SINGLE_QUOTE = 0x27; /* ' */ var CHAR_ASTERISK = 0x2A; /* * */ var CHAR_COMMA = 0x2C; /* , */ var CHAR_MINUS = 0x2D; /* - */ var CHAR_COLON = 0x3A; /* : */ var CHAR_EQUALS = 0x3D; /* = */ var CHAR_GREATER_THAN = 0x3E; /* > */ var CHAR_QUESTION = 0x3F; /* ? */ var CHAR_COMMERCIAL_AT = 0x40; /* @ */ var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ var CHAR_GRAVE_ACCENT = 0x60; /* ` */ var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ var CHAR_VERTICAL_LINE = 0x7C; /* | */ var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ var ESCAPE_SEQUENCES = {}; ESCAPE_SEQUENCES[0x00] = '\\0'; ESCAPE_SEQUENCES[0x07] = '\\a'; ESCAPE_SEQUENCES[0x08] = '\\b'; ESCAPE_SEQUENCES[0x09] = '\\t'; ESCAPE_SEQUENCES[0x0A] = '\\n'; ESCAPE_SEQUENCES[0x0B] = '\\v'; ESCAPE_SEQUENCES[0x0C] = '\\f'; ESCAPE_SEQUENCES[0x0D] = '\\r'; ESCAPE_SEQUENCES[0x1B] = '\\e'; ESCAPE_SEQUENCES[0x22] = '\\"'; ESCAPE_SEQUENCES[0x5C] = '\\\\'; ESCAPE_SEQUENCES[0x85] = '\\N'; ESCAPE_SEQUENCES[0xA0] = '\\_'; ESCAPE_SEQUENCES[0x2028] = '\\L'; ESCAPE_SEQUENCES[0x2029] = '\\P'; var DEPRECATED_BOOLEANS_SYNTAX = [ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' ]; function compileStyleMap(schema, map) { var result, keys, index, length, tag, style, type; if (map === null) return {}; result = {}; keys = Object.keys(map); for (index = 0, length = keys.length; index < length; index += 1) { tag = keys[index]; style = String(map[tag]); if (tag.slice(0, 2) === '!!') { tag = 'tag:yaml.org,2002:' + tag.slice(2); } type = schema.compiledTypeMap['fallback'][tag]; if (type && _hasOwnProperty.call(type.styleAliases, style)) { style = type.styleAliases[style]; } result[tag] = style; } return result; } function encodeHex(character) { var string, handle, length; string = character.toString(16).toUpperCase(); if (character <= 0xFF) { handle = 'x'; length = 2; } else if (character <= 0xFFFF) { handle = 'u'; length = 4; } else if (character <= 0xFFFFFFFF) { handle = 'U'; length = 8; } else { throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); } return '\\' + handle + common.repeat('0', length - string.length) + string; } function State(options) { this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; this.indent = Math.max(1, (options['indent'] || 2)); this.noArrayIndent = options['noArrayIndent'] || false; this.skipInvalid = options['skipInvalid'] || false; this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); this.styleMap = compileStyleMap(this.schema, options['styles'] || null); this.sortKeys = options['sortKeys'] || false; this.lineWidth = options['lineWidth'] || 80; this.noRefs = options['noRefs'] || false; this.noCompatMode = options['noCompatMode'] || false; this.condenseFlow = options['condenseFlow'] || false; this.implicitTypes = this.schema.compiledImplicit; this.explicitTypes = this.schema.compiledExplicit; this.tag = null; this.result = ''; this.duplicates = []; this.usedDuplicates = null; } // Indents every line in a string. Empty lines (\n only) are not indented. function indentString(string, spaces) { var ind = common.repeat(' ', spaces), position = 0, next = -1, result = '', line, length = string.length; while (position < length) { next = string.indexOf('\n', position); if (next === -1) { line = string.slice(position); position = length; } else { line = string.slice(position, next + 1); position = next + 1; } if (line.length && line !== '\n') result += ind; result += line; } return result; } function generateNextLine(state, level) { return '\n' + common.repeat(' ', state.indent * level); } function testImplicitResolving(state, str) { var index, length, type; for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { type = state.implicitTypes[index]; if (type.resolve(str)) { return true; } } return false; } // [33] s-white ::= s-space | s-tab function isWhitespace(c) { return c === CHAR_SPACE || c === CHAR_TAB; } // Returns true if the character can be printed without escaping. // From YAML 1.2: "any allowed characters known to be non-printable // should also be escaped. [However,] This isn’t mandatory" // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. function isPrintable(c) { return (0x00020 <= c && c <= 0x00007E) || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) || (0x10000 <= c && c <= 0x10FFFF); } // [34] ns-char ::= nb-char - s-white // [27] nb-char ::= c-printable - b-char - c-byte-order-mark // [26] b-char ::= b-line-feed | b-carriage-return // [24] b-line-feed ::= #xA /* LF */ // [25] b-carriage-return ::= #xD /* CR */ // [3] c-byte-order-mark ::= #xFEFF function isNsChar(c) { return isPrintable(c) && !isWhitespace(c) // byte-order-mark && c !== 0xFEFF // b-char && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED; } // Simplified test for values allowed after the first character in plain style. function isPlainSafe(c, prev) { // Uses a subset of nb-char - c-flow-indicator - ":" - "#" // where nb-char ::= c-printable - b-char - c-byte-order-mark. return isPrintable(c) && c !== 0xFEFF // - c-flow-indicator && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET // - ":" - "#" // /* An ns-char preceding */ "#" && c !== CHAR_COLON && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); } // Simplified test for values allowed as the first character in plain style. function isPlainSafeFirst(c) { // Uses a subset of ns-char - c-indicator // where ns-char = nb-char - s-white. return isPrintable(c) && c !== 0xFEFF && !isWhitespace(c) // - s-white // - (c-indicator ::= // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE // | “%” | “@” | “`”) && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT; } // Determines whether block indentation indicator is required. function needIndentIndicator(string) { var leadingSpaceRe = /^\n* /; return leadingSpaceRe.test(string); } var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5; // Determines which scalar styles are possible and returns the preferred style. // lineWidth = -1 => no limit. // Pre-conditions: str.length > 0. // Post-conditions: // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { var i; var char, prev_char; var hasLineBreak = false; var hasFoldableLine = false; // only checked if shouldTrackWidth var shouldTrackWidth = lineWidth !== -1; var previousLineBreak = -1; // count the first line correctly var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1)); if (singleLineOnly) { // Case: no block styles. // Check for disallowed characters to rule out plain and single. for (i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (!isPrintable(char)) { return STYLE_DOUBLE; } prev_char = i > 0 ? string.charCodeAt(i - 1) : null; plain = plain && isPlainSafe(char, prev_char); } } else { // Case: block styles permitted. for (i = 0; i < string.length; i++) { char = string.charCodeAt(i); if (char === CHAR_LINE_FEED) { hasLineBreak = true; // Check if any line can be folded. if (shouldTrackWidth) { hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented. (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== ' '); previousLineBreak = i; } } else if (!isPrintable(char)) { return STYLE_DOUBLE; } prev_char = i > 0 ? string.charCodeAt(i - 1) : null; plain = plain && isPlainSafe(char, prev_char); } // in case the end is missing a \n hasFoldableLine = hasFoldableLine || (shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== ' ')); } // Although every style can represent \n without escaping, prefer block styles // for multiline, since they're more readable and they don't add empty lines. // Also prefer folding a super-long line. if (!hasLineBreak && !hasFoldableLine) { // Strings interpretable as another type have to be quoted; // e.g. the string 'true' vs. the boolean true. return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE; } // Edge case: block indentation indicator can only have one digit. if (indentPerLevel > 9 && needIndentIndicator(string)) { return STYLE_DOUBLE; } // At this point we know block styles are valid. // Prefer literal style unless we want to fold. return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; } // Note: line breaking/folding is implemented for only the folded style. // NB. We drop the last trailing newline (if any) of a returned block scalar // since the dumper adds its own newline. This always works: // • No ending newline => unaffected; already using strip "-" chomping. // • Ending newline => removed then restored. // Importantly, this keeps the "+" chomp indicator from gaining an extra line. function writeScalar(state, string, level, iskey) { state.dump = (function () { if (string.length === 0) { return "''"; } if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { return "'" + string + "'"; } var indent = state.indent * Math.max(1, level); // no 0-indent scalars // As indentation gets deeper, let the width decrease monotonically // to the lower bound min(state.lineWidth, 40). // Note that this implies // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. // state.lineWidth > 40 + state.indent: width decreases until the lower bound. // This behaves better than a constant minimum width which disallows narrower options, // or an indent threshold which causes the width to suddenly increase. var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); // Without knowing if keys are implicit/explicit, assume implicit for safety. var singleLineOnly = iskey // No block styles in flow mode. || (state.flowLevel > -1 && level >= state.flowLevel); function testAmbiguity(string) { return testImplicitResolving(state, string); } switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { case STYLE_PLAIN: return string; case STYLE_SINGLE: return "'" + string.replace(/'/g, "''") + "'"; case STYLE_LITERAL: return '|' + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent)); case STYLE_FOLDED: return '>' + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); case STYLE_DOUBLE: return '"' + escapeString(string, lineWidth) + '"'; default: throw new YAMLException('impossible error: invalid scalar style'); } }()); } // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. function blockHeader(string, indentPerLevel) { var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; // note the special case: the string '\n' counts as a "trailing" empty line. var clip = string[string.length - 1] === '\n'; var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); var chomp = keep ? '+' : (clip ? '' : '-'); return indentIndicator + chomp + '\n'; } // (See the note for writeScalar.) function dropEndingNewline(string) { return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; } // Note: a long line without a suitable break point will exceed the width limit. // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. function foldString(string, width) { // In folded style, $k$ consecutive newlines output as $k+1$ newlines— // unless they're before or after a more-indented line, or at the very // beginning or end, in which case $k$ maps to $k$. // Therefore, parse each chunk as newline(s) followed by a content line. var lineRe = /(\n+)([^\n]*)/g; // first line (possibly an empty line) var result = (function () { var nextLF = string.indexOf('\n'); nextLF = nextLF !== -1 ? nextLF : string.length; lineRe.lastIndex = nextLF; return foldLine(string.slice(0, nextLF), width); }()); // If we haven't reached the first content line yet, don't add an extra \n. var prevMoreIndented = string[0] === '\n' || string[0] === ' '; var moreIndented; // rest of the lines var match; while ((match = lineRe.exec(string))) { var prefix = match[1], line = match[2]; moreIndented = (line[0] === ' '); result += prefix + (!prevMoreIndented && !moreIndented && line !== '' ? '\n' : '') + foldLine(line, width); prevMoreIndented = moreIndented; } return result; } // Greedy line breaking. // Picks the longest line under the limit each time, // otherwise settles for the shortest line over the limit. // NB. More-indented lines *cannot* be folded, as that would add an extra \n. function foldLine(line, width) { if (line === '' || line[0] === ' ') return line; // Since a more-indented line adds a \n, breaks can't be followed by a space. var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. var match; // start is an inclusive index. end, curr, and next are exclusive. var start = 0, end, curr = 0, next = 0; var result = ''; // Invariants: 0 <= start <= length-1. // 0 <= curr <= next <= max(0, length-2). curr - start <= width. // Inside the loop: // A match implies length >= 2, so curr and next are <= length-2. while ((match = breakRe.exec(line))) { next = match.index; // maintain invariant: curr - start <= width if (next - start > width) { end = (curr > start) ? curr : next; // derive end <= length-2 result += '\n' + line.slice(start, end); // skip the space that was output as \n start = end + 1; // derive start <= length-1 } curr = next; } // By the invariants, start <= length-1, so there is something left over. // It is either the whole string or a part starting from non-whitespace. result += '\n'; // Insert a break if the remainder is too long and there is a break available. if (line.length - start > width && curr > start) { result += line.slice(start, curr) + '\n' + line.slice(curr + 1); } else { result += line.slice(start); } return result.slice(1); // drop extra \n joiner } // Escapes a double-quoted string. function escapeString(string) { var result = ''; var char, nextChar; var escapeSeq; for (var i = 0; i < string.length; i++) { char = string.charCodeAt(i); // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { nextChar = string.charCodeAt(i + 1); if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { // Combine the surrogate pair and store it escaped. result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); // Advance index one extra since we already used that char here. i++; continue; } } escapeSeq = ESCAPE_SEQUENCES[char]; result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char); } return result; } function writeFlowSequence(state, level, object) { var _result = '', _tag = state.tag, index, length; for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level, object[index], false, false)) { if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); _result += state.dump; } } state.tag = _tag; state.dump = '[' + _result + ']'; } function writeBlockSequence(state, level, object, compact) { var _result = '', _tag = state.tag, index, length; for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level + 1, object[index], true, true)) { if (!compact || index !== 0) { _result += generateNextLine(state, level); } if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { _result += '-'; } else { _result += '- '; } _result += state.dump; } } state.tag = _tag; state.dump = _result || '[]'; // Empty sequence if no valid values. } function writeFlowMapping(state, level, object) { var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer; for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; if (index !== 0) pairBuffer += ', '; if (state.condenseFlow) pairBuffer += '"'; objectKey = objectKeyList[index]; objectValue = object[objectKey]; if (!writeNode(state, level, objectKey, false, false)) { continue; // Skip this pair because of invalid key; } if (state.dump.length > 1024) pairBuffer += '? '; pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); if (!writeNode(state, level, objectValue, false, false)) { continue; // Skip this pair because of invalid value. } pairBuffer += state.dump; // Both key and value are valid. _result += pairBuffer; } state.tag = _tag; state.dump = '{' + _result + '}'; } function writeBlockMapping(state, level, object, compact) { var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer; // Allow sorting keys so that the output file is deterministic if (state.sortKeys === true) { // Default sorting objectKeyList.sort(); } else if (typeof state.sortKeys === 'function') { // Custom sort function objectKeyList.sort(state.sortKeys); } else if (state.sortKeys) { // Something is wrong throw new YAMLException('sortKeys must be a boolean or a function'); } for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; if (!compact || index !== 0) { pairBuffer += generateNextLine(state, level); } objectKey = objectKeyList[index]; objectValue = object[objectKey]; if (!writeNode(state, level + 1, objectKey, true, true, true)) { continue; // Skip this pair because of invalid key. } explicitPair = (state.tag !== null && state.tag !== '?') || (state.dump && state.dump.length > 1024); if (explicitPair) { if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { pairBuffer += '?'; } else { pairBuffer += '? '; } } pairBuffer += state.dump; if (explicitPair) { pairBuffer += generateNextLine(state, level); } if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { continue; // Skip this pair because of invalid value. } if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { pairBuffer += ':'; } else { pairBuffer += ': '; } pairBuffer += state.dump; // Both key and value are valid. _result += pairBuffer; } state.tag = _tag; state.dump = _result || '{}'; // Empty mapping if no valid pairs. } function detectType(state, object, explicit) { var _result, typeList, index, length, type, style; typeList = explicit ? state.explicitTypes : state.implicitTypes; for (index = 0, length = typeList.length; index < length; index += 1) { type = typeList[index]; if ((type.instanceOf || type.predicate) && (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && (!type.predicate || type.predicate(object))) { state.tag = explicit ? type.tag : '?'; if (type.represent) { style = state.styleMap[type.tag] || type.defaultStyle; if (_toString.call(type.represent) === '[object Function]') { _result = type.represent(object, style); } else if (_hasOwnProperty.call(type.represent, style)) { _result = type.represent[style](object, style); } else { throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); } state.dump = _result; } return true; } } return false; } // Serializes `object` and writes it to global `result`. // Returns true on success, or false on invalid object. // function writeNode(state, level, object, block, compact, iskey) { state.tag = null; state.dump = object; if (!detectType(state, object, false)) { detectType(state, object, true); } var type = _toString.call(state.dump); if (block) { block = (state.flowLevel < 0 || state.flowLevel > level); } var objectOrArray = type === '[object Object]' || type === '[object Array]', duplicateIndex, duplicate; if (objectOrArray) { duplicateIndex = state.duplicates.indexOf(object); duplicate = duplicateIndex !== -1; } if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { compact = false; } if (duplicate && state.usedDuplicates[duplicateIndex]) { state.dump = '*ref_' + duplicateIndex; } else { if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { state.usedDuplicates[duplicateIndex] = true; } if (type === '[object Object]') { if (block && (Object.keys(state.dump).length !== 0)) { writeBlockMapping(state, level, state.dump, compact); if (duplicate) { state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowMapping(state, level, state.dump); if (duplicate) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } } else if (type === '[object Array]') { var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; if (block && (state.dump.length !== 0)) { writeBlockSequence(state, arrayLevel, state.dump, compact); if (duplicate) { state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowSequence(state, arrayLevel, state.dump); if (duplicate) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } } else if (type === '[object String]') { if (state.tag !== '?') { writeScalar(state, state.dump, level, iskey); } } else { if (state.skipInvalid) return false; throw new YAMLException('unacceptable kind of an object to dump ' + type); } if (state.tag !== null && state.tag !== '?') { state.dump = '!<' + state.tag + '> ' + state.dump; } } return true; } function getDuplicateReferences(object, state) { var objects = [], duplicatesIndexes = [], index, length; inspectNode(object, objects, duplicatesIndexes); for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { state.duplicates.push(objects[duplicatesIndexes[index]]); } state.usedDuplicates = new Array(length); } function inspectNode(object, objects, duplicatesIndexes) { var objectKeyList, index, length; if (object !== null && typeof object === 'object') { index = objects.indexOf(object); if (index !== -1) { if (duplicatesIndexes.indexOf(index) === -1) { duplicatesIndexes.push(index); } } else { objects.push(object); if (Array.isArray(object)) { for (index = 0, length = object.length; index < length; index += 1) { inspectNode(object[index], objects, duplicatesIndexes); } } else { objectKeyList = Object.keys(object); for (index = 0, length = objectKeyList.length; index < length; index += 1) { inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); } } } } } function dump(input, options) { options = options || {}; var state = new State(options); if (!state.noRefs) getDuplicateReferences(input, state); if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; return ''; } function safeDump(input, options) { return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } module.exports.dump = dump; module.exports.safeDump = safeDump; /***/ }), /***/ 65199: /***/ ((module) => { "use strict"; // YAML error class. http://stackoverflow.com/questions/8458984 // function YAMLException(reason, mark) { // Super constructor Error.call(this); this.name = 'YAMLException'; this.reason = reason; this.mark = mark; this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); // Include stack trace in error object if (Error.captureStackTrace) { // Chrome and NodeJS Error.captureStackTrace(this, this.constructor); } else { // FF, IE 10+ and Safari 6+. Fallback for others this.stack = (new Error()).stack || ''; } } // Inherit from Error YAMLException.prototype = Object.create(Error.prototype); YAMLException.prototype.constructor = YAMLException; YAMLException.prototype.toString = function toString(compact) { var result = this.name + ': '; result += this.reason || '(unknown reason)'; if (!compact && this.mark) { result += ' ' + this.mark.toString(); } return result; }; module.exports = YAMLException; /***/ }), /***/ 45190: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable max-len,no-use-before-define*/ var common = __webpack_require__(59136); var YAMLException = __webpack_require__(65199); var Mark = __webpack_require__(55426); var DEFAULT_SAFE_SCHEMA = __webpack_require__(48949); var DEFAULT_FULL_SCHEMA = __webpack_require__(56874); var _hasOwnProperty = Object.prototype.hasOwnProperty; var CONTEXT_FLOW_IN = 1; var CONTEXT_FLOW_OUT = 2; var CONTEXT_BLOCK_IN = 3; var CONTEXT_BLOCK_OUT = 4; var CHOMPING_CLIP = 1; var CHOMPING_STRIP = 2; var CHOMPING_KEEP = 3; var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; function _class(obj) { return Object.prototype.toString.call(obj); } function is_EOL(c) { return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); } function is_WHITE_SPACE(c) { return (c === 0x09/* Tab */) || (c === 0x20/* Space */); } function is_WS_OR_EOL(c) { return (c === 0x09/* Tab */) || (c === 0x20/* Space */) || (c === 0x0A/* LF */) || (c === 0x0D/* CR */); } function is_FLOW_INDICATOR(c) { return c === 0x2C/* , */ || c === 0x5B/* [ */ || c === 0x5D/* ] */ || c === 0x7B/* { */ || c === 0x7D/* } */; } function fromHexCode(c) { var lc; if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { return c - 0x30; } /*eslint-disable no-bitwise*/ lc = c | 0x20; if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { return lc - 0x61 + 10; } return -1; } function escapedHexLen(c) { if (c === 0x78/* x */) { return 2; } if (c === 0x75/* u */) { return 4; } if (c === 0x55/* U */) { return 8; } return 0; } function fromDecimalCode(c) { if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { return c - 0x30; } return -1; } function simpleEscapeSequence(c) { /* eslint-disable indent */ return (c === 0x30/* 0 */) ? '\x00' : (c === 0x61/* a */) ? '\x07' : (c === 0x62/* b */) ? '\x08' : (c === 0x74/* t */) ? '\x09' : (c === 0x09/* Tab */) ? '\x09' : (c === 0x6E/* n */) ? '\x0A' : (c === 0x76/* v */) ? '\x0B' : (c === 0x66/* f */) ? '\x0C' : (c === 0x72/* r */) ? '\x0D' : (c === 0x65/* e */) ? '\x1B' : (c === 0x20/* Space */) ? ' ' : (c === 0x22/* " */) ? '\x22' : (c === 0x2F/* / */) ? '/' : (c === 0x5C/* \ */) ? '\x5C' : (c === 0x4E/* N */) ? '\x85' : (c === 0x5F/* _ */) ? '\xA0' : (c === 0x4C/* L */) ? '\u2028' : (c === 0x50/* P */) ? '\u2029' : ''; } function charFromCodepoint(c) { if (c <= 0xFFFF) { return String.fromCharCode(c); } // Encode UTF-16 surrogate pair // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF return String.fromCharCode( ((c - 0x010000) >> 10) + 0xD800, ((c - 0x010000) & 0x03FF) + 0xDC00 ); } var simpleEscapeCheck = new Array(256); // integer, for fast access var simpleEscapeMap = new Array(256); for (var i = 0; i < 256; i++) { simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; simpleEscapeMap[i] = simpleEscapeSequence(i); } function State(input, options) { this.input = input; this.filename = options['filename'] || null; this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; this.onWarning = options['onWarning'] || null; this.legacy = options['legacy'] || false; this.json = options['json'] || false; this.listener = options['listener'] || null; this.implicitTypes = this.schema.compiledImplicit; this.typeMap = this.schema.compiledTypeMap; this.length = input.length; this.position = 0; this.line = 0; this.lineStart = 0; this.lineIndent = 0; this.documents = []; /* this.version; this.checkLineBreaks; this.tagMap; this.anchorMap; this.tag; this.anchor; this.kind; this.result;*/ } function generateError(state, message) { return new YAMLException( message, new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); } function throwError(state, message) { throw generateError(state, message); } function throwWarning(state, message) { if (state.onWarning) { state.onWarning.call(null, generateError(state, message)); } } var directiveHandlers = { YAML: function handleYamlDirective(state, name, args) { var match, major, minor; if (state.version !== null) { throwError(state, 'duplication of %YAML directive'); } if (args.length !== 1) { throwError(state, 'YAML directive accepts exactly one argument'); } match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); if (match === null) { throwError(state, 'ill-formed argument of the YAML directive'); } major = parseInt(match[1], 10); minor = parseInt(match[2], 10); if (major !== 1) { throwError(state, 'unacceptable YAML version of the document'); } state.version = args[0]; state.checkLineBreaks = (minor < 2); if (minor !== 1 && minor !== 2) { throwWarning(state, 'unsupported YAML version of the document'); } }, TAG: function handleTagDirective(state, name, args) { var handle, prefix; if (args.length !== 2) { throwError(state, 'TAG directive accepts exactly two arguments'); } handle = args[0]; prefix = args[1]; if (!PATTERN_TAG_HANDLE.test(handle)) { throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); } if (_hasOwnProperty.call(state.tagMap, handle)) { throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); } if (!PATTERN_TAG_URI.test(prefix)) { throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); } state.tagMap[handle] = prefix; } }; function captureSegment(state, start, end, checkJson) { var _position, _length, _character, _result; if (start < end) { _result = state.input.slice(start, end); if (checkJson) { for (_position = 0, _length = _result.length; _position < _length; _position += 1) { _character = _result.charCodeAt(_position); if (!(_character === 0x09 || (0x20 <= _character && _character <= 0x10FFFF))) { throwError(state, 'expected valid JSON character'); } } } else if (PATTERN_NON_PRINTABLE.test(_result)) { throwError(state, 'the stream contains non-printable characters'); } state.result += _result; } } function mergeMappings(state, destination, source, overridableKeys) { var sourceKeys, key, index, quantity; if (!common.isObject(source)) { throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); } sourceKeys = Object.keys(source); for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty.call(destination, key)) { destination[key] = source[key]; overridableKeys[key] = true; } } } function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { var index, quantity; // The output is a plain object here, so keys can only be strings. // We need to convert keyNode to a string, but doing so can hang the process // (deeply nested arrays that explode exponentially using aliases). if (Array.isArray(keyNode)) { keyNode = Array.prototype.slice.call(keyNode); for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { if (Array.isArray(keyNode[index])) { throwError(state, 'nested arrays are not supported inside keys'); } if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { keyNode[index] = '[object Object]'; } } } // Avoid code execution in load() via toString property // (still use its own toString for arrays, timestamps, // and whatever user schema extensions happen to have @@toStringTag) if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { keyNode = '[object Object]'; } keyNode = String(keyNode); if (_result === null) { _result = {}; } if (keyTag === 'tag:yaml.org,2002:merge') { if (Array.isArray(valueNode)) { for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { mergeMappings(state, _result, valueNode[index], overridableKeys); } } else { mergeMappings(state, _result, valueNode, overridableKeys); } } else { if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) { state.line = startLine || state.line; state.position = startPos || state.position; throwError(state, 'duplicated mapping key'); } _result[keyNode] = valueNode; delete overridableKeys[keyNode]; } return _result; } function readLineBreak(state) { var ch; ch = state.input.charCodeAt(state.position); if (ch === 0x0A/* LF */) { state.position++; } else if (ch === 0x0D/* CR */) { state.position++; if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { state.position++; } } else { throwError(state, 'a line break is expected'); } state.line += 1; state.lineStart = state.position; } function skipSeparationSpace(state, allowComments, checkIndent) { var lineBreaks = 0, ch = state.input.charCodeAt(state.position); while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (allowComments && ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); } if (is_EOL(ch)) { readLineBreak(state); ch = state.input.charCodeAt(state.position); lineBreaks++; state.lineIndent = 0; while (ch === 0x20/* Space */) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } } else { break; } } if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { throwWarning(state, 'deficient indentation'); } return lineBreaks; } function testDocumentSeparator(state) { var _position = state.position, ch; ch = state.input.charCodeAt(_position); // Condition state.position === state.lineStart is tested // in parent on each call, for efficiency. No needs to test here again. if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { _position += 3; ch = state.input.charCodeAt(_position); if (ch === 0 || is_WS_OR_EOL(ch)) { return true; } } return false; } function writeFoldedLines(state, count) { if (count === 1) { state.result += ' '; } else if (count > 1) { state.result += common.repeat('\n', count - 1); } } function readPlainScalar(state, nodeIndent, withinFlowCollection) { var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; ch = state.input.charCodeAt(state.position); if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 0x23/* # */ || ch === 0x26/* & */ || ch === 0x2A/* * */ || ch === 0x21/* ! */ || ch === 0x7C/* | */ || ch === 0x3E/* > */ || ch === 0x27/* ' */ || ch === 0x22/* " */ || ch === 0x25/* % */ || ch === 0x40/* @ */ || ch === 0x60/* ` */) { return false; } if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { return false; } } state.kind = 'scalar'; state.result = ''; captureStart = captureEnd = state.position; hasPendingContent = false; while (ch !== 0) { if (ch === 0x3A/* : */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { break; } } else if (ch === 0x23/* # */) { preceding = state.input.charCodeAt(state.position - 1); if (is_WS_OR_EOL(preceding)) { break; } } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { break; } else if (is_EOL(ch)) { _line = state.line; _lineStart = state.lineStart; _lineIndent = state.lineIndent; skipSeparationSpace(state, false, -1); if (state.lineIndent >= nodeIndent) { hasPendingContent = true; ch = state.input.charCodeAt(state.position); continue; } else { state.position = captureEnd; state.line = _line; state.lineStart = _lineStart; state.lineIndent = _lineIndent; break; } } if (hasPendingContent) { captureSegment(state, captureStart, captureEnd, false); writeFoldedLines(state, state.line - _line); captureStart = captureEnd = state.position; hasPendingContent = false; } if (!is_WHITE_SPACE(ch)) { captureEnd = state.position + 1; } ch = state.input.charCodeAt(++state.position); } captureSegment(state, captureStart, captureEnd, false); if (state.result) { return true; } state.kind = _kind; state.result = _result; return false; } function readSingleQuotedScalar(state, nodeIndent) { var ch, captureStart, captureEnd; ch = state.input.charCodeAt(state.position); if (ch !== 0x27/* ' */) { return false; } state.kind = 'scalar'; state.result = ''; state.position++; captureStart = captureEnd = state.position; while ((ch = state.input.charCodeAt(state.position)) !== 0) { if (ch === 0x27/* ' */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); if (ch === 0x27/* ' */) { captureStart = state.position; state.position++; captureEnd = state.position; } else { return true; } } else if (is_EOL(ch)) { captureSegment(state, captureStart, captureEnd, true); writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); captureStart = captureEnd = state.position; } else if (state.position === state.lineStart && testDocumentSeparator(state)) { throwError(state, 'unexpected end of the document within a single quoted scalar'); } else { state.position++; captureEnd = state.position; } } throwError(state, 'unexpected end of the stream within a single quoted scalar'); } function readDoubleQuotedScalar(state, nodeIndent) { var captureStart, captureEnd, hexLength, hexResult, tmp, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x22/* " */) { return false; } state.kind = 'scalar'; state.result = ''; state.position++; captureStart = captureEnd = state.position; while ((ch = state.input.charCodeAt(state.position)) !== 0) { if (ch === 0x22/* " */) { captureSegment(state, captureStart, state.position, true); state.position++; return true; } else if (ch === 0x5C/* \ */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); if (is_EOL(ch)) { skipSeparationSpace(state, false, nodeIndent); // TODO: rework to inline fn with no type cast? } else if (ch < 256 && simpleEscapeCheck[ch]) { state.result += simpleEscapeMap[ch]; state.position++; } else if ((tmp = escapedHexLen(ch)) > 0) { hexLength = tmp; hexResult = 0; for (; hexLength > 0; hexLength--) { ch = state.input.charCodeAt(++state.position); if ((tmp = fromHexCode(ch)) >= 0) { hexResult = (hexResult << 4) + tmp; } else { throwError(state, 'expected hexadecimal character'); } } state.result += charFromCodepoint(hexResult); state.position++; } else { throwError(state, 'unknown escape sequence'); } captureStart = captureEnd = state.position; } else if (is_EOL(ch)) { captureSegment(state, captureStart, captureEnd, true); writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); captureStart = captureEnd = state.position; } else if (state.position === state.lineStart && testDocumentSeparator(state)) { throwError(state, 'unexpected end of the document within a double quoted scalar'); } else { state.position++; captureEnd = state.position; } } throwError(state, 'unexpected end of the stream within a double quoted scalar'); } function readFlowCollection(state, nodeIndent) { var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch; ch = state.input.charCodeAt(state.position); if (ch === 0x5B/* [ */) { terminator = 0x5D;/* ] */ isMapping = false; _result = []; } else if (ch === 0x7B/* { */) { terminator = 0x7D;/* } */ isMapping = true; _result = {}; } else { return false; } if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(++state.position); while (ch !== 0) { skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if (ch === terminator) { state.position++; state.tag = _tag; state.anchor = _anchor; state.kind = isMapping ? 'mapping' : 'sequence'; state.result = _result; return true; } else if (!readNext) { throwError(state, 'missed comma between flow collection entries'); } keyTag = keyNode = valueNode = null; isPair = isExplicitPair = false; if (ch === 0x3F/* ? */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following)) { isPair = isExplicitPair = true; state.position++; skipSeparationSpace(state, true, nodeIndent); } } _line = state.line; composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); keyTag = state.tag; keyNode = state.result; skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { isPair = true; ch = state.input.charCodeAt(++state.position); skipSeparationSpace(state, true, nodeIndent); composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); valueNode = state.result; } if (isMapping) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); } else if (isPair) { _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); } else { _result.push(keyNode); } skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); if (ch === 0x2C/* , */) { readNext = true; ch = state.input.charCodeAt(++state.position); } else { readNext = false; } } throwError(state, 'unexpected end of the stream within a flow collection'); } function readBlockScalar(state, nodeIndent) { var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; ch = state.input.charCodeAt(state.position); if (ch === 0x7C/* | */) { folding = false; } else if (ch === 0x3E/* > */) { folding = true; } else { return false; } state.kind = 'scalar'; state.result = ''; while (ch !== 0) { ch = state.input.charCodeAt(++state.position); if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { if (CHOMPING_CLIP === chomping) { chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; } else { throwError(state, 'repeat of a chomping mode identifier'); } } else if ((tmp = fromDecimalCode(ch)) >= 0) { if (tmp === 0) { throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); } else if (!detectedIndent) { textIndent = nodeIndent + tmp - 1; detectedIndent = true; } else { throwError(state, 'repeat of an indentation width identifier'); } } else { break; } } if (is_WHITE_SPACE(ch)) { do { ch = state.input.charCodeAt(++state.position); } while (is_WHITE_SPACE(ch)); if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (!is_EOL(ch) && (ch !== 0)); } } while (ch !== 0) { readLineBreak(state); state.lineIndent = 0; ch = state.input.charCodeAt(state.position); while ((!detectedIndent || state.lineIndent < textIndent) && (ch === 0x20/* Space */)) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } if (!detectedIndent && state.lineIndent > textIndent) { textIndent = state.lineIndent; } if (is_EOL(ch)) { emptyLines++; continue; } // End of the scalar. if (state.lineIndent < textIndent) { // Perform the chomping. if (chomping === CHOMPING_KEEP) { state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } else if (chomping === CHOMPING_CLIP) { if (didReadContent) { // i.e. only if the scalar is not empty. state.result += '\n'; } } // Break this `while` cycle and go to the funciton's epilogue. break; } // Folded style: use fancy rules to handle line breaks. if (folding) { // Lines starting with white space characters (more-indented lines) are not folded. if (is_WHITE_SPACE(ch)) { atMoreIndented = true; // except for the first content line (cf. Example 8.1) state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); // End of more-indented block. } else if (atMoreIndented) { atMoreIndented = false; state.result += common.repeat('\n', emptyLines + 1); // Just one line break - perceive as the same line. } else if (emptyLines === 0) { if (didReadContent) { // i.e. only if we have already read some scalar content. state.result += ' '; } // Several line breaks - perceive as different lines. } else { state.result += common.repeat('\n', emptyLines); } // Literal style: just add exact number of line breaks between content lines. } else { // Keep all line breaks except the header line break. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); } didReadContent = true; detectedIndent = true; emptyLines = 0; captureStart = state.position; while (!is_EOL(ch) && (ch !== 0)) { ch = state.input.charCodeAt(++state.position); } captureSegment(state, captureStart, state.position, false); } return true; } function readBlockSequence(state, nodeIndent) { var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); while (ch !== 0) { if (ch !== 0x2D/* - */) { break; } following = state.input.charCodeAt(state.position + 1); if (!is_WS_OR_EOL(following)) { break; } detected = true; state.position++; if (skipSeparationSpace(state, true, -1)) { if (state.lineIndent <= nodeIndent) { _result.push(null); ch = state.input.charCodeAt(state.position); continue; } } _line = state.line; composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); _result.push(state.result); skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { throwError(state, 'bad indentation of a sequence entry'); } else if (state.lineIndent < nodeIndent) { break; } } if (detected) { state.tag = _tag; state.anchor = _anchor; state.kind = 'sequence'; state.result = _result; return true; } return false; } function readBlockMapping(state, nodeIndent, flowIndent) { var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); while (ch !== 0) { following = state.input.charCodeAt(state.position + 1); _line = state.line; // Save the current line. _pos = state.position; // // Explicit notation case. There are two separate blocks: // first for the key (denoted by "?") and second for the value (denoted by ":") // if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { if (ch === 0x3F/* ? */) { if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = true; allowCompact = true; } else if (atExplicitKey) { // i.e. 0x3A/* : */ === character after the explicit key. atExplicitKey = false; allowCompact = true; } else { throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); } state.position += 1; ch = following; // // Implicit notation case. Flow-style node as the key first, then ":", and the value. // } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { if (state.line === _line) { ch = state.input.charCodeAt(state.position); while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (ch === 0x3A/* : */) { ch = state.input.charCodeAt(++state.position); if (!is_WS_OR_EOL(ch)) { throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); } if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = false; allowCompact = false; keyTag = state.tag; keyNode = state.result; } else if (detected) { throwError(state, 'can not read an implicit mapping pair; a colon is missed'); } else { state.tag = _tag; state.anchor = _anchor; return true; // Keep the result of `composeNode`. } } else if (detected) { throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); } else { state.tag = _tag; state.anchor = _anchor; return true; // Keep the result of `composeNode`. } } else { break; // Reading is done. Go to the epilogue. } // // Common reading code for both explicit and implicit notations. // if (state.line === _line || state.lineIndent > nodeIndent) { if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { if (atExplicitKey) { keyNode = state.result; } else { valueNode = state.result; } } if (!atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); keyTag = keyNode = valueNode = null; } skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); } if (state.lineIndent > nodeIndent && (ch !== 0)) { throwError(state, 'bad indentation of a mapping entry'); } else if (state.lineIndent < nodeIndent) { break; } } // // Epilogue. // // Special case: last mapping's node contains only the key in explicit notation. if (atExplicitKey) { storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); } // Expose the resulting mapping. if (detected) { state.tag = _tag; state.anchor = _anchor; state.kind = 'mapping'; state.result = _result; } return detected; } function readTagProperty(state) { var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x21/* ! */) return false; if (state.tag !== null) { throwError(state, 'duplication of a tag property'); } ch = state.input.charCodeAt(++state.position); if (ch === 0x3C/* < */) { isVerbatim = true; ch = state.input.charCodeAt(++state.position); } else if (ch === 0x21/* ! */) { isNamed = true; tagHandle = '!!'; ch = state.input.charCodeAt(++state.position); } else { tagHandle = '!'; } _position = state.position; if (isVerbatim) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0 && ch !== 0x3E/* > */); if (state.position < state.length) { tagName = state.input.slice(_position, state.position); ch = state.input.charCodeAt(++state.position); } else { throwError(state, 'unexpected end of the stream within a verbatim tag'); } } else { while (ch !== 0 && !is_WS_OR_EOL(ch)) { if (ch === 0x21/* ! */) { if (!isNamed) { tagHandle = state.input.slice(_position - 1, state.position + 1); if (!PATTERN_TAG_HANDLE.test(tagHandle)) { throwError(state, 'named tag handle cannot contain such characters'); } isNamed = true; _position = state.position + 1; } else { throwError(state, 'tag suffix cannot contain exclamation marks'); } } ch = state.input.charCodeAt(++state.position); } tagName = state.input.slice(_position, state.position); if (PATTERN_FLOW_INDICATORS.test(tagName)) { throwError(state, 'tag suffix cannot contain flow indicator characters'); } } if (tagName && !PATTERN_TAG_URI.test(tagName)) { throwError(state, 'tag name cannot contain such characters: ' + tagName); } if (isVerbatim) { state.tag = tagName; } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { state.tag = state.tagMap[tagHandle] + tagName; } else if (tagHandle === '!') { state.tag = '!' + tagName; } else if (tagHandle === '!!') { state.tag = 'tag:yaml.org,2002:' + tagName; } else { throwError(state, 'undeclared tag handle "' + tagHandle + '"'); } return true; } function readAnchorProperty(state) { var _position, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x26/* & */) return false; if (state.anchor !== null) { throwError(state, 'duplication of an anchor property'); } ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } if (state.position === _position) { throwError(state, 'name of an anchor node must contain at least one character'); } state.anchor = state.input.slice(_position, state.position); return true; } function readAlias(state) { var _position, alias, ch; ch = state.input.charCodeAt(state.position); if (ch !== 0x2A/* * */) return false; ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } if (state.position === _position) { throwError(state, 'name of an alias node must contain at least one character'); } alias = state.input.slice(_position, state.position); if (!_hasOwnProperty.call(state.anchorMap, alias)) { throwError(state, 'unidentified alias "' + alias + '"'); } state.result = state.anchorMap[alias]; skipSeparationSpace(state, true, -1); return true; } function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { indentStatus = 1; } else if (state.lineIndent === parentIndent) { indentStatus = 0; } else if (state.lineIndent < parentIndent) { indentStatus = -1; } } } if (indentStatus === 1) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; allowBlockCollections = allowBlockStyles; if (state.lineIndent > parentIndent) { indentStatus = 1; } else if (state.lineIndent === parentIndent) { indentStatus = 0; } else if (state.lineIndent < parentIndent) { indentStatus = -1; } } else { allowBlockCollections = false; } } } if (allowBlockCollections) { allowBlockCollections = atNewLine || allowCompact; } if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { flowIndent = parentIndent + 1; } blockIndent = state.position - state.lineStart; if (indentStatus === 1) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) { hasContent = true; } else { if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) { hasContent = true; } else if (readAlias(state)) { hasContent = true; if (state.tag !== null || state.anchor !== null) { throwError(state, 'alias node should not have any properties'); } } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { hasContent = true; if (state.tag === null) { state.tag = '?'; } } if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else if (indentStatus === 0) { // Special case: block sequences are allowed to have same indentation level as the parent. // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } if (state.tag !== null && state.tag !== '!') { if (state.tag === '?') { // Implicit resolving is not allowed for non-scalar types, and '?' // non-specific tag is only automatically assigned to plain scalars. // // We only need to check kind conformity in case user explicitly assigns '?' // tag, for example like this: "! [0]" // if (state.result !== null && state.kind !== 'scalar') { throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); } for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { type = state.implicitTypes[typeIndex]; if (type.resolve(state.result)) { // `state.result` updated in resolver if matched state.result = type.construct(state.result); state.tag = type.tag; if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } break; } } } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { type = state.typeMap[state.kind || 'fallback'][state.tag]; if (state.result !== null && type.kind !== state.kind) { throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); } if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); } else { state.result = type.construct(state.result); if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else { throwError(state, 'unknown tag !<' + state.tag + '>'); } } if (state.listener !== null) { state.listener('close', state); } return state.tag !== null || state.anchor !== null || hasContent; } function readDocument(state) { var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; state.version = null; state.checkLineBreaks = state.legacy; state.tagMap = {}; state.anchorMap = {}; while ((ch = state.input.charCodeAt(state.position)) !== 0) { skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); if (state.lineIndent > 0 || ch !== 0x25/* % */) { break; } hasDirectives = true; ch = state.input.charCodeAt(++state.position); _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveName = state.input.slice(_position, state.position); directiveArgs = []; if (directiveName.length < 1) { throwError(state, 'directive name must not be less than one character in length'); } while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } while (ch !== 0 && !is_EOL(ch)); break; } if (is_EOL(ch)) break; _position = state.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveArgs.push(state.input.slice(_position, state.position)); } if (ch !== 0) readLineBreak(state); if (_hasOwnProperty.call(directiveHandlers, directiveName)) { directiveHandlers[directiveName](state, directiveName, directiveArgs); } else { throwWarning(state, 'unknown document directive "' + directiveName + '"'); } } skipSeparationSpace(state, true, -1); if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 0x2D/* - */ && state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { state.position += 3; skipSeparationSpace(state, true, -1); } else if (hasDirectives) { throwError(state, 'directives end mark is expected'); } composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); skipSeparationSpace(state, true, -1); if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { throwWarning(state, 'non-ASCII line breaks are interpreted as content'); } state.documents.push(state.result); if (state.position === state.lineStart && testDocumentSeparator(state)) { if (state.input.charCodeAt(state.position) === 0x2E/* . */) { state.position += 3; skipSeparationSpace(state, true, -1); } return; } if (state.position < (state.length - 1)) { throwError(state, 'end of the stream or a document separator is expected'); } else { return; } } function loadDocuments(input, options) { input = String(input); options = options || {}; if (input.length !== 0) { // Add tailing `\n` if not exists if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { input += '\n'; } // Strip BOM if (input.charCodeAt(0) === 0xFEFF) { input = input.slice(1); } } var state = new State(input, options); var nullpos = input.indexOf('\0'); if (nullpos !== -1) { state.position = nullpos; throwError(state, 'null byte is not allowed in input'); } // Use 0 as string terminator. That significantly simplifies bounds check. state.input += '\0'; while (state.input.charCodeAt(state.position) === 0x20/* Space */) { state.lineIndent += 1; state.position += 1; } while (state.position < (state.length - 1)) { readDocument(state); } return state.documents; } function loadAll(input, iterator, options) { if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { options = iterator; iterator = null; } var documents = loadDocuments(input, options); if (typeof iterator !== 'function') { return documents; } for (var index = 0, length = documents.length; index < length; index += 1) { iterator(documents[index]); } } function load(input, options) { var documents = loadDocuments(input, options); if (documents.length === 0) { /*eslint-disable no-undefined*/ return undefined; } else if (documents.length === 1) { return documents[0]; } throw new YAMLException('expected a single document in the stream, but found more'); } function safeLoadAll(input, iterator, options) { if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { options = iterator; iterator = null; } return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } function safeLoad(input, options) { return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); } module.exports.loadAll = loadAll; module.exports.load = load; module.exports.safeLoadAll = safeLoadAll; module.exports.safeLoad = safeLoad; /***/ }), /***/ 55426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(59136); function Mark(name, buffer, position, line, column) { this.name = name; this.buffer = buffer; this.position = position; this.line = line; this.column = column; } Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { var head, start, tail, end, snippet; if (!this.buffer) return null; indent = indent || 4; maxLength = maxLength || 75; head = ''; start = this.position; while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { start -= 1; if (this.position - start > (maxLength / 2 - 1)) { head = ' ... '; start += 5; break; } } tail = ''; end = this.position; while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { end += 1; if (end - this.position > (maxLength / 2 - 1)) { tail = ' ... '; end -= 5; break; } } snippet = this.buffer.slice(start, end); return common.repeat(' ', indent) + head + snippet + tail + '\n' + common.repeat(' ', indent + this.position - start + head.length) + '^'; }; Mark.prototype.toString = function toString(compact) { var snippet, where = ''; if (this.name) { where += 'in "' + this.name + '" '; } where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); if (!compact) { snippet = this.getSnippet(); if (snippet) { where += ':\n' + snippet; } } return where; }; module.exports = Mark; /***/ }), /***/ 66514: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable max-len*/ var common = __webpack_require__(59136); var YAMLException = __webpack_require__(65199); var Type = __webpack_require__(30967); function compileList(schema, name, result) { var exclude = []; schema.include.forEach(function (includedSchema) { result = compileList(includedSchema, name, result); }); schema[name].forEach(function (currentType) { result.forEach(function (previousType, previousIndex) { if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { exclude.push(previousIndex); } }); result.push(currentType); }); return result.filter(function (type, index) { return exclude.indexOf(index) === -1; }); } function compileMap(/* lists... */) { var result = { scalar: {}, sequence: {}, mapping: {}, fallback: {} }, index, length; function collectType(type) { result[type.kind][type.tag] = result['fallback'][type.tag] = type; } for (index = 0, length = arguments.length; index < length; index += 1) { arguments[index].forEach(collectType); } return result; } function Schema(definition) { this.include = definition.include || []; this.implicit = definition.implicit || []; this.explicit = definition.explicit || []; this.implicit.forEach(function (type) { if (type.loadKind && type.loadKind !== 'scalar') { throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); } }); this.compiledImplicit = compileList(this, 'implicit', []); this.compiledExplicit = compileList(this, 'explicit', []); this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); } Schema.DEFAULT = null; Schema.create = function createSchema() { var schemas, types; switch (arguments.length) { case 1: schemas = Schema.DEFAULT; types = arguments[0]; break; case 2: schemas = arguments[0]; types = arguments[1]; break; default: throw new YAMLException('Wrong number of arguments for Schema.create function'); } schemas = common.toArray(schemas); types = common.toArray(types); if (!schemas.every(function (schema) { return schema instanceof Schema; })) { throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); } if (!types.every(function (type) { return type instanceof Type; })) { throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); } return new Schema({ include: schemas, explicit: types }); }; module.exports = Schema; /***/ }), /***/ 92183: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's Core schema. // http://www.yaml.org/spec/1.2/spec.html#id2804923 // // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. // So, Core schema has no distinctions from JSON schema is JS-YAML. var Schema = __webpack_require__(66514); module.exports = new Schema({ include: [ __webpack_require__(1571) ] }); /***/ }), /***/ 56874: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // JS-YAML's default schema for `load` function. // It is not described in the YAML specification. // // This schema is based on JS-YAML's default safe schema and includes // JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. // // Also this schema is used as default base schema at `Schema.create` function. var Schema = __webpack_require__(66514); module.exports = Schema.DEFAULT = new Schema({ include: [ __webpack_require__(48949) ], explicit: [ __webpack_require__(25914), __webpack_require__(69242), __webpack_require__(27278) ] }); /***/ }), /***/ 48949: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // JS-YAML's default schema for `safeLoad` function. // It is not described in the YAML specification. // // This schema is based on standard YAML's Core schema and includes most of // extra types described at YAML tag repository. (http://yaml.org/type/) var Schema = __webpack_require__(66514); module.exports = new Schema({ include: [ __webpack_require__(92183) ], implicit: [ __webpack_require__(83714), __webpack_require__(81393) ], explicit: [ __webpack_require__(32551), __webpack_require__(96668), __webpack_require__(76039), __webpack_require__(69237) ] }); /***/ }), /***/ 66037: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's Failsafe schema. // http://www.yaml.org/spec/1.2/spec.html#id2802346 var Schema = __webpack_require__(66514); module.exports = new Schema({ explicit: [ __webpack_require__(52672), __webpack_require__(5490), __webpack_require__(31173) ] }); /***/ }), /***/ 1571: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Standard YAML's JSON schema. // http://www.yaml.org/spec/1.2/spec.html#id2803231 // // NOTE: JS-YAML does not support schema-specific tag resolution restrictions. // So, this schema is not such strict as defined in the YAML specification. // It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. var Schema = __webpack_require__(66514); module.exports = new Schema({ include: [ __webpack_require__(66037) ], implicit: [ __webpack_require__(65647), __webpack_require__(94675), __webpack_require__(89963), __webpack_require__(15564) ] }); /***/ }), /***/ 30967: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var YAMLException = __webpack_require__(65199); var TYPE_CONSTRUCTOR_OPTIONS = [ 'kind', 'resolve', 'construct', 'instanceOf', 'predicate', 'represent', 'defaultStyle', 'styleAliases' ]; var YAML_NODE_KINDS = [ 'scalar', 'sequence', 'mapping' ]; function compileStyleAliases(map) { var result = {}; if (map !== null) { Object.keys(map).forEach(function (style) { map[style].forEach(function (alias) { result[String(alias)] = style; }); }); } return result; } function Type(tag, options) { options = options || {}; Object.keys(options).forEach(function (name) { if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); // TODO: Add tag format check. this.tag = tag; this.kind = options['kind'] || null; this.resolve = options['resolve'] || function () { return true; }; this.construct = options['construct'] || function (data) { return data; }; this.instanceOf = options['instanceOf'] || null; this.predicate = options['predicate'] || null; this.represent = options['represent'] || null; this.defaultStyle = options['defaultStyle'] || null; this.styleAliases = compileStyleAliases(options['styleAliases'] || null); if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } module.exports = Type; /***/ }), /***/ 32551: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*eslint-disable no-bitwise*/ var NodeBuffer; try { // A trick for browserified version, to not include `Buffer` shim var _require = require; NodeBuffer = _require('buffer').Buffer; } catch (__) {} var Type = __webpack_require__(30967); // [ 64, 65, 66 ] -> [ padding, CR, LF ] var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; function resolveYamlBinary(data) { if (data === null) return false; var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; // Convert one by one. for (idx = 0; idx < max; idx++) { code = map.indexOf(data.charAt(idx)); // Skip CR/LF if (code > 64) continue; // Fail on illegal characters if (code < 0) return false; bitlen += 6; } // If there are any bits left, source was corrupted return (bitlen % 8) === 0; } function constructYamlBinary(data) { var idx, tailbits, input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan max = input.length, map = BASE64_MAP, bits = 0, result = []; // Collect by 6*4 bits (3 bytes) for (idx = 0; idx < max; idx++) { if ((idx % 4 === 0) && idx) { result.push((bits >> 16) & 0xFF); result.push((bits >> 8) & 0xFF); result.push(bits & 0xFF); } bits = (bits << 6) | map.indexOf(input.charAt(idx)); } // Dump tail tailbits = (max % 4) * 6; if (tailbits === 0) { result.push((bits >> 16) & 0xFF); result.push((bits >> 8) & 0xFF); result.push(bits & 0xFF); } else if (tailbits === 18) { result.push((bits >> 10) & 0xFF); result.push((bits >> 2) & 0xFF); } else if (tailbits === 12) { result.push((bits >> 4) & 0xFF); } // Wrap into Buffer for NodeJS and leave Array for browser if (NodeBuffer) { // Support node 6.+ Buffer API when available return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); } return result; } function representYamlBinary(object /*, style*/) { var result = '', bits = 0, idx, tail, max = object.length, map = BASE64_MAP; // Convert every three bytes to 4 ASCII characters. for (idx = 0; idx < max; idx++) { if ((idx % 3 === 0) && idx) { result += map[(bits >> 18) & 0x3F]; result += map[(bits >> 12) & 0x3F]; result += map[(bits >> 6) & 0x3F]; result += map[bits & 0x3F]; } bits = (bits << 8) + object[idx]; } // Dump tail tail = max % 3; if (tail === 0) { result += map[(bits >> 18) & 0x3F]; result += map[(bits >> 12) & 0x3F]; result += map[(bits >> 6) & 0x3F]; result += map[bits & 0x3F]; } else if (tail === 2) { result += map[(bits >> 10) & 0x3F]; result += map[(bits >> 4) & 0x3F]; result += map[(bits << 2) & 0x3F]; result += map[64]; } else if (tail === 1) { result += map[(bits >> 2) & 0x3F]; result += map[(bits << 4) & 0x3F]; result += map[64]; result += map[64]; } return result; } function isBinary(object) { return NodeBuffer && NodeBuffer.isBuffer(object); } module.exports = new Type('tag:yaml.org,2002:binary', { kind: 'scalar', resolve: resolveYamlBinary, construct: constructYamlBinary, predicate: isBinary, represent: representYamlBinary }); /***/ }), /***/ 94675: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveYamlBoolean(data) { if (data === null) return false; var max = data.length; return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); } function constructYamlBoolean(data) { return data === 'true' || data === 'True' || data === 'TRUE'; } function isBoolean(object) { return Object.prototype.toString.call(object) === '[object Boolean]'; } module.exports = new Type('tag:yaml.org,2002:bool', { kind: 'scalar', resolve: resolveYamlBoolean, construct: constructYamlBoolean, predicate: isBoolean, represent: { lowercase: function (object) { return object ? 'true' : 'false'; }, uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, camelcase: function (object) { return object ? 'True' : 'False'; } }, defaultStyle: 'lowercase' }); /***/ }), /***/ 15564: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(59136); var Type = __webpack_require__(30967); var YAML_FLOAT_PATTERN = new RegExp( // 2.5e4, 2.5 and integers '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + // .2e4, .2 // special case, seems not from spec '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + // 20:59 '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + // .inf '|[-+]?\\.(?:inf|Inf|INF)' + // .nan '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { if (data === null) return false; if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_` // Probably should update regexp & check speed data[data.length - 1] === '_') { return false; } return true; } function constructYamlFloat(data) { var value, sign, base, digits; value = data.replace(/_/g, '').toLowerCase(); sign = value[0] === '-' ? -1 : 1; digits = []; if ('+-'.indexOf(value[0]) >= 0) { value = value.slice(1); } if (value === '.inf') { return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; } else if (value === '.nan') { return NaN; } else if (value.indexOf(':') >= 0) { value.split(':').forEach(function (v) { digits.unshift(parseFloat(v, 10)); }); value = 0.0; base = 1; digits.forEach(function (d) { value += d * base; base *= 60; }); return sign * value; } return sign * parseFloat(value, 10); } var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; function representYamlFloat(object, style) { var res; if (isNaN(object)) { switch (style) { case 'lowercase': return '.nan'; case 'uppercase': return '.NAN'; case 'camelcase': return '.NaN'; } } else if (Number.POSITIVE_INFINITY === object) { switch (style) { case 'lowercase': return '.inf'; case 'uppercase': return '.INF'; case 'camelcase': return '.Inf'; } } else if (Number.NEGATIVE_INFINITY === object) { switch (style) { case 'lowercase': return '-.inf'; case 'uppercase': return '-.INF'; case 'camelcase': return '-.Inf'; } } else if (common.isNegativeZero(object)) { return '-0.0'; } res = object.toString(10); // JS stringifier can build scientific format without dots: 5e-100, // while YAML requres dot: 5.e-100. Fix it with simple hack return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; } function isFloat(object) { return (Object.prototype.toString.call(object) === '[object Number]') && (object % 1 !== 0 || common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:float', { kind: 'scalar', resolve: resolveYamlFloat, construct: constructYamlFloat, predicate: isFloat, represent: representYamlFloat, defaultStyle: 'lowercase' }); /***/ }), /***/ 89963: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var common = __webpack_require__(59136); var Type = __webpack_require__(30967); function isHexCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || ((0x61/* a */ <= c) && (c <= 0x66/* f */)); } function isOctCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); } function isDecCode(c) { return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); } function resolveYamlInteger(data) { if (data === null) return false; var max = data.length, index = 0, hasDigits = false, ch; if (!max) return false; ch = data[index]; // sign if (ch === '-' || ch === '+') { ch = data[++index]; } if (ch === '0') { // 0 if (index + 1 === max) return true; ch = data[++index]; // base 2, base 8, base 16 if (ch === 'b') { // base 2 index++; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (ch !== '0' && ch !== '1') return false; hasDigits = true; } return hasDigits && ch !== '_'; } if (ch === 'x') { // base 16 index++; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (!isHexCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== '_'; } // base 8 for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (!isOctCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits && ch !== '_'; } // base 10 (except 0) or base 60 // value should not start with `_`; if (ch === '_') return false; for (; index < max; index++) { ch = data[index]; if (ch === '_') continue; if (ch === ':') break; if (!isDecCode(data.charCodeAt(index))) { return false; } hasDigits = true; } // Should have digits and should not end with `_` if (!hasDigits || ch === '_') return false; // if !base60 - done; if (ch !== ':') return true; // base60 almost not used, no needs to optimize return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); } function constructYamlInteger(data) { var value = data, sign = 1, ch, base, digits = []; if (value.indexOf('_') !== -1) { value = value.replace(/_/g, ''); } ch = value[0]; if (ch === '-' || ch === '+') { if (ch === '-') sign = -1; value = value.slice(1); ch = value[0]; } if (value === '0') return 0; if (ch === '0') { if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); if (value[1] === 'x') return sign * parseInt(value, 16); return sign * parseInt(value, 8); } if (value.indexOf(':') !== -1) { value.split(':').forEach(function (v) { digits.unshift(parseInt(v, 10)); }); value = 0; base = 1; digits.forEach(function (d) { value += (d * base); base *= 60; }); return sign * value; } return sign * parseInt(value, 10); } function isInteger(object) { return (Object.prototype.toString.call(object)) === '[object Number]' && (object % 1 === 0 && !common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:int', { kind: 'scalar', resolve: resolveYamlInteger, construct: constructYamlInteger, predicate: isInteger, represent: { binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, decimal: function (obj) { return obj.toString(10); }, /* eslint-disable max-len */ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } }, defaultStyle: 'decimal', styleAliases: { binary: [ 2, 'bin' ], octal: [ 8, 'oct' ], decimal: [ 10, 'dec' ], hexadecimal: [ 16, 'hex' ] } }); /***/ }), /***/ 27278: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var esprima; // Browserified version does not have esprima // // 1. For node.js just require module as deps // 2. For browser try to require mudule via external AMD system. // If not found - try to fallback to window.esprima. If not // found too - then fail to parse. // try { // workaround to exclude package from browserify list. var _require = require; esprima = _require('esprima'); } catch (_) { /* eslint-disable no-redeclare */ /* global window */ if (typeof window !== 'undefined') esprima = window.esprima; } var Type = __webpack_require__(30967); function resolveJavascriptFunction(data) { if (data === null) return false; try { var source = '(' + data + ')', ast = esprima.parse(source, { range: true }); if (ast.type !== 'Program' || ast.body.length !== 1 || ast.body[0].type !== 'ExpressionStatement' || (ast.body[0].expression.type !== 'ArrowFunctionExpression' && ast.body[0].expression.type !== 'FunctionExpression')) { return false; } return true; } catch (err) { return false; } } function constructJavascriptFunction(data) { /*jslint evil:true*/ var source = '(' + data + ')', ast = esprima.parse(source, { range: true }), params = [], body; if (ast.type !== 'Program' || ast.body.length !== 1 || ast.body[0].type !== 'ExpressionStatement' || (ast.body[0].expression.type !== 'ArrowFunctionExpression' && ast.body[0].expression.type !== 'FunctionExpression')) { throw new Error('Failed to resolve function'); } ast.body[0].expression.params.forEach(function (param) { params.push(param.name); }); body = ast.body[0].expression.body.range; // Esprima's ranges include the first '{' and the last '}' characters on // function expressions. So cut them out. if (ast.body[0].expression.body.type === 'BlockStatement') { /*eslint-disable no-new-func*/ return new Function(params, source.slice(body[0] + 1, body[1] - 1)); } // ES6 arrow functions can omit the BlockStatement. In that case, just return // the body. /*eslint-disable no-new-func*/ return new Function(params, 'return ' + source.slice(body[0], body[1])); } function representJavascriptFunction(object /*, style*/) { return object.toString(); } function isFunction(object) { return Object.prototype.toString.call(object) === '[object Function]'; } module.exports = new Type('tag:yaml.org,2002:js/function', { kind: 'scalar', resolve: resolveJavascriptFunction, construct: constructJavascriptFunction, predicate: isFunction, represent: representJavascriptFunction }); /***/ }), /***/ 69242: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveJavascriptRegExp(data) { if (data === null) return false; if (data.length === 0) return false; var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; // if regexp starts with '/' it can have modifiers and must be properly closed // `/foo/gim` - modifiers tail can be maximum 3 chars if (regexp[0] === '/') { if (tail) modifiers = tail[1]; if (modifiers.length > 3) return false; // if expression starts with /, is should be properly terminated if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; } return true; } function constructJavascriptRegExp(data) { var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; // `/foo/gim` - tail can be maximum 4 chars if (regexp[0] === '/') { if (tail) modifiers = tail[1]; regexp = regexp.slice(1, regexp.length - modifiers.length - 1); } return new RegExp(regexp, modifiers); } function representJavascriptRegExp(object /*, style*/) { var result = '/' + object.source + '/'; if (object.global) result += 'g'; if (object.multiline) result += 'm'; if (object.ignoreCase) result += 'i'; return result; } function isRegExp(object) { return Object.prototype.toString.call(object) === '[object RegExp]'; } module.exports = new Type('tag:yaml.org,2002:js/regexp', { kind: 'scalar', resolve: resolveJavascriptRegExp, construct: constructJavascriptRegExp, predicate: isRegExp, represent: representJavascriptRegExp }); /***/ }), /***/ 25914: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveJavascriptUndefined() { return true; } function constructJavascriptUndefined() { /*eslint-disable no-undefined*/ return undefined; } function representJavascriptUndefined() { return ''; } function isUndefined(object) { return typeof object === 'undefined'; } module.exports = new Type('tag:yaml.org,2002:js/undefined', { kind: 'scalar', resolve: resolveJavascriptUndefined, construct: constructJavascriptUndefined, predicate: isUndefined, represent: representJavascriptUndefined }); /***/ }), /***/ 31173: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); module.exports = new Type('tag:yaml.org,2002:map', { kind: 'mapping', construct: function (data) { return data !== null ? data : {}; } }); /***/ }), /***/ 81393: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveYamlMerge(data) { return data === '<<' || data === null; } module.exports = new Type('tag:yaml.org,2002:merge', { kind: 'scalar', resolve: resolveYamlMerge }); /***/ }), /***/ 65647: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); function resolveYamlNull(data) { if (data === null) return true; var max = data.length; return (max === 1 && data === '~') || (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); } function constructYamlNull() { return null; } function isNull(object) { return object === null; } module.exports = new Type('tag:yaml.org,2002:null', { kind: 'scalar', resolve: resolveYamlNull, construct: constructYamlNull, predicate: isNull, represent: { canonical: function () { return '~'; }, lowercase: function () { return 'null'; }, uppercase: function () { return 'NULL'; }, camelcase: function () { return 'Null'; } }, defaultStyle: 'lowercase' }); /***/ }), /***/ 96668: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { if (data === null) return true; var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; pairHasKey = false; if (_toString.call(pair) !== '[object Object]') return false; for (pairKey in pair) { if (_hasOwnProperty.call(pair, pairKey)) { if (!pairHasKey) pairHasKey = true; else return false; } } if (!pairHasKey) return false; if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); else return false; } return true; } function constructYamlOmap(data) { return data !== null ? data : []; } module.exports = new Type('tag:yaml.org,2002:omap', { kind: 'sequence', resolve: resolveYamlOmap, construct: constructYamlOmap }); /***/ }), /***/ 76039: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { if (data === null) return true; var index, length, pair, keys, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; if (_toString.call(pair) !== '[object Object]') return false; keys = Object.keys(pair); if (keys.length !== 1) return false; result[index] = [ keys[0], pair[keys[0]] ]; } return true; } function constructYamlPairs(data) { if (data === null) return []; var index, length, pair, keys, result, object = data; result = new Array(object.length); for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; keys = Object.keys(pair); result[index] = [ keys[0], pair[keys[0]] ]; } return result; } module.exports = new Type('tag:yaml.org,2002:pairs', { kind: 'sequence', resolve: resolveYamlPairs, construct: constructYamlPairs }); /***/ }), /***/ 5490: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); module.exports = new Type('tag:yaml.org,2002:seq', { kind: 'sequence', construct: function (data) { return data !== null ? data : []; } }); /***/ }), /***/ 69237: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { if (data === null) return true; var key, object = data; for (key in object) { if (_hasOwnProperty.call(object, key)) { if (object[key] !== null) return false; } } return true; } function constructYamlSet(data) { return data !== null ? data : {}; } module.exports = new Type('tag:yaml.org,2002:set', { kind: 'mapping', resolve: resolveYamlSet, construct: constructYamlSet }); /***/ }), /***/ 52672: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); module.exports = new Type('tag:yaml.org,2002:str', { kind: 'scalar', construct: function (data) { return data !== null ? data : ''; } }); /***/ }), /***/ 83714: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Type = __webpack_require__(30967); var YAML_DATE_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9])' + // [2] month '-([0-9][0-9])$'); // [3] day var YAML_TIMESTAMP_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9]?)' + // [2] month '-([0-9][0-9]?)' + // [3] day '(?:[Tt]|[ \\t]+)' + // ... '([0-9][0-9]?)' + // [4] hour ':([0-9][0-9])' + // [5] minute ':([0-9][0-9])' + // [6] second '(?:\\.([0-9]*))?' + // [7] fraction '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour '(?::([0-9][0-9]))?))?$'); // [11] tz_minute function resolveYamlTimestamp(data) { if (data === null) return false; if (YAML_DATE_REGEXP.exec(data) !== null) return true; if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; return false; } function constructYamlTimestamp(data) { var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; match = YAML_DATE_REGEXP.exec(data); if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); if (match === null) throw new Error('Date resolve error'); // match: [1] year [2] month [3] day year = +(match[1]); month = +(match[2]) - 1; // JS month starts with 0 day = +(match[3]); if (!match[4]) { // no hour return new Date(Date.UTC(year, month, day)); } // match: [4] hour [5] minute [6] second [7] fraction hour = +(match[4]); minute = +(match[5]); second = +(match[6]); if (match[7]) { fraction = match[7].slice(0, 3); while (fraction.length < 3) { // milli-seconds fraction += '0'; } fraction = +fraction; } // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute if (match[9]) { tz_hour = +(match[10]); tz_minute = +(match[11] || 0); delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds if (match[9] === '-') delta = -delta; } date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); if (delta) date.setTime(date.getTime() - delta); return date; } function representYamlTimestamp(object /*, style*/) { return object.toISOString(); } module.exports = new Type('tag:yaml.org,2002:timestamp', { kind: 'scalar', resolve: resolveYamlTimestamp, construct: constructYamlTimestamp, instanceOf: Date, represent: representYamlTimestamp }); /***/ }), /***/ 85587: /***/ (function(module, exports) { (function(){ // Copyright (c) 2005 Tom Wu // All Rights Reserved. // See "LICENSE" for details. // Basic JavaScript BN library - subset useful for RSA encryption. // Bits per digit var dbits; // JavaScript engine analysis var canary = 0xdeadbeefcafe; var j_lm = ((canary&0xffffff)==0xefcafe); // (public) Constructor function BigInteger(a,b,c) { if(a != null) if("number" == typeof a) this.fromNumber(a,b,c); else if(b == null && "string" != typeof a) this.fromString(a,256); else this.fromString(a,b); } // return new, unset BigInteger function nbi() { return new BigInteger(null); } // am: Compute w_j += (x*this_i), propagate carries, // c is initial carry, returns final carry. // c < 3*dvalue, x < 2*dvalue, this_i < dvalue // We need to select the fastest one that works in this environment. // am1: use a single mult and divide to get the high bits, // max digit bits should be 26 because // max internal value = 2*dvalue^2-2*dvalue (< 2^53) function am1(i,x,w,j,c,n) { while(--n >= 0) { var v = x*this[i++]+w[j]+c; c = Math.floor(v/0x4000000); w[j++] = v&0x3ffffff; } return c; } // am2 avoids a big mult-and-extract completely. // Max digit bits should be <= 30 because we do bitwise ops // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) function am2(i,x,w,j,c,n) { var xl = x&0x7fff, xh = x>>15; while(--n >= 0) { var l = this[i]&0x7fff; var h = this[i++]>>15; var m = xh*l+h*xl; l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); w[j++] = l&0x3fffffff; } return c; } // Alternately, set max digit bits to 28 since some // browsers slow down when dealing with 32-bit numbers. function am3(i,x,w,j,c,n) { var xl = x&0x3fff, xh = x>>14; while(--n >= 0) { var l = this[i]&0x3fff; var h = this[i++]>>14; var m = xh*l+h*xl; l = xl*l+((m&0x3fff)<<14)+w[j]+c; c = (l>>28)+(m>>14)+xh*h; w[j++] = l&0xfffffff; } return c; } var inBrowser = typeof navigator !== "undefined"; if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) { BigInteger.prototype.am = am2; dbits = 30; } else if(inBrowser && j_lm && (navigator.appName != "Netscape")) { BigInteger.prototype.am = am1; dbits = 26; } else { // Mozilla/Netscape seems to prefer am3 BigInteger.prototype.am = am3; dbits = 28; } BigInteger.prototype.DB = dbits; BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; r.t = this.t; r.s = this.s; } // (protected) set from integer value x, -DV <= x < DV function bnpFromInt(x) { this.t = 1; this.s = (x<0)?-1:0; if(x > 0) this[0] = x; else if(x < -1) this[0] = x+this.DV; else this.t = 0; } // return bigint initialized to value function nbv(i) { var r = nbi(); r.fromInt(i); return r; } // (protected) set from string and radix function bnpFromString(s,b) { var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 256) k = 8; // byte array else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else { this.fromRadix(s,b); return; } this.t = 0; this.s = 0; var i = s.length, mi = false, sh = 0; while(--i >= 0) { var x = (k==8)?s[i]&0xff:intAt(s,i); if(x < 0) { if(s.charAt(i) == "-") mi = true; continue; } mi = false; if(sh == 0) this[this.t++] = x; else if(sh+k > this.DB) { this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); } else this[this.t-1] |= x<= this.DB) sh -= this.DB; } if(k == 8 && (s[0]&0x80) != 0) { this.s = -1; if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; } // (public) return string representation in given radix function bnToString(b) { if(this.s < 0) return "-"+this.negate().toString(b); var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else return this.toRadix(b); var km = (1< 0) { if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } while(i >= 0) { if(p < k) { d = (this[i]&((1<>(p+=this.DB-k); } else { d = (this[i]>>(p-=k))&km; if(p <= 0) { p += this.DB; --i; } } if(d > 0) m = true; if(m) r += int2char(d); } } return m?r:"0"; } // (public) -this function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } // (public) |this| function bnAbs() { return (this.s<0)?this.negate():this; } // (public) return + if this > a, - if this < a, 0 if equal function bnCompareTo(a) { var r = this.s-a.s; if(r != 0) return r; var i = this.t; r = i-a.t; if(r != 0) return (this.s<0)?-r:r; while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; return 0; } // returns bit length of the integer x function nbits(x) { var r = 1, t; if((t=x>>>16) != 0) { x = t; r += 16; } if((t=x>>8) != 0) { x = t; r += 8; } if((t=x>>4) != 0) { x = t; r += 4; } if((t=x>>2) != 0) { x = t; r += 2; } if((t=x>>1) != 0) { x = t; r += 1; } return r; } // (public) return the number of bits in "this" function bnBitLength() { if(this.t <= 0) return 0; return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); } // (protected) r = this << n*DB function bnpDLShiftTo(n,r) { var i; for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; for(i = n-1; i >= 0; --i) r[i] = 0; r.t = this.t+n; r.s = this.s; } // (protected) r = this >> n*DB function bnpDRShiftTo(n,r) { for(var i = n; i < this.t; ++i) r[i-n] = this[i]; r.t = Math.max(this.t-n,0); r.s = this.s; } // (protected) r = this << n function bnpLShiftTo(n,r) { var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<= 0; --i) { r[i+ds+1] = (this[i]>>cbs)|c; c = (this[i]&bm)<= 0; --i) r[i] = 0; r[ds] = c; r.t = this.t+ds+1; r.s = this.s; r.clamp(); } // (protected) r = this >> n function bnpRShiftTo(n,r) { r.s = this.s; var ds = Math.floor(n/this.DB); if(ds >= this.t) { r.t = 0; return; } var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<>bs; for(var i = ds+1; i < this.t; ++i) { r[i-ds-1] |= (this[i]&bm)<>bs; } if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; } if(a.t < this.t) { c -= a.s; while(i < this.t) { c += this[i]; r[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c -= a[i]; r[i++] = c&this.DM; c >>= this.DB; } c -= a.s; } r.s = (c<0)?-1:0; if(c < -1) r[i++] = this.DV+c; else if(c > 0) r[i++] = c; r.t = i; r.clamp(); } // (protected) r = this * a, r != this,a (HAC 14.12) // "this" should be the larger one if appropriate. function bnpMultiplyTo(a,r) { var x = this.abs(), y = a.abs(); var i = x.t; r.t = i+y.t; while(--i >= 0) r[i] = 0; for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); r.s = 0; r.clamp(); if(this.s != a.s) BigInteger.ZERO.subTo(r,r); } // (protected) r = this^2, r != this (HAC 14.16) function bnpSquareTo(r) { var x = this.abs(); var i = r.t = 2*x.t; while(--i >= 0) r[i] = 0; for(i = 0; i < x.t-1; ++i) { var c = x.am(i,x[i],r,2*i,0,1); if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { r[i+x.t] -= x.DV; r[i+x.t+1] = 1; } } if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); r.s = 0; r.clamp(); } // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) // r != q, this != m. q or r may be null. function bnpDivRemTo(m,q,r) { var pm = m.abs(); if(pm.t <= 0) return; var pt = this.abs(); if(pt.t < pm.t) { if(q != null) q.fromInt(0); if(r != null) this.copyTo(r); return; } if(r == null) r = nbi(); var y = nbi(), ts = this.s, ms = m.s; var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } var ys = y.t; var y0 = y[ys-1]; if(y0 == 0) return; var yt = y0*(1<1)?y[ys-2]>>this.F2:0); var d1 = this.FV/yt, d2 = (1<= 0) { r[r.t++] = 1; r.subTo(t,r); } BigInteger.ONE.dlShiftTo(ys,t); t.subTo(y,y); // "negative" y so we can replace sub with am later while(y.t < ys) y[y.t++] = 0; while(--j >= 0) { // Estimate quotient digit var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out y.dlShiftTo(j,t); r.subTo(t,r); while(r[i] < --qd) r.subTo(t,r); } } if(q != null) { r.drShiftTo(ys,q); if(ts != ms) BigInteger.ZERO.subTo(q,q); } r.t = ys; r.clamp(); if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder if(ts < 0) BigInteger.ZERO.subTo(r,r); } // (public) this mod a function bnMod(a) { var r = nbi(); this.abs().divRemTo(a,null,r); if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); return r; } // Modular reduction using "classic" algorithm function Classic(m) { this.m = m; } function cConvert(x) { if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); else return x; } function cRevert(x) { return x; } function cReduce(x) { x.divRemTo(this.m,null,x); } function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } Classic.prototype.convert = cConvert; Classic.prototype.revert = cRevert; Classic.prototype.reduce = cReduce; Classic.prototype.mulTo = cMulTo; Classic.prototype.sqrTo = cSqrTo; // (protected) return "-1/this % 2^DB"; useful for Mont. reduction // justification: // xy == 1 (mod m) // xy = 1+km // xy(2-xy) = (1+km)(1-km) // x[y(2-xy)] = 1-k^2m^2 // x[y(2-xy)] == 1 (mod m^2) // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. // JS multiply "overflows" differently from C/C++, so care is needed here. function bnpInvDigit() { if(this.t < 1) return 0; var x = this[0]; if((x&1) == 0) return 0; var y = x&3; // y == 1/x mod 2^2 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 // last step - calculate inverse mod DV directly; // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits // we really want the negative inverse, and -DV < y < DV return (y>0)?this.DV-y:-y; } // Montgomery reduction function Montgomery(m) { this.m = m; this.mp = m.invDigit(); this.mpl = this.mp&0x7fff; this.mph = this.mp>>15; this.um = (1<<(m.DB-15))-1; this.mt2 = 2*m.t; } // xR mod m function montConvert(x) { var r = nbi(); x.abs().dlShiftTo(this.m.t,r); r.divRemTo(this.m,null,r); if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); return r; } // x/R mod m function montRevert(x) { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } // x = x/R mod m (HAC 14.32) function montReduce(x) { while(x.t <= this.mt2) // pad x so am has enough room later x[x.t++] = 0; for(var i = 0; i < this.m.t; ++i) { // faster way of calculating u0 = x[i]*mp mod DV var j = x[i]&0x7fff; var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; // use am to combine the multiply-shift-add into one call j = i+this.m.t; x[j] += this.m.am(0,u0,x,i,0,this.m.t); // propagate carry while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } } x.clamp(); x.drShiftTo(this.m.t,x); if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = "x^2/R mod m"; x != r function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = "xy/R mod m"; x,y != r function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Montgomery.prototype.convert = montConvert; Montgomery.prototype.revert = montRevert; Montgomery.prototype.reduce = montReduce; Montgomery.prototype.mulTo = montMulTo; Montgomery.prototype.sqrTo = montSqrTo; // (protected) true iff this is even function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) function bnpExp(e,z) { if(e > 0xffffffff || e < 1) return BigInteger.ONE; var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; g.copyTo(r); while(--i >= 0) { z.sqrTo(r,r2); if((e&(1< 0) z.mulTo(r2,g,r); else { var t = r; r = r2; r2 = t; } } return z.revert(r); } // (public) this^e % m, 0 <= e < 2^32 function bnModPowInt(e,m) { var z; if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); return this.exp(e,z); } // protected BigInteger.prototype.copyTo = bnpCopyTo; BigInteger.prototype.fromInt = bnpFromInt; BigInteger.prototype.fromString = bnpFromString; BigInteger.prototype.clamp = bnpClamp; BigInteger.prototype.dlShiftTo = bnpDLShiftTo; BigInteger.prototype.drShiftTo = bnpDRShiftTo; BigInteger.prototype.lShiftTo = bnpLShiftTo; BigInteger.prototype.rShiftTo = bnpRShiftTo; BigInteger.prototype.subTo = bnpSubTo; BigInteger.prototype.multiplyTo = bnpMultiplyTo; BigInteger.prototype.squareTo = bnpSquareTo; BigInteger.prototype.divRemTo = bnpDivRemTo; BigInteger.prototype.invDigit = bnpInvDigit; BigInteger.prototype.isEven = bnpIsEven; BigInteger.prototype.exp = bnpExp; // public BigInteger.prototype.toString = bnToString; BigInteger.prototype.negate = bnNegate; BigInteger.prototype.abs = bnAbs; BigInteger.prototype.compareTo = bnCompareTo; BigInteger.prototype.bitLength = bnBitLength; BigInteger.prototype.mod = bnMod; BigInteger.prototype.modPowInt = bnModPowInt; // "constants" BigInteger.ZERO = nbv(0); BigInteger.ONE = nbv(1); // Copyright (c) 2005-2009 Tom Wu // All Rights Reserved. // See "LICENSE" for details. // Extended JavaScript BN functions, required for RSA private ops. // Version 1.1: new BigInteger("0", 10) returns "proper" zero // Version 1.2: square() API, isProbablePrime fix // (public) function bnClone() { var r = nbi(); this.copyTo(r); return r; } // (public) return value as integer function bnIntValue() { if(this.s < 0) { if(this.t == 1) return this[0]-this.DV; else if(this.t == 0) return -1; } else if(this.t == 1) return this[0]; else if(this.t == 0) return 0; // assumes 16 < DB < 32 return ((this[1]&((1<<(32-this.DB))-1))<>24; } // (public) return value as short (assumes DB>=16) function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; } // (protected) return x s.t. r^x < DV function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } // (public) 0 if this == 0, 1 if this > 0 function bnSigNum() { if(this.s < 0) return -1; else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; else return 1; } // (protected) convert to radix string function bnpToRadix(b) { if(b == null) b = 10; if(this.signum() == 0 || b < 2 || b > 36) return "0"; var cs = this.chunkSize(b); var a = Math.pow(b,cs); var d = nbv(a), y = nbi(), z = nbi(), r = ""; this.divRemTo(d,y,z); while(y.signum() > 0) { r = (a+z.intValue()).toString(b).substr(1) + r; y.divRemTo(d,y,z); } return z.intValue().toString(b) + r; } // (protected) convert from radix string function bnpFromRadix(s,b) { this.fromInt(0); if(b == null) b = 10; var cs = this.chunkSize(b); var d = Math.pow(b,cs), mi = false, j = 0, w = 0; for(var i = 0; i < s.length; ++i) { var x = intAt(s,i); if(x < 0) { if(s.charAt(i) == "-" && this.signum() == 0) mi = true; continue; } w = b*w+x; if(++j >= cs) { this.dMultiply(d); this.dAddOffset(w,0); j = 0; w = 0; } } if(j > 0) { this.dMultiply(Math.pow(b,j)); this.dAddOffset(w,0); } if(mi) BigInteger.ZERO.subTo(this,this); } // (protected) alternate constructor function bnpFromNumber(a,b,c) { if("number" == typeof b) { // new BigInteger(int,int,RNG) if(a < 2) this.fromInt(1); else { this.fromNumber(a,c); if(!this.testBit(a-1)) // force MSB set this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); if(this.isEven()) this.dAddOffset(1,0); // force odd while(!this.isProbablePrime(b)) { this.dAddOffset(2,0); if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); } } } else { // new BigInteger(int,RNG) var x = new Array(), t = a&7; x.length = (a>>3)+1; b.nextBytes(x); if(t > 0) x[0] &= ((1< 0) { if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p) r[k++] = d|(this.s<<(this.DB-p)); while(i >= 0) { if(p < 8) { d = (this[i]&((1<>(p+=this.DB-8); } else { d = (this[i]>>(p-=8))&0xff; if(p <= 0) { p += this.DB; --i; } } if((d&0x80) != 0) d |= -256; if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; if(k > 0 || d != this.s) r[k++] = d; } } return r; } function bnEquals(a) { return(this.compareTo(a)==0); } function bnMin(a) { return(this.compareTo(a)<0)?this:a; } function bnMax(a) { return(this.compareTo(a)>0)?this:a; } // (protected) r = this op a (bitwise) function bnpBitwiseTo(a,op,r) { var i, f, m = Math.min(a.t,this.t); for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]); if(a.t < this.t) { f = a.s&this.DM; for(i = m; i < this.t; ++i) r[i] = op(this[i],f); r.t = this.t; } else { f = this.s&this.DM; for(i = m; i < a.t; ++i) r[i] = op(f,a[i]); r.t = a.t; } r.s = op(this.s,a.s); r.clamp(); } // (public) this & a function op_and(x,y) { return x&y; } function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } // (public) this | a function op_or(x,y) { return x|y; } function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } // (public) this ^ a function op_xor(x,y) { return x^y; } function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } // (public) this & ~a function op_andnot(x,y) { return x&~y; } function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } // (public) ~this function bnNot() { var r = nbi(); for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i]; r.t = this.t; r.s = ~this.s; return r; } // (public) this << n function bnShiftLeft(n) { var r = nbi(); if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); return r; } // (public) this >> n function bnShiftRight(n) { var r = nbi(); if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); return r; } // return index of lowest 1-bit in x, x < 2^31 function lbit(x) { if(x == 0) return -1; var r = 0; if((x&0xffff) == 0) { x >>= 16; r += 16; } if((x&0xff) == 0) { x >>= 8; r += 8; } if((x&0xf) == 0) { x >>= 4; r += 4; } if((x&3) == 0) { x >>= 2; r += 2; } if((x&1) == 0) ++r; return r; } // (public) returns index of lowest 1-bit (or -1 if none) function bnGetLowestSetBit() { for(var i = 0; i < this.t; ++i) if(this[i] != 0) return i*this.DB+lbit(this[i]); if(this.s < 0) return this.t*this.DB; return -1; } // return number of 1 bits in x function cbit(x) { var r = 0; while(x != 0) { x &= x-1; ++r; } return r; } // (public) return number of set bits function bnBitCount() { var r = 0, x = this.s&this.DM; for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x); return r; } // (public) true iff nth bit is set function bnTestBit(n) { var j = Math.floor(n/this.DB); if(j >= this.t) return(this.s!=0); return((this[j]&(1<<(n%this.DB)))!=0); } // (protected) this op (1<>= this.DB; } if(a.t < this.t) { c += a.s; while(i < this.t) { c += this[i]; r[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c += a[i]; r[i++] = c&this.DM; c >>= this.DB; } c += a.s; } r.s = (c<0)?-1:0; if(c > 0) r[i++] = c; else if(c < -1) r[i++] = this.DV+c; r.t = i; r.clamp(); } // (public) this + a function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } // (public) this - a function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } // (public) this * a function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } // (public) this^2 function bnSquare() { var r = nbi(); this.squareTo(r); return r; } // (public) this / a function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } // (public) this % a function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } // (public) [this/a,this%a] function bnDivideAndRemainder(a) { var q = nbi(), r = nbi(); this.divRemTo(a,q,r); return new Array(q,r); } // (protected) this *= n, this >= 0, 1 < n < DV function bnpDMultiply(n) { this[this.t] = this.am(0,n-1,this,0,0,this.t); ++this.t; this.clamp(); } // (protected) this += n << w words, this >= 0 function bnpDAddOffset(n,w) { if(n == 0) return; while(this.t <= w) this[this.t++] = 0; this[w] += n; while(this[w] >= this.DV) { this[w] -= this.DV; if(++w >= this.t) this[this.t++] = 0; ++this[w]; } } // A "null" reducer function NullExp() {} function nNop(x) { return x; } function nMulTo(x,y,r) { x.multiplyTo(y,r); } function nSqrTo(x,r) { x.squareTo(r); } NullExp.prototype.convert = nNop; NullExp.prototype.revert = nNop; NullExp.prototype.mulTo = nMulTo; NullExp.prototype.sqrTo = nSqrTo; // (public) this^e function bnPow(e) { return this.exp(e,new NullExp()); } // (protected) r = lower n words of "this * a", a.t <= n // "this" should be the larger one if appropriate. function bnpMultiplyLowerTo(a,n,r) { var i = Math.min(this.t+a.t,n); r.s = 0; // assumes a,this >= 0 r.t = i; while(i > 0) r[--i] = 0; var j; for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t); for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i); r.clamp(); } // (protected) r = "this * a" without lower n words, n > 0 // "this" should be the larger one if appropriate. function bnpMultiplyUpperTo(a,n,r) { --n; var i = r.t = this.t+a.t-n; r.s = 0; // assumes a,this >= 0 while(--i >= 0) r[i] = 0; for(i = Math.max(n-this.t,0); i < a.t; ++i) r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n); r.clamp(); r.drShiftTo(1,r); } // Barrett modular reduction function Barrett(m) { // setup Barrett this.r2 = nbi(); this.q3 = nbi(); BigInteger.ONE.dlShiftTo(2*m.t,this.r2); this.mu = this.r2.divide(m); this.m = m; } function barrettConvert(x) { if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); else if(x.compareTo(this.m) < 0) return x; else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } } function barrettRevert(x) { return x; } // x = x mod m (HAC 14.42) function barrettReduce(x) { x.drShiftTo(this.m.t-1,this.r2); if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); x.subTo(this.r2,x); while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = x^2 mod m; x != r function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = x*y mod m; x,y != r function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Barrett.prototype.convert = barrettConvert; Barrett.prototype.revert = barrettRevert; Barrett.prototype.reduce = barrettReduce; Barrett.prototype.mulTo = barrettMulTo; Barrett.prototype.sqrTo = barrettSqrTo; // (public) this^e % m (HAC 14.85) function bnModPow(e,m) { var i = e.bitLength(), k, r = nbv(1), z; if(i <= 0) return r; else if(i < 18) k = 1; else if(i < 48) k = 3; else if(i < 144) k = 4; else if(i < 768) k = 5; else k = 6; if(i < 8) z = new Classic(m); else if(m.isEven()) z = new Barrett(m); else z = new Montgomery(m); // precomputation var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { var g2 = nbi(); z.sqrTo(g[1],g2); while(n <= km) { g[n] = nbi(); z.mulTo(g2,g[n-2],g[n]); n += 2; } } var j = e.t-1, w, is1 = true, r2 = nbi(), t; i = nbits(e[j])-1; while(j >= 0) { if(i >= k1) w = (e[j]>>(i-k1))&km; else { w = (e[j]&((1<<(i+1))-1))<<(k1-i); if(j > 0) w |= e[j-1]>>(this.DB+i-k1); } n = k; while((w&1) == 0) { w >>= 1; --n; } if((i -= n) < 0) { i += this.DB; --j; } if(is1) { // ret == 1, don't bother squaring or multiplying it g[w].copyTo(r); is1 = false; } else { while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } z.mulTo(r2,g[w],r); } while(j >= 0 && (e[j]&(1< 0) { x.rShiftTo(g,x); y.rShiftTo(g,y); } while(x.signum() > 0) { if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); if(x.compareTo(y) >= 0) { x.subTo(y,x); x.rShiftTo(1,x); } else { y.subTo(x,y); y.rShiftTo(1,y); } } if(g > 0) y.lShiftTo(g,y); return y; } // (protected) this % n, n < 2^26 function bnpModInt(n) { if(n <= 0) return 0; var d = this.DV%n, r = (this.s<0)?n-1:0; if(this.t > 0) if(d == 0) r = this[0]%n; else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n; return r; } // (public) 1/this % m (HAC 14.61) function bnModInverse(m) { var ac = m.isEven(); if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; var u = m.clone(), v = this.clone(); var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); while(u.signum() != 0) { while(u.isEven()) { u.rShiftTo(1,u); if(ac) { if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } a.rShiftTo(1,a); } else if(!b.isEven()) b.subTo(m,b); b.rShiftTo(1,b); } while(v.isEven()) { v.rShiftTo(1,v); if(ac) { if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } c.rShiftTo(1,c); } else if(!d.isEven()) d.subTo(m,d); d.rShiftTo(1,d); } if(u.compareTo(v) >= 0) { u.subTo(v,u); if(ac) a.subTo(c,a); b.subTo(d,b); } else { v.subTo(u,v); if(ac) c.subTo(a,c); d.subTo(b,d); } } if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; if(d.compareTo(m) >= 0) return d.subtract(m); if(d.signum() < 0) d.addTo(m,d); else return d; if(d.signum() < 0) return d.add(m); else return d; } var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]; var lplim = (1<<26)/lowprimes[lowprimes.length-1]; // (public) test primality with certainty >= 1-.5^t function bnIsProbablePrime(t) { var i, x = this.abs(); if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) { for(i = 0; i < lowprimes.length; ++i) if(x[0] == lowprimes[i]) return true; return false; } if(x.isEven()) return false; i = 1; while(i < lowprimes.length) { var m = lowprimes[i], j = i+1; while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; m = x.modInt(m); while(i < j) if(m%lowprimes[i++] == 0) return false; } return x.millerRabin(t); } // (protected) true if probably prime (HAC 4.24, Miller-Rabin) function bnpMillerRabin(t) { var n1 = this.subtract(BigInteger.ONE); var k = n1.getLowestSetBit(); if(k <= 0) return false; var r = n1.shiftRight(k); t = (t+1)>>1; if(t > lowprimes.length) t = lowprimes.length; var a = nbi(); for(var i = 0; i < t; ++i) { //Pick bases at random, instead of starting at 2 a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]); var y = a.modPow(r,this); if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { var j = 1; while(j++ < k && y.compareTo(n1) != 0) { y = y.modPowInt(2,this); if(y.compareTo(BigInteger.ONE) == 0) return false; } if(y.compareTo(n1) != 0) return false; } } return true; } // protected BigInteger.prototype.chunkSize = bnpChunkSize; BigInteger.prototype.toRadix = bnpToRadix; BigInteger.prototype.fromRadix = bnpFromRadix; BigInteger.prototype.fromNumber = bnpFromNumber; BigInteger.prototype.bitwiseTo = bnpBitwiseTo; BigInteger.prototype.changeBit = bnpChangeBit; BigInteger.prototype.addTo = bnpAddTo; BigInteger.prototype.dMultiply = bnpDMultiply; BigInteger.prototype.dAddOffset = bnpDAddOffset; BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; BigInteger.prototype.modInt = bnpModInt; BigInteger.prototype.millerRabin = bnpMillerRabin; // public BigInteger.prototype.clone = bnClone; BigInteger.prototype.intValue = bnIntValue; BigInteger.prototype.byteValue = bnByteValue; BigInteger.prototype.shortValue = bnShortValue; BigInteger.prototype.signum = bnSigNum; BigInteger.prototype.toByteArray = bnToByteArray; BigInteger.prototype.equals = bnEquals; BigInteger.prototype.min = bnMin; BigInteger.prototype.max = bnMax; BigInteger.prototype.and = bnAnd; BigInteger.prototype.or = bnOr; BigInteger.prototype.xor = bnXor; BigInteger.prototype.andNot = bnAndNot; BigInteger.prototype.not = bnNot; BigInteger.prototype.shiftLeft = bnShiftLeft; BigInteger.prototype.shiftRight = bnShiftRight; BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; BigInteger.prototype.bitCount = bnBitCount; BigInteger.prototype.testBit = bnTestBit; BigInteger.prototype.setBit = bnSetBit; BigInteger.prototype.clearBit = bnClearBit; BigInteger.prototype.flipBit = bnFlipBit; BigInteger.prototype.add = bnAdd; BigInteger.prototype.subtract = bnSubtract; BigInteger.prototype.multiply = bnMultiply; BigInteger.prototype.divide = bnDivide; BigInteger.prototype.remainder = bnRemainder; BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; BigInteger.prototype.modPow = bnModPow; BigInteger.prototype.modInverse = bnModInverse; BigInteger.prototype.pow = bnPow; BigInteger.prototype.gcd = bnGCD; BigInteger.prototype.isProbablePrime = bnIsProbablePrime; // JSBN-specific extension BigInteger.prototype.square = bnSquare; // Expose the Barrett function BigInteger.prototype.Barrett = Barrett // BigInteger interfaces not implemented in jsbn: // BigInteger(int signum, byte[] magnitude) // double doubleValue() // float floatValue() // int hashCode() // long longValue() // static BigInteger valueOf(long val) // Random number generator - requires a PRNG backend, e.g. prng4.js // For best results, put code like // // in your main HTML document. var rng_state; var rng_pool; var rng_pptr; // Mix in a 32-bit integer into the pool function rng_seed_int(x) { rng_pool[rng_pptr++] ^= x & 255; rng_pool[rng_pptr++] ^= (x >> 8) & 255; rng_pool[rng_pptr++] ^= (x >> 16) & 255; rng_pool[rng_pptr++] ^= (x >> 24) & 255; if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; } // Mix in the current time (w/milliseconds) into the pool function rng_seed_time() { rng_seed_int(new Date().getTime()); } // Initialize the pool with junk if needed. if(rng_pool == null) { rng_pool = new Array(); rng_pptr = 0; var t; if(typeof window !== "undefined" && window.crypto) { if (window.crypto.getRandomValues) { // Use webcrypto if available var ua = new Uint8Array(32); window.crypto.getRandomValues(ua); for(t = 0; t < 32; ++t) rng_pool[rng_pptr++] = ua[t]; } else if(navigator.appName == "Netscape" && navigator.appVersion < "5") { // Extract entropy (256 bits) from NS4 RNG if available var z = window.crypto.random(32); for(t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; } } while(rng_pptr < rng_psize) { // extract some randomness from Math.random() t = Math.floor(65536 * Math.random()); rng_pool[rng_pptr++] = t >>> 8; rng_pool[rng_pptr++] = t & 255; } rng_pptr = 0; rng_seed_time(); //rng_seed_int(window.screenX); //rng_seed_int(window.screenY); } function rng_get_byte() { if(rng_state == null) { rng_seed_time(); rng_state = prng_newstate(); rng_state.init(rng_pool); for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0; rng_pptr = 0; //rng_pool = null; } // TODO: allow reseeding after first request return rng_state.next(); } function rng_get_bytes(ba) { var i; for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); } function SecureRandom() {} SecureRandom.prototype.nextBytes = rng_get_bytes; // prng4.js - uses Arcfour as a PRNG function Arcfour() { this.i = 0; this.j = 0; this.S = new Array(); } // Initialize arcfour context from key, an array of ints, each from [0..255] function ARC4init(key) { var i, j, t; for(i = 0; i < 256; ++i) this.S[i] = i; j = 0; for(i = 0; i < 256; ++i) { j = (j + this.S[i] + key[i % key.length]) & 255; t = this.S[i]; this.S[i] = this.S[j]; this.S[j] = t; } this.i = 0; this.j = 0; } function ARC4next() { var t; this.i = (this.i + 1) & 255; this.j = (this.j + this.S[this.i]) & 255; t = this.S[this.i]; this.S[this.i] = this.S[this.j]; this.S[this.j] = t; return this.S[(t + this.S[this.i]) & 255]; } Arcfour.prototype.init = ARC4init; Arcfour.prototype.next = ARC4next; // Plug in your RNG constructor here function prng_newstate() { return new Arcfour(); } // Pool size must be a multiple of 4 and greater than 32. // An array of bytes the size of the pool will be passed to init() var rng_psize = 256; BigInteger.SecureRandom = SecureRandom; BigInteger.BigInteger = BigInteger; if (true) { exports = module.exports = BigInteger; } else {} }).call(this); /***/ }), /***/ 55031: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var json_stringify = __webpack_require__(78574).stringify; var json_parse = __webpack_require__(89099); module.exports = function(options) { return { parse: json_parse(options), stringify: json_stringify } }; //create the default method members with no options applied for backwards compatibility module.exports.parse = json_parse(); module.exports.stringify = json_stringify; /***/ }), /***/ 89099: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var BigNumber = null; // regexpxs extracted from // (c) BSD-3-Clause // https://github.com/fastify/secure-json-parse/graphs/contributors and https://github.com/hapijs/bourne/graphs/contributors const suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/; const suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/; /* json_parse.js 2012-06-20 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. This file creates a json_parse function. During create you can (optionally) specify some behavioural switches require('json-bigint')(options) The optional options parameter holds switches that drive certain aspects of the parsing process: * options.strict = true will warn about duplicate-key usage in the json. The default (strict = false) will silently ignore those and overwrite values for keys that are in duplicate use. The resulting function follows this signature: json_parse(text, reviver) This method parses a JSON text to produce an object or array. It can throw a SyntaxError exception. The optional reviver parameter is a function that can filter and transform the results. It receives each of the keys and values, and its return value is used instead of the original value. If it returns what it received, then the structure is not modified. If it returns undefined then the member is deleted. Example: // Parse the text. Values that look like ISO date strings will // be converted to Date objects. myData = json_parse(text, function (key, value) { var a; if (typeof value === 'string') { a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); if (a) { return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6])); } } return value; }); This is a reference implementation. You are free to copy, modify, or redistribute. This code should be minified before deployment. See http://javascript.crockford.com/jsmin.html USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO NOT CONTROL. */ /*members "", "\"", "\/", "\\", at, b, call, charAt, f, fromCharCode, hasOwnProperty, message, n, name, prototype, push, r, t, text */ var json_parse = function (options) { 'use strict'; // This is a function that can parse a JSON text, producing a JavaScript // data structure. It is a simple, recursive descent parser. It does not use // eval or regular expressions, so it can be used as a model for implementing // a JSON parser in other languages. // We are defining the function inside of another function to avoid creating // global variables. // Default options one can override by passing options to the parse() var _options = { strict: false, // not being strict means do not generate syntax errors for "duplicate key" storeAsString: false, // toggles whether the values should be stored as BigNumber (default) or a string alwaysParseAsBig: false, // toggles whether all numbers should be Big useNativeBigInt: false, // toggles whether to use native BigInt instead of bignumber.js protoAction: 'error', constructorAction: 'error', }; // If there are options, then use them to override the default _options if (options !== undefined && options !== null) { if (options.strict === true) { _options.strict = true; } if (options.storeAsString === true) { _options.storeAsString = true; } _options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false; _options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false; if (typeof options.constructorAction !== 'undefined') { if ( options.constructorAction === 'error' || options.constructorAction === 'ignore' || options.constructorAction === 'preserve' ) { _options.constructorAction = options.constructorAction; } else { throw new Error( `Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}` ); } } if (typeof options.protoAction !== 'undefined') { if ( options.protoAction === 'error' || options.protoAction === 'ignore' || options.protoAction === 'preserve' ) { _options.protoAction = options.protoAction; } else { throw new Error( `Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}` ); } } } var at, // The index of the current character ch, // The current character escapee = { '"': '"', '\\': '\\', '/': '/', b: '\b', f: '\f', n: '\n', r: '\r', t: '\t', }, text, error = function (m) { // Call error when something is wrong. throw { name: 'SyntaxError', message: m, at: at, text: text, }; }, next = function (c) { // If a c parameter is provided, verify that it matches the current character. if (c && c !== ch) { error("Expected '" + c + "' instead of '" + ch + "'"); } // Get the next character. When there are no more characters, // return the empty string. ch = text.charAt(at); at += 1; return ch; }, number = function () { // Parse a number value. var number, string = ''; if (ch === '-') { string = '-'; next('-'); } while (ch >= '0' && ch <= '9') { string += ch; next(); } if (ch === '.') { string += '.'; while (next() && ch >= '0' && ch <= '9') { string += ch; } } if (ch === 'e' || ch === 'E') { string += ch; next(); if (ch === '-' || ch === '+') { string += ch; next(); } while (ch >= '0' && ch <= '9') { string += ch; next(); } } number = +string; if (!isFinite(number)) { error('Bad number'); } else { if (BigNumber == null) BigNumber = __webpack_require__(87558); //if (number > 9007199254740992 || number < -9007199254740992) // Bignumber has stricter check: everything with length > 15 digits disallowed if (string.length > 15) return _options.storeAsString ? string : _options.useNativeBigInt ? BigInt(string) : new BigNumber(string); else return !_options.alwaysParseAsBig ? number : _options.useNativeBigInt ? BigInt(number) : new BigNumber(number); } }, string = function () { // Parse a string value. var hex, i, string = '', uffff; // When parsing for string values, we must look for " and \ characters. if (ch === '"') { var startAt = at; while (next()) { if (ch === '"') { if (at - 1 > startAt) string += text.substring(startAt, at - 1); next(); return string; } if (ch === '\\') { if (at - 1 > startAt) string += text.substring(startAt, at - 1); next(); if (ch === 'u') { uffff = 0; for (i = 0; i < 4; i += 1) { hex = parseInt(next(), 16); if (!isFinite(hex)) { break; } uffff = uffff * 16 + hex; } string += String.fromCharCode(uffff); } else if (typeof escapee[ch] === 'string') { string += escapee[ch]; } else { break; } startAt = at; } } } error('Bad string'); }, white = function () { // Skip whitespace. while (ch && ch <= ' ') { next(); } }, word = function () { // true, false, or null. switch (ch) { case 't': next('t'); next('r'); next('u'); next('e'); return true; case 'f': next('f'); next('a'); next('l'); next('s'); next('e'); return false; case 'n': next('n'); next('u'); next('l'); next('l'); return null; } error("Unexpected '" + ch + "'"); }, value, // Place holder for the value function. array = function () { // Parse an array value. var array = []; if (ch === '[') { next('['); white(); if (ch === ']') { next(']'); return array; // empty array } while (ch) { array.push(value()); white(); if (ch === ']') { next(']'); return array; } next(','); white(); } } error('Bad array'); }, object = function () { // Parse an object value. var key, object = Object.create(null); if (ch === '{') { next('{'); white(); if (ch === '}') { next('}'); return object; // empty object } while (ch) { key = string(); white(); next(':'); if ( _options.strict === true && Object.hasOwnProperty.call(object, key) ) { error('Duplicate key "' + key + '"'); } if (suspectProtoRx.test(key) === true) { if (_options.protoAction === 'error') { error('Object contains forbidden prototype property'); } else if (_options.protoAction === 'ignore') { value(); } else { object[key] = value(); } } else if (suspectConstructorRx.test(key) === true) { if (_options.constructorAction === 'error') { error('Object contains forbidden constructor property'); } else if (_options.constructorAction === 'ignore') { value(); } else { object[key] = value(); } } else { object[key] = value(); } white(); if (ch === '}') { next('}'); return object; } next(','); white(); } } error('Bad object'); }; value = function () { // Parse a JSON value. It could be an object, an array, a string, a number, // or a word. white(); switch (ch) { case '{': return object(); case '[': return array(); case '"': return string(); case '-': return number(); default: return ch >= '0' && ch <= '9' ? number() : word(); } }; // Return the json_parse function. It will have access to all of the above // functions and variables. return function (source, reviver) { var result; text = source + ''; at = 0; ch = ' '; result = value(); white(); if (ch) { error('Syntax error'); } // If there is a reviver function, we recursively walk the new structure, // passing each name/value pair to the reviver function for possible // transformation, starting with a temporary root object that holds the result // in an empty key. If there is not a reviver function, we simply return the // result. return typeof reviver === 'function' ? (function walk(holder, key) { var k, v, value = holder[key]; if (value && typeof value === 'object') { Object.keys(value).forEach(function (k) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } }); } return reviver.call(holder, key, value); })({ '': result }, '') : result; }; }; module.exports = json_parse; /***/ }), /***/ 78574: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var BigNumber = __webpack_require__(87558); /* json2.js 2013-05-26 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html This code should be minified before deployment. See http://javascript.crockford.com/jsmin.html USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO NOT CONTROL. This file creates a global JSON object containing two methods: stringify and parse. JSON.stringify(value, replacer, space) value any JavaScript value, usually an object or array. replacer an optional parameter that determines how object values are stringified for objects. It can be a function or an array of strings. space an optional parameter that specifies the indentation of nested structures. If it is omitted, the text will be packed without extra whitespace. If it is a number, it will specify the number of spaces to indent at each level. If it is a string (such as '\t' or ' '), it contains the characters used to indent at each level. This method produces a JSON text from a JavaScript value. When an object value is found, if the object contains a toJSON method, its toJSON method will be called and the result will be stringified. A toJSON method does not serialize: it returns the value represented by the name/value pair that should be serialized, or undefined if nothing should be serialized. The toJSON method will be passed the key associated with the value, and this will be bound to the value For example, this would serialize Dates as ISO strings. Date.prototype.toJSON = function (key) { function f(n) { // Format integers to have at least two digits. return n < 10 ? '0' + n : n; } return this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'; }; You can provide an optional replacer method. It will be passed the key and value of each member, with this bound to the containing object. The value that is returned from your method will be serialized. If your method returns undefined, then the member will be excluded from the serialization. If the replacer parameter is an array of strings, then it will be used to select the members to be serialized. It filters the results such that only members with keys listed in the replacer array are stringified. Values that do not have JSON representations, such as undefined or functions, will not be serialized. Such values in objects will be dropped; in arrays they will be replaced with null. You can use a replacer function to replace those with JSON values. JSON.stringify(undefined) returns undefined. The optional space parameter produces a stringification of the value that is filled with line breaks and indentation to make it easier to read. If the space parameter is a non-empty string, then that string will be used for indentation. If the space parameter is a number, then the indentation will be that many spaces. Example: text = JSON.stringify(['e', {pluribus: 'unum'}]); // text is '["e",{"pluribus":"unum"}]' text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' text = JSON.stringify([new Date()], function (key, value) { return this[key] instanceof Date ? 'Date(' + this[key] + ')' : value; }); // text is '["Date(---current time---)"]' JSON.parse(text, reviver) This method parses a JSON text to produce an object or array. It can throw a SyntaxError exception. The optional reviver parameter is a function that can filter and transform the results. It receives each of the keys and values, and its return value is used instead of the original value. If it returns what it received, then the structure is not modified. If it returns undefined then the member is deleted. Example: // Parse the text. Values that look like ISO date strings will // be converted to Date objects. myData = JSON.parse(text, function (key, value) { var a; if (typeof value === 'string') { a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); if (a) { return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6])); } } return value; }); myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { var d; if (typeof value === 'string' && value.slice(0, 5) === 'Date(' && value.slice(-1) === ')') { d = new Date(value.slice(5, -1)); if (d) { return d; } } return value; }); This is a reference implementation. You are free to copy, modify, or redistribute. */ /*jslint evil: true, regexp: true */ /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, lastIndex, length, parse, prototype, push, replace, slice, stringify, test, toJSON, toString, valueOf */ // Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. var JSON = module.exports; (function () { 'use strict'; function f(n) { // Format integers to have at least two digits. return n < 10 ? '0' + n : n; } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { // table of character substitutions '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\' }, rep; function quote(string) { // If the string contains no control characters, no quote characters, and no // backslash characters, then we can safely slap some quotes around it. // Otherwise we must also replace the offending characters with safe escape // sequences. escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function (a) { var c = meta[a]; return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }) + '"' : '"' + string + '"'; } function str(key, holder) { // Produce a string from holder[key]. var i, // The loop counter. k, // The member key. v, // The member value. length, mind = gap, partial, value = holder[key], isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value)); // If the value has a toJSON method, call it to obtain a replacement value. if (value && typeof value === 'object' && typeof value.toJSON === 'function') { value = value.toJSON(key); } // If we were called with a replacer function, then call the replacer to // obtain a replacement value. if (typeof rep === 'function') { value = rep.call(holder, key, value); } // What happens next depends on the value's type. switch (typeof value) { case 'string': if (isBigNumber) { return value; } else { return quote(value); } case 'number': // JSON numbers must be finite. Encode non-finite numbers as null. return isFinite(value) ? String(value) : 'null'; case 'boolean': case 'null': case 'bigint': // If the value is a boolean or null, convert it to a string. Note: // typeof null does not produce 'null'. The case is included here in // the remote chance that this gets fixed someday. return String(value); // If the type is 'object', we might be dealing with an object or an array or // null. case 'object': // Due to a specification blunder in ECMAScript, typeof null is 'object', // so watch out for that case. if (!value) { return 'null'; } // Make an array to hold the partial results of stringifying this object value. gap += indent; partial = []; // Is the value an array? if (Object.prototype.toString.apply(value) === '[object Array]') { // The value is an array. Stringify every element. Use null as a placeholder // for non-JSON values. length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || 'null'; } // Join all of the elements together, separated with commas, and wrap them in // brackets. v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']'; gap = mind; return v; } // If the replacer is an array, use it to select the members to be stringified. if (rep && typeof rep === 'object') { length = rep.length; for (i = 0; i < length; i += 1) { if (typeof rep[i] === 'string') { k = rep[i]; v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } } else { // Otherwise, iterate through all of the keys in the object. Object.keys(value).forEach(function(k) { var v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } }); } // Join all of the member texts together, separated with commas, // and wrap them in braces. v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}'; gap = mind; return v; } } // If the JSON object does not yet have a stringify method, give it one. if (typeof JSON.stringify !== 'function') { JSON.stringify = function (value, replacer, space) { // The stringify method takes a value and an optional replacer, and an optional // space parameter, and returns a JSON text. The replacer can be a function // that can replace values, or an array of strings that will select the keys. // A default replacer method can be provided. Use of the space parameter can // produce text that is more easily readable. var i; gap = ''; indent = ''; // If the space parameter is a number, make an indent string containing that // many spaces. if (typeof space === 'number') { for (i = 0; i < space; i += 1) { indent += ' '; } // If the space parameter is a string, it will be used as the indent string. } else if (typeof space === 'string') { indent = space; } // If there is a replacer, it must be a function or an array. // Otherwise, throw an error. rep = replacer; if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { throw new Error('JSON.stringify'); } // Make a fake root object containing our value under the key of ''. // Return the result of stringifying the value. return str('', {'': value}); }; } }()); /***/ }), /***/ 52533: /***/ ((module) => { "use strict"; var traverse = module.exports = function (schema, opts, cb) { // Legacy support for v0.3.1 and earlier. if (typeof opts == 'function') { cb = opts; opts = {}; } cb = opts.cb || cb; var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; var post = cb.post || function() {}; _traverse(opts, pre, post, schema, '', schema); }; traverse.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true }; traverse.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true }; traverse.propsKeywords = { definitions: true, properties: true, patternProperties: true, dependencies: true }; traverse.skipKeywords = { default: true, enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true }; function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (schema && typeof schema == 'object' && !Array.isArray(schema)) { pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); for (var key in schema) { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) { for (var i=0; i schema.maxItems){ addError("There must be a maximum of " + schema.maxItems + " in the array"); } }else if(schema.properties || schema.additionalProperties){ errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties)); } if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){ addError("does not match the regex pattern " + schema.pattern); } if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){ addError("may only be " + schema.maxLength + " characters long"); } if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){ addError("must be at least " + schema.minLength + " characters long"); } if(typeof schema.minimum !== 'undefined' && typeof value == typeof schema.minimum && schema.minimum > value){ addError("must have a minimum value of " + schema.minimum); } if(typeof schema.maximum !== 'undefined' && typeof value == typeof schema.maximum && schema.maximum < value){ addError("must have a maximum value of " + schema.maximum); } if(schema['enum']){ var enumer = schema['enum']; l = enumer.length; var found; for(var j = 0; j < l; j++){ if(enumer[j]===value){ found=1; break; } } if(!found){ addError("does not have a value in the enumeration " + enumer.join(", ")); } } if(typeof schema.maxDecimal == 'number' && (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){ addError("may only have " + schema.maxDecimal + " digits of decimal places"); } } } return null; } // validate an object against a schema function checkObj(instance,objTypeDef,path,additionalProp){ if(typeof objTypeDef =='object'){ if(typeof instance != 'object' || instance instanceof Array){ errors.push({property:path,message:"an object is required"}); } for(var i in objTypeDef){ if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){ var value = instance.hasOwnProperty(i) ? instance[i] : undefined; // skip _not_ specified properties if (value === undefined && options.existingOnly) continue; var propDef = objTypeDef[i]; // set default if(value === undefined && propDef["default"]){ value = instance[i] = propDef["default"]; } if(options.coerce && i in instance){ value = instance[i] = options.coerce(value, propDef); } checkProp(value,propDef,path,i); } } } for(i in instance){ if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){ if (options.filter) { delete instance[i]; continue; } else { errors.push({property:path,message:"The property " + i + " is not defined in the schema and the schema does not allow additional properties"}); } } var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires; if(requires && !(requires in instance)){ errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"}); } value = instance[i]; if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){ if(options.coerce){ value = instance[i] = options.coerce(value, additionalProp); } checkProp(value,additionalProp,path,i); } if(!_changing && value && value.$schema){ errors = errors.concat(checkProp(value,value.$schema,path,i)); } } return errors; } if(schema){ checkProp(instance,schema,'',_changing || ''); } if(!_changing && instance && instance.$schema){ checkProp(instance,instance.$schema,'',''); } return {valid:!errors.length,errors:errors}; }; exports.mustBeValid = function(result){ // summary: // This checks to ensure that the result is valid and will throw an appropriate error message if it is not // result: the result returned from checkPropertyChange or validate if(!result.valid){ throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n")); } } return exports; })); /***/ }), /***/ 57073: /***/ ((module, exports) => { exports = module.exports = stringify exports.getSerialize = serializer function stringify(obj, replacer, spaces, cycleReplacer) { return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) } function serializer(replacer, cycleReplacer) { var stack = [], keys = [] if (cycleReplacer == null) cycleReplacer = function(key, value) { if (stack[0] === value) return "[Circular ~]" return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" } return function(key, value) { if (stack.length > 0) { var thisPos = stack.indexOf(this) ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) } else stack.push(value) return replacer == null ? value : replacer.call(this, key, value) } } /***/ }), /***/ 63269: /***/ (function(module, exports, __webpack_require__) { (function (global, factory) { true ? factory(exports) : 0; }(this, function (exports) { 'use strict'; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; } else { _typeof = function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } /* eslint-disable no-eval */ var globalEval = eval; // eslint-disable-next-line import/no-commonjs var supportsNodeVM = true && Boolean(module.exports) && !(typeof navigator !== 'undefined' && navigator.product === 'ReactNative'); var allowedResultTypes = ['value', 'path', 'pointer', 'parent', 'parentProperty', 'all']; var hasOwnProp = Object.prototype.hasOwnProperty; /** * Copy items out of one array into another. * @param {Array} source Array with items to copy * @param {Array} target Array to which to copy * @param {Function} conditionCb Callback passed the current item; will move * item if evaluates to `true` * @returns {undefined} */ var moveToAnotherArray = function moveToAnotherArray(source, target, conditionCb) { var il = source.length; for (var i = 0; i < il; i++) { var item = source[i]; if (conditionCb(item)) { target.push(source.splice(i--, 1)[0]); } } }; var vm = supportsNodeVM ? __webpack_require__(92184) : { /** * @param {string} expr Expression to evaluate * @param {Object} context Object whose items will be added to evaluation * @returns {*} Result of evaluated code */ runInNewContext: function runInNewContext(expr, context) { var keys = Object.keys(context); var funcs = []; moveToAnotherArray(keys, funcs, function (key) { return typeof context[key] === 'function'; }); var code = funcs.reduce(function (s, func) { var fString = context[func].toString(); if (!/function/.exec(fString)) { fString = 'function ' + fString; } return 'var ' + func + '=' + fString + ';' + s; }, '') + keys.reduce(function (s, vr) { return 'var ' + vr + '=' + JSON.stringify(context[vr]).replace( // http://www.thespanner.co.uk/2011/07/25/the-json-specification-is-now-wrong/ /\u2028|\u2029/g, function (m) { return "\\u202" + (m === "\u2028" ? '8' : '9'); }) + ';' + s; }, expr); return globalEval(code); } }; /** * Copies array and then pushes item into it. * @param {Array} arr Array to copy and into which to push * @param {*} item Array item to add (to end) * @returns {Array} Copy of the original array */ function push(arr, item) { arr = arr.slice(); arr.push(item); return arr; } /** * Copies array and then unshifts item into it. * @param {*} item Array item to add (to beginning) * @param {Array} arr Array to copy and into which to unshift * @returns {Array} Copy of the original array */ function unshift(item, arr) { arr = arr.slice(); arr.unshift(item); return arr; } /** * Caught when JSONPath is used without `new` but rethrown if with `new` * @extends Error */ var NewError = /*#__PURE__*/ function (_Error) { _inherits(NewError, _Error); /** * @param {*} value The evaluated scalar value */ function NewError(value) { var _this; _classCallCheck(this, NewError); _this = _possibleConstructorReturn(this, _getPrototypeOf(NewError).call(this, 'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')); _this.avoidNew = true; _this.value = value; _this.name = 'NewError'; return _this; } return NewError; }(_wrapNativeSuper(Error)); /** * @param {Object} [opts] If present, must be an object * @param {string} expr JSON path to evaluate * @param {JSON} obj JSON object to evaluate against * @param {Function} callback Passed 3 arguments: 1) desired payload per `resultType`, * 2) `"value"|"property"`, 3) Full returned object with all payloads * @param {Function} otherTypeCallback If `@other()` is at the end of one's query, this * will be invoked with the value of the item, its path, its parent, and its parent's * property name, and it should return a boolean indicating whether the supplied value * belongs to the "other" type or not (or it may handle transformations and return `false`). * @returns {JSONPath} * @class */ function JSONPath(opts, expr, obj, callback, otherTypeCallback) { // eslint-disable-next-line no-restricted-syntax if (!(this instanceof JSONPath)) { try { return new JSONPath(opts, expr, obj, callback, otherTypeCallback); } catch (e) { if (!e.avoidNew) { throw e; } return e.value; } } if (typeof opts === 'string') { otherTypeCallback = callback; callback = obj; obj = expr; expr = opts; opts = {}; } opts = opts || {}; var objArgs = hasOwnProp.call(opts, 'json') && hasOwnProp.call(opts, 'path'); this.json = opts.json || obj; this.path = opts.path || expr; this.resultType = opts.resultType && opts.resultType.toLowerCase() || 'value'; this.flatten = opts.flatten || false; this.wrap = hasOwnProp.call(opts, 'wrap') ? opts.wrap : true; this.sandbox = opts.sandbox || {}; this.preventEval = opts.preventEval || false; this.parent = opts.parent || null; this.parentProperty = opts.parentProperty || null; this.callback = opts.callback || callback || null; this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () { throw new Error('You must supply an otherTypeCallback callback option with the @other() operator.'); }; if (opts.autostart !== false) { var ret = this.evaluate({ path: objArgs ? opts.path : expr, json: objArgs ? opts.json : obj }); if (!ret || _typeof(ret) !== 'object') { throw new NewError(ret); } return ret; } } // PUBLIC METHODS JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) { var that = this; var currParent = this.parent, currParentProperty = this.parentProperty; var flatten = this.flatten, wrap = this.wrap; this.currResultType = this.resultType; this.currPreventEval = this.preventEval; this.currSandbox = this.sandbox; callback = callback || this.callback; this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; json = json || this.json; expr = expr || this.path; if (expr && _typeof(expr) === 'object') { if (!expr.path) { throw new Error('You must supply a "path" property when providing an object argument to JSONPath.evaluate().'); } json = hasOwnProp.call(expr, 'json') ? expr.json : json; flatten = hasOwnProp.call(expr, 'flatten') ? expr.flatten : flatten; this.currResultType = hasOwnProp.call(expr, 'resultType') ? expr.resultType : this.currResultType; this.currSandbox = hasOwnProp.call(expr, 'sandbox') ? expr.sandbox : this.currSandbox; wrap = hasOwnProp.call(expr, 'wrap') ? expr.wrap : wrap; this.currPreventEval = hasOwnProp.call(expr, 'preventEval') ? expr.preventEval : this.currPreventEval; callback = hasOwnProp.call(expr, 'callback') ? expr.callback : callback; this.currOtherTypeCallback = hasOwnProp.call(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback; currParent = hasOwnProp.call(expr, 'parent') ? expr.parent : currParent; currParentProperty = hasOwnProp.call(expr, 'parentProperty') ? expr.parentProperty : currParentProperty; expr = expr.path; } currParent = currParent || null; currParentProperty = currParentProperty || null; if (Array.isArray(expr)) { expr = JSONPath.toPathString(expr); } if (!expr || !json || !allowedResultTypes.includes(this.currResultType)) { return undefined; } this._obj = json; var exprList = JSONPath.toPathArray(expr); if (exprList[0] === '$' && exprList.length > 1) { exprList.shift(); } this._hasParentSelector = null; var result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) { return ea && !ea.isParentSelector; }); if (!result.length) { return wrap ? [] : undefined; } if (result.length === 1 && !wrap && !Array.isArray(result[0].value)) { return this._getPreferredOutput(result[0]); } return result.reduce(function (rslt, ea) { var valOrPath = that._getPreferredOutput(ea); if (flatten && Array.isArray(valOrPath)) { rslt = rslt.concat(valOrPath); } else { rslt.push(valOrPath); } return rslt; }, []); }; // PRIVATE METHODS JSONPath.prototype._getPreferredOutput = function (ea) { var resultType = this.currResultType; switch (resultType) { default: throw new TypeError('Unknown result type'); case 'all': ea.pointer = JSONPath.toPointer(ea.path); ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path); return ea; case 'value': case 'parent': case 'parentProperty': return ea[resultType]; case 'path': return JSONPath.toPathString(ea[resultType]); case 'pointer': return JSONPath.toPointer(ea.path); } }; JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) { if (callback) { var preferredOutput = this._getPreferredOutput(fullRetObj); fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); // eslint-disable-next-line callback-return callback(preferredOutput, type, fullRetObj); } }; JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, literalPriority) { // No expr to follow? return path and value as the result of this trace branch var retObj; var that = this; if (!expr.length) { retObj = { path: path, value: val, parent: parent, parentProperty: parentPropName }; this._handleCallback(retObj, callback, 'value'); return retObj; } var loc = expr[0], x = expr.slice(1); // We need to gather the return value of recursive trace calls in order to // do the parent sel computation. var ret = []; function addRet(elems) { if (Array.isArray(elems)) { // This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...elems);` elems.forEach(function (t) { ret.push(t); }); } else { ret.push(elems); } } if ((typeof loc !== 'string' || literalPriority) && val && hasOwnProp.call(val, loc)) { // simple case--directly follow property addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback)); } else if (loc === '*') { // all child properties // eslint-disable-next-line no-shadow this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) { addRet(that._trace(unshift(m, x), v, p, par, pr, cb, true)); }); } else if (loc === '..') { // all descendent parent properties addRet(this._trace(x, val, path, parent, parentPropName, callback)); // Check remaining expression with val's immediate children // eslint-disable-next-line no-shadow this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) { // We don't join m and x here because we only want parents, not scalar values if (_typeof(v[m]) === 'object') { // Keep going with recursive descent on val's object children addRet(that._trace(unshift(l, x), v[m], push(p, m), v, m, cb)); } }); // The parent sel computation is handled in the frame above using the // ancestor object of val } else if (loc === '^') { // This is not a final endpoint, so we do not invoke the callback here this._hasParentSelector = true; return path.length ? { path: path.slice(0, -1), expr: x, isParentSelector: true } : []; } else if (loc === '~') { // property name retObj = { path: push(path, loc), value: parentPropName, parent: parent, parentProperty: null }; this._handleCallback(retObj, callback, 'property'); return retObj; } else if (loc === '$') { // root only addRet(this._trace(x, val, path, null, null, callback)); } else if (/^(-?\d*):(-?\d*):?(\d*)$/.test(loc)) { // [start:end:step] Python slice syntax addRet(this._slice(loc, x, val, path, parent, parentPropName, callback)); } else if (loc.indexOf('?(') === 0) { // [?(expr)] (filtering) if (this.currPreventEval) { throw new Error('Eval [?(expr)] prevented in JSONPath expression.'); } // eslint-disable-next-line no-shadow this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) { if (that._eval(l.replace(/^\?\((.*?)\)$/, '$1'), v[m], m, p, par, pr)) { addRet(that._trace(unshift(m, x), v, p, par, pr, cb)); } }); } else if (loc[0] === '(') { // [(expr)] (dynamic property/index) if (this.currPreventEval) { throw new Error('Eval [(expr)] prevented in JSONPath expression.'); } // As this will resolve to a property name (but we don't know it yet), property and parent information is relative to the parent of the property to which this expression will resolve addRet(this._trace(unshift(this._eval(loc, val, path[path.length - 1], path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback)); } else if (loc[0] === '@') { // value type: @boolean(), etc. var addType = false; var valueType = loc.slice(1, -2); switch (valueType) { default: throw new TypeError('Unknown value type ' + valueType); case 'scalar': if (!val || !['object', 'function'].includes(_typeof(val))) { addType = true; } break; case 'boolean': case 'string': case 'undefined': case 'function': if (_typeof(val) === valueType) { // eslint-disable-line valid-typeof addType = true; } break; case 'number': if (_typeof(val) === valueType && isFinite(val)) { // eslint-disable-line valid-typeof addType = true; } break; case 'nonFinite': if (typeof val === 'number' && !isFinite(val)) { addType = true; } break; case 'object': if (val && _typeof(val) === valueType) { // eslint-disable-line valid-typeof addType = true; } break; case 'array': if (Array.isArray(val)) { addType = true; } break; case 'other': addType = this.currOtherTypeCallback(val, path, parent, parentPropName); break; case 'integer': if (val === Number(val) && isFinite(val) && !(val % 1)) { addType = true; } break; case 'null': if (val === null) { addType = true; } break; } if (addType) { retObj = { path: path, value: val, parent: parent, parentProperty: parentPropName }; this._handleCallback(retObj, callback, 'value'); return retObj; } } else if (loc[0] === '`' && val && hasOwnProp.call(val, loc.slice(1))) { // `-escaped property var locProp = loc.slice(1); addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, true)); } else if (loc.includes(',')) { // [name1,name2,...] var parts = loc.split(','); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var part = _step.value; addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback)); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator["return"] != null) { _iterator["return"](); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } else if (!literalPriority && val && hasOwnProp.call(val, loc)) { // simple case--directly follow property addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, true)); } // We check the resulting values for parent selections. For parent // selections we discard the value object and continue the trace with the // current val object if (this._hasParentSelector) { // eslint-disable-next-line unicorn/no-for-loop for (var t = 0; t < ret.length; t++) { var rett = ret[t]; if (rett.isParentSelector) { var tmp = that._trace(rett.expr, val, rett.path, parent, parentPropName, callback); if (Array.isArray(tmp)) { ret[t] = tmp[0]; var tl = tmp.length; for (var tt = 1; tt < tl; tt++) { t++; ret.splice(t, 0, tmp[tt]); } } else { ret[t] = tmp; } } } } return ret; }; JSONPath.prototype._walk = function (loc, expr, val, path, parent, parentPropName, callback, f) { if (Array.isArray(val)) { var n = val.length; for (var i = 0; i < n; i++) { f(i, loc, expr, val, path, parent, parentPropName, callback); } } else if (_typeof(val) === 'object') { for (var m in val) { if (hasOwnProp.call(val, m)) { f(m, loc, expr, val, path, parent, parentPropName, callback); } } } }; JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) { if (!Array.isArray(val)) { return undefined; } var len = val.length, parts = loc.split(':'), step = parts[2] && parseInt(parts[2]) || 1; var start = parts[0] && parseInt(parts[0]) || 0, end = parts[1] && parseInt(parts[1]) || len; start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); var ret = []; for (var i = start; i < end; i += step) { var tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback); if (Array.isArray(tmp)) { // This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...tmp);` tmp.forEach(function (t) { ret.push(t); }); } else { ret.push(tmp); } } return ret; }; JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) { if (!this._obj || !_v) { return false; } if (code.includes('@parentProperty')) { this.currSandbox._$_parentProperty = parentPropName; code = code.replace(/@parentProperty/g, '_$_parentProperty'); } if (code.includes('@parent')) { this.currSandbox._$_parent = parent; code = code.replace(/@parent/g, '_$_parent'); } if (code.includes('@property')) { this.currSandbox._$_property = _vname; code = code.replace(/@property/g, '_$_property'); } if (code.includes('@path')) { this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname])); code = code.replace(/@path/g, '_$_path'); } if (code.match(/@([.\s)[])/)) { this.currSandbox._$_v = _v; code = code.replace(/@([.\s)[])/g, '_$_v$1'); } try { return vm.runInNewContext(code, this.currSandbox); } catch (e) { // eslint-disable-next-line no-console console.log(e); throw new Error('jsonPath: ' + e.message + ': ' + code); } }; // PUBLIC CLASS PROPERTIES AND METHODS // Could store the cache object itself JSONPath.cache = {}; /** * @param {string[]} pathArr Array to convert * @returns {string} The path string */ JSONPath.toPathString = function (pathArr) { var x = pathArr, n = x.length; var p = '$'; for (var i = 1; i < n; i++) { if (!/^(~|\^|@.*?\(\))$/.test(x[i])) { p += /^[0-9*]+$/.test(x[i]) ? '[' + x[i] + ']' : "['" + x[i] + "']"; } } return p; }; /** * @param {string} pointer JSON Path * @returns {string} JSON Pointer */ JSONPath.toPointer = function (pointer) { var x = pointer, n = x.length; var p = ''; for (var i = 1; i < n; i++) { if (!/^(~|\^|@.*?\(\))$/.test(x[i])) { p += '/' + x[i].toString().replace(/~/g, '~0').replace(/\//g, '~1'); } } return p; }; /** * @param {string} expr Expression to convert * @returns {string[]} */ JSONPath.toPathArray = function (expr) { var cache = JSONPath.cache; if (cache[expr]) { return cache[expr].concat(); } var subx = []; var normalized = expr // Properties .replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g, ';$&;') // Parenthetical evaluations (filtering and otherwise), directly // within brackets or single quotes .replace(/[['](\??\(.*?\))[\]']/g, function ($0, $1) { return '[#' + (subx.push($1) - 1) + ']'; }) // Escape periods and tildes within properties .replace(/\['([^'\]]*)'\]/g, function ($0, prop) { return "['" + prop.replace(/\./g, '%@%').replace(/~/g, '%%@@%%') + "']"; }) // Properties operator .replace(/~/g, ';~;') // Split by property boundaries .replace(/'?\.'?(?![^[]*\])|\['?/g, ';') // Reinsert periods within properties .replace(/%@%/g, '.') // Reinsert tildes within properties .replace(/%%@@%%/g, '~') // Parent .replace(/(?:;)?(\^+)(?:;)?/g, function ($0, ups) { return ';' + ups.split('').join(';') + ';'; }) // Descendents .replace(/;;;|;;/g, ';..;') // Remove trailing .replace(/;$|'?\]|'$/g, ''); var exprList = normalized.split(';').map(function (exp) { var match = exp.match(/#(\d+)/); return !match || !match[1] ? exp : subx[match[1]]; }); cache[expr] = exprList; return cache[expr]; }; exports.JSONPath = JSONPath; Object.defineProperty(exports, '__esModule', { value: true }); })); /***/ }), /***/ 6287: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* * lib/jsprim.js: utilities for primitive JavaScript types */ var mod_assert = __webpack_require__(66631); var mod_util = __webpack_require__(31669); var mod_extsprintf = __webpack_require__(87264); var mod_verror = __webpack_require__(81692); var mod_jsonschema = __webpack_require__(21328); /* * Public interface */ exports.deepCopy = deepCopy; exports.deepEqual = deepEqual; exports.isEmpty = isEmpty; exports.hasKey = hasKey; exports.forEachKey = forEachKey; exports.pluck = pluck; exports.flattenObject = flattenObject; exports.flattenIter = flattenIter; exports.validateJsonObject = validateJsonObjectJS; exports.validateJsonObjectJS = validateJsonObjectJS; exports.randElt = randElt; exports.extraProperties = extraProperties; exports.mergeObjects = mergeObjects; exports.startsWith = startsWith; exports.endsWith = endsWith; exports.parseInteger = parseInteger; exports.iso8601 = iso8601; exports.rfc1123 = rfc1123; exports.parseDateTime = parseDateTime; exports.hrtimediff = hrtimeDiff; exports.hrtimeDiff = hrtimeDiff; exports.hrtimeAccum = hrtimeAccum; exports.hrtimeAdd = hrtimeAdd; exports.hrtimeNanosec = hrtimeNanosec; exports.hrtimeMicrosec = hrtimeMicrosec; exports.hrtimeMillisec = hrtimeMillisec; /* * Deep copy an acyclic *basic* Javascript object. This only handles basic * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects * containing these. This does *not* handle instances of other classes. */ function deepCopy(obj) { var ret, key; var marker = '__deepCopy'; if (obj && obj[marker]) throw (new Error('attempted deep copy of cyclic object')); if (obj && obj.constructor == Object) { ret = {}; obj[marker] = true; for (key in obj) { if (key == marker) continue; ret[key] = deepCopy(obj[key]); } delete (obj[marker]); return (ret); } if (obj && obj.constructor == Array) { ret = []; obj[marker] = true; for (key = 0; key < obj.length; key++) ret.push(deepCopy(obj[key])); delete (obj[marker]); return (ret); } /* * It must be a primitive type -- just return it. */ return (obj); } function deepEqual(obj1, obj2) { if (typeof (obj1) != typeof (obj2)) return (false); if (obj1 === null || obj2 === null || typeof (obj1) != 'object') return (obj1 === obj2); if (obj1.constructor != obj2.constructor) return (false); var k; for (k in obj1) { if (!obj2.hasOwnProperty(k)) return (false); if (!deepEqual(obj1[k], obj2[k])) return (false); } for (k in obj2) { if (!obj1.hasOwnProperty(k)) return (false); } return (true); } function isEmpty(obj) { var key; for (key in obj) return (false); return (true); } function hasKey(obj, key) { mod_assert.equal(typeof (key), 'string'); return (Object.prototype.hasOwnProperty.call(obj, key)); } function forEachKey(obj, callback) { for (var key in obj) { if (hasKey(obj, key)) { callback(key, obj[key]); } } } function pluck(obj, key) { mod_assert.equal(typeof (key), 'string'); return (pluckv(obj, key)); } function pluckv(obj, key) { if (obj === null || typeof (obj) !== 'object') return (undefined); if (obj.hasOwnProperty(key)) return (obj[key]); var i = key.indexOf('.'); if (i == -1) return (undefined); var key1 = key.substr(0, i); if (!obj.hasOwnProperty(key1)) return (undefined); return (pluckv(obj[key1], key.substr(i + 1))); } /* * Invoke callback(row) for each entry in the array that would be returned by * flattenObject(data, depth). This is just like flattenObject(data, * depth).forEach(callback), except that the intermediate array is never * created. */ function flattenIter(data, depth, callback) { doFlattenIter(data, depth, [], callback); } function doFlattenIter(data, depth, accum, callback) { var each; var key; if (depth === 0) { each = accum.slice(0); each.push(data); callback(each); return; } mod_assert.ok(data !== null); mod_assert.equal(typeof (data), 'object'); mod_assert.equal(typeof (depth), 'number'); mod_assert.ok(depth >= 0); for (key in data) { each = accum.slice(0); each.push(key); doFlattenIter(data[key], depth - 1, each, callback); } } function flattenObject(data, depth) { if (depth === 0) return ([ data ]); mod_assert.ok(data !== null); mod_assert.equal(typeof (data), 'object'); mod_assert.equal(typeof (depth), 'number'); mod_assert.ok(depth >= 0); var rv = []; var key; for (key in data) { flattenObject(data[key], depth - 1).forEach(function (p) { rv.push([ key ].concat(p)); }); } return (rv); } function startsWith(str, prefix) { return (str.substr(0, prefix.length) == prefix); } function endsWith(str, suffix) { return (str.substr( str.length - suffix.length, suffix.length) == suffix); } function iso8601(d) { if (typeof (d) == 'number') d = new Date(d); mod_assert.ok(d.constructor === Date); return (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ', d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds())); } var RFC1123_MONTHS = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var RFC1123_DAYS = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; function rfc1123(date) { return (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT', RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(), RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds())); } /* * Parses a date expressed as a string, as either a number of milliseconds since * the epoch or any string format that Date accepts, giving preference to the * former where these two sets overlap (e.g., small numbers). */ function parseDateTime(str) { /* * This is irritatingly implicit, but significantly more concise than * alternatives. The "+str" will convert a string containing only a * number directly to a Number, or NaN for other strings. Thus, if the * conversion succeeds, we use it (this is the milliseconds-since-epoch * case). Otherwise, we pass the string directly to the Date * constructor to parse. */ var numeric = +str; if (!isNaN(numeric)) { return (new Date(numeric)); } else { return (new Date(str)); } } /* * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode * the ES6 definitions here, while allowing for them to someday be higher. */ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991; /* * Default options for parseInteger(). */ var PI_DEFAULTS = { base: 10, allowSign: true, allowPrefix: false, allowTrailing: false, allowImprecise: false, trimWhitespace: false, leadingZeroIsOctal: false }; var CP_0 = 0x30; var CP_9 = 0x39; var CP_A = 0x41; var CP_B = 0x42; var CP_O = 0x4f; var CP_T = 0x54; var CP_X = 0x58; var CP_Z = 0x5a; var CP_a = 0x61; var CP_b = 0x62; var CP_o = 0x6f; var CP_t = 0x74; var CP_x = 0x78; var CP_z = 0x7a; var PI_CONV_DEC = 0x30; var PI_CONV_UC = 0x37; var PI_CONV_LC = 0x57; /* * A stricter version of parseInt() that provides options for changing what * is an acceptable string (for example, disallowing trailing characters). */ function parseInteger(str, uopts) { mod_assert.string(str, 'str'); mod_assert.optionalObject(uopts, 'options'); var baseOverride = false; var options = PI_DEFAULTS; if (uopts) { baseOverride = hasKey(uopts, 'base'); options = mergeObjects(options, uopts); mod_assert.number(options.base, 'options.base'); mod_assert.ok(options.base >= 2, 'options.base >= 2'); mod_assert.ok(options.base <= 36, 'options.base <= 36'); mod_assert.bool(options.allowSign, 'options.allowSign'); mod_assert.bool(options.allowPrefix, 'options.allowPrefix'); mod_assert.bool(options.allowTrailing, 'options.allowTrailing'); mod_assert.bool(options.allowImprecise, 'options.allowImprecise'); mod_assert.bool(options.trimWhitespace, 'options.trimWhitespace'); mod_assert.bool(options.leadingZeroIsOctal, 'options.leadingZeroIsOctal'); if (options.leadingZeroIsOctal) { mod_assert.ok(!baseOverride, '"base" and "leadingZeroIsOctal" are ' + 'mutually exclusive'); } } var c; var pbase = -1; var base = options.base; var start; var mult = 1; var value = 0; var idx = 0; var len = str.length; /* Trim any whitespace on the left side. */ if (options.trimWhitespace) { while (idx < len && isSpace(str.charCodeAt(idx))) { ++idx; } } /* Check the number for a leading sign. */ if (options.allowSign) { if (str[idx] === '-') { idx += 1; mult = -1; } else if (str[idx] === '+') { idx += 1; } } /* Parse the base-indicating prefix if there is one. */ if (str[idx] === '0') { if (options.allowPrefix) { pbase = prefixToBase(str.charCodeAt(idx + 1)); if (pbase !== -1 && (!baseOverride || pbase === base)) { base = pbase; idx += 2; } } if (pbase === -1 && options.leadingZeroIsOctal) { base = 8; } } /* Parse the actual digits. */ for (start = idx; idx < len; ++idx) { c = translateDigit(str.charCodeAt(idx)); if (c !== -1 && c < base) { value *= base; value += c; } else { break; } } /* If we didn't parse any digits, we have an invalid number. */ if (start === idx) { return (new Error('invalid number: ' + JSON.stringify(str))); } /* Trim any whitespace on the right side. */ if (options.trimWhitespace) { while (idx < len && isSpace(str.charCodeAt(idx))) { ++idx; } } /* Check for trailing characters. */ if (idx < len && !options.allowTrailing) { return (new Error('trailing characters after number: ' + JSON.stringify(str.slice(idx)))); } /* If our value is 0, we return now, to avoid returning -0. */ if (value === 0) { return (0); } /* Calculate our final value. */ var result = value * mult; /* * If the string represents a value that cannot be precisely represented * by JavaScript, then we want to check that: * * - We never increased the value past MAX_SAFE_INTEGER * - We don't make the result negative and below MIN_SAFE_INTEGER * * Because we only ever increment the value during parsing, there's no * chance of moving past MAX_SAFE_INTEGER and then dropping below it * again, losing precision in the process. This means that we only need * to do our checks here, at the end. */ if (!options.allowImprecise && (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) { return (new Error('number is outside of the supported range: ' + JSON.stringify(str.slice(start, idx)))); } return (result); } /* * Interpret a character code as a base-36 digit. */ function translateDigit(d) { if (d >= CP_0 && d <= CP_9) { /* '0' to '9' -> 0 to 9 */ return (d - PI_CONV_DEC); } else if (d >= CP_A && d <= CP_Z) { /* 'A' - 'Z' -> 10 to 35 */ return (d - PI_CONV_UC); } else if (d >= CP_a && d <= CP_z) { /* 'a' - 'z' -> 10 to 35 */ return (d - PI_CONV_LC); } else { /* Invalid character code */ return (-1); } } /* * Test if a value matches the ECMAScript definition of trimmable whitespace. */ function isSpace(c) { return (c === 0x20) || (c >= 0x0009 && c <= 0x000d) || (c === 0x00a0) || (c === 0x1680) || (c === 0x180e) || (c >= 0x2000 && c <= 0x200a) || (c === 0x2028) || (c === 0x2029) || (c === 0x202f) || (c === 0x205f) || (c === 0x3000) || (c === 0xfeff); } /* * Determine which base a character indicates (e.g., 'x' indicates hex). */ function prefixToBase(c) { if (c === CP_b || c === CP_B) { /* 0b/0B (binary) */ return (2); } else if (c === CP_o || c === CP_O) { /* 0o/0O (octal) */ return (8); } else if (c === CP_t || c === CP_T) { /* 0t/0T (decimal) */ return (10); } else if (c === CP_x || c === CP_X) { /* 0x/0X (hexadecimal) */ return (16); } else { /* Not a meaningful character */ return (-1); } } function validateJsonObjectJS(schema, input) { var report = mod_jsonschema.validate(input, schema); if (report.errors.length === 0) return (null); /* Currently, we only do anything useful with the first error. */ var error = report.errors[0]; /* The failed property is given by a URI with an irrelevant prefix. */ var propname = error['property']; var reason = error['message'].toLowerCase(); var i, j; /* * There's at least one case where the property error message is * confusing at best. We work around this here. */ if ((i = reason.indexOf('the property ')) != -1 && (j = reason.indexOf(' is not defined in the schema and the ' + 'schema does not allow additional properties')) != -1) { i += 'the property '.length; if (propname === '') propname = reason.substr(i, j - i); else propname = propname + '.' + reason.substr(i, j - i); reason = 'unsupported property'; } var rv = new mod_verror.VError('property "%s": %s', propname, reason); rv.jsv_details = error; return (rv); } function randElt(arr) { mod_assert.ok(Array.isArray(arr) && arr.length > 0, 'randElt argument must be a non-empty array'); return (arr[Math.floor(Math.random() * arr.length)]); } function assertHrtime(a) { mod_assert.ok(a[0] >= 0 && a[1] >= 0, 'negative numbers not allowed in hrtimes'); mod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow'); } /* * Compute the time elapsed between hrtime readings A and B, where A is later * than B. hrtime readings come from Node's process.hrtime(). There is no * defined way to represent negative deltas, so it's illegal to diff B from A * where the time denoted by B is later than the time denoted by A. If this * becomes valuable, we can define a representation and extend the * implementation to support it. */ function hrtimeDiff(a, b) { assertHrtime(a); assertHrtime(b); mod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]), 'negative differences not allowed'); var rv = [ a[0] - b[0], 0 ]; if (a[1] >= b[1]) { rv[1] = a[1] - b[1]; } else { rv[0]--; rv[1] = 1e9 - (b[1] - a[1]); } return (rv); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of nanoseconds. */ function hrtimeNanosec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e9 + a[1])); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of microseconds. */ function hrtimeMicrosec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e6 + a[1] / 1e3)); } /* * Convert a hrtime reading from the array format returned by Node's * process.hrtime() into a scalar number of milliseconds. */ function hrtimeMillisec(a) { assertHrtime(a); return (Math.floor(a[0] * 1e3 + a[1] / 1e6)); } /* * Add two hrtime readings A and B, overwriting A with the result of the * addition. This function is useful for accumulating several hrtime intervals * into a counter. Returns A. */ function hrtimeAccum(a, b) { assertHrtime(a); assertHrtime(b); /* * Accumulate the nanosecond component. */ a[1] += b[1]; if (a[1] >= 1e9) { /* * The nanosecond component overflowed, so carry to the seconds * field. */ a[0]++; a[1] -= 1e9; } /* * Accumulate the seconds component. */ a[0] += b[0]; return (a); } /* * Add two hrtime readings A and B, returning the result as a new hrtime array. * Does not modify either input argument. */ function hrtimeAdd(a, b) { assertHrtime(a); var rv = [ a[0], a[1] ]; return (hrtimeAccum(rv, b)); } /* * Check an object for unexpected properties. Accepts the object to check, and * an array of allowed property names (strings). Returns an array of key names * that were found on the object, but did not appear in the list of allowed * properties. If no properties were found, the returned array will be of * zero length. */ function extraProperties(obj, allowed) { mod_assert.ok(typeof (obj) === 'object' && obj !== null, 'obj argument must be a non-null object'); mod_assert.ok(Array.isArray(allowed), 'allowed argument must be an array of strings'); for (var i = 0; i < allowed.length; i++) { mod_assert.ok(typeof (allowed[i]) === 'string', 'allowed argument must be an array of strings'); } return (Object.keys(obj).filter(function (key) { return (allowed.indexOf(key) === -1); })); } /* * Given three sets of properties "provided" (may be undefined), "overrides" * (required), and "defaults" (may be undefined), construct an object containing * the union of these sets with "overrides" overriding "provided", and * "provided" overriding "defaults". None of the input objects are modified. */ function mergeObjects(provided, overrides, defaults) { var rv, k; rv = {}; if (defaults) { for (k in defaults) rv[k] = defaults[k]; } if (provided) { for (k in provided) rv[k] = provided[k]; } if (overrides) { for (k in overrides) rv[k] = overrides[k]; } return (rv); } /***/ }), /***/ 96010: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var bufferEqual = __webpack_require__(9239); var Buffer = __webpack_require__(21867).Buffer; var crypto = __webpack_require__(76417); var formatEcdsa = __webpack_require__(11728); var util = __webpack_require__(31669); var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".' var MSG_INVALID_SECRET = 'secret must be a string or buffer'; var MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer'; var MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object'; var supportsKeyObjects = typeof crypto.createPublicKey === 'function'; if (supportsKeyObjects) { MSG_INVALID_VERIFIER_KEY += ' or a KeyObject'; MSG_INVALID_SECRET += 'or a KeyObject'; } function checkIsPublicKey(key) { if (Buffer.isBuffer(key)) { return; } if (typeof key === 'string') { return; } if (!supportsKeyObjects) { throw typeError(MSG_INVALID_VERIFIER_KEY); } if (typeof key !== 'object') { throw typeError(MSG_INVALID_VERIFIER_KEY); } if (typeof key.type !== 'string') { throw typeError(MSG_INVALID_VERIFIER_KEY); } if (typeof key.asymmetricKeyType !== 'string') { throw typeError(MSG_INVALID_VERIFIER_KEY); } if (typeof key.export !== 'function') { throw typeError(MSG_INVALID_VERIFIER_KEY); } }; function checkIsPrivateKey(key) { if (Buffer.isBuffer(key)) { return; } if (typeof key === 'string') { return; } if (typeof key === 'object') { return; } throw typeError(MSG_INVALID_SIGNER_KEY); }; function checkIsSecretKey(key) { if (Buffer.isBuffer(key)) { return; } if (typeof key === 'string') { return key; } if (!supportsKeyObjects) { throw typeError(MSG_INVALID_SECRET); } if (typeof key !== 'object') { throw typeError(MSG_INVALID_SECRET); } if (key.type !== 'secret') { throw typeError(MSG_INVALID_SECRET); } if (typeof key.export !== 'function') { throw typeError(MSG_INVALID_SECRET); } } function fromBase64(base64) { return base64 .replace(/=/g, '') .replace(/\+/g, '-') .replace(/\//g, '_'); } function toBase64(base64url) { base64url = base64url.toString(); var padding = 4 - base64url.length % 4; if (padding !== 4) { for (var i = 0; i < padding; ++i) { base64url += '='; } } return base64url .replace(/\-/g, '+') .replace(/_/g, '/'); } function typeError(template) { var args = [].slice.call(arguments, 1); var errMsg = util.format.bind(util, template).apply(null, args); return new TypeError(errMsg); } function bufferOrString(obj) { return Buffer.isBuffer(obj) || typeof obj === 'string'; } function normalizeInput(thing) { if (!bufferOrString(thing)) thing = JSON.stringify(thing); return thing; } function createHmacSigner(bits) { return function sign(thing, secret) { checkIsSecretKey(secret); thing = normalizeInput(thing); var hmac = crypto.createHmac('sha' + bits, secret); var sig = (hmac.update(thing), hmac.digest('base64')) return fromBase64(sig); } } function createHmacVerifier(bits) { return function verify(thing, signature, secret) { var computedSig = createHmacSigner(bits)(thing, secret); return bufferEqual(Buffer.from(signature), Buffer.from(computedSig)); } } function createKeySigner(bits) { return function sign(thing, privateKey) { checkIsPrivateKey(privateKey); thing = normalizeInput(thing); // Even though we are specifying "RSA" here, this works with ECDSA // keys as well. var signer = crypto.createSign('RSA-SHA' + bits); var sig = (signer.update(thing), signer.sign(privateKey, 'base64')); return fromBase64(sig); } } function createKeyVerifier(bits) { return function verify(thing, signature, publicKey) { checkIsPublicKey(publicKey); thing = normalizeInput(thing); signature = toBase64(signature); var verifier = crypto.createVerify('RSA-SHA' + bits); verifier.update(thing); return verifier.verify(publicKey, signature, 'base64'); } } function createPSSKeySigner(bits) { return function sign(thing, privateKey) { checkIsPrivateKey(privateKey); thing = normalizeInput(thing); var signer = crypto.createSign('RSA-SHA' + bits); var sig = (signer.update(thing), signer.sign({ key: privateKey, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST }, 'base64')); return fromBase64(sig); } } function createPSSKeyVerifier(bits) { return function verify(thing, signature, publicKey) { checkIsPublicKey(publicKey); thing = normalizeInput(thing); signature = toBase64(signature); var verifier = crypto.createVerify('RSA-SHA' + bits); verifier.update(thing); return verifier.verify({ key: publicKey, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST }, signature, 'base64'); } } function createECDSASigner(bits) { var inner = createKeySigner(bits); return function sign() { var signature = inner.apply(null, arguments); signature = formatEcdsa.derToJose(signature, 'ES' + bits); return signature; }; } function createECDSAVerifer(bits) { var inner = createKeyVerifier(bits); return function verify(thing, signature, publicKey) { signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64'); var result = inner(thing, signature, publicKey); return result; }; } function createNoneSigner() { return function sign() { return ''; } } function createNoneVerifier() { return function verify(thing, signature) { return signature === ''; } } module.exports = function jwa(algorithm) { var signerFactories = { hs: createHmacSigner, rs: createKeySigner, ps: createPSSKeySigner, es: createECDSASigner, none: createNoneSigner, } var verifierFactories = { hs: createHmacVerifier, rs: createKeyVerifier, ps: createPSSKeyVerifier, es: createECDSAVerifer, none: createNoneVerifier, } var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/); if (!match) throw typeError(MSG_INVALID_ALGORITHM, algorithm); var algo = (match[1] || match[3]).toLowerCase(); var bits = match[2]; return { sign: signerFactories[algo](bits), verify: verifierFactories[algo](bits), } }; /***/ }), /***/ 4636: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /*global exports*/ var SignStream = __webpack_require__(73334); var VerifyStream = __webpack_require__(5522); var ALGORITHMS = [ 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', 'RS512', 'PS256', 'PS384', 'PS512', 'ES256', 'ES384', 'ES512' ]; exports.ALGORITHMS = ALGORITHMS; exports.sign = SignStream.sign; exports.verify = VerifyStream.verify; exports.decode = VerifyStream.decode; exports.isValid = VerifyStream.isValid; exports.createSign = function createSign(opts) { return new SignStream(opts); }; exports.createVerify = function createVerify(opts) { return new VerifyStream(opts); }; /***/ }), /***/ 61868: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*global module, process*/ var Buffer = __webpack_require__(21867).Buffer; var Stream = __webpack_require__(92413); var util = __webpack_require__(31669); function DataStream(data) { this.buffer = null; this.writable = true; this.readable = true; // No input if (!data) { this.buffer = Buffer.alloc(0); return this; } // Stream if (typeof data.pipe === 'function') { this.buffer = Buffer.alloc(0); data.pipe(this); return this; } // Buffer or String // or Object (assumedly a passworded key) if (data.length || typeof data === 'object') { this.buffer = data; this.writable = false; process.nextTick(function () { this.emit('end', data); this.readable = false; this.emit('close'); }.bind(this)); return this; } throw new TypeError('Unexpected data type ('+ typeof data + ')'); } util.inherits(DataStream, Stream); DataStream.prototype.write = function write(data) { this.buffer = Buffer.concat([this.buffer, Buffer.from(data)]); this.emit('data', data); }; DataStream.prototype.end = function end(data) { if (data) this.write(data); this.emit('end', data); this.emit('close'); this.writable = false; this.readable = false; }; module.exports = DataStream; /***/ }), /***/ 73334: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*global module*/ var Buffer = __webpack_require__(21867).Buffer; var DataStream = __webpack_require__(61868); var jwa = __webpack_require__(96010); var Stream = __webpack_require__(92413); var toString = __webpack_require__(65292); var util = __webpack_require__(31669); function base64url(string, encoding) { return Buffer .from(string, encoding) .toString('base64') .replace(/=/g, '') .replace(/\+/g, '-') .replace(/\//g, '_'); } function jwsSecuredInput(header, payload, encoding) { encoding = encoding || 'utf8'; var encodedHeader = base64url(toString(header), 'binary'); var encodedPayload = base64url(toString(payload), encoding); return util.format('%s.%s', encodedHeader, encodedPayload); } function jwsSign(opts) { var header = opts.header; var payload = opts.payload; var secretOrKey = opts.secret || opts.privateKey; var encoding = opts.encoding; var algo = jwa(header.alg); var securedInput = jwsSecuredInput(header, payload, encoding); var signature = algo.sign(securedInput, secretOrKey); return util.format('%s.%s', securedInput, signature); } function SignStream(opts) { var secret = opts.secret||opts.privateKey||opts.key; var secretStream = new DataStream(secret); this.readable = true; this.header = opts.header; this.encoding = opts.encoding; this.secret = this.privateKey = this.key = secretStream; this.payload = new DataStream(opts.payload); this.secret.once('close', function () { if (!this.payload.writable && this.readable) this.sign(); }.bind(this)); this.payload.once('close', function () { if (!this.secret.writable && this.readable) this.sign(); }.bind(this)); } util.inherits(SignStream, Stream); SignStream.prototype.sign = function sign() { try { var signature = jwsSign({ header: this.header, payload: this.payload.buffer, secret: this.secret.buffer, encoding: this.encoding }); this.emit('done', signature); this.emit('data', signature); this.emit('end'); this.readable = false; return signature; } catch (e) { this.readable = false; this.emit('error', e); this.emit('close'); } }; SignStream.sign = jwsSign; module.exports = SignStream; /***/ }), /***/ 65292: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*global module*/ var Buffer = __webpack_require__(64293).Buffer; module.exports = function toString(obj) { if (typeof obj === 'string') return obj; if (typeof obj === 'number' || Buffer.isBuffer(obj)) return obj.toString(); return JSON.stringify(obj); }; /***/ }), /***/ 5522: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*global module*/ var Buffer = __webpack_require__(21867).Buffer; var DataStream = __webpack_require__(61868); var jwa = __webpack_require__(96010); var Stream = __webpack_require__(92413); var toString = __webpack_require__(65292); var util = __webpack_require__(31669); var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; function isObject(thing) { return Object.prototype.toString.call(thing) === '[object Object]'; } function safeJsonParse(thing) { if (isObject(thing)) return thing; try { return JSON.parse(thing); } catch (e) { return undefined; } } function headerFromJWS(jwsSig) { var encodedHeader = jwsSig.split('.', 1)[0]; return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary')); } function securedInputFromJWS(jwsSig) { return jwsSig.split('.', 2).join('.'); } function signatureFromJWS(jwsSig) { return jwsSig.split('.')[2]; } function payloadFromJWS(jwsSig, encoding) { encoding = encoding || 'utf8'; var payload = jwsSig.split('.')[1]; return Buffer.from(payload, 'base64').toString(encoding); } function isValidJws(string) { return JWS_REGEX.test(string) && !!headerFromJWS(string); } function jwsVerify(jwsSig, algorithm, secretOrKey) { if (!algorithm) { var err = new Error("Missing algorithm parameter for jws.verify"); err.code = "MISSING_ALGORITHM"; throw err; } jwsSig = toString(jwsSig); var signature = signatureFromJWS(jwsSig); var securedInput = securedInputFromJWS(jwsSig); var algo = jwa(algorithm); return algo.verify(securedInput, signature, secretOrKey); } function jwsDecode(jwsSig, opts) { opts = opts || {}; jwsSig = toString(jwsSig); if (!isValidJws(jwsSig)) return null; var header = headerFromJWS(jwsSig); if (!header) return null; var payload = payloadFromJWS(jwsSig); if (header.typ === 'JWT' || opts.json) payload = JSON.parse(payload, opts.encoding); return { header: header, payload: payload, signature: signatureFromJWS(jwsSig) }; } function VerifyStream(opts) { opts = opts || {}; var secretOrKey = opts.secret||opts.publicKey||opts.key; var secretStream = new DataStream(secretOrKey); this.readable = true; this.algorithm = opts.algorithm; this.encoding = opts.encoding; this.secret = this.publicKey = this.key = secretStream; this.signature = new DataStream(opts.signature); this.secret.once('close', function () { if (!this.signature.writable && this.readable) this.verify(); }.bind(this)); this.signature.once('close', function () { if (!this.secret.writable && this.readable) this.verify(); }.bind(this)); } util.inherits(VerifyStream, Stream); VerifyStream.prototype.verify = function verify() { try { var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); var obj = jwsDecode(this.signature.buffer, this.encoding); this.emit('done', valid, obj); this.emit('data', valid); this.emit('end'); this.readable = false; return valid; } catch (e) { this.readable = false; this.emit('error', e); this.emit('close'); } }; VerifyStream.decode = jwsDecode; VerifyStream.isValid = isValidJws; VerifyStream.verify = jwsVerify; module.exports = VerifyStream; /***/ }), /***/ 7994: /***/ ((module) => { /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', rsComboSymbolsRange = '\\u20d0-\\u20f0', rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr, rsUpper + '+' + rsOptUpperContr, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 'ss' }; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array ? array.length : 0; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Built-in value references. */ var Symbol = root.Symbol; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && objectToString.call(value) == symbolTag); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. * @example * * _.camelCase('Foo Bar'); * // => 'fooBar' * * _.camelCase('--foo-bar--'); * // => 'fooBar' * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Converts the first character of `string` to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.upperFirst('fred'); * // => 'Fred' * * _.upperFirst('FRED'); * // => 'FRED' */ var upperFirst = createCaseFirst('toUpperCase'); /** * Splits `string` into an array of its words. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {RegExp|string} [pattern] The pattern to match words. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the words of `string`. * @example * * _.words('fred, barney, & pebbles'); * // => ['fred', 'barney', 'pebbles'] * * _.words('fred, barney, & pebbles', /[^, ]+/g); * // => ['fred', 'barney', '&', 'pebbles'] */ function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined : pattern; if (pattern === undefined) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } module.exports = camelCase; /***/ }), /***/ 9662: /***/ ((module) => { "use strict"; module.exports = object => { const result = {}; for (const [key, value] of Object.entries(object)) { result[key.toLowerCase()] = value; } return result; }; /***/ }), /***/ 7129: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // A linked list to keep track of recently-used-ness const Yallist = __webpack_require__(40665) const MAX = Symbol('max') const LENGTH = Symbol('length') const LENGTH_CALCULATOR = Symbol('lengthCalculator') const ALLOW_STALE = Symbol('allowStale') const MAX_AGE = Symbol('maxAge') const DISPOSE = Symbol('dispose') const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') const LRU_LIST = Symbol('lruList') const CACHE = Symbol('cache') const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') const naiveLength = () => 1 // lruList is a yallist where the head is the youngest // item, and the tail is the oldest. the list contains the Hit // objects as the entries. // Each Hit object has a reference to its Yallist.Node. This // never changes. // // cache is a Map (or PseudoMap) that matches the keys to // the Yallist.Node object. class LRUCache { constructor (options) { if (typeof options === 'number') options = { max: options } if (!options) options = {} if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number') // Kind of weird to have a default max of Infinity, but oh well. const max = this[MAX] = options.max || Infinity const lc = options.length || naiveLength this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc this[ALLOW_STALE] = options.stale || false if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number') this[MAX_AGE] = options.maxAge || 0 this[DISPOSE] = options.dispose this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false this.reset() } // resize the cache when the max changes. set max (mL) { if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number') this[MAX] = mL || Infinity trim(this) } get max () { return this[MAX] } set allowStale (allowStale) { this[ALLOW_STALE] = !!allowStale } get allowStale () { return this[ALLOW_STALE] } set maxAge (mA) { if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number') this[MAX_AGE] = mA trim(this) } get maxAge () { return this[MAX_AGE] } // resize the cache when the lengthCalculator changes. set lengthCalculator (lC) { if (typeof lC !== 'function') lC = naiveLength if (lC !== this[LENGTH_CALCULATOR]) { this[LENGTH_CALCULATOR] = lC this[LENGTH] = 0 this[LRU_LIST].forEach(hit => { hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) this[LENGTH] += hit.length }) } trim(this) } get lengthCalculator () { return this[LENGTH_CALCULATOR] } get length () { return this[LENGTH] } get itemCount () { return this[LRU_LIST].length } rforEach (fn, thisp) { thisp = thisp || this for (let walker = this[LRU_LIST].tail; walker !== null;) { const prev = walker.prev forEachStep(this, fn, walker, thisp) walker = prev } } forEach (fn, thisp) { thisp = thisp || this for (let walker = this[LRU_LIST].head; walker !== null;) { const next = walker.next forEachStep(this, fn, walker, thisp) walker = next } } keys () { return this[LRU_LIST].toArray().map(k => k.key) } values () { return this[LRU_LIST].toArray().map(k => k.value) } reset () { if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) } this[CACHE] = new Map() // hash of items by key this[LRU_LIST] = new Yallist() // list of items in order of use recency this[LENGTH] = 0 // length of items in the list } dump () { return this[LRU_LIST].map(hit => isStale(this, hit) ? false : { k: hit.key, v: hit.value, e: hit.now + (hit.maxAge || 0) }).toArray().filter(h => h) } dumpLru () { return this[LRU_LIST] } set (key, value, maxAge) { maxAge = maxAge || this[MAX_AGE] if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number') const now = maxAge ? Date.now() : 0 const len = this[LENGTH_CALCULATOR](value, key) if (this[CACHE].has(key)) { if (len > this[MAX]) { del(this, this[CACHE].get(key)) return false } const node = this[CACHE].get(key) const item = node.value // dispose of the old one before overwriting // split out into 2 ifs for better coverage tracking if (this[DISPOSE]) { if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value) } item.now = now item.maxAge = maxAge item.value = value this[LENGTH] += len - item.length item.length = len this.get(key) trim(this) return true } const hit = new Entry(key, value, len, now, maxAge) // oversized objects fall out of cache automatically. if (hit.length > this[MAX]) { if (this[DISPOSE]) this[DISPOSE](key, value) return false } this[LENGTH] += hit.length this[LRU_LIST].unshift(hit) this[CACHE].set(key, this[LRU_LIST].head) trim(this) return true } has (key) { if (!this[CACHE].has(key)) return false const hit = this[CACHE].get(key).value return !isStale(this, hit) } get (key) { return get(this, key, true) } peek (key) { return get(this, key, false) } pop () { const node = this[LRU_LIST].tail if (!node) return null del(this, node) return node.value } del (key) { del(this, this[CACHE].get(key)) } load (arr) { // reset the cache this.reset() const now = Date.now() // A previous serialized cache has the most recent items first for (let l = arr.length - 1; l >= 0; l--) { const hit = arr[l] const expiresAt = hit.e || 0 if (expiresAt === 0) // the item was created without expiration in a non aged cache this.set(hit.k, hit.v) else { const maxAge = expiresAt - now // dont add already expired items if (maxAge > 0) { this.set(hit.k, hit.v, maxAge) } } } } prune () { this[CACHE].forEach((value, key) => get(this, key, false)) } } const get = (self, key, doUse) => { const node = self[CACHE].get(key) if (node) { const hit = node.value if (isStale(self, hit)) { del(self, node) if (!self[ALLOW_STALE]) return undefined } else { if (doUse) { if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now() self[LRU_LIST].unshiftNode(node) } } return hit.value } } const isStale = (self, hit) => { if (!hit || (!hit.maxAge && !self[MAX_AGE])) return false const diff = Date.now() - hit.now return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && (diff > self[MAX_AGE]) } const trim = self => { if (self[LENGTH] > self[MAX]) { for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) { // We know that we're about to delete this one, and also // what the next least recently used key will be, so just // go ahead and set it now. const prev = walker.prev del(self, walker) walker = prev } } } const del = (self, node) => { if (node) { const hit = node.value if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value) self[LENGTH] -= hit.length self[CACHE].delete(hit.key) self[LRU_LIST].removeNode(node) } } class Entry { constructor (key, value, length, now, maxAge) { this.key = key this.value = value this.length = length this.now = now this.maxAge = maxAge || 0 } } const forEachStep = (self, fn, node, thisp) => { let hit = node.value if (isStale(self, hit)) { del(self, node) if (!self[ALLOW_STALE]) hit = undefined } if (hit) fn.call(thisp, hit.value, hit.key, self) } module.exports = LRUCache /***/ }), /***/ 21381: /***/ ((module, exports) => { "use strict"; // ISC @ Julien Fontanet // =================================================================== var construct = typeof Reflect !== "undefined" ? Reflect.construct : undefined; var defineProperty = Object.defineProperty; // ------------------------------------------------------------------- var captureStackTrace = Error.captureStackTrace; if (captureStackTrace === undefined) { captureStackTrace = function captureStackTrace(error) { var container = new Error(); defineProperty(error, "stack", { configurable: true, get: function getStack() { var stack = container.stack; // Replace property with value for faster future accesses. defineProperty(this, "stack", { configurable: true, value: stack, writable: true, }); return stack; }, set: function setStack(stack) { defineProperty(error, "stack", { configurable: true, value: stack, writable: true, }); }, }); }; } // ------------------------------------------------------------------- function BaseError(message) { if (message !== undefined) { defineProperty(this, "message", { configurable: true, value: message, writable: true, }); } var cname = this.constructor.name; if (cname !== undefined && cname !== this.name) { defineProperty(this, "name", { configurable: true, value: cname, writable: true, }); } captureStackTrace(this, this.constructor); } BaseError.prototype = Object.create(Error.prototype, { // See: https://github.com/JsCommunity/make-error/issues/4 constructor: { configurable: true, value: BaseError, writable: true, }, }); // ------------------------------------------------------------------- // Sets the name of a function if possible (depends of the JS engine). var setFunctionName = (function() { function setFunctionName(fn, name) { return defineProperty(fn, "name", { configurable: true, value: name, }); } try { var f = function() {}; setFunctionName(f, "foo"); if (f.name === "foo") { return setFunctionName; } } catch (_) {} })(); // ------------------------------------------------------------------- function makeError(constructor, super_) { if (super_ == null || super_ === Error) { super_ = BaseError; } else if (typeof super_ !== "function") { throw new TypeError("super_ should be a function"); } var name; if (typeof constructor === "string") { name = constructor; constructor = construct !== undefined ? function() { return construct(super_, arguments, this.constructor); } : function() { super_.apply(this, arguments); }; // If the name can be set, do it once and for all. if (setFunctionName !== undefined) { setFunctionName(constructor, name); name = undefined; } } else if (typeof constructor !== "function") { throw new TypeError("constructor should be either a string or a function"); } // Also register the super constructor also as `constructor.super_` just // like Node's `util.inherits()`. // // eslint-disable-next-line dot-notation constructor.super_ = constructor["super"] = super_; var properties = { constructor: { configurable: true, value: constructor, writable: true, }, }; // If the name could not be set on the constructor, set it on the // prototype. if (name !== undefined) { properties.name = { configurable: true, value: name, writable: true, }; } constructor.prototype = Object.create(super_.prototype, properties); return constructor; } exports = module.exports = makeError; exports.BaseError = BaseError; /***/ }), /***/ 47426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*! * mime-db * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ /** * Module exports. */ module.exports = __webpack_require__(73313) /***/ }), /***/ 43583: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. * @private */ var db = __webpack_require__(47426) var extname = __webpack_require__(85622).extname /** * Module variables. * @private */ var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ var TEXT_TYPE_REGEXP = /^text\//i /** * Module exports. * @public */ exports.charset = charset exports.charsets = { lookup: charset } exports.contentType = contentType exports.extension = extension exports.extensions = Object.create(null) exports.lookup = lookup exports.types = Object.create(null) // Populate the extensions/types maps populateMaps(exports.extensions, exports.types) /** * Get the default charset for a MIME type. * * @param {string} type * @return {boolean|string} */ function charset (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) var mime = match && db[match[1].toLowerCase()] if (mime && mime.charset) { return mime.charset } // default text/* to utf-8 if (match && TEXT_TYPE_REGEXP.test(match[1])) { return 'UTF-8' } return false } /** * Create a full Content-Type header given a MIME type or extension. * * @param {string} str * @return {boolean|string} */ function contentType (str) { // TODO: should this even be in this module? if (!str || typeof str !== 'string') { return false } var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str if (!mime) { return false } // TODO: use content-type or other module if (mime.indexOf('charset') === -1) { var charset = exports.charset(mime) if (charset) mime += '; charset=' + charset.toLowerCase() } return mime } /** * Get the default extension for a MIME type. * * @param {string} type * @return {boolean|string} */ function extension (type) { if (!type || typeof type !== 'string') { return false } // TODO: use media-typer var match = EXTRACT_TYPE_REGEXP.exec(type) // get extensions var exts = match && exports.extensions[match[1].toLowerCase()] if (!exts || !exts.length) { return false } return exts[0] } /** * Lookup the MIME type for a file path/extension. * * @param {string} path * @return {boolean|string} */ function lookup (path) { if (!path || typeof path !== 'string') { return false } // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path) .toLowerCase() .substr(1) if (!extension) { return false } return exports.types[extension] || false } /** * Populate the extensions and types maps. * @private */ function populateMaps (extensions, types) { // source preference (least -> most) var preference = ['nginx', 'apache', undefined, 'iana'] Object.keys(db).forEach(function forEachMimeType (type) { var mime = db[type] var exts = mime.extensions if (!exts || !exts.length) { return } // mime -> extensions extensions[type] = exts // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i] if (types[extension]) { var from = preference.indexOf(db[types[extension]].source) var to = preference.indexOf(mime.source) if (types[extension] !== 'application/octet-stream' && (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { // skip the remapping continue } } // set the extension -> mime types[extension] = type } }) } /***/ }), /***/ 42610: /***/ ((module) => { "use strict"; // We define these manually to ensure they're always copied // even if they would move up the prototype chain // https://nodejs.org/api/http.html#http_class_http_incomingmessage const knownProps = [ 'destroy', 'setTimeout', 'socket', 'headers', 'trailers', 'rawHeaders', 'statusCode', 'httpVersion', 'httpVersionMinor', 'httpVersionMajor', 'rawTrailers', 'statusMessage' ]; module.exports = (fromStream, toStream) => { const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); for (const prop of fromProps) { // Don't overwrite existing properties if (prop in toStream) { continue; } toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; } }; /***/ }), /***/ 83973: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = minimatch minimatch.Minimatch = Minimatch var path = { sep: '/' } try { path = __webpack_require__(85622) } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = __webpack_require__(33717) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, '?': { open: '(?:', close: ')?' }, '+': { open: '(?:', close: ')+' }, '*': { open: '(?:', close: ')*' }, '@': { open: '(?:', close: ')' } } // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' // * => any number of characters var star = qmark + '*?' // ** when dots are allowed. Anything goes, except .. and . // not (^ or / followed by one or two dots followed by $ or /), // followed by anything, any number of times. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' // not a ^ or / followed by a dot, // followed by anything, any number of times. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' // characters that need to be escaped in RegExp. var reSpecials = charSet('().*{}+?[]^$\\!') // "abc" -> { a:true, b:true, c:true } function charSet (s) { return s.split('').reduce(function (set, c) { set[c] = true return set }, {}) } // normalizes slashes. var slashSplit = /\/+/ minimatch.filter = filter function filter (pattern, options) { options = options || {} return function (p, i, list) { return minimatch(p, pattern, options) } } function ext (a, b) { a = a || {} b = b || {} var t = {} Object.keys(b).forEach(function (k) { t[k] = b[k] }) Object.keys(a).forEach(function (k) { t[k] = a[k] }) return t } minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return minimatch var orig = minimatch var m = function minimatch (p, pattern, options) { return orig.minimatch(p, pattern, ext(def, options)) } m.Minimatch = function Minimatch (pattern, options) { return new orig.Minimatch(pattern, ext(def, options)) } return m } Minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return Minimatch return minimatch.defaults(def).Minimatch } function minimatch (p, pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required') } if (!options) options = {} // shortcut: comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { return false } // "" only matches "" if (pattern.trim() === '') return p === '' return new Minimatch(pattern, options).match(p) } function Minimatch (pattern, options) { if (!(this instanceof Minimatch)) { return new Minimatch(pattern, options) } if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required') } if (!options) options = {} pattern = pattern.trim() // windows support: need to use /, not \ if (path.sep !== '/') { pattern = pattern.split(path.sep).join('/') } this.options = options this.set = [] this.pattern = pattern this.regexp = null this.negate = false this.comment = false this.empty = false // make the set of regexps etc. this.make() } Minimatch.prototype.debug = function () {} Minimatch.prototype.make = make function make () { // don't do it more than once. if (this._made) return var pattern = this.pattern var options = this.options // empty patterns and comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true return } if (!pattern) { this.empty = true return } // step 1: figure out negation, etc. this.parseNegate() // step 2: expand braces var set = this.globSet = this.braceExpand() if (options.debug) this.debug = console.error this.debug(this.pattern, set) // step 3: now we have a set, so turn each one into a series of path-portion // matching patterns. // These will be regexps, except in the case of "**", which is // set to the GLOBSTAR object for globstar behavior, // and will not contain any / characters set = this.globParts = set.map(function (s) { return s.split(slashSplit) }) this.debug(this.pattern, set) // glob --> regexps set = set.map(function (s, si, set) { return s.map(this.parse, this) }, this) this.debug(this.pattern, set) // filter out everything that didn't compile properly. set = set.filter(function (s) { return s.indexOf(false) === -1 }) this.debug(this.pattern, set) this.set = set } Minimatch.prototype.parseNegate = parseNegate function parseNegate () { var pattern = this.pattern var negate = false var options = this.options var negateOffset = 0 if (options.nonegate) return for (var i = 0, l = pattern.length ; i < l && pattern.charAt(i) === '!' ; i++) { negate = !negate negateOffset++ } if (negateOffset) this.pattern = pattern.substr(negateOffset) this.negate = negate } // Brace expansion: // a{b,c}d -> abd acd // a{b,}c -> abc ac // a{0..3}d -> a0d a1d a2d a3d // a{b,c{d,e}f}g -> abg acdfg acefg // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg // // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { return braceExpand(pattern, options) } Minimatch.prototype.braceExpand = braceExpand function braceExpand (pattern, options) { if (!options) { if (this instanceof Minimatch) { options = this.options } else { options = {} } } pattern = typeof pattern === 'undefined' ? this.pattern : pattern if (typeof pattern === 'undefined') { throw new TypeError('undefined pattern') } if (options.nobrace || !pattern.match(/\{.*\}/)) { // shortcut. no need to expand. return [pattern] } return expand(pattern) } // parse a component of the expanded set. // At this point, no pattern may contain "/" in it // so we're going to return a 2d array, where each entry is the full // pattern, split on '/', and then turned into a regular expression. // A regexp is made at the end which joins each array with an // escaped /, and another full one which joins each regexp with |. // // Following the lead of Bash 4.1, note that "**" only has special meaning // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { if (pattern.length > 1024 * 64) { throw new TypeError('pattern is too long') } var options = this.options // shortcuts if (!options.noglobstar && pattern === '**') return GLOBSTAR if (pattern === '') return '' var re = '' var hasMagic = !!options.nocase var escaping = false // ? => one single character var patternListStack = [] var negativeLists = [] var stateChar var inClass = false var reClassStart = -1 var classStart = -1 // . and .. never match anything that doesn't start with ., // even when options.dot is set. var patternStart = pattern.charAt(0) === '.' ? '' // anything // not (start or / followed by . or .. followed by / or end) : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)' var self = this function clearStateChar () { if (stateChar) { // we had some state-tracking character // that wasn't consumed by this pass. switch (stateChar) { case '*': re += star hasMagic = true break case '?': re += qmark hasMagic = true break default: re += '\\' + stateChar break } self.debug('clearStateChar %j %j', stateChar, re) stateChar = false } } for (var i = 0, len = pattern.length, c ; (i < len) && (c = pattern.charAt(i)) ; i++) { this.debug('%s\t%s %s %j', pattern, i, re, c) // skip over any that are escaped. if (escaping && reSpecials[c]) { re += '\\' + c escaping = false continue } switch (c) { case '/': // completely not allowed, even escaped. // Should already be path-split by now. return false case '\\': clearStateChar() escaping = true continue // the various stateChar values // for the "extglob" stuff. case '?': case '*': case '+': case '@': case '!': this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) // all of those are literals inside a class, except that // the glob [!a] means [^a] in regexp if (inClass) { this.debug(' in class') if (c === '!' && i === classStart + 1) c = '^' re += c continue } // if we already have a stateChar, then it means // that there was something like ** or +? in there. // Handle the stateChar, then proceed with this one. self.debug('call clearStateChar %j', stateChar) clearStateChar() stateChar = c // if extglob is disabled, then +(asdf|foo) isn't a thing. // just clear the statechar *now*, rather than even diving into // the patternList stuff. if (options.noext) clearStateChar() continue case '(': if (inClass) { re += '(' continue } if (!stateChar) { re += '\\(' continue } patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false continue case ')': if (inClass || !patternListStack.length) { re += '\\)' continue } clearStateChar() hasMagic = true var pl = patternListStack.pop() // negation is (?:(?!js)[^/]*) // The others are (?:) re += pl.close if (pl.type === '!') { negativeLists.push(pl) } pl.reEnd = re.length continue case '|': if (inClass || !patternListStack.length || escaping) { re += '\\|' escaping = false continue } clearStateChar() re += '|' continue // these are mostly the same in regexp and glob case '[': // swallow any state-tracking char before the [ clearStateChar() if (inClass) { re += '\\' + c continue } inClass = true classStart = i reClassStart = re.length re += c continue case ']': // a right bracket shall lose its special // meaning and represent itself in // a bracket expression if it occurs // first in the list. -- POSIX.2 2.8.3.2 if (i === classStart + 1 || !inClass) { re += '\\' + c escaping = false continue } // handle the case where we left a class open. // "[z-a]" is valid, equivalent to "\[z-a\]" if (inClass) { // split where the last [ was, make sure we don't have // an invalid re. if so, re-walk the contents of the // would-be class to re-translate any characters that // were passed through as-is // TODO: It would probably be faster to determine this // without a try/catch and a new RegExp, but it's tricky // to do safely. For now, this is safe and works. var cs = pattern.substring(classStart + 1, i) try { RegExp('[' + cs + ']') } catch (er) { // not a valid class! var sp = this.parse(cs, SUBPARSE) re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' hasMagic = hasMagic || sp[1] inClass = false continue } } // finish up the class. hasMagic = true inClass = false re += c continue default: // swallow any state char that wasn't consumed clearStateChar() if (escaping) { // no need escaping = false } else if (reSpecials[c] && !(c === '^' && inClass)) { re += '\\' } re += c } // switch } // for // handle the case where we left a class open. // "[abc" is valid, equivalent to "\[abc" if (inClass) { // split where the last [ was, and escape it // this is a huge pita. We now have to re-walk // the contents of the would-be class to re-translate // any characters that were passed through as-is cs = pattern.substr(classStart + 1) sp = this.parse(cs, SUBPARSE) re = re.substr(0, reClassStart) + '\\[' + sp[0] hasMagic = hasMagic || sp[1] } // handle the case where we had a +( thing at the *end* // of the pattern. // each pattern list stack adds 3 chars, and we need to go through // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length) this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' } // need to escape all those slashes *again*, without escaping the // one that we need for escaping the | character. As it works out, // escaping an even number of slashes can be done by simply repeating // it exactly after itself. That's why this trick works. // // I am sorry that you have to see this. return $1 + $1 + $2 + '|' }) this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type hasMagic = true re = re.slice(0, pl.reStart) + t + '\\(' + tail } // handle trailing things that only matter at the very end. clearStateChar() if (escaping) { // trailing \\ re += '\\\\' } // only need to apply the nodot start if the re starts with // something that could conceivably capture a dot var addPatternStart = false switch (re.charAt(0)) { case '.': case '[': case '(': addPatternStart = true } // Hack to work around lack of negative lookbehind in JS // A pattern like: *.!(x).!(y|z) needs to ensure that a name // like 'a.xyz.yz' doesn't match. So, the first negative // lookahead, has to look ALL the way ahead, to the end of // the pattern. for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n] var nlBefore = re.slice(0, nl.reStart) var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) var nlAfter = re.slice(nl.reEnd) nlLast += nlAfter // Handle nested stuff like *(*.js|!(*.json)), where open parens // mean that we should *not* include the ) in the bit that is considered // "after" the negated section. var openParensBefore = nlBefore.split('(').length - 1 var cleanAfter = nlAfter for (i = 0; i < openParensBefore; i++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') } nlAfter = cleanAfter var dollar = '' if (nlAfter === '' && isSub !== SUBPARSE) { dollar = '$' } var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast re = newRe } // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. if (re !== '' && hasMagic) { re = '(?=.)' + re } if (addPatternStart) { re = patternStart + re } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { return [re, hasMagic] } // skip the regexp for non-magical patterns // unescape anything in it, though, so that it'll be // an exact match against a file etc. if (!hasMagic) { return globUnescape(pattern) } var flags = options.nocase ? 'i' : '' try { var regExp = new RegExp('^' + re + '$', flags) } catch (er) { // If it was an invalid regular expression, then it can't match // anything. This trick looks for a character after the end of // the string, which is of course impossible, except in multi-line // mode, but it's not a /m regex. return new RegExp('$.') } regExp._glob = pattern regExp._src = re return regExp } minimatch.makeRe = function (pattern, options) { return new Minimatch(pattern, options || {}).makeRe() } Minimatch.prototype.makeRe = makeRe function makeRe () { if (this.regexp || this.regexp === false) return this.regexp // at this point, this.set is a 2d array of partial // pattern strings, or "**". // // It's better to use .match(). This function shouldn't // be used, really, but it's pretty convenient sometimes, // when you just want to work with a regex. var set = this.set if (!set.length) { this.regexp = false return this.regexp } var options = this.options var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot var flags = options.nocase ? 'i' : '' var re = set.map(function (pattern) { return pattern.map(function (p) { return (p === GLOBSTAR) ? twoStar : (typeof p === 'string') ? regExpEscape(p) : p._src }).join('\\\/') }).join('|') // must match entire pattern // ending in a * or ** will make it less strict. re = '^(?:' + re + ')$' // can match anything, as long as it's not this. if (this.negate) re = '^(?!' + re + ').*$' try { this.regexp = new RegExp(re, flags) } catch (ex) { this.regexp = false } return this.regexp } minimatch.match = function (list, pattern, options) { options = options || {} var mm = new Minimatch(pattern, options) list = list.filter(function (f) { return mm.match(f) }) if (mm.options.nonull && !list.length) { list.push(pattern) } return list } Minimatch.prototype.match = match function match (f, partial) { this.debug('match', f, this.pattern) // short-circuit in the case of busted things. // comments, etc. if (this.comment) return false if (this.empty) return f === '' if (f === '/' && partial) return true var options = this.options // windows: need to use /, not \ if (path.sep !== '/') { f = f.split(path.sep).join('/') } // treat the test path as a set of pathparts. f = f.split(slashSplit) this.debug(this.pattern, 'split', f) // just ONE of the pattern sets in this.set needs to match // in order for it to be valid. If negating, then just one // match means that we have failed. // Either way, return on the first hit. var set = this.set this.debug(this.pattern, 'set', set) // Find the basename of the path by looking for the last non-empty segment var filename var i for (i = f.length - 1; i >= 0; i--) { filename = f[i] if (filename) break } for (i = 0; i < set.length; i++) { var pattern = set[i] var file = f if (options.matchBase && pattern.length === 1) { file = [filename] } var hit = this.matchOne(file, pattern, partial) if (hit) { if (options.flipNegate) return true return !this.negate } } // didn't get any hits. this is success if it's a negative // pattern, failure otherwise. if (options.flipNegate) return false return this.negate } // set partial to true to test if, for example, // "/a/b" matches the start of "/*/b/*/d" // Partial means, if you run out of file before you run // out of pattern, then that's fine, as long as all // the parts match. Minimatch.prototype.matchOne = function (file, pattern, partial) { var options = this.options this.debug('matchOne', { 'this': this, file: file, pattern: pattern }) this.debug('matchOne', file.length, pattern.length) for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length ; (fi < fl) && (pi < pl) ; fi++, pi++) { this.debug('matchOne loop') var p = pattern[pi] var f = file[fi] this.debug(pattern, p, f) // should be impossible. // some invalid regexp stuff in the set. if (p === false) return false if (p === GLOBSTAR) { this.debug('GLOBSTAR', [pattern, p, f]) // "**" // a/**/b/**/c would match the following: // a/b/x/y/z/c // a/x/y/z/b/c // a/b/x/b/x/c // a/b/c // To do this, take the rest of the pattern after // the **, and see if it would match the file remainder. // If so, return success. // If not, the ** "swallows" a segment, and try again. // This is recursively awful. // // a/**/b/**/c matching a/b/x/y/z/c // - a matches a // - doublestar // - matchOne(b/x/y/z/c, b/**/c) // - b matches b // - doublestar // - matchOne(x/y/z/c, c) -> no // - matchOne(y/z/c, c) -> no // - matchOne(z/c, c) -> no // - matchOne(c, c) yes, hit var fr = fi var pr = pi + 1 if (pr === pl) { this.debug('** at the end') // a ** at the end will just swallow the rest. // We have found a match. // however, it will not swallow /.x, unless // options.dot is set. // . and .. are *never* matched by **, for explosively // exponential reasons. for (; fi < fl; fi++) { if (file[fi] === '.' || file[fi] === '..' || (!options.dot && file[fi].charAt(0) === '.')) return false } return true } // ok, let's see if we can swallow whatever we can. while (fr < fl) { var swallowee = file[fr] this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) // XXX remove this slice. Just pass the start index. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { this.debug('globstar found match!', fr, fl, swallowee) // found a match. return true } else { // can't swallow "." or ".." ever. // can only swallow ".foo" when explicitly asked. if (swallowee === '.' || swallowee === '..' || (!options.dot && swallowee.charAt(0) === '.')) { this.debug('dot detected!', file, fr, pattern, pr) break } // ** swallows a segment, and continue. this.debug('globstar swallow a segment, and continue') fr++ } } // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then if (partial) { // ran out of file this.debug('\n>>> no match, partial?', file, fr, pattern, pr) if (fr === fl) return true } return false } // something other than ** // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. var hit if (typeof p === 'string') { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase() } else { hit = f === p } this.debug('string match', p, f, hit) } else { hit = f.match(p) this.debug('pattern match', p, f, hit) } if (!hit) return false } // Note: ending in / means that we'll get a final "" // at the end of the pattern. This can only match a // corresponding "" at the end of the file. // If the file ends in /, then it can only match a // a pattern that ends in /, unless the pattern just // doesn't have any more for it. But, a/b/ should *not* // match "a/b/*", even though "" matches against the // [^/]*? pattern, except in partial mode, where it might // simply not be reached yet. // However, a/b/ should still satisfy a/* // now either we fell off the end of the pattern, or we're done. if (fi === fl && pi === pl) { // ran out of pattern and filename at the same time. // an exact hit! return true } else if (fi === fl) { // ran out of file, but still had pattern left. // this is ok if we're doing the match as part of // a glob fs traversal. return partial } else if (pi === pl) { // ran out of pattern, still have file left. // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') return emptyFileEnd } // should be unreachable. throw new Error('wtf?') } // replace stuff like \* with * function globUnescape (s) { return s.replace(/\\(.)/g, '$1') } function regExpEscape (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } /***/ }), /***/ 73078: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EE = __webpack_require__(28614) const Stream = __webpack_require__(92413) const Yallist = __webpack_require__(40665) const SD = __webpack_require__(24304).StringDecoder const EOF = Symbol('EOF') const MAYBE_EMIT_END = Symbol('maybeEmitEnd') const EMITTED_END = Symbol('emittedEnd') const EMITTING_END = Symbol('emittingEnd') const CLOSED = Symbol('closed') const READ = Symbol('read') const FLUSH = Symbol('flush') const FLUSHCHUNK = Symbol('flushChunk') const ENCODING = Symbol('encoding') const DECODER = Symbol('decoder') const FLOWING = Symbol('flowing') const PAUSED = Symbol('paused') const RESUME = Symbol('resume') const BUFFERLENGTH = Symbol('bufferLength') const BUFFERPUSH = Symbol('bufferPush') const BUFFERSHIFT = Symbol('bufferShift') const OBJECTMODE = Symbol('objectMode') const DESTROYED = Symbol('destroyed') // TODO remove when Node v8 support drops const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' const ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol('asyncIterator not implemented') const ITERATOR = doIter && Symbol.iterator || Symbol('iterator not implemented') // events that mean 'the stream is over' // these are treated specially, and re-emitted // if they are listened for after emitting. const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish' const isArrayBuffer = b => b instanceof ArrayBuffer || typeof b === 'object' && b.constructor && b.constructor.name === 'ArrayBuffer' && b.byteLength >= 0 const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) module.exports = class Minipass extends Stream { constructor (options) { super() this[FLOWING] = false // whether we're explicitly paused this[PAUSED] = false this.pipes = new Yallist() this.buffer = new Yallist() this[OBJECTMODE] = options && options.objectMode || false if (this[OBJECTMODE]) this[ENCODING] = null else this[ENCODING] = options && options.encoding || null if (this[ENCODING] === 'buffer') this[ENCODING] = null this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null this[EOF] = false this[EMITTED_END] = false this[EMITTING_END] = false this[CLOSED] = false this.writable = true this.readable = true this[BUFFERLENGTH] = 0 this[DESTROYED] = false } get bufferLength () { return this[BUFFERLENGTH] } get encoding () { return this[ENCODING] } set encoding (enc) { if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode') if (this[ENCODING] && enc !== this[ENCODING] && (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) throw new Error('cannot change encoding') if (this[ENCODING] !== enc) { this[DECODER] = enc ? new SD(enc) : null if (this.buffer.length) this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) } this[ENCODING] = enc } setEncoding (enc) { this.encoding = enc } get objectMode () { return this[OBJECTMODE] } set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om } write (chunk, encoding, cb) { if (this[EOF]) throw new Error('write after end') if (this[DESTROYED]) { this.emit('error', Object.assign( new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' } )) return true } if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (!encoding) encoding = 'utf8' // convert array buffers and typed array views into buffers // at some point in the future, we may want to do the opposite! // leave strings and buffers as-is // anything else switches us into object mode if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { if (isArrayBufferView(chunk)) chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk) else if (typeof chunk !== 'string') // use the setter so we throw if we have encoding set this.objectMode = true } // this ensures at this point that the chunk is a buffer or string // don't buffer it up or send it to the decoder if (!this.objectMode && !chunk.length) { if (this[BUFFERLENGTH] !== 0) this.emit('readable') if (cb) cb() return this.flowing } // fast-path writing strings of same encoding to a stream with // an empty buffer, skipping the buffer/decoder dance if (typeof chunk === 'string' && !this[OBJECTMODE] && // unless it is a string already ready for us to use !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { chunk = Buffer.from(chunk, encoding) } if (Buffer.isBuffer(chunk) && this[ENCODING]) chunk = this[DECODER].write(chunk) if (this.flowing) { // if we somehow have something in the buffer, but we think we're // flowing, then we need to flush all that out first, or we get // chunks coming in out of order. Can't emit 'drain' here though, // because we're mid-write, so that'd be bad. if (this[BUFFERLENGTH] !== 0) this[FLUSH](true) this.emit('data', chunk) } else this[BUFFERPUSH](chunk) if (this[BUFFERLENGTH] !== 0) this.emit('readable') if (cb) cb() return this.flowing } read (n) { if (this[DESTROYED]) return null try { if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) return null if (this[OBJECTMODE]) n = null if (this.buffer.length > 1 && !this[OBJECTMODE]) { if (this.encoding) this.buffer = new Yallist([ Array.from(this.buffer).join('') ]) else this.buffer = new Yallist([ Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH]) ]) } return this[READ](n || null, this.buffer.head.value) } finally { this[MAYBE_EMIT_END]() } } [READ] (n, chunk) { if (n === chunk.length || n === null) this[BUFFERSHIFT]() else { this.buffer.head.value = chunk.slice(n) chunk = chunk.slice(0, n) this[BUFFERLENGTH] -= n } this.emit('data', chunk) if (!this.buffer.length && !this[EOF]) this.emit('drain') return chunk } end (chunk, encoding, cb) { if (typeof chunk === 'function') cb = chunk, chunk = null if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (chunk) this.write(chunk, encoding) if (cb) this.once('end', cb) this[EOF] = true this.writable = false // if we haven't written anything, then go ahead and emit, // even if we're not reading. // we'll re-emit if a new 'end' listener is added anyway. // This makes MP more suitable to write-only use cases. if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() return this } // don't let the internal resume be overwritten [RESUME] () { if (this[DESTROYED]) return this[PAUSED] = false this[FLOWING] = true this.emit('resume') if (this.buffer.length) this[FLUSH]() else if (this[EOF]) this[MAYBE_EMIT_END]() else this.emit('drain') } resume () { return this[RESUME]() } pause () { this[FLOWING] = false this[PAUSED] = true } get destroyed () { return this[DESTROYED] } get flowing () { return this[FLOWING] } get paused () { return this[PAUSED] } [BUFFERPUSH] (chunk) { if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 else this[BUFFERLENGTH] += chunk.length return this.buffer.push(chunk) } [BUFFERSHIFT] () { if (this.buffer.length) { if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1 else this[BUFFERLENGTH] -= this.buffer.head.value.length } return this.buffer.shift() } [FLUSH] (noDrain) { do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) if (!noDrain && !this.buffer.length && !this[EOF]) this.emit('drain') } [FLUSHCHUNK] (chunk) { return chunk ? (this.emit('data', chunk), this.flowing) : false } pipe (dest, opts) { if (this[DESTROYED]) return const ended = this[EMITTED_END] opts = opts || {} if (dest === process.stdout || dest === process.stderr) opts.end = false else opts.end = opts.end !== false const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } this.pipes.push(p) dest.on('drain', p.ondrain) this[RESUME]() // piping an ended stream ends immediately if (ended && p.opts.end) p.dest.end() return dest } addListener (ev, fn) { return this.on(ev, fn) } on (ev, fn) { try { return super.on(ev, fn) } finally { if (ev === 'data' && !this.pipes.length && !this.flowing) this[RESUME]() else if (isEndish(ev) && this[EMITTED_END]) { super.emit(ev) this.removeAllListeners(ev) } } } get emittedEnd () { return this[EMITTED_END] } [MAYBE_EMIT_END] () { if (!this[EMITTING_END] && !this[EMITTED_END] && !this[DESTROYED] && this.buffer.length === 0 && this[EOF]) { this[EMITTING_END] = true this.emit('end') this.emit('prefinish') this.emit('finish') if (this[CLOSED]) this.emit('close') this[EMITTING_END] = false } } emit (ev, data) { // error and close are only events allowed after calling destroy() if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) return else if (ev === 'data') { if (!data) return if (this.pipes.length) this.pipes.forEach(p => p.dest.write(data) === false && this.pause()) } else if (ev === 'end') { // only actual end gets this treatment if (this[EMITTED_END] === true) return this[EMITTED_END] = true this.readable = false if (this[DECODER]) { data = this[DECODER].end() if (data) { this.pipes.forEach(p => p.dest.write(data)) super.emit('data', data) } } this.pipes.forEach(p => { p.dest.removeListener('drain', p.ondrain) if (p.opts.end) p.dest.end() }) } else if (ev === 'close') { this[CLOSED] = true // don't emit close before 'end' and 'finish' if (!this[EMITTED_END] && !this[DESTROYED]) return } // TODO: replace with a spread operator when Node v4 support drops const args = new Array(arguments.length) args[0] = ev args[1] = data if (arguments.length > 2) { for (let i = 2; i < arguments.length; i++) { args[i] = arguments[i] } } try { return super.emit.apply(this, args) } finally { if (!isEndish(ev)) this[MAYBE_EMIT_END]() else this.removeAllListeners(ev) } } // const all = await stream.collect() collect () { const buf = [] if (!this[OBJECTMODE]) buf.dataLength = 0 // set the promise first, in case an error is raised // by triggering the flow here. const p = this.promise() this.on('data', c => { buf.push(c) if (!this[OBJECTMODE]) buf.dataLength += c.length }) return p.then(() => buf) } // const data = await stream.concat() concat () { return this[OBJECTMODE] ? Promise.reject(new Error('cannot concat in objectMode')) : this.collect().then(buf => this[OBJECTMODE] ? Promise.reject(new Error('cannot concat in objectMode')) : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength)) } // stream.promise().then(() => done, er => emitted error) promise () { return new Promise((resolve, reject) => { this.on(DESTROYED, () => reject(new Error('stream destroyed'))) this.on('end', () => resolve()) this.on('error', er => reject(er)) }) } // for await (let chunk of stream) [ASYNCITERATOR] () { const next = () => { const res = this.read() if (res !== null) return Promise.resolve({ done: false, value: res }) if (this[EOF]) return Promise.resolve({ done: true }) let resolve = null let reject = null const onerr = er => { this.removeListener('data', ondata) this.removeListener('end', onend) reject(er) } const ondata = value => { this.removeListener('error', onerr) this.removeListener('end', onend) this.pause() resolve({ value: value, done: !!this[EOF] }) } const onend = () => { this.removeListener('error', onerr) this.removeListener('data', ondata) resolve({ done: true }) } const ondestroy = () => onerr(new Error('stream destroyed')) return new Promise((res, rej) => { reject = rej resolve = res this.once(DESTROYED, ondestroy) this.once('error', onerr) this.once('end', onend) this.once('data', ondata) }) } return { next } } // for (let chunk of stream) [ITERATOR] () { const next = () => { const value = this.read() const done = value === null return { value, done } } return { next } } destroy (er) { if (this[DESTROYED]) { if (er) this.emit('error', er) else this.emit(DESTROYED) return this } this[DESTROYED] = true // throw away all buffered data, it's never coming out this.buffer = new Yallist() this[BUFFERLENGTH] = 0 if (typeof this.close === 'function' && !this[CLOSED]) this.close() if (er) this.emit('error', er) else // if no error to emit, still reject pending promises this.emit(DESTROYED) return this } static isStream (s) { return !!s && (s instanceof Minipass || s instanceof Stream || s instanceof EE && ( typeof s.pipe === 'function' || // readable (typeof s.write === 'function' && typeof s.end === 'function') // writable )) } } /***/ }), /***/ 642: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Update with any zlib constants that are added or changed in the future. // Node v6 didn't export this, so we just hard code the version and rely // on all the other hard-coded values from zlib v4736. When node v6 // support drops, we can just export the realZlibConstants object. const realZlibConstants = __webpack_require__(78761).constants || /* istanbul ignore next */ { ZLIB_VERNUM: 4736 } module.exports = Object.freeze(Object.assign(Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: Infinity, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31, }, realZlibConstants)) /***/ }), /***/ 33486: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; const assert = __webpack_require__(42357) const Buffer = __webpack_require__(64293).Buffer const realZlib = __webpack_require__(78761) const constants = exports.constants = __webpack_require__(642) const Minipass = __webpack_require__(73078) const OriginalBufferConcat = Buffer.concat const _superWrite = Symbol('_superWrite') class ZlibError extends Error { constructor (err) { super('zlib: ' + err.message) this.code = err.code this.errno = err.errno /* istanbul ignore if */ if (!this.code) this.code = 'ZLIB_ERROR' this.message = 'zlib: ' + err.message Error.captureStackTrace(this, this.constructor) } get name () { return 'ZlibError' } } // the Zlib class they all inherit from // This thing manages the queue of requests, and returns // true or false if there is anything in the queue when // you call the .write() method. const _opts = Symbol('opts') const _flushFlag = Symbol('flushFlag') const _finishFlushFlag = Symbol('finishFlushFlag') const _fullFlushFlag = Symbol('fullFlushFlag') const _handle = Symbol('handle') const _onError = Symbol('onError') const _sawError = Symbol('sawError') const _level = Symbol('level') const _strategy = Symbol('strategy') const _ended = Symbol('ended') const _defaultFullFlush = Symbol('_defaultFullFlush') class ZlibBase extends Minipass { constructor (opts, mode) { if (!opts || typeof opts !== 'object') throw new TypeError('invalid options for ZlibBase constructor') super(opts) this[_sawError] = false this[_ended] = false this[_opts] = opts this[_flushFlag] = opts.flush this[_finishFlushFlag] = opts.finishFlush // this will throw if any options are invalid for the class selected try { this[_handle] = new realZlib[mode](opts) } catch (er) { // make sure that all errors get decorated properly throw new ZlibError(er) } this[_onError] = (err) => { // no sense raising multiple errors, since we abort on the first one. if (this[_sawError]) return this[_sawError] = true // there is no way to cleanly recover. // continuing only obscures problems. this.close() this.emit('error', err) } this[_handle].on('error', er => this[_onError](new ZlibError(er))) this.once('end', () => this.close) } close () { if (this[_handle]) { this[_handle].close() this[_handle] = null this.emit('close') } } reset () { if (!this[_sawError]) { assert(this[_handle], 'zlib binding closed') return this[_handle].reset() } } flush (flushFlag) { if (this.ended) return if (typeof flushFlag !== 'number') flushFlag = this[_fullFlushFlag] this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag })) } end (chunk, encoding, cb) { if (chunk) this.write(chunk, encoding) this.flush(this[_finishFlushFlag]) this[_ended] = true return super.end(null, null, cb) } get ended () { return this[_ended] } write (chunk, encoding, cb) { // process the chunk using the sync process // then super.write() all the outputted chunks if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (typeof chunk === 'string') chunk = Buffer.from(chunk, encoding) if (this[_sawError]) return assert(this[_handle], 'zlib binding closed') // _processChunk tries to .close() the native handle after it's done, so we // intercept that by temporarily making it a no-op. const nativeHandle = this[_handle]._handle const originalNativeClose = nativeHandle.close nativeHandle.close = () => {} const originalClose = this[_handle].close this[_handle].close = () => {} // It also calls `Buffer.concat()` at the end, which may be convenient // for some, but which we are not interested in as it slows us down. Buffer.concat = (args) => args let result try { const flushFlag = typeof chunk[_flushFlag] === 'number' ? chunk[_flushFlag] : this[_flushFlag] result = this[_handle]._processChunk(chunk, flushFlag) // if we don't throw, reset it back how it was Buffer.concat = OriginalBufferConcat } catch (err) { // or if we do, put Buffer.concat() back before we emit error // Error events call into user code, which may call Buffer.concat() Buffer.concat = OriginalBufferConcat this[_onError](new ZlibError(err)) } finally { if (this[_handle]) { // Core zlib resets `_handle` to null after attempting to close the // native handle. Our no-op handler prevented actual closure, but we // need to restore the `._handle` property. this[_handle]._handle = nativeHandle nativeHandle.close = originalNativeClose this[_handle].close = originalClose // `_processChunk()` adds an 'error' listener. If we don't remove it // after each call, these handlers start piling up. this[_handle].removeAllListeners('error') // make sure OUR error listener is still attached tho } } if (this[_handle]) this[_handle].on('error', er => this[_onError](new ZlibError(er))) let writeReturn if (result) { if (Array.isArray(result) && result.length > 0) { // The first buffer is always `handle._outBuffer`, which would be // re-used for later invocations; so, we always have to copy that one. writeReturn = this[_superWrite](Buffer.from(result[0])) for (let i = 1; i < result.length; i++) { writeReturn = this[_superWrite](result[i]) } } else { writeReturn = this[_superWrite](Buffer.from(result)) } } if (cb) cb() return writeReturn } [_superWrite] (data) { return super.write(data) } } class Zlib extends ZlibBase { constructor (opts, mode) { opts = opts || {} opts.flush = opts.flush || constants.Z_NO_FLUSH opts.finishFlush = opts.finishFlush || constants.Z_FINISH super(opts, mode) this[_fullFlushFlag] = constants.Z_FULL_FLUSH this[_level] = opts.level this[_strategy] = opts.strategy } params (level, strategy) { if (this[_sawError]) return if (!this[_handle]) throw new Error('cannot switch params when binding is closed') // no way to test this without also not supporting params at all /* istanbul ignore if */ if (!this[_handle].params) throw new Error('not supported in this implementation') if (this[_level] !== level || this[_strategy] !== strategy) { this.flush(constants.Z_SYNC_FLUSH) assert(this[_handle], 'zlib binding closed') // .params() calls .flush(), but the latter is always async in the // core zlib. We override .flush() temporarily to intercept that and // flush synchronously. const origFlush = this[_handle].flush this[_handle].flush = (flushFlag, cb) => { this.flush(flushFlag) cb() } try { this[_handle].params(level, strategy) } finally { this[_handle].flush = origFlush } /* istanbul ignore else */ if (this[_handle]) { this[_level] = level this[_strategy] = strategy } } } } // minimal 2-byte header class Deflate extends Zlib { constructor (opts) { super(opts, 'Deflate') } } class Inflate extends Zlib { constructor (opts) { super(opts, 'Inflate') } } // gzip - bigger header, same deflate compression const _portable = Symbol('_portable') class Gzip extends Zlib { constructor (opts) { super(opts, 'Gzip') this[_portable] = opts && !!opts.portable } [_superWrite] (data) { if (!this[_portable]) return super[_superWrite](data) // we'll always get the header emitted in one first chunk // overwrite the OS indicator byte with 0xFF this[_portable] = false data[9] = 255 return super[_superWrite](data) } } class Gunzip extends Zlib { constructor (opts) { super(opts, 'Gunzip') } } // raw - no header class DeflateRaw extends Zlib { constructor (opts) { super(opts, 'DeflateRaw') } } class InflateRaw extends Zlib { constructor (opts) { super(opts, 'InflateRaw') } } // auto-detect header. class Unzip extends Zlib { constructor (opts) { super(opts, 'Unzip') } } class Brotli extends ZlibBase { constructor (opts, mode) { opts = opts || {} opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH super(opts, mode) this[_fullFlushFlag] = constants.BROTLI_OPERATION_FLUSH } } class BrotliCompress extends Brotli { constructor (opts) { super(opts, 'BrotliCompress') } } class BrotliDecompress extends Brotli { constructor (opts) { super(opts, 'BrotliDecompress') } } exports.Deflate = Deflate exports.Inflate = Inflate exports.Gzip = Gzip exports.Gunzip = Gunzip exports.DeflateRaw = DeflateRaw exports.InflateRaw = InflateRaw exports.Unzip = Unzip /* istanbul ignore else */ if (typeof realZlib.BrotliCompress === 'function') { exports.BrotliCompress = BrotliCompress exports.BrotliDecompress = BrotliDecompress } else { exports.BrotliCompress = exports.BrotliDecompress = class { constructor () { throw new Error('Brotli is not supported in this version of Node.js') } } } /***/ }), /***/ 66186: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const optsArg = __webpack_require__(42853) const pathArg = __webpack_require__(12930) const {mkdirpNative, mkdirpNativeSync} = __webpack_require__(50508) const {mkdirpManual, mkdirpManualSync} = __webpack_require__(40356) const {useNative, useNativeSync} = __webpack_require__(54518) const mkdirp = (path, opts) => { path = pathArg(path) opts = optsArg(opts) return useNative(opts) ? mkdirpNative(path, opts) : mkdirpManual(path, opts) } const mkdirpSync = (path, opts) => { path = pathArg(path) opts = optsArg(opts) return useNativeSync(opts) ? mkdirpNativeSync(path, opts) : mkdirpManualSync(path, opts) } mkdirp.sync = mkdirpSync mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts)) mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts)) mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts)) mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts)) module.exports = mkdirp /***/ }), /***/ 44992: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const {dirname} = __webpack_require__(85622) const findMade = (opts, parent, path = undefined) => { // we never want the 'made' return value to be a root directory if (path === parent) return Promise.resolve() return opts.statAsync(parent).then( st => st.isDirectory() ? path : undefined, // will fail later er => er.code === 'ENOENT' ? findMade(opts, dirname(parent), parent) : undefined ) } const findMadeSync = (opts, parent, path = undefined) => { if (path === parent) return undefined try { return opts.statSync(parent).isDirectory() ? path : undefined } catch (er) { return er.code === 'ENOENT' ? findMadeSync(opts, dirname(parent), parent) : undefined } } module.exports = {findMade, findMadeSync} /***/ }), /***/ 40356: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const {dirname} = __webpack_require__(85622) const mkdirpManual = (path, opts, made) => { opts.recursive = false const parent = dirname(path) if (parent === path) { return opts.mkdirAsync(path, opts).catch(er => { // swallowed by recursive implementation on posix systems // any other error is a failure if (er.code !== 'EISDIR') throw er }) } return opts.mkdirAsync(path, opts).then(() => made || path, er => { if (er.code === 'ENOENT') return mkdirpManual(parent, opts) .then(made => mkdirpManual(path, opts, made)) if (er.code !== 'EEXIST' && er.code !== 'EROFS') throw er return opts.statAsync(path).then(st => { if (st.isDirectory()) return made else throw er }, () => { throw er }) }) } const mkdirpManualSync = (path, opts, made) => { const parent = dirname(path) opts.recursive = false if (parent === path) { try { return opts.mkdirSync(path, opts) } catch (er) { // swallowed by recursive implementation on posix systems // any other error is a failure if (er.code !== 'EISDIR') throw er else return } } try { opts.mkdirSync(path, opts) return made || path } catch (er) { if (er.code === 'ENOENT') return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made)) if (er.code !== 'EEXIST' && er.code !== 'EROFS') throw er try { if (!opts.statSync(path).isDirectory()) throw er } catch (_) { throw er } } } module.exports = {mkdirpManual, mkdirpManualSync} /***/ }), /***/ 50508: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const {dirname} = __webpack_require__(85622) const {findMade, findMadeSync} = __webpack_require__(44992) const {mkdirpManual, mkdirpManualSync} = __webpack_require__(40356) const mkdirpNative = (path, opts) => { opts.recursive = true const parent = dirname(path) if (parent === path) return opts.mkdirAsync(path, opts) return findMade(opts, path).then(made => opts.mkdirAsync(path, opts).then(() => made) .catch(er => { if (er.code === 'ENOENT') return mkdirpManual(path, opts) else throw er })) } const mkdirpNativeSync = (path, opts) => { opts.recursive = true const parent = dirname(path) if (parent === path) return opts.mkdirSync(path, opts) const made = findMadeSync(opts, path) try { opts.mkdirSync(path, opts) return made } catch (er) { if (er.code === 'ENOENT') return mkdirpManualSync(path, opts) else throw er } } module.exports = {mkdirpNative, mkdirpNativeSync} /***/ }), /***/ 42853: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { promisify } = __webpack_require__(31669) const fs = __webpack_require__(35747) const optsArg = opts => { if (!opts) opts = { mode: 0o777, fs } else if (typeof opts === 'object') opts = { mode: 0o777, fs, ...opts } else if (typeof opts === 'number') opts = { mode: opts, fs } else if (typeof opts === 'string') opts = { mode: parseInt(opts, 8), fs } else throw new TypeError('invalid options argument') opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir opts.mkdirAsync = promisify(opts.mkdir) opts.stat = opts.stat || opts.fs.stat || fs.stat opts.statAsync = promisify(opts.stat) opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync return opts } module.exports = optsArg /***/ }), /***/ 12930: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform const { resolve, parse } = __webpack_require__(85622) const pathArg = path => { if (/\0/.test(path)) { // simulate same failure that node raises throw Object.assign( new TypeError('path must be a string without null bytes'), { path, code: 'ERR_INVALID_ARG_VALUE', } ) } path = resolve(path) if (platform === 'win32') { const badWinChars = /[*|"<>?:]/ const {root} = parse(path) if (badWinChars.test(path.substr(root.length))) { throw Object.assign(new Error('Illegal characters in path.'), { path, code: 'EINVAL', }) } } return path } module.exports = pathArg /***/ }), /***/ 54518: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const fs = __webpack_require__(35747) const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version const versArr = version.replace(/^v/, '').split('.') const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12 const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync module.exports = {useNative, useNativeSync} /***/ }), /***/ 80900: /***/ ((module) => { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } /***/ }), /***/ 38560: /***/ ((module) => { "use strict"; /** * Tries to execute a function and discards any error that occurs. * @param {Function} fn - Function that might or might not throw an error. * @returns {?*} Return-value of the function when no error occurred. */ module.exports = function(fn) { try { return fn() } catch (e) {} } /***/ }), /***/ 80467: /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var Stream = _interopDefault(__webpack_require__(92413)); var http = _interopDefault(__webpack_require__(98605)); var Url = _interopDefault(__webpack_require__(78835)); var https = _interopDefault(__webpack_require__(57211)); var zlib = _interopDefault(__webpack_require__(78761)); // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js // fix for "Readable" isn't a named export issue const Readable = Stream.Readable; const BUFFER = Symbol('buffer'); const TYPE = Symbol('type'); class Blob { constructor() { this[TYPE] = ''; const blobParts = arguments[0]; const options = arguments[1]; const buffers = []; let size = 0; if (blobParts) { const a = blobParts; const length = Number(a.length); for (let i = 0; i < length; i++) { const element = a[i]; let buffer; if (element instanceof Buffer) { buffer = element; } else if (ArrayBuffer.isView(element)) { buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); } else if (element instanceof ArrayBuffer) { buffer = Buffer.from(element); } else if (element instanceof Blob) { buffer = element[BUFFER]; } else { buffer = Buffer.from(typeof element === 'string' ? element : String(element)); } size += buffer.length; buffers.push(buffer); } } this[BUFFER] = Buffer.concat(buffers); let type = options && options.type !== undefined && String(options.type).toLowerCase(); if (type && !/[^\u0020-\u007E]/.test(type)) { this[TYPE] = type; } } get size() { return this[BUFFER].length; } get type() { return this[TYPE]; } text() { return Promise.resolve(this[BUFFER].toString()); } arrayBuffer() { const buf = this[BUFFER]; const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); return Promise.resolve(ab); } stream() { const readable = new Readable(); readable._read = function () {}; readable.push(this[BUFFER]); readable.push(null); return readable; } toString() { return '[object Blob]'; } slice() { const size = this.size; const start = arguments[0]; const end = arguments[1]; let relativeStart, relativeEnd; if (start === undefined) { relativeStart = 0; } else if (start < 0) { relativeStart = Math.max(size + start, 0); } else { relativeStart = Math.min(start, size); } if (end === undefined) { relativeEnd = size; } else if (end < 0) { relativeEnd = Math.max(size + end, 0); } else { relativeEnd = Math.min(end, size); } const span = Math.max(relativeEnd - relativeStart, 0); const buffer = this[BUFFER]; const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); const blob = new Blob([], { type: arguments[2] }); blob[BUFFER] = slicedBuffer; return blob; } } Object.defineProperties(Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } }); Object.defineProperty(Blob.prototype, Symbol.toStringTag, { value: 'Blob', writable: false, enumerable: false, configurable: true }); /** * fetch-error.js * * FetchError interface for operational errors */ /** * Create FetchError instance * * @param String message Error message for human * @param String type Error type for machine * @param String systemError For Node.js system error * @return FetchError */ function FetchError(message, type, systemError) { Error.call(this, message); this.message = message; this.type = type; // when err.type is `system`, err.code contains system error code if (systemError) { this.code = this.errno = systemError.code; } // hide custom error implementation details from end-users Error.captureStackTrace(this, this.constructor); } FetchError.prototype = Object.create(Error.prototype); FetchError.prototype.constructor = FetchError; FetchError.prototype.name = 'FetchError'; let convert; try { convert = __webpack_require__(22877).convert; } catch (e) {} const INTERNALS = Symbol('Body internals'); // fix an issue where "PassThrough" isn't a named export for node <10 const PassThrough = Stream.PassThrough; /** * Body mixin * * Ref: https://fetch.spec.whatwg.org/#body * * @param Stream body Readable stream * @param Object opts Response options * @return Void */ function Body(body) { var _this = this; var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$size = _ref.size; let size = _ref$size === undefined ? 0 : _ref$size; var _ref$timeout = _ref.timeout; let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; if (body == null) { // body is undefined or null body = null; } else if (isURLSearchParams(body)) { // body is a URLSearchParams body = Buffer.from(body.toString()); } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { // body is ArrayBuffer body = Buffer.from(body); } else if (ArrayBuffer.isView(body)) { // body is ArrayBufferView body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); } else if (body instanceof Stream) ; else { // none of the above // coerce to string then buffer body = Buffer.from(String(body)); } this[INTERNALS] = { body, disturbed: false, error: null }; this.size = size; this.timeout = timeout; if (body instanceof Stream) { body.on('error', function (err) { const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); _this[INTERNALS].error = error; }); } } Body.prototype = { get body() { return this[INTERNALS].body; }, get bodyUsed() { return this[INTERNALS].disturbed; }, /** * Decode response as ArrayBuffer * * @return Promise */ arrayBuffer() { return consumeBody.call(this).then(function (buf) { return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); }); }, /** * Return raw response as Blob * * @return Promise */ blob() { let ct = this.headers && this.headers.get('content-type') || ''; return consumeBody.call(this).then(function (buf) { return Object.assign( // Prevent copying new Blob([], { type: ct.toLowerCase() }), { [BUFFER]: buf }); }); }, /** * Decode response as json * * @return Promise */ json() { var _this2 = this; return consumeBody.call(this).then(function (buffer) { try { return JSON.parse(buffer.toString()); } catch (err) { return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); } }); }, /** * Decode response as text * * @return Promise */ text() { return consumeBody.call(this).then(function (buffer) { return buffer.toString(); }); }, /** * Decode response as buffer (non-spec api) * * @return Promise */ buffer() { return consumeBody.call(this); }, /** * Decode response as text, while automatically detecting the encoding and * trying to decode to UTF-8 (non-spec api) * * @return Promise */ textConverted() { var _this3 = this; return consumeBody.call(this).then(function (buffer) { return convertBody(buffer, _this3.headers); }); } }; // In browsers, all properties are enumerable. Object.defineProperties(Body.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true } }); Body.mixIn = function (proto) { for (const name of Object.getOwnPropertyNames(Body.prototype)) { // istanbul ignore else: future proof if (!(name in proto)) { const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); Object.defineProperty(proto, name, desc); } } }; /** * Consume and convert an entire Body to a Buffer. * * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body * * @return Promise */ function consumeBody() { var _this4 = this; if (this[INTERNALS].disturbed) { return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); } this[INTERNALS].disturbed = true; if (this[INTERNALS].error) { return Body.Promise.reject(this[INTERNALS].error); } let body = this.body; // body is null if (body === null) { return Body.Promise.resolve(Buffer.alloc(0)); } // body is blob if (isBlob(body)) { body = body.stream(); } // body is buffer if (Buffer.isBuffer(body)) { return Body.Promise.resolve(body); } // istanbul ignore if: should never happen if (!(body instanceof Stream)) { return Body.Promise.resolve(Buffer.alloc(0)); } // body is stream // get ready to actually consume the body let accum = []; let accumBytes = 0; let abort = false; return new Body.Promise(function (resolve, reject) { let resTimeout; // allow timeout on slow response body if (_this4.timeout) { resTimeout = setTimeout(function () { abort = true; reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); }, _this4.timeout); } // handle stream errors body.on('error', function (err) { if (err.name === 'AbortError') { // if the request was aborted, reject with this Error abort = true; reject(err); } else { // other errors, such as incorrect content-encoding reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); } }); body.on('data', function (chunk) { if (abort || chunk === null) { return; } if (_this4.size && accumBytes + chunk.length > _this4.size) { abort = true; reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); return; } accumBytes += chunk.length; accum.push(chunk); }); body.on('end', function () { if (abort) { return; } clearTimeout(resTimeout); try { resolve(Buffer.concat(accum, accumBytes)); } catch (err) { // handle streams that have accumulated too much data (issue #414) reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); } }); }); } /** * Detect buffer encoding and convert to target encoding * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding * * @param Buffer buffer Incoming buffer * @param String encoding Target encoding * @return String */ function convertBody(buffer, headers) { if (typeof convert !== 'function') { throw new Error('The package `encoding` must be installed to use the textConverted() function'); } const ct = headers.get('content-type'); let charset = 'utf-8'; let res, str; // header if (ct) { res = /charset=([^;]*)/i.exec(ct); } // no charset in content type, peek at response body for at most 1024 bytes str = buffer.slice(0, 1024).toString(); // html5 if (!res && str) { res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; this[MAP] = Object.create(null); if (init instanceof Headers) { const rawHeaders = init.raw(); const headerNames = Object.keys(rawHeaders); for (const headerName of headerNames) { for (const value of rawHeaders[headerName]) { this.append(headerName, value); } } return; } // We don't worry about converting prop to ByteString here as append() // will handle it. if (init == null) ; else if (typeof init === 'object') { const method = init[Symbol.iterator]; if (method != null) { if (typeof method !== 'function') { throw new TypeError('Header pairs must be iterable'); } // sequence> // Note: per spec we have to first exhaust the lists then process them const pairs = []; for (const pair of init) { if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { throw new TypeError('Each header pair must be iterable'); } pairs.push(Array.from(pair)); } for (const pair of pairs) { if (pair.length !== 2) { throw new TypeError('Each header pair must be a name/value tuple'); } this.append(pair[0], pair[1]); } } else { // record for (const key of Object.keys(init)) { const value = init[key]; this.append(key, value); } } } else { throw new TypeError('Provided initializer must be an object'); } } /** * Return combined header value given name * * @param String name Header name * @return Mixed */ get(name) { name = `${name}`; validateName(name); const key = find(this[MAP], name); if (key === undefined) { return null; } return this[MAP][key].join(', '); } /** * Iterate over all headers * * @param Function callback Executed for each item with parameters (value, name, thisArg) * @param Boolean thisArg `this` context for callback function * @return Void */ forEach(callback) { let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; let pairs = getHeaders(this); let i = 0; while (i < pairs.length) { var _pairs$i = pairs[i]; const name = _pairs$i[0], value = _pairs$i[1]; callback.call(thisArg, value, name, this); pairs = getHeaders(this); i++; } } /** * Overwrite header values given name * * @param String name Header name * @param String value Header value * @return Void */ set(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find(this[MAP], name); this[MAP][key !== undefined ? key : name] = [value]; } /** * Append a value onto existing header * * @param String name Header name * @param String value Header value * @return Void */ append(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find(this[MAP], name); if (key !== undefined) { this[MAP][key].push(value); } else { this[MAP][name] = [value]; } } /** * Check for header name existence * * @param String name Header name * @return Boolean */ has(name) { name = `${name}`; validateName(name); return find(this[MAP], name) !== undefined; } /** * Delete all header values given name * * @param String name Header name * @return Void */ delete(name) { name = `${name}`; validateName(name); const key = find(this[MAP], name); if (key !== undefined) { delete this[MAP][key]; } } /** * Return raw headers (non-spec api) * * @return Object */ raw() { return this[MAP]; } /** * Get an iterator on keys. * * @return Iterator */ keys() { return createHeadersIterator(this, 'key'); } /** * Get an iterator on values. * * @return Iterator */ values() { return createHeadersIterator(this, 'value'); } /** * Get an iterator on entries. * * This is the default iterator of the Headers object. * * @return Iterator */ [Symbol.iterator]() { return createHeadersIterator(this, 'key+value'); } } Headers.prototype.entries = Headers.prototype[Symbol.iterator]; Object.defineProperty(Headers.prototype, Symbol.toStringTag, { value: 'Headers', writable: false, enumerable: false, configurable: true }); Object.defineProperties(Headers.prototype, { get: { enumerable: true }, forEach: { enumerable: true }, set: { enumerable: true }, append: { enumerable: true }, has: { enumerable: true }, delete: { enumerable: true }, keys: { enumerable: true }, values: { enumerable: true }, entries: { enumerable: true } }); function getHeaders(headers) { let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; const keys = Object.keys(headers[MAP]).sort(); return keys.map(kind === 'key' ? function (k) { return k.toLowerCase(); } : kind === 'value' ? function (k) { return headers[MAP][k].join(', '); } : function (k) { return [k.toLowerCase(), headers[MAP][k].join(', ')]; }); } const INTERNAL = Symbol('internal'); function createHeadersIterator(target, kind) { const iterator = Object.create(HeadersIteratorPrototype); iterator[INTERNAL] = { target, kind, index: 0 }; return iterator; } const HeadersIteratorPrototype = Object.setPrototypeOf({ next() { // istanbul ignore if if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { throw new TypeError('Value of `this` is not a HeadersIterator'); } var _INTERNAL = this[INTERNAL]; const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index; const values = getHeaders(target, kind); const len = values.length; if (index >= len) { return { value: undefined, done: true }; } this[INTERNAL].index = index + 1; return { value: values[index], done: false }; } }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { value: 'HeadersIterator', writable: false, enumerable: false, configurable: true }); /** * Export the Headers object in a form that Node.js can consume. * * @param Headers headers * @return Object */ function exportNodeCompatibleHeaders(headers) { const obj = Object.assign({ __proto__: null }, headers[MAP]); // http.request() only supports string as Host header. This hack makes // specifying custom Host header possible. const hostHeaderKey = find(headers[MAP], 'Host'); if (hostHeaderKey !== undefined) { obj[hostHeaderKey] = obj[hostHeaderKey][0]; } return obj; } /** * Create a Headers object from an object of headers, ignoring those that do * not conform to HTTP grammar productions. * * @param Object obj Object of headers * @return Headers */ function createHeadersLenient(obj) { const headers = new Headers(); for (const name of Object.keys(obj)) { if (invalidTokenRegex.test(name)) { continue; } if (Array.isArray(obj[name])) { for (const val of obj[name]) { if (invalidHeaderCharRegex.test(val)) { continue; } if (headers[MAP][name] === undefined) { headers[MAP][name] = [val]; } else { headers[MAP][name].push(val); } } } else if (!invalidHeaderCharRegex.test(obj[name])) { headers[MAP][name] = [obj[name]]; } } return headers; } const INTERNALS$1 = Symbol('Response internals'); // fix an issue where "STATUS_CODES" aren't a named export for node <10 const STATUS_CODES = http.STATUS_CODES; /** * Response class * * @param Stream body Readable stream * @param Object opts Response options * @return Void */ class Response { constructor() { let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; Body.call(this, body, opts); const status = opts.status || 200; const headers = new Headers(opts.headers); if (body != null && !headers.has('Content-Type')) { const contentType = extractContentType(body); if (contentType) { headers.append('Content-Type', contentType); } } this[INTERNALS$1] = { url: opts.url, status, statusText: opts.statusText || STATUS_CODES[status], headers, counter: opts.counter }; } get url() { return this[INTERNALS$1].url || ''; } get status() { return this[INTERNALS$1].status; } /** * Convenience property representing if the request ended normally */ get ok() { return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; } get redirected() { return this[INTERNALS$1].counter > 0; } get statusText() { return this[INTERNALS$1].statusText; } get headers() { return this[INTERNALS$1].headers; } /** * Clone this response * * @return Response */ clone() { return new Response(clone(this), { url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected }); } } Body.mixIn(Response.prototype); Object.defineProperties(Response.prototype, { url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } }); Object.defineProperty(Response.prototype, Symbol.toStringTag, { value: 'Response', writable: false, enumerable: false, configurable: true }); const INTERNALS$2 = Symbol('Request internals'); // fix an issue where "format", "parse" aren't a named export for node <10 const parse_url = Url.parse; const format_url = Url.format; const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; /** * Check if a value is an instance of Request. * * @param Mixed input * @return Boolean */ function isRequest(input) { return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; } function isAbortSignal(signal) { const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); return !!(proto && proto.constructor.name === 'AbortSignal'); } /** * Request class * * @param Mixed input Url or Request instance * @param Object init Custom options * @return Void */ class Request { constructor(input) { let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; let parsedURL; // normalize input if (!isRequest(input)) { if (input && input.href) { // in order to support Node.js' Url objects; though WHATWG's URL objects // will fall into this branch also (since their `toString()` will return // `href` property anyway) parsedURL = parse_url(input.href); } else { // coerce input to a string before attempting to parse parsedURL = parse_url(`${input}`); } input = {}; } else { parsedURL = parse_url(input.url); } let method = init.method || input.method || 'GET'; method = method.toUpperCase(); if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { throw new TypeError('Request with GET/HEAD method cannot have body'); } let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; Body.call(this, inputBody, { timeout: init.timeout || input.timeout || 0, size: init.size || input.size || 0 }); const headers = new Headers(init.headers || input.headers || {}); if (inputBody != null && !headers.has('Content-Type')) { const contentType = extractContentType(inputBody); if (contentType) { headers.append('Content-Type', contentType); } } let signal = isRequest(input) ? input.signal : null; if ('signal' in init) signal = init.signal; if (signal != null && !isAbortSignal(signal)) { throw new TypeError('Expected signal to be an instanceof AbortSignal'); } this[INTERNALS$2] = { method, redirect: init.redirect || input.redirect || 'follow', headers, parsedURL, signal }; // node-fetch-only options this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; this.counter = init.counter || input.counter || 0; this.agent = init.agent || input.agent; } get method() { return this[INTERNALS$2].method; } get url() { return format_url(this[INTERNALS$2].parsedURL); } get headers() { return this[INTERNALS$2].headers; } get redirect() { return this[INTERNALS$2].redirect; } get signal() { return this[INTERNALS$2].signal; } /** * Clone this request * * @return Request */ clone() { return new Request(this); } } Body.mixIn(Request.prototype); Object.defineProperty(Request.prototype, Symbol.toStringTag, { value: 'Request', writable: false, enumerable: false, configurable: true }); Object.defineProperties(Request.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true } }); /** * Convert a Request to Node.js http request options. * * @param Request A Request instance * @return Object The options object to be passed to http.request */ function getNodeRequestOptions(request) { const parsedURL = request[INTERNALS$2].parsedURL; const headers = new Headers(request[INTERNALS$2].headers); // fetch step 1.3 if (!headers.has('Accept')) { headers.set('Accept', '*/*'); } // Basic fetch if (!parsedURL.protocol || !parsedURL.hostname) { throw new TypeError('Only absolute URLs are supported'); } if (!/^https?:$/.test(parsedURL.protocol)) { throw new TypeError('Only HTTP(S) protocols are supported'); } if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); } // HTTP-network-or-cache fetch steps 2.4-2.7 let contentLengthValue = null; if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { contentLengthValue = '0'; } if (request.body != null) { const totalBytes = getTotalBytes(request); if (typeof totalBytes === 'number') { contentLengthValue = String(totalBytes); } } if (contentLengthValue) { headers.set('Content-Length', contentLengthValue); } // HTTP-network-or-cache fetch step 2.11 if (!headers.has('User-Agent')) { headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); } // HTTP-network-or-cache fetch step 2.15 if (request.compress && !headers.has('Accept-Encoding')) { headers.set('Accept-Encoding', 'gzip,deflate'); } let agent = request.agent; if (typeof agent === 'function') { agent = agent(parsedURL); } if (!headers.has('Connection') && !agent) { headers.set('Connection', 'close'); } // HTTP-network fetch step 4.2 // chunked encoding is handled by Node.js return Object.assign({}, parsedURL, { method: request.method, headers: exportNodeCompatibleHeaders(headers), agent }); } /** * abort-error.js * * AbortError interface for cancelled requests */ /** * Create AbortError instance * * @param String message Error message for human * @return AbortError */ function AbortError(message) { Error.call(this, message); this.type = 'aborted'; this.message = message; // hide custom error implementation details from end-users Error.captureStackTrace(this, this.constructor); } AbortError.prototype = Object.create(Error.prototype); AbortError.prototype.constructor = AbortError; AbortError.prototype.name = 'AbortError'; // fix an issue where "PassThrough", "resolve" aren't a named export for node <10 const PassThrough$1 = Stream.PassThrough; const resolve_url = Url.resolve; /** * Fetch function * * @param Mixed url Absolute url or Request instance * @param Object opts Fetch options * @return Promise */ function fetch(url, opts) { // allow custom promise if (!fetch.Promise) { throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); } Body.Promise = fetch.Promise; // wrap http.request into fetch return new fetch.Promise(function (resolve, reject) { // build request object const request = new Request(url, opts); const options = getNodeRequestOptions(request); const send = (options.protocol === 'https:' ? https : http).request; const signal = request.signal; let response = null; const abort = function abort() { let error = new AbortError('The user aborted a request.'); reject(error); if (request.body && request.body instanceof Stream.Readable) { request.body.destroy(error); } if (!response || !response.body) return; response.body.emit('error', error); }; if (signal && signal.aborted) { abort(); return; } const abortAndFinalize = function abortAndFinalize() { abort(); finalize(); }; // send request const req = send(options); let reqTimeout; if (signal) { signal.addEventListener('abort', abortAndFinalize); } function finalize() { req.abort(); if (signal) signal.removeEventListener('abort', abortAndFinalize); clearTimeout(reqTimeout); } if (request.timeout) { req.once('socket', function (socket) { reqTimeout = setTimeout(function () { reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); finalize(); }, request.timeout); }); } req.on('error', function (err) { reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); finalize(); }); req.on('response', function (res) { clearTimeout(reqTimeout); const headers = createHeadersLenient(res.headers); // HTTP fetch step 5 if (fetch.isRedirect(res.statusCode)) { // HTTP fetch step 5.2 const location = headers.get('Location'); // HTTP fetch step 5.3 const locationURL = location === null ? null : resolve_url(request.url, location); // HTTP fetch step 5.5 switch (request.redirect) { case 'error': reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); finalize(); return; case 'manual': // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. if (locationURL !== null) { // handle corrupted header try { headers.set('Location', locationURL); } catch (err) { // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request reject(err); } } break; case 'follow': // HTTP-redirect fetch step 2 if (locationURL === null) { break; } // HTTP-redirect fetch step 5 if (request.counter >= request.follow) { reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); finalize(); return; } // HTTP-redirect fetch step 6 (counter increment) // Create a new Request object. const requestOpts = { headers: new Headers(request.headers), follow: request.follow, counter: request.counter + 1, agent: request.agent, compress: request.compress, method: request.method, body: request.body, signal: request.signal, timeout: request.timeout, size: request.size }; // HTTP-redirect fetch step 9 if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); finalize(); return; } // HTTP-redirect fetch step 11 if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { requestOpts.method = 'GET'; requestOpts.body = undefined; requestOpts.headers.delete('content-length'); } // HTTP-redirect fetch step 15 resolve(fetch(new Request(locationURL, requestOpts))); finalize(); return; } } // prepare response res.once('end', function () { if (signal) signal.removeEventListener('abort', abortAndFinalize); }); let body = res.pipe(new PassThrough$1()); const response_options = { url: request.url, status: res.statusCode, statusText: res.statusMessage, headers: headers, size: request.size, timeout: request.timeout, counter: request.counter }; // HTTP-network fetch step 12.1.1.3 const codings = headers.get('Content-Encoding'); // HTTP-network fetch step 12.1.1.4: handle content codings // in following scenarios we ignore compression support // 1. compression support is disabled // 2. HEAD request // 3. no Content-Encoding header // 4. no content response (204) // 5. content not modified response (304) if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { response = new Response(body, response_options); resolve(response); return; } // For Node v6+ // Be less strict when decoding compressed responses, since sometimes // servers send slightly invalid responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. const zlibOptions = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH }; // for gzip if (codings == 'gzip' || codings == 'x-gzip') { body = body.pipe(zlib.createGunzip(zlibOptions)); response = new Response(body, response_options); resolve(response); return; } // for deflate if (codings == 'deflate' || codings == 'x-deflate') { // handle the infamous raw deflate response from old servers // a hack for old IIS and Apache servers const raw = res.pipe(new PassThrough$1()); raw.once('data', function (chunk) { // see http://stackoverflow.com/questions/37519828 if ((chunk[0] & 0x0F) === 0x08) { body = body.pipe(zlib.createInflate()); } else { body = body.pipe(zlib.createInflateRaw()); } response = new Response(body, response_options); resolve(response); }); return; } // for br if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { body = body.pipe(zlib.createBrotliDecompress()); response = new Response(body, response_options); resolve(response); return; } // otherwise, use response as-is response = new Response(body, response_options); resolve(response); }); writeToStream(req, request); }); } /** * Redirect code matching * * @param Number code Status code * @return Boolean */ fetch.isRedirect = function (code) { return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; }; // expose Promise fetch.Promise = global.Promise; module.exports = exports = fetch; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.default = exports; exports.Headers = Headers; exports.Request = Request; exports.Response = Response; exports.FetchError = FetchError; /***/ }), /***/ 87994: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Advanced Encryption Standard (AES) implementation. * * This implementation is based on the public domain library 'jscrypto' which * was written by: * * Emily Stark (estark@stanford.edu) * Mike Hamburg (mhamburg@stanford.edu) * Dan Boneh (dabo@cs.stanford.edu) * * Parts of this code are based on the OpenSSL implementation of AES: * http://www.openssl.org * * @author Dave Longley * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(7088); __webpack_require__(10873); __webpack_require__(28339); /* AES API */ module.exports = forge.aes = forge.aes || {}; /** * Deprecated. Instead, use: * * var cipher = forge.cipher.createCipher('AES-', key); * cipher.start({iv: iv}); * * Creates an AES cipher object to encrypt data using the given symmetric key. * The output will be stored in the 'output' member of the returned cipher. * * The key and iv may be given as a string of bytes, an array of bytes, * a byte buffer, or an array of 32-bit words. * * @param key the symmetric key to use. * @param iv the initialization vector to use. * @param output the buffer to write to, null to create one. * @param mode the cipher mode to use (default: 'CBC'). * * @return the cipher. */ forge.aes.startEncrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key: key, output: output, decrypt: false, mode: mode }); cipher.start(iv); return cipher; }; /** * Deprecated. Instead, use: * * var cipher = forge.cipher.createCipher('AES-', key); * * Creates an AES cipher object to encrypt data using the given symmetric key. * * The key may be given as a string of bytes, an array of bytes, a * byte buffer, or an array of 32-bit words. * * @param key the symmetric key to use. * @param mode the cipher mode to use (default: 'CBC'). * * @return the cipher. */ forge.aes.createEncryptionCipher = function(key, mode) { return _createCipher({ key: key, output: null, decrypt: false, mode: mode }); }; /** * Deprecated. Instead, use: * * var decipher = forge.cipher.createDecipher('AES-', key); * decipher.start({iv: iv}); * * Creates an AES cipher object to decrypt data using the given symmetric key. * The output will be stored in the 'output' member of the returned cipher. * * The key and iv may be given as a string of bytes, an array of bytes, * a byte buffer, or an array of 32-bit words. * * @param key the symmetric key to use. * @param iv the initialization vector to use. * @param output the buffer to write to, null to create one. * @param mode the cipher mode to use (default: 'CBC'). * * @return the cipher. */ forge.aes.startDecrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key: key, output: output, decrypt: true, mode: mode }); cipher.start(iv); return cipher; }; /** * Deprecated. Instead, use: * * var decipher = forge.cipher.createDecipher('AES-', key); * * Creates an AES cipher object to decrypt data using the given symmetric key. * * The key may be given as a string of bytes, an array of bytes, a * byte buffer, or an array of 32-bit words. * * @param key the symmetric key to use. * @param mode the cipher mode to use (default: 'CBC'). * * @return the cipher. */ forge.aes.createDecryptionCipher = function(key, mode) { return _createCipher({ key: key, output: null, decrypt: true, mode: mode }); }; /** * Creates a new AES cipher algorithm object. * * @param name the name of the algorithm. * @param mode the mode factory function. * * @return the AES algorithm object. */ forge.aes.Algorithm = function(name, mode) { if(!init) { initialize(); } var self = this; self.name = name; self.mode = new mode({ blockSize: 16, cipher: { encrypt: function(inBlock, outBlock) { return _updateBlock(self._w, inBlock, outBlock, false); }, decrypt: function(inBlock, outBlock) { return _updateBlock(self._w, inBlock, outBlock, true); } } }); self._init = false; }; /** * Initializes this AES algorithm by expanding its key. * * @param options the options to use. * key the key to use with this algorithm. * decrypt true if the algorithm should be initialized for decryption, * false for encryption. */ forge.aes.Algorithm.prototype.initialize = function(options) { if(this._init) { return; } var key = options.key; var tmp; /* Note: The key may be a string of bytes, an array of bytes, a byte buffer, or an array of 32-bit integers. If the key is in bytes, then it must be 16, 24, or 32 bytes in length. If it is in 32-bit integers, it must be 4, 6, or 8 integers long. */ if(typeof key === 'string' && (key.length === 16 || key.length === 24 || key.length === 32)) { // convert key string into byte buffer key = forge.util.createBuffer(key); } else if(forge.util.isArray(key) && (key.length === 16 || key.length === 24 || key.length === 32)) { // convert key integer array into byte buffer tmp = key; key = forge.util.createBuffer(); for(var i = 0; i < tmp.length; ++i) { key.putByte(tmp[i]); } } // convert key byte buffer into 32-bit integer array if(!forge.util.isArray(key)) { tmp = key; key = []; // key lengths of 16, 24, 32 bytes allowed var len = tmp.length(); if(len === 16 || len === 24 || len === 32) { len = len >>> 2; for(var i = 0; i < len; ++i) { key.push(tmp.getInt32()); } } } // key must be an array of 32-bit integers by now if(!forge.util.isArray(key) || !(key.length === 4 || key.length === 6 || key.length === 8)) { throw new Error('Invalid key parameter.'); } // encryption operation is always used for these modes var mode = this.mode.name; var encryptOp = (['CFB', 'OFB', 'CTR', 'GCM'].indexOf(mode) !== -1); // do key expansion this._w = _expandKey(key, options.decrypt && !encryptOp); this._init = true; }; /** * Expands a key. Typically only used for testing. * * @param key the symmetric key to expand, as an array of 32-bit words. * @param decrypt true to expand for decryption, false for encryption. * * @return the expanded key. */ forge.aes._expandKey = function(key, decrypt) { if(!init) { initialize(); } return _expandKey(key, decrypt); }; /** * Updates a single block. Typically only used for testing. * * @param w the expanded key to use. * @param input an array of block-size 32-bit words. * @param output an array of block-size 32-bit words. * @param decrypt true to decrypt, false to encrypt. */ forge.aes._updateBlock = _updateBlock; /** Register AES algorithms **/ registerAlgorithm('AES-ECB', forge.cipher.modes.ecb); registerAlgorithm('AES-CBC', forge.cipher.modes.cbc); registerAlgorithm('AES-CFB', forge.cipher.modes.cfb); registerAlgorithm('AES-OFB', forge.cipher.modes.ofb); registerAlgorithm('AES-CTR', forge.cipher.modes.ctr); registerAlgorithm('AES-GCM', forge.cipher.modes.gcm); function registerAlgorithm(name, mode) { var factory = function() { return new forge.aes.Algorithm(name, mode); }; forge.cipher.registerAlgorithm(name, factory); } /** AES implementation **/ var init = false; // not yet initialized var Nb = 4; // number of words comprising the state (AES = 4) var sbox; // non-linear substitution table used in key expansion var isbox; // inversion of sbox var rcon; // round constant word array var mix; // mix-columns table var imix; // inverse mix-columns table /** * Performs initialization, ie: precomputes tables to optimize for speed. * * One way to understand how AES works is to imagine that 'addition' and * 'multiplication' are interfaces that require certain mathematical * properties to hold true (ie: they are associative) but they might have * different implementations and produce different kinds of results ... * provided that their mathematical properties remain true. AES defines * its own methods of addition and multiplication but keeps some important * properties the same, ie: associativity and distributivity. The * explanation below tries to shed some light on how AES defines addition * and multiplication of bytes and 32-bit words in order to perform its * encryption and decryption algorithms. * * The basics: * * The AES algorithm views bytes as binary representations of polynomials * that have either 1 or 0 as the coefficients. It defines the addition * or subtraction of two bytes as the XOR operation. It also defines the * multiplication of two bytes as a finite field referred to as GF(2^8) * (Note: 'GF' means "Galois Field" which is a field that contains a finite * number of elements so GF(2^8) has 256 elements). * * This means that any two bytes can be represented as binary polynomials; * when they multiplied together and modularly reduced by an irreducible * polynomial of the 8th degree, the results are the field GF(2^8). The * specific irreducible polynomial that AES uses in hexadecimal is 0x11b. * This multiplication is associative with 0x01 as the identity: * * (b * 0x01 = GF(b, 0x01) = b). * * The operation GF(b, 0x02) can be performed at the byte level by left * shifting b once and then XOR'ing it (to perform the modular reduction) * with 0x11b if b is >= 128. Repeated application of the multiplication * of 0x02 can be used to implement the multiplication of any two bytes. * * For instance, multiplying 0x57 and 0x13, denoted as GF(0x57, 0x13), can * be performed by factoring 0x13 into 0x01, 0x02, and 0x10. Then these * factors can each be multiplied by 0x57 and then added together. To do * the multiplication, values for 0x57 multiplied by each of these 3 factors * can be precomputed and stored in a table. To add them, the values from * the table are XOR'd together. * * AES also defines addition and multiplication of words, that is 4-byte * numbers represented as polynomials of 3 degrees where the coefficients * are the values of the bytes. * * The word [a0, a1, a2, a3] is a polynomial a3x^3 + a2x^2 + a1x + a0. * * Addition is performed by XOR'ing like powers of x. Multiplication * is performed in two steps, the first is an algebriac expansion as * you would do normally (where addition is XOR). But the result is * a polynomial larger than 3 degrees and thus it cannot fit in a word. So * next the result is modularly reduced by an AES-specific polynomial of * degree 4 which will always produce a polynomial of less than 4 degrees * such that it will fit in a word. In AES, this polynomial is x^4 + 1. * * The modular product of two polynomials 'a' and 'b' is thus: * * d(x) = d3x^3 + d2x^2 + d1x + d0 * with * d0 = GF(a0, b0) ^ GF(a3, b1) ^ GF(a2, b2) ^ GF(a1, b3) * d1 = GF(a1, b0) ^ GF(a0, b1) ^ GF(a3, b2) ^ GF(a2, b3) * d2 = GF(a2, b0) ^ GF(a1, b1) ^ GF(a0, b2) ^ GF(a3, b3) * d3 = GF(a3, b0) ^ GF(a2, b1) ^ GF(a1, b2) ^ GF(a0, b3) * * As a matrix: * * [d0] = [a0 a3 a2 a1][b0] * [d1] [a1 a0 a3 a2][b1] * [d2] [a2 a1 a0 a3][b2] * [d3] [a3 a2 a1 a0][b3] * * Special polynomials defined by AES (0x02 == {02}): * a(x) = {03}x^3 + {01}x^2 + {01}x + {02} * a^-1(x) = {0b}x^3 + {0d}x^2 + {09}x + {0e}. * * These polynomials are used in the MixColumns() and InverseMixColumns() * operations, respectively, to cause each element in the state to affect * the output (referred to as diffusing). * * RotWord() uses: a0 = a1 = a2 = {00} and a3 = {01}, which is the * polynomial x3. * * The ShiftRows() method modifies the last 3 rows in the state (where * the state is 4 words with 4 bytes per word) by shifting bytes cyclically. * The 1st byte in the second row is moved to the end of the row. The 1st * and 2nd bytes in the third row are moved to the end of the row. The 1st, * 2nd, and 3rd bytes are moved in the fourth row. * * More details on how AES arithmetic works: * * In the polynomial representation of binary numbers, XOR performs addition * and subtraction and multiplication in GF(2^8) denoted as GF(a, b) * corresponds with the multiplication of polynomials modulo an irreducible * polynomial of degree 8. In other words, for AES, GF(a, b) will multiply * polynomial 'a' with polynomial 'b' and then do a modular reduction by * an AES-specific irreducible polynomial of degree 8. * * A polynomial is irreducible if its only divisors are one and itself. For * the AES algorithm, this irreducible polynomial is: * * m(x) = x^8 + x^4 + x^3 + x + 1, * * or {01}{1b} in hexadecimal notation, where each coefficient is a bit: * 100011011 = 283 = 0x11b. * * For example, GF(0x57, 0x83) = 0xc1 because * * 0x57 = 87 = 01010111 = x^6 + x^4 + x^2 + x + 1 * 0x85 = 131 = 10000101 = x^7 + x + 1 * * (x^6 + x^4 + x^2 + x + 1) * (x^7 + x + 1) * = x^13 + x^11 + x^9 + x^8 + x^7 + * x^7 + x^5 + x^3 + x^2 + x + * x^6 + x^4 + x^2 + x + 1 * = x^13 + x^11 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1 = y * y modulo (x^8 + x^4 + x^3 + x + 1) * = x^7 + x^6 + 1. * * The modular reduction by m(x) guarantees the result will be a binary * polynomial of less than degree 8, so that it can fit in a byte. * * The operation to multiply a binary polynomial b with x (the polynomial * x in binary representation is 00000010) is: * * b_7x^8 + b_6x^7 + b_5x^6 + b_4x^5 + b_3x^4 + b_2x^3 + b_1x^2 + b_0x^1 * * To get GF(b, x) we must reduce that by m(x). If b_7 is 0 (that is the * most significant bit is 0 in b) then the result is already reduced. If * it is 1, then we can reduce it by subtracting m(x) via an XOR. * * It follows that multiplication by x (00000010 or 0x02) can be implemented * by performing a left shift followed by a conditional bitwise XOR with * 0x1b. This operation on bytes is denoted by xtime(). Multiplication by * higher powers of x can be implemented by repeated application of xtime(). * * By adding intermediate results, multiplication by any constant can be * implemented. For instance: * * GF(0x57, 0x13) = 0xfe because: * * xtime(b) = (b & 128) ? (b << 1 ^ 0x11b) : (b << 1) * * Note: We XOR with 0x11b instead of 0x1b because in javascript our * datatype for b can be larger than 1 byte, so a left shift will not * automatically eliminate bits that overflow a byte ... by XOR'ing the * overflow bit with 1 (the extra one from 0x11b) we zero it out. * * GF(0x57, 0x02) = xtime(0x57) = 0xae * GF(0x57, 0x04) = xtime(0xae) = 0x47 * GF(0x57, 0x08) = xtime(0x47) = 0x8e * GF(0x57, 0x10) = xtime(0x8e) = 0x07 * * GF(0x57, 0x13) = GF(0x57, (0x01 ^ 0x02 ^ 0x10)) * * And by the distributive property (since XOR is addition and GF() is * multiplication): * * = GF(0x57, 0x01) ^ GF(0x57, 0x02) ^ GF(0x57, 0x10) * = 0x57 ^ 0xae ^ 0x07 * = 0xfe. */ function initialize() { init = true; /* Populate the Rcon table. These are the values given by [x^(i-1),{00},{00},{00}] where x^(i-1) are powers of x (and x = 0x02) in the field of GF(2^8), where i starts at 1. rcon[0] = [0x00, 0x00, 0x00, 0x00] rcon[1] = [0x01, 0x00, 0x00, 0x00] 2^(1-1) = 2^0 = 1 rcon[2] = [0x02, 0x00, 0x00, 0x00] 2^(2-1) = 2^1 = 2 ... rcon[9] = [0x1B, 0x00, 0x00, 0x00] 2^(9-1) = 2^8 = 0x1B rcon[10] = [0x36, 0x00, 0x00, 0x00] 2^(10-1) = 2^9 = 0x36 We only store the first byte because it is the only one used. */ rcon = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36]; // compute xtime table which maps i onto GF(i, 0x02) var xtime = new Array(256); for(var i = 0; i < 128; ++i) { xtime[i] = i << 1; xtime[i + 128] = (i + 128) << 1 ^ 0x11B; } // compute all other tables sbox = new Array(256); isbox = new Array(256); mix = new Array(4); imix = new Array(4); for(var i = 0; i < 4; ++i) { mix[i] = new Array(256); imix[i] = new Array(256); } var e = 0, ei = 0, e2, e4, e8, sx, sx2, me, ime; for(var i = 0; i < 256; ++i) { /* We need to generate the SubBytes() sbox and isbox tables so that we can perform byte substitutions. This requires us to traverse all of the elements in GF, find their multiplicative inverses, and apply to each the following affine transformation: bi' = bi ^ b(i + 4) mod 8 ^ b(i + 5) mod 8 ^ b(i + 6) mod 8 ^ b(i + 7) mod 8 ^ ci for 0 <= i < 8, where bi is the ith bit of the byte, and ci is the ith bit of a byte c with the value {63} or {01100011}. It is possible to traverse every possible value in a Galois field using what is referred to as a 'generator'. There are many generators (128 out of 256): 3,5,6,9,11,82 to name a few. To fully traverse GF we iterate 255 times, multiplying by our generator each time. On each iteration we can determine the multiplicative inverse for the current element. Suppose there is an element in GF 'e'. For a given generator 'g', e = g^x. The multiplicative inverse of e is g^(255 - x). It turns out that if use the inverse of a generator as another generator it will produce all of the corresponding multiplicative inverses at the same time. For this reason, we choose 5 as our inverse generator because it only requires 2 multiplies and 1 add and its inverse, 82, requires relatively few operations as well. In order to apply the affine transformation, the multiplicative inverse 'ei' of 'e' can be repeatedly XOR'd (4 times) with a bit-cycling of 'ei'. To do this 'ei' is first stored in 's' and 'x'. Then 's' is left shifted and the high bit of 's' is made the low bit. The resulting value is stored in 's'. Then 'x' is XOR'd with 's' and stored in 'x'. On each subsequent iteration the same operation is performed. When 4 iterations are complete, 'x' is XOR'd with 'c' (0x63) and the transformed value is stored in 'x'. For example: s = 01000001 x = 01000001 iteration 1: s = 10000010, x ^= s iteration 2: s = 00000101, x ^= s iteration 3: s = 00001010, x ^= s iteration 4: s = 00010100, x ^= s x ^= 0x63 This can be done with a loop where s = (s << 1) | (s >> 7). However, it can also be done by using a single 16-bit (in this case 32-bit) number 'sx'. Since XOR is an associative operation, we can set 'sx' to 'ei' and then XOR it with 'sx' left-shifted 1,2,3, and 4 times. The most significant bits will flow into the high 8 bit positions and be correctly XOR'd with one another. All that remains will be to cycle the high 8 bits by XOR'ing them all with the lower 8 bits afterwards. At the same time we're populating sbox and isbox we can precompute the multiplication we'll need to do to do MixColumns() later. */ // apply affine transformation sx = ei ^ (ei << 1) ^ (ei << 2) ^ (ei << 3) ^ (ei << 4); sx = (sx >> 8) ^ (sx & 255) ^ 0x63; // update tables sbox[e] = sx; isbox[sx] = e; /* Mixing columns is done using matrix multiplication. The columns that are to be mixed are each a single word in the current state. The state has Nb columns (4 columns). Therefore each column is a 4 byte word. So to mix the columns in a single column 'c' where its rows are r0, r1, r2, and r3, we use the following matrix multiplication: [2 3 1 1]*[r0,c]=[r'0,c] [1 2 3 1] [r1,c] [r'1,c] [1 1 2 3] [r2,c] [r'2,c] [3 1 1 2] [r3,c] [r'3,c] r0, r1, r2, and r3 are each 1 byte of one of the words in the state (a column). To do matrix multiplication for each mixed column c' we multiply the corresponding row from the left matrix with the corresponding column from the right matrix. In total, we get 4 equations: r0,c' = 2*r0,c + 3*r1,c + 1*r2,c + 1*r3,c r1,c' = 1*r0,c + 2*r1,c + 3*r2,c + 1*r3,c r2,c' = 1*r0,c + 1*r1,c + 2*r2,c + 3*r3,c r3,c' = 3*r0,c + 1*r1,c + 1*r2,c + 2*r3,c As usual, the multiplication is as previously defined and the addition is XOR. In order to optimize mixing columns we can store the multiplication results in tables. If you think of the whole column as a word (it might help to visualize by mentally rotating the equations above by counterclockwise 90 degrees) then you can see that it would be useful to map the multiplications performed on each byte (r0, r1, r2, r3) onto a word as well. For instance, we could map 2*r0,1*r0,1*r0,3*r0 onto a word by storing 2*r0 in the highest 8 bits and 3*r0 in the lowest 8 bits (with the other two respectively in the middle). This means that a table can be constructed that uses r0 as an index to the word. We can do the same with r1, r2, and r3, creating a total of 4 tables. To construct a full c', we can just look up each byte of c in their respective tables and XOR the results together. Also, to build each table we only have to calculate the word for 2,1,1,3 for every byte ... which we can do on each iteration of this loop since we will iterate over every byte. After we have calculated 2,1,1,3 we can get the results for the other tables by cycling the byte at the end to the beginning. For instance we can take the result of table 2,1,1,3 and produce table 3,2,1,1 by moving the right most byte to the left most position just like how you can imagine the 3 moved out of 2,1,1,3 and to the front to produce 3,2,1,1. There is another optimization in that the same multiples of the current element we need in order to advance our generator to the next iteration can be reused in performing the 2,1,1,3 calculation. We also calculate the inverse mix column tables, with e,9,d,b being the inverse of 2,1,1,3. When we're done, and we need to actually mix columns, the first byte of each state word should be put through mix[0] (2,1,1,3), the second through mix[1] (3,2,1,1) and so forth. Then they should be XOR'd together to produce the fully mixed column. */ // calculate mix and imix table values sx2 = xtime[sx]; e2 = xtime[e]; e4 = xtime[e2]; e8 = xtime[e4]; me = (sx2 << 24) ^ // 2 (sx << 16) ^ // 1 (sx << 8) ^ // 1 (sx ^ sx2); // 3 ime = (e2 ^ e4 ^ e8) << 24 ^ // E (14) (e ^ e8) << 16 ^ // 9 (e ^ e4 ^ e8) << 8 ^ // D (13) (e ^ e2 ^ e8); // B (11) // produce each of the mix tables by rotating the 2,1,1,3 value for(var n = 0; n < 4; ++n) { mix[n][e] = me; imix[n][sx] = ime; // cycle the right most byte to the left most position // ie: 2,1,1,3 becomes 3,2,1,1 me = me << 24 | me >>> 8; ime = ime << 24 | ime >>> 8; } // get next element and inverse if(e === 0) { // 1 is the inverse of 1 e = ei = 1; } else { // e = 2e + 2*2*2*(10e)) = multiply e by 82 (chosen generator) // ei = ei + 2*2*ei = multiply ei by 5 (inverse generator) e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]]; ei ^= xtime[xtime[ei]]; } } } /** * Generates a key schedule using the AES key expansion algorithm. * * The AES algorithm takes the Cipher Key, K, and performs a Key Expansion * routine to generate a key schedule. The Key Expansion generates a total * of Nb*(Nr + 1) words: the algorithm requires an initial set of Nb words, * and each of the Nr rounds requires Nb words of key data. The resulting * key schedule consists of a linear array of 4-byte words, denoted [wi ], * with i in the range 0 <= i < Nb(Nr + 1). * * KeyExpansion(byte key[4*Nk], word w[Nb*(Nr+1)], Nk) * AES-128 (Nb=4, Nk=4, Nr=10) * AES-192 (Nb=4, Nk=6, Nr=12) * AES-256 (Nb=4, Nk=8, Nr=14) * Note: Nr=Nk+6. * * Nb is the number of columns (32-bit words) comprising the State (or * number of bytes in a block). For AES, Nb=4. * * @param key the key to schedule (as an array of 32-bit words). * @param decrypt true to modify the key schedule to decrypt, false not to. * * @return the generated key schedule. */ function _expandKey(key, decrypt) { // copy the key's words to initialize the key schedule var w = key.slice(0); /* RotWord() will rotate a word, moving the first byte to the last byte's position (shifting the other bytes left). We will be getting the value of Rcon at i / Nk. 'i' will iterate from Nk to (Nb * Nr+1). Nk = 4 (4 byte key), Nb = 4 (4 words in a block), Nr = Nk + 6 (10). Therefore 'i' will iterate from 4 to 44 (exclusive). Each time we iterate 4 times, i / Nk will increase by 1. We use a counter iNk to keep track of this. */ // go through the rounds expanding the key var temp, iNk = 1; var Nk = w.length; var Nr1 = Nk + 6 + 1; var end = Nb * Nr1; for(var i = Nk; i < end; ++i) { temp = w[i - 1]; if(i % Nk === 0) { // temp = SubWord(RotWord(temp)) ^ Rcon[i / Nk] temp = sbox[temp >>> 16 & 255] << 24 ^ sbox[temp >>> 8 & 255] << 16 ^ sbox[temp & 255] << 8 ^ sbox[temp >>> 24] ^ (rcon[iNk] << 24); iNk++; } else if(Nk > 6 && (i % Nk === 4)) { // temp = SubWord(temp) temp = sbox[temp >>> 24] << 24 ^ sbox[temp >>> 16 & 255] << 16 ^ sbox[temp >>> 8 & 255] << 8 ^ sbox[temp & 255]; } w[i] = w[i - Nk] ^ temp; } /* When we are updating a cipher block we always use the code path for encryption whether we are decrypting or not (to shorten code and simplify the generation of look up tables). However, because there are differences in the decryption algorithm, other than just swapping in different look up tables, we must transform our key schedule to account for these changes: 1. The decryption algorithm gets its key rounds in reverse order. 2. The decryption algorithm adds the round key before mixing columns instead of afterwards. We don't need to modify our key schedule to handle the first case, we can just traverse the key schedule in reverse order when decrypting. The second case requires a little work. The tables we built for performing rounds will take an input and then perform SubBytes() and MixColumns() or, for the decrypt version, InvSubBytes() and InvMixColumns(). But the decrypt algorithm requires us to AddRoundKey() before InvMixColumns(). This means we'll need to apply some transformations to the round key to inverse-mix its columns so they'll be correct for moving AddRoundKey() to after the state has had its columns inverse-mixed. To inverse-mix the columns of the state when we're decrypting we use a lookup table that will apply InvSubBytes() and InvMixColumns() at the same time. However, the round key's bytes are not inverse-substituted in the decryption algorithm. To get around this problem, we can first substitute the bytes in the round key so that when we apply the transformation via the InvSubBytes()+InvMixColumns() table, it will undo our substitution leaving us with the original value that we want -- and then inverse-mix that value. This change will correctly alter our key schedule so that we can XOR each round key with our already transformed decryption state. This allows us to use the same code path as the encryption algorithm. We make one more change to the decryption key. Since the decryption algorithm runs in reverse from the encryption algorithm, we reverse the order of the round keys to avoid having to iterate over the key schedule backwards when running the encryption algorithm later in decryption mode. In addition to reversing the order of the round keys, we also swap each round key's 2nd and 4th rows. See the comments section where rounds are performed for more details about why this is done. These changes are done inline with the other substitution described above. */ if(decrypt) { var tmp; var m0 = imix[0]; var m1 = imix[1]; var m2 = imix[2]; var m3 = imix[3]; var wnew = w.slice(0); end = w.length; for(var i = 0, wi = end - Nb; i < end; i += Nb, wi -= Nb) { // do not sub the first or last round key (round keys are Nb // words) as no column mixing is performed before they are added, // but do change the key order if(i === 0 || i === (end - Nb)) { wnew[i] = w[wi]; wnew[i + 1] = w[wi + 3]; wnew[i + 2] = w[wi + 2]; wnew[i + 3] = w[wi + 1]; } else { // substitute each round key byte because the inverse-mix // table will inverse-substitute it (effectively cancel the // substitution because round key bytes aren't sub'd in // decryption mode) and swap indexes 3 and 1 for(var n = 0; n < Nb; ++n) { tmp = w[wi + n]; wnew[i + (3&-n)] = m0[sbox[tmp >>> 24]] ^ m1[sbox[tmp >>> 16 & 255]] ^ m2[sbox[tmp >>> 8 & 255]] ^ m3[sbox[tmp & 255]]; } } } w = wnew; } return w; } /** * Updates a single block (16 bytes) using AES. The update will either * encrypt or decrypt the block. * * @param w the key schedule. * @param input the input block (an array of 32-bit words). * @param output the updated output block. * @param decrypt true to decrypt the block, false to encrypt it. */ function _updateBlock(w, input, output, decrypt) { /* Cipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) begin byte state[4,Nb] state = in AddRoundKey(state, w[0, Nb-1]) for round = 1 step 1 to Nr-1 SubBytes(state) ShiftRows(state) MixColumns(state) AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) end for SubBytes(state) ShiftRows(state) AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) out = state end InvCipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) begin byte state[4,Nb] state = in AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) for round = Nr-1 step -1 downto 1 InvShiftRows(state) InvSubBytes(state) AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) InvMixColumns(state) end for InvShiftRows(state) InvSubBytes(state) AddRoundKey(state, w[0, Nb-1]) out = state end */ // Encrypt: AddRoundKey(state, w[0, Nb-1]) // Decrypt: AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) var Nr = w.length / 4 - 1; var m0, m1, m2, m3, sub; if(decrypt) { m0 = imix[0]; m1 = imix[1]; m2 = imix[2]; m3 = imix[3]; sub = isbox; } else { m0 = mix[0]; m1 = mix[1]; m2 = mix[2]; m3 = mix[3]; sub = sbox; } var a, b, c, d, a2, b2, c2; a = input[0] ^ w[0]; b = input[decrypt ? 3 : 1] ^ w[1]; c = input[2] ^ w[2]; d = input[decrypt ? 1 : 3] ^ w[3]; var i = 3; /* In order to share code we follow the encryption algorithm when both encrypting and decrypting. To account for the changes required in the decryption algorithm, we use different lookup tables when decrypting and use a modified key schedule to account for the difference in the order of transformations applied when performing rounds. We also get key rounds in reverse order (relative to encryption). */ for(var round = 1; round < Nr; ++round) { /* As described above, we'll be using table lookups to perform the column mixing. Each column is stored as a word in the state (the array 'input' has one column as a word at each index). In order to mix a column, we perform these transformations on each row in c, which is 1 byte in each word. The new column for c0 is c'0: m0 m1 m2 m3 r0,c'0 = 2*r0,c0 + 3*r1,c0 + 1*r2,c0 + 1*r3,c0 r1,c'0 = 1*r0,c0 + 2*r1,c0 + 3*r2,c0 + 1*r3,c0 r2,c'0 = 1*r0,c0 + 1*r1,c0 + 2*r2,c0 + 3*r3,c0 r3,c'0 = 3*r0,c0 + 1*r1,c0 + 1*r2,c0 + 2*r3,c0 So using mix tables where c0 is a word with r0 being its upper 8 bits and r3 being its lower 8 bits: m0[c0 >> 24] will yield this word: [2*r0,1*r0,1*r0,3*r0] ... m3[c0 & 255] will yield this word: [1*r3,1*r3,3*r3,2*r3] Therefore to mix the columns in each word in the state we do the following (& 255 omitted for brevity): c'0,r0 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] c'0,r1 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] c'0,r2 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] c'0,r3 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] However, before mixing, the algorithm requires us to perform ShiftRows(). The ShiftRows() transformation cyclically shifts the last 3 rows of the state over different offsets. The first row (r = 0) is not shifted. s'_r,c = s_r,(c + shift(r, Nb) mod Nb for 0 < r < 4 and 0 <= c < Nb and shift(1, 4) = 1 shift(2, 4) = 2 shift(3, 4) = 3. This causes the first byte in r = 1 to be moved to the end of the row, the first 2 bytes in r = 2 to be moved to the end of the row, the first 3 bytes in r = 3 to be moved to the end of the row: r1: [c0 c1 c2 c3] => [c1 c2 c3 c0] r2: [c0 c1 c2 c3] [c2 c3 c0 c1] r3: [c0 c1 c2 c3] [c3 c0 c1 c2] We can make these substitutions inline with our column mixing to generate an updated set of equations to produce each word in the state (note the columns have changed positions): c0 c1 c2 c3 => c0 c1 c2 c3 c0 c1 c2 c3 c1 c2 c3 c0 (cycled 1 byte) c0 c1 c2 c3 c2 c3 c0 c1 (cycled 2 bytes) c0 c1 c2 c3 c3 c0 c1 c2 (cycled 3 bytes) Therefore: c'0 = 2*r0,c0 + 3*r1,c1 + 1*r2,c2 + 1*r3,c3 c'0 = 1*r0,c0 + 2*r1,c1 + 3*r2,c2 + 1*r3,c3 c'0 = 1*r0,c0 + 1*r1,c1 + 2*r2,c2 + 3*r3,c3 c'0 = 3*r0,c0 + 1*r1,c1 + 1*r2,c2 + 2*r3,c3 c'1 = 2*r0,c1 + 3*r1,c2 + 1*r2,c3 + 1*r3,c0 c'1 = 1*r0,c1 + 2*r1,c2 + 3*r2,c3 + 1*r3,c0 c'1 = 1*r0,c1 + 1*r1,c2 + 2*r2,c3 + 3*r3,c0 c'1 = 3*r0,c1 + 1*r1,c2 + 1*r2,c3 + 2*r3,c0 ... and so forth for c'2 and c'3. The important distinction is that the columns are cycling, with c0 being used with the m0 map when calculating c0, but c1 being used with the m0 map when calculating c1 ... and so forth. When performing the inverse we transform the mirror image and skip the bottom row, instead of the top one, and move upwards: c3 c2 c1 c0 => c0 c3 c2 c1 (cycled 3 bytes) *same as encryption c3 c2 c1 c0 c1 c0 c3 c2 (cycled 2 bytes) c3 c2 c1 c0 c2 c1 c0 c3 (cycled 1 byte) *same as encryption c3 c2 c1 c0 c3 c2 c1 c0 If you compare the resulting matrices for ShiftRows()+MixColumns() and for InvShiftRows()+InvMixColumns() the 2nd and 4th columns are different (in encrypt mode vs. decrypt mode). So in order to use the same code to handle both encryption and decryption, we will need to do some mapping. If in encryption mode we let a=c0, b=c1, c=c2, d=c3, and r be a row number in the state, then the resulting matrix in encryption mode for applying the above transformations would be: r1: a b c d r2: b c d a r3: c d a b r4: d a b c If we did the same in decryption mode we would get: r1: a d c b r2: b a d c r3: c b a d r4: d c b a If instead we swap d and b (set b=c3 and d=c1), then we get: r1: a b c d r2: d a b c r3: c d a b r4: b c d a Now the 1st and 3rd rows are the same as the encryption matrix. All we need to do then to make the mapping exactly the same is to swap the 2nd and 4th rows when in decryption mode. To do this without having to do it on each iteration, we swapped the 2nd and 4th rows in the decryption key schedule. We also have to do the swap above when we first pull in the input and when we set the final output. */ a2 = m0[a >>> 24] ^ m1[b >>> 16 & 255] ^ m2[c >>> 8 & 255] ^ m3[d & 255] ^ w[++i]; b2 = m0[b >>> 24] ^ m1[c >>> 16 & 255] ^ m2[d >>> 8 & 255] ^ m3[a & 255] ^ w[++i]; c2 = m0[c >>> 24] ^ m1[d >>> 16 & 255] ^ m2[a >>> 8 & 255] ^ m3[b & 255] ^ w[++i]; d = m0[d >>> 24] ^ m1[a >>> 16 & 255] ^ m2[b >>> 8 & 255] ^ m3[c & 255] ^ w[++i]; a = a2; b = b2; c = c2; } /* Encrypt: SubBytes(state) ShiftRows(state) AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) Decrypt: InvShiftRows(state) InvSubBytes(state) AddRoundKey(state, w[0, Nb-1]) */ // Note: rows are shifted inline output[0] = (sub[a >>> 24] << 24) ^ (sub[b >>> 16 & 255] << 16) ^ (sub[c >>> 8 & 255] << 8) ^ (sub[d & 255]) ^ w[++i]; output[decrypt ? 3 : 1] = (sub[b >>> 24] << 24) ^ (sub[c >>> 16 & 255] << 16) ^ (sub[d >>> 8 & 255] << 8) ^ (sub[a & 255]) ^ w[++i]; output[2] = (sub[c >>> 24] << 24) ^ (sub[d >>> 16 & 255] << 16) ^ (sub[a >>> 8 & 255] << 8) ^ (sub[b & 255]) ^ w[++i]; output[decrypt ? 1 : 3] = (sub[d >>> 24] << 24) ^ (sub[a >>> 16 & 255] << 16) ^ (sub[b >>> 8 & 255] << 8) ^ (sub[c & 255]) ^ w[++i]; } /** * Deprecated. Instead, use: * * forge.cipher.createCipher('AES-', key); * forge.cipher.createDecipher('AES-', key); * * Creates a deprecated AES cipher object. This object's mode will default to * CBC (cipher-block-chaining). * * The key and iv may be given as a string of bytes, an array of bytes, a * byte buffer, or an array of 32-bit words. * * @param options the options to use. * key the symmetric key to use. * output the buffer to write to. * decrypt true for decryption, false for encryption. * mode the cipher mode to use (default: 'CBC'). * * @return the cipher. */ function _createCipher(options) { options = options || {}; var mode = (options.mode || 'CBC').toUpperCase(); var algorithm = 'AES-' + mode; var cipher; if(options.decrypt) { cipher = forge.cipher.createDecipher(algorithm, options.key); } else { cipher = forge.cipher.createCipher(algorithm, options.key); } // backwards compatible start API var start = cipher.start; cipher.start = function(iv, options) { // backwards compatibility: support second arg as output buffer var output = null; if(options instanceof forge.util.ByteBuffer) { output = options; options = {}; } options = options || {}; options.output = output; options.iv = iv; start.call(cipher, options); }; return cipher; } /***/ }), /***/ 81449: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * A Javascript implementation of AES Cipher Suites for TLS. * * @author Dave Longley * * Copyright (c) 2009-2015 Digital Bazaar, Inc. * */ var forge = __webpack_require__(89177); __webpack_require__(87994); __webpack_require__(79167); var tls = module.exports = forge.tls; /** * Supported cipher suites. */ tls.CipherSuites['TLS_RSA_WITH_AES_128_CBC_SHA'] = { id: [0x00, 0x2f], name: 'TLS_RSA_WITH_AES_128_CBC_SHA', initSecurityParameters: function(sp) { sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; sp.cipher_type = tls.CipherType.block; sp.enc_key_length = 16; sp.block_length = 16; sp.fixed_iv_length = 16; sp.record_iv_length = 16; sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; sp.mac_length = 20; sp.mac_key_length = 20; }, initConnectionState: initConnectionState }; tls.CipherSuites['TLS_RSA_WITH_AES_256_CBC_SHA'] = { id: [0x00, 0x35], name: 'TLS_RSA_WITH_AES_256_CBC_SHA', initSecurityParameters: function(sp) { sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; sp.cipher_type = tls.CipherType.block; sp.enc_key_length = 32; sp.block_length = 16; sp.fixed_iv_length = 16; sp.record_iv_length = 16; sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; sp.mac_length = 20; sp.mac_key_length = 20; }, initConnectionState: initConnectionState }; function initConnectionState(state, c, sp) { var client = (c.entity === forge.tls.ConnectionEnd.client); // cipher setup state.read.cipherState = { init: false, cipher: forge.cipher.createDecipher('AES-CBC', client ? sp.keys.server_write_key : sp.keys.client_write_key), iv: client ? sp.keys.server_write_IV : sp.keys.client_write_IV }; state.write.cipherState = { init: false, cipher: forge.cipher.createCipher('AES-CBC', client ? sp.keys.client_write_key : sp.keys.server_write_key), iv: client ? sp.keys.client_write_IV : sp.keys.server_write_IV }; state.read.cipherFunction = decrypt_aes_cbc_sha1; state.write.cipherFunction = encrypt_aes_cbc_sha1; // MAC setup state.read.macLength = state.write.macLength = sp.mac_length; state.read.macFunction = state.write.macFunction = tls.hmac_sha1; } /** * Encrypts the TLSCompressed record into a TLSCipherText record using AES * in CBC mode. * * @param record the TLSCompressed record to encrypt. * @param s the ConnectionState to use. * * @return true on success, false on failure. */ function encrypt_aes_cbc_sha1(record, s) { var rval = false; // append MAC to fragment, update sequence number var mac = s.macFunction(s.macKey, s.sequenceNumber, record); record.fragment.putBytes(mac); s.updateSequenceNumber(); // TLS 1.1+ use an explicit IV every time to protect against CBC attacks var iv; if(record.version.minor === tls.Versions.TLS_1_0.minor) { // use the pre-generated IV when initializing for TLS 1.0, otherwise use // the residue from the previous encryption iv = s.cipherState.init ? null : s.cipherState.iv; } else { iv = forge.random.getBytesSync(16); } s.cipherState.init = true; // start cipher var cipher = s.cipherState.cipher; cipher.start({iv: iv}); // TLS 1.1+ write IV into output if(record.version.minor >= tls.Versions.TLS_1_1.minor) { cipher.output.putBytes(iv); } // do encryption (default padding is appropriate) cipher.update(record.fragment); if(cipher.finish(encrypt_aes_cbc_sha1_padding)) { // set record fragment to encrypted output record.fragment = cipher.output; record.length = record.fragment.length(); rval = true; } return rval; } /** * Handles padding for aes_cbc_sha1 in encrypt mode. * * @param blockSize the block size. * @param input the input buffer. * @param decrypt true in decrypt mode, false in encrypt mode. * * @return true on success, false on failure. */ function encrypt_aes_cbc_sha1_padding(blockSize, input, decrypt) { /* The encrypted data length (TLSCiphertext.length) is one more than the sum of SecurityParameters.block_length, TLSCompressed.length, SecurityParameters.mac_length, and padding_length. The padding may be any length up to 255 bytes long, as long as it results in the TLSCiphertext.length being an integral multiple of the block length. Lengths longer than necessary might be desirable to frustrate attacks on a protocol based on analysis of the lengths of exchanged messages. Each uint8 in the padding data vector must be filled with the padding length value. The padding length should be such that the total size of the GenericBlockCipher structure is a multiple of the cipher's block length. Legal values range from zero to 255, inclusive. This length specifies the length of the padding field exclusive of the padding_length field itself. This is slightly different from PKCS#7 because the padding value is 1 less than the actual number of padding bytes if you include the padding_length uint8 itself as a padding byte. */ if(!decrypt) { // get the number of padding bytes required to reach the blockSize and // subtract 1 for the padding value (to make room for the padding_length // uint8) var padding = blockSize - (input.length() % blockSize); input.fillWithByte(padding - 1, padding); } return true; } /** * Handles padding for aes_cbc_sha1 in decrypt mode. * * @param blockSize the block size. * @param output the output buffer. * @param decrypt true in decrypt mode, false in encrypt mode. * * @return true on success, false on failure. */ function decrypt_aes_cbc_sha1_padding(blockSize, output, decrypt) { var rval = true; if(decrypt) { /* The last byte in the output specifies the number of padding bytes not including itself. Each of the padding bytes has the same value as that last byte (known as the padding_length). Here we check all padding bytes to ensure they have the value of padding_length even if one of them is bad in order to ward-off timing attacks. */ var len = output.length(); var paddingLength = output.last(); for(var i = len - 1 - paddingLength; i < len - 1; ++i) { rval = rval && (output.at(i) == paddingLength); } if(rval) { // trim off padding bytes and last padding length byte output.truncate(paddingLength + 1); } } return rval; } /** * Decrypts a TLSCipherText record into a TLSCompressed record using * AES in CBC mode. * * @param record the TLSCipherText record to decrypt. * @param s the ConnectionState to use. * * @return true on success, false on failure. */ function decrypt_aes_cbc_sha1(record, s) { var rval = false; var iv; if(record.version.minor === tls.Versions.TLS_1_0.minor) { // use pre-generated IV when initializing for TLS 1.0, otherwise use the // residue from the previous decryption iv = s.cipherState.init ? null : s.cipherState.iv; } else { // TLS 1.1+ use an explicit IV every time to protect against CBC attacks // that is appended to the record fragment iv = record.fragment.getBytes(16); } s.cipherState.init = true; // start cipher var cipher = s.cipherState.cipher; cipher.start({iv: iv}); // do decryption cipher.update(record.fragment); rval = cipher.finish(decrypt_aes_cbc_sha1_padding); // even if decryption fails, keep going to minimize timing attacks // decrypted data: // first (len - 20) bytes = application data // last 20 bytes = MAC var macLen = s.macLength; // create a random MAC to check against should the mac length check fail // Note: do this regardless of the failure to keep timing consistent var mac = forge.random.getBytesSync(macLen); // get fragment and mac var len = cipher.output.length(); if(len >= macLen) { record.fragment = cipher.output.getBytes(len - macLen); mac = cipher.output.getBytes(macLen); } else { // bad data, but get bytes anyway to try to keep timing consistent record.fragment = cipher.output.getBytes(); } record.fragment = forge.util.createBuffer(record.fragment); record.length = record.fragment.length(); // see if data integrity checks out, update sequence number var mac2 = s.macFunction(s.macKey, s.sequenceNumber, record); s.updateSequenceNumber(); rval = compareMacs(s.macKey, mac, mac2) && rval; return rval; } /** * Safely compare two MACs. This function will compare two MACs in a way * that protects against timing attacks. * * TODO: Expose elsewhere as a utility API. * * See: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/february/double-hmac-verification/ * * @param key the MAC key to use. * @param mac1 as a binary-encoded string of bytes. * @param mac2 as a binary-encoded string of bytes. * * @return true if the MACs are the same, false if not. */ function compareMacs(key, mac1, mac2) { var hmac = forge.hmac.create(); hmac.start('SHA1', key); hmac.update(mac1); mac1 = hmac.digest().getBytes(); hmac.start(null, null); hmac.update(mac2); mac2 = hmac.digest().getBytes(); return mac1 === mac2; } /***/ }), /***/ 29414: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /** * Copyright (c) 2019 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(39549); var asn1 = forge.asn1; exports.privateKeyValidator = { // PrivateKeyInfo name: 'PrivateKeyInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // Version (INTEGER) name: 'PrivateKeyInfo.version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyVersion' }, { // privateKeyAlgorithm name: 'PrivateKeyInfo.privateKeyAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'AlgorithmIdentifier.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'privateKeyOid' }] }, { // PrivateKey name: 'PrivateKeyInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'privateKey' }] }; exports.publicKeyValidator = { name: 'SubjectPublicKeyInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'subjectPublicKeyInfo', value: [{ name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'AlgorithmIdentifier.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'publicKeyOid' }] }, // capture group for ed25519PublicKey { tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, composed: true, captureBitStringValue: 'ed25519PublicKey' } // FIXME: this is capture group for rsaPublicKey, use it in this API or // discard? /* { // subjectPublicKey name: 'SubjectPublicKeyInfo.subjectPublicKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, value: [{ // RSAPublicKey name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, optional: true, captureAsn1: 'rsaPublicKey' }] } */ ] }; /***/ }), /***/ 39549: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of Abstract Syntax Notation Number One. * * @author Dave Longley * * Copyright (c) 2010-2015 Digital Bazaar, Inc. * * An API for storing data using the Abstract Syntax Notation Number One * format using DER (Distinguished Encoding Rules) encoding. This encoding is * commonly used to store data for PKI, i.e. X.509 Certificates, and this * implementation exists for that purpose. * * Abstract Syntax Notation Number One (ASN.1) is used to define the abstract * syntax of information without restricting the way the information is encoded * for transmission. It provides a standard that allows for open systems * communication. ASN.1 defines the syntax of information data and a number of * simple data types as well as a notation for describing them and specifying * values for them. * * The RSA algorithm creates public and private keys that are often stored in * X.509 or PKCS#X formats -- which use ASN.1 (encoded in DER format). This * class provides the most basic functionality required to store and load DSA * keys that are encoded according to ASN.1. * * The most common binary encodings for ASN.1 are BER (Basic Encoding Rules) * and DER (Distinguished Encoding Rules). DER is just a subset of BER that * has stricter requirements for how data must be encoded. * * Each ASN.1 structure has a tag (a byte identifying the ASN.1 structure type) * and a byte array for the value of this ASN1 structure which may be data or a * list of ASN.1 structures. * * Each ASN.1 structure using BER is (Tag-Length-Value): * * | byte 0 | bytes X | bytes Y | * |--------|---------|---------- * | tag | length | value | * * ASN.1 allows for tags to be of "High-tag-number form" which allows a tag to * be two or more octets, but that is not supported by this class. A tag is * only 1 byte. Bits 1-5 give the tag number (ie the data type within a * particular 'class'), 6 indicates whether or not the ASN.1 value is * constructed from other ASN.1 values, and bits 7 and 8 give the 'class'. If * bits 7 and 8 are both zero, the class is UNIVERSAL. If only bit 7 is set, * then the class is APPLICATION. If only bit 8 is set, then the class is * CONTEXT_SPECIFIC. If both bits 7 and 8 are set, then the class is PRIVATE. * The tag numbers for the data types for the class UNIVERSAL are listed below: * * UNIVERSAL 0 Reserved for use by the encoding rules * UNIVERSAL 1 Boolean type * UNIVERSAL 2 Integer type * UNIVERSAL 3 Bitstring type * UNIVERSAL 4 Octetstring type * UNIVERSAL 5 Null type * UNIVERSAL 6 Object identifier type * UNIVERSAL 7 Object descriptor type * UNIVERSAL 8 External type and Instance-of type * UNIVERSAL 9 Real type * UNIVERSAL 10 Enumerated type * UNIVERSAL 11 Embedded-pdv type * UNIVERSAL 12 UTF8String type * UNIVERSAL 13 Relative object identifier type * UNIVERSAL 14-15 Reserved for future editions * UNIVERSAL 16 Sequence and Sequence-of types * UNIVERSAL 17 Set and Set-of types * UNIVERSAL 18-22, 25-30 Character string types * UNIVERSAL 23-24 Time types * * The length of an ASN.1 structure is specified after the tag identifier. * There is a definite form and an indefinite form. The indefinite form may * be used if the encoding is constructed and not all immediately available. * The indefinite form is encoded using a length byte with only the 8th bit * set. The end of the constructed object is marked using end-of-contents * octets (two zero bytes). * * The definite form looks like this: * * The length may take up 1 or more bytes, it depends on the length of the * value of the ASN.1 structure. DER encoding requires that if the ASN.1 * structure has a value that has a length greater than 127, more than 1 byte * will be used to store its length, otherwise just one byte will be used. * This is strict. * * In the case that the length of the ASN.1 value is less than 127, 1 octet * (byte) is used to store the "short form" length. The 8th bit has a value of * 0 indicating the length is "short form" and not "long form" and bits 7-1 * give the length of the data. (The 8th bit is the left-most, most significant * bit: also known as big endian or network format). * * In the case that the length of the ASN.1 value is greater than 127, 2 to * 127 octets (bytes) are used to store the "long form" length. The first * byte's 8th bit is set to 1 to indicate the length is "long form." Bits 7-1 * give the number of additional octets. All following octets are in base 256 * with the most significant digit first (typical big-endian binary unsigned * integer storage). So, for instance, if the length of a value was 257, the * first byte would be set to: * * 10000010 = 130 = 0x82. * * This indicates there are 2 octets (base 256) for the length. The second and * third bytes (the octets just mentioned) would store the length in base 256: * * octet 2: 00000001 = 1 * 256^1 = 256 * octet 3: 00000001 = 1 * 256^0 = 1 * total = 257 * * The algorithm for converting a js integer value of 257 to base-256 is: * * var value = 257; * var bytes = []; * bytes[0] = (value >>> 8) & 0xFF; // most significant byte first * bytes[1] = value & 0xFF; // least significant byte last * * On the ASN.1 UNIVERSAL Object Identifier (OID) type: * * An OID can be written like: "value1.value2.value3...valueN" * * The DER encoding rules: * * The first byte has the value 40 * value1 + value2. * The following bytes, if any, encode the remaining values. Each value is * encoded in base 128, most significant digit first (big endian), with as * few digits as possible, and the most significant bit of each byte set * to 1 except the last in each value's encoding. For example: Given the * OID "1.2.840.113549", its DER encoding is (remember each byte except the * last one in each encoding is OR'd with 0x80): * * byte 1: 40 * 1 + 2 = 42 = 0x2A. * bytes 2-3: 128 * 6 + 72 = 840 = 6 72 = 6 72 = 0x0648 = 0x8648 * bytes 4-6: 16384 * 6 + 128 * 119 + 13 = 6 119 13 = 0x06770D = 0x86F70D * * The final value is: 0x2A864886F70D. * The full OID (including ASN.1 tag and length of 6 bytes) is: * 0x06062A864886F70D */ var forge = __webpack_require__(89177); __webpack_require__(28339); __webpack_require__(81925); /* ASN.1 API */ var asn1 = module.exports = forge.asn1 = forge.asn1 || {}; /** * ASN.1 classes. */ asn1.Class = { UNIVERSAL: 0x00, APPLICATION: 0x40, CONTEXT_SPECIFIC: 0x80, PRIVATE: 0xC0 }; /** * ASN.1 types. Not all types are supported by this implementation, only * those necessary to implement a simple PKI are implemented. */ asn1.Type = { NONE: 0, BOOLEAN: 1, INTEGER: 2, BITSTRING: 3, OCTETSTRING: 4, NULL: 5, OID: 6, ODESC: 7, EXTERNAL: 8, REAL: 9, ENUMERATED: 10, EMBEDDED: 11, UTF8: 12, ROID: 13, SEQUENCE: 16, SET: 17, PRINTABLESTRING: 19, IA5STRING: 22, UTCTIME: 23, GENERALIZEDTIME: 24, BMPSTRING: 30 }; /** * Creates a new asn1 object. * * @param tagClass the tag class for the object. * @param type the data type (tag number) for the object. * @param constructed true if the asn1 object is in constructed form. * @param value the value for the object, if it is not constructed. * @param [options] the options to use: * [bitStringContents] the plain BIT STRING content including padding * byte. * * @return the asn1 object. */ asn1.create = function(tagClass, type, constructed, value, options) { /* An asn1 object has a tagClass, a type, a constructed flag, and a value. The value's type depends on the constructed flag. If constructed, it will contain a list of other asn1 objects. If not, it will contain the ASN.1 value as an array of bytes formatted according to the ASN.1 data type. */ // remove undefined values if(forge.util.isArray(value)) { var tmp = []; for(var i = 0; i < value.length; ++i) { if(value[i] !== undefined) { tmp.push(value[i]); } } value = tmp; } var obj = { tagClass: tagClass, type: type, constructed: constructed, composed: constructed || forge.util.isArray(value), value: value }; if(options && 'bitStringContents' in options) { // TODO: copy byte buffer if it's a buffer not a string obj.bitStringContents = options.bitStringContents; // TODO: add readonly flag to avoid this overhead // save copy to detect changes obj.original = asn1.copy(obj); } return obj; }; /** * Copies an asn1 object. * * @param obj the asn1 object. * @param [options] copy options: * [excludeBitStringContents] true to not copy bitStringContents * * @return the a copy of the asn1 object. */ asn1.copy = function(obj, options) { var copy; if(forge.util.isArray(obj)) { copy = []; for(var i = 0; i < obj.length; ++i) { copy.push(asn1.copy(obj[i], options)); } return copy; } if(typeof obj === 'string') { // TODO: copy byte buffer if it's a buffer not a string return obj; } copy = { tagClass: obj.tagClass, type: obj.type, constructed: obj.constructed, composed: obj.composed, value: asn1.copy(obj.value, options) }; if(options && !options.excludeBitStringContents) { // TODO: copy byte buffer if it's a buffer not a string copy.bitStringContents = obj.bitStringContents; } return copy; }; /** * Compares asn1 objects for equality. * * Note this function does not run in constant time. * * @param obj1 the first asn1 object. * @param obj2 the second asn1 object. * @param [options] compare options: * [includeBitStringContents] true to compare bitStringContents * * @return true if the asn1 objects are equal. */ asn1.equals = function(obj1, obj2, options) { if(forge.util.isArray(obj1)) { if(!forge.util.isArray(obj2)) { return false; } if(obj1.length !== obj2.length) { return false; } for(var i = 0; i < obj1.length; ++i) { if(!asn1.equals(obj1[i], obj2[i])) { return false; } } return true; } if(typeof obj1 !== typeof obj2) { return false; } if(typeof obj1 === 'string') { return obj1 === obj2; } var equal = obj1.tagClass === obj2.tagClass && obj1.type === obj2.type && obj1.constructed === obj2.constructed && obj1.composed === obj2.composed && asn1.equals(obj1.value, obj2.value); if(options && options.includeBitStringContents) { equal = equal && (obj1.bitStringContents === obj2.bitStringContents); } return equal; }; /** * Gets the length of a BER-encoded ASN.1 value. * * In case the length is not specified, undefined is returned. * * @param b the BER-encoded ASN.1 byte buffer, starting with the first * length byte. * * @return the length of the BER-encoded ASN.1 value or undefined. */ asn1.getBerValueLength = function(b) { // TODO: move this function and related DER/BER functions to a der.js // file; better abstract ASN.1 away from der/ber. var b2 = b.getByte(); if(b2 === 0x80) { return undefined; } // see if the length is "short form" or "long form" (bit 8 set) var length; var longForm = b2 & 0x80; if(!longForm) { // length is just the first byte length = b2; } else { // the number of bytes the length is specified in bits 7 through 1 // and each length byte is in big-endian base-256 length = b.getInt((b2 & 0x7F) << 3); } return length; }; /** * Check if the byte buffer has enough bytes. Throws an Error if not. * * @param bytes the byte buffer to parse from. * @param remaining the bytes remaining in the current parsing state. * @param n the number of bytes the buffer must have. */ function _checkBufferLength(bytes, remaining, n) { if(n > remaining) { var error = new Error('Too few bytes to parse DER.'); error.available = bytes.length(); error.remaining = remaining; error.requested = n; throw error; } } /** * Gets the length of a BER-encoded ASN.1 value. * * In case the length is not specified, undefined is returned. * * @param bytes the byte buffer to parse from. * @param remaining the bytes remaining in the current parsing state. * * @return the length of the BER-encoded ASN.1 value or undefined. */ var _getValueLength = function(bytes, remaining) { // TODO: move this function and related DER/BER functions to a der.js // file; better abstract ASN.1 away from der/ber. // fromDer already checked that this byte exists var b2 = bytes.getByte(); remaining--; if(b2 === 0x80) { return undefined; } // see if the length is "short form" or "long form" (bit 8 set) var length; var longForm = b2 & 0x80; if(!longForm) { // length is just the first byte length = b2; } else { // the number of bytes the length is specified in bits 7 through 1 // and each length byte is in big-endian base-256 var longFormBytes = b2 & 0x7F; _checkBufferLength(bytes, remaining, longFormBytes); length = bytes.getInt(longFormBytes << 3); } // FIXME: this will only happen for 32 bit getInt with high bit set if(length < 0) { throw new Error('Negative length: ' + length); } return length; }; /** * Parses an asn1 object from a byte buffer in DER format. * * @param bytes the byte buffer to parse from. * @param [strict] true to be strict when checking value lengths, false to * allow truncated values (default: true). * @param [options] object with options or boolean strict flag * [strict] true to be strict when checking value lengths, false to * allow truncated values (default: true). * [decodeBitStrings] true to attempt to decode the content of * BIT STRINGs (not OCTET STRINGs) using strict mode. Note that * without schema support to understand the data context this can * erroneously decode values that happen to be valid ASN.1. This * flag will be deprecated or removed as soon as schema support is * available. (default: true) * * @return the parsed asn1 object. */ asn1.fromDer = function(bytes, options) { if(options === undefined) { options = { strict: true, decodeBitStrings: true }; } if(typeof options === 'boolean') { options = { strict: options, decodeBitStrings: true }; } if(!('strict' in options)) { options.strict = true; } if(!('decodeBitStrings' in options)) { options.decodeBitStrings = true; } // wrap in buffer if needed if(typeof bytes === 'string') { bytes = forge.util.createBuffer(bytes); } return _fromDer(bytes, bytes.length(), 0, options); }; /** * Internal function to parse an asn1 object from a byte buffer in DER format. * * @param bytes the byte buffer to parse from. * @param remaining the number of bytes remaining for this chunk. * @param depth the current parsing depth. * @param options object with same options as fromDer(). * * @return the parsed asn1 object. */ function _fromDer(bytes, remaining, depth, options) { // temporary storage for consumption calculations var start; // minimum length for ASN.1 DER structure is 2 _checkBufferLength(bytes, remaining, 2); // get the first byte var b1 = bytes.getByte(); // consumed one byte remaining--; // get the tag class var tagClass = (b1 & 0xC0); // get the type (bits 1-5) var type = b1 & 0x1F; // get the variable value length and adjust remaining bytes start = bytes.length(); var length = _getValueLength(bytes, remaining); remaining -= start - bytes.length(); // ensure there are enough bytes to get the value if(length !== undefined && length > remaining) { if(options.strict) { var error = new Error('Too few bytes to read ASN.1 value.'); error.available = bytes.length(); error.remaining = remaining; error.requested = length; throw error; } // Note: be lenient with truncated values and use remaining state bytes length = remaining; } // value storage var value; // possible BIT STRING contents storage var bitStringContents; // constructed flag is bit 6 (32 = 0x20) of the first byte var constructed = ((b1 & 0x20) === 0x20); if(constructed) { // parse child asn1 objects from the value value = []; if(length === undefined) { // asn1 object of indefinite length, read until end tag for(;;) { _checkBufferLength(bytes, remaining, 2); if(bytes.bytes(2) === String.fromCharCode(0, 0)) { bytes.getBytes(2); remaining -= 2; break; } start = bytes.length(); value.push(_fromDer(bytes, remaining, depth + 1, options)); remaining -= start - bytes.length(); } } else { // parsing asn1 object of definite length while(length > 0) { start = bytes.length(); value.push(_fromDer(bytes, length, depth + 1, options)); remaining -= start - bytes.length(); length -= start - bytes.length(); } } } // if a BIT STRING, save the contents including padding if(value === undefined && tagClass === asn1.Class.UNIVERSAL && type === asn1.Type.BITSTRING) { bitStringContents = bytes.bytes(length); } // determine if a non-constructed value should be decoded as a composed // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs) // can be used this way. if(value === undefined && options.decodeBitStrings && tagClass === asn1.Class.UNIVERSAL && // FIXME: OCTET STRINGs not yet supported here // .. other parts of forge expect to decode OCTET STRINGs manually (type === asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/) && length > 1) { // save read position var savedRead = bytes.read; var savedRemaining = remaining; var unused = 0; if(type === asn1.Type.BITSTRING) { /* The first octet gives the number of bits by which the length of the bit string is less than the next multiple of eight (this is called the "number of unused bits"). The second and following octets give the value of the bit string converted to an octet string. */ _checkBufferLength(bytes, remaining, 1); unused = bytes.getByte(); remaining--; } // if all bits are used, maybe the BIT/OCTET STRING holds ASN.1 objs if(unused === 0) { try { // attempt to parse child asn1 object from the value // (stored in array to signal composed value) start = bytes.length(); var subOptions = { // enforce strict mode to avoid parsing ASN.1 from plain data verbose: options.verbose, strict: true, decodeBitStrings: true }; var composed = _fromDer(bytes, remaining, depth + 1, subOptions); var used = start - bytes.length(); remaining -= used; if(type == asn1.Type.BITSTRING) { used++; } // if the data all decoded and the class indicates UNIVERSAL or // CONTEXT_SPECIFIC then assume we've got an encapsulated ASN.1 object var tc = composed.tagClass; if(used === length && (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { value = [composed]; } } catch(ex) { } } if(value === undefined) { // restore read position bytes.read = savedRead; remaining = savedRemaining; } } if(value === undefined) { // asn1 not constructed or composed, get raw value // TODO: do DER to OID conversion and vice-versa in .toDer? if(length === undefined) { if(options.strict) { throw new Error('Non-constructed ASN.1 object of indefinite length.'); } // be lenient and use remaining state bytes length = remaining; } if(type === asn1.Type.BMPSTRING) { value = ''; for(; length > 0; length -= 2) { _checkBufferLength(bytes, remaining, 2); value += String.fromCharCode(bytes.getInt16()); remaining -= 2; } } else { value = bytes.getBytes(length); } } // add BIT STRING contents if available var asn1Options = bitStringContents === undefined ? null : { bitStringContents: bitStringContents }; // create and return asn1 object return asn1.create(tagClass, type, constructed, value, asn1Options); } /** * Converts the given asn1 object to a buffer of bytes in DER format. * * @param asn1 the asn1 object to convert to bytes. * * @return the buffer of bytes. */ asn1.toDer = function(obj) { var bytes = forge.util.createBuffer(); // build the first byte var b1 = obj.tagClass | obj.type; // for storing the ASN.1 value var value = forge.util.createBuffer(); // use BIT STRING contents if available and data not changed var useBitStringContents = false; if('bitStringContents' in obj) { useBitStringContents = true; if(obj.original) { useBitStringContents = asn1.equals(obj, obj.original); } } if(useBitStringContents) { value.putBytes(obj.bitStringContents); } else if(obj.composed) { // if composed, use each child asn1 object's DER bytes as value // turn on 6th bit (0x20 = 32) to indicate asn1 is constructed // from other asn1 objects if(obj.constructed) { b1 |= 0x20; } else { // type is a bit string, add unused bits of 0x00 value.putByte(0x00); } // add all of the child DER bytes together for(var i = 0; i < obj.value.length; ++i) { if(obj.value[i] !== undefined) { value.putBuffer(asn1.toDer(obj.value[i])); } } } else { // use asn1.value directly if(obj.type === asn1.Type.BMPSTRING) { for(var i = 0; i < obj.value.length; ++i) { value.putInt16(obj.value.charCodeAt(i)); } } else { // ensure integer is minimally-encoded // TODO: should all leading bytes be stripped vs just one? // .. ex '00 00 01' => '01'? if(obj.type === asn1.Type.INTEGER && obj.value.length > 1 && // leading 0x00 for positive integer ((obj.value.charCodeAt(0) === 0 && (obj.value.charCodeAt(1) & 0x80) === 0) || // leading 0xFF for negative integer (obj.value.charCodeAt(0) === 0xFF && (obj.value.charCodeAt(1) & 0x80) === 0x80))) { value.putBytes(obj.value.substr(1)); } else { value.putBytes(obj.value); } } } // add tag byte bytes.putByte(b1); // use "short form" encoding if(value.length() <= 127) { // one byte describes the length // bit 8 = 0 and bits 7-1 = length bytes.putByte(value.length() & 0x7F); } else { // use "long form" encoding // 2 to 127 bytes describe the length // first byte: bit 8 = 1 and bits 7-1 = # of additional bytes // other bytes: length in base 256, big-endian var len = value.length(); var lenBytes = ''; do { lenBytes += String.fromCharCode(len & 0xFF); len = len >>> 8; } while(len > 0); // set first byte to # bytes used to store the length and turn on // bit 8 to indicate long-form length is used bytes.putByte(lenBytes.length | 0x80); // concatenate length bytes in reverse since they were generated // little endian and we need big endian for(var i = lenBytes.length - 1; i >= 0; --i) { bytes.putByte(lenBytes.charCodeAt(i)); } } // concatenate value bytes bytes.putBuffer(value); return bytes; }; /** * Converts an OID dot-separated string to a byte buffer. The byte buffer * contains only the DER-encoded value, not any tag or length bytes. * * @param oid the OID dot-separated string. * * @return the byte buffer. */ asn1.oidToDer = function(oid) { // split OID into individual values var values = oid.split('.'); var bytes = forge.util.createBuffer(); // first byte is 40 * value1 + value2 bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10)); // other bytes are each value in base 128 with 8th bit set except for // the last byte for each value var last, valueBytes, value, b; for(var i = 2; i < values.length; ++i) { // produce value bytes in reverse because we don't know how many // bytes it will take to store the value last = true; valueBytes = []; value = parseInt(values[i], 10); do { b = value & 0x7F; value = value >>> 7; // if value is not last, then turn on 8th bit if(!last) { b |= 0x80; } valueBytes.push(b); last = false; } while(value > 0); // add value bytes in reverse (needs to be in big endian) for(var n = valueBytes.length - 1; n >= 0; --n) { bytes.putByte(valueBytes[n]); } } return bytes; }; /** * Converts a DER-encoded byte buffer to an OID dot-separated string. The * byte buffer should contain only the DER-encoded value, not any tag or * length bytes. * * @param bytes the byte buffer. * * @return the OID dot-separated string. */ asn1.derToOid = function(bytes) { var oid; // wrap in buffer if needed if(typeof bytes === 'string') { bytes = forge.util.createBuffer(bytes); } // first byte is 40 * value1 + value2 var b = bytes.getByte(); oid = Math.floor(b / 40) + '.' + (b % 40); // other bytes are each value in base 128 with 8th bit set except for // the last byte for each value var value = 0; while(bytes.length() > 0) { b = bytes.getByte(); value = value << 7; // not the last byte for the value if(b & 0x80) { value += b & 0x7F; } else { // last byte oid += '.' + (value + b); value = 0; } } return oid; }; /** * Converts a UTCTime value to a date. * * Note: GeneralizedTime has 4 digits for the year and is used for X.509 * dates past 2049. Parsing that structure hasn't been implemented yet. * * @param utc the UTCTime value to convert. * * @return the date. */ asn1.utcTimeToDate = function(utc) { /* The following formats can be used: YYMMDDhhmmZ YYMMDDhhmm+hh'mm' YYMMDDhhmm-hh'mm' YYMMDDhhmmssZ YYMMDDhhmmss+hh'mm' YYMMDDhhmmss-hh'mm' Where: YY is the least significant two digits of the year MM is the month (01 to 12) DD is the day (01 to 31) hh is the hour (00 to 23) mm are the minutes (00 to 59) ss are the seconds (00 to 59) Z indicates that local time is GMT, + indicates that local time is later than GMT, and - indicates that local time is earlier than GMT hh' is the absolute value of the offset from GMT in hours mm' is the absolute value of the offset from GMT in minutes */ var date = new Date(); // if YY >= 50 use 19xx, if YY < 50 use 20xx var year = parseInt(utc.substr(0, 2), 10); year = (year >= 50) ? 1900 + year : 2000 + year; var MM = parseInt(utc.substr(2, 2), 10) - 1; // use 0-11 for month var DD = parseInt(utc.substr(4, 2), 10); var hh = parseInt(utc.substr(6, 2), 10); var mm = parseInt(utc.substr(8, 2), 10); var ss = 0; // not just YYMMDDhhmmZ if(utc.length > 11) { // get character after minutes var c = utc.charAt(10); var end = 10; // see if seconds are present if(c !== '+' && c !== '-') { // get seconds ss = parseInt(utc.substr(10, 2), 10); end += 2; } } // update date date.setUTCFullYear(year, MM, DD); date.setUTCHours(hh, mm, ss, 0); if(end) { // get +/- after end of time c = utc.charAt(end); if(c === '+' || c === '-') { // get hours+minutes offset var hhoffset = parseInt(utc.substr(end + 1, 2), 10); var mmoffset = parseInt(utc.substr(end + 4, 2), 10); // calculate offset in milliseconds var offset = hhoffset * 60 + mmoffset; offset *= 60000; // apply offset if(c === '+') { date.setTime(+date - offset); } else { date.setTime(+date + offset); } } } return date; }; /** * Converts a GeneralizedTime value to a date. * * @param gentime the GeneralizedTime value to convert. * * @return the date. */ asn1.generalizedTimeToDate = function(gentime) { /* The following formats can be used: YYYYMMDDHHMMSS YYYYMMDDHHMMSS.fff YYYYMMDDHHMMSSZ YYYYMMDDHHMMSS.fffZ YYYYMMDDHHMMSS+hh'mm' YYYYMMDDHHMMSS.fff+hh'mm' YYYYMMDDHHMMSS-hh'mm' YYYYMMDDHHMMSS.fff-hh'mm' Where: YYYY is the year MM is the month (01 to 12) DD is the day (01 to 31) hh is the hour (00 to 23) mm are the minutes (00 to 59) ss are the seconds (00 to 59) .fff is the second fraction, accurate to three decimal places Z indicates that local time is GMT, + indicates that local time is later than GMT, and - indicates that local time is earlier than GMT hh' is the absolute value of the offset from GMT in hours mm' is the absolute value of the offset from GMT in minutes */ var date = new Date(); var YYYY = parseInt(gentime.substr(0, 4), 10); var MM = parseInt(gentime.substr(4, 2), 10) - 1; // use 0-11 for month var DD = parseInt(gentime.substr(6, 2), 10); var hh = parseInt(gentime.substr(8, 2), 10); var mm = parseInt(gentime.substr(10, 2), 10); var ss = parseInt(gentime.substr(12, 2), 10); var fff = 0; var offset = 0; var isUTC = false; if(gentime.charAt(gentime.length - 1) === 'Z') { isUTC = true; } var end = gentime.length - 5, c = gentime.charAt(end); if(c === '+' || c === '-') { // get hours+minutes offset var hhoffset = parseInt(gentime.substr(end + 1, 2), 10); var mmoffset = parseInt(gentime.substr(end + 4, 2), 10); // calculate offset in milliseconds offset = hhoffset * 60 + mmoffset; offset *= 60000; // apply offset if(c === '+') { offset *= -1; } isUTC = true; } // check for second fraction if(gentime.charAt(14) === '.') { fff = parseFloat(gentime.substr(14), 10) * 1000; } if(isUTC) { date.setUTCFullYear(YYYY, MM, DD); date.setUTCHours(hh, mm, ss, fff); // apply offset date.setTime(+date + offset); } else { date.setFullYear(YYYY, MM, DD); date.setHours(hh, mm, ss, fff); } return date; }; /** * Converts a date to a UTCTime value. * * Note: GeneralizedTime has 4 digits for the year and is used for X.509 * dates past 2049. Converting to a GeneralizedTime hasn't been * implemented yet. * * @param date the date to convert. * * @return the UTCTime value. */ asn1.dateToUtcTime = function(date) { // TODO: validate; currently assumes proper format if(typeof date === 'string') { return date; } var rval = ''; // create format YYMMDDhhmmssZ var format = []; format.push(('' + date.getUTCFullYear()).substr(2)); format.push('' + (date.getUTCMonth() + 1)); format.push('' + date.getUTCDate()); format.push('' + date.getUTCHours()); format.push('' + date.getUTCMinutes()); format.push('' + date.getUTCSeconds()); // ensure 2 digits are used for each format entry for(var i = 0; i < format.length; ++i) { if(format[i].length < 2) { rval += '0'; } rval += format[i]; } rval += 'Z'; return rval; }; /** * Converts a date to a GeneralizedTime value. * * @param date the date to convert. * * @return the GeneralizedTime value as a string. */ asn1.dateToGeneralizedTime = function(date) { // TODO: validate; currently assumes proper format if(typeof date === 'string') { return date; } var rval = ''; // create format YYYYMMDDHHMMSSZ var format = []; format.push('' + date.getUTCFullYear()); format.push('' + (date.getUTCMonth() + 1)); format.push('' + date.getUTCDate()); format.push('' + date.getUTCHours()); format.push('' + date.getUTCMinutes()); format.push('' + date.getUTCSeconds()); // ensure 2 digits are used for each format entry for(var i = 0; i < format.length; ++i) { if(format[i].length < 2) { rval += '0'; } rval += format[i]; } rval += 'Z'; return rval; }; /** * Converts a javascript integer to a DER-encoded byte buffer to be used * as the value for an INTEGER type. * * @param x the integer. * * @return the byte buffer. */ asn1.integerToDer = function(x) { var rval = forge.util.createBuffer(); if(x >= -0x80 && x < 0x80) { return rval.putSignedInt(x, 8); } if(x >= -0x8000 && x < 0x8000) { return rval.putSignedInt(x, 16); } if(x >= -0x800000 && x < 0x800000) { return rval.putSignedInt(x, 24); } if(x >= -0x80000000 && x < 0x80000000) { return rval.putSignedInt(x, 32); } var error = new Error('Integer too large; max is 32-bits.'); error.integer = x; throw error; }; /** * Converts a DER-encoded byte buffer to a javascript integer. This is * typically used to decode the value of an INTEGER type. * * @param bytes the byte buffer. * * @return the integer. */ asn1.derToInteger = function(bytes) { // wrap in buffer if needed if(typeof bytes === 'string') { bytes = forge.util.createBuffer(bytes); } var n = bytes.length() * 8; if(n > 32) { throw new Error('Integer too large; max is 32-bits.'); } return bytes.getSignedInt(n); }; /** * Validates that the given ASN.1 object is at least a super set of the * given ASN.1 structure. Only tag classes and types are checked. An * optional map may also be provided to capture ASN.1 values while the * structure is checked. * * To capture an ASN.1 value, set an object in the validator's 'capture' * parameter to the key to use in the capture map. To capture the full * ASN.1 object, specify 'captureAsn1'. To capture BIT STRING bytes, including * the leading unused bits counter byte, specify 'captureBitStringContents'. * To capture BIT STRING bytes, without the leading unused bits counter byte, * specify 'captureBitStringValue'. * * Objects in the validator may set a field 'optional' to true to indicate * that it isn't necessary to pass validation. * * @param obj the ASN.1 object to validate. * @param v the ASN.1 structure validator. * @param capture an optional map to capture values in. * @param errors an optional array for storing validation errors. * * @return true on success, false on failure. */ asn1.validate = function(obj, v, capture, errors) { var rval = false; // ensure tag class and type are the same if specified if((obj.tagClass === v.tagClass || typeof(v.tagClass) === 'undefined') && (obj.type === v.type || typeof(v.type) === 'undefined')) { // ensure constructed flag is the same if specified if(obj.constructed === v.constructed || typeof(v.constructed) === 'undefined') { rval = true; // handle sub values if(v.value && forge.util.isArray(v.value)) { var j = 0; for(var i = 0; rval && i < v.value.length; ++i) { rval = v.value[i].optional || false; if(obj.value[j]) { rval = asn1.validate(obj.value[j], v.value[i], capture, errors); if(rval) { ++j; } else if(v.value[i].optional) { rval = true; } } if(!rval && errors) { errors.push( '[' + v.name + '] ' + 'Tag class "' + v.tagClass + '", type "' + v.type + '" expected value length "' + v.value.length + '", got "' + obj.value.length + '"'); } } } if(rval && capture) { if(v.capture) { capture[v.capture] = obj.value; } if(v.captureAsn1) { capture[v.captureAsn1] = obj; } if(v.captureBitStringContents && 'bitStringContents' in obj) { capture[v.captureBitStringContents] = obj.bitStringContents; } if(v.captureBitStringValue && 'bitStringContents' in obj) { var value; if(obj.bitStringContents.length < 2) { capture[v.captureBitStringValue] = ''; } else { // FIXME: support unused bits with data shifting var unused = obj.bitStringContents.charCodeAt(0); if(unused !== 0) { throw new Error( 'captureBitStringValue only supported for zero unused bits'); } capture[v.captureBitStringValue] = obj.bitStringContents.slice(1); } } } } else if(errors) { errors.push( '[' + v.name + '] ' + 'Expected constructed "' + v.constructed + '", got "' + obj.constructed + '"'); } } else if(errors) { if(obj.tagClass !== v.tagClass) { errors.push( '[' + v.name + '] ' + 'Expected tag class "' + v.tagClass + '", got "' + obj.tagClass + '"'); } if(obj.type !== v.type) { errors.push( '[' + v.name + '] ' + 'Expected type "' + v.type + '", got "' + obj.type + '"'); } } return rval; }; // regex for testing for non-latin characters var _nonLatinRegex = /[^\\u0000-\\u00ff]/; /** * Pretty prints an ASN.1 object to a string. * * @param obj the object to write out. * @param level the level in the tree. * @param indentation the indentation to use. * * @return the string. */ asn1.prettyPrint = function(obj, level, indentation) { var rval = ''; // set default level and indentation level = level || 0; indentation = indentation || 2; // start new line for deep levels if(level > 0) { rval += '\n'; } // create indent var indent = ''; for(var i = 0; i < level * indentation; ++i) { indent += ' '; } // print class:type rval += indent + 'Tag: '; switch(obj.tagClass) { case asn1.Class.UNIVERSAL: rval += 'Universal:'; break; case asn1.Class.APPLICATION: rval += 'Application:'; break; case asn1.Class.CONTEXT_SPECIFIC: rval += 'Context-Specific:'; break; case asn1.Class.PRIVATE: rval += 'Private:'; break; } if(obj.tagClass === asn1.Class.UNIVERSAL) { rval += obj.type; // known types switch(obj.type) { case asn1.Type.NONE: rval += ' (None)'; break; case asn1.Type.BOOLEAN: rval += ' (Boolean)'; break; case asn1.Type.INTEGER: rval += ' (Integer)'; break; case asn1.Type.BITSTRING: rval += ' (Bit string)'; break; case asn1.Type.OCTETSTRING: rval += ' (Octet string)'; break; case asn1.Type.NULL: rval += ' (Null)'; break; case asn1.Type.OID: rval += ' (Object Identifier)'; break; case asn1.Type.ODESC: rval += ' (Object Descriptor)'; break; case asn1.Type.EXTERNAL: rval += ' (External or Instance of)'; break; case asn1.Type.REAL: rval += ' (Real)'; break; case asn1.Type.ENUMERATED: rval += ' (Enumerated)'; break; case asn1.Type.EMBEDDED: rval += ' (Embedded PDV)'; break; case asn1.Type.UTF8: rval += ' (UTF8)'; break; case asn1.Type.ROID: rval += ' (Relative Object Identifier)'; break; case asn1.Type.SEQUENCE: rval += ' (Sequence)'; break; case asn1.Type.SET: rval += ' (Set)'; break; case asn1.Type.PRINTABLESTRING: rval += ' (Printable String)'; break; case asn1.Type.IA5String: rval += ' (IA5String (ASCII))'; break; case asn1.Type.UTCTIME: rval += ' (UTC time)'; break; case asn1.Type.GENERALIZEDTIME: rval += ' (Generalized time)'; break; case asn1.Type.BMPSTRING: rval += ' (BMP String)'; break; } } else { rval += obj.type; } rval += '\n'; rval += indent + 'Constructed: ' + obj.constructed + '\n'; if(obj.composed) { var subvalues = 0; var sub = ''; for(var i = 0; i < obj.value.length; ++i) { if(obj.value[i] !== undefined) { subvalues += 1; sub += asn1.prettyPrint(obj.value[i], level + 1, indentation); if((i + 1) < obj.value.length) { sub += ','; } } } rval += indent + 'Sub values: ' + subvalues + sub; } else { rval += indent + 'Value: '; if(obj.type === asn1.Type.OID) { var oid = asn1.derToOid(obj.value); rval += oid; if(forge.pki && forge.pki.oids) { if(oid in forge.pki.oids) { rval += ' (' + forge.pki.oids[oid] + ') '; } } } if(obj.type === asn1.Type.INTEGER) { try { rval += asn1.derToInteger(obj.value); } catch(ex) { rval += '0x' + forge.util.bytesToHex(obj.value); } } else if(obj.type === asn1.Type.BITSTRING) { // TODO: shift bits as needed to display without padding if(obj.value.length > 1) { // remove unused bits field rval += '0x' + forge.util.bytesToHex(obj.value.slice(1)); } else { rval += '(none)'; } // show unused bit count if(obj.value.length > 0) { var unused = obj.value.charCodeAt(0); if(unused == 1) { rval += ' (1 unused bit shown)'; } else if(unused > 1) { rval += ' (' + unused + ' unused bits shown)'; } } } else if(obj.type === asn1.Type.OCTETSTRING) { if(!_nonLatinRegex.test(obj.value)) { rval += '(' + obj.value + ') '; } rval += '0x' + forge.util.bytesToHex(obj.value); } else if(obj.type === asn1.Type.UTF8) { rval += forge.util.decodeUtf8(obj.value); } else if(obj.type === asn1.Type.PRINTABLESTRING || obj.type === asn1.Type.IA5String) { rval += obj.value; } else if(_nonLatinRegex.test(obj.value)) { rval += '0x' + forge.util.bytesToHex(obj.value); } else if(obj.value.length === 0) { rval += '[null]'; } else { rval += obj.value; } } return rval; }; /***/ }), /***/ 72300: /***/ ((module) => { /** * Base-N/Base-X encoding/decoding functions. * * Original implementation from base-x: * https://github.com/cryptocoinjs/base-x * * Which is MIT licensed: * * The MIT License (MIT) * * Copyright base-x contributors (c) 2016 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ var api = {}; module.exports = api; // baseN alphabet indexes var _reverseAlphabets = {}; /** * BaseN-encodes a Uint8Array using the given alphabet. * * @param input the Uint8Array to encode. * @param maxline the maximum number of encoded characters per line to use, * defaults to none. * * @return the baseN-encoded output string. */ api.encode = function(input, alphabet, maxline) { if(typeof alphabet !== 'string') { throw new TypeError('"alphabet" must be a string.'); } if(maxline !== undefined && typeof maxline !== 'number') { throw new TypeError('"maxline" must be a number.'); } var output = ''; if(!(input instanceof Uint8Array)) { // assume forge byte buffer output = _encodeWithByteBuffer(input, alphabet); } else { var i = 0; var base = alphabet.length; var first = alphabet.charAt(0); var digits = [0]; for(i = 0; i < input.length; ++i) { for(var j = 0, carry = input[i]; j < digits.length; ++j) { carry += digits[j] << 8; digits[j] = carry % base; carry = (carry / base) | 0; } while(carry > 0) { digits.push(carry % base); carry = (carry / base) | 0; } } // deal with leading zeros for(i = 0; input[i] === 0 && i < input.length - 1; ++i) { output += first; } // convert digits to a string for(i = digits.length - 1; i >= 0; --i) { output += alphabet[digits[i]]; } } if(maxline) { var regex = new RegExp('.{1,' + maxline + '}', 'g'); output = output.match(regex).join('\r\n'); } return output; }; /** * Decodes a baseN-encoded (using the given alphabet) string to a * Uint8Array. * * @param input the baseN-encoded input string. * * @return the Uint8Array. */ api.decode = function(input, alphabet) { if(typeof input !== 'string') { throw new TypeError('"input" must be a string.'); } if(typeof alphabet !== 'string') { throw new TypeError('"alphabet" must be a string.'); } var table = _reverseAlphabets[alphabet]; if(!table) { // compute reverse alphabet table = _reverseAlphabets[alphabet] = []; for(var i = 0; i < alphabet.length; ++i) { table[alphabet.charCodeAt(i)] = i; } } // remove whitespace characters input = input.replace(/\s/g, ''); var base = alphabet.length; var first = alphabet.charAt(0); var bytes = [0]; for(var i = 0; i < input.length; i++) { var value = table[input.charCodeAt(i)]; if(value === undefined) { return; } for(var j = 0, carry = value; j < bytes.length; ++j) { carry += bytes[j] * base; bytes[j] = carry & 0xff; carry >>= 8; } while(carry > 0) { bytes.push(carry & 0xff); carry >>= 8; } } // deal with leading zeros for(var k = 0; input[k] === first && k < input.length - 1; ++k) { bytes.push(0); } if(typeof Buffer !== 'undefined') { return Buffer.from(bytes.reverse()); } return new Uint8Array(bytes.reverse()); }; function _encodeWithByteBuffer(input, alphabet) { var i = 0; var base = alphabet.length; var first = alphabet.charAt(0); var digits = [0]; for(i = 0; i < input.length(); ++i) { for(var j = 0, carry = input.at(i); j < digits.length; ++j) { carry += digits[j] << 8; digits[j] = carry % base; carry = (carry / base) | 0; } while(carry > 0) { digits.push(carry % base); carry = (carry / base) | 0; } } var output = ''; // deal with leading zeros for(i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) { output += first; } // convert digits to a string for(i = digits.length - 1; i >= 0; --i) { output += alphabet[digits[i]]; } return output; } /***/ }), /***/ 7088: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Cipher base API. * * @author Dave Longley * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(28339); module.exports = forge.cipher = forge.cipher || {}; // registered algorithms forge.cipher.algorithms = forge.cipher.algorithms || {}; /** * Creates a cipher object that can be used to encrypt data using the given * algorithm and key. The algorithm may be provided as a string value for a * previously registered algorithm or it may be given as a cipher algorithm * API object. * * @param algorithm the algorithm to use, either a string or an algorithm API * object. * @param key the key to use, as a binary-encoded string of bytes or a * byte buffer. * * @return the cipher. */ forge.cipher.createCipher = function(algorithm, key) { var api = algorithm; if(typeof api === 'string') { api = forge.cipher.getAlgorithm(api); if(api) { api = api(); } } if(!api) { throw new Error('Unsupported algorithm: ' + algorithm); } // assume block cipher return new forge.cipher.BlockCipher({ algorithm: api, key: key, decrypt: false }); }; /** * Creates a decipher object that can be used to decrypt data using the given * algorithm and key. The algorithm may be provided as a string value for a * previously registered algorithm or it may be given as a cipher algorithm * API object. * * @param algorithm the algorithm to use, either a string or an algorithm API * object. * @param key the key to use, as a binary-encoded string of bytes or a * byte buffer. * * @return the cipher. */ forge.cipher.createDecipher = function(algorithm, key) { var api = algorithm; if(typeof api === 'string') { api = forge.cipher.getAlgorithm(api); if(api) { api = api(); } } if(!api) { throw new Error('Unsupported algorithm: ' + algorithm); } // assume block cipher return new forge.cipher.BlockCipher({ algorithm: api, key: key, decrypt: true }); }; /** * Registers an algorithm by name. If the name was already registered, the * algorithm API object will be overwritten. * * @param name the name of the algorithm. * @param algorithm the algorithm API object. */ forge.cipher.registerAlgorithm = function(name, algorithm) { name = name.toUpperCase(); forge.cipher.algorithms[name] = algorithm; }; /** * Gets a registered algorithm by name. * * @param name the name of the algorithm. * * @return the algorithm, if found, null if not. */ forge.cipher.getAlgorithm = function(name) { name = name.toUpperCase(); if(name in forge.cipher.algorithms) { return forge.cipher.algorithms[name]; } return null; }; var BlockCipher = forge.cipher.BlockCipher = function(options) { this.algorithm = options.algorithm; this.mode = this.algorithm.mode; this.blockSize = this.mode.blockSize; this._finish = false; this._input = null; this.output = null; this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt; this._decrypt = options.decrypt; this.algorithm.initialize(options); }; /** * Starts or restarts the encryption or decryption process, whichever * was previously configured. * * For non-GCM mode, the IV may be a binary-encoded string of bytes, an array * of bytes, a byte buffer, or an array of 32-bit integers. If the IV is in * bytes, then it must be Nb (16) bytes in length. If the IV is given in as * 32-bit integers, then it must be 4 integers long. * * Note: an IV is not required or used in ECB mode. * * For GCM-mode, the IV must be given as a binary-encoded string of bytes or * a byte buffer. The number of bytes should be 12 (96 bits) as recommended * by NIST SP-800-38D but another length may be given. * * @param options the options to use: * iv the initialization vector to use as a binary-encoded string of * bytes, null to reuse the last ciphered block from a previous * update() (this "residue" method is for legacy support only). * additionalData additional authentication data as a binary-encoded * string of bytes, for 'GCM' mode, (default: none). * tagLength desired length of authentication tag, in bits, for * 'GCM' mode (0-128, default: 128). * tag the authentication tag to check if decrypting, as a * binary-encoded string of bytes. * output the output the buffer to write to, null to create one. */ BlockCipher.prototype.start = function(options) { options = options || {}; var opts = {}; for(var key in options) { opts[key] = options[key]; } opts.decrypt = this._decrypt; this._finish = false; this._input = forge.util.createBuffer(); this.output = options.output || forge.util.createBuffer(); this.mode.start(opts); }; /** * Updates the next block according to the cipher mode. * * @param input the buffer to read from. */ BlockCipher.prototype.update = function(input) { if(input) { // input given, so empty it into the input buffer this._input.putBuffer(input); } // do cipher operation until it needs more input and not finished while(!this._op.call(this.mode, this._input, this.output, this._finish) && !this._finish) {} // free consumed memory from input buffer this._input.compact(); }; /** * Finishes encrypting or decrypting. * * @param pad a padding function to use in CBC mode, null for default, * signature(blockSize, buffer, decrypt). * * @return true if successful, false on error. */ BlockCipher.prototype.finish = function(pad) { // backwards-compatibility w/deprecated padding API // Note: will overwrite padding functions even after another start() call if(pad && (this.mode.name === 'ECB' || this.mode.name === 'CBC')) { this.mode.pad = function(input) { return pad(this.blockSize, input, false); }; this.mode.unpad = function(output) { return pad(this.blockSize, output, true); }; } // build options for padding and afterFinish functions var options = {}; options.decrypt = this._decrypt; // get # of bytes that won't fill a block options.overflow = this._input.length() % this.blockSize; if(!this._decrypt && this.mode.pad) { if(!this.mode.pad(this._input, options)) { return false; } } // do final update this._finish = true; this.update(); if(this._decrypt && this.mode.unpad) { if(!this.mode.unpad(this.output, options)) { return false; } } if(this.mode.afterFinish) { if(!this.mode.afterFinish(this.output, options)) { return false; } } return true; }; /***/ }), /***/ 10873: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Supported cipher modes. * * @author Dave Longley * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(28339); forge.cipher = forge.cipher || {}; // supported cipher modes var modes = module.exports = forge.cipher.modes = forge.cipher.modes || {}; /** Electronic codebook (ECB) (Don't use this; it's not secure) **/ modes.ecb = function(options) { options = options || {}; this.name = 'ECB'; this.cipher = options.cipher; this.blockSize = options.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = new Array(this._ints); this._outBlock = new Array(this._ints); }; modes.ecb.prototype.start = function(options) {}; modes.ecb.prototype.encrypt = function(input, output, finish) { // not enough input to encrypt if(input.length() < this.blockSize && !(finish && input.length() > 0)) { return true; } // get next block for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = input.getInt32(); } // encrypt block this.cipher.encrypt(this._inBlock, this._outBlock); // write output for(var i = 0; i < this._ints; ++i) { output.putInt32(this._outBlock[i]); } }; modes.ecb.prototype.decrypt = function(input, output, finish) { // not enough input to decrypt if(input.length() < this.blockSize && !(finish && input.length() > 0)) { return true; } // get next block for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = input.getInt32(); } // decrypt block this.cipher.decrypt(this._inBlock, this._outBlock); // write output for(var i = 0; i < this._ints; ++i) { output.putInt32(this._outBlock[i]); } }; modes.ecb.prototype.pad = function(input, options) { // add PKCS#7 padding to block (each pad byte is the // value of the number of pad bytes) var padding = (input.length() === this.blockSize ? this.blockSize : (this.blockSize - input.length())); input.fillWithByte(padding, padding); return true; }; modes.ecb.prototype.unpad = function(output, options) { // check for error: input data not a multiple of blockSize if(options.overflow > 0) { return false; } // ensure padding byte count is valid var len = output.length(); var count = output.at(len - 1); if(count > (this.blockSize << 2)) { return false; } // trim off padding bytes output.truncate(count); return true; }; /** Cipher-block Chaining (CBC) **/ modes.cbc = function(options) { options = options || {}; this.name = 'CBC'; this.cipher = options.cipher; this.blockSize = options.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = new Array(this._ints); this._outBlock = new Array(this._ints); }; modes.cbc.prototype.start = function(options) { // Note: legacy support for using IV residue (has security flaws) // if IV is null, reuse block from previous processing if(options.iv === null) { // must have a previous block if(!this._prev) { throw new Error('Invalid IV parameter.'); } this._iv = this._prev.slice(0); } else if(!('iv' in options)) { throw new Error('Invalid IV parameter.'); } else { // save IV as "previous" block this._iv = transformIV(options.iv, this.blockSize); this._prev = this._iv.slice(0); } }; modes.cbc.prototype.encrypt = function(input, output, finish) { // not enough input to encrypt if(input.length() < this.blockSize && !(finish && input.length() > 0)) { return true; } // get next block // CBC XOR's IV (or previous block) with plaintext for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = this._prev[i] ^ input.getInt32(); } // encrypt block this.cipher.encrypt(this._inBlock, this._outBlock); // write output, save previous block for(var i = 0; i < this._ints; ++i) { output.putInt32(this._outBlock[i]); } this._prev = this._outBlock; }; modes.cbc.prototype.decrypt = function(input, output, finish) { // not enough input to decrypt if(input.length() < this.blockSize && !(finish && input.length() > 0)) { return true; } // get next block for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = input.getInt32(); } // decrypt block this.cipher.decrypt(this._inBlock, this._outBlock); // write output, save previous ciphered block // CBC XOR's IV (or previous block) with ciphertext for(var i = 0; i < this._ints; ++i) { output.putInt32(this._prev[i] ^ this._outBlock[i]); } this._prev = this._inBlock.slice(0); }; modes.cbc.prototype.pad = function(input, options) { // add PKCS#7 padding to block (each pad byte is the // value of the number of pad bytes) var padding = (input.length() === this.blockSize ? this.blockSize : (this.blockSize - input.length())); input.fillWithByte(padding, padding); return true; }; modes.cbc.prototype.unpad = function(output, options) { // check for error: input data not a multiple of blockSize if(options.overflow > 0) { return false; } // ensure padding byte count is valid var len = output.length(); var count = output.at(len - 1); if(count > (this.blockSize << 2)) { return false; } // trim off padding bytes output.truncate(count); return true; }; /** Cipher feedback (CFB) **/ modes.cfb = function(options) { options = options || {}; this.name = 'CFB'; this.cipher = options.cipher; this.blockSize = options.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = null; this._outBlock = new Array(this._ints); this._partialBlock = new Array(this._ints); this._partialOutput = forge.util.createBuffer(); this._partialBytes = 0; }; modes.cfb.prototype.start = function(options) { if(!('iv' in options)) { throw new Error('Invalid IV parameter.'); } // use IV as first input this._iv = transformIV(options.iv, this.blockSize); this._inBlock = this._iv.slice(0); this._partialBytes = 0; }; modes.cfb.prototype.encrypt = function(input, output, finish) { // not enough input to encrypt var inputLength = input.length(); if(inputLength === 0) { return true; } // encrypt block this.cipher.encrypt(this._inBlock, this._outBlock); // handle full block if(this._partialBytes === 0 && inputLength >= this.blockSize) { // XOR input with output, write input as output for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = input.getInt32() ^ this._outBlock[i]; output.putInt32(this._inBlock[i]); } return; } // handle partial block var partialBytes = (this.blockSize - inputLength) % this.blockSize; if(partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } // XOR input with output, write input as partial output this._partialOutput.clear(); for(var i = 0; i < this._ints; ++i) { this._partialBlock[i] = input.getInt32() ^ this._outBlock[i]; this._partialOutput.putInt32(this._partialBlock[i]); } if(partialBytes > 0) { // block still incomplete, restore input buffer input.read -= this.blockSize; } else { // block complete, update input block for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = this._partialBlock[i]; } } // skip any previous partial bytes if(this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if(partialBytes > 0 && !finish) { output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes)); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes)); this._partialBytes = 0; }; modes.cfb.prototype.decrypt = function(input, output, finish) { // not enough input to decrypt var inputLength = input.length(); if(inputLength === 0) { return true; } // encrypt block (CFB always uses encryption mode) this.cipher.encrypt(this._inBlock, this._outBlock); // handle full block if(this._partialBytes === 0 && inputLength >= this.blockSize) { // XOR input with output, write input as output for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = input.getInt32(); output.putInt32(this._inBlock[i] ^ this._outBlock[i]); } return; } // handle partial block var partialBytes = (this.blockSize - inputLength) % this.blockSize; if(partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } // XOR input with output, write input as partial output this._partialOutput.clear(); for(var i = 0; i < this._ints; ++i) { this._partialBlock[i] = input.getInt32(); this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]); } if(partialBytes > 0) { // block still incomplete, restore input buffer input.read -= this.blockSize; } else { // block complete, update input block for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = this._partialBlock[i]; } } // skip any previous partial bytes if(this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if(partialBytes > 0 && !finish) { output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes)); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes)); this._partialBytes = 0; }; /** Output feedback (OFB) **/ modes.ofb = function(options) { options = options || {}; this.name = 'OFB'; this.cipher = options.cipher; this.blockSize = options.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = null; this._outBlock = new Array(this._ints); this._partialOutput = forge.util.createBuffer(); this._partialBytes = 0; }; modes.ofb.prototype.start = function(options) { if(!('iv' in options)) { throw new Error('Invalid IV parameter.'); } // use IV as first input this._iv = transformIV(options.iv, this.blockSize); this._inBlock = this._iv.slice(0); this._partialBytes = 0; }; modes.ofb.prototype.encrypt = function(input, output, finish) { // not enough input to encrypt var inputLength = input.length(); if(input.length() === 0) { return true; } // encrypt block (OFB always uses encryption mode) this.cipher.encrypt(this._inBlock, this._outBlock); // handle full block if(this._partialBytes === 0 && inputLength >= this.blockSize) { // XOR input with output and update next input for(var i = 0; i < this._ints; ++i) { output.putInt32(input.getInt32() ^ this._outBlock[i]); this._inBlock[i] = this._outBlock[i]; } return; } // handle partial block var partialBytes = (this.blockSize - inputLength) % this.blockSize; if(partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } // XOR input with output this._partialOutput.clear(); for(var i = 0; i < this._ints; ++i) { this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); } if(partialBytes > 0) { // block still incomplete, restore input buffer input.read -= this.blockSize; } else { // block complete, update input block for(var i = 0; i < this._ints; ++i) { this._inBlock[i] = this._outBlock[i]; } } // skip any previous partial bytes if(this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if(partialBytes > 0 && !finish) { output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes)); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes)); this._partialBytes = 0; }; modes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt; /** Counter (CTR) **/ modes.ctr = function(options) { options = options || {}; this.name = 'CTR'; this.cipher = options.cipher; this.blockSize = options.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = null; this._outBlock = new Array(this._ints); this._partialOutput = forge.util.createBuffer(); this._partialBytes = 0; }; modes.ctr.prototype.start = function(options) { if(!('iv' in options)) { throw new Error('Invalid IV parameter.'); } // use IV as first input this._iv = transformIV(options.iv, this.blockSize); this._inBlock = this._iv.slice(0); this._partialBytes = 0; }; modes.ctr.prototype.encrypt = function(input, output, finish) { // not enough input to encrypt var inputLength = input.length(); if(inputLength === 0) { return true; } // encrypt block (CTR always uses encryption mode) this.cipher.encrypt(this._inBlock, this._outBlock); // handle full block if(this._partialBytes === 0 && inputLength >= this.blockSize) { // XOR input with output for(var i = 0; i < this._ints; ++i) { output.putInt32(input.getInt32() ^ this._outBlock[i]); } } else { // handle partial block var partialBytes = (this.blockSize - inputLength) % this.blockSize; if(partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } // XOR input with output this._partialOutput.clear(); for(var i = 0; i < this._ints; ++i) { this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); } if(partialBytes > 0) { // block still incomplete, restore input buffer input.read -= this.blockSize; } // skip any previous partial bytes if(this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if(partialBytes > 0 && !finish) { output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes)); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes)); this._partialBytes = 0; } // block complete, increment counter (input block) inc32(this._inBlock); }; modes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt; /** Galois/Counter Mode (GCM) **/ modes.gcm = function(options) { options = options || {}; this.name = 'GCM'; this.cipher = options.cipher; this.blockSize = options.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = new Array(this._ints); this._outBlock = new Array(this._ints); this._partialOutput = forge.util.createBuffer(); this._partialBytes = 0; // R is actually this value concatenated with 120 more zero bits, but // we only XOR against R so the other zeros have no effect -- we just // apply this value to the first integer in a block this._R = 0xE1000000; }; modes.gcm.prototype.start = function(options) { if(!('iv' in options)) { throw new Error('Invalid IV parameter.'); } // ensure IV is a byte buffer var iv = forge.util.createBuffer(options.iv); // no ciphered data processed yet this._cipherLength = 0; // default additional data is none var additionalData; if('additionalData' in options) { additionalData = forge.util.createBuffer(options.additionalData); } else { additionalData = forge.util.createBuffer(); } // default tag length is 128 bits if('tagLength' in options) { this._tagLength = options.tagLength; } else { this._tagLength = 128; } // if tag is given, ensure tag matches tag length this._tag = null; if(options.decrypt) { // save tag to check later this._tag = forge.util.createBuffer(options.tag).getBytes(); if(this._tag.length !== (this._tagLength / 8)) { throw new Error('Authentication tag does not match tag length.'); } } // create tmp storage for hash calculation this._hashBlock = new Array(this._ints); // no tag generated yet this.tag = null; // generate hash subkey // (apply block cipher to "zero" block) this._hashSubkey = new Array(this._ints); this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey); // generate table M // use 4-bit tables (32 component decomposition of a 16 byte value) // 8-bit tables take more space and are known to have security // vulnerabilities (in native implementations) this.componentBits = 4; this._m = this.generateHashTable(this._hashSubkey, this.componentBits); // Note: support IV length different from 96 bits? (only supporting // 96 bits is recommended by NIST SP-800-38D) // generate J_0 var ivLength = iv.length(); if(ivLength === 12) { // 96-bit IV this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1]; } else { // IV is NOT 96-bits this._j0 = [0, 0, 0, 0]; while(iv.length() > 0) { this._j0 = this.ghash( this._hashSubkey, this._j0, [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()]); } this._j0 = this.ghash( this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8))); } // generate ICB (initial counter block) this._inBlock = this._j0.slice(0); inc32(this._inBlock); this._partialBytes = 0; // consume authentication data additionalData = forge.util.createBuffer(additionalData); // save additional data length as a BE 64-bit number this._aDataLength = from64To32(additionalData.length() * 8); // pad additional data to 128 bit (16 byte) block size var overflow = additionalData.length() % this.blockSize; if(overflow) { additionalData.fillWithByte(0, this.blockSize - overflow); } this._s = [0, 0, 0, 0]; while(additionalData.length() > 0) { this._s = this.ghash(this._hashSubkey, this._s, [ additionalData.getInt32(), additionalData.getInt32(), additionalData.getInt32(), additionalData.getInt32() ]); } }; modes.gcm.prototype.encrypt = function(input, output, finish) { // not enough input to encrypt var inputLength = input.length(); if(inputLength === 0) { return true; } // encrypt block this.cipher.encrypt(this._inBlock, this._outBlock); // handle full block if(this._partialBytes === 0 && inputLength >= this.blockSize) { // XOR input with output for(var i = 0; i < this._ints; ++i) { output.putInt32(this._outBlock[i] ^= input.getInt32()); } this._cipherLength += this.blockSize; } else { // handle partial block var partialBytes = (this.blockSize - inputLength) % this.blockSize; if(partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } // XOR input with output this._partialOutput.clear(); for(var i = 0; i < this._ints; ++i) { this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); } if(partialBytes <= 0 || finish) { // handle overflow prior to hashing if(finish) { // get block overflow var overflow = inputLength % this.blockSize; this._cipherLength += overflow; // truncate for hash function this._partialOutput.truncate(this.blockSize - overflow); } else { this._cipherLength += this.blockSize; } // get output block for hashing for(var i = 0; i < this._ints; ++i) { this._outBlock[i] = this._partialOutput.getInt32(); } this._partialOutput.read -= this.blockSize; } // skip any previous partial bytes if(this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if(partialBytes > 0 && !finish) { // block still incomplete, restore input buffer, get partial output, // and return early input.read -= this.blockSize; output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes)); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes)); this._partialBytes = 0; } // update hash block S this._s = this.ghash(this._hashSubkey, this._s, this._outBlock); // increment counter (input block) inc32(this._inBlock); }; modes.gcm.prototype.decrypt = function(input, output, finish) { // not enough input to decrypt var inputLength = input.length(); if(inputLength < this.blockSize && !(finish && inputLength > 0)) { return true; } // encrypt block (GCM always uses encryption mode) this.cipher.encrypt(this._inBlock, this._outBlock); // increment counter (input block) inc32(this._inBlock); // update hash block S this._hashBlock[0] = input.getInt32(); this._hashBlock[1] = input.getInt32(); this._hashBlock[2] = input.getInt32(); this._hashBlock[3] = input.getInt32(); this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock); // XOR hash input with output for(var i = 0; i < this._ints; ++i) { output.putInt32(this._outBlock[i] ^ this._hashBlock[i]); } // increment cipher data length if(inputLength < this.blockSize) { this._cipherLength += inputLength % this.blockSize; } else { this._cipherLength += this.blockSize; } }; modes.gcm.prototype.afterFinish = function(output, options) { var rval = true; // handle overflow if(options.decrypt && options.overflow) { output.truncate(this.blockSize - options.overflow); } // handle authentication tag this.tag = forge.util.createBuffer(); // concatenate additional data length with cipher length var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8)); // include lengths in hash this._s = this.ghash(this._hashSubkey, this._s, lengths); // do GCTR(J_0, S) var tag = []; this.cipher.encrypt(this._j0, tag); for(var i = 0; i < this._ints; ++i) { this.tag.putInt32(this._s[i] ^ tag[i]); } // trim tag to length this.tag.truncate(this.tag.length() % (this._tagLength / 8)); // check authentication tag if(options.decrypt && this.tag.bytes() !== this._tag) { rval = false; } return rval; }; /** * See NIST SP-800-38D 6.3 (Algorithm 1). This function performs Galois * field multiplication. The field, GF(2^128), is defined by the polynomial: * * x^128 + x^7 + x^2 + x + 1 * * Which is represented in little-endian binary form as: 11100001 (0xe1). When * the value of a coefficient is 1, a bit is set. The value R, is the * concatenation of this value and 120 zero bits, yielding a 128-bit value * which matches the block size. * * This function will multiply two elements (vectors of bytes), X and Y, in * the field GF(2^128). The result is initialized to zero. For each bit of * X (out of 128), x_i, if x_i is set, then the result is multiplied (XOR'd) * by the current value of Y. For each bit, the value of Y will be raised by * a power of x (multiplied by the polynomial x). This can be achieved by * shifting Y once to the right. If the current value of Y, prior to being * multiplied by x, has 0 as its LSB, then it is a 127th degree polynomial. * Otherwise, we must divide by R after shifting to find the remainder. * * @param x the first block to multiply by the second. * @param y the second block to multiply by the first. * * @return the block result of the multiplication. */ modes.gcm.prototype.multiply = function(x, y) { var z_i = [0, 0, 0, 0]; var v_i = y.slice(0); // calculate Z_128 (block has 128 bits) for(var i = 0; i < 128; ++i) { // if x_i is 0, Z_{i+1} = Z_i (unchanged) // else Z_{i+1} = Z_i ^ V_i // get x_i by finding 32-bit int position, then left shift 1 by remainder var x_i = x[(i / 32) | 0] & (1 << (31 - i % 32)); if(x_i) { z_i[0] ^= v_i[0]; z_i[1] ^= v_i[1]; z_i[2] ^= v_i[2]; z_i[3] ^= v_i[3]; } // if LSB(V_i) is 1, V_i = V_i >> 1 // else V_i = (V_i >> 1) ^ R this.pow(v_i, v_i); } return z_i; }; modes.gcm.prototype.pow = function(x, out) { // if LSB(x) is 1, x = x >>> 1 // else x = (x >>> 1) ^ R var lsb = x[3] & 1; // always do x >>> 1: // starting with the rightmost integer, shift each integer to the right // one bit, pulling in the bit from the integer to the left as its top // most bit (do this for the last 3 integers) for(var i = 3; i > 0; --i) { out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31); } // shift the first integer normally out[0] = x[0] >>> 1; // if lsb was not set, then polynomial had a degree of 127 and doesn't // need to divided; otherwise, XOR with R to find the remainder; we only // need to XOR the first integer since R technically ends w/120 zero bits if(lsb) { out[0] ^= this._R; } }; modes.gcm.prototype.tableMultiply = function(x) { // assumes 4-bit tables are used var z = [0, 0, 0, 0]; for(var i = 0; i < 32; ++i) { var idx = (i / 8) | 0; var x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF; var ah = this._m[i][x_i]; z[0] ^= ah[0]; z[1] ^= ah[1]; z[2] ^= ah[2]; z[3] ^= ah[3]; } return z; }; /** * A continuing version of the GHASH algorithm that operates on a single * block. The hash block, last hash value (Ym) and the new block to hash * are given. * * @param h the hash block. * @param y the previous value for Ym, use [0, 0, 0, 0] for a new hash. * @param x the block to hash. * * @return the hashed value (Ym). */ modes.gcm.prototype.ghash = function(h, y, x) { y[0] ^= x[0]; y[1] ^= x[1]; y[2] ^= x[2]; y[3] ^= x[3]; return this.tableMultiply(y); //return this.multiply(y, h); }; /** * Precomputes a table for multiplying against the hash subkey. This * mechanism provides a substantial speed increase over multiplication * performed without a table. The table-based multiplication this table is * for solves X * H by multiplying each component of X by H and then * composing the results together using XOR. * * This function can be used to generate tables with different bit sizes * for the components, however, this implementation assumes there are * 32 components of X (which is a 16 byte vector), therefore each component * takes 4-bits (so the table is constructed with bits=4). * * @param h the hash subkey. * @param bits the bit size for a component. */ modes.gcm.prototype.generateHashTable = function(h, bits) { // TODO: There are further optimizations that would use only the // first table M_0 (or some variant) along with a remainder table; // this can be explored in the future var multiplier = 8 / bits; var perInt = 4 * multiplier; var size = 16 * multiplier; var m = new Array(size); for(var i = 0; i < size; ++i) { var tmp = [0, 0, 0, 0]; var idx = (i / perInt) | 0; var shft = ((perInt - 1 - (i % perInt)) * bits); tmp[idx] = (1 << (bits - 1)) << shft; m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits); } return m; }; /** * Generates a table for multiplying against the hash subkey for one * particular component (out of all possible component values). * * @param mid the pre-multiplied value for the middle key of the table. * @param bits the bit size for a component. */ modes.gcm.prototype.generateSubHashTable = function(mid, bits) { // compute the table quickly by minimizing the number of // POW operations -- they only need to be performed for powers of 2, // all other entries can be composed from those powers using XOR var size = 1 << bits; var half = size >>> 1; var m = new Array(size); m[half] = mid.slice(0); var i = half >>> 1; while(i > 0) { // raise m0[2 * i] and store in m0[i] this.pow(m[2 * i], m[i] = []); i >>= 1; } i = 2; while(i < half) { for(var j = 1; j < i; ++j) { var m_i = m[i]; var m_j = m[j]; m[i + j] = [ m_i[0] ^ m_j[0], m_i[1] ^ m_j[1], m_i[2] ^ m_j[2], m_i[3] ^ m_j[3] ]; } i *= 2; } m[0] = [0, 0, 0, 0]; /* Note: We could avoid storing these by doing composition during multiply calculate top half using composition by speed is preferred. */ for(i = half + 1; i < size; ++i) { var c = m[i ^ half]; m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]]; } return m; }; /** Utility functions */ function transformIV(iv, blockSize) { if(typeof iv === 'string') { // convert iv string into byte buffer iv = forge.util.createBuffer(iv); } if(forge.util.isArray(iv) && iv.length > 4) { // convert iv byte array into byte buffer var tmp = iv; iv = forge.util.createBuffer(); for(var i = 0; i < tmp.length; ++i) { iv.putByte(tmp[i]); } } if(iv.length() < blockSize) { throw new Error( 'Invalid IV length; got ' + iv.length() + ' bytes and expected ' + blockSize + ' bytes.'); } if(!forge.util.isArray(iv)) { // convert iv byte buffer into 32-bit integer array var ints = []; var blocks = blockSize / 4; for(var i = 0; i < blocks; ++i) { ints.push(iv.getInt32()); } iv = ints; } return iv; } function inc32(block) { // increment last 32 bits of block only block[block.length - 1] = (block[block.length - 1] + 1) & 0xFFFFFFFF; } function from64To32(num) { // convert 64-bit number to two BE Int32s return [(num / 0x100000000) | 0, num & 0xFFFFFFFF]; } /***/ }), /***/ 52923: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Debugging support for web applications. * * @author David I. Lehn * * Copyright 2008-2013 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); /* DEBUG API */ module.exports = forge.debug = forge.debug || {}; // Private storage for debugging. // Useful to expose data that is otherwise unviewable behind closures. // NOTE: remember that this can hold references to data and cause leaks! // format is "forge._debug.. = data" // Example: // (function() { // var cat = 'forge.test.Test'; // debugging category // var sState = {...}; // local state // forge.debug.set(cat, 'sState', sState); // })(); forge.debug.storage = {}; /** * Gets debug data. Omit name for all cat data Omit name and cat for * all data. * * @param cat name of debugging category. * @param name name of data to get (optional). * @return object with requested debug data or undefined. */ forge.debug.get = function(cat, name) { var rval; if(typeof(cat) === 'undefined') { rval = forge.debug.storage; } else if(cat in forge.debug.storage) { if(typeof(name) === 'undefined') { rval = forge.debug.storage[cat]; } else { rval = forge.debug.storage[cat][name]; } } return rval; }; /** * Sets debug data. * * @param cat name of debugging category. * @param name name of data to set. * @param data data to set. */ forge.debug.set = function(cat, name, data) { if(!(cat in forge.debug.storage)) { forge.debug.storage[cat] = {}; } forge.debug.storage[cat][name] = data; }; /** * Clears debug data. Omit name for all cat data. Omit name and cat for * all data. * * @param cat name of debugging category. * @param name name of data to clear or omit to clear entire category. */ forge.debug.clear = function(cat, name) { if(typeof(cat) === 'undefined') { forge.debug.storage = {}; } else if(cat in forge.debug.storage) { if(typeof(name) === 'undefined') { delete forge.debug.storage[cat]; } else { delete forge.debug.storage[cat][name]; } } }; /***/ }), /***/ 97157: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * DES (Data Encryption Standard) implementation. * * This implementation supports DES as well as 3DES-EDE in ECB and CBC mode. * It is based on the BSD-licensed implementation by Paul Tero: * * Paul Tero, July 2001 * http://www.tero.co.uk/des/ * * Optimised for performance with large blocks by * Michael Hayworth, November 2001 * http://www.netdealing.com * * THIS SOFTWARE IS PROVIDED "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @author Stefan Siegl * @author Dave Longley * * Copyright (c) 2012 Stefan Siegl * Copyright (c) 2012-2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(7088); __webpack_require__(10873); __webpack_require__(28339); /* DES API */ module.exports = forge.des = forge.des || {}; /** * Deprecated. Instead, use: * * var cipher = forge.cipher.createCipher('DES-', key); * cipher.start({iv: iv}); * * Creates an DES cipher object to encrypt data using the given symmetric key. * The output will be stored in the 'output' member of the returned cipher. * * The key and iv may be given as binary-encoded strings of bytes or * byte buffers. * * @param key the symmetric key to use (64 or 192 bits). * @param iv the initialization vector to use. * @param output the buffer to write to, null to create one. * @param mode the cipher mode to use (default: 'CBC' if IV is * given, 'ECB' if null). * * @return the cipher. */ forge.des.startEncrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key: key, output: output, decrypt: false, mode: mode || (iv === null ? 'ECB' : 'CBC') }); cipher.start(iv); return cipher; }; /** * Deprecated. Instead, use: * * var cipher = forge.cipher.createCipher('DES-', key); * * Creates an DES cipher object to encrypt data using the given symmetric key. * * The key may be given as a binary-encoded string of bytes or a byte buffer. * * @param key the symmetric key to use (64 or 192 bits). * @param mode the cipher mode to use (default: 'CBC'). * * @return the cipher. */ forge.des.createEncryptionCipher = function(key, mode) { return _createCipher({ key: key, output: null, decrypt: false, mode: mode }); }; /** * Deprecated. Instead, use: * * var decipher = forge.cipher.createDecipher('DES-', key); * decipher.start({iv: iv}); * * Creates an DES cipher object to decrypt data using the given symmetric key. * The output will be stored in the 'output' member of the returned cipher. * * The key and iv may be given as binary-encoded strings of bytes or * byte buffers. * * @param key the symmetric key to use (64 or 192 bits). * @param iv the initialization vector to use. * @param output the buffer to write to, null to create one. * @param mode the cipher mode to use (default: 'CBC' if IV is * given, 'ECB' if null). * * @return the cipher. */ forge.des.startDecrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key: key, output: output, decrypt: true, mode: mode || (iv === null ? 'ECB' : 'CBC') }); cipher.start(iv); return cipher; }; /** * Deprecated. Instead, use: * * var decipher = forge.cipher.createDecipher('DES-', key); * * Creates an DES cipher object to decrypt data using the given symmetric key. * * The key may be given as a binary-encoded string of bytes or a byte buffer. * * @param key the symmetric key to use (64 or 192 bits). * @param mode the cipher mode to use (default: 'CBC'). * * @return the cipher. */ forge.des.createDecryptionCipher = function(key, mode) { return _createCipher({ key: key, output: null, decrypt: true, mode: mode }); }; /** * Creates a new DES cipher algorithm object. * * @param name the name of the algorithm. * @param mode the mode factory function. * * @return the DES algorithm object. */ forge.des.Algorithm = function(name, mode) { var self = this; self.name = name; self.mode = new mode({ blockSize: 8, cipher: { encrypt: function(inBlock, outBlock) { return _updateBlock(self._keys, inBlock, outBlock, false); }, decrypt: function(inBlock, outBlock) { return _updateBlock(self._keys, inBlock, outBlock, true); } } }); self._init = false; }; /** * Initializes this DES algorithm by expanding its key. * * @param options the options to use. * key the key to use with this algorithm. * decrypt true if the algorithm should be initialized for decryption, * false for encryption. */ forge.des.Algorithm.prototype.initialize = function(options) { if(this._init) { return; } var key = forge.util.createBuffer(options.key); if(this.name.indexOf('3DES') === 0) { if(key.length() !== 24) { throw new Error('Invalid Triple-DES key size: ' + key.length() * 8); } } // do key expansion to 16 or 48 subkeys (single or triple DES) this._keys = _createKeys(key); this._init = true; }; /** Register DES algorithms **/ registerAlgorithm('DES-ECB', forge.cipher.modes.ecb); registerAlgorithm('DES-CBC', forge.cipher.modes.cbc); registerAlgorithm('DES-CFB', forge.cipher.modes.cfb); registerAlgorithm('DES-OFB', forge.cipher.modes.ofb); registerAlgorithm('DES-CTR', forge.cipher.modes.ctr); registerAlgorithm('3DES-ECB', forge.cipher.modes.ecb); registerAlgorithm('3DES-CBC', forge.cipher.modes.cbc); registerAlgorithm('3DES-CFB', forge.cipher.modes.cfb); registerAlgorithm('3DES-OFB', forge.cipher.modes.ofb); registerAlgorithm('3DES-CTR', forge.cipher.modes.ctr); function registerAlgorithm(name, mode) { var factory = function() { return new forge.des.Algorithm(name, mode); }; forge.cipher.registerAlgorithm(name, factory); } /** DES implementation **/ var spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004]; var spfunction2 = [-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000]; var spfunction3 = [0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200]; var spfunction4 = [0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080]; var spfunction5 = [0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100]; var spfunction6 = [0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010]; var spfunction7 = [0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002]; var spfunction8 = [0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000]; /** * Create necessary sub keys. * * @param key the 64-bit or 192-bit key. * * @return the expanded keys. */ function _createKeys(key) { var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204], pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101], pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808], pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000], pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010], pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420], pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002], pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800], pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002], pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408], pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020], pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200], pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010], pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105]; // how many iterations (1 for des, 3 for triple des) // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys var iterations = key.length() > 8 ? 3 : 1; // stores the return keys var keys = []; // now define the left shifts which need to be done var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0]; var n = 0, tmp; for(var j = 0; j < iterations; j++) { var left = key.getInt32(); var right = key.getInt32(); tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= tmp; left ^= (tmp << 4); tmp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= tmp; right ^= (tmp << -16); tmp = ((left >>> 2) ^ right) & 0x33333333; right ^= tmp; left ^= (tmp << 2); tmp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= tmp; right ^= (tmp << -16); tmp = ((left >>> 1) ^ right) & 0x55555555; right ^= tmp; left ^= (tmp << 1); tmp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= tmp; right ^= (tmp << 8); tmp = ((left >>> 1) ^ right) & 0x55555555; right ^= tmp; left ^= (tmp << 1); // right needs to be shifted and OR'd with last four bits of left tmp = (left << 8) | ((right >>> 20) & 0x000000f0); // left needs to be put upside down left = ((right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0)); right = tmp; // now go through and perform these shifts on the left and right keys for(var i = 0; i < shifts.length; ++i) { //shift the keys either one or two bits to the left if(shifts[i]) { left = (left << 2) | (left >>> 26); right = (right << 2) | (right >>> 26); } else { left = (left << 1) | (left >>> 27); right = (right << 1) | (right >>> 27); } left &= -0xf; right &= -0xf; // now apply PC-2, in such a way that E is easier when encrypting or // decrypting this conversion will look like PC-2 except only the last 6 // bits of each byte are used rather than 48 consecutive bits and the // order of lines will be according to how the S selection functions will // be applied: S2, S4, S6, S8, S1, S3, S5, S7 var lefttmp = ( pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] | pc2bytes6[(left >>> 4) & 0xf]); var righttmp = ( pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] | pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] | pc2bytes13[(right >>> 4) & 0xf]); tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff; keys[n++] = lefttmp ^ tmp; keys[n++] = righttmp ^ (tmp << 16); } } return keys; } /** * Updates a single block (1 byte) using DES. The update will either * encrypt or decrypt the block. * * @param keys the expanded keys. * @param input the input block (an array of 32-bit words). * @param output the updated output block. * @param decrypt true to decrypt the block, false to encrypt it. */ function _updateBlock(keys, input, output, decrypt) { // set up loops for single or triple DES var iterations = keys.length === 32 ? 3 : 9; var looping; if(iterations === 3) { looping = decrypt ? [30, -2, -2] : [0, 32, 2]; } else { looping = (decrypt ? [94, 62, -2, 32, 64, 2, 30, -2, -2] : [0, 32, 2, 62, 30, -2, 64, 96, 2]); } var tmp; var left = input[0]; var right = input[1]; // first each 64 bit chunk of the message must be permuted according to IP tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= tmp; left ^= (tmp << 4); tmp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= tmp; left ^= (tmp << 16); tmp = ((right >>> 2) ^ left) & 0x33333333; left ^= tmp; right ^= (tmp << 2); tmp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= tmp; right ^= (tmp << 8); tmp = ((left >>> 1) ^ right) & 0x55555555; right ^= tmp; left ^= (tmp << 1); // rotate left 1 bit left = ((left << 1) | (left >>> 31)); right = ((right << 1) | (right >>> 31)); for(var j = 0; j < iterations; j += 3) { var endloop = looping[j + 1]; var loopinc = looping[j + 2]; // now go through and perform the encryption or decryption for(var i = looping[j]; i != endloop; i += loopinc) { var right1 = right ^ keys[i]; var right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1]; // passing these bytes through the S selection functions tmp = left; left = right; right = tmp ^ ( spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f] | spfunction6[(right1 >>> 8) & 0x3f] | spfunction8[right1 & 0x3f] | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) & 0x3f] | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]); } // unreverse left and right tmp = left; left = right; right = tmp; } // rotate right 1 bit left = ((left >>> 1) | (left << 31)); right = ((right >>> 1) | (right << 31)); // now perform IP-1, which is IP in the opposite direction tmp = ((left >>> 1) ^ right) & 0x55555555; right ^= tmp; left ^= (tmp << 1); tmp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= tmp; right ^= (tmp << 8); tmp = ((right >>> 2) ^ left) & 0x33333333; left ^= tmp; right ^= (tmp << 2); tmp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= tmp; left ^= (tmp << 16); tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= tmp; left ^= (tmp << 4); output[0] = left; output[1] = right; } /** * Deprecated. Instead, use: * * forge.cipher.createCipher('DES-', key); * forge.cipher.createDecipher('DES-', key); * * Creates a deprecated DES cipher object. This object's mode will default to * CBC (cipher-block-chaining). * * The key may be given as a binary-encoded string of bytes or a byte buffer. * * @param options the options to use. * key the symmetric key to use (64 or 192 bits). * output the buffer to write to. * decrypt true for decryption, false for encryption. * mode the cipher mode to use (default: 'CBC'). * * @return the cipher. */ function _createCipher(options) { options = options || {}; var mode = (options.mode || 'CBC').toUpperCase(); var algorithm = 'DES-' + mode; var cipher; if(options.decrypt) { cipher = forge.cipher.createDecipher(algorithm, options.key); } else { cipher = forge.cipher.createCipher(algorithm, options.key); } // backwards compatible start API var start = cipher.start; cipher.start = function(iv, options) { // backwards compatibility: support second arg as output buffer var output = null; if(options instanceof forge.util.ByteBuffer) { output = options; options = {}; } options = options || {}; options.output = output; options.iv = iv; start.call(cipher, options); }; return cipher; } /***/ }), /***/ 90000: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * JavaScript implementation of Ed25519. * * Copyright (c) 2017-2019 Digital Bazaar, Inc. * * This implementation is based on the most excellent TweetNaCl which is * in the public domain. Many thanks to its contributors: * * https://github.com/dchest/tweetnacl-js */ var forge = __webpack_require__(89177); __webpack_require__(98007); __webpack_require__(57821); __webpack_require__(59542); __webpack_require__(28339); var asn1Validator = __webpack_require__(29414); var publicKeyValidator = asn1Validator.publicKeyValidator; var privateKeyValidator = asn1Validator.privateKeyValidator; if(typeof BigInteger === 'undefined') { var BigInteger = forge.jsbn.BigInteger; } var ByteBuffer = forge.util.ByteBuffer; var NativeBuffer = typeof Buffer === 'undefined' ? Uint8Array : Buffer; /* * Ed25519 algorithms, see RFC 8032: * https://tools.ietf.org/html/rfc8032 */ forge.pki = forge.pki || {}; module.exports = forge.pki.ed25519 = forge.ed25519 = forge.ed25519 || {}; var ed25519 = forge.ed25519; ed25519.constants = {}; ed25519.constants.PUBLIC_KEY_BYTE_LENGTH = 32; ed25519.constants.PRIVATE_KEY_BYTE_LENGTH = 64; ed25519.constants.SEED_BYTE_LENGTH = 32; ed25519.constants.SIGN_BYTE_LENGTH = 64; ed25519.constants.HASH_BYTE_LENGTH = 64; ed25519.generateKeyPair = function(options) { options = options || {}; var seed = options.seed; if(seed === undefined) { // generate seed seed = forge.random.getBytesSync(ed25519.constants.SEED_BYTE_LENGTH); } else if(typeof seed === 'string') { if(seed.length !== ed25519.constants.SEED_BYTE_LENGTH) { throw new TypeError( '"seed" must be ' + ed25519.constants.SEED_BYTE_LENGTH + ' bytes in length.'); } } else if(!(seed instanceof Uint8Array)) { throw new TypeError( '"seed" must be a node.js Buffer, Uint8Array, or a binary string.'); } seed = messageToNativeBuffer({message: seed, encoding: 'binary'}); var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); var sk = new NativeBuffer(ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); for(var i = 0; i < 32; ++i) { sk[i] = seed[i]; } crypto_sign_keypair(pk, sk); return {publicKey: pk, privateKey: sk}; }; /** * Converts a private key from a RFC8410 ASN.1 encoding. * * @param obj - The asn1 representation of a private key. * * @returns {Object} keyInfo - The key information. * @returns {Buffer|Uint8Array} keyInfo.privateKeyBytes - 32 private key bytes. */ ed25519.privateKeyFromAsn1 = function(obj) { var capture = {}; var errors = []; var valid = forge.asn1.validate(obj, privateKeyValidator, capture, errors); if(!valid) { var error = new Error('Invalid Key.'); error.errors = errors; throw error; } var oid = forge.asn1.derToOid(capture.privateKeyOid); var ed25519Oid = forge.oids.EdDSA25519; if(oid !== ed25519Oid) { throw new Error('Invalid OID "' + oid + '"; OID must be "' + ed25519Oid + '".'); } var privateKey = capture.privateKey; // manually extract the private key bytes from nested octet string, see FIXME: // https://github.com/digitalbazaar/forge/blob/master/lib/asn1.js#L542 var privateKeyBytes = messageToNativeBuffer({ message: forge.asn1.fromDer(privateKey).value, encoding: 'binary' }); // TODO: RFC8410 specifies a format for encoding the public key bytes along // with the private key bytes. `publicKeyBytes` can be returned in the // future. https://tools.ietf.org/html/rfc8410#section-10.3 return {privateKeyBytes: privateKeyBytes}; }; /** * Converts a public key from a RFC8410 ASN.1 encoding. * * @param obj - The asn1 representation of a public key. * * @return {Buffer|Uint8Array} - 32 public key bytes. */ ed25519.publicKeyFromAsn1 = function(obj) { // get SubjectPublicKeyInfo var capture = {}; var errors = []; var valid = forge.asn1.validate(obj, publicKeyValidator, capture, errors); if(!valid) { var error = new Error('Invalid Key.'); error.errors = errors; throw error; } var oid = forge.asn1.derToOid(capture.publicKeyOid); var ed25519Oid = forge.oids.EdDSA25519; if(oid !== ed25519Oid) { throw new Error('Invalid OID "' + oid + '"; OID must be "' + ed25519Oid + '".'); } var publicKeyBytes = capture.ed25519PublicKey; if(publicKeyBytes.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { throw new Error('Key length is invalid.'); } return messageToNativeBuffer({ message: publicKeyBytes, encoding: 'binary' }); }; ed25519.publicKeyFromPrivateKey = function(options) { options = options || {}; var privateKey = messageToNativeBuffer({ message: options.privateKey, encoding: 'binary' }); if(privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { throw new TypeError( '"options.privateKey" must have a byte length of ' + ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); } var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); for(var i = 0; i < pk.length; ++i) { pk[i] = privateKey[32 + i]; } return pk; }; ed25519.sign = function(options) { options = options || {}; var msg = messageToNativeBuffer(options); var privateKey = messageToNativeBuffer({ message: options.privateKey, encoding: 'binary' }); if(privateKey.length === ed25519.constants.SEED_BYTE_LENGTH) { var keyPair = ed25519.generateKeyPair({seed: privateKey}); privateKey = keyPair.privateKey; } else if(privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { throw new TypeError( '"options.privateKey" must have a byte length of ' + ed25519.constants.SEED_BYTE_LENGTH + ' or ' + ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); } var signedMsg = new NativeBuffer( ed25519.constants.SIGN_BYTE_LENGTH + msg.length); crypto_sign(signedMsg, msg, msg.length, privateKey); var sig = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH); for(var i = 0; i < sig.length; ++i) { sig[i] = signedMsg[i]; } return sig; }; ed25519.verify = function(options) { options = options || {}; var msg = messageToNativeBuffer(options); if(options.signature === undefined) { throw new TypeError( '"options.signature" must be a node.js Buffer, a Uint8Array, a forge ' + 'ByteBuffer, or a binary string.'); } var sig = messageToNativeBuffer({ message: options.signature, encoding: 'binary' }); if(sig.length !== ed25519.constants.SIGN_BYTE_LENGTH) { throw new TypeError( '"options.signature" must have a byte length of ' + ed25519.constants.SIGN_BYTE_LENGTH); } var publicKey = messageToNativeBuffer({ message: options.publicKey, encoding: 'binary' }); if(publicKey.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { throw new TypeError( '"options.publicKey" must have a byte length of ' + ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); } var sm = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); var m = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); var i; for(i = 0; i < ed25519.constants.SIGN_BYTE_LENGTH; ++i) { sm[i] = sig[i]; } for(i = 0; i < msg.length; ++i) { sm[i + ed25519.constants.SIGN_BYTE_LENGTH] = msg[i]; } return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); }; function messageToNativeBuffer(options) { var message = options.message; if(message instanceof Uint8Array || message instanceof NativeBuffer) { return message; } var encoding = options.encoding; if(message === undefined) { if(options.md) { // TODO: more rigorous validation that `md` is a MessageDigest message = options.md.digest().getBytes(); encoding = 'binary'; } else { throw new TypeError('"options.message" or "options.md" not specified.'); } } if(typeof message === 'string' && !encoding) { throw new TypeError('"options.encoding" must be "binary" or "utf8".'); } if(typeof message === 'string') { if(typeof Buffer !== 'undefined') { return Buffer.from(message, encoding); } message = new ByteBuffer(message, encoding); } else if(!(message instanceof ByteBuffer)) { throw new TypeError( '"options.message" must be a node.js Buffer, a Uint8Array, a forge ' + 'ByteBuffer, or a string with "options.encoding" specifying its ' + 'encoding.'); } // convert to native buffer var buffer = new NativeBuffer(message.length()); for(var i = 0; i < buffer.length; ++i) { buffer[i] = message.at(i); } return buffer; } var gf0 = gf(); var gf1 = gf([1]); var D = gf([ 0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]); var D2 = gf([ 0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]); var X = gf([ 0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]); var Y = gf([ 0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]); var L = new Float64Array([ 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); var I = gf([ 0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); // TODO: update forge buffer implementation to use `Buffer` or `Uint8Array`, // whichever is available, to improve performance function sha512(msg, msgLen) { // Note: `out` and `msg` are NativeBuffer var md = forge.md.sha512.create(); var buffer = new ByteBuffer(msg); md.update(buffer.getBytes(msgLen), 'binary'); var hash = md.digest().getBytes(); if(typeof Buffer !== 'undefined') { return Buffer.from(hash, 'binary'); } var out = new NativeBuffer(ed25519.constants.HASH_BYTE_LENGTH); for(var i = 0; i < 64; ++i) { out[i] = hash.charCodeAt(i); } return out; } function crypto_sign_keypair(pk, sk) { var p = [gf(), gf(), gf(), gf()]; var i; var d = sha512(sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; scalarbase(p, d); pack(pk, p); for(i = 0; i < 32; ++i) { sk[i + 32] = pk[i]; } return 0; } // Note: difference from C - smlen returned, not passed as argument. function crypto_sign(sm, m, n, sk) { var i, j, x = new Float64Array(64); var p = [gf(), gf(), gf(), gf()]; var d = sha512(sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; var smlen = n + 64; for(i = 0; i < n; ++i) { sm[64 + i] = m[i]; } for(i = 0; i < 32; ++i) { sm[32 + i] = d[32 + i]; } var r = sha512(sm.subarray(32), n + 32); reduce(r); scalarbase(p, r); pack(sm, p); for(i = 32; i < 64; ++i) { sm[i] = sk[i]; } var h = sha512(sm, n + 64); reduce(h); for(i = 32; i < 64; ++i) { x[i] = 0; } for(i = 0; i < 32; ++i) { x[i] = r[i]; } for(i = 0; i < 32; ++i) { for(j = 0; j < 32; j++) { x[i + j] += h[i] * d[j]; } } modL(sm.subarray(32), x); return smlen; } function crypto_sign_open(m, sm, n, pk) { var i, mlen; var t = new NativeBuffer(32); var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; mlen = -1; if(n < 64) { return -1; } if(unpackneg(q, pk)) { return -1; } for(i = 0; i < n; ++i) { m[i] = sm[i]; } for(i = 0; i < 32; ++i) { m[i + 32] = pk[i]; } var h = sha512(m, n); reduce(h); scalarmult(p, q, h); scalarbase(q, sm.subarray(32)); add(p, q); pack(t, p); n -= 64; if(crypto_verify_32(sm, 0, t, 0)) { for(i = 0; i < n; ++i) { m[i] = 0; } return -1; } for(i = 0; i < n; ++i) { m[i] = sm[i + 64]; } mlen = n; return mlen; } function modL(r, x) { var carry, i, j, k; for(i = 63; i >= 32; --i) { carry = 0; for(j = i - 32, k = i - 12; j < k; ++j) { x[j] += carry - 16 * x[i] * L[j - (i - 32)]; carry = (x[j] + 128) >> 8; x[j] -= carry * 256; } x[j] += carry; x[i] = 0; } carry = 0; for(j = 0; j < 32; ++j) { x[j] += carry - (x[31] >> 4) * L[j]; carry = x[j] >> 8; x[j] &= 255; } for(j = 0; j < 32; ++j) { x[j] -= carry * L[j]; } for(i = 0; i < 32; ++i) { x[i + 1] += x[i] >> 8; r[i] = x[i] & 255; } } function reduce(r) { var x = new Float64Array(64); for(var i = 0; i < 64; ++i) { x[i] = r[i]; r[i] = 0; } modL(r, x); } function add(p, q) { var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); Z(a, p[1], p[0]); Z(t, q[1], q[0]); M(a, a, t); A(b, p[0], p[1]); A(t, q[0], q[1]); M(b, b, t); M(c, p[3], q[3]); M(c, c, D2); M(d, p[2], q[2]); A(d, d, d); Z(e, b, a); Z(f, d, c); A(g, d, c); A(h, b, a); M(p[0], e, f); M(p[1], h, g); M(p[2], g, f); M(p[3], e, h); } function cswap(p, q, b) { for(var i = 0; i < 4; ++i) { sel25519(p[i], q[i], b); } } function pack(r, p) { var tx = gf(), ty = gf(), zi = gf(); inv25519(zi, p[2]); M(tx, p[0], zi); M(ty, p[1], zi); pack25519(r, ty); r[31] ^= par25519(tx) << 7; } function pack25519(o, n) { var i, j, b; var m = gf(), t = gf(); for(i = 0; i < 16; ++i) { t[i] = n[i]; } car25519(t); car25519(t); car25519(t); for(j = 0; j < 2; ++j) { m[0] = t[0] - 0xffed; for(i = 1; i < 15; ++i) { m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1); m[i-1] &= 0xffff; } m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1); b = (m[15] >> 16) & 1; m[14] &= 0xffff; sel25519(t, m, 1 - b); } for (i = 0; i < 16; i++) { o[2 * i] = t[i] & 0xff; o[2 * i + 1] = t[i] >> 8; } } function unpackneg(r, p) { var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); set25519(r[2], gf1); unpack25519(r[1], p); S(num, r[1]); M(den, num, D); Z(num, num, r[2]); A(den, r[2], den); S(den2, den); S(den4, den2); M(den6, den4, den2); M(t, den6, num); M(t, t, den); pow2523(t, t); M(t, t, num); M(t, t, den); M(t, t, den); M(r[0], t, den); S(chk, r[0]); M(chk, chk, den); if(neq25519(chk, num)) { M(r[0], r[0], I); } S(chk, r[0]); M(chk, chk, den); if(neq25519(chk, num)) { return -1; } if(par25519(r[0]) === (p[31] >> 7)) { Z(r[0], gf0, r[0]); } M(r[3], r[0], r[1]); return 0; } function unpack25519(o, n) { var i; for(i = 0; i < 16; ++i) { o[i] = n[2 * i] + (n[2 * i + 1] << 8); } o[15] &= 0x7fff; } function pow2523(o, i) { var c = gf(); var a; for(a = 0; a < 16; ++a) { c[a] = i[a]; } for(a = 250; a >= 0; --a) { S(c, c); if(a !== 1) { M(c, c, i); } } for(a = 0; a < 16; ++a) { o[a] = c[a]; } } function neq25519(a, b) { var c = new NativeBuffer(32); var d = new NativeBuffer(32); pack25519(c, a); pack25519(d, b); return crypto_verify_32(c, 0, d, 0); } function crypto_verify_32(x, xi, y, yi) { return vn(x, xi, y, yi, 32); } function vn(x, xi, y, yi, n) { var i, d = 0; for(i = 0; i < n; ++i) { d |= x[xi + i] ^ y[yi + i]; } return (1 & ((d - 1) >>> 8)) - 1; } function par25519(a) { var d = new NativeBuffer(32); pack25519(d, a); return d[0] & 1; } function scalarmult(p, q, s) { var b, i; set25519(p[0], gf0); set25519(p[1], gf1); set25519(p[2], gf1); set25519(p[3], gf0); for(i = 255; i >= 0; --i) { b = (s[(i / 8)|0] >> (i & 7)) & 1; cswap(p, q, b); add(q, p); add(p, p); cswap(p, q, b); } } function scalarbase(p, s) { var q = [gf(), gf(), gf(), gf()]; set25519(q[0], X); set25519(q[1], Y); set25519(q[2], gf1); M(q[3], X, Y); scalarmult(p, q, s); } function set25519(r, a) { var i; for(i = 0; i < 16; i++) { r[i] = a[i] | 0; } } function inv25519(o, i) { var c = gf(); var a; for(a = 0; a < 16; ++a) { c[a] = i[a]; } for(a = 253; a >= 0; --a) { S(c, c); if(a !== 2 && a !== 4) { M(c, c, i); } } for(a = 0; a < 16; ++a) { o[a] = c[a]; } } function car25519(o) { var i, v, c = 1; for(i = 0; i < 16; ++i) { v = o[i] + c + 65535; c = Math.floor(v / 65536); o[i] = v - c * 65536; } o[0] += c - 1 + 37 * (c - 1); } function sel25519(p, q, b) { var t, c = ~(b - 1); for(var i = 0; i < 16; ++i) { t = c & (p[i] ^ q[i]); p[i] ^= t; q[i] ^= t; } } function gf(init) { var i, r = new Float64Array(16); if(init) { for(i = 0; i < init.length; ++i) { r[i] = init[i]; } } return r; } function A(o, a, b) { for(var i = 0; i < 16; ++i) { o[i] = a[i] + b[i]; } } function Z(o, a, b) { for(var i = 0; i < 16; ++i) { o[i] = a[i] - b[i]; } } function S(o, a) { M(o, a, a); } function M(o, a, b) { var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; v = a[0]; t0 += v * b0; t1 += v * b1; t2 += v * b2; t3 += v * b3; t4 += v * b4; t5 += v * b5; t6 += v * b6; t7 += v * b7; t8 += v * b8; t9 += v * b9; t10 += v * b10; t11 += v * b11; t12 += v * b12; t13 += v * b13; t14 += v * b14; t15 += v * b15; v = a[1]; t1 += v * b0; t2 += v * b1; t3 += v * b2; t4 += v * b3; t5 += v * b4; t6 += v * b5; t7 += v * b6; t8 += v * b7; t9 += v * b8; t10 += v * b9; t11 += v * b10; t12 += v * b11; t13 += v * b12; t14 += v * b13; t15 += v * b14; t16 += v * b15; v = a[2]; t2 += v * b0; t3 += v * b1; t4 += v * b2; t5 += v * b3; t6 += v * b4; t7 += v * b5; t8 += v * b6; t9 += v * b7; t10 += v * b8; t11 += v * b9; t12 += v * b10; t13 += v * b11; t14 += v * b12; t15 += v * b13; t16 += v * b14; t17 += v * b15; v = a[3]; t3 += v * b0; t4 += v * b1; t5 += v * b2; t6 += v * b3; t7 += v * b4; t8 += v * b5; t9 += v * b6; t10 += v * b7; t11 += v * b8; t12 += v * b9; t13 += v * b10; t14 += v * b11; t15 += v * b12; t16 += v * b13; t17 += v * b14; t18 += v * b15; v = a[4]; t4 += v * b0; t5 += v * b1; t6 += v * b2; t7 += v * b3; t8 += v * b4; t9 += v * b5; t10 += v * b6; t11 += v * b7; t12 += v * b8; t13 += v * b9; t14 += v * b10; t15 += v * b11; t16 += v * b12; t17 += v * b13; t18 += v * b14; t19 += v * b15; v = a[5]; t5 += v * b0; t6 += v * b1; t7 += v * b2; t8 += v * b3; t9 += v * b4; t10 += v * b5; t11 += v * b6; t12 += v * b7; t13 += v * b8; t14 += v * b9; t15 += v * b10; t16 += v * b11; t17 += v * b12; t18 += v * b13; t19 += v * b14; t20 += v * b15; v = a[6]; t6 += v * b0; t7 += v * b1; t8 += v * b2; t9 += v * b3; t10 += v * b4; t11 += v * b5; t12 += v * b6; t13 += v * b7; t14 += v * b8; t15 += v * b9; t16 += v * b10; t17 += v * b11; t18 += v * b12; t19 += v * b13; t20 += v * b14; t21 += v * b15; v = a[7]; t7 += v * b0; t8 += v * b1; t9 += v * b2; t10 += v * b3; t11 += v * b4; t12 += v * b5; t13 += v * b6; t14 += v * b7; t15 += v * b8; t16 += v * b9; t17 += v * b10; t18 += v * b11; t19 += v * b12; t20 += v * b13; t21 += v * b14; t22 += v * b15; v = a[8]; t8 += v * b0; t9 += v * b1; t10 += v * b2; t11 += v * b3; t12 += v * b4; t13 += v * b5; t14 += v * b6; t15 += v * b7; t16 += v * b8; t17 += v * b9; t18 += v * b10; t19 += v * b11; t20 += v * b12; t21 += v * b13; t22 += v * b14; t23 += v * b15; v = a[9]; t9 += v * b0; t10 += v * b1; t11 += v * b2; t12 += v * b3; t13 += v * b4; t14 += v * b5; t15 += v * b6; t16 += v * b7; t17 += v * b8; t18 += v * b9; t19 += v * b10; t20 += v * b11; t21 += v * b12; t22 += v * b13; t23 += v * b14; t24 += v * b15; v = a[10]; t10 += v * b0; t11 += v * b1; t12 += v * b2; t13 += v * b3; t14 += v * b4; t15 += v * b5; t16 += v * b6; t17 += v * b7; t18 += v * b8; t19 += v * b9; t20 += v * b10; t21 += v * b11; t22 += v * b12; t23 += v * b13; t24 += v * b14; t25 += v * b15; v = a[11]; t11 += v * b0; t12 += v * b1; t13 += v * b2; t14 += v * b3; t15 += v * b4; t16 += v * b5; t17 += v * b6; t18 += v * b7; t19 += v * b8; t20 += v * b9; t21 += v * b10; t22 += v * b11; t23 += v * b12; t24 += v * b13; t25 += v * b14; t26 += v * b15; v = a[12]; t12 += v * b0; t13 += v * b1; t14 += v * b2; t15 += v * b3; t16 += v * b4; t17 += v * b5; t18 += v * b6; t19 += v * b7; t20 += v * b8; t21 += v * b9; t22 += v * b10; t23 += v * b11; t24 += v * b12; t25 += v * b13; t26 += v * b14; t27 += v * b15; v = a[13]; t13 += v * b0; t14 += v * b1; t15 += v * b2; t16 += v * b3; t17 += v * b4; t18 += v * b5; t19 += v * b6; t20 += v * b7; t21 += v * b8; t22 += v * b9; t23 += v * b10; t24 += v * b11; t25 += v * b12; t26 += v * b13; t27 += v * b14; t28 += v * b15; v = a[14]; t14 += v * b0; t15 += v * b1; t16 += v * b2; t17 += v * b3; t18 += v * b4; t19 += v * b5; t20 += v * b6; t21 += v * b7; t22 += v * b8; t23 += v * b9; t24 += v * b10; t25 += v * b11; t26 += v * b12; t27 += v * b13; t28 += v * b14; t29 += v * b15; v = a[15]; t15 += v * b0; t16 += v * b1; t17 += v * b2; t18 += v * b3; t19 += v * b4; t20 += v * b5; t21 += v * b6; t22 += v * b7; t23 += v * b8; t24 += v * b9; t25 += v * b10; t26 += v * b11; t27 += v * b12; t28 += v * b13; t29 += v * b14; t30 += v * b15; t0 += 38 * t16; t1 += 38 * t17; t2 += 38 * t18; t3 += 38 * t19; t4 += 38 * t20; t5 += 38 * t21; t6 += 38 * t22; t7 += 38 * t23; t8 += 38 * t24; t9 += 38 * t25; t10 += 38 * t26; t11 += 38 * t27; t12 += 38 * t28; t13 += 38 * t29; t14 += 38 * t30; // t15 left as is // first car c = 1; v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; t0 += c-1 + 37 * (c-1); // second car c = 1; v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; t0 += c-1 + 37 * (c-1); o[ 0] = t0; o[ 1] = t1; o[ 2] = t2; o[ 3] = t3; o[ 4] = t4; o[ 5] = t5; o[ 6] = t6; o[ 7] = t7; o[ 8] = t8; o[ 9] = t9; o[10] = t10; o[11] = t11; o[12] = t12; o[13] = t13; o[14] = t14; o[15] = t15; } /***/ }), /***/ 89177: /***/ ((module) => { /** * Node.js module for Forge. * * @author Dave Longley * * Copyright 2011-2016 Digital Bazaar, Inc. */ module.exports = { // default options options: { usePureJavaScript: false } }; /***/ }), /***/ 95104: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Hash-based Message Authentication Code implementation. Requires a message * digest object that can be obtained, for example, from forge.md.sha1 or * forge.md.md5. * * @author Dave Longley * * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved. */ var forge = __webpack_require__(89177); __webpack_require__(86231); __webpack_require__(28339); /* HMAC API */ var hmac = module.exports = forge.hmac = forge.hmac || {}; /** * Creates an HMAC object that uses the given message digest object. * * @return an HMAC object. */ hmac.create = function() { // the hmac key to use var _key = null; // the message digest to use var _md = null; // the inner padding var _ipadding = null; // the outer padding var _opadding = null; // hmac context var ctx = {}; /** * Starts or restarts the HMAC with the given key and message digest. * * @param md the message digest to use, null to reuse the previous one, * a string to use builtin 'sha1', 'md5', 'sha256'. * @param key the key to use as a string, array of bytes, byte buffer, * or null to reuse the previous key. */ ctx.start = function(md, key) { if(md !== null) { if(typeof md === 'string') { // create builtin message digest md = md.toLowerCase(); if(md in forge.md.algorithms) { _md = forge.md.algorithms[md].create(); } else { throw new Error('Unknown hash algorithm "' + md + '"'); } } else { // store message digest _md = md; } } if(key === null) { // reuse previous key key = _key; } else { if(typeof key === 'string') { // convert string into byte buffer key = forge.util.createBuffer(key); } else if(forge.util.isArray(key)) { // convert byte array into byte buffer var tmp = key; key = forge.util.createBuffer(); for(var i = 0; i < tmp.length; ++i) { key.putByte(tmp[i]); } } // if key is longer than blocksize, hash it var keylen = key.length(); if(keylen > _md.blockLength) { _md.start(); _md.update(key.bytes()); key = _md.digest(); } // mix key into inner and outer padding // ipadding = [0x36 * blocksize] ^ key // opadding = [0x5C * blocksize] ^ key _ipadding = forge.util.createBuffer(); _opadding = forge.util.createBuffer(); keylen = key.length(); for(var i = 0; i < keylen; ++i) { var tmp = key.at(i); _ipadding.putByte(0x36 ^ tmp); _opadding.putByte(0x5C ^ tmp); } // if key is shorter than blocksize, add additional padding if(keylen < _md.blockLength) { var tmp = _md.blockLength - keylen; for(var i = 0; i < tmp; ++i) { _ipadding.putByte(0x36); _opadding.putByte(0x5C); } } _key = key; _ipadding = _ipadding.bytes(); _opadding = _opadding.bytes(); } // digest is done like so: hash(opadding | hash(ipadding | message)) // prepare to do inner hash // hash(ipadding | message) _md.start(); _md.update(_ipadding); }; /** * Updates the HMAC with the given message bytes. * * @param bytes the bytes to update with. */ ctx.update = function(bytes) { _md.update(bytes); }; /** * Produces the Message Authentication Code (MAC). * * @return a byte buffer containing the digest value. */ ctx.getMac = function() { // digest is done like so: hash(opadding | hash(ipadding | message)) // here we do the outer hashing var inner = _md.digest().bytes(); _md.start(); _md.update(_opadding); _md.update(inner); return _md.digest(); }; // alias for getMac ctx.digest = ctx.getMac; return ctx; }; /***/ }), /***/ 57655: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Node.js module for Forge. * * @author Dave Longley * * Copyright 2011-2016 Digital Bazaar, Inc. */ module.exports = __webpack_require__(89177); __webpack_require__(87994); __webpack_require__(81449); __webpack_require__(39549); __webpack_require__(7088); __webpack_require__(52923); __webpack_require__(97157); __webpack_require__(90000); __webpack_require__(95104); __webpack_require__(45173); __webpack_require__(49994); __webpack_require__(51145); __webpack_require__(73339); __webpack_require__(98474); __webpack_require__(70154); __webpack_require__(57014); __webpack_require__(30466); __webpack_require__(94829); __webpack_require__(6924); __webpack_require__(6861); __webpack_require__(94467); __webpack_require__(4376); __webpack_require__(57821); __webpack_require__(39965); __webpack_require__(94280); __webpack_require__(19563); __webpack_require__(79167); __webpack_require__(28339); /***/ }), /***/ 98007: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright (c) 2005 Tom Wu // All Rights Reserved. // See "LICENSE" for details. // Basic JavaScript BN library - subset useful for RSA encryption. /* Licensing (LICENSE) ------------------- This software is covered under the following copyright: */ /* * Copyright (c) 2003-2005 Tom Wu * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * In addition, the following condition applies: * * All redistributions must retain an intact copy of this copyright notice * and disclaimer. */ /* Address all questions regarding this license to: Tom Wu tjw@cs.Stanford.EDU */ var forge = __webpack_require__(89177); module.exports = forge.jsbn = forge.jsbn || {}; // Bits per digit var dbits; // JavaScript engine analysis var canary = 0xdeadbeefcafe; var j_lm = ((canary&0xffffff)==0xefcafe); // (public) Constructor function BigInteger(a,b,c) { this.data = []; if(a != null) if("number" == typeof a) this.fromNumber(a,b,c); else if(b == null && "string" != typeof a) this.fromString(a,256); else this.fromString(a,b); } forge.jsbn.BigInteger = BigInteger; // return new, unset BigInteger function nbi() { return new BigInteger(null); } // am: Compute w_j += (x*this_i), propagate carries, // c is initial carry, returns final carry. // c < 3*dvalue, x < 2*dvalue, this_i < dvalue // We need to select the fastest one that works in this environment. // am1: use a single mult and divide to get the high bits, // max digit bits should be 26 because // max internal value = 2*dvalue^2-2*dvalue (< 2^53) function am1(i,x,w,j,c,n) { while(--n >= 0) { var v = x*this.data[i++]+w.data[j]+c; c = Math.floor(v/0x4000000); w.data[j++] = v&0x3ffffff; } return c; } // am2 avoids a big mult-and-extract completely. // Max digit bits should be <= 30 because we do bitwise ops // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) function am2(i,x,w,j,c,n) { var xl = x&0x7fff, xh = x>>15; while(--n >= 0) { var l = this.data[i]&0x7fff; var h = this.data[i++]>>15; var m = xh*l+h*xl; l = xl*l+((m&0x7fff)<<15)+w.data[j]+(c&0x3fffffff); c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); w.data[j++] = l&0x3fffffff; } return c; } // Alternately, set max digit bits to 28 since some // browsers slow down when dealing with 32-bit numbers. function am3(i,x,w,j,c,n) { var xl = x&0x3fff, xh = x>>14; while(--n >= 0) { var l = this.data[i]&0x3fff; var h = this.data[i++]>>14; var m = xh*l+h*xl; l = xl*l+((m&0x3fff)<<14)+w.data[j]+c; c = (l>>28)+(m>>14)+xh*h; w.data[j++] = l&0xfffffff; } return c; } // node.js (no browser) if(typeof(navigator) === 'undefined') { BigInteger.prototype.am = am3; dbits = 28; } else if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { BigInteger.prototype.am = am2; dbits = 30; } else if(j_lm && (navigator.appName != "Netscape")) { BigInteger.prototype.am = am1; dbits = 26; } else { // Mozilla/Netscape seems to prefer am3 BigInteger.prototype.am = am3; dbits = 28; } BigInteger.prototype.DB = dbits; BigInteger.prototype.DM = ((1<= 0; --i) r.data[i] = this.data[i]; r.t = this.t; r.s = this.s; } // (protected) set from integer value x, -DV <= x < DV function bnpFromInt(x) { this.t = 1; this.s = (x<0)?-1:0; if(x > 0) this.data[0] = x; else if(x < -1) this.data[0] = x+this.DV; else this.t = 0; } // return bigint initialized to value function nbv(i) { var r = nbi(); r.fromInt(i); return r; } // (protected) set from string and radix function bnpFromString(s,b) { var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 256) k = 8; // byte array else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else { this.fromRadix(s,b); return; } this.t = 0; this.s = 0; var i = s.length, mi = false, sh = 0; while(--i >= 0) { var x = (k==8)?s[i]&0xff:intAt(s,i); if(x < 0) { if(s.charAt(i) == "-") mi = true; continue; } mi = false; if(sh == 0) this.data[this.t++] = x; else if(sh+k > this.DB) { this.data[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); } else this.data[this.t-1] |= x<= this.DB) sh -= this.DB; } if(k == 8 && (s[0]&0x80) != 0) { this.s = -1; if(sh > 0) this.data[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this.data[this.t-1] == c) --this.t; } // (public) return string representation in given radix function bnToString(b) { if(this.s < 0) return "-"+this.negate().toString(b); var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else return this.toRadix(b); var km = (1< 0) { if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); } while(i >= 0) { if(p < k) { d = (this.data[i]&((1<>(p+=this.DB-k); } else { d = (this.data[i]>>(p-=k))&km; if(p <= 0) { p += this.DB; --i; } } if(d > 0) m = true; if(m) r += int2char(d); } } return m?r:"0"; } // (public) -this function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } // (public) |this| function bnAbs() { return (this.s<0)?this.negate():this; } // (public) return + if this > a, - if this < a, 0 if equal function bnCompareTo(a) { var r = this.s-a.s; if(r != 0) return r; var i = this.t; r = i-a.t; if(r != 0) return (this.s<0)?-r:r; while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r; return 0; } // returns bit length of the integer x function nbits(x) { var r = 1, t; if((t=x>>>16) != 0) { x = t; r += 16; } if((t=x>>8) != 0) { x = t; r += 8; } if((t=x>>4) != 0) { x = t; r += 4; } if((t=x>>2) != 0) { x = t; r += 2; } if((t=x>>1) != 0) { x = t; r += 1; } return r; } // (public) return the number of bits in "this" function bnBitLength() { if(this.t <= 0) return 0; return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM)); } // (protected) r = this << n*DB function bnpDLShiftTo(n,r) { var i; for(i = this.t-1; i >= 0; --i) r.data[i+n] = this.data[i]; for(i = n-1; i >= 0; --i) r.data[i] = 0; r.t = this.t+n; r.s = this.s; } // (protected) r = this >> n*DB function bnpDRShiftTo(n,r) { for(var i = n; i < this.t; ++i) r.data[i-n] = this.data[i]; r.t = Math.max(this.t-n,0); r.s = this.s; } // (protected) r = this << n function bnpLShiftTo(n,r) { var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<= 0; --i) { r.data[i+ds+1] = (this.data[i]>>cbs)|c; c = (this.data[i]&bm)<= 0; --i) r.data[i] = 0; r.data[ds] = c; r.t = this.t+ds+1; r.s = this.s; r.clamp(); } // (protected) r = this >> n function bnpRShiftTo(n,r) { r.s = this.s; var ds = Math.floor(n/this.DB); if(ds >= this.t) { r.t = 0; return; } var bs = n%this.DB; var cbs = this.DB-bs; var bm = (1<>bs; for(var i = ds+1; i < this.t; ++i) { r.data[i-ds-1] |= (this.data[i]&bm)<>bs; } if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<>= this.DB; } if(a.t < this.t) { c -= a.s; while(i < this.t) { c += this.data[i]; r.data[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c -= a.data[i]; r.data[i++] = c&this.DM; c >>= this.DB; } c -= a.s; } r.s = (c<0)?-1:0; if(c < -1) r.data[i++] = this.DV+c; else if(c > 0) r.data[i++] = c; r.t = i; r.clamp(); } // (protected) r = this * a, r != this,a (HAC 14.12) // "this" should be the larger one if appropriate. function bnpMultiplyTo(a,r) { var x = this.abs(), y = a.abs(); var i = x.t; r.t = i+y.t; while(--i >= 0) r.data[i] = 0; for(i = 0; i < y.t; ++i) r.data[i+x.t] = x.am(0,y.data[i],r,i,0,x.t); r.s = 0; r.clamp(); if(this.s != a.s) BigInteger.ZERO.subTo(r,r); } // (protected) r = this^2, r != this (HAC 14.16) function bnpSquareTo(r) { var x = this.abs(); var i = r.t = 2*x.t; while(--i >= 0) r.data[i] = 0; for(i = 0; i < x.t-1; ++i) { var c = x.am(i,x.data[i],r,2*i,0,1); if((r.data[i+x.t]+=x.am(i+1,2*x.data[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { r.data[i+x.t] -= x.DV; r.data[i+x.t+1] = 1; } } if(r.t > 0) r.data[r.t-1] += x.am(i,x.data[i],r,2*i,0,1); r.s = 0; r.clamp(); } // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) // r != q, this != m. q or r may be null. function bnpDivRemTo(m,q,r) { var pm = m.abs(); if(pm.t <= 0) return; var pt = this.abs(); if(pt.t < pm.t) { if(q != null) q.fromInt(0); if(r != null) this.copyTo(r); return; } if(r == null) r = nbi(); var y = nbi(), ts = this.s, ms = m.s; var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } var ys = y.t; var y0 = y.data[ys-1]; if(y0 == 0) return; var yt = y0*(1<1)?y.data[ys-2]>>this.F2:0); var d1 = this.FV/yt, d2 = (1<= 0) { r.data[r.t++] = 1; r.subTo(t,r); } BigInteger.ONE.dlShiftTo(ys,t); t.subTo(y,y); // "negative" y so we can replace sub with am later while(y.t < ys) y.data[y.t++] = 0; while(--j >= 0) { // Estimate quotient digit var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2); if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out y.dlShiftTo(j,t); r.subTo(t,r); while(r.data[i] < --qd) r.subTo(t,r); } } if(q != null) { r.drShiftTo(ys,q); if(ts != ms) BigInteger.ZERO.subTo(q,q); } r.t = ys; r.clamp(); if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder if(ts < 0) BigInteger.ZERO.subTo(r,r); } // (public) this mod a function bnMod(a) { var r = nbi(); this.abs().divRemTo(a,null,r); if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); return r; } // Modular reduction using "classic" algorithm function Classic(m) { this.m = m; } function cConvert(x) { if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); else return x; } function cRevert(x) { return x; } function cReduce(x) { x.divRemTo(this.m,null,x); } function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } Classic.prototype.convert = cConvert; Classic.prototype.revert = cRevert; Classic.prototype.reduce = cReduce; Classic.prototype.mulTo = cMulTo; Classic.prototype.sqrTo = cSqrTo; // (protected) return "-1/this % 2^DB"; useful for Mont. reduction // justification: // xy == 1 (mod m) // xy = 1+km // xy(2-xy) = (1+km)(1-km) // x[y(2-xy)] = 1-k^2m^2 // x[y(2-xy)] == 1 (mod m^2) // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. // JS multiply "overflows" differently from C/C++, so care is needed here. function bnpInvDigit() { if(this.t < 1) return 0; var x = this.data[0]; if((x&1) == 0) return 0; var y = x&3; // y == 1/x mod 2^2 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 // last step - calculate inverse mod DV directly; // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits // we really want the negative inverse, and -DV < y < DV return (y>0)?this.DV-y:-y; } // Montgomery reduction function Montgomery(m) { this.m = m; this.mp = m.invDigit(); this.mpl = this.mp&0x7fff; this.mph = this.mp>>15; this.um = (1<<(m.DB-15))-1; this.mt2 = 2*m.t; } // xR mod m function montConvert(x) { var r = nbi(); x.abs().dlShiftTo(this.m.t,r); r.divRemTo(this.m,null,r); if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); return r; } // x/R mod m function montRevert(x) { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } // x = x/R mod m (HAC 14.32) function montReduce(x) { while(x.t <= this.mt2) // pad x so am has enough room later x.data[x.t++] = 0; for(var i = 0; i < this.m.t; ++i) { // faster way of calculating u0 = x.data[i]*mp mod DV var j = x.data[i]&0x7fff; var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM; // use am to combine the multiply-shift-add into one call j = i+this.m.t; x.data[j] += this.m.am(0,u0,x,i,0,this.m.t); // propagate carry while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; } } x.clamp(); x.drShiftTo(this.m.t,x); if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = "x^2/R mod m"; x != r function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = "xy/R mod m"; x,y != r function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Montgomery.prototype.convert = montConvert; Montgomery.prototype.revert = montRevert; Montgomery.prototype.reduce = montReduce; Montgomery.prototype.mulTo = montMulTo; Montgomery.prototype.sqrTo = montSqrTo; // (protected) true iff this is even function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; } // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) function bnpExp(e,z) { if(e > 0xffffffff || e < 1) return BigInteger.ONE; var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; g.copyTo(r); while(--i >= 0) { z.sqrTo(r,r2); if((e&(1< 0) z.mulTo(r2,g,r); else { var t = r; r = r2; r2 = t; } } return z.revert(r); } // (public) this^e % m, 0 <= e < 2^32 function bnModPowInt(e,m) { var z; if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); return this.exp(e,z); } // protected BigInteger.prototype.copyTo = bnpCopyTo; BigInteger.prototype.fromInt = bnpFromInt; BigInteger.prototype.fromString = bnpFromString; BigInteger.prototype.clamp = bnpClamp; BigInteger.prototype.dlShiftTo = bnpDLShiftTo; BigInteger.prototype.drShiftTo = bnpDRShiftTo; BigInteger.prototype.lShiftTo = bnpLShiftTo; BigInteger.prototype.rShiftTo = bnpRShiftTo; BigInteger.prototype.subTo = bnpSubTo; BigInteger.prototype.multiplyTo = bnpMultiplyTo; BigInteger.prototype.squareTo = bnpSquareTo; BigInteger.prototype.divRemTo = bnpDivRemTo; BigInteger.prototype.invDigit = bnpInvDigit; BigInteger.prototype.isEven = bnpIsEven; BigInteger.prototype.exp = bnpExp; // public BigInteger.prototype.toString = bnToString; BigInteger.prototype.negate = bnNegate; BigInteger.prototype.abs = bnAbs; BigInteger.prototype.compareTo = bnCompareTo; BigInteger.prototype.bitLength = bnBitLength; BigInteger.prototype.mod = bnMod; BigInteger.prototype.modPowInt = bnModPowInt; // "constants" BigInteger.ZERO = nbv(0); BigInteger.ONE = nbv(1); // jsbn2 lib //Copyright (c) 2005-2009 Tom Wu //All Rights Reserved. //See "LICENSE" for details (See jsbn.js for LICENSE). //Extended JavaScript BN functions, required for RSA private ops. //Version 1.1: new BigInteger("0", 10) returns "proper" zero //(public) function bnClone() { var r = nbi(); this.copyTo(r); return r; } //(public) return value as integer function bnIntValue() { if(this.s < 0) { if(this.t == 1) return this.data[0]-this.DV; else if(this.t == 0) return -1; } else if(this.t == 1) return this.data[0]; else if(this.t == 0) return 0; // assumes 16 < DB < 32 return ((this.data[1]&((1<<(32-this.DB))-1))<>24; } //(public) return value as short (assumes DB>=16) function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; } //(protected) return x s.t. r^x < DV function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } //(public) 0 if this == 0, 1 if this > 0 function bnSigNum() { if(this.s < 0) return -1; else if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0; else return 1; } //(protected) convert to radix string function bnpToRadix(b) { if(b == null) b = 10; if(this.signum() == 0 || b < 2 || b > 36) return "0"; var cs = this.chunkSize(b); var a = Math.pow(b,cs); var d = nbv(a), y = nbi(), z = nbi(), r = ""; this.divRemTo(d,y,z); while(y.signum() > 0) { r = (a+z.intValue()).toString(b).substr(1) + r; y.divRemTo(d,y,z); } return z.intValue().toString(b) + r; } //(protected) convert from radix string function bnpFromRadix(s,b) { this.fromInt(0); if(b == null) b = 10; var cs = this.chunkSize(b); var d = Math.pow(b,cs), mi = false, j = 0, w = 0; for(var i = 0; i < s.length; ++i) { var x = intAt(s,i); if(x < 0) { if(s.charAt(i) == "-" && this.signum() == 0) mi = true; continue; } w = b*w+x; if(++j >= cs) { this.dMultiply(d); this.dAddOffset(w,0); j = 0; w = 0; } } if(j > 0) { this.dMultiply(Math.pow(b,j)); this.dAddOffset(w,0); } if(mi) BigInteger.ZERO.subTo(this,this); } //(protected) alternate constructor function bnpFromNumber(a,b,c) { if("number" == typeof b) { // new BigInteger(int,int,RNG) if(a < 2) this.fromInt(1); else { this.fromNumber(a,c); if(!this.testBit(a-1)) // force MSB set this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); if(this.isEven()) this.dAddOffset(1,0); // force odd while(!this.isProbablePrime(b)) { this.dAddOffset(2,0); if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); } } } else { // new BigInteger(int,RNG) var x = new Array(), t = a&7; x.length = (a>>3)+1; b.nextBytes(x); if(t > 0) x[0] &= ((1< 0) { if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p) r[k++] = d|(this.s<<(this.DB-p)); while(i >= 0) { if(p < 8) { d = (this.data[i]&((1<>(p+=this.DB-8); } else { d = (this.data[i]>>(p-=8))&0xff; if(p <= 0) { p += this.DB; --i; } } if((d&0x80) != 0) d |= -256; if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; if(k > 0 || d != this.s) r[k++] = d; } } return r; } function bnEquals(a) { return(this.compareTo(a)==0); } function bnMin(a) { return(this.compareTo(a)<0)?this:a; } function bnMax(a) { return(this.compareTo(a)>0)?this:a; } //(protected) r = this op a (bitwise) function bnpBitwiseTo(a,op,r) { var i, f, m = Math.min(a.t,this.t); for(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]); if(a.t < this.t) { f = a.s&this.DM; for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f); r.t = this.t; } else { f = this.s&this.DM; for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]); r.t = a.t; } r.s = op(this.s,a.s); r.clamp(); } //(public) this & a function op_and(x,y) { return x&y; } function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } //(public) this | a function op_or(x,y) { return x|y; } function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } //(public) this ^ a function op_xor(x,y) { return x^y; } function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } //(public) this & ~a function op_andnot(x,y) { return x&~y; } function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } //(public) ~this function bnNot() { var r = nbi(); for(var i = 0; i < this.t; ++i) r.data[i] = this.DM&~this.data[i]; r.t = this.t; r.s = ~this.s; return r; } //(public) this << n function bnShiftLeft(n) { var r = nbi(); if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); return r; } //(public) this >> n function bnShiftRight(n) { var r = nbi(); if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); return r; } //return index of lowest 1-bit in x, x < 2^31 function lbit(x) { if(x == 0) return -1; var r = 0; if((x&0xffff) == 0) { x >>= 16; r += 16; } if((x&0xff) == 0) { x >>= 8; r += 8; } if((x&0xf) == 0) { x >>= 4; r += 4; } if((x&3) == 0) { x >>= 2; r += 2; } if((x&1) == 0) ++r; return r; } //(public) returns index of lowest 1-bit (or -1 if none) function bnGetLowestSetBit() { for(var i = 0; i < this.t; ++i) if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]); if(this.s < 0) return this.t*this.DB; return -1; } //return number of 1 bits in x function cbit(x) { var r = 0; while(x != 0) { x &= x-1; ++r; } return r; } //(public) return number of set bits function bnBitCount() { var r = 0, x = this.s&this.DM; for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x); return r; } //(public) true iff nth bit is set function bnTestBit(n) { var j = Math.floor(n/this.DB); if(j >= this.t) return(this.s!=0); return((this.data[j]&(1<<(n%this.DB)))!=0); } //(protected) this op (1<>= this.DB; } if(a.t < this.t) { c += a.s; while(i < this.t) { c += this.data[i]; r.data[i++] = c&this.DM; c >>= this.DB; } c += this.s; } else { c += this.s; while(i < a.t) { c += a.data[i]; r.data[i++] = c&this.DM; c >>= this.DB; } c += a.s; } r.s = (c<0)?-1:0; if(c > 0) r.data[i++] = c; else if(c < -1) r.data[i++] = this.DV+c; r.t = i; r.clamp(); } //(public) this + a function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } //(public) this - a function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } //(public) this * a function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } //(public) this / a function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } //(public) this % a function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } //(public) [this/a,this%a] function bnDivideAndRemainder(a) { var q = nbi(), r = nbi(); this.divRemTo(a,q,r); return new Array(q,r); } //(protected) this *= n, this >= 0, 1 < n < DV function bnpDMultiply(n) { this.data[this.t] = this.am(0,n-1,this,0,0,this.t); ++this.t; this.clamp(); } //(protected) this += n << w words, this >= 0 function bnpDAddOffset(n,w) { if(n == 0) return; while(this.t <= w) this.data[this.t++] = 0; this.data[w] += n; while(this.data[w] >= this.DV) { this.data[w] -= this.DV; if(++w >= this.t) this.data[this.t++] = 0; ++this.data[w]; } } //A "null" reducer function NullExp() {} function nNop(x) { return x; } function nMulTo(x,y,r) { x.multiplyTo(y,r); } function nSqrTo(x,r) { x.squareTo(r); } NullExp.prototype.convert = nNop; NullExp.prototype.revert = nNop; NullExp.prototype.mulTo = nMulTo; NullExp.prototype.sqrTo = nSqrTo; //(public) this^e function bnPow(e) { return this.exp(e,new NullExp()); } //(protected) r = lower n words of "this * a", a.t <= n //"this" should be the larger one if appropriate. function bnpMultiplyLowerTo(a,n,r) { var i = Math.min(this.t+a.t,n); r.s = 0; // assumes a,this >= 0 r.t = i; while(i > 0) r.data[--i] = 0; var j; for(j = r.t-this.t; i < j; ++i) r.data[i+this.t] = this.am(0,a.data[i],r,i,0,this.t); for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a.data[i],r,i,0,n-i); r.clamp(); } //(protected) r = "this * a" without lower n words, n > 0 //"this" should be the larger one if appropriate. function bnpMultiplyUpperTo(a,n,r) { --n; var i = r.t = this.t+a.t-n; r.s = 0; // assumes a,this >= 0 while(--i >= 0) r.data[i] = 0; for(i = Math.max(n-this.t,0); i < a.t; ++i) r.data[this.t+i-n] = this.am(n-i,a.data[i],r,0,0,this.t+i-n); r.clamp(); r.drShiftTo(1,r); } //Barrett modular reduction function Barrett(m) { // setup Barrett this.r2 = nbi(); this.q3 = nbi(); BigInteger.ONE.dlShiftTo(2*m.t,this.r2); this.mu = this.r2.divide(m); this.m = m; } function barrettConvert(x) { if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); else if(x.compareTo(this.m) < 0) return x; else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } } function barrettRevert(x) { return x; } //x = x mod m (HAC 14.42) function barrettReduce(x) { x.drShiftTo(this.m.t-1,this.r2); if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); x.subTo(this.r2,x); while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } //r = x^2 mod m; x != r function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } //r = x*y mod m; x,y != r function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Barrett.prototype.convert = barrettConvert; Barrett.prototype.revert = barrettRevert; Barrett.prototype.reduce = barrettReduce; Barrett.prototype.mulTo = barrettMulTo; Barrett.prototype.sqrTo = barrettSqrTo; //(public) this^e % m (HAC 14.85) function bnModPow(e,m) { var i = e.bitLength(), k, r = nbv(1), z; if(i <= 0) return r; else if(i < 18) k = 1; else if(i < 48) k = 3; else if(i < 144) k = 4; else if(i < 768) k = 5; else k = 6; if(i < 8) z = new Classic(m); else if(m.isEven()) z = new Barrett(m); else z = new Montgomery(m); // precomputation var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { var g2 = nbi(); z.sqrTo(g[1],g2); while(n <= km) { g[n] = nbi(); z.mulTo(g2,g[n-2],g[n]); n += 2; } } var j = e.t-1, w, is1 = true, r2 = nbi(), t; i = nbits(e.data[j])-1; while(j >= 0) { if(i >= k1) w = (e.data[j]>>(i-k1))&km; else { w = (e.data[j]&((1<<(i+1))-1))<<(k1-i); if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1); } n = k; while((w&1) == 0) { w >>= 1; --n; } if((i -= n) < 0) { i += this.DB; --j; } if(is1) { // ret == 1, don't bother squaring or multiplying it g[w].copyTo(r); is1 = false; } else { while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } z.mulTo(r2,g[w],r); } while(j >= 0 && (e.data[j]&(1< 0) { x.rShiftTo(g,x); y.rShiftTo(g,y); } while(x.signum() > 0) { if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); if(x.compareTo(y) >= 0) { x.subTo(y,x); x.rShiftTo(1,x); } else { y.subTo(x,y); y.rShiftTo(1,y); } } if(g > 0) y.lShiftTo(g,y); return y; } //(protected) this % n, n < 2^26 function bnpModInt(n) { if(n <= 0) return 0; var d = this.DV%n, r = (this.s<0)?n-1:0; if(this.t > 0) if(d == 0) r = this.data[0]%n; else for(var i = this.t-1; i >= 0; --i) r = (d*r+this.data[i])%n; return r; } //(public) 1/this % m (HAC 14.61) function bnModInverse(m) { var ac = m.isEven(); if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; var u = m.clone(), v = this.clone(); var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); while(u.signum() != 0) { while(u.isEven()) { u.rShiftTo(1,u); if(ac) { if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } a.rShiftTo(1,a); } else if(!b.isEven()) b.subTo(m,b); b.rShiftTo(1,b); } while(v.isEven()) { v.rShiftTo(1,v); if(ac) { if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } c.rShiftTo(1,c); } else if(!d.isEven()) d.subTo(m,d); d.rShiftTo(1,d); } if(u.compareTo(v) >= 0) { u.subTo(v,u); if(ac) a.subTo(c,a); b.subTo(d,b); } else { v.subTo(u,v); if(ac) c.subTo(a,c); d.subTo(b,d); } } if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; if(d.compareTo(m) >= 0) return d.subtract(m); if(d.signum() < 0) d.addTo(m,d); else return d; if(d.signum() < 0) return d.add(m); else return d; } var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509]; var lplim = (1<<26)/lowprimes[lowprimes.length-1]; //(public) test primality with certainty >= 1-.5^t function bnIsProbablePrime(t) { var i, x = this.abs(); if(x.t == 1 && x.data[0] <= lowprimes[lowprimes.length-1]) { for(i = 0; i < lowprimes.length; ++i) if(x.data[0] == lowprimes[i]) return true; return false; } if(x.isEven()) return false; i = 1; while(i < lowprimes.length) { var m = lowprimes[i], j = i+1; while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; m = x.modInt(m); while(i < j) if(m%lowprimes[i++] == 0) return false; } return x.millerRabin(t); } //(protected) true if probably prime (HAC 4.24, Miller-Rabin) function bnpMillerRabin(t) { var n1 = this.subtract(BigInteger.ONE); var k = n1.getLowestSetBit(); if(k <= 0) return false; var r = n1.shiftRight(k); var prng = bnGetPrng(); var a; for(var i = 0; i < t; ++i) { // select witness 'a' at random from between 1 and n1 do { a = new BigInteger(this.bitLength(), prng); } while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0); var y = a.modPow(r,this); if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { var j = 1; while(j++ < k && y.compareTo(n1) != 0) { y = y.modPowInt(2,this); if(y.compareTo(BigInteger.ONE) == 0) return false; } if(y.compareTo(n1) != 0) return false; } } return true; } // get pseudo random number generator function bnGetPrng() { // create prng with api that matches BigInteger secure random return { // x is an array to fill with bytes nextBytes: function(x) { for(var i = 0; i < x.length; ++i) { x[i] = Math.floor(Math.random() * 0x0100); } } }; } //protected BigInteger.prototype.chunkSize = bnpChunkSize; BigInteger.prototype.toRadix = bnpToRadix; BigInteger.prototype.fromRadix = bnpFromRadix; BigInteger.prototype.fromNumber = bnpFromNumber; BigInteger.prototype.bitwiseTo = bnpBitwiseTo; BigInteger.prototype.changeBit = bnpChangeBit; BigInteger.prototype.addTo = bnpAddTo; BigInteger.prototype.dMultiply = bnpDMultiply; BigInteger.prototype.dAddOffset = bnpDAddOffset; BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; BigInteger.prototype.modInt = bnpModInt; BigInteger.prototype.millerRabin = bnpMillerRabin; //public BigInteger.prototype.clone = bnClone; BigInteger.prototype.intValue = bnIntValue; BigInteger.prototype.byteValue = bnByteValue; BigInteger.prototype.shortValue = bnShortValue; BigInteger.prototype.signum = bnSigNum; BigInteger.prototype.toByteArray = bnToByteArray; BigInteger.prototype.equals = bnEquals; BigInteger.prototype.min = bnMin; BigInteger.prototype.max = bnMax; BigInteger.prototype.and = bnAnd; BigInteger.prototype.or = bnOr; BigInteger.prototype.xor = bnXor; BigInteger.prototype.andNot = bnAndNot; BigInteger.prototype.not = bnNot; BigInteger.prototype.shiftLeft = bnShiftLeft; BigInteger.prototype.shiftRight = bnShiftRight; BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; BigInteger.prototype.bitCount = bnBitCount; BigInteger.prototype.testBit = bnTestBit; BigInteger.prototype.setBit = bnSetBit; BigInteger.prototype.clearBit = bnClearBit; BigInteger.prototype.flipBit = bnFlipBit; BigInteger.prototype.add = bnAdd; BigInteger.prototype.subtract = bnSubtract; BigInteger.prototype.multiply = bnMultiply; BigInteger.prototype.divide = bnDivide; BigInteger.prototype.remainder = bnRemainder; BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; BigInteger.prototype.modPow = bnModPow; BigInteger.prototype.modInverse = bnModInverse; BigInteger.prototype.pow = bnPow; BigInteger.prototype.gcd = bnGCD; BigInteger.prototype.isProbablePrime = bnIsProbablePrime; //BigInteger interfaces not implemented in jsbn: //BigInteger(int signum, byte[] magnitude) //double doubleValue() //float floatValue() //int hashCode() //long longValue() //static BigInteger valueOf(long val) /***/ }), /***/ 45173: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of RSA-KEM. * * @author Lautaro Cozzani Rodriguez * @author Dave Longley * * Copyright (c) 2014 Lautaro Cozzani * Copyright (c) 2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(28339); __webpack_require__(57821); __webpack_require__(98007); module.exports = forge.kem = forge.kem || {}; var BigInteger = forge.jsbn.BigInteger; /** * The API for the RSA Key Encapsulation Mechanism (RSA-KEM) from ISO 18033-2. */ forge.kem.rsa = {}; /** * Creates an RSA KEM API object for generating a secret asymmetric key. * * The symmetric key may be generated via a call to 'encrypt', which will * produce a ciphertext to be transmitted to the recipient and a key to be * kept secret. The ciphertext is a parameter to be passed to 'decrypt' which * will produce the same secret key for the recipient to use to decrypt a * message that was encrypted with the secret key. * * @param kdf the KDF API to use (eg: new forge.kem.kdf1()). * @param options the options to use. * [prng] a custom crypto-secure pseudo-random number generator to use, * that must define "getBytesSync". */ forge.kem.rsa.create = function(kdf, options) { options = options || {}; var prng = options.prng || forge.random; var kem = {}; /** * Generates a secret key and its encapsulation. * * @param publicKey the RSA public key to encrypt with. * @param keyLength the length, in bytes, of the secret key to generate. * * @return an object with: * encapsulation: the ciphertext for generating the secret key, as a * binary-encoded string of bytes. * key: the secret key to use for encrypting a message. */ kem.encrypt = function(publicKey, keyLength) { // generate a random r where 1 < r < n var byteLength = Math.ceil(publicKey.n.bitLength() / 8); var r; do { r = new BigInteger( forge.util.bytesToHex(prng.getBytesSync(byteLength)), 16).mod(publicKey.n); } while(r.compareTo(BigInteger.ONE) <= 0); // prepend r with zeros r = forge.util.hexToBytes(r.toString(16)); var zeros = byteLength - r.length; if(zeros > 0) { r = forge.util.fillString(String.fromCharCode(0), zeros) + r; } // encrypt the random var encapsulation = publicKey.encrypt(r, 'NONE'); // generate the secret key var key = kdf.generate(r, keyLength); return {encapsulation: encapsulation, key: key}; }; /** * Decrypts an encapsulated secret key. * * @param privateKey the RSA private key to decrypt with. * @param encapsulation the ciphertext for generating the secret key, as * a binary-encoded string of bytes. * @param keyLength the length, in bytes, of the secret key to generate. * * @return the secret key as a binary-encoded string of bytes. */ kem.decrypt = function(privateKey, encapsulation, keyLength) { // decrypt the encapsulation and generate the secret key var r = privateKey.decrypt(encapsulation, 'NONE'); return kdf.generate(r, keyLength); }; return kem; }; // TODO: add forge.kem.kdf.create('KDF1', {md: ..., ...}) API? /** * Creates a key derivation API object that implements KDF1 per ISO 18033-2. * * @param md the hash API to use. * @param [digestLength] an optional digest length that must be positive and * less than or equal to md.digestLength. * * @return a KDF1 API object. */ forge.kem.kdf1 = function(md, digestLength) { _createKDF(this, md, 0, digestLength || md.digestLength); }; /** * Creates a key derivation API object that implements KDF2 per ISO 18033-2. * * @param md the hash API to use. * @param [digestLength] an optional digest length that must be positive and * less than or equal to md.digestLength. * * @return a KDF2 API object. */ forge.kem.kdf2 = function(md, digestLength) { _createKDF(this, md, 1, digestLength || md.digestLength); }; /** * Creates a KDF1 or KDF2 API object. * * @param md the hash API to use. * @param counterStart the starting index for the counter. * @param digestLength the digest length to use. * * @return the KDF API object. */ function _createKDF(kdf, md, counterStart, digestLength) { /** * Generate a key of the specified length. * * @param x the binary-encoded byte string to generate a key from. * @param length the number of bytes to generate (the size of the key). * * @return the key as a binary-encoded string. */ kdf.generate = function(x, length) { var key = new forge.util.ByteBuffer(); // run counter from counterStart to ceil(length / Hash.len) var k = Math.ceil(length / digestLength) + counterStart; var c = new forge.util.ByteBuffer(); for(var i = counterStart; i < k; ++i) { // I2OSP(i, 4): convert counter to an octet string of 4 octets c.putInt32(i); // digest 'x' and the counter and add the result to the key md.start(); md.update(x + c.getBytes()); var hash = md.digest(); key.putBytes(hash.getBytes(digestLength)); } // truncate to the correct key length key.truncate(key.length() - length); return key.getBytes(); }; } /***/ }), /***/ 49994: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Cross-browser support for logging in a web application. * * @author David I. Lehn * * Copyright (c) 2008-2013 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(28339); /* LOG API */ module.exports = forge.log = forge.log || {}; /** * Application logging system. * * Each logger level available as it's own function of the form: * forge.log.level(category, args...) * The category is an arbitrary string, and the args are the same as * Firebug's console.log API. By default the call will be output as: * 'LEVEL [category] , args[1], ...' * This enables proper % formatting via the first argument. * Each category is enabled by default but can be enabled or disabled with * the setCategoryEnabled() function. */ // list of known levels forge.log.levels = [ 'none', 'error', 'warning', 'info', 'debug', 'verbose', 'max']; // info on the levels indexed by name: // index: level index // name: uppercased display name var sLevelInfo = {}; // list of loggers var sLoggers = []; /** * Standard console logger. If no console support is enabled this will * remain null. Check before using. */ var sConsoleLogger = null; // logger flags /** * Lock the level at the current value. Used in cases where user config may * set the level such that only critical messages are seen but more verbose * messages are needed for debugging or other purposes. */ forge.log.LEVEL_LOCKED = (1 << 1); /** * Always call log function. By default, the logging system will check the * message level against logger.level before calling the log function. This * flag allows the function to do its own check. */ forge.log.NO_LEVEL_CHECK = (1 << 2); /** * Perform message interpolation with the passed arguments. "%" style * fields in log messages will be replaced by arguments as needed. Some * loggers, such as Firebug, may do this automatically. The original log * message will be available as 'message' and the interpolated version will * be available as 'fullMessage'. */ forge.log.INTERPOLATE = (1 << 3); // setup each log level for(var i = 0; i < forge.log.levels.length; ++i) { var level = forge.log.levels[i]; sLevelInfo[level] = { index: i, name: level.toUpperCase() }; } /** * Message logger. Will dispatch a message to registered loggers as needed. * * @param message message object */ forge.log.logMessage = function(message) { var messageLevelIndex = sLevelInfo[message.level].index; for(var i = 0; i < sLoggers.length; ++i) { var logger = sLoggers[i]; if(logger.flags & forge.log.NO_LEVEL_CHECK) { logger.f(message); } else { // get logger level var loggerLevelIndex = sLevelInfo[logger.level].index; // check level if(messageLevelIndex <= loggerLevelIndex) { // message critical enough, call logger logger.f(logger, message); } } } }; /** * Sets the 'standard' key on a message object to: * "LEVEL [category] " + message * * @param message a message log object */ forge.log.prepareStandard = function(message) { if(!('standard' in message)) { message.standard = sLevelInfo[message.level].name + //' ' + +message.timestamp + ' [' + message.category + '] ' + message.message; } }; /** * Sets the 'full' key on a message object to the original message * interpolated via % formatting with the message arguments. * * @param message a message log object. */ forge.log.prepareFull = function(message) { if(!('full' in message)) { // copy args and insert message at the front var args = [message.message]; args = args.concat([] || 0); // format the message message.full = forge.util.format.apply(this, args); } }; /** * Applies both preparseStandard() and prepareFull() to a message object and * store result in 'standardFull'. * * @param message a message log object. */ forge.log.prepareStandardFull = function(message) { if(!('standardFull' in message)) { // FIXME implement 'standardFull' logging forge.log.prepareStandard(message); message.standardFull = message.standard; } }; // create log level functions if(true) { // levels for which we want functions var levels = ['error', 'warning', 'info', 'debug', 'verbose']; for(var i = 0; i < levels.length; ++i) { // wrap in a function to ensure proper level var is passed (function(level) { // create function for this level forge.log[level] = function(category, message/*, args...*/) { // convert arguments to real array, remove category and message var args = Array.prototype.slice.call(arguments).slice(2); // create message object // Note: interpolation and standard formatting is done lazily var msg = { timestamp: new Date(), level: level, category: category, message: message, 'arguments': args /*standard*/ /*full*/ /*fullMessage*/ }; // process this message forge.log.logMessage(msg); }; })(levels[i]); } } /** * Creates a new logger with specified custom logging function. * * The logging function has a signature of: * function(logger, message) * logger: current logger * message: object: * level: level id * category: category * message: string message * arguments: Array of extra arguments * fullMessage: interpolated message and arguments if INTERPOLATE flag set * * @param logFunction a logging function which takes a log message object * as a parameter. * * @return a logger object. */ forge.log.makeLogger = function(logFunction) { var logger = { flags: 0, f: logFunction }; forge.log.setLevel(logger, 'none'); return logger; }; /** * Sets the current log level on a logger. * * @param logger the target logger. * @param level the new maximum log level as a string. * * @return true if set, false if not. */ forge.log.setLevel = function(logger, level) { var rval = false; if(logger && !(logger.flags & forge.log.LEVEL_LOCKED)) { for(var i = 0; i < forge.log.levels.length; ++i) { var aValidLevel = forge.log.levels[i]; if(level == aValidLevel) { // set level logger.level = level; rval = true; break; } } } return rval; }; /** * Locks the log level at its current value. * * @param logger the target logger. * @param lock boolean lock value, default to true. */ forge.log.lock = function(logger, lock) { if(typeof lock === 'undefined' || lock) { logger.flags |= forge.log.LEVEL_LOCKED; } else { logger.flags &= ~forge.log.LEVEL_LOCKED; } }; /** * Adds a logger. * * @param logger the logger object. */ forge.log.addLogger = function(logger) { sLoggers.push(logger); }; // setup the console logger if possible, else create fake console.log if(typeof(console) !== 'undefined' && 'log' in console) { var logger; if(console.error && console.warn && console.info && console.debug) { // looks like Firebug-style logging is available // level handlers map var levelHandlers = { error: console.error, warning: console.warn, info: console.info, debug: console.debug, verbose: console.debug }; var f = function(logger, message) { forge.log.prepareStandard(message); var handler = levelHandlers[message.level]; // prepend standard message and concat args var args = [message.standard]; args = args.concat(message['arguments'].slice()); // apply to low-level console function handler.apply(console, args); }; logger = forge.log.makeLogger(f); } else { // only appear to have basic console.log var f = function(logger, message) { forge.log.prepareStandardFull(message); console.log(message.standardFull); }; logger = forge.log.makeLogger(f); } forge.log.setLevel(logger, 'debug'); forge.log.addLogger(logger); sConsoleLogger = logger; } else { // define fake console.log to avoid potential script errors on // browsers that do not have console logging console = { log: function() {} }; } /* * Check for logging control query vars. * * console.level= * Set's the console log level by name. Useful to override defaults and * allow more verbose logging before a user config is loaded. * * console.lock= * Lock the console log level at whatever level it is set at. This is run * after console.level is processed. Useful to force a level of verbosity * that could otherwise be limited by a user config. */ if(sConsoleLogger !== null) { var query = forge.util.getQueryVariables(); if('console.level' in query) { // set with last value forge.log.setLevel( sConsoleLogger, query['console.level'].slice(-1)[0]); } if('console.lock' in query) { // set with last value var lock = query['console.lock'].slice(-1)[0]; if(lock == 'true') { forge.log.lock(sConsoleLogger); } } } // provide public access to console logger forge.log.consoleLogger = sConsoleLogger; /***/ }), /***/ 51145: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Node.js module for all known Forge message digests. * * @author Dave Longley * * Copyright 2011-2017 Digital Bazaar, Inc. */ module.exports = __webpack_require__(86231); __webpack_require__(86594); __webpack_require__(90279); __webpack_require__(80953); __webpack_require__(59542); /***/ }), /***/ 86231: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Node.js module for Forge message digests. * * @author Dave Longley * * Copyright 2011-2017 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); module.exports = forge.md = forge.md || {}; forge.md.algorithms = forge.md.algorithms || {}; /***/ }), /***/ 86594: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Message Digest Algorithm 5 with 128-bit digest (MD5) implementation. * * @author Dave Longley * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(86231); __webpack_require__(28339); var md5 = module.exports = forge.md5 = forge.md5 || {}; forge.md.md5 = forge.md.algorithms.md5 = md5; /** * Creates an MD5 message digest object. * * @return a message digest object. */ md5.create = function() { // do initialization as necessary if(!_initialized) { _init(); } // MD5 state contains four 32-bit integers var _state = null; // input buffer var _input = forge.util.createBuffer(); // used for word storage var _w = new Array(16); // message digest object var md = { algorithm: 'md5', blockLength: 64, digestLength: 16, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length fullMessageLength: null, // size of message length in bytes messageLengthSize: 8 }; /** * Starts the digest. * * @return this digest object. */ md.start = function() { // up to 56-bit message length for convenience md.messageLength = 0; // full message length (set md.messageLength64 for backwards-compatibility) md.fullMessageLength = md.messageLength64 = []; var int32s = md.messageLengthSize / 4; for(var i = 0; i < int32s; ++i) { md.fullMessageLength.push(0); } _input = forge.util.createBuffer(); _state = { h0: 0x67452301, h1: 0xEFCDAB89, h2: 0x98BADCFE, h3: 0x10325476 }; return md; }; // start digest automatically for first time md.start(); /** * Updates the digest with the given message input. The given input can * treated as raw input (no encoding will be applied) or an encoding of * 'utf8' maybe given to encode the input using UTF-8. * * @param msg the message input to update with. * @param encoding the encoding to use (default: 'raw', other: 'utf8'). * * @return this digest object. */ md.update = function(msg, encoding) { if(encoding === 'utf8') { msg = forge.util.encodeUtf8(msg); } // update message length var len = msg.length; md.messageLength += len; len = [(len / 0x100000000) >>> 0, len >>> 0]; for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { md.fullMessageLength[i] += len[1]; len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; len[0] = (len[1] / 0x100000000) >>> 0; } // add bytes to input buffer _input.putBytes(msg); // process bytes _update(_state, _w, _input); // compact input buffer every 2K or if empty if(_input.read > 2048 || _input.length() === 0) { _input.compact(); } return md; }; /** * Produces the digest. * * @return a byte buffer containing the digest value. */ md.digest = function() { /* Note: Here we copy the remaining bytes in the input buffer and add the appropriate MD5 padding. Then we do the final update on a copy of the state so that if the user wants to get intermediate digests they can do so. */ /* Determine the number of bytes that must be added to the message to ensure its length is congruent to 448 mod 512. In other words, the data to be digested must be a multiple of 512 bits (or 128 bytes). This data includes the message, some padding, and the length of the message. Since the length of the message will be encoded as 8 bytes (64 bits), that means that the last segment of the data must have 56 bytes (448 bits) of message and padding. Therefore, the length of the message plus the padding must be congruent to 448 mod 512 because 512 - 128 = 448. In order to fill up the message length it must be filled with padding that begins with 1 bit followed by all 0 bits. Padding must *always* be present, so if the message length is already congruent to 448 mod 512, then 512 padding bits must be added. */ var finalBlock = forge.util.createBuffer(); finalBlock.putBytes(_input.bytes()); // compute remaining size to be digested (include message length size) var remaining = ( md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize); // add padding for overflow blockSize - overflow // _padding starts with 1 byte with first bit is set (byte value 128), then // there may be up to (blockSize - 1) other pad bytes var overflow = remaining & (md.blockLength - 1); finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); // serialize message length in bits in little-endian order; since length // is stored in bytes we multiply by 8 and add carry var bits, carry = 0; for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { bits = md.fullMessageLength[i] * 8 + carry; carry = (bits / 0x100000000) >>> 0; finalBlock.putInt32Le(bits >>> 0); } var s2 = { h0: _state.h0, h1: _state.h1, h2: _state.h2, h3: _state.h3 }; _update(s2, _w, finalBlock); var rval = forge.util.createBuffer(); rval.putInt32Le(s2.h0); rval.putInt32Le(s2.h1); rval.putInt32Le(s2.h2); rval.putInt32Le(s2.h3); return rval; }; return md; }; // padding, constant tables for calculating md5 var _padding = null; var _g = null; var _r = null; var _k = null; var _initialized = false; /** * Initializes the constant tables. */ function _init() { // create padding _padding = String.fromCharCode(128); _padding += forge.util.fillString(String.fromCharCode(0x00), 64); // g values _g = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9]; // rounds table _r = [ 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]; // get the result of abs(sin(i + 1)) as a 32-bit integer _k = new Array(64); for(var i = 0; i < 64; ++i) { _k[i] = Math.floor(Math.abs(Math.sin(i + 1)) * 0x100000000); } // now initialized _initialized = true; } /** * Updates an MD5 state with the given byte buffer. * * @param s the MD5 state to update. * @param w the array to use to store words. * @param bytes the byte buffer to update with. */ function _update(s, w, bytes) { // consume 512 bit (64 byte) chunks var t, a, b, c, d, f, r, i; var len = bytes.length(); while(len >= 64) { // initialize hash value for this chunk a = s.h0; b = s.h1; c = s.h2; d = s.h3; // round 1 for(i = 0; i < 16; ++i) { w[i] = bytes.getInt32Le(); f = d ^ (b & (c ^ d)); t = (a + f + _k[i] + w[i]); r = _r[i]; a = d; d = c; c = b; b += (t << r) | (t >>> (32 - r)); } // round 2 for(; i < 32; ++i) { f = c ^ (d & (b ^ c)); t = (a + f + _k[i] + w[_g[i]]); r = _r[i]; a = d; d = c; c = b; b += (t << r) | (t >>> (32 - r)); } // round 3 for(; i < 48; ++i) { f = b ^ c ^ d; t = (a + f + _k[i] + w[_g[i]]); r = _r[i]; a = d; d = c; c = b; b += (t << r) | (t >>> (32 - r)); } // round 4 for(; i < 64; ++i) { f = c ^ (b | ~d); t = (a + f + _k[i] + w[_g[i]]); r = _r[i]; a = d; d = c; c = b; b += (t << r) | (t >>> (32 - r)); } // update hash state s.h0 = (s.h0 + a) | 0; s.h1 = (s.h1 + b) | 0; s.h2 = (s.h2 + c) | 0; s.h3 = (s.h3 + d) | 0; len -= 64; } } /***/ }), /***/ 27973: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Node.js module for Forge mask generation functions. * * @author Stefan Siegl * * Copyright 2012 Stefan Siegl */ var forge = __webpack_require__(89177); __webpack_require__(73339); module.exports = forge.mgf = forge.mgf || {}; forge.mgf.mgf1 = forge.mgf1; /***/ }), /***/ 73339: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of mask generation function MGF1. * * @author Stefan Siegl * @author Dave Longley * * Copyright (c) 2012 Stefan Siegl * Copyright (c) 2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(28339); forge.mgf = forge.mgf || {}; var mgf1 = module.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {}; /** * Creates a MGF1 mask generation function object. * * @param md the message digest API to use (eg: forge.md.sha1.create()). * * @return a mask generation function object. */ mgf1.create = function(md) { var mgf = { /** * Generate mask of specified length. * * @param {String} seed The seed for mask generation. * @param maskLen Number of bytes to generate. * @return {String} The generated mask. */ generate: function(seed, maskLen) { /* 2. Let T be the empty octet string. */ var t = new forge.util.ByteBuffer(); /* 3. For counter from 0 to ceil(maskLen / hLen), do the following: */ var len = Math.ceil(maskLen / md.digestLength); for(var i = 0; i < len; i++) { /* a. Convert counter to an octet string C of length 4 octets */ var c = new forge.util.ByteBuffer(); c.putInt32(i); /* b. Concatenate the hash of the seed mgfSeed and C to the octet * string T: */ md.start(); md.update(seed + c.getBytes()); t.putBuffer(md.digest()); } /* Output the leading maskLen octets of T as the octet string mask. */ t.truncate(t.length() - maskLen); return t.getBytes(); } }; return mgf; }; /***/ }), /***/ 81925: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Object IDs for ASN.1. * * @author Dave Longley * * Copyright (c) 2010-2013 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); forge.pki = forge.pki || {}; var oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {}; // set id to name mapping and name to id mapping function _IN(id, name) { oids[id] = name; oids[name] = id; } // set id to name mapping only function _I_(id, name) { oids[id] = name; } // algorithm OIDs _IN('1.2.840.113549.1.1.1', 'rsaEncryption'); // Note: md2 & md4 not implemented //_IN('1.2.840.113549.1.1.2', 'md2WithRSAEncryption'); //_IN('1.2.840.113549.1.1.3', 'md4WithRSAEncryption'); _IN('1.2.840.113549.1.1.4', 'md5WithRSAEncryption'); _IN('1.2.840.113549.1.1.5', 'sha1WithRSAEncryption'); _IN('1.2.840.113549.1.1.7', 'RSAES-OAEP'); _IN('1.2.840.113549.1.1.8', 'mgf1'); _IN('1.2.840.113549.1.1.9', 'pSpecified'); _IN('1.2.840.113549.1.1.10', 'RSASSA-PSS'); _IN('1.2.840.113549.1.1.11', 'sha256WithRSAEncryption'); _IN('1.2.840.113549.1.1.12', 'sha384WithRSAEncryption'); _IN('1.2.840.113549.1.1.13', 'sha512WithRSAEncryption'); // Edwards-curve Digital Signature Algorithm (EdDSA) Ed25519 _IN('1.3.101.112', 'EdDSA25519'); _IN('1.2.840.10040.4.3', 'dsa-with-sha1'); _IN('1.3.14.3.2.7', 'desCBC'); _IN('1.3.14.3.2.26', 'sha1'); _IN('2.16.840.1.101.3.4.2.1', 'sha256'); _IN('2.16.840.1.101.3.4.2.2', 'sha384'); _IN('2.16.840.1.101.3.4.2.3', 'sha512'); _IN('1.2.840.113549.2.5', 'md5'); // pkcs#7 content types _IN('1.2.840.113549.1.7.1', 'data'); _IN('1.2.840.113549.1.7.2', 'signedData'); _IN('1.2.840.113549.1.7.3', 'envelopedData'); _IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData'); _IN('1.2.840.113549.1.7.5', 'digestedData'); _IN('1.2.840.113549.1.7.6', 'encryptedData'); // pkcs#9 oids _IN('1.2.840.113549.1.9.1', 'emailAddress'); _IN('1.2.840.113549.1.9.2', 'unstructuredName'); _IN('1.2.840.113549.1.9.3', 'contentType'); _IN('1.2.840.113549.1.9.4', 'messageDigest'); _IN('1.2.840.113549.1.9.5', 'signingTime'); _IN('1.2.840.113549.1.9.6', 'counterSignature'); _IN('1.2.840.113549.1.9.7', 'challengePassword'); _IN('1.2.840.113549.1.9.8', 'unstructuredAddress'); _IN('1.2.840.113549.1.9.14', 'extensionRequest'); _IN('1.2.840.113549.1.9.20', 'friendlyName'); _IN('1.2.840.113549.1.9.21', 'localKeyId'); _IN('1.2.840.113549.1.9.22.1', 'x509Certificate'); // pkcs#12 safe bags _IN('1.2.840.113549.1.12.10.1.1', 'keyBag'); _IN('1.2.840.113549.1.12.10.1.2', 'pkcs8ShroudedKeyBag'); _IN('1.2.840.113549.1.12.10.1.3', 'certBag'); _IN('1.2.840.113549.1.12.10.1.4', 'crlBag'); _IN('1.2.840.113549.1.12.10.1.5', 'secretBag'); _IN('1.2.840.113549.1.12.10.1.6', 'safeContentsBag'); // password-based-encryption for pkcs#12 _IN('1.2.840.113549.1.5.13', 'pkcs5PBES2'); _IN('1.2.840.113549.1.5.12', 'pkcs5PBKDF2'); _IN('1.2.840.113549.1.12.1.1', 'pbeWithSHAAnd128BitRC4'); _IN('1.2.840.113549.1.12.1.2', 'pbeWithSHAAnd40BitRC4'); _IN('1.2.840.113549.1.12.1.3', 'pbeWithSHAAnd3-KeyTripleDES-CBC'); _IN('1.2.840.113549.1.12.1.4', 'pbeWithSHAAnd2-KeyTripleDES-CBC'); _IN('1.2.840.113549.1.12.1.5', 'pbeWithSHAAnd128BitRC2-CBC'); _IN('1.2.840.113549.1.12.1.6', 'pbewithSHAAnd40BitRC2-CBC'); // hmac OIDs _IN('1.2.840.113549.2.7', 'hmacWithSHA1'); _IN('1.2.840.113549.2.8', 'hmacWithSHA224'); _IN('1.2.840.113549.2.9', 'hmacWithSHA256'); _IN('1.2.840.113549.2.10', 'hmacWithSHA384'); _IN('1.2.840.113549.2.11', 'hmacWithSHA512'); // symmetric key algorithm oids _IN('1.2.840.113549.3.7', 'des-EDE3-CBC'); _IN('2.16.840.1.101.3.4.1.2', 'aes128-CBC'); _IN('2.16.840.1.101.3.4.1.22', 'aes192-CBC'); _IN('2.16.840.1.101.3.4.1.42', 'aes256-CBC'); // certificate issuer/subject OIDs _IN('2.5.4.3', 'commonName'); _IN('2.5.4.5', 'serialName'); _IN('2.5.4.6', 'countryName'); _IN('2.5.4.7', 'localityName'); _IN('2.5.4.8', 'stateOrProvinceName'); _IN('2.5.4.9', 'streetAddress'); _IN('2.5.4.10', 'organizationName'); _IN('2.5.4.11', 'organizationalUnitName'); _IN('2.5.4.13', 'description'); _IN('2.5.4.15', 'businessCategory'); _IN('2.5.4.17', 'postalCode'); _IN('1.3.6.1.4.1.311.60.2.1.2', 'jurisdictionOfIncorporationStateOrProvinceName'); _IN('1.3.6.1.4.1.311.60.2.1.3', 'jurisdictionOfIncorporationCountryName'); // X.509 extension OIDs _IN('2.16.840.1.113730.1.1', 'nsCertType'); _IN('2.16.840.1.113730.1.13', 'nsComment'); // deprecated in theory; still widely used _I_('2.5.29.1', 'authorityKeyIdentifier'); // deprecated, use .35 _I_('2.5.29.2', 'keyAttributes'); // obsolete use .37 or .15 _I_('2.5.29.3', 'certificatePolicies'); // deprecated, use .32 _I_('2.5.29.4', 'keyUsageRestriction'); // obsolete use .37 or .15 _I_('2.5.29.5', 'policyMapping'); // deprecated use .33 _I_('2.5.29.6', 'subtreesConstraint'); // obsolete use .30 _I_('2.5.29.7', 'subjectAltName'); // deprecated use .17 _I_('2.5.29.8', 'issuerAltName'); // deprecated use .18 _I_('2.5.29.9', 'subjectDirectoryAttributes'); _I_('2.5.29.10', 'basicConstraints'); // deprecated use .19 _I_('2.5.29.11', 'nameConstraints'); // deprecated use .30 _I_('2.5.29.12', 'policyConstraints'); // deprecated use .36 _I_('2.5.29.13', 'basicConstraints'); // deprecated use .19 _IN('2.5.29.14', 'subjectKeyIdentifier'); _IN('2.5.29.15', 'keyUsage'); _I_('2.5.29.16', 'privateKeyUsagePeriod'); _IN('2.5.29.17', 'subjectAltName'); _IN('2.5.29.18', 'issuerAltName'); _IN('2.5.29.19', 'basicConstraints'); _I_('2.5.29.20', 'cRLNumber'); _I_('2.5.29.21', 'cRLReason'); _I_('2.5.29.22', 'expirationDate'); _I_('2.5.29.23', 'instructionCode'); _I_('2.5.29.24', 'invalidityDate'); _I_('2.5.29.25', 'cRLDistributionPoints'); // deprecated use .31 _I_('2.5.29.26', 'issuingDistributionPoint'); // deprecated use .28 _I_('2.5.29.27', 'deltaCRLIndicator'); _I_('2.5.29.28', 'issuingDistributionPoint'); _I_('2.5.29.29', 'certificateIssuer'); _I_('2.5.29.30', 'nameConstraints'); _IN('2.5.29.31', 'cRLDistributionPoints'); _IN('2.5.29.32', 'certificatePolicies'); _I_('2.5.29.33', 'policyMappings'); _I_('2.5.29.34', 'policyConstraints'); // deprecated use .36 _IN('2.5.29.35', 'authorityKeyIdentifier'); _I_('2.5.29.36', 'policyConstraints'); _IN('2.5.29.37', 'extKeyUsage'); _I_('2.5.29.46', 'freshestCRL'); _I_('2.5.29.54', 'inhibitAnyPolicy'); // extKeyUsage purposes _IN('1.3.6.1.4.1.11129.2.4.2', 'timestampList'); _IN('1.3.6.1.5.5.7.1.1', 'authorityInfoAccess'); _IN('1.3.6.1.5.5.7.3.1', 'serverAuth'); _IN('1.3.6.1.5.5.7.3.2', 'clientAuth'); _IN('1.3.6.1.5.5.7.3.3', 'codeSigning'); _IN('1.3.6.1.5.5.7.3.4', 'emailProtection'); _IN('1.3.6.1.5.5.7.3.8', 'timeStamping'); /***/ }), /***/ 21281: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Password-based encryption functions. * * @author Dave Longley * @author Stefan Siegl * * Copyright (c) 2010-2013 Digital Bazaar, Inc. * Copyright (c) 2012 Stefan Siegl * * An EncryptedPrivateKeyInfo: * * EncryptedPrivateKeyInfo ::= SEQUENCE { * encryptionAlgorithm EncryptionAlgorithmIdentifier, * encryptedData EncryptedData } * * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier * * EncryptedData ::= OCTET STRING */ var forge = __webpack_require__(89177); __webpack_require__(87994); __webpack_require__(39549); __webpack_require__(97157); __webpack_require__(86231); __webpack_require__(81925); __webpack_require__(98474); __webpack_require__(70154); __webpack_require__(57821); __webpack_require__(39965); __webpack_require__(53921); __webpack_require__(28339); if(typeof BigInteger === 'undefined') { var BigInteger = forge.jsbn.BigInteger; } // shortcut for asn.1 API var asn1 = forge.asn1; /* Password-based encryption implementation. */ var pki = forge.pki = forge.pki || {}; module.exports = pki.pbe = forge.pbe = forge.pbe || {}; var oids = pki.oids; // validator for an EncryptedPrivateKeyInfo structure // Note: Currently only works w/algorithm params var encryptedPrivateKeyValidator = { name: 'EncryptedPrivateKeyInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'EncryptedPrivateKeyInfo.encryptionAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'AlgorithmIdentifier.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'encryptionOid' }, { name: 'AlgorithmIdentifier.parameters', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'encryptionParams' }] }, { // encryptedData name: 'EncryptedPrivateKeyInfo.encryptedData', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'encryptedData' }] }; // validator for a PBES2Algorithms structure // Note: Currently only works w/PBKDF2 + AES encryption schemes var PBES2AlgorithmsValidator = { name: 'PBES2Algorithms', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'PBES2Algorithms.keyDerivationFunc', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'PBES2Algorithms.keyDerivationFunc.oid', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'kdfOid' }, { name: 'PBES2Algorithms.params', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'PBES2Algorithms.params.salt', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'kdfSalt' }, { name: 'PBES2Algorithms.params.iterationCount', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'kdfIterationCount' }, { name: 'PBES2Algorithms.params.keyLength', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, optional: true, capture: 'keyLength' }, { // prf name: 'PBES2Algorithms.params.prf', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, optional: true, value: [{ name: 'PBES2Algorithms.params.prf.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'prfOid' }] }] }] }, { name: 'PBES2Algorithms.encryptionScheme', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'PBES2Algorithms.encryptionScheme.oid', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'encOid' }, { name: 'PBES2Algorithms.encryptionScheme.iv', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'encIv' }] }] }; var pkcs12PbeParamsValidator = { name: 'pkcs-12PbeParams', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'pkcs-12PbeParams.salt', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'salt' }, { name: 'pkcs-12PbeParams.iterations', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'iterations' }] }; /** * Encrypts a ASN.1 PrivateKeyInfo object, producing an EncryptedPrivateKeyInfo. * * PBES2Algorithms ALGORITHM-IDENTIFIER ::= * { {PBES2-params IDENTIFIED BY id-PBES2}, ...} * * id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} * * PBES2-params ::= SEQUENCE { * keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}}, * encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} * } * * PBES2-KDFs ALGORITHM-IDENTIFIER ::= * { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... } * * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... } * * PBKDF2-params ::= SEQUENCE { * salt CHOICE { * specified OCTET STRING, * otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}} * }, * iterationCount INTEGER (1..MAX), * keyLength INTEGER (1..MAX) OPTIONAL, * prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 * } * * @param obj the ASN.1 PrivateKeyInfo object. * @param password the password to encrypt with. * @param options: * algorithm the encryption algorithm to use * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'. * count the iteration count to use. * saltSize the salt size to use. * prfAlgorithm the PRF message digest algorithm to use * ('sha1', 'sha224', 'sha256', 'sha384', 'sha512') * * @return the ASN.1 EncryptedPrivateKeyInfo. */ pki.encryptPrivateKeyInfo = function(obj, password, options) { // set default options options = options || {}; options.saltSize = options.saltSize || 8; options.count = options.count || 2048; options.algorithm = options.algorithm || 'aes128'; options.prfAlgorithm = options.prfAlgorithm || 'sha1'; // generate PBE params var salt = forge.random.getBytesSync(options.saltSize); var count = options.count; var countBytes = asn1.integerToDer(count); var dkLen; var encryptionAlgorithm; var encryptedData; if(options.algorithm.indexOf('aes') === 0 || options.algorithm === 'des') { // do PBES2 var ivLen, encOid, cipherFn; switch(options.algorithm) { case 'aes128': dkLen = 16; ivLen = 16; encOid = oids['aes128-CBC']; cipherFn = forge.aes.createEncryptionCipher; break; case 'aes192': dkLen = 24; ivLen = 16; encOid = oids['aes192-CBC']; cipherFn = forge.aes.createEncryptionCipher; break; case 'aes256': dkLen = 32; ivLen = 16; encOid = oids['aes256-CBC']; cipherFn = forge.aes.createEncryptionCipher; break; case 'des': dkLen = 8; ivLen = 8; encOid = oids['desCBC']; cipherFn = forge.des.createEncryptionCipher; break; default: var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); error.algorithm = options.algorithm; throw error; } // get PRF message digest var prfAlgorithm = 'hmacWith' + options.prfAlgorithm.toUpperCase(); var md = prfAlgorithmToMessageDigest(prfAlgorithm); // encrypt private key using pbe SHA-1 and AES/DES var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); var iv = forge.random.getBytesSync(ivLen); var cipher = cipherFn(dk); cipher.start(iv); cipher.update(asn1.toDer(obj)); cipher.finish(); encryptedData = cipher.output.getBytes(); // get PBKDF2-params var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm); encryptionAlgorithm = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oids['pkcs5PBES2']).getBytes()), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // keyDerivationFunc asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oids['pkcs5PBKDF2']).getBytes()), // PBKDF2-params params ]), // encryptionScheme asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(encOid).getBytes()), // iv asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, iv) ]) ]) ]); } else if(options.algorithm === '3des') { // Do PKCS12 PBE dkLen = 24; var saltBytes = new forge.util.ByteBuffer(salt); var dk = pki.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen); var iv = pki.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen); var cipher = forge.des.createEncryptionCipher(dk); cipher.start(iv); cipher.update(asn1.toDer(obj)); cipher.finish(); encryptedData = cipher.output.getBytes(); encryptionAlgorithm = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oids['pbeWithSHAAnd3-KeyTripleDES-CBC']).getBytes()), // pkcs-12PbeParams asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // salt asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), // iteration count asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, countBytes.getBytes()) ]) ]); } else { var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); error.algorithm = options.algorithm; throw error; } // EncryptedPrivateKeyInfo var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // encryptionAlgorithm encryptionAlgorithm, // encryptedData asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, encryptedData) ]); return rval; }; /** * Decrypts a ASN.1 PrivateKeyInfo object. * * @param obj the ASN.1 EncryptedPrivateKeyInfo object. * @param password the password to decrypt with. * * @return the ASN.1 PrivateKeyInfo on success, null on failure. */ pki.decryptPrivateKeyInfo = function(obj, password) { var rval = null; // get PBE params var capture = {}; var errors = []; if(!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) { var error = new Error('Cannot read encrypted private key. ' + 'ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); error.errors = errors; throw error; } // get cipher var oid = asn1.derToOid(capture.encryptionOid); var cipher = pki.pbe.getCipher(oid, capture.encryptionParams, password); // get encrypted data var encrypted = forge.util.createBuffer(capture.encryptedData); cipher.update(encrypted); if(cipher.finish()) { rval = asn1.fromDer(cipher.output); } return rval; }; /** * Converts a EncryptedPrivateKeyInfo to PEM format. * * @param epki the EncryptedPrivateKeyInfo. * @param maxline the maximum characters per line, defaults to 64. * * @return the PEM-formatted encrypted private key. */ pki.encryptedPrivateKeyToPem = function(epki, maxline) { // convert to DER, then PEM-encode var msg = { type: 'ENCRYPTED PRIVATE KEY', body: asn1.toDer(epki).getBytes() }; return forge.pem.encode(msg, {maxline: maxline}); }; /** * Converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format. Decryption * is not performed. * * @param pem the EncryptedPrivateKeyInfo in PEM-format. * * @return the ASN.1 EncryptedPrivateKeyInfo. */ pki.encryptedPrivateKeyFromPem = function(pem) { var msg = forge.pem.decode(pem)[0]; if(msg.type !== 'ENCRYPTED PRIVATE KEY') { var error = new Error('Could not convert encrypted private key from PEM; ' + 'PEM header type is "ENCRYPTED PRIVATE KEY".'); error.headerType = msg.type; throw error; } if(msg.procType && msg.procType.type === 'ENCRYPTED') { throw new Error('Could not convert encrypted private key from PEM; ' + 'PEM is encrypted.'); } // convert DER to ASN.1 object return asn1.fromDer(msg.body); }; /** * Encrypts an RSA private key. By default, the key will be wrapped in * a PrivateKeyInfo and encrypted to produce a PKCS#8 EncryptedPrivateKeyInfo. * This is the standard, preferred way to encrypt a private key. * * To produce a non-standard PEM-encrypted private key that uses encapsulated * headers to indicate the encryption algorithm (old-style non-PKCS#8 OpenSSL * private key encryption), set the 'legacy' option to true. Note: Using this * option will cause the iteration count to be forced to 1. * * Note: The 'des' algorithm is supported, but it is not considered to be * secure because it only uses a single 56-bit key. If possible, it is highly * recommended that a different algorithm be used. * * @param rsaKey the RSA key to encrypt. * @param password the password to use. * @param options: * algorithm: the encryption algorithm to use * ('aes128', 'aes192', 'aes256', '3des', 'des'). * count: the iteration count to use. * saltSize: the salt size to use. * legacy: output an old non-PKCS#8 PEM-encrypted+encapsulated * headers (DEK-Info) private key. * * @return the PEM-encoded ASN.1 EncryptedPrivateKeyInfo. */ pki.encryptRsaPrivateKey = function(rsaKey, password, options) { // standard PKCS#8 options = options || {}; if(!options.legacy) { // encrypt PrivateKeyInfo var rval = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(rsaKey)); rval = pki.encryptPrivateKeyInfo(rval, password, options); return pki.encryptedPrivateKeyToPem(rval); } // legacy non-PKCS#8 var algorithm; var iv; var dkLen; var cipherFn; switch(options.algorithm) { case 'aes128': algorithm = 'AES-128-CBC'; dkLen = 16; iv = forge.random.getBytesSync(16); cipherFn = forge.aes.createEncryptionCipher; break; case 'aes192': algorithm = 'AES-192-CBC'; dkLen = 24; iv = forge.random.getBytesSync(16); cipherFn = forge.aes.createEncryptionCipher; break; case 'aes256': algorithm = 'AES-256-CBC'; dkLen = 32; iv = forge.random.getBytesSync(16); cipherFn = forge.aes.createEncryptionCipher; break; case '3des': algorithm = 'DES-EDE3-CBC'; dkLen = 24; iv = forge.random.getBytesSync(8); cipherFn = forge.des.createEncryptionCipher; break; case 'des': algorithm = 'DES-CBC'; dkLen = 8; iv = forge.random.getBytesSync(8); cipherFn = forge.des.createEncryptionCipher; break; default: var error = new Error('Could not encrypt RSA private key; unsupported ' + 'encryption algorithm "' + options.algorithm + '".'); error.algorithm = options.algorithm; throw error; } // encrypt private key using OpenSSL legacy key derivation var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); var cipher = cipherFn(dk); cipher.start(iv); cipher.update(asn1.toDer(pki.privateKeyToAsn1(rsaKey))); cipher.finish(); var msg = { type: 'RSA PRIVATE KEY', procType: { version: '4', type: 'ENCRYPTED' }, dekInfo: { algorithm: algorithm, parameters: forge.util.bytesToHex(iv).toUpperCase() }, body: cipher.output.getBytes() }; return forge.pem.encode(msg); }; /** * Decrypts an RSA private key. * * @param pem the PEM-formatted EncryptedPrivateKeyInfo to decrypt. * @param password the password to use. * * @return the RSA key on success, null on failure. */ pki.decryptRsaPrivateKey = function(pem, password) { var rval = null; var msg = forge.pem.decode(pem)[0]; if(msg.type !== 'ENCRYPTED PRIVATE KEY' && msg.type !== 'PRIVATE KEY' && msg.type !== 'RSA PRIVATE KEY') { var error = new Error('Could not convert private key from PEM; PEM header type ' + 'is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'); error.headerType = error; throw error; } if(msg.procType && msg.procType.type === 'ENCRYPTED') { var dkLen; var cipherFn; switch(msg.dekInfo.algorithm) { case 'DES-CBC': dkLen = 8; cipherFn = forge.des.createDecryptionCipher; break; case 'DES-EDE3-CBC': dkLen = 24; cipherFn = forge.des.createDecryptionCipher; break; case 'AES-128-CBC': dkLen = 16; cipherFn = forge.aes.createDecryptionCipher; break; case 'AES-192-CBC': dkLen = 24; cipherFn = forge.aes.createDecryptionCipher; break; case 'AES-256-CBC': dkLen = 32; cipherFn = forge.aes.createDecryptionCipher; break; case 'RC2-40-CBC': dkLen = 5; cipherFn = function(key) { return forge.rc2.createDecryptionCipher(key, 40); }; break; case 'RC2-64-CBC': dkLen = 8; cipherFn = function(key) { return forge.rc2.createDecryptionCipher(key, 64); }; break; case 'RC2-128-CBC': dkLen = 16; cipherFn = function(key) { return forge.rc2.createDecryptionCipher(key, 128); }; break; default: var error = new Error('Could not decrypt private key; unsupported ' + 'encryption algorithm "' + msg.dekInfo.algorithm + '".'); error.algorithm = msg.dekInfo.algorithm; throw error; } // use OpenSSL legacy key derivation var iv = forge.util.hexToBytes(msg.dekInfo.parameters); var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); var cipher = cipherFn(dk); cipher.start(iv); cipher.update(forge.util.createBuffer(msg.body)); if(cipher.finish()) { rval = cipher.output.getBytes(); } else { return rval; } } else { rval = msg.body; } if(msg.type === 'ENCRYPTED PRIVATE KEY') { rval = pki.decryptPrivateKeyInfo(asn1.fromDer(rval), password); } else { // decryption already performed above rval = asn1.fromDer(rval); } if(rval !== null) { rval = pki.privateKeyFromAsn1(rval); } return rval; }; /** * Derives a PKCS#12 key. * * @param password the password to derive the key material from, null or * undefined for none. * @param salt the salt, as a ByteBuffer, to use. * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC). * @param iter the iteration count. * @param n the number of bytes to derive from the password. * @param md the message digest to use, defaults to SHA-1. * * @return a ByteBuffer with the bytes derived from the password. */ pki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) { var j, l; if(typeof md === 'undefined' || md === null) { if(!('sha1' in forge.md)) { throw new Error('"sha1" hash algorithm unavailable.'); } md = forge.md.sha1.create(); } var u = md.digestLength; var v = md.blockLength; var result = new forge.util.ByteBuffer(); /* Convert password to Unicode byte buffer + trailing 0-byte. */ var passBuf = new forge.util.ByteBuffer(); if(password !== null && password !== undefined) { for(l = 0; l < password.length; l++) { passBuf.putInt16(password.charCodeAt(l)); } passBuf.putInt16(0); } /* Length of salt and password in BYTES. */ var p = passBuf.length(); var s = salt.length(); /* 1. Construct a string, D (the "diversifier"), by concatenating v copies of ID. */ var D = new forge.util.ByteBuffer(); D.fillWithByte(id, v); /* 2. Concatenate copies of the salt together to create a string S of length v * ceil(s / v) bytes (the final copy of the salt may be trunacted to create S). Note that if the salt is the empty string, then so is S. */ var Slen = v * Math.ceil(s / v); var S = new forge.util.ByteBuffer(); for(l = 0; l < Slen; l++) { S.putByte(salt.at(l % s)); } /* 3. Concatenate copies of the password together to create a string P of length v * ceil(p / v) bytes (the final copy of the password may be truncated to create P). Note that if the password is the empty string, then so is P. */ var Plen = v * Math.ceil(p / v); var P = new forge.util.ByteBuffer(); for(l = 0; l < Plen; l++) { P.putByte(passBuf.at(l % p)); } /* 4. Set I=S||P to be the concatenation of S and P. */ var I = S; I.putBuffer(P); /* 5. Set c=ceil(n / u). */ var c = Math.ceil(n / u); /* 6. For i=1, 2, ..., c, do the following: */ for(var i = 1; i <= c; i++) { /* a) Set Ai=H^r(D||I). (l.e. the rth hash of D||I, H(H(H(...H(D||I)))) */ var buf = new forge.util.ByteBuffer(); buf.putBytes(D.bytes()); buf.putBytes(I.bytes()); for(var round = 0; round < iter; round++) { md.start(); md.update(buf.getBytes()); buf = md.digest(); } /* b) Concatenate copies of Ai to create a string B of length v bytes (the final copy of Ai may be truncated to create B). */ var B = new forge.util.ByteBuffer(); for(l = 0; l < v; l++) { B.putByte(buf.at(l % u)); } /* c) Treating I as a concatenation I0, I1, ..., Ik-1 of v-byte blocks, where k=ceil(s / v) + ceil(p / v), modify I by setting Ij=(Ij+B+1) mod 2v for each j. */ var k = Math.ceil(s / v) + Math.ceil(p / v); var Inew = new forge.util.ByteBuffer(); for(j = 0; j < k; j++) { var chunk = new forge.util.ByteBuffer(I.getBytes(v)); var x = 0x1ff; for(l = B.length() - 1; l >= 0; l--) { x = x >> 8; x += B.at(l) + chunk.at(l); chunk.setAt(l, x & 0xff); } Inew.putBuffer(chunk); } I = Inew; /* Add Ai to A. */ result.putBuffer(buf); } result.truncate(result.length() - n); return result; }; /** * Get new Forge cipher object instance. * * @param oid the OID (in string notation). * @param params the ASN.1 params object. * @param password the password to decrypt with. * * @return new cipher object instance. */ pki.pbe.getCipher = function(oid, params, password) { switch(oid) { case pki.oids['pkcs5PBES2']: return pki.pbe.getCipherForPBES2(oid, params, password); case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: case pki.oids['pbewithSHAAnd40BitRC2-CBC']: return pki.pbe.getCipherForPKCS12PBE(oid, params, password); default: var error = new Error('Cannot read encrypted PBE data block. Unsupported OID.'); error.oid = oid; error.supportedOids = [ 'pkcs5PBES2', 'pbeWithSHAAnd3-KeyTripleDES-CBC', 'pbewithSHAAnd40BitRC2-CBC' ]; throw error; } }; /** * Get new Forge cipher object instance according to PBES2 params block. * * The returned cipher instance is already started using the IV * from PBES2 parameter block. * * @param oid the PKCS#5 PBKDF2 OID (in string notation). * @param params the ASN.1 PBES2-params object. * @param password the password to decrypt with. * * @return new cipher object instance. */ pki.pbe.getCipherForPBES2 = function(oid, params, password) { // get PBE params var capture = {}; var errors = []; if(!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) { var error = new Error('Cannot read password-based-encryption algorithm ' + 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); error.errors = errors; throw error; } // check oids oid = asn1.derToOid(capture.kdfOid); if(oid !== pki.oids['pkcs5PBKDF2']) { var error = new Error('Cannot read encrypted private key. ' + 'Unsupported key derivation function OID.'); error.oid = oid; error.supportedOids = ['pkcs5PBKDF2']; throw error; } oid = asn1.derToOid(capture.encOid); if(oid !== pki.oids['aes128-CBC'] && oid !== pki.oids['aes192-CBC'] && oid !== pki.oids['aes256-CBC'] && oid !== pki.oids['des-EDE3-CBC'] && oid !== pki.oids['desCBC']) { var error = new Error('Cannot read encrypted private key. ' + 'Unsupported encryption scheme OID.'); error.oid = oid; error.supportedOids = [ 'aes128-CBC', 'aes192-CBC', 'aes256-CBC', 'des-EDE3-CBC', 'desCBC']; throw error; } // set PBE params var salt = capture.kdfSalt; var count = forge.util.createBuffer(capture.kdfIterationCount); count = count.getInt(count.length() << 3); var dkLen; var cipherFn; switch(pki.oids[oid]) { case 'aes128-CBC': dkLen = 16; cipherFn = forge.aes.createDecryptionCipher; break; case 'aes192-CBC': dkLen = 24; cipherFn = forge.aes.createDecryptionCipher; break; case 'aes256-CBC': dkLen = 32; cipherFn = forge.aes.createDecryptionCipher; break; case 'des-EDE3-CBC': dkLen = 24; cipherFn = forge.des.createDecryptionCipher; break; case 'desCBC': dkLen = 8; cipherFn = forge.des.createDecryptionCipher; break; } // get PRF message digest var md = prfOidToMessageDigest(capture.prfOid); // decrypt private key using pbe with chosen PRF and AES/DES var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); var iv = capture.encIv; var cipher = cipherFn(dk); cipher.start(iv); return cipher; }; /** * Get new Forge cipher object instance for PKCS#12 PBE. * * The returned cipher instance is already started using the key & IV * derived from the provided password and PKCS#12 PBE salt. * * @param oid The PKCS#12 PBE OID (in string notation). * @param params The ASN.1 PKCS#12 PBE-params object. * @param password The password to decrypt with. * * @return the new cipher object instance. */ pki.pbe.getCipherForPKCS12PBE = function(oid, params, password) { // get PBE params var capture = {}; var errors = []; if(!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) { var error = new Error('Cannot read password-based-encryption algorithm ' + 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); error.errors = errors; throw error; } var salt = forge.util.createBuffer(capture.salt); var count = forge.util.createBuffer(capture.iterations); count = count.getInt(count.length() << 3); var dkLen, dIvLen, cipherFn; switch(oid) { case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: dkLen = 24; dIvLen = 8; cipherFn = forge.des.startDecrypting; break; case pki.oids['pbewithSHAAnd40BitRC2-CBC']: dkLen = 5; dIvLen = 8; cipherFn = function(key, iv) { var cipher = forge.rc2.createDecryptionCipher(key, 40); cipher.start(iv, null); return cipher; }; break; default: var error = new Error('Cannot read PKCS #12 PBE data block. Unsupported OID.'); error.oid = oid; throw error; } // get PRF message digest var md = prfOidToMessageDigest(capture.prfOid); var key = pki.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md); md.start(); var iv = pki.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md); return cipherFn(key, iv); }; /** * OpenSSL's legacy key derivation function. * * See: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html * * @param password the password to derive the key from. * @param salt the salt to use, null for none. * @param dkLen the number of bytes needed for the derived key. * @param [options] the options to use: * [md] an optional message digest object to use. */ pki.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) { if(typeof md === 'undefined' || md === null) { if(!('md5' in forge.md)) { throw new Error('"md5" hash algorithm unavailable.'); } md = forge.md.md5.create(); } if(salt === null) { salt = ''; } var digests = [hash(md, password + salt)]; for(var length = 16, i = 1; length < dkLen; ++i, length += 16) { digests.push(hash(md, digests[i - 1] + password + salt)); } return digests.join('').substr(0, dkLen); }; function hash(md, bytes) { return md.start().update(bytes).digest().getBytes(); } function prfOidToMessageDigest(prfOid) { // get PRF algorithm, default to SHA-1 var prfAlgorithm; if(!prfOid) { prfAlgorithm = 'hmacWithSHA1'; } else { prfAlgorithm = pki.oids[asn1.derToOid(prfOid)]; if(!prfAlgorithm) { var error = new Error('Unsupported PRF OID.'); error.oid = prfOid; error.supported = [ 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', 'hmacWithSHA512']; throw error; } } return prfAlgorithmToMessageDigest(prfAlgorithm); } function prfAlgorithmToMessageDigest(prfAlgorithm) { var factory = forge.md; switch(prfAlgorithm) { case 'hmacWithSHA224': factory = forge.md.sha512; case 'hmacWithSHA1': case 'hmacWithSHA256': case 'hmacWithSHA384': case 'hmacWithSHA512': prfAlgorithm = prfAlgorithm.substr(8).toLowerCase(); break; default: var error = new Error('Unsupported PRF algorithm.'); error.algorithm = prfAlgorithm; error.supported = [ 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', 'hmacWithSHA512']; throw error; } if(!factory || !(prfAlgorithm in factory)) { throw new Error('Unknown hash algorithm: ' + prfAlgorithm); } return factory[prfAlgorithm].create(); } function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // salt asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), // iteration count asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, countBytes.getBytes()) ]); // when PRF algorithm is not SHA-1 default, add key length and PRF algorithm if(prfAlgorithm !== 'hmacWithSHA1') { params.value.push( // key length asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, forge.util.hexToBytes(dkLen.toString(16))), // AlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids[prfAlgorithm]).getBytes()), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ])); } return params; } /***/ }), /***/ 98474: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Password-Based Key-Derivation Function #2 implementation. * * See RFC 2898 for details. * * @author Dave Longley * * Copyright (c) 2010-2013 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(95104); __webpack_require__(86231); __webpack_require__(28339); var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; var crypto; if(forge.util.isNodejs && !forge.options.usePureJavaScript) { crypto = __webpack_require__(76417); } /** * Derives a key from a password. * * @param p the password as a binary-encoded string of bytes. * @param s the salt as a binary-encoded string of bytes. * @param c the iteration count, a positive integer. * @param dkLen the intended length, in bytes, of the derived key, * (max: 2^32 - 1) * hash length of the PRF. * @param [md] the message digest (or algorithm identifier as a string) to use * in the PRF, defaults to SHA-1. * @param [callback(err, key)] presence triggers asynchronous version, called * once the operation completes. * * @return the derived key, as a binary-encoded string of bytes, for the * synchronous version (if no callback is specified). */ module.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function( p, s, c, dkLen, md, callback) { if(typeof md === 'function') { callback = md; md = null; } // use native implementation if possible and not disabled, note that // some node versions only support SHA-1, others allow digest to be changed if(forge.util.isNodejs && !forge.options.usePureJavaScript && crypto.pbkdf2 && (md === null || typeof md !== 'object') && (crypto.pbkdf2Sync.length > 4 || (!md || md === 'sha1'))) { if(typeof md !== 'string') { // default prf to SHA-1 md = 'sha1'; } p = Buffer.from(p, 'binary'); s = Buffer.from(s, 'binary'); if(!callback) { if(crypto.pbkdf2Sync.length === 4) { return crypto.pbkdf2Sync(p, s, c, dkLen).toString('binary'); } return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString('binary'); } if(crypto.pbkdf2Sync.length === 4) { return crypto.pbkdf2(p, s, c, dkLen, function(err, key) { if(err) { return callback(err); } callback(null, key.toString('binary')); }); } return crypto.pbkdf2(p, s, c, dkLen, md, function(err, key) { if(err) { return callback(err); } callback(null, key.toString('binary')); }); } if(typeof md === 'undefined' || md === null) { // default prf to SHA-1 md = 'sha1'; } if(typeof md === 'string') { if(!(md in forge.md.algorithms)) { throw new Error('Unknown hash algorithm: ' + md); } md = forge.md[md].create(); } var hLen = md.digestLength; /* 1. If dkLen > (2^32 - 1) * hLen, output "derived key too long" and stop. */ if(dkLen > (0xFFFFFFFF * hLen)) { var err = new Error('Derived key is too long.'); if(callback) { return callback(err); } throw err; } /* 2. Let len be the number of hLen-octet blocks in the derived key, rounding up, and let r be the number of octets in the last block: len = CEIL(dkLen / hLen), r = dkLen - (len - 1) * hLen. */ var len = Math.ceil(dkLen / hLen); var r = dkLen - (len - 1) * hLen; /* 3. For each block of the derived key apply the function F defined below to the password P, the salt S, the iteration count c, and the block index to compute the block: T_1 = F(P, S, c, 1), T_2 = F(P, S, c, 2), ... T_len = F(P, S, c, len), where the function F is defined as the exclusive-or sum of the first c iterates of the underlying pseudorandom function PRF applied to the password P and the concatenation of the salt S and the block index i: F(P, S, c, i) = u_1 XOR u_2 XOR ... XOR u_c where u_1 = PRF(P, S || INT(i)), u_2 = PRF(P, u_1), ... u_c = PRF(P, u_{c-1}). Here, INT(i) is a four-octet encoding of the integer i, most significant octet first. */ var prf = forge.hmac.create(); prf.start(md, p); var dk = ''; var xor, u_c, u_c1; // sync version if(!callback) { for(var i = 1; i <= len; ++i) { // PRF(P, S || INT(i)) (first iteration) prf.start(null, null); prf.update(s); prf.update(forge.util.int32ToBytes(i)); xor = u_c1 = prf.digest().getBytes(); // PRF(P, u_{c-1}) (other iterations) for(var j = 2; j <= c; ++j) { prf.start(null, null); prf.update(u_c1); u_c = prf.digest().getBytes(); // F(p, s, c, i) xor = forge.util.xorBytes(xor, u_c, hLen); u_c1 = u_c; } /* 4. Concatenate the blocks and extract the first dkLen octets to produce a derived key DK: DK = T_1 || T_2 || ... || T_len<0..r-1> */ dk += (i < len) ? xor : xor.substr(0, r); } /* 5. Output the derived key DK. */ return dk; } // async version var i = 1, j; function outer() { if(i > len) { // done return callback(null, dk); } // PRF(P, S || INT(i)) (first iteration) prf.start(null, null); prf.update(s); prf.update(forge.util.int32ToBytes(i)); xor = u_c1 = prf.digest().getBytes(); // PRF(P, u_{c-1}) (other iterations) j = 2; inner(); } function inner() { if(j <= c) { prf.start(null, null); prf.update(u_c1); u_c = prf.digest().getBytes(); // F(p, s, c, i) xor = forge.util.xorBytes(xor, u_c, hLen); u_c1 = u_c; ++j; return forge.util.setImmediate(inner); } /* 4. Concatenate the blocks and extract the first dkLen octets to produce a derived key DK: DK = T_1 || T_2 || ... || T_len<0..r-1> */ dk += (i < len) ? xor : xor.substr(0, r); ++i; outer(); } outer(); }; /***/ }), /***/ 70154: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of basic PEM (Privacy Enhanced Mail) algorithms. * * See: RFC 1421. * * @author Dave Longley * * Copyright (c) 2013-2014 Digital Bazaar, Inc. * * A Forge PEM object has the following fields: * * type: identifies the type of message (eg: "RSA PRIVATE KEY"). * * procType: identifies the type of processing performed on the message, * it has two subfields: version and type, eg: 4,ENCRYPTED. * * contentDomain: identifies the type of content in the message, typically * only uses the value: "RFC822". * * dekInfo: identifies the message encryption algorithm and mode and includes * any parameters for the algorithm, it has two subfields: algorithm and * parameters, eg: DES-CBC,F8143EDE5960C597. * * headers: contains all other PEM encapsulated headers -- where order is * significant (for pairing data like recipient ID + key info). * * body: the binary-encoded body. */ var forge = __webpack_require__(89177); __webpack_require__(28339); // shortcut for pem API var pem = module.exports = forge.pem = forge.pem || {}; /** * Encodes (serializes) the given PEM object. * * @param msg the PEM message object to encode. * @param options the options to use: * maxline the maximum characters per line for the body, (default: 64). * * @return the PEM-formatted string. */ pem.encode = function(msg, options) { options = options || {}; var rval = '-----BEGIN ' + msg.type + '-----\r\n'; // encode special headers var header; if(msg.procType) { header = { name: 'Proc-Type', values: [String(msg.procType.version), msg.procType.type] }; rval += foldHeader(header); } if(msg.contentDomain) { header = {name: 'Content-Domain', values: [msg.contentDomain]}; rval += foldHeader(header); } if(msg.dekInfo) { header = {name: 'DEK-Info', values: [msg.dekInfo.algorithm]}; if(msg.dekInfo.parameters) { header.values.push(msg.dekInfo.parameters); } rval += foldHeader(header); } if(msg.headers) { // encode all other headers for(var i = 0; i < msg.headers.length; ++i) { rval += foldHeader(msg.headers[i]); } } // terminate header if(msg.procType) { rval += '\r\n'; } // add body rval += forge.util.encode64(msg.body, options.maxline || 64) + '\r\n'; rval += '-----END ' + msg.type + '-----\r\n'; return rval; }; /** * Decodes (deserializes) all PEM messages found in the given string. * * @param str the PEM-formatted string to decode. * * @return the PEM message objects in an array. */ pem.decode = function(str) { var rval = []; // split string into PEM messages (be lenient w/EOF on BEGIN line) var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g; var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/; var rCRLF = /\r?\n/; var match; while(true) { match = rMessage.exec(str); if(!match) { break; } var msg = { type: match[1], procType: null, contentDomain: null, dekInfo: null, headers: [], body: forge.util.decode64(match[3]) }; rval.push(msg); // no headers if(!match[2]) { continue; } // parse headers var lines = match[2].split(rCRLF); var li = 0; while(match && li < lines.length) { // get line, trim any rhs whitespace var line = lines[li].replace(/\s+$/, ''); // RFC2822 unfold any following folded lines for(var nl = li + 1; nl < lines.length; ++nl) { var next = lines[nl]; if(!/\s/.test(next[0])) { break; } line += next; li = nl; } // parse header match = line.match(rHeader); if(match) { var header = {name: match[1], values: []}; var values = match[2].split(','); for(var vi = 0; vi < values.length; ++vi) { header.values.push(ltrim(values[vi])); } // Proc-Type must be the first header if(!msg.procType) { if(header.name !== 'Proc-Type') { throw new Error('Invalid PEM formatted message. The first ' + 'encapsulated header must be "Proc-Type".'); } else if(header.values.length !== 2) { throw new Error('Invalid PEM formatted message. The "Proc-Type" ' + 'header must have two subfields.'); } msg.procType = {version: values[0], type: values[1]}; } else if(!msg.contentDomain && header.name === 'Content-Domain') { // special-case Content-Domain msg.contentDomain = values[0] || ''; } else if(!msg.dekInfo && header.name === 'DEK-Info') { // special-case DEK-Info if(header.values.length === 0) { throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + 'header must have at least one subfield.'); } msg.dekInfo = {algorithm: values[0], parameters: values[1] || null}; } else { msg.headers.push(header); } } ++li; } if(msg.procType === 'ENCRYPTED' && !msg.dekInfo) { throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + 'header must be present if "Proc-Type" is "ENCRYPTED".'); } } if(rval.length === 0) { throw new Error('Invalid PEM formatted message.'); } return rval; }; function foldHeader(header) { var rval = header.name + ': '; // ensure values with CRLF are folded var values = []; var insertSpace = function(match, $1) { return ' ' + $1; }; for(var i = 0; i < header.values.length; ++i) { values.push(header.values[i].replace(/^(\S+\r\n)/, insertSpace)); } rval += values.join(',') + '\r\n'; // do folding var length = 0; var candidate = -1; for(var i = 0; i < rval.length; ++i, ++length) { if(length > 65 && candidate !== -1) { var insert = rval[candidate]; if(insert === ',') { ++candidate; rval = rval.substr(0, candidate) + '\r\n ' + rval.substr(candidate); } else { rval = rval.substr(0, candidate) + '\r\n' + insert + rval.substr(candidate + 1); } length = (i - candidate - 1); candidate = -1; ++i; } else if(rval[i] === ' ' || rval[i] === '\t' || rval[i] === ',') { candidate = i; } } return rval; } function ltrim(str) { return str.replace(/^\s+/, ''); } /***/ }), /***/ 57014: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Partial implementation of PKCS#1 v2.2: RSA-OEAP * * Modified but based on the following MIT and BSD licensed code: * * https://github.com/kjur/jsjws/blob/master/rsa.js: * * The 'jsjws'(JSON Web Signature JavaScript Library) License * * Copyright (c) 2012 Kenji Urushima * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * http://webrsa.cvs.sourceforge.net/viewvc/webrsa/Client/RSAES-OAEP.js?content-type=text%2Fplain: * * RSAES-OAEP.js * $Id: RSAES-OAEP.js,v 1.1.1.1 2003/03/19 15:37:20 ellispritchard Exp $ * JavaScript Implementation of PKCS #1 v2.1 RSA CRYPTOGRAPHY STANDARD (RSA Laboratories, June 14, 2002) * Copyright (C) Ellis Pritchard, Guardian Unlimited 2003. * Contact: ellis@nukinetics.com * Distributed under the BSD License. * * Official documentation: http://www.rsa.com/rsalabs/node.asp?id=2125 * * @author Evan Jones (http://evanjones.ca/) * @author Dave Longley * * Copyright (c) 2013-2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(28339); __webpack_require__(57821); __webpack_require__(90279); // shortcut for PKCS#1 API var pkcs1 = module.exports = forge.pkcs1 = forge.pkcs1 || {}; /** * Encode the given RSAES-OAEP message (M) using key, with optional label (L) * and seed. * * This method does not perform RSA encryption, it only encodes the message * using RSAES-OAEP. * * @param key the RSA key to use. * @param message the message to encode. * @param options the options to use: * label an optional label to use. * seed the seed to use. * md the message digest object to use, undefined for SHA-1. * mgf1 optional mgf1 parameters: * md the message digest object to use for MGF1. * * @return the encoded message bytes. */ pkcs1.encode_rsa_oaep = function(key, message, options) { // parse arguments var label; var seed; var md; var mgf1Md; // legacy args (label, seed, md) if(typeof options === 'string') { label = options; seed = arguments[3] || undefined; md = arguments[4] || undefined; } else if(options) { label = options.label || undefined; seed = options.seed || undefined; md = options.md || undefined; if(options.mgf1 && options.mgf1.md) { mgf1Md = options.mgf1.md; } } // default OAEP to SHA-1 message digest if(!md) { md = forge.md.sha1.create(); } else { md.start(); } // default MGF-1 to same as OAEP if(!mgf1Md) { mgf1Md = md; } // compute length in bytes and check output var keyLength = Math.ceil(key.n.bitLength() / 8); var maxLength = keyLength - 2 * md.digestLength - 2; if(message.length > maxLength) { var error = new Error('RSAES-OAEP input message length is too long.'); error.length = message.length; error.maxLength = maxLength; throw error; } if(!label) { label = ''; } md.update(label, 'raw'); var lHash = md.digest(); var PS = ''; var PS_length = maxLength - message.length; for(var i = 0; i < PS_length; i++) { PS += '\x00'; } var DB = lHash.getBytes() + PS + '\x01' + message; if(!seed) { seed = forge.random.getBytes(md.digestLength); } else if(seed.length !== md.digestLength) { var error = new Error('Invalid RSAES-OAEP seed. The seed length must ' + 'match the digest length.'); error.seedLength = seed.length; error.digestLength = md.digestLength; throw error; } var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length); // return encoded message return '\x00' + maskedSeed + maskedDB; }; /** * Decode the given RSAES-OAEP encoded message (EM) using key, with optional * label (L). * * This method does not perform RSA decryption, it only decodes the message * using RSAES-OAEP. * * @param key the RSA key to use. * @param em the encoded message to decode. * @param options the options to use: * label an optional label to use. * md the message digest object to use for OAEP, undefined for SHA-1. * mgf1 optional mgf1 parameters: * md the message digest object to use for MGF1. * * @return the decoded message bytes. */ pkcs1.decode_rsa_oaep = function(key, em, options) { // parse args var label; var md; var mgf1Md; // legacy args if(typeof options === 'string') { label = options; md = arguments[3] || undefined; } else if(options) { label = options.label || undefined; md = options.md || undefined; if(options.mgf1 && options.mgf1.md) { mgf1Md = options.mgf1.md; } } // compute length in bytes var keyLength = Math.ceil(key.n.bitLength() / 8); if(em.length !== keyLength) { var error = new Error('RSAES-OAEP encoded message length is invalid.'); error.length = em.length; error.expectedLength = keyLength; throw error; } // default OAEP to SHA-1 message digest if(md === undefined) { md = forge.md.sha1.create(); } else { md.start(); } // default MGF-1 to same as OAEP if(!mgf1Md) { mgf1Md = md; } if(keyLength < 2 * md.digestLength + 2) { throw new Error('RSAES-OAEP key is too short for the hash function.'); } if(!label) { label = ''; } md.update(label, 'raw'); var lHash = md.digest().getBytes(); // split the message into its parts var y = em.charAt(0); var maskedSeed = em.substring(1, md.digestLength + 1); var maskedDB = em.substring(1 + md.digestLength); var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); var lHashPrime = db.substring(0, md.digestLength); // constant time check that all values match what is expected var error = (y !== '\x00'); // constant time check lHash vs lHashPrime for(var i = 0; i < md.digestLength; ++i) { error |= (lHash.charAt(i) !== lHashPrime.charAt(i)); } // "constant time" find the 0x1 byte separating the padding (zeros) from the // message // TODO: It must be possible to do this in a better/smarter way? var in_ps = 1; var index = md.digestLength; for(var j = md.digestLength; j < db.length; j++) { var code = db.charCodeAt(j); var is_0 = (code & 0x1) ^ 0x1; // non-zero if not 0 or 1 in the ps section var error_mask = in_ps ? 0xfffe : 0x0000; error |= (code & error_mask); // latch in_ps to zero after we find 0x1 in_ps = in_ps & is_0; index += in_ps; } if(error || db.charCodeAt(index) !== 0x1) { throw new Error('Invalid RSAES-OAEP padding.'); } return db.substring(index + 1); }; function rsa_mgf1(seed, maskLength, hash) { // default to SHA-1 message digest if(!hash) { hash = forge.md.sha1.create(); } var t = ''; var count = Math.ceil(maskLength / hash.digestLength); for(var i = 0; i < count; ++i) { var c = String.fromCharCode( (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); hash.start(); hash.update(seed + c); t += hash.digest().getBytes(); } return t.substring(0, maskLength); } /***/ }), /***/ 30466: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of PKCS#12. * * @author Dave Longley * @author Stefan Siegl * * Copyright (c) 2010-2014 Digital Bazaar, Inc. * Copyright (c) 2012 Stefan Siegl * * The ASN.1 representation of PKCS#12 is as follows * (see ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12-tc1.pdf for details) * * PFX ::= SEQUENCE { * version INTEGER {v3(3)}(v3,...), * authSafe ContentInfo, * macData MacData OPTIONAL * } * * MacData ::= SEQUENCE { * mac DigestInfo, * macSalt OCTET STRING, * iterations INTEGER DEFAULT 1 * } * Note: The iterations default is for historical reasons and its use is * deprecated. A higher value, like 1024, is recommended. * * DigestInfo is defined in PKCS#7 as follows: * * DigestInfo ::= SEQUENCE { * digestAlgorithm DigestAlgorithmIdentifier, * digest Digest * } * * DigestAlgorithmIdentifier ::= AlgorithmIdentifier * * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters * for the algorithm, if any. In the case of SHA1 there is none. * * AlgorithmIdentifer ::= SEQUENCE { * algorithm OBJECT IDENTIFIER, * parameters ANY DEFINED BY algorithm OPTIONAL * } * * Digest ::= OCTET STRING * * * ContentInfo ::= SEQUENCE { * contentType ContentType, * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL * } * * ContentType ::= OBJECT IDENTIFIER * * AuthenticatedSafe ::= SEQUENCE OF ContentInfo * -- Data if unencrypted * -- EncryptedData if password-encrypted * -- EnvelopedData if public key-encrypted * * * SafeContents ::= SEQUENCE OF SafeBag * * SafeBag ::= SEQUENCE { * bagId BAG-TYPE.&id ({PKCS12BagSet}) * bagValue [0] EXPLICIT BAG-TYPE.&Type({PKCS12BagSet}{@bagId}), * bagAttributes SET OF PKCS12Attribute OPTIONAL * } * * PKCS12Attribute ::= SEQUENCE { * attrId ATTRIBUTE.&id ({PKCS12AttrSet}), * attrValues SET OF ATTRIBUTE.&Type ({PKCS12AttrSet}{@attrId}) * } -- This type is compatible with the X.500 type 'Attribute' * * PKCS12AttrSet ATTRIBUTE ::= { * friendlyName | -- from PKCS #9 * localKeyId, -- from PKCS #9 * ... -- Other attributes are allowed * } * * CertBag ::= SEQUENCE { * certId BAG-TYPE.&id ({CertTypes}), * certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId}) * } * * x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {certTypes 1}} * -- DER-encoded X.509 certificate stored in OCTET STRING * * sdsiCertificate BAG-TYPE ::= {IA5String IDENTIFIED BY {certTypes 2}} * -- Base64-encoded SDSI certificate stored in IA5String * * CertTypes BAG-TYPE ::= { * x509Certificate | * sdsiCertificate, * ... -- For future extensions * } */ var forge = __webpack_require__(89177); __webpack_require__(39549); __webpack_require__(95104); __webpack_require__(81925); __webpack_require__(70266); __webpack_require__(21281); __webpack_require__(57821); __webpack_require__(53921); __webpack_require__(90279); __webpack_require__(28339); __webpack_require__(8180); // shortcut for asn.1 & PKI API var asn1 = forge.asn1; var pki = forge.pki; // shortcut for PKCS#12 API var p12 = module.exports = forge.pkcs12 = forge.pkcs12 || {}; var contentInfoValidator = { name: 'ContentInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, // a ContentInfo constructed: true, value: [{ name: 'ContentInfo.contentType', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'contentType' }, { name: 'ContentInfo.content', tagClass: asn1.Class.CONTEXT_SPECIFIC, constructed: true, captureAsn1: 'content' }] }; var pfxValidator = { name: 'PFX', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'PFX.version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'version' }, contentInfoValidator, { name: 'PFX.macData', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, optional: true, captureAsn1: 'mac', value: [{ name: 'PFX.macData.mac', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, // DigestInfo constructed: true, value: [{ name: 'PFX.macData.mac.digestAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, // DigestAlgorithmIdentifier constructed: true, value: [{ name: 'PFX.macData.mac.digestAlgorithm.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'macAlgorithm' }, { name: 'PFX.macData.mac.digestAlgorithm.parameters', tagClass: asn1.Class.UNIVERSAL, captureAsn1: 'macAlgorithmParameters' }] }, { name: 'PFX.macData.mac.digest', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'macDigest' }] }, { name: 'PFX.macData.macSalt', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'macSalt' }, { name: 'PFX.macData.iterations', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, optional: true, capture: 'macIterations' }] }] }; var safeBagValidator = { name: 'SafeBag', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'SafeBag.bagId', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'bagId' }, { name: 'SafeBag.bagValue', tagClass: asn1.Class.CONTEXT_SPECIFIC, constructed: true, captureAsn1: 'bagValue' }, { name: 'SafeBag.bagAttributes', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true, optional: true, capture: 'bagAttributes' }] }; var attributeValidator = { name: 'Attribute', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'Attribute.attrId', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'oid' }, { name: 'Attribute.attrValues', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true, capture: 'values' }] }; var certBagValidator = { name: 'CertBag', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'CertBag.certId', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'certId' }, { name: 'CertBag.certValue', tagClass: asn1.Class.CONTEXT_SPECIFIC, constructed: true, /* So far we only support X.509 certificates (which are wrapped in an OCTET STRING, hence hard code that here). */ value: [{ name: 'CertBag.certValue[0]', tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.OCTETSTRING, constructed: false, capture: 'cert' }] }] }; /** * Search SafeContents structure for bags with matching attributes. * * The search can optionally be narrowed by a certain bag type. * * @param safeContents the SafeContents structure to search in. * @param attrName the name of the attribute to compare against. * @param attrValue the attribute value to search for. * @param [bagType] bag type to narrow search by. * * @return an array of matching bags. */ function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) { var result = []; for(var i = 0; i < safeContents.length; i++) { for(var j = 0; j < safeContents[i].safeBags.length; j++) { var bag = safeContents[i].safeBags[j]; if(bagType !== undefined && bag.type !== bagType) { continue; } // only filter by bag type, no attribute specified if(attrName === null) { result.push(bag); continue; } if(bag.attributes[attrName] !== undefined && bag.attributes[attrName].indexOf(attrValue) >= 0) { result.push(bag); } } } return result; } /** * Converts a PKCS#12 PFX in ASN.1 notation into a PFX object. * * @param obj The PKCS#12 PFX in ASN.1 notation. * @param strict true to use strict DER decoding, false not to (default: true). * @param {String} password Password to decrypt with (optional). * * @return PKCS#12 PFX object. */ p12.pkcs12FromAsn1 = function(obj, strict, password) { // handle args if(typeof strict === 'string') { password = strict; strict = true; } else if(strict === undefined) { strict = true; } // validate PFX and capture data var capture = {}; var errors = []; if(!asn1.validate(obj, pfxValidator, capture, errors)) { var error = new Error('Cannot read PKCS#12 PFX. ' + 'ASN.1 object is not an PKCS#12 PFX.'); error.errors = error; throw error; } var pfx = { version: capture.version.charCodeAt(0), safeContents: [], /** * Gets bags with matching attributes. * * @param filter the attributes to filter by: * [localKeyId] the localKeyId to search for. * [localKeyIdHex] the localKeyId in hex to search for. * [friendlyName] the friendly name to search for. * [bagType] bag type to narrow each attribute search by. * * @return a map of attribute type to an array of matching bags or, if no * attribute was given but a bag type, the map key will be the * bag type. */ getBags: function(filter) { var rval = {}; var localKeyId; if('localKeyId' in filter) { localKeyId = filter.localKeyId; } else if('localKeyIdHex' in filter) { localKeyId = forge.util.hexToBytes(filter.localKeyIdHex); } // filter on bagType only if(localKeyId === undefined && !('friendlyName' in filter) && 'bagType' in filter) { rval[filter.bagType] = _getBagsByAttribute( pfx.safeContents, null, null, filter.bagType); } if(localKeyId !== undefined) { rval.localKeyId = _getBagsByAttribute( pfx.safeContents, 'localKeyId', localKeyId, filter.bagType); } if('friendlyName' in filter) { rval.friendlyName = _getBagsByAttribute( pfx.safeContents, 'friendlyName', filter.friendlyName, filter.bagType); } return rval; }, /** * DEPRECATED: use getBags() instead. * * Get bags with matching friendlyName attribute. * * @param friendlyName the friendly name to search for. * @param [bagType] bag type to narrow search by. * * @return an array of bags with matching friendlyName attribute. */ getBagsByFriendlyName: function(friendlyName, bagType) { return _getBagsByAttribute( pfx.safeContents, 'friendlyName', friendlyName, bagType); }, /** * DEPRECATED: use getBags() instead. * * Get bags with matching localKeyId attribute. * * @param localKeyId the localKeyId to search for. * @param [bagType] bag type to narrow search by. * * @return an array of bags with matching localKeyId attribute. */ getBagsByLocalKeyId: function(localKeyId, bagType) { return _getBagsByAttribute( pfx.safeContents, 'localKeyId', localKeyId, bagType); } }; if(capture.version.charCodeAt(0) !== 3) { var error = new Error('PKCS#12 PFX of version other than 3 not supported.'); error.version = capture.version.charCodeAt(0); throw error; } if(asn1.derToOid(capture.contentType) !== pki.oids.data) { var error = new Error('Only PKCS#12 PFX in password integrity mode supported.'); error.oid = asn1.derToOid(capture.contentType); throw error; } var data = capture.content.value[0]; if(data.tagClass !== asn1.Class.UNIVERSAL || data.type !== asn1.Type.OCTETSTRING) { throw new Error('PKCS#12 authSafe content data is not an OCTET STRING.'); } data = _decodePkcs7Data(data); // check for MAC if(capture.mac) { var md = null; var macKeyBytes = 0; var macAlgorithm = asn1.derToOid(capture.macAlgorithm); switch(macAlgorithm) { case pki.oids.sha1: md = forge.md.sha1.create(); macKeyBytes = 20; break; case pki.oids.sha256: md = forge.md.sha256.create(); macKeyBytes = 32; break; case pki.oids.sha384: md = forge.md.sha384.create(); macKeyBytes = 48; break; case pki.oids.sha512: md = forge.md.sha512.create(); macKeyBytes = 64; break; case pki.oids.md5: md = forge.md.md5.create(); macKeyBytes = 16; break; } if(md === null) { throw new Error('PKCS#12 uses unsupported MAC algorithm: ' + macAlgorithm); } // verify MAC (iterations default to 1) var macSalt = new forge.util.ByteBuffer(capture.macSalt); var macIterations = (('macIterations' in capture) ? parseInt(forge.util.bytesToHex(capture.macIterations), 16) : 1); var macKey = p12.generateKey( password, macSalt, 3, macIterations, macKeyBytes, md); var mac = forge.hmac.create(); mac.start(md, macKey); mac.update(data.value); var macValue = mac.getMac(); if(macValue.getBytes() !== capture.macDigest) { throw new Error('PKCS#12 MAC could not be verified. Invalid password?'); } } _decodeAuthenticatedSafe(pfx, data.value, strict, password); return pfx; }; /** * Decodes PKCS#7 Data. PKCS#7 (RFC 2315) defines "Data" as an OCTET STRING, * but it is sometimes an OCTET STRING that is composed/constructed of chunks, * each its own OCTET STRING. This is BER-encoding vs. DER-encoding. This * function transforms this corner-case into the usual simple, * non-composed/constructed OCTET STRING. * * This function may be moved to ASN.1 at some point to better deal with * more BER-encoding issues, should they arise. * * @param data the ASN.1 Data object to transform. */ function _decodePkcs7Data(data) { // handle special case of "chunked" data content: an octet string composed // of other octet strings if(data.composed || data.constructed) { var value = forge.util.createBuffer(); for(var i = 0; i < data.value.length; ++i) { value.putBytes(data.value[i].value); } data.composed = data.constructed = false; data.value = value.getBytes(); } return data; } /** * Decode PKCS#12 AuthenticatedSafe (BER encoded) into PFX object. * * The AuthenticatedSafe is a BER-encoded SEQUENCE OF ContentInfo. * * @param pfx The PKCS#12 PFX object to fill. * @param {String} authSafe BER-encoded AuthenticatedSafe. * @param strict true to use strict DER decoding, false not to. * @param {String} password Password to decrypt with (optional). */ function _decodeAuthenticatedSafe(pfx, authSafe, strict, password) { authSafe = asn1.fromDer(authSafe, strict); /* actually it's BER encoded */ if(authSafe.tagClass !== asn1.Class.UNIVERSAL || authSafe.type !== asn1.Type.SEQUENCE || authSafe.constructed !== true) { throw new Error('PKCS#12 AuthenticatedSafe expected to be a ' + 'SEQUENCE OF ContentInfo'); } for(var i = 0; i < authSafe.value.length; i++) { var contentInfo = authSafe.value[i]; // validate contentInfo and capture data var capture = {}; var errors = []; if(!asn1.validate(contentInfo, contentInfoValidator, capture, errors)) { var error = new Error('Cannot read ContentInfo.'); error.errors = errors; throw error; } var obj = { encrypted: false }; var safeContents = null; var data = capture.content.value[0]; switch(asn1.derToOid(capture.contentType)) { case pki.oids.data: if(data.tagClass !== asn1.Class.UNIVERSAL || data.type !== asn1.Type.OCTETSTRING) { throw new Error('PKCS#12 SafeContents Data is not an OCTET STRING.'); } safeContents = _decodePkcs7Data(data).value; break; case pki.oids.encryptedData: safeContents = _decryptSafeContents(data, password); obj.encrypted = true; break; default: var error = new Error('Unsupported PKCS#12 contentType.'); error.contentType = asn1.derToOid(capture.contentType); throw error; } obj.safeBags = _decodeSafeContents(safeContents, strict, password); pfx.safeContents.push(obj); } } /** * Decrypt PKCS#7 EncryptedData structure. * * @param data ASN.1 encoded EncryptedContentInfo object. * @param password The user-provided password. * * @return The decrypted SafeContents (ASN.1 object). */ function _decryptSafeContents(data, password) { var capture = {}; var errors = []; if(!asn1.validate( data, forge.pkcs7.asn1.encryptedDataValidator, capture, errors)) { var error = new Error('Cannot read EncryptedContentInfo.'); error.errors = errors; throw error; } var oid = asn1.derToOid(capture.contentType); if(oid !== pki.oids.data) { var error = new Error( 'PKCS#12 EncryptedContentInfo ContentType is not Data.'); error.oid = oid; throw error; } // get cipher oid = asn1.derToOid(capture.encAlgorithm); var cipher = pki.pbe.getCipher(oid, capture.encParameter, password); // get encrypted data var encryptedContentAsn1 = _decodePkcs7Data(capture.encryptedContentAsn1); var encrypted = forge.util.createBuffer(encryptedContentAsn1.value); cipher.update(encrypted); if(!cipher.finish()) { throw new Error('Failed to decrypt PKCS#12 SafeContents.'); } return cipher.output.getBytes(); } /** * Decode PKCS#12 SafeContents (BER-encoded) into array of Bag objects. * * The safeContents is a BER-encoded SEQUENCE OF SafeBag. * * @param {String} safeContents BER-encoded safeContents. * @param strict true to use strict DER decoding, false not to. * @param {String} password Password to decrypt with (optional). * * @return {Array} Array of Bag objects. */ function _decodeSafeContents(safeContents, strict, password) { // if strict and no safe contents, return empty safes if(!strict && safeContents.length === 0) { return []; } // actually it's BER-encoded safeContents = asn1.fromDer(safeContents, strict); if(safeContents.tagClass !== asn1.Class.UNIVERSAL || safeContents.type !== asn1.Type.SEQUENCE || safeContents.constructed !== true) { throw new Error( 'PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.'); } var res = []; for(var i = 0; i < safeContents.value.length; i++) { var safeBag = safeContents.value[i]; // validate SafeBag and capture data var capture = {}; var errors = []; if(!asn1.validate(safeBag, safeBagValidator, capture, errors)) { var error = new Error('Cannot read SafeBag.'); error.errors = errors; throw error; } /* Create bag object and push to result array. */ var bag = { type: asn1.derToOid(capture.bagId), attributes: _decodeBagAttributes(capture.bagAttributes) }; res.push(bag); var validator, decoder; var bagAsn1 = capture.bagValue.value[0]; switch(bag.type) { case pki.oids.pkcs8ShroudedKeyBag: /* bagAsn1 has a EncryptedPrivateKeyInfo, which we need to decrypt. Afterwards we can handle it like a keyBag, which is a PrivateKeyInfo. */ bagAsn1 = pki.decryptPrivateKeyInfo(bagAsn1, password); if(bagAsn1 === null) { throw new Error( 'Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?'); } /* fall through */ case pki.oids.keyBag: /* A PKCS#12 keyBag is a simple PrivateKeyInfo as understood by our PKI module, hence we don't have to do validation/capturing here, just pass what we already got. */ try { bag.key = pki.privateKeyFromAsn1(bagAsn1); } catch(e) { // ignore unknown key type, pass asn1 value bag.key = null; bag.asn1 = bagAsn1; } continue; /* Nothing more to do. */ case pki.oids.certBag: /* A PKCS#12 certBag can wrap both X.509 and sdsi certificates. Therefore put the SafeBag content through another validator to capture the fields. Afterwards check & store the results. */ validator = certBagValidator; decoder = function() { if(asn1.derToOid(capture.certId) !== pki.oids.x509Certificate) { var error = new Error( 'Unsupported certificate type, only X.509 supported.'); error.oid = asn1.derToOid(capture.certId); throw error; } // true=produce cert hash var certAsn1 = asn1.fromDer(capture.cert, strict); try { bag.cert = pki.certificateFromAsn1(certAsn1, true); } catch(e) { // ignore unknown cert type, pass asn1 value bag.cert = null; bag.asn1 = certAsn1; } }; break; default: var error = new Error('Unsupported PKCS#12 SafeBag type.'); error.oid = bag.type; throw error; } /* Validate SafeBag value (i.e. CertBag, etc.) and capture data if needed. */ if(validator !== undefined && !asn1.validate(bagAsn1, validator, capture, errors)) { var error = new Error('Cannot read PKCS#12 ' + validator.name); error.errors = errors; throw error; } /* Call decoder function from above to store the results. */ decoder(); } return res; } /** * Decode PKCS#12 SET OF PKCS12Attribute into JavaScript object. * * @param attributes SET OF PKCS12Attribute (ASN.1 object). * * @return the decoded attributes. */ function _decodeBagAttributes(attributes) { var decodedAttrs = {}; if(attributes !== undefined) { for(var i = 0; i < attributes.length; ++i) { var capture = {}; var errors = []; if(!asn1.validate(attributes[i], attributeValidator, capture, errors)) { var error = new Error('Cannot read PKCS#12 BagAttribute.'); error.errors = errors; throw error; } var oid = asn1.derToOid(capture.oid); if(pki.oids[oid] === undefined) { // unsupported attribute type, ignore. continue; } decodedAttrs[pki.oids[oid]] = []; for(var j = 0; j < capture.values.length; ++j) { decodedAttrs[pki.oids[oid]].push(capture.values[j].value); } } } return decodedAttrs; } /** * Wraps a private key and certificate in a PKCS#12 PFX wrapper. If a * password is provided then the private key will be encrypted. * * An entire certificate chain may also be included. To do this, pass * an array for the "cert" parameter where the first certificate is * the one that is paired with the private key and each subsequent one * verifies the previous one. The certificates may be in PEM format or * have been already parsed by Forge. * * @todo implement password-based-encryption for the whole package * * @param key the private key. * @param cert the certificate (may be an array of certificates in order * to specify a certificate chain). * @param password the password to use, null for none. * @param options: * algorithm the encryption algorithm to use * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'. * count the iteration count to use. * saltSize the salt size to use. * useMac true to include a MAC, false not to, defaults to true. * localKeyId the local key ID to use, in hex. * friendlyName the friendly name to use. * generateLocalKeyId true to generate a random local key ID, * false not to, defaults to true. * * @return the PKCS#12 PFX ASN.1 object. */ p12.toPkcs12Asn1 = function(key, cert, password, options) { // set default options options = options || {}; options.saltSize = options.saltSize || 8; options.count = options.count || 2048; options.algorithm = options.algorithm || options.encAlgorithm || 'aes128'; if(!('useMac' in options)) { options.useMac = true; } if(!('localKeyId' in options)) { options.localKeyId = null; } if(!('generateLocalKeyId' in options)) { options.generateLocalKeyId = true; } var localKeyId = options.localKeyId; var bagAttrs; if(localKeyId !== null) { localKeyId = forge.util.hexToBytes(localKeyId); } else if(options.generateLocalKeyId) { // use SHA-1 of paired cert, if available if(cert) { var pairedCert = forge.util.isArray(cert) ? cert[0] : cert; if(typeof pairedCert === 'string') { pairedCert = pki.certificateFromPem(pairedCert); } var sha1 = forge.md.sha1.create(); sha1.update(asn1.toDer(pki.certificateToAsn1(pairedCert)).getBytes()); localKeyId = sha1.digest().getBytes(); } else { // FIXME: consider using SHA-1 of public key (which can be generated // from private key components), see: cert.generateSubjectKeyIdentifier // generate random bytes localKeyId = forge.random.getBytes(20); } } var attrs = []; if(localKeyId !== null) { attrs.push( // localKeyID asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // attrId asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.localKeyId).getBytes()), // attrValues asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, localKeyId) ]) ])); } if('friendlyName' in options) { attrs.push( // friendlyName asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // attrId asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.friendlyName).getBytes()), // attrValues asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BMPSTRING, false, options.friendlyName) ]) ])); } if(attrs.length > 0) { bagAttrs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, attrs); } // collect contents for AuthenticatedSafe var contents = []; // create safe bag(s) for certificate chain var chain = []; if(cert !== null) { if(forge.util.isArray(cert)) { chain = cert; } else { chain = [cert]; } } var certSafeBags = []; for(var i = 0; i < chain.length; ++i) { // convert cert from PEM as necessary cert = chain[i]; if(typeof cert === 'string') { cert = pki.certificateFromPem(cert); } // SafeBag var certBagAttrs = (i === 0) ? bagAttrs : undefined; var certAsn1 = pki.certificateToAsn1(cert); var certSafeBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // bagId asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.certBag).getBytes()), // bagValue asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ // CertBag asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // certId asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.x509Certificate).getBytes()), // certValue (x509Certificate) asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(certAsn1).getBytes()) ])])]), // bagAttributes (OPTIONAL) certBagAttrs ]); certSafeBags.push(certSafeBag); } if(certSafeBags.length > 0) { // SafeContents var certSafeContents = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, certSafeBags); // ContentInfo var certCI = // PKCS#7 ContentInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // contentType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, // OID for the content type is 'data' asn1.oidToDer(pki.oids.data).getBytes()), // content asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(certSafeContents).getBytes()) ]) ]); contents.push(certCI); } // create safe contents for private key var keyBag = null; if(key !== null) { // SafeBag var pkAsn1 = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(key)); if(password === null) { // no encryption keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // bagId asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.keyBag).getBytes()), // bagValue asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ // PrivateKeyInfo pkAsn1 ]), // bagAttributes (OPTIONAL) bagAttrs ]); } else { // encrypted PrivateKeyInfo keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // bagId asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.pkcs8ShroudedKeyBag).getBytes()), // bagValue asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ // EncryptedPrivateKeyInfo pki.encryptPrivateKeyInfo(pkAsn1, password, options) ]), // bagAttributes (OPTIONAL) bagAttrs ]); } // SafeContents var keySafeContents = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [keyBag]); // ContentInfo var keyCI = // PKCS#7 ContentInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // contentType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, // OID for the content type is 'data' asn1.oidToDer(pki.oids.data).getBytes()), // content asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(keySafeContents).getBytes()) ]) ]); contents.push(keyCI); } // create AuthenticatedSafe by stringing together the contents var safe = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, contents); var macData; if(options.useMac) { // MacData var sha1 = forge.md.sha1.create(); var macSalt = new forge.util.ByteBuffer( forge.random.getBytes(options.saltSize)); var count = options.count; // 160-bit key var key = p12.generateKey(password, macSalt, 3, count, 20); var mac = forge.hmac.create(); mac.start(sha1, key); mac.update(asn1.toDer(safe).getBytes()); var macValue = mac.getMac(); macData = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // mac DigestInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // digestAlgorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm = SHA-1 asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.sha1).getBytes()), // parameters = Null asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ]), // digest asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, macValue.getBytes()) ]), // macSalt OCTET STRING asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, macSalt.getBytes()), // iterations INTEGER (XXX: Only support count < 65536) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(count).getBytes() ) ]); } // PFX return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version (3) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(3).getBytes()), // PKCS#7 ContentInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // contentType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, // OID for the content type is 'data' asn1.oidToDer(pki.oids.data).getBytes()), // content asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(safe).getBytes()) ]) ]), macData ]); }; /** * Derives a PKCS#12 key. * * @param password the password to derive the key material from, null or * undefined for none. * @param salt the salt, as a ByteBuffer, to use. * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC). * @param iter the iteration count. * @param n the number of bytes to derive from the password. * @param md the message digest to use, defaults to SHA-1. * * @return a ByteBuffer with the bytes derived from the password. */ p12.generateKey = forge.pbe.generatePkcs12Key; /***/ }), /***/ 94829: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of PKCS#7 v1.5. * * @author Stefan Siegl * @author Dave Longley * * Copyright (c) 2012 Stefan Siegl * Copyright (c) 2012-2015 Digital Bazaar, Inc. * * Currently this implementation only supports ContentType of EnvelopedData, * EncryptedData, or SignedData at the root level. The top level elements may * contain only a ContentInfo of ContentType Data, i.e. plain data. Further * nesting is not (yet) supported. * * The Forge validators for PKCS #7's ASN.1 structures are available from * a separate file pkcs7asn1.js, since those are referenced from other * PKCS standards like PKCS #12. */ var forge = __webpack_require__(89177); __webpack_require__(87994); __webpack_require__(39549); __webpack_require__(97157); __webpack_require__(81925); __webpack_require__(70154); __webpack_require__(70266); __webpack_require__(57821); __webpack_require__(28339); __webpack_require__(8180); // shortcut for ASN.1 API var asn1 = forge.asn1; // shortcut for PKCS#7 API var p7 = module.exports = forge.pkcs7 = forge.pkcs7 || {}; /** * Converts a PKCS#7 message from PEM format. * * @param pem the PEM-formatted PKCS#7 message. * * @return the PKCS#7 message. */ p7.messageFromPem = function(pem) { var msg = forge.pem.decode(pem)[0]; if(msg.type !== 'PKCS7') { var error = new Error('Could not convert PKCS#7 message from PEM; PEM ' + 'header type is not "PKCS#7".'); error.headerType = msg.type; throw error; } if(msg.procType && msg.procType.type === 'ENCRYPTED') { throw new Error('Could not convert PKCS#7 message from PEM; PEM is encrypted.'); } // convert DER to ASN.1 object var obj = asn1.fromDer(msg.body); return p7.messageFromAsn1(obj); }; /** * Converts a PKCS#7 message to PEM format. * * @param msg The PKCS#7 message object * @param maxline The maximum characters per line, defaults to 64. * * @return The PEM-formatted PKCS#7 message. */ p7.messageToPem = function(msg, maxline) { // convert to ASN.1, then DER, then PEM-encode var pemObj = { type: 'PKCS7', body: asn1.toDer(msg.toAsn1()).getBytes() }; return forge.pem.encode(pemObj, {maxline: maxline}); }; /** * Converts a PKCS#7 message from an ASN.1 object. * * @param obj the ASN.1 representation of a ContentInfo. * * @return the PKCS#7 message. */ p7.messageFromAsn1 = function(obj) { // validate root level ContentInfo and capture data var capture = {}; var errors = []; if(!asn1.validate(obj, p7.asn1.contentInfoValidator, capture, errors)) { var error = new Error('Cannot read PKCS#7 message. ' + 'ASN.1 object is not an PKCS#7 ContentInfo.'); error.errors = errors; throw error; } var contentType = asn1.derToOid(capture.contentType); var msg; switch(contentType) { case forge.pki.oids.envelopedData: msg = p7.createEnvelopedData(); break; case forge.pki.oids.encryptedData: msg = p7.createEncryptedData(); break; case forge.pki.oids.signedData: msg = p7.createSignedData(); break; default: throw new Error('Cannot read PKCS#7 message. ContentType with OID ' + contentType + ' is not (yet) supported.'); } msg.fromAsn1(capture.content.value[0]); return msg; }; p7.createSignedData = function() { var msg = null; msg = { type: forge.pki.oids.signedData, version: 1, certificates: [], crls: [], // TODO: add json-formatted signer stuff here? signers: [], // populated during sign() digestAlgorithmIdentifiers: [], contentInfo: null, signerInfos: [], fromAsn1: function(obj) { // validate SignedData content block and capture data. _fromAsn1(msg, obj, p7.asn1.signedDataValidator); msg.certificates = []; msg.crls = []; msg.digestAlgorithmIdentifiers = []; msg.contentInfo = null; msg.signerInfos = []; if(msg.rawCapture.certificates) { var certs = msg.rawCapture.certificates.value; for(var i = 0; i < certs.length; ++i) { msg.certificates.push(forge.pki.certificateFromAsn1(certs[i])); } } // TODO: parse crls }, toAsn1: function() { // degenerate case with no content if(!msg.contentInfo) { msg.sign(); } var certs = []; for(var i = 0; i < msg.certificates.length; ++i) { certs.push(forge.pki.certificateToAsn1(msg.certificates[i])); } var crls = []; // TODO: implement CRLs // [0] SignedData var signedData = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Version asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(msg.version).getBytes()), // DigestAlgorithmIdentifiers asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SET, true, msg.digestAlgorithmIdentifiers), // ContentInfo msg.contentInfo ]) ]); if(certs.length > 0) { // [0] IMPLICIT ExtendedCertificatesAndCertificates OPTIONAL signedData.value[0].value.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, certs)); } if(crls.length > 0) { // [1] IMPLICIT CertificateRevocationLists OPTIONAL signedData.value[0].value.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, crls)); } // SignerInfos signedData.value[0].value.push( asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, msg.signerInfos)); // ContentInfo return asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // ContentType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(msg.type).getBytes()), // [0] SignedData signedData ]); }, /** * Add (another) entity to list of signers. * * Note: If authenticatedAttributes are provided, then, per RFC 2315, * they must include at least two attributes: content type and * message digest. The message digest attribute value will be * auto-calculated during signing and will be ignored if provided. * * Here's an example of providing these two attributes: * * forge.pkcs7.createSignedData(); * p7.addSigner({ * issuer: cert.issuer.attributes, * serialNumber: cert.serialNumber, * key: privateKey, * digestAlgorithm: forge.pki.oids.sha1, * authenticatedAttributes: [{ * type: forge.pki.oids.contentType, * value: forge.pki.oids.data * }, { * type: forge.pki.oids.messageDigest * }] * }); * * TODO: Support [subjectKeyIdentifier] as signer's ID. * * @param signer the signer information: * key the signer's private key. * [certificate] a certificate containing the public key * associated with the signer's private key; use this option as * an alternative to specifying signer.issuer and * signer.serialNumber. * [issuer] the issuer attributes (eg: cert.issuer.attributes). * [serialNumber] the signer's certificate's serial number in * hexadecimal (eg: cert.serialNumber). * [digestAlgorithm] the message digest OID, as a string, to use * (eg: forge.pki.oids.sha1). * [authenticatedAttributes] an optional array of attributes * to also sign along with the content. */ addSigner: function(signer) { var issuer = signer.issuer; var serialNumber = signer.serialNumber; if(signer.certificate) { var cert = signer.certificate; if(typeof cert === 'string') { cert = forge.pki.certificateFromPem(cert); } issuer = cert.issuer.attributes; serialNumber = cert.serialNumber; } var key = signer.key; if(!key) { throw new Error( 'Could not add PKCS#7 signer; no private key specified.'); } if(typeof key === 'string') { key = forge.pki.privateKeyFromPem(key); } // ensure OID known for digest algorithm var digestAlgorithm = signer.digestAlgorithm || forge.pki.oids.sha1; switch(digestAlgorithm) { case forge.pki.oids.sha1: case forge.pki.oids.sha256: case forge.pki.oids.sha384: case forge.pki.oids.sha512: case forge.pki.oids.md5: break; default: throw new Error( 'Could not add PKCS#7 signer; unknown message digest algorithm: ' + digestAlgorithm); } // if authenticatedAttributes is present, then the attributes // must contain at least PKCS #9 content-type and message-digest var authenticatedAttributes = signer.authenticatedAttributes || []; if(authenticatedAttributes.length > 0) { var contentType = false; var messageDigest = false; for(var i = 0; i < authenticatedAttributes.length; ++i) { var attr = authenticatedAttributes[i]; if(!contentType && attr.type === forge.pki.oids.contentType) { contentType = true; if(messageDigest) { break; } continue; } if(!messageDigest && attr.type === forge.pki.oids.messageDigest) { messageDigest = true; if(contentType) { break; } continue; } } if(!contentType || !messageDigest) { throw new Error('Invalid signer.authenticatedAttributes. If ' + 'signer.authenticatedAttributes is specified, then it must ' + 'contain at least two attributes, PKCS #9 content-type and ' + 'PKCS #9 message-digest.'); } } msg.signers.push({ key: key, version: 1, issuer: issuer, serialNumber: serialNumber, digestAlgorithm: digestAlgorithm, signatureAlgorithm: forge.pki.oids.rsaEncryption, signature: null, authenticatedAttributes: authenticatedAttributes, unauthenticatedAttributes: [] }); }, /** * Signs the content. * @param options Options to apply when signing: * [detached] boolean. If signing should be done in detached mode. Defaults to false. */ sign: function(options) { options = options || {}; // auto-generate content info if(typeof msg.content !== 'object' || msg.contentInfo === null) { // use Data ContentInfo msg.contentInfo = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // ContentType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(forge.pki.oids.data).getBytes()) ]); // add actual content, if present if('content' in msg) { var content; if(msg.content instanceof forge.util.ByteBuffer) { content = msg.content.bytes(); } else if(typeof msg.content === 'string') { content = forge.util.encodeUtf8(msg.content); } if (options.detached) { msg.detachedContent = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content); } else { msg.contentInfo.value.push( // [0] EXPLICIT content asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content) ])); } } } // no signers, return early (degenerate case for certificate container) if(msg.signers.length === 0) { return; } // generate digest algorithm identifiers var mds = addDigestAlgorithmIds(); // generate signerInfos addSignerInfos(mds); }, verify: function() { throw new Error('PKCS#7 signature verification not yet implemented.'); }, /** * Add a certificate. * * @param cert the certificate to add. */ addCertificate: function(cert) { // convert from PEM if(typeof cert === 'string') { cert = forge.pki.certificateFromPem(cert); } msg.certificates.push(cert); }, /** * Add a certificate revokation list. * * @param crl the certificate revokation list to add. */ addCertificateRevokationList: function(crl) { throw new Error('PKCS#7 CRL support not yet implemented.'); } }; return msg; function addDigestAlgorithmIds() { var mds = {}; for(var i = 0; i < msg.signers.length; ++i) { var signer = msg.signers[i]; var oid = signer.digestAlgorithm; if(!(oid in mds)) { // content digest mds[oid] = forge.md[forge.pki.oids[oid]].create(); } if(signer.authenticatedAttributes.length === 0) { // no custom attributes to digest; use content message digest signer.md = mds[oid]; } else { // custom attributes to be digested; use own message digest // TODO: optimize to just copy message digest state if that // feature is ever supported with message digests signer.md = forge.md[forge.pki.oids[oid]].create(); } } // add unique digest algorithm identifiers msg.digestAlgorithmIdentifiers = []; for(var oid in mds) { msg.digestAlgorithmIdentifiers.push( // AlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oid).getBytes()), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ])); } return mds; } function addSignerInfos(mds) { var content; if (msg.detachedContent) { // Signature has been made in detached mode. content = msg.detachedContent; } else { // Note: ContentInfo is a SEQUENCE with 2 values, second value is // the content field and is optional for a ContentInfo but required here // since signers are present // get ContentInfo content content = msg.contentInfo.value[1]; // skip [0] EXPLICIT content wrapper content = content.value[0]; } if(!content) { throw new Error( 'Could not sign PKCS#7 message; there is no content to sign.'); } // get ContentInfo content type var contentType = asn1.derToOid(msg.contentInfo.value[0].value); // serialize content var bytes = asn1.toDer(content); // skip identifier and length per RFC 2315 9.3 // skip identifier (1 byte) bytes.getByte(); // read and discard length bytes asn1.getBerValueLength(bytes); bytes = bytes.getBytes(); // digest content DER value bytes for(var oid in mds) { mds[oid].start().update(bytes); } // sign content var signingTime = new Date(); for(var i = 0; i < msg.signers.length; ++i) { var signer = msg.signers[i]; if(signer.authenticatedAttributes.length === 0) { // if ContentInfo content type is not "Data", then // authenticatedAttributes must be present per RFC 2315 if(contentType !== forge.pki.oids.data) { throw new Error( 'Invalid signer; authenticatedAttributes must be present ' + 'when the ContentInfo content type is not PKCS#7 Data.'); } } else { // process authenticated attributes // [0] IMPLICIT signer.authenticatedAttributesAsn1 = asn1.create( asn1.Class.CONTEXT_SPECIFIC, 0, true, []); // per RFC 2315, attributes are to be digested using a SET container // not the above [0] IMPLICIT container var attrsAsn1 = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SET, true, []); for(var ai = 0; ai < signer.authenticatedAttributes.length; ++ai) { var attr = signer.authenticatedAttributes[ai]; if(attr.type === forge.pki.oids.messageDigest) { // use content message digest as value attr.value = mds[signer.digestAlgorithm].digest(); } else if(attr.type === forge.pki.oids.signingTime) { // auto-populate signing time if not already set if(!attr.value) { attr.value = signingTime; } } // convert to ASN.1 and push onto Attributes SET (for signing) and // onto authenticatedAttributesAsn1 to complete SignedData ASN.1 // TODO: optimize away duplication attrsAsn1.value.push(_attributeToAsn1(attr)); signer.authenticatedAttributesAsn1.value.push(_attributeToAsn1(attr)); } // DER-serialize and digest SET OF attributes only bytes = asn1.toDer(attrsAsn1).getBytes(); signer.md.start().update(bytes); } // sign digest signer.signature = signer.key.sign(signer.md, 'RSASSA-PKCS1-V1_5'); } // add signer info msg.signerInfos = _signersToAsn1(msg.signers); } }; /** * Creates an empty PKCS#7 message of type EncryptedData. * * @return the message. */ p7.createEncryptedData = function() { var msg = null; msg = { type: forge.pki.oids.encryptedData, version: 0, encryptedContent: { algorithm: forge.pki.oids['aes256-CBC'] }, /** * Reads an EncryptedData content block (in ASN.1 format) * * @param obj The ASN.1 representation of the EncryptedData content block */ fromAsn1: function(obj) { // Validate EncryptedData content block and capture data. _fromAsn1(msg, obj, p7.asn1.encryptedDataValidator); }, /** * Decrypt encrypted content * * @param key The (symmetric) key as a byte buffer */ decrypt: function(key) { if(key !== undefined) { msg.encryptedContent.key = key; } _decryptContent(msg); } }; return msg; }; /** * Creates an empty PKCS#7 message of type EnvelopedData. * * @return the message. */ p7.createEnvelopedData = function() { var msg = null; msg = { type: forge.pki.oids.envelopedData, version: 0, recipients: [], encryptedContent: { algorithm: forge.pki.oids['aes256-CBC'] }, /** * Reads an EnvelopedData content block (in ASN.1 format) * * @param obj the ASN.1 representation of the EnvelopedData content block. */ fromAsn1: function(obj) { // validate EnvelopedData content block and capture data var capture = _fromAsn1(msg, obj, p7.asn1.envelopedDataValidator); msg.recipients = _recipientsFromAsn1(capture.recipientInfos.value); }, toAsn1: function() { // ContentInfo return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // ContentType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(msg.type).getBytes()), // [0] EnvelopedData asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Version asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(msg.version).getBytes()), // RecipientInfos asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, _recipientsToAsn1(msg.recipients)), // EncryptedContentInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, _encryptedContentToAsn1(msg.encryptedContent)) ]) ]) ]); }, /** * Find recipient by X.509 certificate's issuer. * * @param cert the certificate with the issuer to look for. * * @return the recipient object. */ findRecipient: function(cert) { var sAttr = cert.issuer.attributes; for(var i = 0; i < msg.recipients.length; ++i) { var r = msg.recipients[i]; var rAttr = r.issuer; if(r.serialNumber !== cert.serialNumber) { continue; } if(rAttr.length !== sAttr.length) { continue; } var match = true; for(var j = 0; j < sAttr.length; ++j) { if(rAttr[j].type !== sAttr[j].type || rAttr[j].value !== sAttr[j].value) { match = false; break; } } if(match) { return r; } } return null; }, /** * Decrypt enveloped content * * @param recipient The recipient object related to the private key * @param privKey The (RSA) private key object */ decrypt: function(recipient, privKey) { if(msg.encryptedContent.key === undefined && recipient !== undefined && privKey !== undefined) { switch(recipient.encryptedContent.algorithm) { case forge.pki.oids.rsaEncryption: case forge.pki.oids.desCBC: var key = privKey.decrypt(recipient.encryptedContent.content); msg.encryptedContent.key = forge.util.createBuffer(key); break; default: throw new Error('Unsupported asymmetric cipher, ' + 'OID ' + recipient.encryptedContent.algorithm); } } _decryptContent(msg); }, /** * Add (another) entity to list of recipients. * * @param cert The certificate of the entity to add. */ addRecipient: function(cert) { msg.recipients.push({ version: 0, issuer: cert.issuer.attributes, serialNumber: cert.serialNumber, encryptedContent: { // We simply assume rsaEncryption here, since forge.pki only // supports RSA so far. If the PKI module supports other // ciphers one day, we need to modify this one as well. algorithm: forge.pki.oids.rsaEncryption, key: cert.publicKey } }); }, /** * Encrypt enveloped content. * * This function supports two optional arguments, cipher and key, which * can be used to influence symmetric encryption. Unless cipher is * provided, the cipher specified in encryptedContent.algorithm is used * (defaults to AES-256-CBC). If no key is provided, encryptedContent.key * is (re-)used. If that one's not set, a random key will be generated * automatically. * * @param [key] The key to be used for symmetric encryption. * @param [cipher] The OID of the symmetric cipher to use. */ encrypt: function(key, cipher) { // Part 1: Symmetric encryption if(msg.encryptedContent.content === undefined) { cipher = cipher || msg.encryptedContent.algorithm; key = key || msg.encryptedContent.key; var keyLen, ivLen, ciphFn; switch(cipher) { case forge.pki.oids['aes128-CBC']: keyLen = 16; ivLen = 16; ciphFn = forge.aes.createEncryptionCipher; break; case forge.pki.oids['aes192-CBC']: keyLen = 24; ivLen = 16; ciphFn = forge.aes.createEncryptionCipher; break; case forge.pki.oids['aes256-CBC']: keyLen = 32; ivLen = 16; ciphFn = forge.aes.createEncryptionCipher; break; case forge.pki.oids['des-EDE3-CBC']: keyLen = 24; ivLen = 8; ciphFn = forge.des.createEncryptionCipher; break; default: throw new Error('Unsupported symmetric cipher, OID ' + cipher); } if(key === undefined) { key = forge.util.createBuffer(forge.random.getBytes(keyLen)); } else if(key.length() != keyLen) { throw new Error('Symmetric key has wrong length; ' + 'got ' + key.length() + ' bytes, expected ' + keyLen + '.'); } // Keep a copy of the key & IV in the object, so the caller can // use it for whatever reason. msg.encryptedContent.algorithm = cipher; msg.encryptedContent.key = key; msg.encryptedContent.parameter = forge.util.createBuffer( forge.random.getBytes(ivLen)); var ciph = ciphFn(key); ciph.start(msg.encryptedContent.parameter.copy()); ciph.update(msg.content); // The finish function does PKCS#7 padding by default, therefore // no action required by us. if(!ciph.finish()) { throw new Error('Symmetric encryption failed.'); } msg.encryptedContent.content = ciph.output; } // Part 2: asymmetric encryption for each recipient for(var i = 0; i < msg.recipients.length; ++i) { var recipient = msg.recipients[i]; // Nothing to do, encryption already done. if(recipient.encryptedContent.content !== undefined) { continue; } switch(recipient.encryptedContent.algorithm) { case forge.pki.oids.rsaEncryption: recipient.encryptedContent.content = recipient.encryptedContent.key.encrypt( msg.encryptedContent.key.data); break; default: throw new Error('Unsupported asymmetric cipher, OID ' + recipient.encryptedContent.algorithm); } } } }; return msg; }; /** * Converts a single recipient from an ASN.1 object. * * @param obj the ASN.1 RecipientInfo. * * @return the recipient object. */ function _recipientFromAsn1(obj) { // validate EnvelopedData content block and capture data var capture = {}; var errors = []; if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) { var error = new Error('Cannot read PKCS#7 RecipientInfo. ' + 'ASN.1 object is not an PKCS#7 RecipientInfo.'); error.errors = errors; throw error; } return { version: capture.version.charCodeAt(0), issuer: forge.pki.RDNAttributesAsArray(capture.issuer), serialNumber: forge.util.createBuffer(capture.serial).toHex(), encryptedContent: { algorithm: asn1.derToOid(capture.encAlgorithm), parameter: capture.encParameter.value, content: capture.encKey } }; } /** * Converts a single recipient object to an ASN.1 object. * * @param obj the recipient object. * * @return the ASN.1 RecipientInfo. */ function _recipientToAsn1(obj) { return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Version asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(obj.version).getBytes()), // IssuerAndSerialNumber asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Name forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}), // Serial asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, forge.util.hexToBytes(obj.serialNumber)) ]), // KeyEncryptionAlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()), // Parameter, force NULL, only RSA supported for now. asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ]), // EncryptedKey asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.encryptedContent.content) ]); } /** * Map a set of RecipientInfo ASN.1 objects to recipient objects. * * @param infos an array of ASN.1 representations RecipientInfo (i.e. SET OF). * * @return an array of recipient objects. */ function _recipientsFromAsn1(infos) { var ret = []; for(var i = 0; i < infos.length; ++i) { ret.push(_recipientFromAsn1(infos[i])); } return ret; } /** * Map an array of recipient objects to ASN.1 RecipientInfo objects. * * @param recipients an array of recipientInfo objects. * * @return an array of ASN.1 RecipientInfos. */ function _recipientsToAsn1(recipients) { var ret = []; for(var i = 0; i < recipients.length; ++i) { ret.push(_recipientToAsn1(recipients[i])); } return ret; } /** * Converts a single signer from an ASN.1 object. * * @param obj the ASN.1 representation of a SignerInfo. * * @return the signer object. */ function _signerFromAsn1(obj) { // validate EnvelopedData content block and capture data var capture = {}; var errors = []; if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) { var error = new Error('Cannot read PKCS#7 SignerInfo. ' + 'ASN.1 object is not an PKCS#7 SignerInfo.'); error.errors = errors; throw error; } var rval = { version: capture.version.charCodeAt(0), issuer: forge.pki.RDNAttributesAsArray(capture.issuer), serialNumber: forge.util.createBuffer(capture.serial).toHex(), digestAlgorithm: asn1.derToOid(capture.digestAlgorithm), signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm), signature: capture.signature, authenticatedAttributes: [], unauthenticatedAttributes: [] }; // TODO: convert attributes var authenticatedAttributes = capture.authenticatedAttributes || []; var unauthenticatedAttributes = capture.unauthenticatedAttributes || []; return rval; } /** * Converts a single signerInfo object to an ASN.1 object. * * @param obj the signerInfo object. * * @return the ASN.1 representation of a SignerInfo. */ function _signerToAsn1(obj) { // SignerInfo var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(obj.version).getBytes()), // issuerAndSerialNumber asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // name forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}), // serial asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, forge.util.hexToBytes(obj.serialNumber)) ]), // digestAlgorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(obj.digestAlgorithm).getBytes()), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ]) ]); // authenticatedAttributes (OPTIONAL) if(obj.authenticatedAttributesAsn1) { // add ASN.1 previously generated during signing rval.value.push(obj.authenticatedAttributesAsn1); } // digestEncryptionAlgorithm rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(obj.signatureAlgorithm).getBytes()), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ])); // encryptedDigest rval.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature)); // unauthenticatedAttributes (OPTIONAL) if(obj.unauthenticatedAttributes.length > 0) { // [1] IMPLICIT var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []); for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) { var attr = obj.unauthenticatedAttributes[i]; attrsAsn1.values.push(_attributeToAsn1(attr)); } rval.value.push(attrsAsn1); } return rval; } /** * Map a set of SignerInfo ASN.1 objects to an array of signer objects. * * @param signerInfoAsn1s an array of ASN.1 SignerInfos (i.e. SET OF). * * @return an array of signers objects. */ function _signersFromAsn1(signerInfoAsn1s) { var ret = []; for(var i = 0; i < signerInfoAsn1s.length; ++i) { ret.push(_signerFromAsn1(signerInfoAsn1s[i])); } return ret; } /** * Map an array of signer objects to ASN.1 objects. * * @param signers an array of signer objects. * * @return an array of ASN.1 SignerInfos. */ function _signersToAsn1(signers) { var ret = []; for(var i = 0; i < signers.length; ++i) { ret.push(_signerToAsn1(signers[i])); } return ret; } /** * Convert an attribute object to an ASN.1 Attribute. * * @param attr the attribute object. * * @return the ASN.1 Attribute. */ function _attributeToAsn1(attr) { var value; // TODO: generalize to support more attributes if(attr.type === forge.pki.oids.contentType) { value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(attr.value).getBytes()); } else if(attr.type === forge.pki.oids.messageDigest) { value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, attr.value.bytes()); } else if(attr.type === forge.pki.oids.signingTime) { /* Note per RFC 2985: Dates between 1 January 1950 and 31 December 2049 (inclusive) MUST be encoded as UTCTime. Any dates with year values before 1950 or after 2049 MUST be encoded as GeneralizedTime. [Further,] UTCTime values MUST be expressed in Greenwich Mean Time (Zulu) and MUST include seconds (i.e., times are YYMMDDHHMMSSZ), even where the number of seconds is zero. Midnight (GMT) must be represented as "YYMMDD000000Z". */ // TODO: make these module-level constants var jan_1_1950 = new Date('1950-01-01T00:00:00Z'); var jan_1_2050 = new Date('2050-01-01T00:00:00Z'); var date = attr.value; if(typeof date === 'string') { // try to parse date var timestamp = Date.parse(date); if(!isNaN(timestamp)) { date = new Date(timestamp); } else if(date.length === 13) { // YYMMDDHHMMSSZ (13 chars for UTCTime) date = asn1.utcTimeToDate(date); } else { // assume generalized time date = asn1.generalizedTimeToDate(date); } } if(date >= jan_1_1950 && date < jan_1_2050) { value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false, asn1.dateToUtcTime(date)); } else { value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, asn1.dateToGeneralizedTime(date)); } } // TODO: expose as common API call // create a RelativeDistinguishedName set // each value in the set is an AttributeTypeAndValue first // containing the type (an OID) and second the value return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AttributeType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(attr.type).getBytes()), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ // AttributeValue value ]) ]); } /** * Map messages encrypted content to ASN.1 objects. * * @param ec The encryptedContent object of the message. * * @return ASN.1 representation of the encryptedContent object (SEQUENCE). */ function _encryptedContentToAsn1(ec) { return [ // ContentType, always Data for the moment asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(forge.pki.oids.data).getBytes()), // ContentEncryptionAlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(ec.algorithm).getBytes()), // Parameters (IV) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ec.parameter.getBytes()) ]), // [0] EncryptedContent asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ec.content.getBytes()) ]) ]; } /** * Reads the "common part" of an PKCS#7 content block (in ASN.1 format) * * This function reads the "common part" of the PKCS#7 content blocks * EncryptedData and EnvelopedData, i.e. version number and symmetrically * encrypted content block. * * The result of the ASN.1 validate and capture process is returned * to allow the caller to extract further data, e.g. the list of recipients * in case of a EnvelopedData object. * * @param msg the PKCS#7 object to read the data to. * @param obj the ASN.1 representation of the content block. * @param validator the ASN.1 structure validator object to use. * * @return the value map captured by validator object. */ function _fromAsn1(msg, obj, validator) { var capture = {}; var errors = []; if(!asn1.validate(obj, validator, capture, errors)) { var error = new Error('Cannot read PKCS#7 message. ' + 'ASN.1 object is not a supported PKCS#7 message.'); error.errors = error; throw error; } // Check contentType, so far we only support (raw) Data. var contentType = asn1.derToOid(capture.contentType); if(contentType !== forge.pki.oids.data) { throw new Error('Unsupported PKCS#7 message. ' + 'Only wrapped ContentType Data supported.'); } if(capture.encryptedContent) { var content = ''; if(forge.util.isArray(capture.encryptedContent)) { for(var i = 0; i < capture.encryptedContent.length; ++i) { if(capture.encryptedContent[i].type !== asn1.Type.OCTETSTRING) { throw new Error('Malformed PKCS#7 message, expecting encrypted ' + 'content constructed of only OCTET STRING objects.'); } content += capture.encryptedContent[i].value; } } else { content = capture.encryptedContent; } msg.encryptedContent = { algorithm: asn1.derToOid(capture.encAlgorithm), parameter: forge.util.createBuffer(capture.encParameter.value), content: forge.util.createBuffer(content) }; } if(capture.content) { var content = ''; if(forge.util.isArray(capture.content)) { for(var i = 0; i < capture.content.length; ++i) { if(capture.content[i].type !== asn1.Type.OCTETSTRING) { throw new Error('Malformed PKCS#7 message, expecting ' + 'content constructed of only OCTET STRING objects.'); } content += capture.content[i].value; } } else { content = capture.content; } msg.content = forge.util.createBuffer(content); } msg.version = capture.version.charCodeAt(0); msg.rawCapture = capture; return capture; } /** * Decrypt the symmetrically encrypted content block of the PKCS#7 message. * * Decryption is skipped in case the PKCS#7 message object already has a * (decrypted) content attribute. The algorithm, key and cipher parameters * (probably the iv) are taken from the encryptedContent attribute of the * message object. * * @param The PKCS#7 message object. */ function _decryptContent(msg) { if(msg.encryptedContent.key === undefined) { throw new Error('Symmetric key not available.'); } if(msg.content === undefined) { var ciph; switch(msg.encryptedContent.algorithm) { case forge.pki.oids['aes128-CBC']: case forge.pki.oids['aes192-CBC']: case forge.pki.oids['aes256-CBC']: ciph = forge.aes.createDecryptionCipher(msg.encryptedContent.key); break; case forge.pki.oids['desCBC']: case forge.pki.oids['des-EDE3-CBC']: ciph = forge.des.createDecryptionCipher(msg.encryptedContent.key); break; default: throw new Error('Unsupported symmetric cipher, OID ' + msg.encryptedContent.algorithm); } ciph.start(msg.encryptedContent.parameter); ciph.update(msg.encryptedContent.content); if(!ciph.finish()) { throw new Error('Symmetric decryption failed.'); } msg.content = ciph.output; } } /***/ }), /***/ 70266: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of ASN.1 validators for PKCS#7 v1.5. * * @author Dave Longley * @author Stefan Siegl * * Copyright (c) 2012-2015 Digital Bazaar, Inc. * Copyright (c) 2012 Stefan Siegl * * The ASN.1 representation of PKCS#7 is as follows * (see RFC #2315 for details, http://www.ietf.org/rfc/rfc2315.txt): * * A PKCS#7 message consists of a ContentInfo on root level, which may * contain any number of further ContentInfo nested into it. * * ContentInfo ::= SEQUENCE { * contentType ContentType, * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL * } * * ContentType ::= OBJECT IDENTIFIER * * EnvelopedData ::= SEQUENCE { * version Version, * recipientInfos RecipientInfos, * encryptedContentInfo EncryptedContentInfo * } * * EncryptedData ::= SEQUENCE { * version Version, * encryptedContentInfo EncryptedContentInfo * } * * id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) * us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } * * SignedData ::= SEQUENCE { * version INTEGER, * digestAlgorithms DigestAlgorithmIdentifiers, * contentInfo ContentInfo, * certificates [0] IMPLICIT Certificates OPTIONAL, * crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, * signerInfos SignerInfos * } * * SignerInfos ::= SET OF SignerInfo * * SignerInfo ::= SEQUENCE { * version Version, * issuerAndSerialNumber IssuerAndSerialNumber, * digestAlgorithm DigestAlgorithmIdentifier, * authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL, * digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier, * encryptedDigest EncryptedDigest, * unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL * } * * EncryptedDigest ::= OCTET STRING * * Attributes ::= SET OF Attribute * * Attribute ::= SEQUENCE { * attrType OBJECT IDENTIFIER, * attrValues SET OF AttributeValue * } * * AttributeValue ::= ANY * * Version ::= INTEGER * * RecipientInfos ::= SET OF RecipientInfo * * EncryptedContentInfo ::= SEQUENCE { * contentType ContentType, * contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, * encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL * } * * ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier * * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters * for the algorithm, if any. In the case of AES and DES3, there is only one, * the IV. * * AlgorithmIdentifer ::= SEQUENCE { * algorithm OBJECT IDENTIFIER, * parameters ANY DEFINED BY algorithm OPTIONAL * } * * EncryptedContent ::= OCTET STRING * * RecipientInfo ::= SEQUENCE { * version Version, * issuerAndSerialNumber IssuerAndSerialNumber, * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, * encryptedKey EncryptedKey * } * * IssuerAndSerialNumber ::= SEQUENCE { * issuer Name, * serialNumber CertificateSerialNumber * } * * CertificateSerialNumber ::= INTEGER * * KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier * * EncryptedKey ::= OCTET STRING */ var forge = __webpack_require__(89177); __webpack_require__(39549); __webpack_require__(28339); // shortcut for ASN.1 API var asn1 = forge.asn1; // shortcut for PKCS#7 API var p7v = module.exports = forge.pkcs7asn1 = forge.pkcs7asn1 || {}; forge.pkcs7 = forge.pkcs7 || {}; forge.pkcs7.asn1 = p7v; var contentInfoValidator = { name: 'ContentInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'ContentInfo.ContentType', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'contentType' }, { name: 'ContentInfo.content', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, optional: true, captureAsn1: 'content' }] }; p7v.contentInfoValidator = contentInfoValidator; var encryptedContentInfoValidator = { name: 'EncryptedContentInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'EncryptedContentInfo.contentType', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'contentType' }, { name: 'EncryptedContentInfo.contentEncryptionAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'EncryptedContentInfo.contentEncryptionAlgorithm.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'encAlgorithm' }, { name: 'EncryptedContentInfo.contentEncryptionAlgorithm.parameter', tagClass: asn1.Class.UNIVERSAL, captureAsn1: 'encParameter' }] }, { name: 'EncryptedContentInfo.encryptedContent', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, /* The PKCS#7 structure output by OpenSSL somewhat differs from what * other implementations do generate. * * OpenSSL generates a structure like this: * SEQUENCE { * ... * [0] * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 * ... * } * * Whereas other implementations (and this PKCS#7 module) generate: * SEQUENCE { * ... * [0] { * OCTET STRING * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 * ... * } * } * * In order to support both, we just capture the context specific * field here. The OCTET STRING bit is removed below. */ capture: 'encryptedContent', captureAsn1: 'encryptedContentAsn1' }] }; p7v.envelopedDataValidator = { name: 'EnvelopedData', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'EnvelopedData.Version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'version' }, { name: 'EnvelopedData.RecipientInfos', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true, captureAsn1: 'recipientInfos' }].concat(encryptedContentInfoValidator) }; p7v.encryptedDataValidator = { name: 'EncryptedData', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'EncryptedData.Version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'version' }].concat(encryptedContentInfoValidator) }; var signerValidator = { name: 'SignerInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'SignerInfo.version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false }, { name: 'SignerInfo.issuerAndSerialNumber', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'SignerInfo.issuerAndSerialNumber.issuer', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'issuer' }, { name: 'SignerInfo.issuerAndSerialNumber.serialNumber', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'serial' }] }, { name: 'SignerInfo.digestAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'SignerInfo.digestAlgorithm.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'digestAlgorithm' }, { name: 'SignerInfo.digestAlgorithm.parameter', tagClass: asn1.Class.UNIVERSAL, constructed: false, captureAsn1: 'digestParameter', optional: true }] }, { name: 'SignerInfo.authenticatedAttributes', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, optional: true, capture: 'authenticatedAttributes' }, { name: 'SignerInfo.digestEncryptionAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, capture: 'signatureAlgorithm' }, { name: 'SignerInfo.encryptedDigest', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'signature' }, { name: 'SignerInfo.unauthenticatedAttributes', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 1, constructed: true, optional: true, capture: 'unauthenticatedAttributes' }] }; p7v.signedDataValidator = { name: 'SignedData', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'SignedData.Version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'version' }, { name: 'SignedData.DigestAlgorithms', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true, captureAsn1: 'digestAlgorithms' }, contentInfoValidator, { name: 'SignedData.Certificates', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, optional: true, captureAsn1: 'certificates' }, { name: 'SignedData.CertificateRevocationLists', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 1, optional: true, captureAsn1: 'crls' }, { name: 'SignedData.SignerInfos', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, capture: 'signerInfos', optional: true, value: [signerValidator] }] }; p7v.recipientInfoValidator = { name: 'RecipientInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'RecipientInfo.version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'version' }, { name: 'RecipientInfo.issuerAndSerial', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'RecipientInfo.issuerAndSerial.issuer', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'issuer' }, { name: 'RecipientInfo.issuerAndSerial.serialNumber', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'serial' }] }, { name: 'RecipientInfo.keyEncryptionAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'RecipientInfo.keyEncryptionAlgorithm.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'encAlgorithm' }, { name: 'RecipientInfo.keyEncryptionAlgorithm.parameter', tagClass: asn1.Class.UNIVERSAL, constructed: false, captureAsn1: 'encParameter' }] }, { name: 'RecipientInfo.encryptedKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'encKey' }] }; /***/ }), /***/ 6924: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of a basic Public Key Infrastructure, including * support for RSA public and private keys. * * @author Dave Longley * * Copyright (c) 2010-2013 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(39549); __webpack_require__(81925); __webpack_require__(21281); __webpack_require__(70154); __webpack_require__(98474); __webpack_require__(30466); __webpack_require__(4376); __webpack_require__(53921); __webpack_require__(28339); __webpack_require__(8180); // shortcut for asn.1 API var asn1 = forge.asn1; /* Public Key Infrastructure (PKI) implementation. */ var pki = module.exports = forge.pki = forge.pki || {}; /** * NOTE: THIS METHOD IS DEPRECATED. Use pem.decode() instead. * * Converts PEM-formatted data to DER. * * @param pem the PEM-formatted data. * * @return the DER-formatted data. */ pki.pemToDer = function(pem) { var msg = forge.pem.decode(pem)[0]; if(msg.procType && msg.procType.type === 'ENCRYPTED') { throw new Error('Could not convert PEM to DER; PEM is encrypted.'); } return forge.util.createBuffer(msg.body); }; /** * Converts an RSA private key from PEM format. * * @param pem the PEM-formatted private key. * * @return the private key. */ pki.privateKeyFromPem = function(pem) { var msg = forge.pem.decode(pem)[0]; if(msg.type !== 'PRIVATE KEY' && msg.type !== 'RSA PRIVATE KEY') { var error = new Error('Could not convert private key from PEM; PEM ' + 'header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".'); error.headerType = msg.type; throw error; } if(msg.procType && msg.procType.type === 'ENCRYPTED') { throw new Error('Could not convert private key from PEM; PEM is encrypted.'); } // convert DER to ASN.1 object var obj = asn1.fromDer(msg.body); return pki.privateKeyFromAsn1(obj); }; /** * Converts an RSA private key to PEM format. * * @param key the private key. * @param maxline the maximum characters per line, defaults to 64. * * @return the PEM-formatted private key. */ pki.privateKeyToPem = function(key, maxline) { // convert to ASN.1, then DER, then PEM-encode var msg = { type: 'RSA PRIVATE KEY', body: asn1.toDer(pki.privateKeyToAsn1(key)).getBytes() }; return forge.pem.encode(msg, {maxline: maxline}); }; /** * Converts a PrivateKeyInfo to PEM format. * * @param pki the PrivateKeyInfo. * @param maxline the maximum characters per line, defaults to 64. * * @return the PEM-formatted private key. */ pki.privateKeyInfoToPem = function(pki, maxline) { // convert to DER, then PEM-encode var msg = { type: 'PRIVATE KEY', body: asn1.toDer(pki).getBytes() }; return forge.pem.encode(msg, {maxline: maxline}); }; /***/ }), /***/ 6861: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Prime number generation API. * * @author Dave Longley * * Copyright (c) 2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(28339); __webpack_require__(98007); __webpack_require__(57821); (function() { // forge.prime already defined if(forge.prime) { module.exports = forge.prime; return; } /* PRIME API */ var prime = module.exports = forge.prime = forge.prime || {}; var BigInteger = forge.jsbn.BigInteger; // primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; var THIRTY = new BigInteger(null); THIRTY.fromInt(30); var op_or = function(x, y) {return x|y;}; /** * Generates a random probable prime with the given number of bits. * * Alternative algorithms can be specified by name as a string or as an * object with custom options like so: * * { * name: 'PRIMEINC', * options: { * maxBlockTime: , * millerRabinTests: , * workerScript: , * workers: . * workLoad: the size of the work load, ie: number of possible prime * numbers for each web worker to check per work assignment, * (default: 100). * } * } * * @param bits the number of bits for the prime number. * @param options the options to use. * [algorithm] the algorithm to use (default: 'PRIMEINC'). * [prng] a custom crypto-secure pseudo-random number generator to use, * that must define "getBytesSync". * * @return callback(err, num) called once the operation completes. */ prime.generateProbablePrime = function(bits, options, callback) { if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; // default to PRIMEINC algorithm var algorithm = options.algorithm || 'PRIMEINC'; if(typeof algorithm === 'string') { algorithm = {name: algorithm}; } algorithm.options = algorithm.options || {}; // create prng with api that matches BigInteger secure random var prng = options.prng || forge.random; var rng = { // x is an array to fill with bytes nextBytes: function(x) { var b = prng.getBytesSync(x.length); for(var i = 0; i < x.length; ++i) { x[i] = b.charCodeAt(i); } } }; if(algorithm.name === 'PRIMEINC') { return primeincFindPrime(bits, rng, algorithm.options, callback); } throw new Error('Invalid prime generation algorithm: ' + algorithm.name); }; function primeincFindPrime(bits, rng, options, callback) { if('workers' in options) { return primeincFindPrimeWithWorkers(bits, rng, options, callback); } return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); } function primeincFindPrimeWithoutWorkers(bits, rng, options, callback) { // initialize random number var num = generateRandom(bits, rng); /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The number we are given is always aligned at 30k + 1. Each time the number is determined not to be prime we add to get to the next 'i', eg: if the number was at 30k + 1 we add 6. */ var deltaIdx = 0; // get required number of MR tests var mrTests = getMillerRabinTests(num.bitLength()); if('millerRabinTests' in options) { mrTests = options.millerRabinTests; } // find prime nearest to 'num' for maxBlockTime ms // 10 ms gives 5ms of leeway for other calculations before dropping // below 60fps (1000/60 == 16.67), but in reality, the number will // likely be higher due to an 'atomic' big int modPow var maxBlockTime = 10; if('maxBlockTime' in options) { maxBlockTime = options.maxBlockTime; } _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); } function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) { var start = +new Date(); do { // overflow, regenerate random number if(num.bitLength() > bits) { num = generateRandom(bits, rng); } // do primality test if(num.isProbablePrime(mrTests)) { return callback(null, num); } // get next potential prime num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); } while(maxBlockTime < 0 || (+new Date() - start < maxBlockTime)); // keep trying later forge.util.setImmediate(function() { _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); }); } // NOTE: This algorithm is indeterminate in nature because workers // run in parallel looking at different segments of numbers. Even if this // algorithm is run twice with the same input from a predictable RNG, it // may produce different outputs. function primeincFindPrimeWithWorkers(bits, rng, options, callback) { // web workers unavailable if(typeof Worker === 'undefined') { return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); } // initialize random number var num = generateRandom(bits, rng); // use web workers to generate keys var numWorkers = options.workers; var workLoad = options.workLoad || 100; var range = workLoad * 30 / 8; var workerScript = options.workerScript || 'forge/prime.worker.js'; if(numWorkers === -1) { return forge.util.estimateCores(function(err, cores) { if(err) { // default to 2 cores = 2; } numWorkers = cores - 1; generate(); }); } generate(); function generate() { // require at least 1 worker numWorkers = Math.max(1, numWorkers); // TODO: consider optimizing by starting workers outside getPrime() ... // note that in order to clean up they will have to be made internally // asynchronous which may actually be slower // start workers immediately var workers = []; for(var i = 0; i < numWorkers; ++i) { // FIXME: fix path or use blob URLs workers[i] = new Worker(workerScript); } var running = numWorkers; // listen for requests from workers and assign ranges to find prime for(var i = 0; i < numWorkers; ++i) { workers[i].addEventListener('message', workerMessage); } /* Note: The distribution of random numbers is unknown. Therefore, each web worker is continuously allocated a range of numbers to check for a random number until one is found. Every 30 numbers will be checked just 8 times, because prime numbers have the form: 30k+i, for i < 30 and gcd(30, i)=1 (there are 8 values of i for this) Therefore, if we want a web worker to run N checks before asking for a new range of numbers, each range must contain N*30/8 numbers. For 100 checks (workLoad), this is a range of 375. */ var found = false; function workerMessage(e) { // ignore message, prime already found if(found) { return; } --running; var data = e.data; if(data.found) { // terminate all workers for(var i = 0; i < workers.length; ++i) { workers[i].terminate(); } found = true; return callback(null, new BigInteger(data.prime, 16)); } // overflow, regenerate random number if(num.bitLength() > bits) { num = generateRandom(bits, rng); } // assign new range to check var hex = num.toString(16); // start prime search e.target.postMessage({ hex: hex, workLoad: workLoad }); num.dAddOffset(range, 0); } } } /** * Generates a random number using the given number of bits and RNG. * * @param bits the number of bits for the number. * @param rng the random number generator to use. * * @return the random number. */ function generateRandom(bits, rng) { var num = new BigInteger(bits, rng); // force MSB set var bits1 = bits - 1; if(!num.testBit(bits1)) { num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num); } // align number on 30k+1 boundary num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0); return num; } /** * Returns the required number of Miller-Rabin tests to generate a * prime with an error probability of (1/2)^80. * * See Handbook of Applied Cryptography Chapter 4, Table 4.4. * * @param bits the bit size. * * @return the required number of iterations. */ function getMillerRabinTests(bits) { if(bits <= 100) return 27; if(bits <= 150) return 18; if(bits <= 200) return 15; if(bits <= 250) return 12; if(bits <= 300) return 9; if(bits <= 350) return 8; if(bits <= 400) return 7; if(bits <= 500) return 6; if(bits <= 600) return 5; if(bits <= 800) return 4; if(bits <= 1250) return 3; return 2; } })(); /***/ }), /***/ 94467: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * A javascript implementation of a cryptographically-secure * Pseudo Random Number Generator (PRNG). The Fortuna algorithm is followed * here though the use of SHA-256 is not enforced; when generating an * a PRNG context, the hashing algorithm and block cipher used for * the generator are specified via a plugin. * * @author Dave Longley * * Copyright (c) 2010-2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(28339); var _crypto = null; if(forge.util.isNodejs && !forge.options.usePureJavaScript && !process.versions['node-webkit']) { _crypto = __webpack_require__(76417); } /* PRNG API */ var prng = module.exports = forge.prng = forge.prng || {}; /** * Creates a new PRNG context. * * A PRNG plugin must be passed in that will provide: * * 1. A function that initializes the key and seed of a PRNG context. It * will be given a 16 byte key and a 16 byte seed. Any key expansion * or transformation of the seed from a byte string into an array of * integers (or similar) should be performed. * 2. The cryptographic function used by the generator. It takes a key and * a seed. * 3. A seed increment function. It takes the seed and returns seed + 1. * 4. An api to create a message digest. * * For an example, see random.js. * * @param plugin the PRNG plugin to use. */ prng.create = function(plugin) { var ctx = { plugin: plugin, key: null, seed: null, time: null, // number of reseeds so far reseeds: 0, // amount of data generated so far generated: 0, // no initial key bytes keyBytes: '' }; // create 32 entropy pools (each is a message digest) var md = plugin.md; var pools = new Array(32); for(var i = 0; i < 32; ++i) { pools[i] = md.create(); } ctx.pools = pools; // entropy pools are written to cyclically, starting at index 0 ctx.pool = 0; /** * Generates random bytes. The bytes may be generated synchronously or * asynchronously. Web workers must use the asynchronous interface or * else the behavior is undefined. * * @param count the number of random bytes to generate. * @param [callback(err, bytes)] called once the operation completes. * * @return count random bytes as a string. */ ctx.generate = function(count, callback) { // do synchronously if(!callback) { return ctx.generateSync(count); } // simple generator using counter-based CBC var cipher = ctx.plugin.cipher; var increment = ctx.plugin.increment; var formatKey = ctx.plugin.formatKey; var formatSeed = ctx.plugin.formatSeed; var b = forge.util.createBuffer(); // paranoid deviation from Fortuna: // reset key for every request to protect previously // generated random bytes should the key be discovered; // there is no 100ms based reseeding because of this // forced reseed for every `generate` call ctx.key = null; generate(); function generate(err) { if(err) { return callback(err); } // sufficient bytes generated if(b.length() >= count) { return callback(null, b.getBytes(count)); } // if amount of data generated is greater than 1 MiB, trigger reseed if(ctx.generated > 0xfffff) { ctx.key = null; } if(ctx.key === null) { // prevent stack overflow return forge.util.nextTick(function() { _reseed(generate); }); } // generate the random bytes var bytes = cipher(ctx.key, ctx.seed); ctx.generated += bytes.length; b.putBytes(bytes); // generate bytes for a new key and seed ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); forge.util.setImmediate(generate); } }; /** * Generates random bytes synchronously. * * @param count the number of random bytes to generate. * * @return count random bytes as a string. */ ctx.generateSync = function(count) { // simple generator using counter-based CBC var cipher = ctx.plugin.cipher; var increment = ctx.plugin.increment; var formatKey = ctx.plugin.formatKey; var formatSeed = ctx.plugin.formatSeed; // paranoid deviation from Fortuna: // reset key for every request to protect previously // generated random bytes should the key be discovered; // there is no 100ms based reseeding because of this // forced reseed for every `generateSync` call ctx.key = null; var b = forge.util.createBuffer(); while(b.length() < count) { // if amount of data generated is greater than 1 MiB, trigger reseed if(ctx.generated > 0xfffff) { ctx.key = null; } if(ctx.key === null) { _reseedSync(); } // generate the random bytes var bytes = cipher(ctx.key, ctx.seed); ctx.generated += bytes.length; b.putBytes(bytes); // generate bytes for a new key and seed ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); } return b.getBytes(count); }; /** * Private function that asynchronously reseeds a generator. * * @param callback(err) called once the operation completes. */ function _reseed(callback) { if(ctx.pools[0].messageLength >= 32) { _seed(); return callback(); } // not enough seed data... var needed = (32 - ctx.pools[0].messageLength) << 5; ctx.seedFile(needed, function(err, bytes) { if(err) { return callback(err); } ctx.collect(bytes); _seed(); callback(); }); } /** * Private function that synchronously reseeds a generator. */ function _reseedSync() { if(ctx.pools[0].messageLength >= 32) { return _seed(); } // not enough seed data... var needed = (32 - ctx.pools[0].messageLength) << 5; ctx.collect(ctx.seedFileSync(needed)); _seed(); } /** * Private function that seeds a generator once enough bytes are available. */ function _seed() { // update reseed count ctx.reseeds = (ctx.reseeds === 0xffffffff) ? 0 : ctx.reseeds + 1; // goal is to update `key` via: // key = hash(key + s) // where 's' is all collected entropy from selected pools, then... // create a plugin-based message digest var md = ctx.plugin.md.create(); // consume current key bytes md.update(ctx.keyBytes); // digest the entropy of pools whose index k meet the // condition 'n mod 2^k == 0' where n is the number of reseeds var _2powK = 1; for(var k = 0; k < 32; ++k) { if(ctx.reseeds % _2powK === 0) { md.update(ctx.pools[k].digest().getBytes()); ctx.pools[k].start(); } _2powK = _2powK << 1; } // get digest for key bytes ctx.keyBytes = md.digest().getBytes(); // paranoid deviation from Fortuna: // update `seed` via `seed = hash(key)` // instead of initializing to zero once and only // ever incrementing it md.start(); md.update(ctx.keyBytes); var seedBytes = md.digest().getBytes(); // update state ctx.key = ctx.plugin.formatKey(ctx.keyBytes); ctx.seed = ctx.plugin.formatSeed(seedBytes); ctx.generated = 0; } /** * The built-in default seedFile. This seedFile is used when entropy * is needed immediately. * * @param needed the number of bytes that are needed. * * @return the random bytes. */ function defaultSeedFile(needed) { // use window.crypto.getRandomValues strong source of entropy if available var getRandomValues = null; var globalScope = forge.util.globalScope; var _crypto = globalScope.crypto || globalScope.msCrypto; if(_crypto && _crypto.getRandomValues) { getRandomValues = function(arr) { return _crypto.getRandomValues(arr); }; } var b = forge.util.createBuffer(); if(getRandomValues) { while(b.length() < needed) { // max byte length is 65536 before QuotaExceededError is thrown // http://www.w3.org/TR/WebCryptoAPI/#RandomSource-method-getRandomValues var count = Math.max(1, Math.min(needed - b.length(), 65536) / 4); var entropy = new Uint32Array(Math.floor(count)); try { getRandomValues(entropy); for(var i = 0; i < entropy.length; ++i) { b.putInt32(entropy[i]); } } catch(e) { /* only ignore QuotaExceededError */ if(!(typeof QuotaExceededError !== 'undefined' && e instanceof QuotaExceededError)) { throw e; } } } } // be sad and add some weak random data if(b.length() < needed) { /* Draws from Park-Miller "minimal standard" 31 bit PRNG, implemented with David G. Carta's optimization: with 32 bit math and without division (Public Domain). */ var hi, lo, next; var seed = Math.floor(Math.random() * 0x010000); while(b.length() < needed) { lo = 16807 * (seed & 0xFFFF); hi = 16807 * (seed >> 16); lo += (hi & 0x7FFF) << 16; lo += hi >> 15; lo = (lo & 0x7FFFFFFF) + (lo >> 31); seed = lo & 0xFFFFFFFF; // consume lower 3 bytes of seed for(var i = 0; i < 3; ++i) { // throw in more pseudo random next = seed >>> (i << 3); next ^= Math.floor(Math.random() * 0x0100); b.putByte(String.fromCharCode(next & 0xFF)); } } } return b.getBytes(needed); } // initialize seed file APIs if(_crypto) { // use nodejs async API ctx.seedFile = function(needed, callback) { _crypto.randomBytes(needed, function(err, bytes) { if(err) { return callback(err); } callback(null, bytes.toString()); }); }; // use nodejs sync API ctx.seedFileSync = function(needed) { return _crypto.randomBytes(needed).toString(); }; } else { ctx.seedFile = function(needed, callback) { try { callback(null, defaultSeedFile(needed)); } catch(e) { callback(e); } }; ctx.seedFileSync = defaultSeedFile; } /** * Adds entropy to a prng ctx's accumulator. * * @param bytes the bytes of entropy as a string. */ ctx.collect = function(bytes) { // iterate over pools distributing entropy cyclically var count = bytes.length; for(var i = 0; i < count; ++i) { ctx.pools[ctx.pool].update(bytes.substr(i, 1)); ctx.pool = (ctx.pool === 31) ? 0 : ctx.pool + 1; } }; /** * Collects an integer of n bits. * * @param i the integer entropy. * @param n the number of bits in the integer. */ ctx.collectInt = function(i, n) { var bytes = ''; for(var x = 0; x < n; x += 8) { bytes += String.fromCharCode((i >> x) & 0xFF); } ctx.collect(bytes); }; /** * Registers a Web Worker to receive immediate entropy from the main thread. * This method is required until Web Workers can access the native crypto * API. This method should be called twice for each created worker, once in * the main thread, and once in the worker itself. * * @param worker the worker to register. */ ctx.registerWorker = function(worker) { // worker receives random bytes if(worker === self) { ctx.seedFile = function(needed, callback) { function listener(e) { var data = e.data; if(data.forge && data.forge.prng) { self.removeEventListener('message', listener); callback(data.forge.prng.err, data.forge.prng.bytes); } } self.addEventListener('message', listener); self.postMessage({forge: {prng: {needed: needed}}}); }; } else { // main thread sends random bytes upon request var listener = function(e) { var data = e.data; if(data.forge && data.forge.prng) { ctx.seedFile(data.forge.prng.needed, function(err, bytes) { worker.postMessage({forge: {prng: {err: err, bytes: bytes}}}); }); } }; // TODO: do we need to remove the event listener when the worker dies? worker.addEventListener('message', listener); } }; return ctx; }; /***/ }), /***/ 4376: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of PKCS#1 PSS signature padding. * * @author Stefan Siegl * * Copyright (c) 2012 Stefan Siegl */ var forge = __webpack_require__(89177); __webpack_require__(57821); __webpack_require__(28339); // shortcut for PSS API var pss = module.exports = forge.pss = forge.pss || {}; /** * Creates a PSS signature scheme object. * * There are several ways to provide a salt for encoding: * * 1. Specify the saltLength only and the built-in PRNG will generate it. * 2. Specify the saltLength and a custom PRNG with 'getBytesSync' defined that * will be used. * 3. Specify the salt itself as a forge.util.ByteBuffer. * * @param options the options to use: * md the message digest object to use, a forge md instance. * mgf the mask generation function to use, a forge mgf instance. * [saltLength] the length of the salt in octets. * [prng] the pseudo-random number generator to use to produce a salt. * [salt] the salt to use when encoding. * * @return a signature scheme object. */ pss.create = function(options) { // backwards compatibility w/legacy args: hash, mgf, sLen if(arguments.length === 3) { options = { md: arguments[0], mgf: arguments[1], saltLength: arguments[2] }; } var hash = options.md; var mgf = options.mgf; var hLen = hash.digestLength; var salt_ = options.salt || null; if(typeof salt_ === 'string') { // assume binary-encoded string salt_ = forge.util.createBuffer(salt_); } var sLen; if('saltLength' in options) { sLen = options.saltLength; } else if(salt_ !== null) { sLen = salt_.length(); } else { throw new Error('Salt length not specified or specific salt not given.'); } if(salt_ !== null && salt_.length() !== sLen) { throw new Error('Given salt length does not match length of given salt.'); } var prng = options.prng || forge.random; var pssobj = {}; /** * Encodes a PSS signature. * * This function implements EMSA-PSS-ENCODE as per RFC 3447, section 9.1.1. * * @param md the message digest object with the hash to sign. * @param modsBits the length of the RSA modulus in bits. * * @return the encoded message as a binary-encoded string of length * ceil((modBits - 1) / 8). */ pssobj.encode = function(md, modBits) { var i; var emBits = modBits - 1; var emLen = Math.ceil(emBits / 8); /* 2. Let mHash = Hash(M), an octet string of length hLen. */ var mHash = md.digest().getBytes(); /* 3. If emLen < hLen + sLen + 2, output "encoding error" and stop. */ if(emLen < hLen + sLen + 2) { throw new Error('Message is too long to encrypt.'); } /* 4. Generate a random octet string salt of length sLen; if sLen = 0, * then salt is the empty string. */ var salt; if(salt_ === null) { salt = prng.getBytesSync(sLen); } else { salt = salt_.bytes(); } /* 5. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; */ var m_ = new forge.util.ByteBuffer(); m_.fillWithByte(0, 8); m_.putBytes(mHash); m_.putBytes(salt); /* 6. Let H = Hash(M'), an octet string of length hLen. */ hash.start(); hash.update(m_.getBytes()); var h = hash.digest().getBytes(); /* 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2 * zero octets. The length of PS may be 0. */ var ps = new forge.util.ByteBuffer(); ps.fillWithByte(0, emLen - sLen - hLen - 2); /* 8. Let DB = PS || 0x01 || salt; DB is an octet string of length * emLen - hLen - 1. */ ps.putByte(0x01); ps.putBytes(salt); var db = ps.getBytes(); /* 9. Let dbMask = MGF(H, emLen - hLen - 1). */ var maskLen = emLen - hLen - 1; var dbMask = mgf.generate(h, maskLen); /* 10. Let maskedDB = DB \xor dbMask. */ var maskedDB = ''; for(i = 0; i < maskLen; i++) { maskedDB += String.fromCharCode(db.charCodeAt(i) ^ dbMask.charCodeAt(i)); } /* 11. Set the leftmost 8emLen - emBits bits of the leftmost octet in * maskedDB to zero. */ var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF; maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) + maskedDB.substr(1); /* 12. Let EM = maskedDB || H || 0xbc. * 13. Output EM. */ return maskedDB + h + String.fromCharCode(0xbc); }; /** * Verifies a PSS signature. * * This function implements EMSA-PSS-VERIFY as per RFC 3447, section 9.1.2. * * @param mHash the message digest hash, as a binary-encoded string, to * compare against the signature. * @param em the encoded message, as a binary-encoded string * (RSA decryption result). * @param modsBits the length of the RSA modulus in bits. * * @return true if the signature was verified, false if not. */ pssobj.verify = function(mHash, em, modBits) { var i; var emBits = modBits - 1; var emLen = Math.ceil(emBits / 8); /* c. Convert the message representative m to an encoded message EM * of length emLen = ceil((modBits - 1) / 8) octets, where modBits * is the length in bits of the RSA modulus n */ em = em.substr(-emLen); /* 3. If emLen < hLen + sLen + 2, output "inconsistent" and stop. */ if(emLen < hLen + sLen + 2) { throw new Error('Inconsistent parameters to PSS signature verification.'); } /* 4. If the rightmost octet of EM does not have hexadecimal value * 0xbc, output "inconsistent" and stop. */ if(em.charCodeAt(emLen - 1) !== 0xbc) { throw new Error('Encoded message does not end in 0xBC.'); } /* 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and * let H be the next hLen octets. */ var maskLen = emLen - hLen - 1; var maskedDB = em.substr(0, maskLen); var h = em.substr(maskLen, hLen); /* 6. If the leftmost 8emLen - emBits bits of the leftmost octet in * maskedDB are not all equal to zero, output "inconsistent" and stop. */ var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF; if((maskedDB.charCodeAt(0) & mask) !== 0) { throw new Error('Bits beyond keysize not zero as expected.'); } /* 7. Let dbMask = MGF(H, emLen - hLen - 1). */ var dbMask = mgf.generate(h, maskLen); /* 8. Let DB = maskedDB \xor dbMask. */ var db = ''; for(i = 0; i < maskLen; i++) { db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i)); } /* 9. Set the leftmost 8emLen - emBits bits of the leftmost octet * in DB to zero. */ db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1); /* 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero * or if the octet at position emLen - hLen - sLen - 1 (the leftmost * position is "position 1") does not have hexadecimal value 0x01, * output "inconsistent" and stop. */ var checkLen = emLen - hLen - sLen - 2; for(i = 0; i < checkLen; i++) { if(db.charCodeAt(i) !== 0x00) { throw new Error('Leftmost octets not zero as expected'); } } if(db.charCodeAt(checkLen) !== 0x01) { throw new Error('Inconsistent PSS signature, 0x01 marker not found'); } /* 11. Let salt be the last sLen octets of DB. */ var salt = db.substr(-sLen); /* 12. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt */ var m_ = new forge.util.ByteBuffer(); m_.fillWithByte(0, 8); m_.putBytes(mHash); m_.putBytes(salt); /* 13. Let H' = Hash(M'), an octet string of length hLen. */ hash.start(); hash.update(m_.getBytes()); var h_ = hash.digest().getBytes(); /* 14. If H = H', output "consistent." Otherwise, output "inconsistent." */ return h === h_; }; return pssobj; }; /***/ }), /***/ 57821: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * An API for getting cryptographically-secure random bytes. The bytes are * generated using the Fortuna algorithm devised by Bruce Schneier and * Niels Ferguson. * * Getting strong random bytes is not yet easy to do in javascript. The only * truish random entropy that can be collected is from the mouse, keyboard, or * from timing with respect to page loads, etc. This generator makes a poor * attempt at providing random bytes when those sources haven't yet provided * enough entropy to initially seed or to reseed the PRNG. * * @author Dave Longley * * Copyright (c) 2009-2014 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(87994); __webpack_require__(80953); __webpack_require__(94467); __webpack_require__(28339); (function() { // forge.random already defined if(forge.random && forge.random.getBytes) { module.exports = forge.random; return; } (function(jQuery) { // the default prng plugin, uses AES-128 var prng_aes = {}; var _prng_aes_output = new Array(4); var _prng_aes_buffer = forge.util.createBuffer(); prng_aes.formatKey = function(key) { // convert the key into 32-bit integers var tmp = forge.util.createBuffer(key); key = new Array(4); key[0] = tmp.getInt32(); key[1] = tmp.getInt32(); key[2] = tmp.getInt32(); key[3] = tmp.getInt32(); // return the expanded key return forge.aes._expandKey(key, false); }; prng_aes.formatSeed = function(seed) { // convert seed into 32-bit integers var tmp = forge.util.createBuffer(seed); seed = new Array(4); seed[0] = tmp.getInt32(); seed[1] = tmp.getInt32(); seed[2] = tmp.getInt32(); seed[3] = tmp.getInt32(); return seed; }; prng_aes.cipher = function(key, seed) { forge.aes._updateBlock(key, seed, _prng_aes_output, false); _prng_aes_buffer.putInt32(_prng_aes_output[0]); _prng_aes_buffer.putInt32(_prng_aes_output[1]); _prng_aes_buffer.putInt32(_prng_aes_output[2]); _prng_aes_buffer.putInt32(_prng_aes_output[3]); return _prng_aes_buffer.getBytes(); }; prng_aes.increment = function(seed) { // FIXME: do we care about carry or signed issues? ++seed[3]; return seed; }; prng_aes.md = forge.md.sha256; /** * Creates a new PRNG. */ function spawnPrng() { var ctx = forge.prng.create(prng_aes); /** * Gets random bytes. If a native secure crypto API is unavailable, this * method tries to make the bytes more unpredictable by drawing from data that * can be collected from the user of the browser, eg: mouse movement. * * If a callback is given, this method will be called asynchronously. * * @param count the number of random bytes to get. * @param [callback(err, bytes)] called once the operation completes. * * @return the random bytes in a string. */ ctx.getBytes = function(count, callback) { return ctx.generate(count, callback); }; /** * Gets random bytes asynchronously. If a native secure crypto API is * unavailable, this method tries to make the bytes more unpredictable by * drawing from data that can be collected from the user of the browser, * eg: mouse movement. * * @param count the number of random bytes to get. * * @return the random bytes in a string. */ ctx.getBytesSync = function(count) { return ctx.generate(count); }; return ctx; } // create default prng context var _ctx = spawnPrng(); // add other sources of entropy only if window.crypto.getRandomValues is not // available -- otherwise this source will be automatically used by the prng var getRandomValues = null; var globalScope = forge.util.globalScope; var _crypto = globalScope.crypto || globalScope.msCrypto; if(_crypto && _crypto.getRandomValues) { getRandomValues = function(arr) { return _crypto.getRandomValues(arr); }; } if(forge.options.usePureJavaScript || (!forge.util.isNodejs && !getRandomValues)) { // if this is a web worker, do not use weak entropy, instead register to // receive strong entropy asynchronously from the main thread if(typeof window === 'undefined' || window.document === undefined) { // FIXME: } // get load time entropy _ctx.collectInt(+new Date(), 32); // add some entropy from navigator object if(typeof(navigator) !== 'undefined') { var _navBytes = ''; for(var key in navigator) { try { if(typeof(navigator[key]) == 'string') { _navBytes += navigator[key]; } } catch(e) { /* Some navigator keys might not be accessible, e.g. the geolocation attribute throws an exception if touched in Mozilla chrome:// context. Silently ignore this and just don't use this as a source of entropy. */ } } _ctx.collect(_navBytes); _navBytes = null; } // add mouse and keyboard collectors if jquery is available if(jQuery) { // set up mouse entropy capture jQuery().mousemove(function(e) { // add mouse coords _ctx.collectInt(e.clientX, 16); _ctx.collectInt(e.clientY, 16); }); // set up keyboard entropy capture jQuery().keypress(function(e) { _ctx.collectInt(e.charCode, 8); }); } } /* Random API */ if(!forge.random) { forge.random = _ctx; } else { // extend forge.random with _ctx for(var key in _ctx) { forge.random[key] = _ctx[key]; } } // expose spawn PRNG forge.random.createInstance = spawnPrng; module.exports = forge.random; })(typeof(jQuery) !== 'undefined' ? jQuery : null); })(); /***/ }), /***/ 39965: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * RC2 implementation. * * @author Stefan Siegl * * Copyright (c) 2012 Stefan Siegl * * Information on the RC2 cipher is available from RFC #2268, * http://www.ietf.org/rfc/rfc2268.txt */ var forge = __webpack_require__(89177); __webpack_require__(28339); var piTable = [ 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d, 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2, 0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32, 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82, 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc, 0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26, 0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x03, 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7, 0x08, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a, 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x04, 0x18, 0xa4, 0xec, 0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39, 0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9, 0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9, 0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad ]; var s = [1, 2, 3, 5]; /** * Rotate a word left by given number of bits. * * Bits that are shifted out on the left are put back in on the right * hand side. * * @param word The word to shift left. * @param bits The number of bits to shift by. * @return The rotated word. */ var rol = function(word, bits) { return ((word << bits) & 0xffff) | ((word & 0xffff) >> (16 - bits)); }; /** * Rotate a word right by given number of bits. * * Bits that are shifted out on the right are put back in on the left * hand side. * * @param word The word to shift right. * @param bits The number of bits to shift by. * @return The rotated word. */ var ror = function(word, bits) { return ((word & 0xffff) >> bits) | ((word << (16 - bits)) & 0xffff); }; /* RC2 API */ module.exports = forge.rc2 = forge.rc2 || {}; /** * Perform RC2 key expansion as per RFC #2268, section 2. * * @param key variable-length user key (between 1 and 128 bytes) * @param effKeyBits number of effective key bits (default: 128) * @return the expanded RC2 key (ByteBuffer of 128 bytes) */ forge.rc2.expandKey = function(key, effKeyBits) { if(typeof key === 'string') { key = forge.util.createBuffer(key); } effKeyBits = effKeyBits || 128; /* introduce variables that match the names used in RFC #2268 */ var L = key; var T = key.length(); var T1 = effKeyBits; var T8 = Math.ceil(T1 / 8); var TM = 0xff >> (T1 & 0x07); var i; for(i = T; i < 128; i++) { L.putByte(piTable[(L.at(i - 1) + L.at(i - T)) & 0xff]); } L.setAt(128 - T8, piTable[L.at(128 - T8) & TM]); for(i = 127 - T8; i >= 0; i--) { L.setAt(i, piTable[L.at(i + 1) ^ L.at(i + T8)]); } return L; }; /** * Creates a RC2 cipher object. * * @param key the symmetric key to use (as base for key generation). * @param bits the number of effective key bits. * @param encrypt false for decryption, true for encryption. * * @return the cipher. */ var createCipher = function(key, bits, encrypt) { var _finish = false, _input = null, _output = null, _iv = null; var mixRound, mashRound; var i, j, K = []; /* Expand key and fill into K[] Array */ key = forge.rc2.expandKey(key, bits); for(i = 0; i < 64; i++) { K.push(key.getInt16Le()); } if(encrypt) { /** * Perform one mixing round "in place". * * @param R Array of four words to perform mixing on. */ mixRound = function(R) { for(i = 0; i < 4; i++) { R[i] += K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); R[i] = rol(R[i], s[i]); j++; } }; /** * Perform one mashing round "in place". * * @param R Array of four words to perform mashing on. */ mashRound = function(R) { for(i = 0; i < 4; i++) { R[i] += K[R[(i + 3) % 4] & 63]; } }; } else { /** * Perform one r-mixing round "in place". * * @param R Array of four words to perform mixing on. */ mixRound = function(R) { for(i = 3; i >= 0; i--) { R[i] = ror(R[i], s[i]); R[i] -= K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); j--; } }; /** * Perform one r-mashing round "in place". * * @param R Array of four words to perform mashing on. */ mashRound = function(R) { for(i = 3; i >= 0; i--) { R[i] -= K[R[(i + 3) % 4] & 63]; } }; } /** * Run the specified cipher execution plan. * * This function takes four words from the input buffer, applies the IV on * it (if requested) and runs the provided execution plan. * * The plan must be put together in form of a array of arrays. Where the * outer one is simply a list of steps to perform and the inner one needs * to have two elements: the first one telling how many rounds to perform, * the second one telling what to do (i.e. the function to call). * * @param {Array} plan The plan to execute. */ var runPlan = function(plan) { var R = []; /* Get data from input buffer and fill the four words into R */ for(i = 0; i < 4; i++) { var val = _input.getInt16Le(); if(_iv !== null) { if(encrypt) { /* We're encrypting, apply the IV first. */ val ^= _iv.getInt16Le(); } else { /* We're decryption, keep cipher text for next block. */ _iv.putInt16Le(val); } } R.push(val & 0xffff); } /* Reset global "j" variable as per spec. */ j = encrypt ? 0 : 63; /* Run execution plan. */ for(var ptr = 0; ptr < plan.length; ptr++) { for(var ctr = 0; ctr < plan[ptr][0]; ctr++) { plan[ptr][1](R); } } /* Write back result to output buffer. */ for(i = 0; i < 4; i++) { if(_iv !== null) { if(encrypt) { /* We're encrypting in CBC-mode, feed back encrypted bytes into IV buffer to carry it forward to next block. */ _iv.putInt16Le(R[i]); } else { R[i] ^= _iv.getInt16Le(); } } _output.putInt16Le(R[i]); } }; /* Create cipher object */ var cipher = null; cipher = { /** * Starts or restarts the encryption or decryption process, whichever * was previously configured. * * To use the cipher in CBC mode, iv may be given either as a string * of bytes, or as a byte buffer. For ECB mode, give null as iv. * * @param iv the initialization vector to use, null for ECB mode. * @param output the output the buffer to write to, null to create one. */ start: function(iv, output) { if(iv) { /* CBC mode */ if(typeof iv === 'string') { iv = forge.util.createBuffer(iv); } } _finish = false; _input = forge.util.createBuffer(); _output = output || new forge.util.createBuffer(); _iv = iv; cipher.output = _output; }, /** * Updates the next block. * * @param input the buffer to read from. */ update: function(input) { if(!_finish) { // not finishing, so fill the input buffer with more input _input.putBuffer(input); } while(_input.length() >= 8) { runPlan([ [ 5, mixRound ], [ 1, mashRound ], [ 6, mixRound ], [ 1, mashRound ], [ 5, mixRound ] ]); } }, /** * Finishes encrypting or decrypting. * * @param pad a padding function to use, null for PKCS#7 padding, * signature(blockSize, buffer, decrypt). * * @return true if successful, false on error. */ finish: function(pad) { var rval = true; if(encrypt) { if(pad) { rval = pad(8, _input, !encrypt); } else { // add PKCS#7 padding to block (each pad byte is the // value of the number of pad bytes) var padding = (_input.length() === 8) ? 8 : (8 - _input.length()); _input.fillWithByte(padding, padding); } } if(rval) { // do final update _finish = true; cipher.update(); } if(!encrypt) { // check for error: input data not a multiple of block size rval = (_input.length() === 0); if(rval) { if(pad) { rval = pad(8, _output, !encrypt); } else { // ensure padding byte count is valid var len = _output.length(); var count = _output.at(len - 1); if(count > len) { rval = false; } else { // trim off padding bytes _output.truncate(count); } } } } return rval; } }; return cipher; }; /** * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the * given symmetric key. The output will be stored in the 'output' member * of the returned cipher. * * The key and iv may be given as a string of bytes or a byte buffer. * The cipher is initialized to use 128 effective key bits. * * @param key the symmetric key to use. * @param iv the initialization vector to use. * @param output the buffer to write to, null to create one. * * @return the cipher. */ forge.rc2.startEncrypting = function(key, iv, output) { var cipher = forge.rc2.createEncryptionCipher(key, 128); cipher.start(iv, output); return cipher; }; /** * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the * given symmetric key. * * The key may be given as a string of bytes or a byte buffer. * * To start encrypting call start() on the cipher with an iv and optional * output buffer. * * @param key the symmetric key to use. * * @return the cipher. */ forge.rc2.createEncryptionCipher = function(key, bits) { return createCipher(key, bits, true); }; /** * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the * given symmetric key. The output will be stored in the 'output' member * of the returned cipher. * * The key and iv may be given as a string of bytes or a byte buffer. * The cipher is initialized to use 128 effective key bits. * * @param key the symmetric key to use. * @param iv the initialization vector to use. * @param output the buffer to write to, null to create one. * * @return the cipher. */ forge.rc2.startDecrypting = function(key, iv, output) { var cipher = forge.rc2.createDecryptionCipher(key, 128); cipher.start(iv, output); return cipher; }; /** * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the * given symmetric key. * * The key may be given as a string of bytes or a byte buffer. * * To start decrypting call start() on the cipher with an iv and optional * output buffer. * * @param key the symmetric key to use. * * @return the cipher. */ forge.rc2.createDecryptionCipher = function(key, bits) { return createCipher(key, bits, false); }; /***/ }), /***/ 53921: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of basic RSA algorithms. * * @author Dave Longley * * Copyright (c) 2010-2014 Digital Bazaar, Inc. * * The only algorithm currently supported for PKI is RSA. * * An RSA key is often stored in ASN.1 DER format. The SubjectPublicKeyInfo * ASN.1 structure is composed of an algorithm of type AlgorithmIdentifier * and a subjectPublicKey of type bit string. * * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters * for the algorithm, if any. In the case of RSA, there aren't any. * * SubjectPublicKeyInfo ::= SEQUENCE { * algorithm AlgorithmIdentifier, * subjectPublicKey BIT STRING * } * * AlgorithmIdentifer ::= SEQUENCE { * algorithm OBJECT IDENTIFIER, * parameters ANY DEFINED BY algorithm OPTIONAL * } * * For an RSA public key, the subjectPublicKey is: * * RSAPublicKey ::= SEQUENCE { * modulus INTEGER, -- n * publicExponent INTEGER -- e * } * * PrivateKeyInfo ::= SEQUENCE { * version Version, * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, * privateKey PrivateKey, * attributes [0] IMPLICIT Attributes OPTIONAL * } * * Version ::= INTEGER * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier * PrivateKey ::= OCTET STRING * Attributes ::= SET OF Attribute * * An RSA private key as the following structure: * * RSAPrivateKey ::= SEQUENCE { * version Version, * modulus INTEGER, -- n * publicExponent INTEGER, -- e * privateExponent INTEGER, -- d * prime1 INTEGER, -- p * prime2 INTEGER, -- q * exponent1 INTEGER, -- d mod (p-1) * exponent2 INTEGER, -- d mod (q-1) * coefficient INTEGER -- (inverse of q) mod p * } * * Version ::= INTEGER * * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1 */ var forge = __webpack_require__(89177); __webpack_require__(39549); __webpack_require__(98007); __webpack_require__(81925); __webpack_require__(57014); __webpack_require__(6861); __webpack_require__(57821); __webpack_require__(28339); if(typeof BigInteger === 'undefined') { var BigInteger = forge.jsbn.BigInteger; } var _crypto = forge.util.isNodejs ? __webpack_require__(76417) : null; // shortcut for asn.1 API var asn1 = forge.asn1; // shortcut for util API var util = forge.util; /* * RSA encryption and decryption, see RFC 2313. */ forge.pki = forge.pki || {}; module.exports = forge.pki.rsa = forge.rsa = forge.rsa || {}; var pki = forge.pki; // for finding primes, which are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; // validator for a PrivateKeyInfo structure var privateKeyValidator = { // PrivateKeyInfo name: 'PrivateKeyInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // Version (INTEGER) name: 'PrivateKeyInfo.version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyVersion' }, { // privateKeyAlgorithm name: 'PrivateKeyInfo.privateKeyAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'AlgorithmIdentifier.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'privateKeyOid' }] }, { // PrivateKey name: 'PrivateKeyInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: 'privateKey' }] }; // validator for an RSA private key var rsaPrivateKeyValidator = { // RSAPrivateKey name: 'RSAPrivateKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // Version (INTEGER) name: 'RSAPrivateKey.version', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyVersion' }, { // modulus (n) name: 'RSAPrivateKey.modulus', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyModulus' }, { // publicExponent (e) name: 'RSAPrivateKey.publicExponent', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyPublicExponent' }, { // privateExponent (d) name: 'RSAPrivateKey.privateExponent', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyPrivateExponent' }, { // prime1 (p) name: 'RSAPrivateKey.prime1', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyPrime1' }, { // prime2 (q) name: 'RSAPrivateKey.prime2', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyPrime2' }, { // exponent1 (d mod (p-1)) name: 'RSAPrivateKey.exponent1', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyExponent1' }, { // exponent2 (d mod (q-1)) name: 'RSAPrivateKey.exponent2', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyExponent2' }, { // coefficient ((inverse of q) mod p) name: 'RSAPrivateKey.coefficient', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'privateKeyCoefficient' }] }; // validator for an RSA public key var rsaPublicKeyValidator = { // RSAPublicKey name: 'RSAPublicKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // modulus (n) name: 'RSAPublicKey.modulus', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'publicKeyModulus' }, { // publicExponent (e) name: 'RSAPublicKey.exponent', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'publicKeyExponent' }] }; // validator for an SubjectPublicKeyInfo structure // Note: Currently only works with an RSA public key var publicKeyValidator = forge.pki.rsa.publicKeyValidator = { name: 'SubjectPublicKeyInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'subjectPublicKeyInfo', value: [{ name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'AlgorithmIdentifier.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'publicKeyOid' }] }, { // subjectPublicKey name: 'SubjectPublicKeyInfo.subjectPublicKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, value: [{ // RSAPublicKey name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, optional: true, captureAsn1: 'rsaPublicKey' }] }] }; /** * Wrap digest in DigestInfo object. * * This function implements EMSA-PKCS1-v1_5-ENCODE as per RFC 3447. * * DigestInfo ::= SEQUENCE { * digestAlgorithm DigestAlgorithmIdentifier, * digest Digest * } * * DigestAlgorithmIdentifier ::= AlgorithmIdentifier * Digest ::= OCTET STRING * * @param md the message digest object with the hash to sign. * * @return the encoded message (ready for RSA encrytion) */ var emsaPkcs1v15encode = function(md) { // get the oid for the algorithm var oid; if(md.algorithm in pki.oids) { oid = pki.oids[md.algorithm]; } else { var error = new Error('Unknown message digest algorithm.'); error.algorithm = md.algorithm; throw error; } var oidBytes = asn1.oidToDer(oid).getBytes(); // create the digest info var digestInfo = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); var digestAlgorithm = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); digestAlgorithm.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, oidBytes)); digestAlgorithm.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')); var digest = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, md.digest().getBytes()); digestInfo.value.push(digestAlgorithm); digestInfo.value.push(digest); // encode digest info return asn1.toDer(digestInfo).getBytes(); }; /** * Performs x^c mod n (RSA encryption or decryption operation). * * @param x the number to raise and mod. * @param key the key to use. * @param pub true if the key is public, false if private. * * @return the result of x^c mod n. */ var _modPow = function(x, key, pub) { if(pub) { return x.modPow(key.e, key.n); } if(!key.p || !key.q) { // allow calculation without CRT params (slow) return x.modPow(key.d, key.n); } // pre-compute dP, dQ, and qInv if necessary if(!key.dP) { key.dP = key.d.mod(key.p.subtract(BigInteger.ONE)); } if(!key.dQ) { key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE)); } if(!key.qInv) { key.qInv = key.q.modInverse(key.p); } /* Chinese remainder theorem (CRT) states: Suppose n1, n2, ..., nk are positive integers which are pairwise coprime (n1 and n2 have no common factors other than 1). For any integers x1, x2, ..., xk there exists an integer x solving the system of simultaneous congruences (where ~= means modularly congruent so a ~= b mod n means a mod n = b mod n): x ~= x1 mod n1 x ~= x2 mod n2 ... x ~= xk mod nk This system of congruences has a single simultaneous solution x between 0 and n - 1. Furthermore, each xk solution and x itself is congruent modulo the product n = n1*n2*...*nk. So x1 mod n = x2 mod n = xk mod n = x mod n. The single simultaneous solution x can be solved with the following equation: x = sum(xi*ri*si) mod n where ri = n/ni and si = ri^-1 mod ni. Where x is less than n, xi = x mod ni. For RSA we are only concerned with k = 2. The modulus n = pq, where p and q are coprime. The RSA decryption algorithm is: y = x^d mod n Given the above: x1 = x^d mod p r1 = n/p = q s1 = q^-1 mod p x2 = x^d mod q r2 = n/q = p s2 = p^-1 mod q So y = (x1r1s1 + x2r2s2) mod n = ((x^d mod p)q(q^-1 mod p) + (x^d mod q)p(p^-1 mod q)) mod n According to Fermat's Little Theorem, if the modulus P is prime, for any integer A not evenly divisible by P, A^(P-1) ~= 1 mod P. Since A is not divisible by P it follows that if: N ~= M mod (P - 1), then A^N mod P = A^M mod P. Therefore: A^N mod P = A^(M mod (P - 1)) mod P. (The latter takes less effort to calculate). In order to calculate x^d mod p more quickly the exponent d mod (p - 1) is stored in the RSA private key (the same is done for x^d mod q). These values are referred to as dP and dQ respectively. Therefore we now have: y = ((x^dP mod p)q(q^-1 mod p) + (x^dQ mod q)p(p^-1 mod q)) mod n Since we'll be reducing x^dP by modulo p (same for q) we can also reduce x by p (and q respectively) before hand. Therefore, let xp = ((x mod p)^dP mod p), and xq = ((x mod q)^dQ mod q), yielding: y = (xp*q*(q^-1 mod p) + xq*p*(p^-1 mod q)) mod n This can be further reduced to a simple algorithm that only requires 1 inverse (the q inverse is used) to be used and stored. The algorithm is called Garner's algorithm. If qInv is the inverse of q, we simply calculate: y = (qInv*(xp - xq) mod p) * q + xq However, there are two further complications. First, we need to ensure that xp > xq to prevent signed BigIntegers from being used so we add p until this is true (since we will be mod'ing with p anyway). Then, there is a known timing attack on algorithms using the CRT. To mitigate this risk, "cryptographic blinding" should be used. This requires simply generating a random number r between 0 and n-1 and its inverse and multiplying x by r^e before calculating y and then multiplying y by r^-1 afterwards. Note that r must be coprime with n (gcd(r, n) === 1) in order to have an inverse. */ // cryptographic blinding var r; do { r = new BigInteger( forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)), 16); } while(r.compareTo(key.n) >= 0 || !r.gcd(key.n).equals(BigInteger.ONE)); x = x.multiply(r.modPow(key.e, key.n)).mod(key.n); // calculate xp and xq var xp = x.mod(key.p).modPow(key.dP, key.p); var xq = x.mod(key.q).modPow(key.dQ, key.q); // xp must be larger than xq to avoid signed bit usage while(xp.compareTo(xq) < 0) { xp = xp.add(key.p); } // do last step var y = xp.subtract(xq) .multiply(key.qInv).mod(key.p) .multiply(key.q).add(xq); // remove effect of random for cryptographic blinding y = y.multiply(r.modInverse(key.n)).mod(key.n); return y; }; /** * NOTE: THIS METHOD IS DEPRECATED, use 'sign' on a private key object or * 'encrypt' on a public key object instead. * * Performs RSA encryption. * * The parameter bt controls whether to put padding bytes before the * message passed in. Set bt to either true or false to disable padding * completely (in order to handle e.g. EMSA-PSS encoding seperately before), * signaling whether the encryption operation is a public key operation * (i.e. encrypting data) or not, i.e. private key operation (data signing). * * For PKCS#1 v1.5 padding pass in the block type to use, i.e. either 0x01 * (for signing) or 0x02 (for encryption). The key operation mode (private * or public) is derived from this flag in that case). * * @param m the message to encrypt as a byte string. * @param key the RSA key to use. * @param bt for PKCS#1 v1.5 padding, the block type to use * (0x01 for private key, 0x02 for public), * to disable padding: true = public key, false = private key. * * @return the encrypted bytes as a string. */ pki.rsa.encrypt = function(m, key, bt) { var pub = bt; var eb; // get the length of the modulus in bytes var k = Math.ceil(key.n.bitLength() / 8); if(bt !== false && bt !== true) { // legacy, default to PKCS#1 v1.5 padding pub = (bt === 0x02); eb = _encodePkcs1_v1_5(m, key, bt); } else { eb = forge.util.createBuffer(); eb.putBytes(m); } // load encryption block as big integer 'x' // FIXME: hex conversion inefficient, get BigInteger w/byte strings var x = new BigInteger(eb.toHex(), 16); // do RSA encryption var y = _modPow(x, key, pub); // convert y into the encrypted data byte string, if y is shorter in // bytes than k, then prepend zero bytes to fill up ed // FIXME: hex conversion inefficient, get BigInteger w/byte strings var yhex = y.toString(16); var ed = forge.util.createBuffer(); var zeros = k - Math.ceil(yhex.length / 2); while(zeros > 0) { ed.putByte(0x00); --zeros; } ed.putBytes(forge.util.hexToBytes(yhex)); return ed.getBytes(); }; /** * NOTE: THIS METHOD IS DEPRECATED, use 'decrypt' on a private key object or * 'verify' on a public key object instead. * * Performs RSA decryption. * * The parameter ml controls whether to apply PKCS#1 v1.5 padding * or not. Set ml = false to disable padding removal completely * (in order to handle e.g. EMSA-PSS later on) and simply pass back * the RSA encryption block. * * @param ed the encrypted data to decrypt in as a byte string. * @param key the RSA key to use. * @param pub true for a public key operation, false for private. * @param ml the message length, if known, false to disable padding. * * @return the decrypted message as a byte string. */ pki.rsa.decrypt = function(ed, key, pub, ml) { // get the length of the modulus in bytes var k = Math.ceil(key.n.bitLength() / 8); // error if the length of the encrypted data ED is not k if(ed.length !== k) { var error = new Error('Encrypted message length is invalid.'); error.length = ed.length; error.expected = k; throw error; } // convert encrypted data into a big integer // FIXME: hex conversion inefficient, get BigInteger w/byte strings var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); // y must be less than the modulus or it wasn't the result of // a previous mod operation (encryption) using that modulus if(y.compareTo(key.n) >= 0) { throw new Error('Encrypted message is invalid.'); } // do RSA decryption var x = _modPow(y, key, pub); // create the encryption block, if x is shorter in bytes than k, then // prepend zero bytes to fill up eb // FIXME: hex conversion inefficient, get BigInteger w/byte strings var xhex = x.toString(16); var eb = forge.util.createBuffer(); var zeros = k - Math.ceil(xhex.length / 2); while(zeros > 0) { eb.putByte(0x00); --zeros; } eb.putBytes(forge.util.hexToBytes(xhex)); if(ml !== false) { // legacy, default to PKCS#1 v1.5 padding return _decodePkcs1_v1_5(eb.getBytes(), key, pub); } // return message return eb.getBytes(); }; /** * Creates an RSA key-pair generation state object. It is used to allow * key-generation to be performed in steps. It also allows for a UI to * display progress updates. * * @param bits the size for the private key in bits, defaults to 2048. * @param e the public exponent to use, defaults to 65537 (0x10001). * @param [options] the options to use. * prng a custom crypto-secure pseudo-random number generator to use, * that must define "getBytesSync". * algorithm the algorithm to use (default: 'PRIMEINC'). * * @return the state object to use to generate the key-pair. */ pki.rsa.createKeyPairGenerationState = function(bits, e, options) { // TODO: migrate step-based prime generation code to forge.prime // set default bits if(typeof(bits) === 'string') { bits = parseInt(bits, 10); } bits = bits || 2048; // create prng with api that matches BigInteger secure random options = options || {}; var prng = options.prng || forge.random; var rng = { // x is an array to fill with bytes nextBytes: function(x) { var b = prng.getBytesSync(x.length); for(var i = 0; i < x.length; ++i) { x[i] = b.charCodeAt(i); } } }; var algorithm = options.algorithm || 'PRIMEINC'; // create PRIMEINC algorithm state var rval; if(algorithm === 'PRIMEINC') { rval = { algorithm: algorithm, state: 0, bits: bits, rng: rng, eInt: e || 65537, e: new BigInteger(null), p: null, q: null, qBits: bits >> 1, pBits: bits - (bits >> 1), pqState: 0, num: null, keys: null }; rval.e.fromInt(rval.eInt); } else { throw new Error('Invalid key generation algorithm: ' + algorithm); } return rval; }; /** * Attempts to runs the key-generation algorithm for at most n seconds * (approximately) using the given state. When key-generation has completed, * the keys will be stored in state.keys. * * To use this function to update a UI while generating a key or to prevent * causing browser lockups/warnings, set "n" to a value other than 0. A * simple pattern for generating a key and showing a progress indicator is: * * var state = pki.rsa.createKeyPairGenerationState(2048); * var step = function() { * // step key-generation, run algorithm for 100 ms, repeat * if(!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) { * setTimeout(step, 1); * } else { * // key-generation complete * // TODO: turn off progress indicator here * // TODO: use the generated key-pair in "state.keys" * } * }; * // TODO: turn on progress indicator here * setTimeout(step, 0); * * @param state the state to use. * @param n the maximum number of milliseconds to run the algorithm for, 0 * to run the algorithm to completion. * * @return true if the key-generation completed, false if not. */ pki.rsa.stepKeyPairGenerationState = function(state, n) { // set default algorithm if not set if(!('algorithm' in state)) { state.algorithm = 'PRIMEINC'; } // TODO: migrate step-based prime generation code to forge.prime // TODO: abstract as PRIMEINC algorithm // do key generation (based on Tom Wu's rsa.js, see jsbn.js license) // with some minor optimizations and designed to run in steps // local state vars var THIRTY = new BigInteger(null); THIRTY.fromInt(30); var deltaIdx = 0; var op_or = function(x, y) {return x | y;}; // keep stepping until time limit is reached or done var t1 = +new Date(); var t2; var total = 0; while(state.keys === null && (n <= 0 || total < n)) { // generate p or q if(state.state === 0) { /* Note: All primes are of the form: 30k+i, for i < 30 and gcd(30, i)=1, where there are 8 values for i When we generate a random number, we always align it at 30k + 1. Each time the number is determined not to be prime we add to get to the next 'i', eg: if the number was at 30k + 1 we add 6. */ var bits = (state.p === null) ? state.pBits : state.qBits; var bits1 = bits - 1; // get a random number if(state.pqState === 0) { state.num = new BigInteger(bits, state.rng); // force MSB set if(!state.num.testBit(bits1)) { state.num.bitwiseTo( BigInteger.ONE.shiftLeft(bits1), op_or, state.num); } // align number on 30k+1 boundary state.num.dAddOffset(31 - state.num.mod(THIRTY).byteValue(), 0); deltaIdx = 0; ++state.pqState; } else if(state.pqState === 1) { // try to make the number a prime if(state.num.bitLength() > bits) { // overflow, try again state.pqState = 0; // do primality test } else if(state.num.isProbablePrime( _getMillerRabinTests(state.num.bitLength()))) { ++state.pqState; } else { // get next potential prime state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); } } else if(state.pqState === 2) { // ensure number is coprime with e state.pqState = (state.num.subtract(BigInteger.ONE).gcd(state.e) .compareTo(BigInteger.ONE) === 0) ? 3 : 0; } else if(state.pqState === 3) { // store p or q state.pqState = 0; if(state.p === null) { state.p = state.num; } else { state.q = state.num; } // advance state if both p and q are ready if(state.p !== null && state.q !== null) { ++state.state; } state.num = null; } } else if(state.state === 1) { // ensure p is larger than q (swap them if not) if(state.p.compareTo(state.q) < 0) { state.num = state.p; state.p = state.q; state.q = state.num; } ++state.state; } else if(state.state === 2) { // compute phi: (p - 1)(q - 1) (Euler's totient function) state.p1 = state.p.subtract(BigInteger.ONE); state.q1 = state.q.subtract(BigInteger.ONE); state.phi = state.p1.multiply(state.q1); ++state.state; } else if(state.state === 3) { // ensure e and phi are coprime if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) === 0) { // phi and e are coprime, advance ++state.state; } else { // phi and e aren't coprime, so generate a new p and q state.p = null; state.q = null; state.state = 0; } } else if(state.state === 4) { // create n, ensure n is has the right number of bits state.n = state.p.multiply(state.q); // ensure n is right number of bits if(state.n.bitLength() === state.bits) { // success, advance ++state.state; } else { // failed, get new q state.q = null; state.state = 0; } } else if(state.state === 5) { // set keys var d = state.e.modInverse(state.phi); state.keys = { privateKey: pki.rsa.setPrivateKey( state.n, state.e, d, state.p, state.q, d.mod(state.p1), d.mod(state.q1), state.q.modInverse(state.p)), publicKey: pki.rsa.setPublicKey(state.n, state.e) }; } // update timing t2 = +new Date(); total += t2 - t1; t1 = t2; } return state.keys !== null; }; /** * Generates an RSA public-private key pair in a single call. * * To generate a key-pair in steps (to allow for progress updates and to * prevent blocking or warnings in slow browsers) then use the key-pair * generation state functions. * * To generate a key-pair asynchronously (either through web-workers, if * available, or by breaking up the work on the main thread), pass a * callback function. * * @param [bits] the size for the private key in bits, defaults to 2048. * @param [e] the public exponent to use, defaults to 65537. * @param [options] options for key-pair generation, if given then 'bits' * and 'e' must *not* be given: * bits the size for the private key in bits, (default: 2048). * e the public exponent to use, (default: 65537 (0x10001)). * workerScript the worker script URL. * workers the number of web workers (if supported) to use, * (default: 2). * workLoad the size of the work load, ie: number of possible prime * numbers for each web worker to check per work assignment, * (default: 100). * prng a custom crypto-secure pseudo-random number generator to use, * that must define "getBytesSync". Disables use of native APIs. * algorithm the algorithm to use (default: 'PRIMEINC'). * @param [callback(err, keypair)] called once the operation completes. * * @return an object with privateKey and publicKey properties. */ pki.rsa.generateKeyPair = function(bits, e, options, callback) { // (bits), (options), (callback) if(arguments.length === 1) { if(typeof bits === 'object') { options = bits; bits = undefined; } else if(typeof bits === 'function') { callback = bits; bits = undefined; } } else if(arguments.length === 2) { // (bits, e), (bits, options), (bits, callback), (options, callback) if(typeof bits === 'number') { if(typeof e === 'function') { callback = e; e = undefined; } else if(typeof e !== 'number') { options = e; e = undefined; } } else { options = bits; callback = e; bits = undefined; e = undefined; } } else if(arguments.length === 3) { // (bits, e, options), (bits, e, callback), (bits, options, callback) if(typeof e === 'number') { if(typeof options === 'function') { callback = options; options = undefined; } } else { callback = options; options = e; e = undefined; } } options = options || {}; if(bits === undefined) { bits = options.bits || 2048; } if(e === undefined) { e = options.e || 0x10001; } // use native code if permitted, available, and parameters are acceptable if(!forge.options.usePureJavaScript && !options.prng && bits >= 256 && bits <= 16384 && (e === 0x10001 || e === 3)) { if(callback) { // try native async if(_detectNodeCrypto('generateKeyPair')) { return _crypto.generateKeyPair('rsa', { modulusLength: bits, publicExponent: e, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } }, function(err, pub, priv) { if(err) { return callback(err); } callback(null, { privateKey: pki.privateKeyFromPem(priv), publicKey: pki.publicKeyFromPem(pub) }); }); } if(_detectSubtleCrypto('generateKey') && _detectSubtleCrypto('exportKey')) { // use standard native generateKey return util.globalScope.crypto.subtle.generateKey({ name: 'RSASSA-PKCS1-v1_5', modulusLength: bits, publicExponent: _intToUint8Array(e), hash: {name: 'SHA-256'} }, true /* key can be exported*/, ['sign', 'verify']) .then(function(pair) { return util.globalScope.crypto.subtle.exportKey( 'pkcs8', pair.privateKey); // avoiding catch(function(err) {...}) to support IE <= 8 }).then(undefined, function(err) { callback(err); }).then(function(pkcs8) { if(pkcs8) { var privateKey = pki.privateKeyFromAsn1( asn1.fromDer(forge.util.createBuffer(pkcs8))); callback(null, { privateKey: privateKey, publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) }); } }); } if(_detectSubtleMsCrypto('generateKey') && _detectSubtleMsCrypto('exportKey')) { var genOp = util.globalScope.msCrypto.subtle.generateKey({ name: 'RSASSA-PKCS1-v1_5', modulusLength: bits, publicExponent: _intToUint8Array(e), hash: {name: 'SHA-256'} }, true /* key can be exported*/, ['sign', 'verify']); genOp.oncomplete = function(e) { var pair = e.target.result; var exportOp = util.globalScope.msCrypto.subtle.exportKey( 'pkcs8', pair.privateKey); exportOp.oncomplete = function(e) { var pkcs8 = e.target.result; var privateKey = pki.privateKeyFromAsn1( asn1.fromDer(forge.util.createBuffer(pkcs8))); callback(null, { privateKey: privateKey, publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) }); }; exportOp.onerror = function(err) { callback(err); }; }; genOp.onerror = function(err) { callback(err); }; return; } } else { // try native sync if(_detectNodeCrypto('generateKeyPairSync')) { var keypair = _crypto.generateKeyPairSync('rsa', { modulusLength: bits, publicExponent: e, publicKeyEncoding: { type: 'spki', format: 'pem' }, privateKeyEncoding: { type: 'pkcs8', format: 'pem' } }); return { privateKey: pki.privateKeyFromPem(keypair.privateKey), publicKey: pki.publicKeyFromPem(keypair.publicKey) }; } } } // use JavaScript implementation var state = pki.rsa.createKeyPairGenerationState(bits, e, options); if(!callback) { pki.rsa.stepKeyPairGenerationState(state, 0); return state.keys; } _generateKeyPair(state, options, callback); }; /** * Sets an RSA public key from BigIntegers modulus and exponent. * * @param n the modulus. * @param e the exponent. * * @return the public key. */ pki.setRsaPublicKey = pki.rsa.setPublicKey = function(n, e) { var key = { n: n, e: e }; /** * Encrypts the given data with this public key. Newer applications * should use the 'RSA-OAEP' decryption scheme, 'RSAES-PKCS1-V1_5' is for * legacy applications. * * @param data the byte string to encrypt. * @param scheme the encryption scheme to use: * 'RSAES-PKCS1-V1_5' (default), * 'RSA-OAEP', * 'RAW', 'NONE', or null to perform raw RSA encryption, * an object with an 'encode' property set to a function * with the signature 'function(data, key)' that returns * a binary-encoded string representing the encoded data. * @param schemeOptions any scheme-specific options. * * @return the encrypted byte string. */ key.encrypt = function(data, scheme, schemeOptions) { if(typeof scheme === 'string') { scheme = scheme.toUpperCase(); } else if(scheme === undefined) { scheme = 'RSAES-PKCS1-V1_5'; } if(scheme === 'RSAES-PKCS1-V1_5') { scheme = { encode: function(m, key, pub) { return _encodePkcs1_v1_5(m, key, 0x02).getBytes(); } }; } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { scheme = { encode: function(m, key) { return forge.pkcs1.encode_rsa_oaep(key, m, schemeOptions); } }; } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { scheme = {encode: function(e) {return e;}}; } else if(typeof scheme === 'string') { throw new Error('Unsupported encryption scheme: "' + scheme + '".'); } // do scheme-based encoding then rsa encryption var e = scheme.encode(data, key, true); return pki.rsa.encrypt(e, key, true); }; /** * Verifies the given signature against the given digest. * * PKCS#1 supports multiple (currently two) signature schemes: * RSASSA-PKCS1-V1_5 and RSASSA-PSS. * * By default this implementation uses the "old scheme", i.e. * RSASSA-PKCS1-V1_5, in which case once RSA-decrypted, the * signature is an OCTET STRING that holds a DigestInfo. * * DigestInfo ::= SEQUENCE { * digestAlgorithm DigestAlgorithmIdentifier, * digest Digest * } * DigestAlgorithmIdentifier ::= AlgorithmIdentifier * Digest ::= OCTET STRING * * To perform PSS signature verification, provide an instance * of Forge PSS object as the scheme parameter. * * @param digest the message digest hash to compare against the signature, * as a binary-encoded string. * @param signature the signature to verify, as a binary-encoded string. * @param scheme signature verification scheme to use: * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, * a Forge PSS object for RSASSA-PSS, * 'NONE' or null for none, DigestInfo will not be expected, but * PKCS#1 v1.5 padding will still be used. * * @return true if the signature was verified, false if not. */ key.verify = function(digest, signature, scheme) { if(typeof scheme === 'string') { scheme = scheme.toUpperCase(); } else if(scheme === undefined) { scheme = 'RSASSA-PKCS1-V1_5'; } if(scheme === 'RSASSA-PKCS1-V1_5') { scheme = { verify: function(digest, d) { // remove padding d = _decodePkcs1_v1_5(d, key, true); // d is ASN.1 BER-encoded DigestInfo var obj = asn1.fromDer(d); // compare the given digest to the decrypted one return digest === obj.value[1].value; } }; } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { scheme = { verify: function(digest, d) { // remove padding d = _decodePkcs1_v1_5(d, key, true); return digest === d; } }; } // do rsa decryption w/o any decoding, then verify -- which does decoding var d = pki.rsa.decrypt(signature, key, true, false); return scheme.verify(digest, d, key.n.bitLength()); }; return key; }; /** * Sets an RSA private key from BigIntegers modulus, exponent, primes, * prime exponents, and modular multiplicative inverse. * * @param n the modulus. * @param e the public exponent. * @param d the private exponent ((inverse of e) mod n). * @param p the first prime. * @param q the second prime. * @param dP exponent1 (d mod (p-1)). * @param dQ exponent2 (d mod (q-1)). * @param qInv ((inverse of q) mod p) * * @return the private key. */ pki.setRsaPrivateKey = pki.rsa.setPrivateKey = function( n, e, d, p, q, dP, dQ, qInv) { var key = { n: n, e: e, d: d, p: p, q: q, dP: dP, dQ: dQ, qInv: qInv }; /** * Decrypts the given data with this private key. The decryption scheme * must match the one used to encrypt the data. * * @param data the byte string to decrypt. * @param scheme the decryption scheme to use: * 'RSAES-PKCS1-V1_5' (default), * 'RSA-OAEP', * 'RAW', 'NONE', or null to perform raw RSA decryption. * @param schemeOptions any scheme-specific options. * * @return the decrypted byte string. */ key.decrypt = function(data, scheme, schemeOptions) { if(typeof scheme === 'string') { scheme = scheme.toUpperCase(); } else if(scheme === undefined) { scheme = 'RSAES-PKCS1-V1_5'; } // do rsa decryption w/o any decoding var d = pki.rsa.decrypt(data, key, false, false); if(scheme === 'RSAES-PKCS1-V1_5') { scheme = {decode: _decodePkcs1_v1_5}; } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { scheme = { decode: function(d, key) { return forge.pkcs1.decode_rsa_oaep(key, d, schemeOptions); } }; } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { scheme = {decode: function(d) {return d;}}; } else { throw new Error('Unsupported encryption scheme: "' + scheme + '".'); } // decode according to scheme return scheme.decode(d, key, false); }; /** * Signs the given digest, producing a signature. * * PKCS#1 supports multiple (currently two) signature schemes: * RSASSA-PKCS1-V1_5 and RSASSA-PSS. * * By default this implementation uses the "old scheme", i.e. * RSASSA-PKCS1-V1_5. In order to generate a PSS signature, provide * an instance of Forge PSS object as the scheme parameter. * * @param md the message digest object with the hash to sign. * @param scheme the signature scheme to use: * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, * a Forge PSS object for RSASSA-PSS, * 'NONE' or null for none, DigestInfo will not be used but * PKCS#1 v1.5 padding will still be used. * * @return the signature as a byte string. */ key.sign = function(md, scheme) { /* Note: The internal implementation of RSA operations is being transitioned away from a PKCS#1 v1.5 hard-coded scheme. Some legacy code like the use of an encoding block identifier 'bt' will eventually be removed. */ // private key operation var bt = false; if(typeof scheme === 'string') { scheme = scheme.toUpperCase(); } if(scheme === undefined || scheme === 'RSASSA-PKCS1-V1_5') { scheme = {encode: emsaPkcs1v15encode}; bt = 0x01; } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { scheme = {encode: function() {return md;}}; bt = 0x01; } // encode and then encrypt var d = scheme.encode(md, key.n.bitLength()); return pki.rsa.encrypt(d, key, bt); }; return key; }; /** * Wraps an RSAPrivateKey ASN.1 object in an ASN.1 PrivateKeyInfo object. * * @param rsaKey the ASN.1 RSAPrivateKey. * * @return the ASN.1 PrivateKeyInfo. */ pki.wrapRsaPrivateKey = function(rsaKey) { // PrivateKeyInfo return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version (0) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(0).getBytes()), // privateKeyAlgorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ]), // PrivateKey asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(rsaKey).getBytes()) ]); }; /** * Converts a private key from an ASN.1 object. * * @param obj the ASN.1 representation of a PrivateKeyInfo containing an * RSAPrivateKey or an RSAPrivateKey. * * @return the private key. */ pki.privateKeyFromAsn1 = function(obj) { // get PrivateKeyInfo var capture = {}; var errors = []; if(asn1.validate(obj, privateKeyValidator, capture, errors)) { obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey)); } // get RSAPrivateKey capture = {}; errors = []; if(!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) { var error = new Error('Cannot read private key. ' + 'ASN.1 object does not contain an RSAPrivateKey.'); error.errors = errors; throw error; } // Note: Version is currently ignored. // capture.privateKeyVersion // FIXME: inefficient, get a BigInteger that uses byte strings var n, e, d, p, q, dP, dQ, qInv; n = forge.util.createBuffer(capture.privateKeyModulus).toHex(); e = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex(); d = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex(); p = forge.util.createBuffer(capture.privateKeyPrime1).toHex(); q = forge.util.createBuffer(capture.privateKeyPrime2).toHex(); dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex(); dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex(); qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex(); // set private key return pki.setRsaPrivateKey( new BigInteger(n, 16), new BigInteger(e, 16), new BigInteger(d, 16), new BigInteger(p, 16), new BigInteger(q, 16), new BigInteger(dP, 16), new BigInteger(dQ, 16), new BigInteger(qInv, 16)); }; /** * Converts a private key to an ASN.1 RSAPrivateKey. * * @param key the private key. * * @return the ASN.1 representation of an RSAPrivateKey. */ pki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) { // RSAPrivateKey return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version (0 = only 2 primes, 1 multiple primes) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(0).getBytes()), // modulus (n) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.n)), // publicExponent (e) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.e)), // privateExponent (d) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.d)), // privateKeyPrime1 (p) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.p)), // privateKeyPrime2 (q) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.q)), // privateKeyExponent1 (dP) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.dP)), // privateKeyExponent2 (dQ) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.dQ)), // coefficient (qInv) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.qInv)) ]); }; /** * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey. * * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey. * * @return the public key. */ pki.publicKeyFromAsn1 = function(obj) { // get SubjectPublicKeyInfo var capture = {}; var errors = []; if(asn1.validate(obj, publicKeyValidator, capture, errors)) { // get oid var oid = asn1.derToOid(capture.publicKeyOid); if(oid !== pki.oids.rsaEncryption) { var error = new Error('Cannot read public key. Unknown OID.'); error.oid = oid; throw error; } obj = capture.rsaPublicKey; } // get RSA params errors = []; if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) { var error = new Error('Cannot read public key. ' + 'ASN.1 object does not contain an RSAPublicKey.'); error.errors = errors; throw error; } // FIXME: inefficient, get a BigInteger that uses byte strings var n = forge.util.createBuffer(capture.publicKeyModulus).toHex(); var e = forge.util.createBuffer(capture.publicKeyExponent).toHex(); // set public key return pki.setRsaPublicKey( new BigInteger(n, 16), new BigInteger(e, 16)); }; /** * Converts a public key to an ASN.1 SubjectPublicKeyInfo. * * @param key the public key. * * @return the asn1 representation of a SubjectPublicKeyInfo. */ pki.publicKeyToAsn1 = pki.publicKeyToSubjectPublicKeyInfo = function(key) { // SubjectPublicKeyInfo return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ]), // subjectPublicKey asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ pki.publicKeyToRSAPublicKey(key) ]) ]); }; /** * Converts a public key to an ASN.1 RSAPublicKey. * * @param key the public key. * * @return the asn1 representation of a RSAPublicKey. */ pki.publicKeyToRSAPublicKey = function(key) { // RSAPublicKey return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // modulus (n) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.n)), // publicExponent (e) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.e)) ]); }; /** * Encodes a message using PKCS#1 v1.5 padding. * * @param m the message to encode. * @param key the RSA key to use. * @param bt the block type to use, i.e. either 0x01 (for signing) or 0x02 * (for encryption). * * @return the padded byte buffer. */ function _encodePkcs1_v1_5(m, key, bt) { var eb = forge.util.createBuffer(); // get the length of the modulus in bytes var k = Math.ceil(key.n.bitLength() / 8); /* use PKCS#1 v1.5 padding */ if(m.length > (k - 11)) { var error = new Error('Message is too long for PKCS#1 v1.5 padding.'); error.length = m.length; error.max = k - 11; throw error; } /* A block type BT, a padding string PS, and the data D shall be formatted into an octet string EB, the encryption block: EB = 00 || BT || PS || 00 || D The block type BT shall be a single octet indicating the structure of the encryption block. For this version of the document it shall have value 00, 01, or 02. For a private-key operation, the block type shall be 00 or 01. For a public-key operation, it shall be 02. The padding string PS shall consist of k-3-||D|| octets. For block type 00, the octets shall have value 00; for block type 01, they shall have value FF; and for block type 02, they shall be pseudorandomly generated and nonzero. This makes the length of the encryption block EB equal to k. */ // build the encryption block eb.putByte(0x00); eb.putByte(bt); // create the padding var padNum = k - 3 - m.length; var padByte; // private key op if(bt === 0x00 || bt === 0x01) { padByte = (bt === 0x00) ? 0x00 : 0xFF; for(var i = 0; i < padNum; ++i) { eb.putByte(padByte); } } else { // public key op // pad with random non-zero values while(padNum > 0) { var numZeros = 0; var padBytes = forge.random.getBytes(padNum); for(var i = 0; i < padNum; ++i) { padByte = padBytes.charCodeAt(i); if(padByte === 0) { ++numZeros; } else { eb.putByte(padByte); } } padNum = numZeros; } } // zero followed by message eb.putByte(0x00); eb.putBytes(m); return eb; } /** * Decodes a message using PKCS#1 v1.5 padding. * * @param em the message to decode. * @param key the RSA key to use. * @param pub true if the key is a public key, false if it is private. * @param ml the message length, if specified. * * @return the decoded bytes. */ function _decodePkcs1_v1_5(em, key, pub, ml) { // get the length of the modulus in bytes var k = Math.ceil(key.n.bitLength() / 8); /* It is an error if any of the following conditions occurs: 1. The encryption block EB cannot be parsed unambiguously. 2. The padding string PS consists of fewer than eight octets or is inconsisent with the block type BT. 3. The decryption process is a public-key operation and the block type BT is not 00 or 01, or the decryption process is a private-key operation and the block type is not 02. */ // parse the encryption block var eb = forge.util.createBuffer(em); var first = eb.getByte(); var bt = eb.getByte(); if(first !== 0x00 || (pub && bt !== 0x00 && bt !== 0x01) || (!pub && bt != 0x02) || (pub && bt === 0x00 && typeof(ml) === 'undefined')) { throw new Error('Encryption block is invalid.'); } var padNum = 0; if(bt === 0x00) { // check all padding bytes for 0x00 padNum = k - 3 - ml; for(var i = 0; i < padNum; ++i) { if(eb.getByte() !== 0x00) { throw new Error('Encryption block is invalid.'); } } } else if(bt === 0x01) { // find the first byte that isn't 0xFF, should be after all padding padNum = 0; while(eb.length() > 1) { if(eb.getByte() !== 0xFF) { --eb.read; break; } ++padNum; } } else if(bt === 0x02) { // look for 0x00 byte padNum = 0; while(eb.length() > 1) { if(eb.getByte() === 0x00) { --eb.read; break; } ++padNum; } } // zero must be 0x00 and padNum must be (k - 3 - message length) var zero = eb.getByte(); if(zero !== 0x00 || padNum !== (k - 3 - eb.length())) { throw new Error('Encryption block is invalid.'); } return eb.getBytes(); } /** * Runs the key-generation algorithm asynchronously, either in the background * via Web Workers, or using the main thread and setImmediate. * * @param state the key-pair generation state. * @param [options] options for key-pair generation: * workerScript the worker script URL. * workers the number of web workers (if supported) to use, * (default: 2, -1 to use estimated cores minus one). * workLoad the size of the work load, ie: number of possible prime * numbers for each web worker to check per work assignment, * (default: 100). * @param callback(err, keypair) called once the operation completes. */ function _generateKeyPair(state, options, callback) { if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; var opts = { algorithm: { name: options.algorithm || 'PRIMEINC', options: { workers: options.workers || 2, workLoad: options.workLoad || 100, workerScript: options.workerScript } } }; if('prng' in options) { opts.prng = options.prng; } generate(); function generate() { // find p and then q (done in series to simplify) getPrime(state.pBits, function(err, num) { if(err) { return callback(err); } state.p = num; if(state.q !== null) { return finish(err, state.q); } getPrime(state.qBits, finish); }); } function getPrime(bits, callback) { forge.prime.generateProbablePrime(bits, opts, callback); } function finish(err, num) { if(err) { return callback(err); } // set q state.q = num; // ensure p is larger than q (swap them if not) if(state.p.compareTo(state.q) < 0) { var tmp = state.p; state.p = state.q; state.q = tmp; } // ensure p is coprime with e if(state.p.subtract(BigInteger.ONE).gcd(state.e) .compareTo(BigInteger.ONE) !== 0) { state.p = null; generate(); return; } // ensure q is coprime with e if(state.q.subtract(BigInteger.ONE).gcd(state.e) .compareTo(BigInteger.ONE) !== 0) { state.q = null; getPrime(state.qBits, finish); return; } // compute phi: (p - 1)(q - 1) (Euler's totient function) state.p1 = state.p.subtract(BigInteger.ONE); state.q1 = state.q.subtract(BigInteger.ONE); state.phi = state.p1.multiply(state.q1); // ensure e and phi are coprime if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) { // phi and e aren't coprime, so generate a new p and q state.p = state.q = null; generate(); return; } // create n, ensure n is has the right number of bits state.n = state.p.multiply(state.q); if(state.n.bitLength() !== state.bits) { // failed, get new q state.q = null; getPrime(state.qBits, finish); return; } // set keys var d = state.e.modInverse(state.phi); state.keys = { privateKey: pki.rsa.setPrivateKey( state.n, state.e, d, state.p, state.q, d.mod(state.p1), d.mod(state.q1), state.q.modInverse(state.p)), publicKey: pki.rsa.setPublicKey(state.n, state.e) }; callback(null, state.keys); } } /** * Converts a positive BigInteger into 2's-complement big-endian bytes. * * @param b the big integer to convert. * * @return the bytes. */ function _bnToBytes(b) { // prepend 0x00 if first byte >= 0x80 var hex = b.toString(16); if(hex[0] >= '8') { hex = '00' + hex; } var bytes = forge.util.hexToBytes(hex); // ensure integer is minimally-encoded if(bytes.length > 1 && // leading 0x00 for positive integer ((bytes.charCodeAt(0) === 0 && (bytes.charCodeAt(1) & 0x80) === 0) || // leading 0xFF for negative integer (bytes.charCodeAt(0) === 0xFF && (bytes.charCodeAt(1) & 0x80) === 0x80))) { return bytes.substr(1); } return bytes; } /** * Returns the required number of Miller-Rabin tests to generate a * prime with an error probability of (1/2)^80. * * See Handbook of Applied Cryptography Chapter 4, Table 4.4. * * @param bits the bit size. * * @return the required number of iterations. */ function _getMillerRabinTests(bits) { if(bits <= 100) return 27; if(bits <= 150) return 18; if(bits <= 200) return 15; if(bits <= 250) return 12; if(bits <= 300) return 9; if(bits <= 350) return 8; if(bits <= 400) return 7; if(bits <= 500) return 6; if(bits <= 600) return 5; if(bits <= 800) return 4; if(bits <= 1250) return 3; return 2; } /** * Performs feature detection on the Node crypto interface. * * @param fn the feature (function) to detect. * * @return true if detected, false if not. */ function _detectNodeCrypto(fn) { return forge.util.isNodejs && typeof _crypto[fn] === 'function'; } /** * Performs feature detection on the SubtleCrypto interface. * * @param fn the feature (function) to detect. * * @return true if detected, false if not. */ function _detectSubtleCrypto(fn) { return (typeof util.globalScope !== 'undefined' && typeof util.globalScope.crypto === 'object' && typeof util.globalScope.crypto.subtle === 'object' && typeof util.globalScope.crypto.subtle[fn] === 'function'); } /** * Performs feature detection on the deprecated Microsoft Internet Explorer * outdated SubtleCrypto interface. This function should only be used after * checking for the modern, standard SubtleCrypto interface. * * @param fn the feature (function) to detect. * * @return true if detected, false if not. */ function _detectSubtleMsCrypto(fn) { return (typeof util.globalScope !== 'undefined' && typeof util.globalScope.msCrypto === 'object' && typeof util.globalScope.msCrypto.subtle === 'object' && typeof util.globalScope.msCrypto.subtle[fn] === 'function'); } function _intToUint8Array(x) { var bytes = forge.util.hexToBytes(x.toString(16)); var buffer = new Uint8Array(bytes.length); for(var i = 0; i < bytes.length; ++i) { buffer[i] = bytes.charCodeAt(i); } return buffer; } function _privateKeyFromJwk(jwk) { if(jwk.kty !== 'RSA') { throw new Error( 'Unsupported key algorithm "' + jwk.kty + '"; algorithm must be "RSA".'); } return pki.setRsaPrivateKey( _base64ToBigInt(jwk.n), _base64ToBigInt(jwk.e), _base64ToBigInt(jwk.d), _base64ToBigInt(jwk.p), _base64ToBigInt(jwk.q), _base64ToBigInt(jwk.dp), _base64ToBigInt(jwk.dq), _base64ToBigInt(jwk.qi)); } function _publicKeyFromJwk(jwk) { if(jwk.kty !== 'RSA') { throw new Error('Key algorithm must be "RSA".'); } return pki.setRsaPublicKey( _base64ToBigInt(jwk.n), _base64ToBigInt(jwk.e)); } function _base64ToBigInt(b64) { return new BigInteger(forge.util.bytesToHex(forge.util.decode64(b64)), 16); } /***/ }), /***/ 90279: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation. * * @author Dave Longley * * Copyright (c) 2010-2015 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(86231); __webpack_require__(28339); var sha1 = module.exports = forge.sha1 = forge.sha1 || {}; forge.md.sha1 = forge.md.algorithms.sha1 = sha1; /** * Creates a SHA-1 message digest object. * * @return a message digest object. */ sha1.create = function() { // do initialization as necessary if(!_initialized) { _init(); } // SHA-1 state contains five 32-bit integers var _state = null; // input buffer var _input = forge.util.createBuffer(); // used for word storage var _w = new Array(80); // message digest object var md = { algorithm: 'sha1', blockLength: 64, digestLength: 20, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length fullMessageLength: null, // size of message length in bytes messageLengthSize: 8 }; /** * Starts the digest. * * @return this digest object. */ md.start = function() { // up to 56-bit message length for convenience md.messageLength = 0; // full message length (set md.messageLength64 for backwards-compatibility) md.fullMessageLength = md.messageLength64 = []; var int32s = md.messageLengthSize / 4; for(var i = 0; i < int32s; ++i) { md.fullMessageLength.push(0); } _input = forge.util.createBuffer(); _state = { h0: 0x67452301, h1: 0xEFCDAB89, h2: 0x98BADCFE, h3: 0x10325476, h4: 0xC3D2E1F0 }; return md; }; // start digest automatically for first time md.start(); /** * Updates the digest with the given message input. The given input can * treated as raw input (no encoding will be applied) or an encoding of * 'utf8' maybe given to encode the input using UTF-8. * * @param msg the message input to update with. * @param encoding the encoding to use (default: 'raw', other: 'utf8'). * * @return this digest object. */ md.update = function(msg, encoding) { if(encoding === 'utf8') { msg = forge.util.encodeUtf8(msg); } // update message length var len = msg.length; md.messageLength += len; len = [(len / 0x100000000) >>> 0, len >>> 0]; for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { md.fullMessageLength[i] += len[1]; len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; len[0] = ((len[1] / 0x100000000) >>> 0); } // add bytes to input buffer _input.putBytes(msg); // process bytes _update(_state, _w, _input); // compact input buffer every 2K or if empty if(_input.read > 2048 || _input.length() === 0) { _input.compact(); } return md; }; /** * Produces the digest. * * @return a byte buffer containing the digest value. */ md.digest = function() { /* Note: Here we copy the remaining bytes in the input buffer and add the appropriate SHA-1 padding. Then we do the final update on a copy of the state so that if the user wants to get intermediate digests they can do so. */ /* Determine the number of bytes that must be added to the message to ensure its length is congruent to 448 mod 512. In other words, the data to be digested must be a multiple of 512 bits (or 128 bytes). This data includes the message, some padding, and the length of the message. Since the length of the message will be encoded as 8 bytes (64 bits), that means that the last segment of the data must have 56 bytes (448 bits) of message and padding. Therefore, the length of the message plus the padding must be congruent to 448 mod 512 because 512 - 128 = 448. In order to fill up the message length it must be filled with padding that begins with 1 bit followed by all 0 bits. Padding must *always* be present, so if the message length is already congruent to 448 mod 512, then 512 padding bits must be added. */ var finalBlock = forge.util.createBuffer(); finalBlock.putBytes(_input.bytes()); // compute remaining size to be digested (include message length size) var remaining = ( md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize); // add padding for overflow blockSize - overflow // _padding starts with 1 byte with first bit is set (byte value 128), then // there may be up to (blockSize - 1) other pad bytes var overflow = remaining & (md.blockLength - 1); finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); // serialize message length in bits in big-endian order; since length // is stored in bytes we multiply by 8 and add carry from next int var next, carry; var bits = md.fullMessageLength[0] * 8; for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { next = md.fullMessageLength[i + 1] * 8; carry = (next / 0x100000000) >>> 0; bits += carry; finalBlock.putInt32(bits >>> 0); bits = next >>> 0; } finalBlock.putInt32(bits); var s2 = { h0: _state.h0, h1: _state.h1, h2: _state.h2, h3: _state.h3, h4: _state.h4 }; _update(s2, _w, finalBlock); var rval = forge.util.createBuffer(); rval.putInt32(s2.h0); rval.putInt32(s2.h1); rval.putInt32(s2.h2); rval.putInt32(s2.h3); rval.putInt32(s2.h4); return rval; }; return md; }; // sha-1 padding bytes not initialized yet var _padding = null; var _initialized = false; /** * Initializes the constant tables. */ function _init() { // create padding _padding = String.fromCharCode(128); _padding += forge.util.fillString(String.fromCharCode(0x00), 64); // now initialized _initialized = true; } /** * Updates a SHA-1 state with the given byte buffer. * * @param s the SHA-1 state to update. * @param w the array to use to store words. * @param bytes the byte buffer to update with. */ function _update(s, w, bytes) { // consume 512 bit (64 byte) chunks var t, a, b, c, d, e, f, i; var len = bytes.length(); while(len >= 64) { // the w array will be populated with sixteen 32-bit big-endian words // and then extended into 80 32-bit words according to SHA-1 algorithm // and for 32-79 using Max Locktyukhin's optimization // initialize hash value for this chunk a = s.h0; b = s.h1; c = s.h2; d = s.h3; e = s.h4; // round 1 for(i = 0; i < 16; ++i) { t = bytes.getInt32(); w[i] = t; f = d ^ (b & (c ^ d)); t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; e = d; d = c; // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug c = ((b << 30) | (b >>> 2)) >>> 0; b = a; a = t; } for(; i < 20; ++i) { t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); t = (t << 1) | (t >>> 31); w[i] = t; f = d ^ (b & (c ^ d)); t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; e = d; d = c; // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug c = ((b << 30) | (b >>> 2)) >>> 0; b = a; a = t; } // round 2 for(; i < 32; ++i) { t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); t = (t << 1) | (t >>> 31); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; e = d; d = c; // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug c = ((b << 30) | (b >>> 2)) >>> 0; b = a; a = t; } for(; i < 40; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; e = d; d = c; // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug c = ((b << 30) | (b >>> 2)) >>> 0; b = a; a = t; } // round 3 for(; i < 60; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = (b & c) | (d & (b ^ c)); t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t; e = d; d = c; // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug c = ((b << 30) | (b >>> 2)) >>> 0; b = a; a = t; } // round 4 for(; i < 80; ++i) { t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); t = (t << 2) | (t >>> 30); w[i] = t; f = b ^ c ^ d; t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t; e = d; d = c; // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug c = ((b << 30) | (b >>> 2)) >>> 0; b = a; a = t; } // update hash state s.h0 = (s.h0 + a) | 0; s.h1 = (s.h1 + b) | 0; s.h2 = (s.h2 + c) | 0; s.h3 = (s.h3 + d) | 0; s.h4 = (s.h4 + e) | 0; len -= 64; } } /***/ }), /***/ 80953: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation. * * See FIPS 180-2 for details. * * @author Dave Longley * * Copyright (c) 2010-2015 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(86231); __webpack_require__(28339); var sha256 = module.exports = forge.sha256 = forge.sha256 || {}; forge.md.sha256 = forge.md.algorithms.sha256 = sha256; /** * Creates a SHA-256 message digest object. * * @return a message digest object. */ sha256.create = function() { // do initialization as necessary if(!_initialized) { _init(); } // SHA-256 state contains eight 32-bit integers var _state = null; // input buffer var _input = forge.util.createBuffer(); // used for word storage var _w = new Array(64); // message digest object var md = { algorithm: 'sha256', blockLength: 64, digestLength: 32, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length fullMessageLength: null, // size of message length in bytes messageLengthSize: 8 }; /** * Starts the digest. * * @return this digest object. */ md.start = function() { // up to 56-bit message length for convenience md.messageLength = 0; // full message length (set md.messageLength64 for backwards-compatibility) md.fullMessageLength = md.messageLength64 = []; var int32s = md.messageLengthSize / 4; for(var i = 0; i < int32s; ++i) { md.fullMessageLength.push(0); } _input = forge.util.createBuffer(); _state = { h0: 0x6A09E667, h1: 0xBB67AE85, h2: 0x3C6EF372, h3: 0xA54FF53A, h4: 0x510E527F, h5: 0x9B05688C, h6: 0x1F83D9AB, h7: 0x5BE0CD19 }; return md; }; // start digest automatically for first time md.start(); /** * Updates the digest with the given message input. The given input can * treated as raw input (no encoding will be applied) or an encoding of * 'utf8' maybe given to encode the input using UTF-8. * * @param msg the message input to update with. * @param encoding the encoding to use (default: 'raw', other: 'utf8'). * * @return this digest object. */ md.update = function(msg, encoding) { if(encoding === 'utf8') { msg = forge.util.encodeUtf8(msg); } // update message length var len = msg.length; md.messageLength += len; len = [(len / 0x100000000) >>> 0, len >>> 0]; for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { md.fullMessageLength[i] += len[1]; len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; len[0] = ((len[1] / 0x100000000) >>> 0); } // add bytes to input buffer _input.putBytes(msg); // process bytes _update(_state, _w, _input); // compact input buffer every 2K or if empty if(_input.read > 2048 || _input.length() === 0) { _input.compact(); } return md; }; /** * Produces the digest. * * @return a byte buffer containing the digest value. */ md.digest = function() { /* Note: Here we copy the remaining bytes in the input buffer and add the appropriate SHA-256 padding. Then we do the final update on a copy of the state so that if the user wants to get intermediate digests they can do so. */ /* Determine the number of bytes that must be added to the message to ensure its length is congruent to 448 mod 512. In other words, the data to be digested must be a multiple of 512 bits (or 128 bytes). This data includes the message, some padding, and the length of the message. Since the length of the message will be encoded as 8 bytes (64 bits), that means that the last segment of the data must have 56 bytes (448 bits) of message and padding. Therefore, the length of the message plus the padding must be congruent to 448 mod 512 because 512 - 128 = 448. In order to fill up the message length it must be filled with padding that begins with 1 bit followed by all 0 bits. Padding must *always* be present, so if the message length is already congruent to 448 mod 512, then 512 padding bits must be added. */ var finalBlock = forge.util.createBuffer(); finalBlock.putBytes(_input.bytes()); // compute remaining size to be digested (include message length size) var remaining = ( md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize); // add padding for overflow blockSize - overflow // _padding starts with 1 byte with first bit is set (byte value 128), then // there may be up to (blockSize - 1) other pad bytes var overflow = remaining & (md.blockLength - 1); finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); // serialize message length in bits in big-endian order; since length // is stored in bytes we multiply by 8 and add carry from next int var next, carry; var bits = md.fullMessageLength[0] * 8; for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { next = md.fullMessageLength[i + 1] * 8; carry = (next / 0x100000000) >>> 0; bits += carry; finalBlock.putInt32(bits >>> 0); bits = next >>> 0; } finalBlock.putInt32(bits); var s2 = { h0: _state.h0, h1: _state.h1, h2: _state.h2, h3: _state.h3, h4: _state.h4, h5: _state.h5, h6: _state.h6, h7: _state.h7 }; _update(s2, _w, finalBlock); var rval = forge.util.createBuffer(); rval.putInt32(s2.h0); rval.putInt32(s2.h1); rval.putInt32(s2.h2); rval.putInt32(s2.h3); rval.putInt32(s2.h4); rval.putInt32(s2.h5); rval.putInt32(s2.h6); rval.putInt32(s2.h7); return rval; }; return md; }; // sha-256 padding bytes not initialized yet var _padding = null; var _initialized = false; // table of constants var _k = null; /** * Initializes the constant tables. */ function _init() { // create padding _padding = String.fromCharCode(128); _padding += forge.util.fillString(String.fromCharCode(0x00), 64); // create K table for SHA-256 _k = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; // now initialized _initialized = true; } /** * Updates a SHA-256 state with the given byte buffer. * * @param s the SHA-256 state to update. * @param w the array to use to store words. * @param bytes the byte buffer to update with. */ function _update(s, w, bytes) { // consume 512 bit (64 byte) chunks var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h; var len = bytes.length(); while(len >= 64) { // the w array will be populated with sixteen 32-bit big-endian words // and then extended into 64 32-bit words according to SHA-256 for(i = 0; i < 16; ++i) { w[i] = bytes.getInt32(); } for(; i < 64; ++i) { // XOR word 2 words ago rot right 17, rot right 19, shft right 10 t1 = w[i - 2]; t1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^ (t1 >>> 10); // XOR word 15 words ago rot right 7, rot right 18, shft right 3 t2 = w[i - 15]; t2 = ((t2 >>> 7) | (t2 << 25)) ^ ((t2 >>> 18) | (t2 << 14)) ^ (t2 >>> 3); // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^32 w[i] = (t1 + w[i - 7] + t2 + w[i - 16]) | 0; } // initialize hash value for this chunk a = s.h0; b = s.h1; c = s.h2; d = s.h3; e = s.h4; f = s.h5; g = s.h6; h = s.h7; // round function for(i = 0; i < 64; ++i) { // Sum1(e) s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7)); // Ch(e, f, g) (optimized the same way as SHA-1) ch = g ^ (e & (f ^ g)); // Sum0(a) s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10)); // Maj(a, b, c) (optimized the same way as SHA-1) maj = (a & b) | (c & (a ^ b)); // main algorithm t1 = h + s1 + ch + _k[i] + w[i]; t2 = s0 + maj; h = g; g = f; f = e; // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug // can't truncate with `| 0` e = (d + t1) >>> 0; d = c; c = b; b = a; // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug // can't truncate with `| 0` a = (t1 + t2) >>> 0; } // update hash state s.h0 = (s.h0 + a) | 0; s.h1 = (s.h1 + b) | 0; s.h2 = (s.h2 + c) | 0; s.h3 = (s.h3 + d) | 0; s.h4 = (s.h4 + e) | 0; s.h5 = (s.h5 + f) | 0; s.h6 = (s.h6 + g) | 0; s.h7 = (s.h7 + h) | 0; len -= 64; } } /***/ }), /***/ 59542: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Secure Hash Algorithm with a 1024-bit block size implementation. * * This includes: SHA-512, SHA-384, SHA-512/224, and SHA-512/256. For * SHA-256 (block size 512 bits), see sha256.js. * * See FIPS 180-4 for details. * * @author Dave Longley * * Copyright (c) 2014-2015 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(86231); __webpack_require__(28339); var sha512 = module.exports = forge.sha512 = forge.sha512 || {}; // SHA-512 forge.md.sha512 = forge.md.algorithms.sha512 = sha512; // SHA-384 var sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {}; sha384.create = function() { return sha512.create('SHA-384'); }; forge.md.sha384 = forge.md.algorithms.sha384 = sha384; // SHA-512/256 forge.sha512.sha256 = forge.sha512.sha256 || { create: function() { return sha512.create('SHA-512/256'); } }; forge.md['sha512/256'] = forge.md.algorithms['sha512/256'] = forge.sha512.sha256; // SHA-512/224 forge.sha512.sha224 = forge.sha512.sha224 || { create: function() { return sha512.create('SHA-512/224'); } }; forge.md['sha512/224'] = forge.md.algorithms['sha512/224'] = forge.sha512.sha224; /** * Creates a SHA-2 message digest object. * * @param algorithm the algorithm to use (SHA-512, SHA-384, SHA-512/224, * SHA-512/256). * * @return a message digest object. */ sha512.create = function(algorithm) { // do initialization as necessary if(!_initialized) { _init(); } if(typeof algorithm === 'undefined') { algorithm = 'SHA-512'; } if(!(algorithm in _states)) { throw new Error('Invalid SHA-512 algorithm: ' + algorithm); } // SHA-512 state contains eight 64-bit integers (each as two 32-bit ints) var _state = _states[algorithm]; var _h = null; // input buffer var _input = forge.util.createBuffer(); // used for 64-bit word storage var _w = new Array(80); for(var wi = 0; wi < 80; ++wi) { _w[wi] = new Array(2); } // determine digest length by algorithm name (default) var digestLength = 64; switch(algorithm) { case 'SHA-384': digestLength = 48; break; case 'SHA-512/256': digestLength = 32; break; case 'SHA-512/224': digestLength = 28; break; } // message digest object var md = { // SHA-512 => sha512 algorithm: algorithm.replace('-', '').toLowerCase(), blockLength: 128, digestLength: digestLength, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length fullMessageLength: null, // size of message length in bytes messageLengthSize: 16 }; /** * Starts the digest. * * @return this digest object. */ md.start = function() { // up to 56-bit message length for convenience md.messageLength = 0; // full message length (set md.messageLength128 for backwards-compatibility) md.fullMessageLength = md.messageLength128 = []; var int32s = md.messageLengthSize / 4; for(var i = 0; i < int32s; ++i) { md.fullMessageLength.push(0); } _input = forge.util.createBuffer(); _h = new Array(_state.length); for(var i = 0; i < _state.length; ++i) { _h[i] = _state[i].slice(0); } return md; }; // start digest automatically for first time md.start(); /** * Updates the digest with the given message input. The given input can * treated as raw input (no encoding will be applied) or an encoding of * 'utf8' maybe given to encode the input using UTF-8. * * @param msg the message input to update with. * @param encoding the encoding to use (default: 'raw', other: 'utf8'). * * @return this digest object. */ md.update = function(msg, encoding) { if(encoding === 'utf8') { msg = forge.util.encodeUtf8(msg); } // update message length var len = msg.length; md.messageLength += len; len = [(len / 0x100000000) >>> 0, len >>> 0]; for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { md.fullMessageLength[i] += len[1]; len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; len[0] = ((len[1] / 0x100000000) >>> 0); } // add bytes to input buffer _input.putBytes(msg); // process bytes _update(_h, _w, _input); // compact input buffer every 2K or if empty if(_input.read > 2048 || _input.length() === 0) { _input.compact(); } return md; }; /** * Produces the digest. * * @return a byte buffer containing the digest value. */ md.digest = function() { /* Note: Here we copy the remaining bytes in the input buffer and add the appropriate SHA-512 padding. Then we do the final update on a copy of the state so that if the user wants to get intermediate digests they can do so. */ /* Determine the number of bytes that must be added to the message to ensure its length is congruent to 896 mod 1024. In other words, the data to be digested must be a multiple of 1024 bits (or 128 bytes). This data includes the message, some padding, and the length of the message. Since the length of the message will be encoded as 16 bytes (128 bits), that means that the last segment of the data must have 112 bytes (896 bits) of message and padding. Therefore, the length of the message plus the padding must be congruent to 896 mod 1024 because 1024 - 128 = 896. In order to fill up the message length it must be filled with padding that begins with 1 bit followed by all 0 bits. Padding must *always* be present, so if the message length is already congruent to 896 mod 1024, then 1024 padding bits must be added. */ var finalBlock = forge.util.createBuffer(); finalBlock.putBytes(_input.bytes()); // compute remaining size to be digested (include message length size) var remaining = ( md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize); // add padding for overflow blockSize - overflow // _padding starts with 1 byte with first bit is set (byte value 128), then // there may be up to (blockSize - 1) other pad bytes var overflow = remaining & (md.blockLength - 1); finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); // serialize message length in bits in big-endian order; since length // is stored in bytes we multiply by 8 and add carry from next int var next, carry; var bits = md.fullMessageLength[0] * 8; for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { next = md.fullMessageLength[i + 1] * 8; carry = (next / 0x100000000) >>> 0; bits += carry; finalBlock.putInt32(bits >>> 0); bits = next >>> 0; } finalBlock.putInt32(bits); var h = new Array(_h.length); for(var i = 0; i < _h.length; ++i) { h[i] = _h[i].slice(0); } _update(h, _w, finalBlock); var rval = forge.util.createBuffer(); var hlen; if(algorithm === 'SHA-512') { hlen = h.length; } else if(algorithm === 'SHA-384') { hlen = h.length - 2; } else { hlen = h.length - 4; } for(var i = 0; i < hlen; ++i) { rval.putInt32(h[i][0]); if(i !== hlen - 1 || algorithm !== 'SHA-512/224') { rval.putInt32(h[i][1]); } } return rval; }; return md; }; // sha-512 padding bytes not initialized yet var _padding = null; var _initialized = false; // table of constants var _k = null; // initial hash states var _states = null; /** * Initializes the constant tables. */ function _init() { // create padding _padding = String.fromCharCode(128); _padding += forge.util.fillString(String.fromCharCode(0x00), 128); // create K table for SHA-512 _k = [ [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd], [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8189dbbc], [0x3956c25b, 0xf348b538], [0x59f111f1, 0xb605d019], [0x923f82a4, 0xaf194f9b], [0xab1c5ed5, 0xda6d8118], [0xd807aa98, 0xa3030242], [0x12835b01, 0x45706fbe], [0x243185be, 0x4ee4b28c], [0x550c7dc3, 0xd5ffb4e2], [0x72be5d74, 0xf27b896f], [0x80deb1fe, 0x3b1696b1], [0x9bdc06a7, 0x25c71235], [0xc19bf174, 0xcf692694], [0xe49b69c1, 0x9ef14ad2], [0xefbe4786, 0x384f25e3], [0x0fc19dc6, 0x8b8cd5b5], [0x240ca1cc, 0x77ac9c65], [0x2de92c6f, 0x592b0275], [0x4a7484aa, 0x6ea6e483], [0x5cb0a9dc, 0xbd41fbd4], [0x76f988da, 0x831153b5], [0x983e5152, 0xee66dfab], [0xa831c66d, 0x2db43210], [0xb00327c8, 0x98fb213f], [0xbf597fc7, 0xbeef0ee4], [0xc6e00bf3, 0x3da88fc2], [0xd5a79147, 0x930aa725], [0x06ca6351, 0xe003826f], [0x14292967, 0x0a0e6e70], [0x27b70a85, 0x46d22ffc], [0x2e1b2138, 0x5c26c926], [0x4d2c6dfc, 0x5ac42aed], [0x53380d13, 0x9d95b3df], [0x650a7354, 0x8baf63de], [0x766a0abb, 0x3c77b2a8], [0x81c2c92e, 0x47edaee6], [0x92722c85, 0x1482353b], [0xa2bfe8a1, 0x4cf10364], [0xa81a664b, 0xbc423001], [0xc24b8b70, 0xd0f89791], [0xc76c51a3, 0x0654be30], [0xd192e819, 0xd6ef5218], [0xd6990624, 0x5565a910], [0xf40e3585, 0x5771202a], [0x106aa070, 0x32bbd1b8], [0x19a4c116, 0xb8d2d0c8], [0x1e376c08, 0x5141ab53], [0x2748774c, 0xdf8eeb99], [0x34b0bcb5, 0xe19b48a8], [0x391c0cb3, 0xc5c95a63], [0x4ed8aa4a, 0xe3418acb], [0x5b9cca4f, 0x7763e373], [0x682e6ff3, 0xd6b2b8a3], [0x748f82ee, 0x5defb2fc], [0x78a5636f, 0x43172f60], [0x84c87814, 0xa1f0ab72], [0x8cc70208, 0x1a6439ec], [0x90befffa, 0x23631e28], [0xa4506ceb, 0xde82bde9], [0xbef9a3f7, 0xb2c67915], [0xc67178f2, 0xe372532b], [0xca273ece, 0xea26619c], [0xd186b8c7, 0x21c0c207], [0xeada7dd6, 0xcde0eb1e], [0xf57d4f7f, 0xee6ed178], [0x06f067aa, 0x72176fba], [0x0a637dc5, 0xa2c898a6], [0x113f9804, 0xbef90dae], [0x1b710b35, 0x131c471b], [0x28db77f5, 0x23047d84], [0x32caab7b, 0x40c72493], [0x3c9ebe0a, 0x15c9bebc], [0x431d67c4, 0x9c100d4c], [0x4cc5d4be, 0xcb3e42b6], [0x597f299c, 0xfc657e2a], [0x5fcb6fab, 0x3ad6faec], [0x6c44198c, 0x4a475817] ]; // initial hash states _states = {}; _states['SHA-512'] = [ [0x6a09e667, 0xf3bcc908], [0xbb67ae85, 0x84caa73b], [0x3c6ef372, 0xfe94f82b], [0xa54ff53a, 0x5f1d36f1], [0x510e527f, 0xade682d1], [0x9b05688c, 0x2b3e6c1f], [0x1f83d9ab, 0xfb41bd6b], [0x5be0cd19, 0x137e2179] ]; _states['SHA-384'] = [ [0xcbbb9d5d, 0xc1059ed8], [0x629a292a, 0x367cd507], [0x9159015a, 0x3070dd17], [0x152fecd8, 0xf70e5939], [0x67332667, 0xffc00b31], [0x8eb44a87, 0x68581511], [0xdb0c2e0d, 0x64f98fa7], [0x47b5481d, 0xbefa4fa4] ]; _states['SHA-512/256'] = [ [0x22312194, 0xFC2BF72C], [0x9F555FA3, 0xC84C64C2], [0x2393B86B, 0x6F53B151], [0x96387719, 0x5940EABD], [0x96283EE2, 0xA88EFFE3], [0xBE5E1E25, 0x53863992], [0x2B0199FC, 0x2C85B8AA], [0x0EB72DDC, 0x81C52CA2] ]; _states['SHA-512/224'] = [ [0x8C3D37C8, 0x19544DA2], [0x73E19966, 0x89DCD4D6], [0x1DFAB7AE, 0x32FF9C82], [0x679DD514, 0x582F9FCF], [0x0F6D2B69, 0x7BD44DA8], [0x77E36F73, 0x04C48942], [0x3F9D85A8, 0x6A1D36C8], [0x1112E6AD, 0x91D692A1] ]; // now initialized _initialized = true; } /** * Updates a SHA-512 state with the given byte buffer. * * @param s the SHA-512 state to update. * @param w the array to use to store words. * @param bytes the byte buffer to update with. */ function _update(s, w, bytes) { // consume 512 bit (128 byte) chunks var t1_hi, t1_lo; var t2_hi, t2_lo; var s0_hi, s0_lo; var s1_hi, s1_lo; var ch_hi, ch_lo; var maj_hi, maj_lo; var a_hi, a_lo; var b_hi, b_lo; var c_hi, c_lo; var d_hi, d_lo; var e_hi, e_lo; var f_hi, f_lo; var g_hi, g_lo; var h_hi, h_lo; var i, hi, lo, w2, w7, w15, w16; var len = bytes.length(); while(len >= 128) { // the w array will be populated with sixteen 64-bit big-endian words // and then extended into 64 64-bit words according to SHA-512 for(i = 0; i < 16; ++i) { w[i][0] = bytes.getInt32() >>> 0; w[i][1] = bytes.getInt32() >>> 0; } for(; i < 80; ++i) { // for word 2 words ago: ROTR 19(x) ^ ROTR 61(x) ^ SHR 6(x) w2 = w[i - 2]; hi = w2[0]; lo = w2[1]; // high bits t1_hi = ( ((hi >>> 19) | (lo << 13)) ^ // ROTR 19 ((lo >>> 29) | (hi << 3)) ^ // ROTR 61/(swap + ROTR 29) (hi >>> 6)) >>> 0; // SHR 6 // low bits t1_lo = ( ((hi << 13) | (lo >>> 19)) ^ // ROTR 19 ((lo << 3) | (hi >>> 29)) ^ // ROTR 61/(swap + ROTR 29) ((hi << 26) | (lo >>> 6))) >>> 0; // SHR 6 // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x) w15 = w[i - 15]; hi = w15[0]; lo = w15[1]; // high bits t2_hi = ( ((hi >>> 1) | (lo << 31)) ^ // ROTR 1 ((hi >>> 8) | (lo << 24)) ^ // ROTR 8 (hi >>> 7)) >>> 0; // SHR 7 // low bits t2_lo = ( ((hi << 31) | (lo >>> 1)) ^ // ROTR 1 ((hi << 24) | (lo >>> 8)) ^ // ROTR 8 ((hi << 25) | (lo >>> 7))) >>> 0; // SHR 7 // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow) w7 = w[i - 7]; w16 = w[i - 16]; lo = (t1_lo + w7[1] + t2_lo + w16[1]); w[i][0] = (t1_hi + w7[0] + t2_hi + w16[0] + ((lo / 0x100000000) >>> 0)) >>> 0; w[i][1] = lo >>> 0; } // initialize hash value for this chunk a_hi = s[0][0]; a_lo = s[0][1]; b_hi = s[1][0]; b_lo = s[1][1]; c_hi = s[2][0]; c_lo = s[2][1]; d_hi = s[3][0]; d_lo = s[3][1]; e_hi = s[4][0]; e_lo = s[4][1]; f_hi = s[5][0]; f_lo = s[5][1]; g_hi = s[6][0]; g_lo = s[6][1]; h_hi = s[7][0]; h_lo = s[7][1]; // round function for(i = 0; i < 80; ++i) { // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e) s1_hi = ( ((e_hi >>> 14) | (e_lo << 18)) ^ // ROTR 14 ((e_hi >>> 18) | (e_lo << 14)) ^ // ROTR 18 ((e_lo >>> 9) | (e_hi << 23))) >>> 0; // ROTR 41/(swap + ROTR 9) s1_lo = ( ((e_hi << 18) | (e_lo >>> 14)) ^ // ROTR 14 ((e_hi << 14) | (e_lo >>> 18)) ^ // ROTR 18 ((e_lo << 23) | (e_hi >>> 9))) >>> 0; // ROTR 41/(swap + ROTR 9) // Ch(e, f, g) (optimized the same way as SHA-1) ch_hi = (g_hi ^ (e_hi & (f_hi ^ g_hi))) >>> 0; ch_lo = (g_lo ^ (e_lo & (f_lo ^ g_lo))) >>> 0; // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a) s0_hi = ( ((a_hi >>> 28) | (a_lo << 4)) ^ // ROTR 28 ((a_lo >>> 2) | (a_hi << 30)) ^ // ROTR 34/(swap + ROTR 2) ((a_lo >>> 7) | (a_hi << 25))) >>> 0; // ROTR 39/(swap + ROTR 7) s0_lo = ( ((a_hi << 4) | (a_lo >>> 28)) ^ // ROTR 28 ((a_lo << 30) | (a_hi >>> 2)) ^ // ROTR 34/(swap + ROTR 2) ((a_lo << 25) | (a_hi >>> 7))) >>> 0; // ROTR 39/(swap + ROTR 7) // Maj(a, b, c) (optimized the same way as SHA-1) maj_hi = ((a_hi & b_hi) | (c_hi & (a_hi ^ b_hi))) >>> 0; maj_lo = ((a_lo & b_lo) | (c_lo & (a_lo ^ b_lo))) >>> 0; // main algorithm // t1 = (h + s1 + ch + _k[i] + _w[i]) modulo 2^64 (carry lo overflow) lo = (h_lo + s1_lo + ch_lo + _k[i][1] + w[i][1]); t1_hi = (h_hi + s1_hi + ch_hi + _k[i][0] + w[i][0] + ((lo / 0x100000000) >>> 0)) >>> 0; t1_lo = lo >>> 0; // t2 = s0 + maj modulo 2^64 (carry lo overflow) lo = s0_lo + maj_lo; t2_hi = (s0_hi + maj_hi + ((lo / 0x100000000) >>> 0)) >>> 0; t2_lo = lo >>> 0; h_hi = g_hi; h_lo = g_lo; g_hi = f_hi; g_lo = f_lo; f_hi = e_hi; f_lo = e_lo; // e = (d + t1) modulo 2^64 (carry lo overflow) lo = d_lo + t1_lo; e_hi = (d_hi + t1_hi + ((lo / 0x100000000) >>> 0)) >>> 0; e_lo = lo >>> 0; d_hi = c_hi; d_lo = c_lo; c_hi = b_hi; c_lo = b_lo; b_hi = a_hi; b_lo = a_lo; // a = (t1 + t2) modulo 2^64 (carry lo overflow) lo = t1_lo + t2_lo; a_hi = (t1_hi + t2_hi + ((lo / 0x100000000) >>> 0)) >>> 0; a_lo = lo >>> 0; } // update hash state (additional modulo 2^64) lo = s[0][1] + a_lo; s[0][0] = (s[0][0] + a_hi + ((lo / 0x100000000) >>> 0)) >>> 0; s[0][1] = lo >>> 0; lo = s[1][1] + b_lo; s[1][0] = (s[1][0] + b_hi + ((lo / 0x100000000) >>> 0)) >>> 0; s[1][1] = lo >>> 0; lo = s[2][1] + c_lo; s[2][0] = (s[2][0] + c_hi + ((lo / 0x100000000) >>> 0)) >>> 0; s[2][1] = lo >>> 0; lo = s[3][1] + d_lo; s[3][0] = (s[3][0] + d_hi + ((lo / 0x100000000) >>> 0)) >>> 0; s[3][1] = lo >>> 0; lo = s[4][1] + e_lo; s[4][0] = (s[4][0] + e_hi + ((lo / 0x100000000) >>> 0)) >>> 0; s[4][1] = lo >>> 0; lo = s[5][1] + f_lo; s[5][0] = (s[5][0] + f_hi + ((lo / 0x100000000) >>> 0)) >>> 0; s[5][1] = lo >>> 0; lo = s[6][1] + g_lo; s[6][0] = (s[6][0] + g_hi + ((lo / 0x100000000) >>> 0)) >>> 0; s[6][1] = lo >>> 0; lo = s[7][1] + h_lo; s[7][0] = (s[7][0] + h_hi + ((lo / 0x100000000) >>> 0)) >>> 0; s[7][1] = lo >>> 0; len -= 128; } } /***/ }), /***/ 94280: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Functions to output keys in SSH-friendly formats. * * This is part of the Forge project which may be used under the terms of * either the BSD License or the GNU General Public License (GPL) Version 2. * * See: https://github.com/digitalbazaar/forge/blob/cbebca3780658703d925b61b2caffb1d263a6c1d/LICENSE * * @author https://github.com/shellac */ var forge = __webpack_require__(89177); __webpack_require__(87994); __webpack_require__(95104); __webpack_require__(86594); __webpack_require__(90279); __webpack_require__(28339); var ssh = module.exports = forge.ssh = forge.ssh || {}; /** * Encodes (and optionally encrypts) a private RSA key as a Putty PPK file. * * @param privateKey the key. * @param passphrase a passphrase to protect the key (falsy for no encryption). * @param comment a comment to include in the key file. * * @return the PPK file as a string. */ ssh.privateKeyToPutty = function(privateKey, passphrase, comment) { comment = comment || ''; passphrase = passphrase || ''; var algorithm = 'ssh-rsa'; var encryptionAlgorithm = (passphrase === '') ? 'none' : 'aes256-cbc'; var ppk = 'PuTTY-User-Key-File-2: ' + algorithm + '\r\n'; ppk += 'Encryption: ' + encryptionAlgorithm + '\r\n'; ppk += 'Comment: ' + comment + '\r\n'; // public key into buffer for ppk var pubbuffer = forge.util.createBuffer(); _addStringToBuffer(pubbuffer, algorithm); _addBigIntegerToBuffer(pubbuffer, privateKey.e); _addBigIntegerToBuffer(pubbuffer, privateKey.n); // write public key var pub = forge.util.encode64(pubbuffer.bytes(), 64); var length = Math.floor(pub.length / 66) + 1; // 66 = 64 + \r\n ppk += 'Public-Lines: ' + length + '\r\n'; ppk += pub; // private key into a buffer var privbuffer = forge.util.createBuffer(); _addBigIntegerToBuffer(privbuffer, privateKey.d); _addBigIntegerToBuffer(privbuffer, privateKey.p); _addBigIntegerToBuffer(privbuffer, privateKey.q); _addBigIntegerToBuffer(privbuffer, privateKey.qInv); // optionally encrypt the private key var priv; if(!passphrase) { // use the unencrypted buffer priv = forge.util.encode64(privbuffer.bytes(), 64); } else { // encrypt RSA key using passphrase var encLen = privbuffer.length() + 16 - 1; encLen -= encLen % 16; // pad private key with sha1-d data -- needs to be a multiple of 16 var padding = _sha1(privbuffer.bytes()); padding.truncate(padding.length() - encLen + privbuffer.length()); privbuffer.putBuffer(padding); var aeskey = forge.util.createBuffer(); aeskey.putBuffer(_sha1('\x00\x00\x00\x00', passphrase)); aeskey.putBuffer(_sha1('\x00\x00\x00\x01', passphrase)); // encrypt some bytes using CBC mode // key is 40 bytes, so truncate *by* 8 bytes var cipher = forge.aes.createEncryptionCipher(aeskey.truncate(8), 'CBC'); cipher.start(forge.util.createBuffer().fillWithByte(0, 16)); cipher.update(privbuffer.copy()); cipher.finish(); var encrypted = cipher.output; // Note: this appears to differ from Putty -- is forge wrong, or putty? // due to padding we finish as an exact multiple of 16 encrypted.truncate(16); // all padding priv = forge.util.encode64(encrypted.bytes(), 64); } // output private key length = Math.floor(priv.length / 66) + 1; // 64 + \r\n ppk += '\r\nPrivate-Lines: ' + length + '\r\n'; ppk += priv; // MAC var mackey = _sha1('putty-private-key-file-mac-key', passphrase); var macbuffer = forge.util.createBuffer(); _addStringToBuffer(macbuffer, algorithm); _addStringToBuffer(macbuffer, encryptionAlgorithm); _addStringToBuffer(macbuffer, comment); macbuffer.putInt32(pubbuffer.length()); macbuffer.putBuffer(pubbuffer); macbuffer.putInt32(privbuffer.length()); macbuffer.putBuffer(privbuffer); var hmac = forge.hmac.create(); hmac.start('sha1', mackey); hmac.update(macbuffer.bytes()); ppk += '\r\nPrivate-MAC: ' + hmac.digest().toHex() + '\r\n'; return ppk; }; /** * Encodes a public RSA key as an OpenSSH file. * * @param key the key. * @param comment a comment. * * @return the public key in OpenSSH format. */ ssh.publicKeyToOpenSSH = function(key, comment) { var type = 'ssh-rsa'; comment = comment || ''; var buffer = forge.util.createBuffer(); _addStringToBuffer(buffer, type); _addBigIntegerToBuffer(buffer, key.e); _addBigIntegerToBuffer(buffer, key.n); return type + ' ' + forge.util.encode64(buffer.bytes()) + ' ' + comment; }; /** * Encodes a private RSA key as an OpenSSH file. * * @param key the key. * @param passphrase a passphrase to protect the key (falsy for no encryption). * * @return the public key in OpenSSH format. */ ssh.privateKeyToOpenSSH = function(privateKey, passphrase) { if(!passphrase) { return forge.pki.privateKeyToPem(privateKey); } // OpenSSH private key is just a legacy format, it seems return forge.pki.encryptRsaPrivateKey(privateKey, passphrase, {legacy: true, algorithm: 'aes128'}); }; /** * Gets the SSH fingerprint for the given public key. * * @param options the options to use. * [md] the message digest object to use (defaults to forge.md.md5). * [encoding] an alternative output encoding, such as 'hex' * (defaults to none, outputs a byte buffer). * [delimiter] the delimiter to use between bytes for 'hex' encoded * output, eg: ':' (defaults to none). * * @return the fingerprint as a byte buffer or other encoding based on options. */ ssh.getPublicKeyFingerprint = function(key, options) { options = options || {}; var md = options.md || forge.md.md5.create(); var type = 'ssh-rsa'; var buffer = forge.util.createBuffer(); _addStringToBuffer(buffer, type); _addBigIntegerToBuffer(buffer, key.e); _addBigIntegerToBuffer(buffer, key.n); // hash public key bytes md.start(); md.update(buffer.getBytes()); var digest = md.digest(); if(options.encoding === 'hex') { var hex = digest.toHex(); if(options.delimiter) { return hex.match(/.{2}/g).join(options.delimiter); } return hex; } else if(options.encoding === 'binary') { return digest.getBytes(); } else if(options.encoding) { throw new Error('Unknown encoding "' + options.encoding + '".'); } return digest; }; /** * Adds len(val) then val to a buffer. * * @param buffer the buffer to add to. * @param val a big integer. */ function _addBigIntegerToBuffer(buffer, val) { var hexVal = val.toString(16); // ensure 2s complement +ve if(hexVal[0] >= '8') { hexVal = '00' + hexVal; } var bytes = forge.util.hexToBytes(hexVal); buffer.putInt32(bytes.length); buffer.putBytes(bytes); } /** * Adds len(val) then val to a buffer. * * @param buffer the buffer to add to. * @param val a string. */ function _addStringToBuffer(buffer, val) { buffer.putInt32(val.length); buffer.putString(val); } /** * Hashes the arguments into one value using SHA-1. * * @return the sha1 hash of the provided arguments. */ function _sha1() { var sha = forge.md.sha1.create(); var num = arguments.length; for (var i = 0; i < num; ++i) { sha.update(arguments[i]); } return sha.digest(); } /***/ }), /***/ 19563: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Support for concurrent task management and synchronization in web * applications. * * @author Dave Longley * @author David I. Lehn * * Copyright (c) 2009-2013 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); __webpack_require__(52923); __webpack_require__(49994); __webpack_require__(28339); // logging category var cat = 'forge.task'; // verbose level // 0: off, 1: a little, 2: a whole lot // Verbose debug logging is surrounded by a level check to avoid the // performance issues with even calling the logging code regardless if it // is actually logged. For performance reasons this should not be set to 2 // for production use. // ex: if(sVL >= 2) forge.log.verbose(....) var sVL = 0; // track tasks for debugging var sTasks = {}; var sNextTaskId = 0; // debug access forge.debug.set(cat, 'tasks', sTasks); // a map of task type to task queue var sTaskQueues = {}; // debug access forge.debug.set(cat, 'queues', sTaskQueues); // name for unnamed tasks var sNoTaskName = '?'; // maximum number of doNext() recursions before a context swap occurs // FIXME: might need to tweak this based on the browser var sMaxRecursions = 30; // time slice for doing tasks before a context swap occurs // FIXME: might need to tweak this based on the browser var sTimeSlice = 20; /** * Task states. * * READY: ready to start processing * RUNNING: task or a subtask is running * BLOCKED: task is waiting to acquire N permits to continue * SLEEPING: task is sleeping for a period of time * DONE: task is done * ERROR: task has an error */ var READY = 'ready'; var RUNNING = 'running'; var BLOCKED = 'blocked'; var SLEEPING = 'sleeping'; var DONE = 'done'; var ERROR = 'error'; /** * Task actions. Used to control state transitions. * * STOP: stop processing * START: start processing tasks * BLOCK: block task from continuing until 1 or more permits are released * UNBLOCK: release one or more permits * SLEEP: sleep for a period of time * WAKEUP: wakeup early from SLEEPING state * CANCEL: cancel further tasks * FAIL: a failure occured */ var STOP = 'stop'; var START = 'start'; var BLOCK = 'block'; var UNBLOCK = 'unblock'; var SLEEP = 'sleep'; var WAKEUP = 'wakeup'; var CANCEL = 'cancel'; var FAIL = 'fail'; /** * State transition table. * * nextState = sStateTable[currentState][action] */ var sStateTable = {}; sStateTable[READY] = {}; sStateTable[READY][STOP] = READY; sStateTable[READY][START] = RUNNING; sStateTable[READY][CANCEL] = DONE; sStateTable[READY][FAIL] = ERROR; sStateTable[RUNNING] = {}; sStateTable[RUNNING][STOP] = READY; sStateTable[RUNNING][START] = RUNNING; sStateTable[RUNNING][BLOCK] = BLOCKED; sStateTable[RUNNING][UNBLOCK] = RUNNING; sStateTable[RUNNING][SLEEP] = SLEEPING; sStateTable[RUNNING][WAKEUP] = RUNNING; sStateTable[RUNNING][CANCEL] = DONE; sStateTable[RUNNING][FAIL] = ERROR; sStateTable[BLOCKED] = {}; sStateTable[BLOCKED][STOP] = BLOCKED; sStateTable[BLOCKED][START] = BLOCKED; sStateTable[BLOCKED][BLOCK] = BLOCKED; sStateTable[BLOCKED][UNBLOCK] = BLOCKED; sStateTable[BLOCKED][SLEEP] = BLOCKED; sStateTable[BLOCKED][WAKEUP] = BLOCKED; sStateTable[BLOCKED][CANCEL] = DONE; sStateTable[BLOCKED][FAIL] = ERROR; sStateTable[SLEEPING] = {}; sStateTable[SLEEPING][STOP] = SLEEPING; sStateTable[SLEEPING][START] = SLEEPING; sStateTable[SLEEPING][BLOCK] = SLEEPING; sStateTable[SLEEPING][UNBLOCK] = SLEEPING; sStateTable[SLEEPING][SLEEP] = SLEEPING; sStateTable[SLEEPING][WAKEUP] = SLEEPING; sStateTable[SLEEPING][CANCEL] = DONE; sStateTable[SLEEPING][FAIL] = ERROR; sStateTable[DONE] = {}; sStateTable[DONE][STOP] = DONE; sStateTable[DONE][START] = DONE; sStateTable[DONE][BLOCK] = DONE; sStateTable[DONE][UNBLOCK] = DONE; sStateTable[DONE][SLEEP] = DONE; sStateTable[DONE][WAKEUP] = DONE; sStateTable[DONE][CANCEL] = DONE; sStateTable[DONE][FAIL] = ERROR; sStateTable[ERROR] = {}; sStateTable[ERROR][STOP] = ERROR; sStateTable[ERROR][START] = ERROR; sStateTable[ERROR][BLOCK] = ERROR; sStateTable[ERROR][UNBLOCK] = ERROR; sStateTable[ERROR][SLEEP] = ERROR; sStateTable[ERROR][WAKEUP] = ERROR; sStateTable[ERROR][CANCEL] = ERROR; sStateTable[ERROR][FAIL] = ERROR; /** * Creates a new task. * * @param options options for this task * run: the run function for the task (required) * name: the run function for the task (optional) * parent: parent of this task (optional) * * @return the empty task. */ var Task = function(options) { // task id this.id = -1; // task name this.name = options.name || sNoTaskName; // task has no parent this.parent = options.parent || null; // save run function this.run = options.run; // create a queue of subtasks to run this.subtasks = []; // error flag this.error = false; // state of the task this.state = READY; // number of times the task has been blocked (also the number // of permits needed to be released to continue running) this.blocks = 0; // timeout id when sleeping this.timeoutId = null; // no swap time yet this.swapTime = null; // no user data this.userData = null; // initialize task // FIXME: deal with overflow this.id = sNextTaskId++; sTasks[this.id] = this; if(sVL >= 1) { forge.log.verbose(cat, '[%s][%s] init', this.id, this.name, this); } }; /** * Logs debug information on this task and the system state. */ Task.prototype.debug = function(msg) { msg = msg || ''; forge.log.debug(cat, msg, '[%s][%s] task:', this.id, this.name, this, 'subtasks:', this.subtasks.length, 'queue:', sTaskQueues); }; /** * Adds a subtask to run after task.doNext() or task.fail() is called. * * @param name human readable name for this task (optional). * @param subrun a function to run that takes the current task as * its first parameter. * * @return the current task (useful for chaining next() calls). */ Task.prototype.next = function(name, subrun) { // juggle parameters if it looks like no name is given if(typeof(name) === 'function') { subrun = name; // inherit parent's name name = this.name; } // create subtask, set parent to this task, propagate callbacks var subtask = new Task({ run: subrun, name: name, parent: this }); // start subtasks running subtask.state = RUNNING; subtask.type = this.type; subtask.successCallback = this.successCallback || null; subtask.failureCallback = this.failureCallback || null; // queue a new subtask this.subtasks.push(subtask); return this; }; /** * Adds subtasks to run in parallel after task.doNext() or task.fail() * is called. * * @param name human readable name for this task (optional). * @param subrun functions to run that take the current task as * their first parameter. * * @return the current task (useful for chaining next() calls). */ Task.prototype.parallel = function(name, subrun) { // juggle parameters if it looks like no name is given if(forge.util.isArray(name)) { subrun = name; // inherit parent's name name = this.name; } // Wrap parallel tasks in a regular task so they are started at the // proper time. return this.next(name, function(task) { // block waiting for subtasks var ptask = task; ptask.block(subrun.length); // we pass the iterator from the loop below as a parameter // to a function because it is otherwise included in the // closure and changes as the loop changes -- causing i // to always be set to its highest value var startParallelTask = function(pname, pi) { forge.task.start({ type: pname, run: function(task) { subrun[pi](task); }, success: function(task) { ptask.unblock(); }, failure: function(task) { ptask.unblock(); } }); }; for(var i = 0; i < subrun.length; i++) { // Type must be unique so task starts in parallel: // name + private string + task id + sub-task index // start tasks in parallel and unblock when the finish var pname = name + '__parallel-' + task.id + '-' + i; var pi = i; startParallelTask(pname, pi); } }); }; /** * Stops a running task. */ Task.prototype.stop = function() { this.state = sStateTable[this.state][STOP]; }; /** * Starts running a task. */ Task.prototype.start = function() { this.error = false; this.state = sStateTable[this.state][START]; // try to restart if(this.state === RUNNING) { this.start = new Date(); this.run(this); runNext(this, 0); } }; /** * Blocks a task until it one or more permits have been released. The * task will not resume until the requested number of permits have * been released with call(s) to unblock(). * * @param n number of permits to wait for(default: 1). */ Task.prototype.block = function(n) { n = typeof(n) === 'undefined' ? 1 : n; this.blocks += n; if(this.blocks > 0) { this.state = sStateTable[this.state][BLOCK]; } }; /** * Releases a permit to unblock a task. If a task was blocked by * requesting N permits via block(), then it will only continue * running once enough permits have been released via unblock() calls. * * If multiple processes need to synchronize with a single task then * use a condition variable (see forge.task.createCondition). It is * an error to unblock a task more times than it has been blocked. * * @param n number of permits to release (default: 1). * * @return the current block count (task is unblocked when count is 0) */ Task.prototype.unblock = function(n) { n = typeof(n) === 'undefined' ? 1 : n; this.blocks -= n; if(this.blocks === 0 && this.state !== DONE) { this.state = RUNNING; runNext(this, 0); } return this.blocks; }; /** * Sleep for a period of time before resuming tasks. * * @param n number of milliseconds to sleep (default: 0). */ Task.prototype.sleep = function(n) { n = typeof(n) === 'undefined' ? 0 : n; this.state = sStateTable[this.state][SLEEP]; var self = this; this.timeoutId = setTimeout(function() { self.timeoutId = null; self.state = RUNNING; runNext(self, 0); }, n); }; /** * Waits on a condition variable until notified. The next task will * not be scheduled until notification. A condition variable can be * created with forge.task.createCondition(). * * Once cond.notify() is called, the task will continue. * * @param cond the condition variable to wait on. */ Task.prototype.wait = function(cond) { cond.wait(this); }; /** * If sleeping, wakeup and continue running tasks. */ Task.prototype.wakeup = function() { if(this.state === SLEEPING) { cancelTimeout(this.timeoutId); this.timeoutId = null; this.state = RUNNING; runNext(this, 0); } }; /** * Cancel all remaining subtasks of this task. */ Task.prototype.cancel = function() { this.state = sStateTable[this.state][CANCEL]; // remove permits needed this.permitsNeeded = 0; // cancel timeouts if(this.timeoutId !== null) { cancelTimeout(this.timeoutId); this.timeoutId = null; } // remove subtasks this.subtasks = []; }; /** * Finishes this task with failure and sets error flag. The entire * task will be aborted unless the next task that should execute * is passed as a parameter. This allows levels of subtasks to be * skipped. For instance, to abort only this tasks's subtasks, then * call fail(task.parent). To abort this task's subtasks and its * parent's subtasks, call fail(task.parent.parent). To abort * all tasks and simply call the task callback, call fail() or * fail(null). * * The task callback (success or failure) will always, eventually, be * called. * * @param next the task to continue at, or null to abort entirely. */ Task.prototype.fail = function(next) { // set error flag this.error = true; // finish task finish(this, true); if(next) { // propagate task info next.error = this.error; next.swapTime = this.swapTime; next.userData = this.userData; // do next task as specified runNext(next, 0); } else { if(this.parent !== null) { // finish root task (ensures it is removed from task queue) var parent = this.parent; while(parent.parent !== null) { // propagate task info parent.error = this.error; parent.swapTime = this.swapTime; parent.userData = this.userData; parent = parent.parent; } finish(parent, true); } // call failure callback if one exists if(this.failureCallback) { this.failureCallback(this); } } }; /** * Asynchronously start a task. * * @param task the task to start. */ var start = function(task) { task.error = false; task.state = sStateTable[task.state][START]; setTimeout(function() { if(task.state === RUNNING) { task.swapTime = +new Date(); task.run(task); runNext(task, 0); } }, 0); }; /** * Run the next subtask or finish this task. * * @param task the task to process. * @param recurse the recursion count. */ var runNext = function(task, recurse) { // get time since last context swap (ms), if enough time has passed set // swap to true to indicate that doNext was performed asynchronously // also, if recurse is too high do asynchronously var swap = (recurse > sMaxRecursions) || (+new Date() - task.swapTime) > sTimeSlice; var doNext = function(recurse) { recurse++; if(task.state === RUNNING) { if(swap) { // update swap time task.swapTime = +new Date(); } if(task.subtasks.length > 0) { // run next subtask var subtask = task.subtasks.shift(); subtask.error = task.error; subtask.swapTime = task.swapTime; subtask.userData = task.userData; subtask.run(subtask); if(!subtask.error) { runNext(subtask, recurse); } } else { finish(task); if(!task.error) { // chain back up and run parent if(task.parent !== null) { // propagate task info task.parent.error = task.error; task.parent.swapTime = task.swapTime; task.parent.userData = task.userData; // no subtasks left, call run next subtask on parent runNext(task.parent, recurse); } } } } }; if(swap) { // we're swapping, so run asynchronously setTimeout(doNext, 0); } else { // not swapping, so run synchronously doNext(recurse); } }; /** * Finishes a task and looks for the next task in the queue to start. * * @param task the task to finish. * @param suppressCallbacks true to suppress callbacks. */ var finish = function(task, suppressCallbacks) { // subtask is now done task.state = DONE; delete sTasks[task.id]; if(sVL >= 1) { forge.log.verbose(cat, '[%s][%s] finish', task.id, task.name, task); } // only do queue processing for root tasks if(task.parent === null) { // report error if queue is missing if(!(task.type in sTaskQueues)) { forge.log.error(cat, '[%s][%s] task queue missing [%s]', task.id, task.name, task.type); } else if(sTaskQueues[task.type].length === 0) { // report error if queue is empty forge.log.error(cat, '[%s][%s] task queue empty [%s]', task.id, task.name, task.type); } else if(sTaskQueues[task.type][0] !== task) { // report error if this task isn't the first in the queue forge.log.error(cat, '[%s][%s] task not first in queue [%s]', task.id, task.name, task.type); } else { // remove ourselves from the queue sTaskQueues[task.type].shift(); // clean up queue if it is empty if(sTaskQueues[task.type].length === 0) { if(sVL >= 1) { forge.log.verbose(cat, '[%s][%s] delete queue [%s]', task.id, task.name, task.type); } /* Note: Only a task can delete a queue of its own type. This is used as a way to synchronize tasks. If a queue for a certain task type exists, then a task of that type is running. */ delete sTaskQueues[task.type]; } else { // dequeue the next task and start it if(sVL >= 1) { forge.log.verbose(cat, '[%s][%s] queue start next [%s] remain:%s', task.id, task.name, task.type, sTaskQueues[task.type].length); } sTaskQueues[task.type][0].start(); } } if(!suppressCallbacks) { // call final callback if one exists if(task.error && task.failureCallback) { task.failureCallback(task); } else if(!task.error && task.successCallback) { task.successCallback(task); } } } }; /* Tasks API */ module.exports = forge.task = forge.task || {}; /** * Starts a new task that will run the passed function asynchronously. * * In order to finish the task, either task.doNext() or task.fail() * *must* be called. * * The task must have a type (a string identifier) that can be used to * synchronize it with other tasks of the same type. That type can also * be used to cancel tasks that haven't started yet. * * To start a task, the following object must be provided as a parameter * (each function takes a task object as its first parameter): * * { * type: the type of task. * run: the function to run to execute the task. * success: a callback to call when the task succeeds (optional). * failure: a callback to call when the task fails (optional). * } * * @param options the object as described above. */ forge.task.start = function(options) { // create a new task var task = new Task({ run: options.run, name: options.name || sNoTaskName }); task.type = options.type; task.successCallback = options.success || null; task.failureCallback = options.failure || null; // append the task onto the appropriate queue if(!(task.type in sTaskQueues)) { if(sVL >= 1) { forge.log.verbose(cat, '[%s][%s] create queue [%s]', task.id, task.name, task.type); } // create the queue with the new task sTaskQueues[task.type] = [task]; start(task); } else { // push the task onto the queue, it will be run after a task // with the same type completes sTaskQueues[options.type].push(task); } }; /** * Cancels all tasks of the given type that haven't started yet. * * @param type the type of task to cancel. */ forge.task.cancel = function(type) { // find the task queue if(type in sTaskQueues) { // empty all but the current task from the queue sTaskQueues[type] = [sTaskQueues[type][0]]; } }; /** * Creates a condition variable to synchronize tasks. To make a task wait * on the condition variable, call task.wait(condition). To notify all * tasks that are waiting, call condition.notify(). * * @return the condition variable. */ forge.task.createCondition = function() { var cond = { // all tasks that are blocked tasks: {} }; /** * Causes the given task to block until notify is called. If the task * is already waiting on this condition then this is a no-op. * * @param task the task to cause to wait. */ cond.wait = function(task) { // only block once if(!(task.id in cond.tasks)) { task.block(); cond.tasks[task.id] = task; } }; /** * Notifies all waiting tasks to wake up. */ cond.notify = function() { // since unblock() will run the next task from here, make sure to // clear the condition's blocked task list before unblocking var tmp = cond.tasks; cond.tasks = {}; for(var id in tmp) { tmp[id].unblock(); } }; return cond; }; /***/ }), /***/ 79167: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * A Javascript implementation of Transport Layer Security (TLS). * * @author Dave Longley * * Copyright (c) 2009-2014 Digital Bazaar, Inc. * * The TLS Handshake Protocol involves the following steps: * * - Exchange hello messages to agree on algorithms, exchange random values, * and check for session resumption. * * - Exchange the necessary cryptographic parameters to allow the client and * server to agree on a premaster secret. * * - Exchange certificates and cryptographic information to allow the client * and server to authenticate themselves. * * - Generate a master secret from the premaster secret and exchanged random * values. * * - Provide security parameters to the record layer. * * - Allow the client and server to verify that their peer has calculated the * same security parameters and that the handshake occurred without tampering * by an attacker. * * Up to 4 different messages may be sent during a key exchange. The server * certificate, the server key exchange, the client certificate, and the * client key exchange. * * A typical handshake (from the client's perspective). * * 1. Client sends ClientHello. * 2. Client receives ServerHello. * 3. Client receives optional Certificate. * 4. Client receives optional ServerKeyExchange. * 5. Client receives ServerHelloDone. * 6. Client sends optional Certificate. * 7. Client sends ClientKeyExchange. * 8. Client sends optional CertificateVerify. * 9. Client sends ChangeCipherSpec. * 10. Client sends Finished. * 11. Client receives ChangeCipherSpec. * 12. Client receives Finished. * 13. Client sends/receives application data. * * To reuse an existing session: * * 1. Client sends ClientHello with session ID for reuse. * 2. Client receives ServerHello with same session ID if reusing. * 3. Client receives ChangeCipherSpec message if reusing. * 4. Client receives Finished. * 5. Client sends ChangeCipherSpec. * 6. Client sends Finished. * * Note: Client ignores HelloRequest if in the middle of a handshake. * * Record Layer: * * The record layer fragments information blocks into TLSPlaintext records * carrying data in chunks of 2^14 bytes or less. Client message boundaries are * not preserved in the record layer (i.e., multiple client messages of the * same ContentType MAY be coalesced into a single TLSPlaintext record, or a * single message MAY be fragmented across several records). * * struct { * uint8 major; * uint8 minor; * } ProtocolVersion; * * struct { * ContentType type; * ProtocolVersion version; * uint16 length; * opaque fragment[TLSPlaintext.length]; * } TLSPlaintext; * * type: * The higher-level protocol used to process the enclosed fragment. * * version: * The version of the protocol being employed. TLS Version 1.2 uses version * {3, 3}. TLS Version 1.0 uses version {3, 1}. Note that a client that * supports multiple versions of TLS may not know what version will be * employed before it receives the ServerHello. * * length: * The length (in bytes) of the following TLSPlaintext.fragment. The length * MUST NOT exceed 2^14 = 16384 bytes. * * fragment: * The application data. This data is transparent and treated as an * independent block to be dealt with by the higher-level protocol specified * by the type field. * * Implementations MUST NOT send zero-length fragments of Handshake, Alert, or * ChangeCipherSpec content types. Zero-length fragments of Application data * MAY be sent as they are potentially useful as a traffic analysis * countermeasure. * * Note: Data of different TLS record layer content types MAY be interleaved. * Application data is generally of lower precedence for transmission than * other content types. However, records MUST be delivered to the network in * the same order as they are protected by the record layer. Recipients MUST * receive and process interleaved application layer traffic during handshakes * subsequent to the first one on a connection. * * struct { * ContentType type; // same as TLSPlaintext.type * ProtocolVersion version;// same as TLSPlaintext.version * uint16 length; * opaque fragment[TLSCompressed.length]; * } TLSCompressed; * * length: * The length (in bytes) of the following TLSCompressed.fragment. * The length MUST NOT exceed 2^14 + 1024. * * fragment: * The compressed form of TLSPlaintext.fragment. * * Note: A CompressionMethod.null operation is an identity operation; no fields * are altered. In this implementation, since no compression is supported, * uncompressed records are always the same as compressed records. * * Encryption Information: * * The encryption and MAC functions translate a TLSCompressed structure into a * TLSCiphertext. The decryption functions reverse the process. The MAC of the * record also includes a sequence number so that missing, extra, or repeated * messages are detectable. * * struct { * ContentType type; * ProtocolVersion version; * uint16 length; * select (SecurityParameters.cipher_type) { * case stream: GenericStreamCipher; * case block: GenericBlockCipher; * case aead: GenericAEADCipher; * } fragment; * } TLSCiphertext; * * type: * The type field is identical to TLSCompressed.type. * * version: * The version field is identical to TLSCompressed.version. * * length: * The length (in bytes) of the following TLSCiphertext.fragment. * The length MUST NOT exceed 2^14 + 2048. * * fragment: * The encrypted form of TLSCompressed.fragment, with the MAC. * * Note: Only CBC Block Ciphers are supported by this implementation. * * The TLSCompressed.fragment structures are converted to/from block * TLSCiphertext.fragment structures. * * struct { * opaque IV[SecurityParameters.record_iv_length]; * block-ciphered struct { * opaque content[TLSCompressed.length]; * opaque MAC[SecurityParameters.mac_length]; * uint8 padding[GenericBlockCipher.padding_length]; * uint8 padding_length; * }; * } GenericBlockCipher; * * The MAC is generated as described in Section 6.2.3.1. * * IV: * The Initialization Vector (IV) SHOULD be chosen at random, and MUST be * unpredictable. Note that in versions of TLS prior to 1.1, there was no * IV field, and the last ciphertext block of the previous record (the "CBC * residue") was used as the IV. This was changed to prevent the attacks * described in [CBCATT]. For block ciphers, the IV length is of length * SecurityParameters.record_iv_length, which is equal to the * SecurityParameters.block_size. * * padding: * Padding that is added to force the length of the plaintext to be an * integral multiple of the block cipher's block length. The padding MAY be * any length up to 255 bytes, as long as it results in the * TLSCiphertext.length being an integral multiple of the block length. * Lengths longer than necessary might be desirable to frustrate attacks on * a protocol that are based on analysis of the lengths of exchanged * messages. Each uint8 in the padding data vector MUST be filled with the * padding length value. The receiver MUST check this padding and MUST use * the bad_record_mac alert to indicate padding errors. * * padding_length: * The padding length MUST be such that the total size of the * GenericBlockCipher structure is a multiple of the cipher's block length. * Legal values range from zero to 255, inclusive. This length specifies the * length of the padding field exclusive of the padding_length field itself. * * The encrypted data length (TLSCiphertext.length) is one more than the sum of * SecurityParameters.block_length, TLSCompressed.length, * SecurityParameters.mac_length, and padding_length. * * Example: If the block length is 8 bytes, the content length * (TLSCompressed.length) is 61 bytes, and the MAC length is 20 bytes, then the * length before padding is 82 bytes (this does not include the IV. Thus, the * padding length modulo 8 must be equal to 6 in order to make the total length * an even multiple of 8 bytes (the block length). The padding length can be * 6, 14, 22, and so on, through 254. If the padding length were the minimum * necessary, 6, the padding would be 6 bytes, each containing the value 6. * Thus, the last 8 octets of the GenericBlockCipher before block encryption * would be xx 06 06 06 06 06 06 06, where xx is the last octet of the MAC. * * Note: With block ciphers in CBC mode (Cipher Block Chaining), it is critical * that the entire plaintext of the record be known before any ciphertext is * transmitted. Otherwise, it is possible for the attacker to mount the attack * described in [CBCATT]. * * Implementation note: Canvel et al. [CBCTIME] have demonstrated a timing * attack on CBC padding based on the time required to compute the MAC. In * order to defend against this attack, implementations MUST ensure that * record processing time is essentially the same whether or not the padding * is correct. In general, the best way to do this is to compute the MAC even * if the padding is incorrect, and only then reject the packet. For instance, * if the pad appears to be incorrect, the implementation might assume a * zero-length pad and then compute the MAC. This leaves a small timing * channel, since MAC performance depends, to some extent, on the size of the * data fragment, but it is not believed to be large enough to be exploitable, * due to the large block size of existing MACs and the small size of the * timing signal. */ var forge = __webpack_require__(89177); __webpack_require__(39549); __webpack_require__(95104); __webpack_require__(86594); __webpack_require__(70154); __webpack_require__(6924); __webpack_require__(57821); __webpack_require__(90279); __webpack_require__(28339); /** * Generates pseudo random bytes by mixing the result of two hash functions, * MD5 and SHA-1. * * prf_TLS1(secret, label, seed) = * P_MD5(S1, label + seed) XOR P_SHA-1(S2, label + seed); * * Each P_hash function functions as follows: * * P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + * HMAC_hash(secret, A(2) + seed) + * HMAC_hash(secret, A(3) + seed) + ... * A() is defined as: * A(0) = seed * A(i) = HMAC_hash(secret, A(i-1)) * * The '+' operator denotes concatenation. * * As many iterations A(N) as are needed are performed to generate enough * pseudo random byte output. If an iteration creates more data than is * necessary, then it is truncated. * * Therefore: * A(1) = HMAC_hash(secret, A(0)) * = HMAC_hash(secret, seed) * A(2) = HMAC_hash(secret, A(1)) * = HMAC_hash(secret, HMAC_hash(secret, seed)) * * Therefore: * P_hash(secret, seed) = * HMAC_hash(secret, HMAC_hash(secret, A(0)) + seed) + * HMAC_hash(secret, HMAC_hash(secret, A(1)) + seed) + * ... * * Therefore: * P_hash(secret, seed) = * HMAC_hash(secret, HMAC_hash(secret, seed) + seed) + * HMAC_hash(secret, HMAC_hash(secret, HMAC_hash(secret, seed)) + seed) + * ... * * @param secret the secret to use. * @param label the label to use. * @param seed the seed value to use. * @param length the number of bytes to generate. * * @return the pseudo random bytes in a byte buffer. */ var prf_TLS1 = function(secret, label, seed, length) { var rval = forge.util.createBuffer(); /* For TLS 1.0, the secret is split in half, into two secrets of equal length. If the secret has an odd length then the last byte of the first half will be the same as the first byte of the second. The length of the two secrets is half of the secret rounded up. */ var idx = (secret.length >> 1); var slen = idx + (secret.length & 1); var s1 = secret.substr(0, slen); var s2 = secret.substr(idx, slen); var ai = forge.util.createBuffer(); var hmac = forge.hmac.create(); seed = label + seed; // determine the number of iterations that must be performed to generate // enough output bytes, md5 creates 16 byte hashes, sha1 creates 20 var md5itr = Math.ceil(length / 16); var sha1itr = Math.ceil(length / 20); // do md5 iterations hmac.start('MD5', s1); var md5bytes = forge.util.createBuffer(); ai.putBytes(seed); for(var i = 0; i < md5itr; ++i) { // HMAC_hash(secret, A(i-1)) hmac.start(null, null); hmac.update(ai.getBytes()); ai.putBuffer(hmac.digest()); // HMAC_hash(secret, A(i) + seed) hmac.start(null, null); hmac.update(ai.bytes() + seed); md5bytes.putBuffer(hmac.digest()); } // do sha1 iterations hmac.start('SHA1', s2); var sha1bytes = forge.util.createBuffer(); ai.clear(); ai.putBytes(seed); for(var i = 0; i < sha1itr; ++i) { // HMAC_hash(secret, A(i-1)) hmac.start(null, null); hmac.update(ai.getBytes()); ai.putBuffer(hmac.digest()); // HMAC_hash(secret, A(i) + seed) hmac.start(null, null); hmac.update(ai.bytes() + seed); sha1bytes.putBuffer(hmac.digest()); } // XOR the md5 bytes with the sha1 bytes rval.putBytes(forge.util.xorBytes( md5bytes.getBytes(), sha1bytes.getBytes(), length)); return rval; }; /** * Generates pseudo random bytes using a SHA256 algorithm. For TLS 1.2. * * @param secret the secret to use. * @param label the label to use. * @param seed the seed value to use. * @param length the number of bytes to generate. * * @return the pseudo random bytes in a byte buffer. */ var prf_sha256 = function(secret, label, seed, length) { // FIXME: implement me for TLS 1.2 }; /** * Gets a MAC for a record using the SHA-1 hash algorithm. * * @param key the mac key. * @param state the sequence number (array of two 32-bit integers). * @param record the record. * * @return the sha-1 hash (20 bytes) for the given record. */ var hmac_sha1 = function(key, seqNum, record) { /* MAC is computed like so: HMAC_hash( key, seqNum + TLSCompressed.type + TLSCompressed.version + TLSCompressed.length + TLSCompressed.fragment) */ var hmac = forge.hmac.create(); hmac.start('SHA1', key); var b = forge.util.createBuffer(); b.putInt32(seqNum[0]); b.putInt32(seqNum[1]); b.putByte(record.type); b.putByte(record.version.major); b.putByte(record.version.minor); b.putInt16(record.length); b.putBytes(record.fragment.bytes()); hmac.update(b.getBytes()); return hmac.digest().getBytes(); }; /** * Compresses the TLSPlaintext record into a TLSCompressed record using the * deflate algorithm. * * @param c the TLS connection. * @param record the TLSPlaintext record to compress. * @param s the ConnectionState to use. * * @return true on success, false on failure. */ var deflate = function(c, record, s) { var rval = false; try { var bytes = c.deflate(record.fragment.getBytes()); record.fragment = forge.util.createBuffer(bytes); record.length = bytes.length; rval = true; } catch(ex) { // deflate error, fail out } return rval; }; /** * Decompresses the TLSCompressed record into a TLSPlaintext record using the * deflate algorithm. * * @param c the TLS connection. * @param record the TLSCompressed record to decompress. * @param s the ConnectionState to use. * * @return true on success, false on failure. */ var inflate = function(c, record, s) { var rval = false; try { var bytes = c.inflate(record.fragment.getBytes()); record.fragment = forge.util.createBuffer(bytes); record.length = bytes.length; rval = true; } catch(ex) { // inflate error, fail out } return rval; }; /** * Reads a TLS variable-length vector from a byte buffer. * * Variable-length vectors are defined by specifying a subrange of legal * lengths, inclusively, using the notation . When these are * encoded, the actual length precedes the vector's contents in the byte * stream. The length will be in the form of a number consuming as many bytes * as required to hold the vector's specified maximum (ceiling) length. A * variable-length vector with an actual length field of zero is referred to * as an empty vector. * * @param b the byte buffer. * @param lenBytes the number of bytes required to store the length. * * @return the resulting byte buffer. */ var readVector = function(b, lenBytes) { var len = 0; switch(lenBytes) { case 1: len = b.getByte(); break; case 2: len = b.getInt16(); break; case 3: len = b.getInt24(); break; case 4: len = b.getInt32(); break; } // read vector bytes into a new buffer return forge.util.createBuffer(b.getBytes(len)); }; /** * Writes a TLS variable-length vector to a byte buffer. * * @param b the byte buffer. * @param lenBytes the number of bytes required to store the length. * @param v the byte buffer vector. */ var writeVector = function(b, lenBytes, v) { // encode length at the start of the vector, where the number of bytes for // the length is the maximum number of bytes it would take to encode the // vector's ceiling b.putInt(v.length(), lenBytes << 3); b.putBuffer(v); }; /** * The tls implementation. */ var tls = {}; /** * Version: TLS 1.2 = 3.3, TLS 1.1 = 3.2, TLS 1.0 = 3.1. Both TLS 1.1 and * TLS 1.2 were still too new (ie: openSSL didn't implement them) at the time * of this implementation so TLS 1.0 was implemented instead. */ tls.Versions = { TLS_1_0: {major: 3, minor: 1}, TLS_1_1: {major: 3, minor: 2}, TLS_1_2: {major: 3, minor: 3} }; tls.SupportedVersions = [ tls.Versions.TLS_1_1, tls.Versions.TLS_1_0 ]; tls.Version = tls.SupportedVersions[0]; /** * Maximum fragment size. True maximum is 16384, but we fragment before that * to allow for unusual small increases during compression. */ tls.MaxFragment = 16384 - 1024; /** * Whether this entity is considered the "client" or "server". * enum { server, client } ConnectionEnd; */ tls.ConnectionEnd = { server: 0, client: 1 }; /** * Pseudo-random function algorithm used to generate keys from the master * secret. * enum { tls_prf_sha256 } PRFAlgorithm; */ tls.PRFAlgorithm = { tls_prf_sha256: 0 }; /** * Bulk encryption algorithms. * enum { null, rc4, des3, aes } BulkCipherAlgorithm; */ tls.BulkCipherAlgorithm = { none: null, rc4: 0, des3: 1, aes: 2 }; /** * Cipher types. * enum { stream, block, aead } CipherType; */ tls.CipherType = { stream: 0, block: 1, aead: 2 }; /** * MAC (Message Authentication Code) algorithms. * enum { null, hmac_md5, hmac_sha1, hmac_sha256, * hmac_sha384, hmac_sha512} MACAlgorithm; */ tls.MACAlgorithm = { none: null, hmac_md5: 0, hmac_sha1: 1, hmac_sha256: 2, hmac_sha384: 3, hmac_sha512: 4 }; /** * Compression algorithms. * enum { null(0), deflate(1), (255) } CompressionMethod; */ tls.CompressionMethod = { none: 0, deflate: 1 }; /** * TLS record content types. * enum { * change_cipher_spec(20), alert(21), handshake(22), * application_data(23), (255) * } ContentType; */ tls.ContentType = { change_cipher_spec: 20, alert: 21, handshake: 22, application_data: 23, heartbeat: 24 }; /** * TLS handshake types. * enum { * hello_request(0), client_hello(1), server_hello(2), * certificate(11), server_key_exchange (12), * certificate_request(13), server_hello_done(14), * certificate_verify(15), client_key_exchange(16), * finished(20), (255) * } HandshakeType; */ tls.HandshakeType = { hello_request: 0, client_hello: 1, server_hello: 2, certificate: 11, server_key_exchange: 12, certificate_request: 13, server_hello_done: 14, certificate_verify: 15, client_key_exchange: 16, finished: 20 }; /** * TLS Alert Protocol. * * enum { warning(1), fatal(2), (255) } AlertLevel; * * enum { * close_notify(0), * unexpected_message(10), * bad_record_mac(20), * decryption_failed(21), * record_overflow(22), * decompression_failure(30), * handshake_failure(40), * bad_certificate(42), * unsupported_certificate(43), * certificate_revoked(44), * certificate_expired(45), * certificate_unknown(46), * illegal_parameter(47), * unknown_ca(48), * access_denied(49), * decode_error(50), * decrypt_error(51), * export_restriction(60), * protocol_version(70), * insufficient_security(71), * internal_error(80), * user_canceled(90), * no_renegotiation(100), * (255) * } AlertDescription; * * struct { * AlertLevel level; * AlertDescription description; * } Alert; */ tls.Alert = {}; tls.Alert.Level = { warning: 1, fatal: 2 }; tls.Alert.Description = { close_notify: 0, unexpected_message: 10, bad_record_mac: 20, decryption_failed: 21, record_overflow: 22, decompression_failure: 30, handshake_failure: 40, bad_certificate: 42, unsupported_certificate: 43, certificate_revoked: 44, certificate_expired: 45, certificate_unknown: 46, illegal_parameter: 47, unknown_ca: 48, access_denied: 49, decode_error: 50, decrypt_error: 51, export_restriction: 60, protocol_version: 70, insufficient_security: 71, internal_error: 80, user_canceled: 90, no_renegotiation: 100 }; /** * TLS Heartbeat Message types. * enum { * heartbeat_request(1), * heartbeat_response(2), * (255) * } HeartbeatMessageType; */ tls.HeartbeatMessageType = { heartbeat_request: 1, heartbeat_response: 2 }; /** * Supported cipher suites. */ tls.CipherSuites = {}; /** * Gets a supported cipher suite from its 2 byte ID. * * @param twoBytes two bytes in a string. * * @return the matching supported cipher suite or null. */ tls.getCipherSuite = function(twoBytes) { var rval = null; for(var key in tls.CipherSuites) { var cs = tls.CipherSuites[key]; if(cs.id[0] === twoBytes.charCodeAt(0) && cs.id[1] === twoBytes.charCodeAt(1)) { rval = cs; break; } } return rval; }; /** * Called when an unexpected record is encountered. * * @param c the connection. * @param record the record. */ tls.handleUnexpected = function(c, record) { // if connection is client and closed, ignore unexpected messages var ignore = (!c.open && c.entity === tls.ConnectionEnd.client); if(!ignore) { c.error(c, { message: 'Unexpected message. Received TLS record out of order.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.unexpected_message } }); } }; /** * Called when a client receives a HelloRequest record. * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleHelloRequest = function(c, record, length) { // ignore renegotiation requests from the server during a handshake, but // if handshaking, send a warning alert that renegotation is denied if(!c.handshaking && c.handshakes > 0) { // send alert warning tls.queue(c, tls.createAlert(c, { level: tls.Alert.Level.warning, description: tls.Alert.Description.no_renegotiation })); tls.flush(c); } // continue c.process(); }; /** * Parses a hello message from a ClientHello or ServerHello record. * * @param record the record to parse. * * @return the parsed message. */ tls.parseHelloMessage = function(c, record, length) { var msg = null; var client = (c.entity === tls.ConnectionEnd.client); // minimum of 38 bytes in message if(length < 38) { c.error(c, { message: client ? 'Invalid ServerHello message. Message too short.' : 'Invalid ClientHello message. Message too short.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } else { // use 'remaining' to calculate # of remaining bytes in the message var b = record.fragment; var remaining = b.length(); msg = { version: { major: b.getByte(), minor: b.getByte() }, random: forge.util.createBuffer(b.getBytes(32)), session_id: readVector(b, 1), extensions: [] }; if(client) { msg.cipher_suite = b.getBytes(2); msg.compression_method = b.getByte(); } else { msg.cipher_suites = readVector(b, 2); msg.compression_methods = readVector(b, 1); } // read extensions if there are any bytes left in the message remaining = length - (remaining - b.length()); if(remaining > 0) { // parse extensions var exts = readVector(b, 2); while(exts.length() > 0) { msg.extensions.push({ type: [exts.getByte(), exts.getByte()], data: readVector(exts, 2) }); } // TODO: make extension support modular if(!client) { for(var i = 0; i < msg.extensions.length; ++i) { var ext = msg.extensions[i]; // support SNI extension if(ext.type[0] === 0x00 && ext.type[1] === 0x00) { // get server name list var snl = readVector(ext.data, 2); while(snl.length() > 0) { // read server name type var snType = snl.getByte(); // only HostName type (0x00) is known, break out if // another type is detected if(snType !== 0x00) { break; } // add host name to server name list c.session.extensions.server_name.serverNameList.push( readVector(snl, 2).getBytes()); } } } } } // version already set, do not allow version change if(c.session.version) { if(msg.version.major !== c.session.version.major || msg.version.minor !== c.session.version.minor) { return c.error(c, { message: 'TLS version change is disallowed during renegotiation.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.protocol_version } }); } } // get the chosen (ServerHello) cipher suite if(client) { // FIXME: should be checking configured acceptable cipher suites c.session.cipherSuite = tls.getCipherSuite(msg.cipher_suite); } else { // get a supported preferred (ClientHello) cipher suite // choose the first supported cipher suite var tmp = forge.util.createBuffer(msg.cipher_suites.bytes()); while(tmp.length() > 0) { // FIXME: should be checking configured acceptable suites // cipher suites take up 2 bytes c.session.cipherSuite = tls.getCipherSuite(tmp.getBytes(2)); if(c.session.cipherSuite !== null) { break; } } } // cipher suite not supported if(c.session.cipherSuite === null) { return c.error(c, { message: 'No cipher suites in common.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.handshake_failure }, cipherSuite: forge.util.bytesToHex(msg.cipher_suite) }); } // TODO: handle compression methods if(client) { c.session.compressionMethod = msg.compression_method; } else { // no compression c.session.compressionMethod = tls.CompressionMethod.none; } } return msg; }; /** * Creates security parameters for the given connection based on the given * hello message. * * @param c the TLS connection. * @param msg the hello message. */ tls.createSecurityParameters = function(c, msg) { /* Note: security params are from TLS 1.2, some values like prf_algorithm are ignored for TLS 1.0/1.1 and the builtin as specified in the spec is used. */ // TODO: handle other options from server when more supported // get client and server randoms var client = (c.entity === tls.ConnectionEnd.client); var msgRandom = msg.random.bytes(); var cRandom = client ? c.session.sp.client_random : msgRandom; var sRandom = client ? msgRandom : tls.createRandom().getBytes(); // create new security parameters c.session.sp = { entity: c.entity, prf_algorithm: tls.PRFAlgorithm.tls_prf_sha256, bulk_cipher_algorithm: null, cipher_type: null, enc_key_length: null, block_length: null, fixed_iv_length: null, record_iv_length: null, mac_algorithm: null, mac_length: null, mac_key_length: null, compression_algorithm: c.session.compressionMethod, pre_master_secret: null, master_secret: null, client_random: cRandom, server_random: sRandom }; }; /** * Called when a client receives a ServerHello record. * * When a ServerHello message will be sent: * The server will send this message in response to a client hello message * when it was able to find an acceptable set of algorithms. If it cannot * find such a match, it will respond with a handshake failure alert. * * uint24 length; * struct { * ProtocolVersion server_version; * Random random; * SessionID session_id; * CipherSuite cipher_suite; * CompressionMethod compression_method; * select(extensions_present) { * case false: * struct {}; * case true: * Extension extensions<0..2^16-1>; * }; * } ServerHello; * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleServerHello = function(c, record, length) { var msg = tls.parseHelloMessage(c, record, length); if(c.fail) { return; } // ensure server version is compatible if(msg.version.minor <= c.version.minor) { c.version.minor = msg.version.minor; } else { return c.error(c, { message: 'Incompatible TLS version.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.protocol_version } }); } // indicate session version has been set c.session.version = c.version; // get the session ID from the message var sessionId = msg.session_id.bytes(); // if the session ID is not blank and matches the cached one, resume // the session if(sessionId.length > 0 && sessionId === c.session.id) { // resuming session, expect a ChangeCipherSpec next c.expect = SCC; c.session.resuming = true; // get new server random c.session.sp.server_random = msg.random.bytes(); } else { // not resuming, expect a server Certificate message next c.expect = SCE; c.session.resuming = false; // create new security parameters tls.createSecurityParameters(c, msg); } // set new session ID c.session.id = sessionId; // continue c.process(); }; /** * Called when a server receives a ClientHello record. * * When a ClientHello message will be sent: * When a client first connects to a server it is required to send the * client hello as its first message. The client can also send a client * hello in response to a hello request or on its own initiative in order * to renegotiate the security parameters in an existing connection. * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleClientHello = function(c, record, length) { var msg = tls.parseHelloMessage(c, record, length); if(c.fail) { return; } // get the session ID from the message var sessionId = msg.session_id.bytes(); // see if the given session ID is in the cache var session = null; if(c.sessionCache) { session = c.sessionCache.getSession(sessionId); if(session === null) { // session ID not found sessionId = ''; } else if(session.version.major !== msg.version.major || session.version.minor > msg.version.minor) { // if session version is incompatible with client version, do not resume session = null; sessionId = ''; } } // no session found to resume, generate a new session ID if(sessionId.length === 0) { sessionId = forge.random.getBytes(32); } // update session c.session.id = sessionId; c.session.clientHelloVersion = msg.version; c.session.sp = {}; if(session) { // use version and security parameters from resumed session c.version = c.session.version = session.version; c.session.sp = session.sp; } else { // use highest compatible minor version var version; for(var i = 1; i < tls.SupportedVersions.length; ++i) { version = tls.SupportedVersions[i]; if(version.minor <= msg.version.minor) { break; } } c.version = {major: version.major, minor: version.minor}; c.session.version = c.version; } // if a session is set, resume it if(session !== null) { // resuming session, expect a ChangeCipherSpec next c.expect = CCC; c.session.resuming = true; // get new client random c.session.sp.client_random = msg.random.bytes(); } else { // not resuming, expect a Certificate or ClientKeyExchange c.expect = (c.verifyClient !== false) ? CCE : CKE; c.session.resuming = false; // create new security parameters tls.createSecurityParameters(c, msg); } // connection now open c.open = true; // queue server hello tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createServerHello(c) })); if(c.session.resuming) { // queue change cipher spec message tls.queue(c, tls.createRecord(c, { type: tls.ContentType.change_cipher_spec, data: tls.createChangeCipherSpec() })); // create pending state c.state.pending = tls.createConnectionState(c); // change current write state to pending write state c.state.current.write = c.state.pending.write; // queue finished tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createFinished(c) })); } else { // queue server certificate tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createCertificate(c) })); if(!c.fail) { // queue server key exchange tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createServerKeyExchange(c) })); // request client certificate if set if(c.verifyClient !== false) { // queue certificate request tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createCertificateRequest(c) })); } // queue server hello done tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createServerHelloDone(c) })); } } // send records tls.flush(c); // continue c.process(); }; /** * Called when a client receives a Certificate record. * * When this message will be sent: * The server must send a certificate whenever the agreed-upon key exchange * method is not an anonymous one. This message will always immediately * follow the server hello message. * * Meaning of this message: * The certificate type must be appropriate for the selected cipher suite's * key exchange algorithm, and is generally an X.509v3 certificate. It must * contain a key which matches the key exchange method, as follows. Unless * otherwise specified, the signing algorithm for the certificate must be * the same as the algorithm for the certificate key. Unless otherwise * specified, the public key may be of any length. * * opaque ASN.1Cert<1..2^24-1>; * struct { * ASN.1Cert certificate_list<1..2^24-1>; * } Certificate; * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleCertificate = function(c, record, length) { // minimum of 3 bytes in message if(length < 3) { return c.error(c, { message: 'Invalid Certificate message. Message too short.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } var b = record.fragment; var msg = { certificate_list: readVector(b, 3) }; /* The sender's certificate will be first in the list (chain), each subsequent one that follows will certify the previous one, but root certificates (self-signed) that specify the certificate authority may be omitted under the assumption that clients must already possess it. */ var cert, asn1; var certs = []; try { while(msg.certificate_list.length() > 0) { // each entry in msg.certificate_list is a vector with 3 len bytes cert = readVector(msg.certificate_list, 3); asn1 = forge.asn1.fromDer(cert); cert = forge.pki.certificateFromAsn1(asn1, true); certs.push(cert); } } catch(ex) { return c.error(c, { message: 'Could not parse certificate list.', cause: ex, send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.bad_certificate } }); } // ensure at least 1 certificate was provided if in client-mode // or if verifyClient was set to true to require a certificate // (as opposed to 'optional') var client = (c.entity === tls.ConnectionEnd.client); if((client || c.verifyClient === true) && certs.length === 0) { // error, no certificate c.error(c, { message: client ? 'No server certificate provided.' : 'No client certificate provided.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } else if(certs.length === 0) { // no certs to verify // expect a ServerKeyExchange or ClientKeyExchange message next c.expect = client ? SKE : CKE; } else { // save certificate in session if(client) { c.session.serverCertificate = certs[0]; } else { c.session.clientCertificate = certs[0]; } if(tls.verifyCertificateChain(c, certs)) { // expect a ServerKeyExchange or ClientKeyExchange message next c.expect = client ? SKE : CKE; } } // continue c.process(); }; /** * Called when a client receives a ServerKeyExchange record. * * When this message will be sent: * This message will be sent immediately after the server certificate * message (or the server hello message, if this is an anonymous * negotiation). * * The server key exchange message is sent by the server only when the * server certificate message (if sent) does not contain enough data to * allow the client to exchange a premaster secret. * * Meaning of this message: * This message conveys cryptographic information to allow the client to * communicate the premaster secret: either an RSA public key to encrypt * the premaster secret with, or a Diffie-Hellman public key with which the * client can complete a key exchange (with the result being the premaster * secret.) * * enum { * dhe_dss, dhe_rsa, dh_anon, rsa, dh_dss, dh_rsa * } KeyExchangeAlgorithm; * * struct { * opaque dh_p<1..2^16-1>; * opaque dh_g<1..2^16-1>; * opaque dh_Ys<1..2^16-1>; * } ServerDHParams; * * struct { * select(KeyExchangeAlgorithm) { * case dh_anon: * ServerDHParams params; * case dhe_dss: * case dhe_rsa: * ServerDHParams params; * digitally-signed struct { * opaque client_random[32]; * opaque server_random[32]; * ServerDHParams params; * } signed_params; * case rsa: * case dh_dss: * case dh_rsa: * struct {}; * }; * } ServerKeyExchange; * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleServerKeyExchange = function(c, record, length) { // this implementation only supports RSA, no Diffie-Hellman support // so any length > 0 is invalid if(length > 0) { return c.error(c, { message: 'Invalid key parameters. Only RSA is supported.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.unsupported_certificate } }); } // expect an optional CertificateRequest message next c.expect = SCR; // continue c.process(); }; /** * Called when a client receives a ClientKeyExchange record. * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleClientKeyExchange = function(c, record, length) { // this implementation only supports RSA, no Diffie-Hellman support // so any length < 48 is invalid if(length < 48) { return c.error(c, { message: 'Invalid key parameters. Only RSA is supported.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.unsupported_certificate } }); } var b = record.fragment; var msg = { enc_pre_master_secret: readVector(b, 2).getBytes() }; // do rsa decryption var privateKey = null; if(c.getPrivateKey) { try { privateKey = c.getPrivateKey(c, c.session.serverCertificate); privateKey = forge.pki.privateKeyFromPem(privateKey); } catch(ex) { c.error(c, { message: 'Could not get private key.', cause: ex, send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } } if(privateKey === null) { return c.error(c, { message: 'No private key set.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } try { // decrypt 48-byte pre-master secret var sp = c.session.sp; sp.pre_master_secret = privateKey.decrypt(msg.enc_pre_master_secret); // ensure client hello version matches first 2 bytes var version = c.session.clientHelloVersion; if(version.major !== sp.pre_master_secret.charCodeAt(0) || version.minor !== sp.pre_master_secret.charCodeAt(1)) { // error, do not send alert (see BLEI attack below) throw new Error('TLS version rollback attack detected.'); } } catch(ex) { /* Note: Daniel Bleichenbacher [BLEI] can be used to attack a TLS server which is using PKCS#1 encoded RSA, so instead of failing here, we generate 48 random bytes and use that as the pre-master secret. */ sp.pre_master_secret = forge.random.getBytes(48); } // expect a CertificateVerify message if a Certificate was received that // does not have fixed Diffie-Hellman params, otherwise expect // ChangeCipherSpec c.expect = CCC; if(c.session.clientCertificate !== null) { // only RSA support, so expect CertificateVerify // TODO: support Diffie-Hellman c.expect = CCV; } // continue c.process(); }; /** * Called when a client receives a CertificateRequest record. * * When this message will be sent: * A non-anonymous server can optionally request a certificate from the * client, if appropriate for the selected cipher suite. This message, if * sent, will immediately follow the Server Key Exchange message (if it is * sent; otherwise, the Server Certificate message). * * enum { * rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), * rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), * fortezza_dms_RESERVED(20), (255) * } ClientCertificateType; * * opaque DistinguishedName<1..2^16-1>; * * struct { * ClientCertificateType certificate_types<1..2^8-1>; * SignatureAndHashAlgorithm supported_signature_algorithms<2^16-1>; * DistinguishedName certificate_authorities<0..2^16-1>; * } CertificateRequest; * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleCertificateRequest = function(c, record, length) { // minimum of 3 bytes in message if(length < 3) { return c.error(c, { message: 'Invalid CertificateRequest. Message too short.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } // TODO: TLS 1.2+ has different format including // SignatureAndHashAlgorithm after cert types var b = record.fragment; var msg = { certificate_types: readVector(b, 1), certificate_authorities: readVector(b, 2) }; // save certificate request in session c.session.certificateRequest = msg; // expect a ServerHelloDone message next c.expect = SHD; // continue c.process(); }; /** * Called when a server receives a CertificateVerify record. * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleCertificateVerify = function(c, record, length) { if(length < 2) { return c.error(c, { message: 'Invalid CertificateVerify. Message too short.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } // rewind to get full bytes for message so it can be manually // digested below (special case for CertificateVerify messages because // they must be digested *after* handling as opposed to all others) var b = record.fragment; b.read -= 4; var msgBytes = b.bytes(); b.read += 4; var msg = { signature: readVector(b, 2).getBytes() }; // TODO: add support for DSA // generate data to verify var verify = forge.util.createBuffer(); verify.putBuffer(c.session.md5.digest()); verify.putBuffer(c.session.sha1.digest()); verify = verify.getBytes(); try { var cert = c.session.clientCertificate; /*b = forge.pki.rsa.decrypt( msg.signature, cert.publicKey, true, verify.length); if(b !== verify) {*/ if(!cert.publicKey.verify(verify, msg.signature, 'NONE')) { throw new Error('CertificateVerify signature does not match.'); } // digest message now that it has been handled c.session.md5.update(msgBytes); c.session.sha1.update(msgBytes); } catch(ex) { return c.error(c, { message: 'Bad signature in CertificateVerify.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.handshake_failure } }); } // expect ChangeCipherSpec c.expect = CCC; // continue c.process(); }; /** * Called when a client receives a ServerHelloDone record. * * When this message will be sent: * The server hello done message is sent by the server to indicate the end * of the server hello and associated messages. After sending this message * the server will wait for a client response. * * Meaning of this message: * This message means that the server is done sending messages to support * the key exchange, and the client can proceed with its phase of the key * exchange. * * Upon receipt of the server hello done message the client should verify * that the server provided a valid certificate if required and check that * the server hello parameters are acceptable. * * struct {} ServerHelloDone; * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleServerHelloDone = function(c, record, length) { // len must be 0 bytes if(length > 0) { return c.error(c, { message: 'Invalid ServerHelloDone message. Invalid length.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.record_overflow } }); } if(c.serverCertificate === null) { // no server certificate was provided var error = { message: 'No server certificate provided. Not enough security.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.insufficient_security } }; // call application callback var depth = 0; var ret = c.verify(c, error.alert.description, depth, []); if(ret !== true) { // check for custom alert info if(ret || ret === 0) { // set custom message and alert description if(typeof ret === 'object' && !forge.util.isArray(ret)) { if(ret.message) { error.message = ret.message; } if(ret.alert) { error.alert.description = ret.alert; } } else if(typeof ret === 'number') { // set custom alert description error.alert.description = ret; } } // send error return c.error(c, error); } } // create client certificate message if requested if(c.session.certificateRequest !== null) { record = tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createCertificate(c) }); tls.queue(c, record); } // create client key exchange message record = tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createClientKeyExchange(c) }); tls.queue(c, record); // expect no messages until the following callback has been called c.expect = SER; // create callback to handle client signature (for client-certs) var callback = function(c, signature) { if(c.session.certificateRequest !== null && c.session.clientCertificate !== null) { // create certificate verify message tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createCertificateVerify(c, signature) })); } // create change cipher spec message tls.queue(c, tls.createRecord(c, { type: tls.ContentType.change_cipher_spec, data: tls.createChangeCipherSpec() })); // create pending state c.state.pending = tls.createConnectionState(c); // change current write state to pending write state c.state.current.write = c.state.pending.write; // create finished message tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createFinished(c) })); // expect a server ChangeCipherSpec message next c.expect = SCC; // send records tls.flush(c); // continue c.process(); }; // if there is no certificate request or no client certificate, do // callback immediately if(c.session.certificateRequest === null || c.session.clientCertificate === null) { return callback(c, null); } // otherwise get the client signature tls.getClientSignature(c, callback); }; /** * Called when a ChangeCipherSpec record is received. * * @param c the connection. * @param record the record. */ tls.handleChangeCipherSpec = function(c, record) { if(record.fragment.getByte() !== 0x01) { return c.error(c, { message: 'Invalid ChangeCipherSpec message received.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } // create pending state if: // 1. Resuming session in client mode OR // 2. NOT resuming session in server mode var client = (c.entity === tls.ConnectionEnd.client); if((c.session.resuming && client) || (!c.session.resuming && !client)) { c.state.pending = tls.createConnectionState(c); } // change current read state to pending read state c.state.current.read = c.state.pending.read; // clear pending state if: // 1. NOT resuming session in client mode OR // 2. resuming a session in server mode if((!c.session.resuming && client) || (c.session.resuming && !client)) { c.state.pending = null; } // expect a Finished record next c.expect = client ? SFI : CFI; // continue c.process(); }; /** * Called when a Finished record is received. * * When this message will be sent: * A finished message is always sent immediately after a change * cipher spec message to verify that the key exchange and * authentication processes were successful. It is essential that a * change cipher spec message be received between the other * handshake messages and the Finished message. * * Meaning of this message: * The finished message is the first protected with the just- * negotiated algorithms, keys, and secrets. Recipients of finished * messages must verify that the contents are correct. Once a side * has sent its Finished message and received and validated the * Finished message from its peer, it may begin to send and receive * application data over the connection. * * struct { * opaque verify_data[verify_data_length]; * } Finished; * * verify_data * PRF(master_secret, finished_label, Hash(handshake_messages)) * [0..verify_data_length-1]; * * finished_label * For Finished messages sent by the client, the string * "client finished". For Finished messages sent by the server, the * string "server finished". * * verify_data_length depends on the cipher suite. If it is not specified * by the cipher suite, then it is 12. Versions of TLS < 1.2 always used * 12 bytes. * * @param c the connection. * @param record the record. * @param length the length of the handshake message. */ tls.handleFinished = function(c, record, length) { // rewind to get full bytes for message so it can be manually // digested below (special case for Finished messages because they // must be digested *after* handling as opposed to all others) var b = record.fragment; b.read -= 4; var msgBytes = b.bytes(); b.read += 4; // message contains only verify_data var vd = record.fragment.getBytes(); // ensure verify data is correct b = forge.util.createBuffer(); b.putBuffer(c.session.md5.digest()); b.putBuffer(c.session.sha1.digest()); // set label based on entity type var client = (c.entity === tls.ConnectionEnd.client); var label = client ? 'server finished' : 'client finished'; // TODO: determine prf function and verify length for TLS 1.2 var sp = c.session.sp; var vdl = 12; var prf = prf_TLS1; b = prf(sp.master_secret, label, b.getBytes(), vdl); if(b.getBytes() !== vd) { return c.error(c, { message: 'Invalid verify_data in Finished message.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.decrypt_error } }); } // digest finished message now that it has been handled c.session.md5.update(msgBytes); c.session.sha1.update(msgBytes); // resuming session as client or NOT resuming session as server if((c.session.resuming && client) || (!c.session.resuming && !client)) { // create change cipher spec message tls.queue(c, tls.createRecord(c, { type: tls.ContentType.change_cipher_spec, data: tls.createChangeCipherSpec() })); // change current write state to pending write state, clear pending c.state.current.write = c.state.pending.write; c.state.pending = null; // create finished message tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createFinished(c) })); } // expect application data next c.expect = client ? SAD : CAD; // handshake complete c.handshaking = false; ++c.handshakes; // save access to peer certificate c.peerCertificate = client ? c.session.serverCertificate : c.session.clientCertificate; // send records tls.flush(c); // now connected c.isConnected = true; c.connected(c); // continue c.process(); }; /** * Called when an Alert record is received. * * @param c the connection. * @param record the record. */ tls.handleAlert = function(c, record) { // read alert var b = record.fragment; var alert = { level: b.getByte(), description: b.getByte() }; // TODO: consider using a table? // get appropriate message var msg; switch(alert.description) { case tls.Alert.Description.close_notify: msg = 'Connection closed.'; break; case tls.Alert.Description.unexpected_message: msg = 'Unexpected message.'; break; case tls.Alert.Description.bad_record_mac: msg = 'Bad record MAC.'; break; case tls.Alert.Description.decryption_failed: msg = 'Decryption failed.'; break; case tls.Alert.Description.record_overflow: msg = 'Record overflow.'; break; case tls.Alert.Description.decompression_failure: msg = 'Decompression failed.'; break; case tls.Alert.Description.handshake_failure: msg = 'Handshake failure.'; break; case tls.Alert.Description.bad_certificate: msg = 'Bad certificate.'; break; case tls.Alert.Description.unsupported_certificate: msg = 'Unsupported certificate.'; break; case tls.Alert.Description.certificate_revoked: msg = 'Certificate revoked.'; break; case tls.Alert.Description.certificate_expired: msg = 'Certificate expired.'; break; case tls.Alert.Description.certificate_unknown: msg = 'Certificate unknown.'; break; case tls.Alert.Description.illegal_parameter: msg = 'Illegal parameter.'; break; case tls.Alert.Description.unknown_ca: msg = 'Unknown certificate authority.'; break; case tls.Alert.Description.access_denied: msg = 'Access denied.'; break; case tls.Alert.Description.decode_error: msg = 'Decode error.'; break; case tls.Alert.Description.decrypt_error: msg = 'Decrypt error.'; break; case tls.Alert.Description.export_restriction: msg = 'Export restriction.'; break; case tls.Alert.Description.protocol_version: msg = 'Unsupported protocol version.'; break; case tls.Alert.Description.insufficient_security: msg = 'Insufficient security.'; break; case tls.Alert.Description.internal_error: msg = 'Internal error.'; break; case tls.Alert.Description.user_canceled: msg = 'User canceled.'; break; case tls.Alert.Description.no_renegotiation: msg = 'Renegotiation not supported.'; break; default: msg = 'Unknown error.'; break; } // close connection on close_notify, not an error if(alert.description === tls.Alert.Description.close_notify) { return c.close(); } // call error handler c.error(c, { message: msg, send: false, // origin is the opposite end origin: (c.entity === tls.ConnectionEnd.client) ? 'server' : 'client', alert: alert }); // continue c.process(); }; /** * Called when a Handshake record is received. * * @param c the connection. * @param record the record. */ tls.handleHandshake = function(c, record) { // get the handshake type and message length var b = record.fragment; var type = b.getByte(); var length = b.getInt24(); // see if the record fragment doesn't yet contain the full message if(length > b.length()) { // cache the record, clear its fragment, and reset the buffer read // pointer before the type and length were read c.fragmented = record; record.fragment = forge.util.createBuffer(); b.read -= 4; // continue return c.process(); } // full message now available, clear cache, reset read pointer to // before type and length c.fragmented = null; b.read -= 4; // save the handshake bytes for digestion after handler is found // (include type and length of handshake msg) var bytes = b.bytes(length + 4); // restore read pointer b.read += 4; // handle expected message if(type in hsTable[c.entity][c.expect]) { // initialize server session if(c.entity === tls.ConnectionEnd.server && !c.open && !c.fail) { c.handshaking = true; c.session = { version: null, extensions: { server_name: { serverNameList: [] } }, cipherSuite: null, compressionMethod: null, serverCertificate: null, clientCertificate: null, md5: forge.md.md5.create(), sha1: forge.md.sha1.create() }; } /* Update handshake messages digest. Finished and CertificateVerify messages are not digested here. They can't be digested as part of the verify_data that they contain. These messages are manually digested in their handlers. HelloRequest messages are simply never included in the handshake message digest according to spec. */ if(type !== tls.HandshakeType.hello_request && type !== tls.HandshakeType.certificate_verify && type !== tls.HandshakeType.finished) { c.session.md5.update(bytes); c.session.sha1.update(bytes); } // handle specific handshake type record hsTable[c.entity][c.expect][type](c, record, length); } else { // unexpected record tls.handleUnexpected(c, record); } }; /** * Called when an ApplicationData record is received. * * @param c the connection. * @param record the record. */ tls.handleApplicationData = function(c, record) { // buffer data, notify that its ready c.data.putBuffer(record.fragment); c.dataReady(c); // continue c.process(); }; /** * Called when a Heartbeat record is received. * * @param c the connection. * @param record the record. */ tls.handleHeartbeat = function(c, record) { // get the heartbeat type and payload var b = record.fragment; var type = b.getByte(); var length = b.getInt16(); var payload = b.getBytes(length); if(type === tls.HeartbeatMessageType.heartbeat_request) { // discard request during handshake or if length is too large if(c.handshaking || length > payload.length) { // continue return c.process(); } // retransmit payload tls.queue(c, tls.createRecord(c, { type: tls.ContentType.heartbeat, data: tls.createHeartbeat( tls.HeartbeatMessageType.heartbeat_response, payload) })); tls.flush(c); } else if(type === tls.HeartbeatMessageType.heartbeat_response) { // check payload against expected payload, discard heartbeat if no match if(payload !== c.expectedHeartbeatPayload) { // continue return c.process(); } // notify that a valid heartbeat was received if(c.heartbeatReceived) { c.heartbeatReceived(c, forge.util.createBuffer(payload)); } } // continue c.process(); }; /** * The transistional state tables for receiving TLS records. It maps the * current TLS engine state and a received record to a function to handle the * record and update the state. * * For instance, if the current state is SHE, then the TLS engine is expecting * a ServerHello record. Once a record is received, the handler function is * looked up using the state SHE and the record's content type. * * The resulting function will either be an error handler or a record handler. * The function will take whatever action is appropriate and update the state * for the next record. * * The states are all based on possible server record types. Note that the * client will never specifically expect to receive a HelloRequest or an alert * from the server so there is no state that reflects this. These messages may * occur at any time. * * There are two tables for mapping states because there is a second tier of * types for handshake messages. Once a record with a content type of handshake * is received, the handshake record handler will look up the handshake type in * the secondary map to get its appropriate handler. * * Valid message orders are as follows: * * =======================FULL HANDSHAKE====================== * Client Server * * ClientHello --------> * ServerHello * Certificate* * ServerKeyExchange* * CertificateRequest* * <-------- ServerHelloDone * Certificate* * ClientKeyExchange * CertificateVerify* * [ChangeCipherSpec] * Finished --------> * [ChangeCipherSpec] * <-------- Finished * Application Data <-------> Application Data * * =====================SESSION RESUMPTION===================== * Client Server * * ClientHello --------> * ServerHello * [ChangeCipherSpec] * <-------- Finished * [ChangeCipherSpec] * Finished --------> * Application Data <-------> Application Data */ // client expect states (indicate which records are expected to be received) var SHE = 0; // rcv server hello var SCE = 1; // rcv server certificate var SKE = 2; // rcv server key exchange var SCR = 3; // rcv certificate request var SHD = 4; // rcv server hello done var SCC = 5; // rcv change cipher spec var SFI = 6; // rcv finished var SAD = 7; // rcv application data var SER = 8; // not expecting any messages at this point // server expect states var CHE = 0; // rcv client hello var CCE = 1; // rcv client certificate var CKE = 2; // rcv client key exchange var CCV = 3; // rcv certificate verify var CCC = 4; // rcv change cipher spec var CFI = 5; // rcv finished var CAD = 6; // rcv application data var CER = 7; // not expecting any messages at this point // map client current expect state and content type to function var __ = tls.handleUnexpected; var R0 = tls.handleChangeCipherSpec; var R1 = tls.handleAlert; var R2 = tls.handleHandshake; var R3 = tls.handleApplicationData; var R4 = tls.handleHeartbeat; var ctTable = []; ctTable[tls.ConnectionEnd.client] = [ // CC,AL,HS,AD,HB /*SHE*/[__,R1,R2,__,R4], /*SCE*/[__,R1,R2,__,R4], /*SKE*/[__,R1,R2,__,R4], /*SCR*/[__,R1,R2,__,R4], /*SHD*/[__,R1,R2,__,R4], /*SCC*/[R0,R1,__,__,R4], /*SFI*/[__,R1,R2,__,R4], /*SAD*/[__,R1,R2,R3,R4], /*SER*/[__,R1,R2,__,R4] ]; // map server current expect state and content type to function ctTable[tls.ConnectionEnd.server] = [ // CC,AL,HS,AD /*CHE*/[__,R1,R2,__,R4], /*CCE*/[__,R1,R2,__,R4], /*CKE*/[__,R1,R2,__,R4], /*CCV*/[__,R1,R2,__,R4], /*CCC*/[R0,R1,__,__,R4], /*CFI*/[__,R1,R2,__,R4], /*CAD*/[__,R1,R2,R3,R4], /*CER*/[__,R1,R2,__,R4] ]; // map client current expect state and handshake type to function var H0 = tls.handleHelloRequest; var H1 = tls.handleServerHello; var H2 = tls.handleCertificate; var H3 = tls.handleServerKeyExchange; var H4 = tls.handleCertificateRequest; var H5 = tls.handleServerHelloDone; var H6 = tls.handleFinished; var hsTable = []; hsTable[tls.ConnectionEnd.client] = [ // HR,01,SH,03,04,05,06,07,08,09,10,SC,SK,CR,HD,15,CK,17,18,19,FI /*SHE*/[__,__,H1,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], /*SCE*/[H0,__,__,__,__,__,__,__,__,__,__,H2,H3,H4,H5,__,__,__,__,__,__], /*SKE*/[H0,__,__,__,__,__,__,__,__,__,__,__,H3,H4,H5,__,__,__,__,__,__], /*SCR*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,H4,H5,__,__,__,__,__,__], /*SHD*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,H5,__,__,__,__,__,__], /*SCC*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], /*SFI*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H6], /*SAD*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], /*SER*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__] ]; // map server current expect state and handshake type to function // Note: CAD[CH] does not map to FB because renegotation is prohibited var H7 = tls.handleClientHello; var H8 = tls.handleClientKeyExchange; var H9 = tls.handleCertificateVerify; hsTable[tls.ConnectionEnd.server] = [ // 01,CH,02,03,04,05,06,07,08,09,10,CC,12,13,14,CV,CK,17,18,19,FI /*CHE*/[__,H7,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], /*CCE*/[__,__,__,__,__,__,__,__,__,__,__,H2,__,__,__,__,__,__,__,__,__], /*CKE*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H8,__,__,__,__], /*CCV*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H9,__,__,__,__,__], /*CCC*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], /*CFI*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H6], /*CAD*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], /*CER*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__] ]; /** * Generates the master_secret and keys using the given security parameters. * * The security parameters for a TLS connection state are defined as such: * * struct { * ConnectionEnd entity; * PRFAlgorithm prf_algorithm; * BulkCipherAlgorithm bulk_cipher_algorithm; * CipherType cipher_type; * uint8 enc_key_length; * uint8 block_length; * uint8 fixed_iv_length; * uint8 record_iv_length; * MACAlgorithm mac_algorithm; * uint8 mac_length; * uint8 mac_key_length; * CompressionMethod compression_algorithm; * opaque master_secret[48]; * opaque client_random[32]; * opaque server_random[32]; * } SecurityParameters; * * Note that this definition is from TLS 1.2. In TLS 1.0 some of these * parameters are ignored because, for instance, the PRFAlgorithm is a * builtin-fixed algorithm combining iterations of MD5 and SHA-1 in TLS 1.0. * * The Record Protocol requires an algorithm to generate keys required by the * current connection state. * * The master secret is expanded into a sequence of secure bytes, which is then * split to a client write MAC key, a server write MAC key, a client write * encryption key, and a server write encryption key. In TLS 1.0 a client write * IV and server write IV are also generated. Each of these is generated from * the byte sequence in that order. Unused values are empty. In TLS 1.2, some * AEAD ciphers may additionally require a client write IV and a server write * IV (see Section 6.2.3.3). * * When keys, MAC keys, and IVs are generated, the master secret is used as an * entropy source. * * To generate the key material, compute: * * master_secret = PRF(pre_master_secret, "master secret", * ClientHello.random + ServerHello.random) * * key_block = PRF(SecurityParameters.master_secret, * "key expansion", * SecurityParameters.server_random + * SecurityParameters.client_random); * * until enough output has been generated. Then, the key_block is * partitioned as follows: * * client_write_MAC_key[SecurityParameters.mac_key_length] * server_write_MAC_key[SecurityParameters.mac_key_length] * client_write_key[SecurityParameters.enc_key_length] * server_write_key[SecurityParameters.enc_key_length] * client_write_IV[SecurityParameters.fixed_iv_length] * server_write_IV[SecurityParameters.fixed_iv_length] * * In TLS 1.2, the client_write_IV and server_write_IV are only generated for * implicit nonce techniques as described in Section 3.2.1 of [AEAD]. This * implementation uses TLS 1.0 so IVs are generated. * * Implementation note: The currently defined cipher suite which requires the * most material is AES_256_CBC_SHA256. It requires 2 x 32 byte keys and 2 x 32 * byte MAC keys, for a total 128 bytes of key material. In TLS 1.0 it also * requires 2 x 16 byte IVs, so it actually takes 160 bytes of key material. * * @param c the connection. * @param sp the security parameters to use. * * @return the security keys. */ tls.generateKeys = function(c, sp) { // TLS_RSA_WITH_AES_128_CBC_SHA (required to be compliant with TLS 1.2) & // TLS_RSA_WITH_AES_256_CBC_SHA are the only cipher suites implemented // at present // TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA is required to be compliant with // TLS 1.0 but we don't care right now because AES is better and we have // an implementation for it // TODO: TLS 1.2 implementation /* // determine the PRF var prf; switch(sp.prf_algorithm) { case tls.PRFAlgorithm.tls_prf_sha256: prf = prf_sha256; break; default: // should never happen throw new Error('Invalid PRF'); } */ // TLS 1.0/1.1 implementation var prf = prf_TLS1; // concatenate server and client random var random = sp.client_random + sp.server_random; // only create master secret if session is new if(!c.session.resuming) { // create master secret, clean up pre-master secret sp.master_secret = prf( sp.pre_master_secret, 'master secret', random, 48).bytes(); sp.pre_master_secret = null; } // generate the amount of key material needed random = sp.server_random + sp.client_random; var length = 2 * sp.mac_key_length + 2 * sp.enc_key_length; // include IV for TLS/1.0 var tls10 = (c.version.major === tls.Versions.TLS_1_0.major && c.version.minor === tls.Versions.TLS_1_0.minor); if(tls10) { length += 2 * sp.fixed_iv_length; } var km = prf(sp.master_secret, 'key expansion', random, length); // split the key material into the MAC and encryption keys var rval = { client_write_MAC_key: km.getBytes(sp.mac_key_length), server_write_MAC_key: km.getBytes(sp.mac_key_length), client_write_key: km.getBytes(sp.enc_key_length), server_write_key: km.getBytes(sp.enc_key_length) }; // include TLS 1.0 IVs if(tls10) { rval.client_write_IV = km.getBytes(sp.fixed_iv_length); rval.server_write_IV = km.getBytes(sp.fixed_iv_length); } return rval; }; /** * Creates a new initialized TLS connection state. A connection state has * a read mode and a write mode. * * compression state: * The current state of the compression algorithm. * * cipher state: * The current state of the encryption algorithm. This will consist of the * scheduled key for that connection. For stream ciphers, this will also * contain whatever state information is necessary to allow the stream to * continue to encrypt or decrypt data. * * MAC key: * The MAC key for the connection. * * sequence number: * Each connection state contains a sequence number, which is maintained * separately for read and write states. The sequence number MUST be set to * zero whenever a connection state is made the active state. Sequence * numbers are of type uint64 and may not exceed 2^64-1. Sequence numbers do * not wrap. If a TLS implementation would need to wrap a sequence number, * it must renegotiate instead. A sequence number is incremented after each * record: specifically, the first record transmitted under a particular * connection state MUST use sequence number 0. * * @param c the connection. * * @return the new initialized TLS connection state. */ tls.createConnectionState = function(c) { var client = (c.entity === tls.ConnectionEnd.client); var createMode = function() { var mode = { // two 32-bit numbers, first is most significant sequenceNumber: [0, 0], macKey: null, macLength: 0, macFunction: null, cipherState: null, cipherFunction: function(record) {return true;}, compressionState: null, compressFunction: function(record) {return true;}, updateSequenceNumber: function() { if(mode.sequenceNumber[1] === 0xFFFFFFFF) { mode.sequenceNumber[1] = 0; ++mode.sequenceNumber[0]; } else { ++mode.sequenceNumber[1]; } } }; return mode; }; var state = { read: createMode(), write: createMode() }; // update function in read mode will decrypt then decompress a record state.read.update = function(c, record) { if(!state.read.cipherFunction(record, state.read)) { c.error(c, { message: 'Could not decrypt record or bad MAC.', send: true, alert: { level: tls.Alert.Level.fatal, // doesn't matter if decryption failed or MAC was // invalid, return the same error so as not to reveal // which one occurred description: tls.Alert.Description.bad_record_mac } }); } else if(!state.read.compressFunction(c, record, state.read)) { c.error(c, { message: 'Could not decompress record.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.decompression_failure } }); } return !c.fail; }; // update function in write mode will compress then encrypt a record state.write.update = function(c, record) { if(!state.write.compressFunction(c, record, state.write)) { // error, but do not send alert since it would require // compression as well c.error(c, { message: 'Could not compress record.', send: false, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } else if(!state.write.cipherFunction(record, state.write)) { // error, but do not send alert since it would require // encryption as well c.error(c, { message: 'Could not encrypt record.', send: false, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } return !c.fail; }; // handle security parameters if(c.session) { var sp = c.session.sp; c.session.cipherSuite.initSecurityParameters(sp); // generate keys sp.keys = tls.generateKeys(c, sp); state.read.macKey = client ? sp.keys.server_write_MAC_key : sp.keys.client_write_MAC_key; state.write.macKey = client ? sp.keys.client_write_MAC_key : sp.keys.server_write_MAC_key; // cipher suite setup c.session.cipherSuite.initConnectionState(state, c, sp); // compression setup switch(sp.compression_algorithm) { case tls.CompressionMethod.none: break; case tls.CompressionMethod.deflate: state.read.compressFunction = inflate; state.write.compressFunction = deflate; break; default: throw new Error('Unsupported compression algorithm.'); } } return state; }; /** * Creates a Random structure. * * struct { * uint32 gmt_unix_time; * opaque random_bytes[28]; * } Random; * * gmt_unix_time: * The current time and date in standard UNIX 32-bit format (seconds since * the midnight starting Jan 1, 1970, UTC, ignoring leap seconds) according * to the sender's internal clock. Clocks are not required to be set * correctly by the basic TLS protocol; higher-level or application * protocols may define additional requirements. Note that, for historical * reasons, the data element is named using GMT, the predecessor of the * current worldwide time base, UTC. * random_bytes: * 28 bytes generated by a secure random number generator. * * @return the Random structure as a byte array. */ tls.createRandom = function() { // get UTC milliseconds var d = new Date(); var utc = +d + d.getTimezoneOffset() * 60000; var rval = forge.util.createBuffer(); rval.putInt32(utc); rval.putBytes(forge.random.getBytes(28)); return rval; }; /** * Creates a TLS record with the given type and data. * * @param c the connection. * @param options: * type: the record type. * data: the plain text data in a byte buffer. * * @return the created record. */ tls.createRecord = function(c, options) { if(!options.data) { return null; } var record = { type: options.type, version: { major: c.version.major, minor: c.version.minor }, length: options.data.length(), fragment: options.data }; return record; }; /** * Creates a TLS alert record. * * @param c the connection. * @param alert: * level: the TLS alert level. * description: the TLS alert description. * * @return the created alert record. */ tls.createAlert = function(c, alert) { var b = forge.util.createBuffer(); b.putByte(alert.level); b.putByte(alert.description); return tls.createRecord(c, { type: tls.ContentType.alert, data: b }); }; /* The structure of a TLS handshake message. * * struct { * HandshakeType msg_type; // handshake type * uint24 length; // bytes in message * select(HandshakeType) { * case hello_request: HelloRequest; * case client_hello: ClientHello; * case server_hello: ServerHello; * case certificate: Certificate; * case server_key_exchange: ServerKeyExchange; * case certificate_request: CertificateRequest; * case server_hello_done: ServerHelloDone; * case certificate_verify: CertificateVerify; * case client_key_exchange: ClientKeyExchange; * case finished: Finished; * } body; * } Handshake; */ /** * Creates a ClientHello message. * * opaque SessionID<0..32>; * enum { null(0), deflate(1), (255) } CompressionMethod; * uint8 CipherSuite[2]; * * struct { * ProtocolVersion client_version; * Random random; * SessionID session_id; * CipherSuite cipher_suites<2..2^16-2>; * CompressionMethod compression_methods<1..2^8-1>; * select(extensions_present) { * case false: * struct {}; * case true: * Extension extensions<0..2^16-1>; * }; * } ClientHello; * * The extension format for extended client hellos and server hellos is: * * struct { * ExtensionType extension_type; * opaque extension_data<0..2^16-1>; * } Extension; * * Here: * * - "extension_type" identifies the particular extension type. * - "extension_data" contains information specific to the particular * extension type. * * The extension types defined in this document are: * * enum { * server_name(0), max_fragment_length(1), * client_certificate_url(2), trusted_ca_keys(3), * truncated_hmac(4), status_request(5), (65535) * } ExtensionType; * * @param c the connection. * * @return the ClientHello byte buffer. */ tls.createClientHello = function(c) { // save hello version c.session.clientHelloVersion = { major: c.version.major, minor: c.version.minor }; // create supported cipher suites var cipherSuites = forge.util.createBuffer(); for(var i = 0; i < c.cipherSuites.length; ++i) { var cs = c.cipherSuites[i]; cipherSuites.putByte(cs.id[0]); cipherSuites.putByte(cs.id[1]); } var cSuites = cipherSuites.length(); // create supported compression methods, null always supported, but // also support deflate if connection has inflate and deflate methods var compressionMethods = forge.util.createBuffer(); compressionMethods.putByte(tls.CompressionMethod.none); // FIXME: deflate support disabled until issues with raw deflate data // without zlib headers are resolved /* if(c.inflate !== null && c.deflate !== null) { compressionMethods.putByte(tls.CompressionMethod.deflate); } */ var cMethods = compressionMethods.length(); // create TLS SNI (server name indication) extension if virtual host // has been specified, see RFC 3546 var extensions = forge.util.createBuffer(); if(c.virtualHost) { // create extension struct var ext = forge.util.createBuffer(); ext.putByte(0x00); // type server_name (ExtensionType is 2 bytes) ext.putByte(0x00); /* In order to provide the server name, clients MAY include an * extension of type "server_name" in the (extended) client hello. * The "extension_data" field of this extension SHALL contain * "ServerNameList" where: * * struct { * NameType name_type; * select(name_type) { * case host_name: HostName; * } name; * } ServerName; * * enum { * host_name(0), (255) * } NameType; * * opaque HostName<1..2^16-1>; * * struct { * ServerName server_name_list<1..2^16-1> * } ServerNameList; */ var serverName = forge.util.createBuffer(); serverName.putByte(0x00); // type host_name writeVector(serverName, 2, forge.util.createBuffer(c.virtualHost)); // ServerNameList is in extension_data var snList = forge.util.createBuffer(); writeVector(snList, 2, serverName); writeVector(ext, 2, snList); extensions.putBuffer(ext); } var extLength = extensions.length(); if(extLength > 0) { // add extension vector length extLength += 2; } // determine length of the handshake message // cipher suites and compression methods size will need to be // updated if more get added to the list var sessionId = c.session.id; var length = sessionId.length + 1 + // session ID vector 2 + // version (major + minor) 4 + 28 + // random time and random bytes 2 + cSuites + // cipher suites vector 1 + cMethods + // compression methods vector extLength; // extensions vector // build record fragment var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.client_hello); rval.putInt24(length); // handshake length rval.putByte(c.version.major); // major version rval.putByte(c.version.minor); // minor version rval.putBytes(c.session.sp.client_random); // random time + bytes writeVector(rval, 1, forge.util.createBuffer(sessionId)); writeVector(rval, 2, cipherSuites); writeVector(rval, 1, compressionMethods); if(extLength > 0) { writeVector(rval, 2, extensions); } return rval; }; /** * Creates a ServerHello message. * * @param c the connection. * * @return the ServerHello byte buffer. */ tls.createServerHello = function(c) { // determine length of the handshake message var sessionId = c.session.id; var length = sessionId.length + 1 + // session ID vector 2 + // version (major + minor) 4 + 28 + // random time and random bytes 2 + // chosen cipher suite 1; // chosen compression method // build record fragment var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.server_hello); rval.putInt24(length); // handshake length rval.putByte(c.version.major); // major version rval.putByte(c.version.minor); // minor version rval.putBytes(c.session.sp.server_random); // random time + bytes writeVector(rval, 1, forge.util.createBuffer(sessionId)); rval.putByte(c.session.cipherSuite.id[0]); rval.putByte(c.session.cipherSuite.id[1]); rval.putByte(c.session.compressionMethod); return rval; }; /** * Creates a Certificate message. * * When this message will be sent: * This is the first message the client can send after receiving a server * hello done message and the first message the server can send after * sending a ServerHello. This client message is only sent if the server * requests a certificate. If no suitable certificate is available, the * client should send a certificate message containing no certificates. If * client authentication is required by the server for the handshake to * continue, it may respond with a fatal handshake failure alert. * * opaque ASN.1Cert<1..2^24-1>; * * struct { * ASN.1Cert certificate_list<0..2^24-1>; * } Certificate; * * @param c the connection. * * @return the Certificate byte buffer. */ tls.createCertificate = function(c) { // TODO: check certificate request to ensure types are supported // get a certificate (a certificate as a PEM string) var client = (c.entity === tls.ConnectionEnd.client); var cert = null; if(c.getCertificate) { var hint; if(client) { hint = c.session.certificateRequest; } else { hint = c.session.extensions.server_name.serverNameList; } cert = c.getCertificate(c, hint); } // buffer to hold certificate list var certList = forge.util.createBuffer(); if(cert !== null) { try { // normalize cert to a chain of certificates if(!forge.util.isArray(cert)) { cert = [cert]; } var asn1 = null; for(var i = 0; i < cert.length; ++i) { var msg = forge.pem.decode(cert[i])[0]; if(msg.type !== 'CERTIFICATE' && msg.type !== 'X509 CERTIFICATE' && msg.type !== 'TRUSTED CERTIFICATE') { var error = new Error('Could not convert certificate from PEM; PEM ' + 'header type is not "CERTIFICATE", "X509 CERTIFICATE", or ' + '"TRUSTED CERTIFICATE".'); error.headerType = msg.type; throw error; } if(msg.procType && msg.procType.type === 'ENCRYPTED') { throw new Error('Could not convert certificate from PEM; PEM is encrypted.'); } var der = forge.util.createBuffer(msg.body); if(asn1 === null) { asn1 = forge.asn1.fromDer(der.bytes(), false); } // certificate entry is itself a vector with 3 length bytes var certBuffer = forge.util.createBuffer(); writeVector(certBuffer, 3, der); // add cert vector to cert list vector certList.putBuffer(certBuffer); } // save certificate cert = forge.pki.certificateFromAsn1(asn1); if(client) { c.session.clientCertificate = cert; } else { c.session.serverCertificate = cert; } } catch(ex) { return c.error(c, { message: 'Could not send certificate list.', cause: ex, send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.bad_certificate } }); } } // determine length of the handshake message var length = 3 + certList.length(); // cert list vector // build record fragment var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.certificate); rval.putInt24(length); writeVector(rval, 3, certList); return rval; }; /** * Creates a ClientKeyExchange message. * * When this message will be sent: * This message is always sent by the client. It will immediately follow the * client certificate message, if it is sent. Otherwise it will be the first * message sent by the client after it receives the server hello done * message. * * Meaning of this message: * With this message, the premaster secret is set, either though direct * transmission of the RSA-encrypted secret, or by the transmission of * Diffie-Hellman parameters which will allow each side to agree upon the * same premaster secret. When the key exchange method is DH_RSA or DH_DSS, * client certification has been requested, and the client was able to * respond with a certificate which contained a Diffie-Hellman public key * whose parameters (group and generator) matched those specified by the * server in its certificate, this message will not contain any data. * * Meaning of this message: * If RSA is being used for key agreement and authentication, the client * generates a 48-byte premaster secret, encrypts it using the public key * from the server's certificate or the temporary RSA key provided in a * server key exchange message, and sends the result in an encrypted * premaster secret message. This structure is a variant of the client * key exchange message, not a message in itself. * * struct { * select(KeyExchangeAlgorithm) { * case rsa: EncryptedPreMasterSecret; * case diffie_hellman: ClientDiffieHellmanPublic; * } exchange_keys; * } ClientKeyExchange; * * struct { * ProtocolVersion client_version; * opaque random[46]; * } PreMasterSecret; * * struct { * public-key-encrypted PreMasterSecret pre_master_secret; * } EncryptedPreMasterSecret; * * A public-key-encrypted element is encoded as a vector <0..2^16-1>. * * @param c the connection. * * @return the ClientKeyExchange byte buffer. */ tls.createClientKeyExchange = function(c) { // create buffer to encrypt var b = forge.util.createBuffer(); // add highest client-supported protocol to help server avoid version // rollback attacks b.putByte(c.session.clientHelloVersion.major); b.putByte(c.session.clientHelloVersion.minor); // generate and add 46 random bytes b.putBytes(forge.random.getBytes(46)); // save pre-master secret var sp = c.session.sp; sp.pre_master_secret = b.getBytes(); // RSA-encrypt the pre-master secret var key = c.session.serverCertificate.publicKey; b = key.encrypt(sp.pre_master_secret); /* Note: The encrypted pre-master secret will be stored in a public-key-encrypted opaque vector that has the length prefixed using 2 bytes, so include those 2 bytes in the handshake message length. This is done as a minor optimization instead of calling writeVector(). */ // determine length of the handshake message var length = b.length + 2; // build record fragment var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.client_key_exchange); rval.putInt24(length); // add vector length bytes rval.putInt16(b.length); rval.putBytes(b); return rval; }; /** * Creates a ServerKeyExchange message. * * @param c the connection. * * @return the ServerKeyExchange byte buffer. */ tls.createServerKeyExchange = function(c) { // this implementation only supports RSA, no Diffie-Hellman support, // so this record is empty // determine length of the handshake message var length = 0; // build record fragment var rval = forge.util.createBuffer(); if(length > 0) { rval.putByte(tls.HandshakeType.server_key_exchange); rval.putInt24(length); } return rval; }; /** * Gets the signed data used to verify a client-side certificate. See * tls.createCertificateVerify() for details. * * @param c the connection. * @param callback the callback to call once the signed data is ready. */ tls.getClientSignature = function(c, callback) { // generate data to RSA encrypt var b = forge.util.createBuffer(); b.putBuffer(c.session.md5.digest()); b.putBuffer(c.session.sha1.digest()); b = b.getBytes(); // create default signing function as necessary c.getSignature = c.getSignature || function(c, b, callback) { // do rsa encryption, call callback var privateKey = null; if(c.getPrivateKey) { try { privateKey = c.getPrivateKey(c, c.session.clientCertificate); privateKey = forge.pki.privateKeyFromPem(privateKey); } catch(ex) { c.error(c, { message: 'Could not get private key.', cause: ex, send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } } if(privateKey === null) { c.error(c, { message: 'No private key set.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } else { b = privateKey.sign(b, null); } callback(c, b); }; // get client signature c.getSignature(c, b, callback); }; /** * Creates a CertificateVerify message. * * Meaning of this message: * This structure conveys the client's Diffie-Hellman public value * (Yc) if it was not already included in the client's certificate. * The encoding used for Yc is determined by the enumerated * PublicValueEncoding. This structure is a variant of the client * key exchange message, not a message in itself. * * When this message will be sent: * This message is used to provide explicit verification of a client * certificate. This message is only sent following a client * certificate that has signing capability (i.e. all certificates * except those containing fixed Diffie-Hellman parameters). When * sent, it will immediately follow the client key exchange message. * * struct { * Signature signature; * } CertificateVerify; * * CertificateVerify.signature.md5_hash * MD5(handshake_messages); * * Certificate.signature.sha_hash * SHA(handshake_messages); * * Here handshake_messages refers to all handshake messages sent or * received starting at client hello up to but not including this * message, including the type and length fields of the handshake * messages. * * select(SignatureAlgorithm) { * case anonymous: struct { }; * case rsa: * digitally-signed struct { * opaque md5_hash[16]; * opaque sha_hash[20]; * }; * case dsa: * digitally-signed struct { * opaque sha_hash[20]; * }; * } Signature; * * In digital signing, one-way hash functions are used as input for a * signing algorithm. A digitally-signed element is encoded as an opaque * vector <0..2^16-1>, where the length is specified by the signing * algorithm and key. * * In RSA signing, a 36-byte structure of two hashes (one SHA and one * MD5) is signed (encrypted with the private key). It is encoded with * PKCS #1 block type 0 or type 1 as described in [PKCS1]. * * In DSS, the 20 bytes of the SHA hash are run directly through the * Digital Signing Algorithm with no additional hashing. * * @param c the connection. * @param signature the signature to include in the message. * * @return the CertificateVerify byte buffer. */ tls.createCertificateVerify = function(c, signature) { /* Note: The signature will be stored in a "digitally-signed" opaque vector that has the length prefixed using 2 bytes, so include those 2 bytes in the handshake message length. This is done as a minor optimization instead of calling writeVector(). */ // determine length of the handshake message var length = signature.length + 2; // build record fragment var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.certificate_verify); rval.putInt24(length); // add vector length bytes rval.putInt16(signature.length); rval.putBytes(signature); return rval; }; /** * Creates a CertificateRequest message. * * @param c the connection. * * @return the CertificateRequest byte buffer. */ tls.createCertificateRequest = function(c) { // TODO: support other certificate types var certTypes = forge.util.createBuffer(); // common RSA certificate type certTypes.putByte(0x01); // add distinguished names from CA store var cAs = forge.util.createBuffer(); for(var key in c.caStore.certs) { var cert = c.caStore.certs[key]; var dn = forge.pki.distinguishedNameToAsn1(cert.subject); var byteBuffer = forge.asn1.toDer(dn); cAs.putInt16(byteBuffer.length()); cAs.putBuffer(byteBuffer); } // TODO: TLS 1.2+ has a different format // determine length of the handshake message var length = 1 + certTypes.length() + 2 + cAs.length(); // build record fragment var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.certificate_request); rval.putInt24(length); writeVector(rval, 1, certTypes); writeVector(rval, 2, cAs); return rval; }; /** * Creates a ServerHelloDone message. * * @param c the connection. * * @return the ServerHelloDone byte buffer. */ tls.createServerHelloDone = function(c) { // build record fragment var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.server_hello_done); rval.putInt24(0); return rval; }; /** * Creates a ChangeCipherSpec message. * * The change cipher spec protocol exists to signal transitions in * ciphering strategies. The protocol consists of a single message, * which is encrypted and compressed under the current (not the pending) * connection state. The message consists of a single byte of value 1. * * struct { * enum { change_cipher_spec(1), (255) } type; * } ChangeCipherSpec; * * @return the ChangeCipherSpec byte buffer. */ tls.createChangeCipherSpec = function() { var rval = forge.util.createBuffer(); rval.putByte(0x01); return rval; }; /** * Creates a Finished message. * * struct { * opaque verify_data[12]; * } Finished; * * verify_data * PRF(master_secret, finished_label, MD5(handshake_messages) + * SHA-1(handshake_messages)) [0..11]; * * finished_label * For Finished messages sent by the client, the string "client * finished". For Finished messages sent by the server, the * string "server finished". * * handshake_messages * All of the data from all handshake messages up to but not * including this message. This is only data visible at the * handshake layer and does not include record layer headers. * This is the concatenation of all the Handshake structures as * defined in 7.4 exchanged thus far. * * @param c the connection. * * @return the Finished byte buffer. */ tls.createFinished = function(c) { // generate verify_data var b = forge.util.createBuffer(); b.putBuffer(c.session.md5.digest()); b.putBuffer(c.session.sha1.digest()); // TODO: determine prf function and verify length for TLS 1.2 var client = (c.entity === tls.ConnectionEnd.client); var sp = c.session.sp; var vdl = 12; var prf = prf_TLS1; var label = client ? 'client finished' : 'server finished'; b = prf(sp.master_secret, label, b.getBytes(), vdl); // build record fragment var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.finished); rval.putInt24(b.length()); rval.putBuffer(b); return rval; }; /** * Creates a HeartbeatMessage (See RFC 6520). * * struct { * HeartbeatMessageType type; * uint16 payload_length; * opaque payload[HeartbeatMessage.payload_length]; * opaque padding[padding_length]; * } HeartbeatMessage; * * The total length of a HeartbeatMessage MUST NOT exceed 2^14 or * max_fragment_length when negotiated as defined in [RFC6066]. * * type: The message type, either heartbeat_request or heartbeat_response. * * payload_length: The length of the payload. * * payload: The payload consists of arbitrary content. * * padding: The padding is random content that MUST be ignored by the * receiver. The length of a HeartbeatMessage is TLSPlaintext.length * for TLS and DTLSPlaintext.length for DTLS. Furthermore, the * length of the type field is 1 byte, and the length of the * payload_length is 2. Therefore, the padding_length is * TLSPlaintext.length - payload_length - 3 for TLS and * DTLSPlaintext.length - payload_length - 3 for DTLS. The * padding_length MUST be at least 16. * * The sender of a HeartbeatMessage MUST use a random padding of at * least 16 bytes. The padding of a received HeartbeatMessage message * MUST be ignored. * * If the payload_length of a received HeartbeatMessage is too large, * the received HeartbeatMessage MUST be discarded silently. * * @param c the connection. * @param type the tls.HeartbeatMessageType. * @param payload the heartbeat data to send as the payload. * @param [payloadLength] the payload length to use, defaults to the * actual payload length. * * @return the HeartbeatRequest byte buffer. */ tls.createHeartbeat = function(type, payload, payloadLength) { if(typeof payloadLength === 'undefined') { payloadLength = payload.length; } // build record fragment var rval = forge.util.createBuffer(); rval.putByte(type); // heartbeat message type rval.putInt16(payloadLength); // payload length rval.putBytes(payload); // payload // padding var plaintextLength = rval.length(); var paddingLength = Math.max(16, plaintextLength - payloadLength - 3); rval.putBytes(forge.random.getBytes(paddingLength)); return rval; }; /** * Fragments, compresses, encrypts, and queues a record for delivery. * * @param c the connection. * @param record the record to queue. */ tls.queue = function(c, record) { // error during record creation if(!record) { return; } if(record.fragment.length() === 0) { if(record.type === tls.ContentType.handshake || record.type === tls.ContentType.alert || record.type === tls.ContentType.change_cipher_spec) { // Empty handshake, alert of change cipher spec messages are not allowed per the TLS specification and should not be sent. return; } } // if the record is a handshake record, update handshake hashes if(record.type === tls.ContentType.handshake) { var bytes = record.fragment.bytes(); c.session.md5.update(bytes); c.session.sha1.update(bytes); bytes = null; } // handle record fragmentation var records; if(record.fragment.length() <= tls.MaxFragment) { records = [record]; } else { // fragment data as long as it is too long records = []; var data = record.fragment.bytes(); while(data.length > tls.MaxFragment) { records.push(tls.createRecord(c, { type: record.type, data: forge.util.createBuffer(data.slice(0, tls.MaxFragment)) })); data = data.slice(tls.MaxFragment); } // add last record if(data.length > 0) { records.push(tls.createRecord(c, { type: record.type, data: forge.util.createBuffer(data) })); } } // compress and encrypt all fragmented records for(var i = 0; i < records.length && !c.fail; ++i) { // update the record using current write state var rec = records[i]; var s = c.state.current.write; if(s.update(c, rec)) { // store record c.records.push(rec); } } }; /** * Flushes all queued records to the output buffer and calls the * tlsDataReady() handler on the given connection. * * @param c the connection. * * @return true on success, false on failure. */ tls.flush = function(c) { for(var i = 0; i < c.records.length; ++i) { var record = c.records[i]; // add record header and fragment c.tlsData.putByte(record.type); c.tlsData.putByte(record.version.major); c.tlsData.putByte(record.version.minor); c.tlsData.putInt16(record.fragment.length()); c.tlsData.putBuffer(c.records[i].fragment); } c.records = []; return c.tlsDataReady(c); }; /** * Maps a pki.certificateError to a tls.Alert.Description. * * @param error the error to map. * * @return the alert description. */ var _certErrorToAlertDesc = function(error) { switch(error) { case true: return true; case forge.pki.certificateError.bad_certificate: return tls.Alert.Description.bad_certificate; case forge.pki.certificateError.unsupported_certificate: return tls.Alert.Description.unsupported_certificate; case forge.pki.certificateError.certificate_revoked: return tls.Alert.Description.certificate_revoked; case forge.pki.certificateError.certificate_expired: return tls.Alert.Description.certificate_expired; case forge.pki.certificateError.certificate_unknown: return tls.Alert.Description.certificate_unknown; case forge.pki.certificateError.unknown_ca: return tls.Alert.Description.unknown_ca; default: return tls.Alert.Description.bad_certificate; } }; /** * Maps a tls.Alert.Description to a pki.certificateError. * * @param desc the alert description. * * @return the certificate error. */ var _alertDescToCertError = function(desc) { switch(desc) { case true: return true; case tls.Alert.Description.bad_certificate: return forge.pki.certificateError.bad_certificate; case tls.Alert.Description.unsupported_certificate: return forge.pki.certificateError.unsupported_certificate; case tls.Alert.Description.certificate_revoked: return forge.pki.certificateError.certificate_revoked; case tls.Alert.Description.certificate_expired: return forge.pki.certificateError.certificate_expired; case tls.Alert.Description.certificate_unknown: return forge.pki.certificateError.certificate_unknown; case tls.Alert.Description.unknown_ca: return forge.pki.certificateError.unknown_ca; default: return forge.pki.certificateError.bad_certificate; } }; /** * Verifies a certificate chain against the given connection's * Certificate Authority store. * * @param c the TLS connection. * @param chain the certificate chain to verify, with the root or highest * authority at the end. * * @return true if successful, false if not. */ tls.verifyCertificateChain = function(c, chain) { try { // Make a copy of c.verifyOptions so that we can modify options.verify // without modifying c.verifyOptions. var options = {}; for (var key in c.verifyOptions) { options[key] = c.verifyOptions[key]; } options.verify = function(vfd, depth, chain) { // convert pki.certificateError to tls alert description var desc = _certErrorToAlertDesc(vfd); // call application callback var ret = c.verify(c, vfd, depth, chain); if(ret !== true) { if(typeof ret === 'object' && !forge.util.isArray(ret)) { // throw custom error var error = new Error('The application rejected the certificate.'); error.send = true; error.alert = { level: tls.Alert.Level.fatal, description: tls.Alert.Description.bad_certificate }; if(ret.message) { error.message = ret.message; } if(ret.alert) { error.alert.description = ret.alert; } throw error; } // convert tls alert description to pki.certificateError if(ret !== vfd) { ret = _alertDescToCertError(ret); } } return ret; }; // verify chain forge.pki.verifyCertificateChain(c.caStore, chain, options); } catch(ex) { // build tls error if not already customized var err = ex; if(typeof err !== 'object' || forge.util.isArray(err)) { err = { send: true, alert: { level: tls.Alert.Level.fatal, description: _certErrorToAlertDesc(ex) } }; } if(!('send' in err)) { err.send = true; } if(!('alert' in err)) { err.alert = { level: tls.Alert.Level.fatal, description: _certErrorToAlertDesc(err.error) }; } // send error c.error(c, err); } return !c.fail; }; /** * Creates a new TLS session cache. * * @param cache optional map of session ID to cached session. * @param capacity the maximum size for the cache (default: 100). * * @return the new TLS session cache. */ tls.createSessionCache = function(cache, capacity) { var rval = null; // assume input is already a session cache object if(cache && cache.getSession && cache.setSession && cache.order) { rval = cache; } else { // create cache rval = {}; rval.cache = cache || {}; rval.capacity = Math.max(capacity || 100, 1); rval.order = []; // store order for sessions, delete session overflow for(var key in cache) { if(rval.order.length <= capacity) { rval.order.push(key); } else { delete cache[key]; } } // get a session from a session ID (or get any session) rval.getSession = function(sessionId) { var session = null; var key = null; // if session ID provided, use it if(sessionId) { key = forge.util.bytesToHex(sessionId); } else if(rval.order.length > 0) { // get first session from cache key = rval.order[0]; } if(key !== null && key in rval.cache) { // get cached session and remove from cache session = rval.cache[key]; delete rval.cache[key]; for(var i in rval.order) { if(rval.order[i] === key) { rval.order.splice(i, 1); break; } } } return session; }; // set a session in the cache rval.setSession = function(sessionId, session) { // remove session from cache if at capacity if(rval.order.length === rval.capacity) { var key = rval.order.shift(); delete rval.cache[key]; } // add session to cache var key = forge.util.bytesToHex(sessionId); rval.order.push(key); rval.cache[key] = session; }; } return rval; }; /** * Creates a new TLS connection. * * See public createConnection() docs for more details. * * @param options the options for this connection. * * @return the new TLS connection. */ tls.createConnection = function(options) { var caStore = null; if(options.caStore) { // if CA store is an array, convert it to a CA store object if(forge.util.isArray(options.caStore)) { caStore = forge.pki.createCaStore(options.caStore); } else { caStore = options.caStore; } } else { // create empty CA store caStore = forge.pki.createCaStore(); } // setup default cipher suites var cipherSuites = options.cipherSuites || null; if(cipherSuites === null) { cipherSuites = []; for(var key in tls.CipherSuites) { cipherSuites.push(tls.CipherSuites[key]); } } // set default entity var entity = (options.server || false) ? tls.ConnectionEnd.server : tls.ConnectionEnd.client; // create session cache if requested var sessionCache = options.sessionCache ? tls.createSessionCache(options.sessionCache) : null; // create TLS connection var c = { version: {major: tls.Version.major, minor: tls.Version.minor}, entity: entity, sessionId: options.sessionId, caStore: caStore, sessionCache: sessionCache, cipherSuites: cipherSuites, connected: options.connected, virtualHost: options.virtualHost || null, verifyClient: options.verifyClient || false, verify: options.verify || function(cn, vfd, dpth, cts) {return vfd;}, verifyOptions: options.verifyOptions || {}, getCertificate: options.getCertificate || null, getPrivateKey: options.getPrivateKey || null, getSignature: options.getSignature || null, input: forge.util.createBuffer(), tlsData: forge.util.createBuffer(), data: forge.util.createBuffer(), tlsDataReady: options.tlsDataReady, dataReady: options.dataReady, heartbeatReceived: options.heartbeatReceived, closed: options.closed, error: function(c, ex) { // set origin if not set ex.origin = ex.origin || ((c.entity === tls.ConnectionEnd.client) ? 'client' : 'server'); // send TLS alert if(ex.send) { tls.queue(c, tls.createAlert(c, ex.alert)); tls.flush(c); } // error is fatal by default var fatal = (ex.fatal !== false); if(fatal) { // set fail flag c.fail = true; } // call error handler first options.error(c, ex); if(fatal) { // fatal error, close connection, do not clear fail c.close(false); } }, deflate: options.deflate || null, inflate: options.inflate || null }; /** * Resets a closed TLS connection for reuse. Called in c.close(). * * @param clearFail true to clear the fail flag (default: true). */ c.reset = function(clearFail) { c.version = {major: tls.Version.major, minor: tls.Version.minor}; c.record = null; c.session = null; c.peerCertificate = null; c.state = { pending: null, current: null }; c.expect = (c.entity === tls.ConnectionEnd.client) ? SHE : CHE; c.fragmented = null; c.records = []; c.open = false; c.handshakes = 0; c.handshaking = false; c.isConnected = false; c.fail = !(clearFail || typeof(clearFail) === 'undefined'); c.input.clear(); c.tlsData.clear(); c.data.clear(); c.state.current = tls.createConnectionState(c); }; // do initial reset of connection c.reset(); /** * Updates the current TLS engine state based on the given record. * * @param c the TLS connection. * @param record the TLS record to act on. */ var _update = function(c, record) { // get record handler (align type in table by subtracting lowest) var aligned = record.type - tls.ContentType.change_cipher_spec; var handlers = ctTable[c.entity][c.expect]; if(aligned in handlers) { handlers[aligned](c, record); } else { // unexpected record tls.handleUnexpected(c, record); } }; /** * Reads the record header and initializes the next record on the given * connection. * * @param c the TLS connection with the next record. * * @return 0 if the input data could be processed, otherwise the * number of bytes required for data to be processed. */ var _readRecordHeader = function(c) { var rval = 0; // get input buffer and its length var b = c.input; var len = b.length(); // need at least 5 bytes to initialize a record if(len < 5) { rval = 5 - len; } else { // enough bytes for header // initialize record c.record = { type: b.getByte(), version: { major: b.getByte(), minor: b.getByte() }, length: b.getInt16(), fragment: forge.util.createBuffer(), ready: false }; // check record version var compatibleVersion = (c.record.version.major === c.version.major); if(compatibleVersion && c.session && c.session.version) { // session version already set, require same minor version compatibleVersion = (c.record.version.minor === c.version.minor); } if(!compatibleVersion) { c.error(c, { message: 'Incompatible TLS version.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.protocol_version } }); } } return rval; }; /** * Reads the next record's contents and appends its message to any * previously fragmented message. * * @param c the TLS connection with the next record. * * @return 0 if the input data could be processed, otherwise the * number of bytes required for data to be processed. */ var _readRecord = function(c) { var rval = 0; // ensure there is enough input data to get the entire record var b = c.input; var len = b.length(); if(len < c.record.length) { // not enough data yet, return how much is required rval = c.record.length - len; } else { // there is enough data to parse the pending record // fill record fragment and compact input buffer c.record.fragment.putBytes(b.getBytes(c.record.length)); b.compact(); // update record using current read state var s = c.state.current.read; if(s.update(c, c.record)) { // see if there is a previously fragmented message that the // new record's message fragment should be appended to if(c.fragmented !== null) { // if the record type matches a previously fragmented // record, append the record fragment to it if(c.fragmented.type === c.record.type) { // concatenate record fragments c.fragmented.fragment.putBuffer(c.record.fragment); c.record = c.fragmented; } else { // error, invalid fragmented record c.error(c, { message: 'Invalid fragmented record.', send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.unexpected_message } }); } } // record is now ready c.record.ready = true; } } return rval; }; /** * Performs a handshake using the TLS Handshake Protocol, as a client. * * This method should only be called if the connection is in client mode. * * @param sessionId the session ID to use, null to start a new one. */ c.handshake = function(sessionId) { // error to call this in non-client mode if(c.entity !== tls.ConnectionEnd.client) { // not fatal error c.error(c, { message: 'Cannot initiate handshake as a server.', fatal: false }); } else if(c.handshaking) { // handshake is already in progress, fail but not fatal error c.error(c, { message: 'Handshake already in progress.', fatal: false }); } else { // clear fail flag on reuse if(c.fail && !c.open && c.handshakes === 0) { c.fail = false; } // now handshaking c.handshaking = true; // default to blank (new session) sessionId = sessionId || ''; // if a session ID was specified, try to find it in the cache var session = null; if(sessionId.length > 0) { if(c.sessionCache) { session = c.sessionCache.getSession(sessionId); } // matching session not found in cache, clear session ID if(session === null) { sessionId = ''; } } // no session given, grab a session from the cache, if available if(sessionId.length === 0 && c.sessionCache) { session = c.sessionCache.getSession(); if(session !== null) { sessionId = session.id; } } // set up session c.session = { id: sessionId, version: null, cipherSuite: null, compressionMethod: null, serverCertificate: null, certificateRequest: null, clientCertificate: null, sp: {}, md5: forge.md.md5.create(), sha1: forge.md.sha1.create() }; // use existing session information if(session) { // only update version on connection, session version not yet set c.version = session.version; c.session.sp = session.sp; } // generate new client random c.session.sp.client_random = tls.createRandom().getBytes(); // connection now open c.open = true; // send hello tls.queue(c, tls.createRecord(c, { type: tls.ContentType.handshake, data: tls.createClientHello(c) })); tls.flush(c); } }; /** * Called when TLS protocol data has been received from somewhere and should * be processed by the TLS engine. * * @param data the TLS protocol data, as a string, to process. * * @return 0 if the data could be processed, otherwise the number of bytes * required for data to be processed. */ c.process = function(data) { var rval = 0; // buffer input data if(data) { c.input.putBytes(data); } // process next record if no failure, process will be called after // each record is handled (since handling can be asynchronous) if(!c.fail) { // reset record if ready and now empty if(c.record !== null && c.record.ready && c.record.fragment.isEmpty()) { c.record = null; } // if there is no pending record, try to read record header if(c.record === null) { rval = _readRecordHeader(c); } // read the next record (if record not yet ready) if(!c.fail && c.record !== null && !c.record.ready) { rval = _readRecord(c); } // record ready to be handled, update engine state if(!c.fail && c.record !== null && c.record.ready) { _update(c, c.record); } } return rval; }; /** * Requests that application data be packaged into a TLS record. The * tlsDataReady handler will be called when the TLS record(s) have been * prepared. * * @param data the application data, as a raw 'binary' encoded string, to * be sent; to send utf-16/utf-8 string data, use the return value * of util.encodeUtf8(str). * * @return true on success, false on failure. */ c.prepare = function(data) { tls.queue(c, tls.createRecord(c, { type: tls.ContentType.application_data, data: forge.util.createBuffer(data) })); return tls.flush(c); }; /** * Requests that a heartbeat request be packaged into a TLS record for * transmission. The tlsDataReady handler will be called when TLS record(s) * have been prepared. * * When a heartbeat response has been received, the heartbeatReceived * handler will be called with the matching payload. This handler can * be used to clear a retransmission timer, etc. * * @param payload the heartbeat data to send as the payload in the message. * @param [payloadLength] the payload length to use, defaults to the * actual payload length. * * @return true on success, false on failure. */ c.prepareHeartbeatRequest = function(payload, payloadLength) { if(payload instanceof forge.util.ByteBuffer) { payload = payload.bytes(); } if(typeof payloadLength === 'undefined') { payloadLength = payload.length; } c.expectedHeartbeatPayload = payload; tls.queue(c, tls.createRecord(c, { type: tls.ContentType.heartbeat, data: tls.createHeartbeat( tls.HeartbeatMessageType.heartbeat_request, payload, payloadLength) })); return tls.flush(c); }; /** * Closes the connection (sends a close_notify alert). * * @param clearFail true to clear the fail flag (default: true). */ c.close = function(clearFail) { // save session if connection didn't fail if(!c.fail && c.sessionCache && c.session) { // only need to preserve session ID, version, and security params var session = { id: c.session.id, version: c.session.version, sp: c.session.sp }; session.sp.keys = null; c.sessionCache.setSession(session.id, session); } if(c.open) { // connection no longer open, clear input c.open = false; c.input.clear(); // if connected or handshaking, send an alert if(c.isConnected || c.handshaking) { c.isConnected = c.handshaking = false; // send close_notify alert tls.queue(c, tls.createAlert(c, { level: tls.Alert.Level.warning, description: tls.Alert.Description.close_notify })); tls.flush(c); } // call handler c.closed(c); } // reset TLS connection, do not clear fail flag c.reset(clearFail); }; return c; }; /* TLS API */ module.exports = forge.tls = forge.tls || {}; // expose non-functions for(var key in tls) { if(typeof tls[key] !== 'function') { forge.tls[key] = tls[key]; } } // expose prf_tls1 for testing forge.tls.prf_tls1 = prf_TLS1; // expose sha1 hmac method forge.tls.hmac_sha1 = hmac_sha1; // expose session cache creation forge.tls.createSessionCache = tls.createSessionCache; /** * Creates a new TLS connection. This does not make any assumptions about the * transport layer that TLS is working on top of, ie: it does not assume there * is a TCP/IP connection or establish one. A TLS connection is totally * abstracted away from the layer is runs on top of, it merely establishes a * secure channel between a client" and a "server". * * A TLS connection contains 4 connection states: pending read and write, and * current read and write. * * At initialization, the current read and write states will be null. Only once * the security parameters have been set and the keys have been generated can * the pending states be converted into current states. Current states will be * updated for each record processed. * * A custom certificate verify callback may be provided to check information * like the common name on the server's certificate. It will be called for * every certificate in the chain. It has the following signature: * * variable func(c, certs, index, preVerify) * Where: * c The TLS connection * verified Set to true if certificate was verified, otherwise the alert * tls.Alert.Description for why the certificate failed. * depth The current index in the chain, where 0 is the server's cert. * certs The certificate chain, *NOTE* if the server was anonymous then * the chain will be empty. * * The function returns true on success and on failure either the appropriate * tls.Alert.Description or an object with 'alert' set to the appropriate * tls.Alert.Description and 'message' set to a custom error message. If true * is not returned then the connection will abort using, in order of * availability, first the returned alert description, second the preVerify * alert description, and lastly the default 'bad_certificate'. * * There are three callbacks that can be used to make use of client-side * certificates where each takes the TLS connection as the first parameter: * * getCertificate(conn, hint) * The second parameter is a hint as to which certificate should be * returned. If the connection entity is a client, then the hint will be * the CertificateRequest message from the server that is part of the * TLS protocol. If the connection entity is a server, then it will be * the servername list provided via an SNI extension the ClientHello, if * one was provided (empty array if not). The hint can be examined to * determine which certificate to use (advanced). Most implementations * will just return a certificate. The return value must be a * PEM-formatted certificate or an array of PEM-formatted certificates * that constitute a certificate chain, with the first in the array/chain * being the client's certificate. * getPrivateKey(conn, certificate) * The second parameter is an forge.pki X.509 certificate object that * is associated with the requested private key. The return value must * be a PEM-formatted private key. * getSignature(conn, bytes, callback) * This callback can be used instead of getPrivateKey if the private key * is not directly accessible in javascript or should not be. For * instance, a secure external web service could provide the signature * in exchange for appropriate credentials. The second parameter is a * string of bytes to be signed that are part of the TLS protocol. These * bytes are used to verify that the private key for the previously * provided client-side certificate is accessible to the client. The * callback is a function that takes 2 parameters, the TLS connection * and the RSA encrypted (signed) bytes as a string. This callback must * be called once the signature is ready. * * @param options the options for this connection: * server: true if the connection is server-side, false for client. * sessionId: a session ID to reuse, null for a new connection. * caStore: an array of certificates to trust. * sessionCache: a session cache to use. * cipherSuites: an optional array of cipher suites to use, * see tls.CipherSuites. * connected: function(conn) called when the first handshake completes. * virtualHost: the virtual server name to use in a TLS SNI extension. * verifyClient: true to require a client certificate in server mode, * 'optional' to request one, false not to (default: false). * verify: a handler used to custom verify certificates in the chain. * verifyOptions: an object with options for the certificate chain validation. * See documentation of pki.verifyCertificateChain for possible options. * verifyOptions.verify is ignored. If you wish to specify a verify handler * use the verify key. * getCertificate: an optional callback used to get a certificate or * a chain of certificates (as an array). * getPrivateKey: an optional callback used to get a private key. * getSignature: an optional callback used to get a signature. * tlsDataReady: function(conn) called when TLS protocol data has been * prepared and is ready to be used (typically sent over a socket * connection to its destination), read from conn.tlsData buffer. * dataReady: function(conn) called when application data has * been parsed from a TLS record and should be consumed by the * application, read from conn.data buffer. * closed: function(conn) called when the connection has been closed. * error: function(conn, error) called when there was an error. * deflate: function(inBytes) if provided, will deflate TLS records using * the deflate algorithm if the server supports it. * inflate: function(inBytes) if provided, will inflate TLS records using * the deflate algorithm if the server supports it. * * @return the new TLS connection. */ forge.tls.createConnection = tls.createConnection; /***/ }), /***/ 28339: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Utility functions for web applications. * * @author Dave Longley * * Copyright (c) 2010-2018 Digital Bazaar, Inc. */ var forge = __webpack_require__(89177); var baseN = __webpack_require__(72300); /* Utilities API */ var util = module.exports = forge.util = forge.util || {}; // define setImmediate and nextTick (function() { // use native nextTick (unless we're in webpack) // webpack (or better node-libs-browser polyfill) sets process.browser. // this way we can detect webpack properly if(typeof process !== 'undefined' && process.nextTick && !process.browser) { util.nextTick = process.nextTick; if(typeof setImmediate === 'function') { util.setImmediate = setImmediate; } else { // polyfill setImmediate with nextTick, older versions of node // (those w/o setImmediate) won't totally starve IO util.setImmediate = util.nextTick; } return; } // polyfill nextTick with native setImmediate if(typeof setImmediate === 'function') { util.setImmediate = function() { return setImmediate.apply(undefined, arguments); }; util.nextTick = function(callback) { return setImmediate(callback); }; return; } /* Note: A polyfill upgrade pattern is used here to allow combining polyfills. For example, MutationObserver is fast, but blocks UI updates, so it needs to allow UI updates periodically, so it falls back on postMessage or setTimeout. */ // polyfill with setTimeout util.setImmediate = function(callback) { setTimeout(callback, 0); }; // upgrade polyfill to use postMessage if(typeof window !== 'undefined' && typeof window.postMessage === 'function') { var msg = 'forge.setImmediate'; var callbacks = []; util.setImmediate = function(callback) { callbacks.push(callback); // only send message when one hasn't been sent in // the current turn of the event loop if(callbacks.length === 1) { window.postMessage(msg, '*'); } }; function handler(event) { if(event.source === window && event.data === msg) { event.stopPropagation(); var copy = callbacks.slice(); callbacks.length = 0; copy.forEach(function(callback) { callback(); }); } } window.addEventListener('message', handler, true); } // upgrade polyfill to use MutationObserver if(typeof MutationObserver !== 'undefined') { // polyfill with MutationObserver var now = Date.now(); var attr = true; var div = document.createElement('div'); var callbacks = []; new MutationObserver(function() { var copy = callbacks.slice(); callbacks.length = 0; copy.forEach(function(callback) { callback(); }); }).observe(div, {attributes: true}); var oldSetImmediate = util.setImmediate; util.setImmediate = function(callback) { if(Date.now() - now > 15) { now = Date.now(); oldSetImmediate(callback); } else { callbacks.push(callback); // only trigger observer when it hasn't been triggered in // the current turn of the event loop if(callbacks.length === 1) { div.setAttribute('a', attr = !attr); } } }; } util.nextTick = util.setImmediate; })(); // check if running under Node.js util.isNodejs = typeof process !== 'undefined' && process.versions && process.versions.node; // 'self' will also work in Web Workers (instance of WorkerGlobalScope) while // it will point to `window` in the main thread. // To remain compatible with older browsers, we fall back to 'window' if 'self' // is not available. util.globalScope = (function() { if(util.isNodejs) { return global; } return typeof self === 'undefined' ? window : self; })(); // define isArray util.isArray = Array.isArray || function(x) { return Object.prototype.toString.call(x) === '[object Array]'; }; // define isArrayBuffer util.isArrayBuffer = function(x) { return typeof ArrayBuffer !== 'undefined' && x instanceof ArrayBuffer; }; // define isArrayBufferView util.isArrayBufferView = function(x) { return x && util.isArrayBuffer(x.buffer) && x.byteLength !== undefined; }; /** * Ensure a bits param is 8, 16, 24, or 32. Used to validate input for * algorithms where bit manipulation, JavaScript limitations, and/or algorithm * design only allow for byte operations of a limited size. * * @param n number of bits. * * Throw Error if n invalid. */ function _checkBitsParam(n) { if(!(n === 8 || n === 16 || n === 24 || n === 32)) { throw new Error('Only 8, 16, 24, or 32 bits supported: ' + n); } } // TODO: set ByteBuffer to best available backing util.ByteBuffer = ByteStringBuffer; /** Buffer w/BinaryString backing */ /** * Constructor for a binary string backed byte buffer. * * @param [b] the bytes to wrap (either encoded as string, one byte per * character, or as an ArrayBuffer or Typed Array). */ function ByteStringBuffer(b) { // TODO: update to match DataBuffer API // the data in this buffer this.data = ''; // the pointer for reading from this buffer this.read = 0; if(typeof b === 'string') { this.data = b; } else if(util.isArrayBuffer(b) || util.isArrayBufferView(b)) { if(typeof Buffer !== 'undefined' && b instanceof Buffer) { this.data = b.toString('binary'); } else { // convert native buffer to forge buffer // FIXME: support native buffers internally instead var arr = new Uint8Array(b); try { this.data = String.fromCharCode.apply(null, arr); } catch(e) { for(var i = 0; i < arr.length; ++i) { this.putByte(arr[i]); } } } } else if(b instanceof ByteStringBuffer || (typeof b === 'object' && typeof b.data === 'string' && typeof b.read === 'number')) { // copy existing buffer this.data = b.data; this.read = b.read; } // used for v8 optimization this._constructedStringLength = 0; } util.ByteStringBuffer = ByteStringBuffer; /* Note: This is an optimization for V8-based browsers. When V8 concatenates a string, the strings are only joined logically using a "cons string" or "constructed/concatenated string". These containers keep references to one another and can result in very large memory usage. For example, if a 2MB string is constructed by concatenating 4 bytes together at a time, the memory usage will be ~44MB; so ~22x increase. The strings are only joined together when an operation requiring their joining takes place, such as substr(). This function is called when adding data to this buffer to ensure these types of strings are periodically joined to reduce the memory footprint. */ var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; util.ByteStringBuffer.prototype._optimizeConstructedString = function(x) { this._constructedStringLength += x; if(this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { // this substr() should cause the constructed string to join this.data.substr(0, 1); this._constructedStringLength = 0; } }; /** * Gets the number of bytes in this buffer. * * @return the number of bytes in this buffer. */ util.ByteStringBuffer.prototype.length = function() { return this.data.length - this.read; }; /** * Gets whether or not this buffer is empty. * * @return true if this buffer is empty, false if not. */ util.ByteStringBuffer.prototype.isEmpty = function() { return this.length() <= 0; }; /** * Puts a byte in this buffer. * * @param b the byte to put. * * @return this buffer. */ util.ByteStringBuffer.prototype.putByte = function(b) { return this.putBytes(String.fromCharCode(b)); }; /** * Puts a byte in this buffer N times. * * @param b the byte to put. * @param n the number of bytes of value b to put. * * @return this buffer. */ util.ByteStringBuffer.prototype.fillWithByte = function(b, n) { b = String.fromCharCode(b); var d = this.data; while(n > 0) { if(n & 1) { d += b; } n >>>= 1; if(n > 0) { b += b; } } this.data = d; this._optimizeConstructedString(n); return this; }; /** * Puts bytes in this buffer. * * @param bytes the bytes (as a binary encoded string) to put. * * @return this buffer. */ util.ByteStringBuffer.prototype.putBytes = function(bytes) { this.data += bytes; this._optimizeConstructedString(bytes.length); return this; }; /** * Puts a UTF-16 encoded string into this buffer. * * @param str the string to put. * * @return this buffer. */ util.ByteStringBuffer.prototype.putString = function(str) { return this.putBytes(util.encodeUtf8(str)); }; /** * Puts a 16-bit integer in this buffer in big-endian order. * * @param i the 16-bit integer. * * @return this buffer. */ util.ByteStringBuffer.prototype.putInt16 = function(i) { return this.putBytes( String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i & 0xFF)); }; /** * Puts a 24-bit integer in this buffer in big-endian order. * * @param i the 24-bit integer. * * @return this buffer. */ util.ByteStringBuffer.prototype.putInt24 = function(i) { return this.putBytes( String.fromCharCode(i >> 16 & 0xFF) + String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i & 0xFF)); }; /** * Puts a 32-bit integer in this buffer in big-endian order. * * @param i the 32-bit integer. * * @return this buffer. */ util.ByteStringBuffer.prototype.putInt32 = function(i) { return this.putBytes( String.fromCharCode(i >> 24 & 0xFF) + String.fromCharCode(i >> 16 & 0xFF) + String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i & 0xFF)); }; /** * Puts a 16-bit integer in this buffer in little-endian order. * * @param i the 16-bit integer. * * @return this buffer. */ util.ByteStringBuffer.prototype.putInt16Le = function(i) { return this.putBytes( String.fromCharCode(i & 0xFF) + String.fromCharCode(i >> 8 & 0xFF)); }; /** * Puts a 24-bit integer in this buffer in little-endian order. * * @param i the 24-bit integer. * * @return this buffer. */ util.ByteStringBuffer.prototype.putInt24Le = function(i) { return this.putBytes( String.fromCharCode(i & 0xFF) + String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i >> 16 & 0xFF)); }; /** * Puts a 32-bit integer in this buffer in little-endian order. * * @param i the 32-bit integer. * * @return this buffer. */ util.ByteStringBuffer.prototype.putInt32Le = function(i) { return this.putBytes( String.fromCharCode(i & 0xFF) + String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i >> 16 & 0xFF) + String.fromCharCode(i >> 24 & 0xFF)); }; /** * Puts an n-bit integer in this buffer in big-endian order. * * @param i the n-bit integer. * @param n the number of bits in the integer (8, 16, 24, or 32). * * @return this buffer. */ util.ByteStringBuffer.prototype.putInt = function(i, n) { _checkBitsParam(n); var bytes = ''; do { n -= 8; bytes += String.fromCharCode((i >> n) & 0xFF); } while(n > 0); return this.putBytes(bytes); }; /** * Puts a signed n-bit integer in this buffer in big-endian order. Two's * complement representation is used. * * @param i the n-bit integer. * @param n the number of bits in the integer (8, 16, 24, or 32). * * @return this buffer. */ util.ByteStringBuffer.prototype.putSignedInt = function(i, n) { // putInt checks n if(i < 0) { i += 2 << (n - 1); } return this.putInt(i, n); }; /** * Puts the given buffer into this buffer. * * @param buffer the buffer to put into this one. * * @return this buffer. */ util.ByteStringBuffer.prototype.putBuffer = function(buffer) { return this.putBytes(buffer.getBytes()); }; /** * Gets a byte from this buffer and advances the read pointer by 1. * * @return the byte. */ util.ByteStringBuffer.prototype.getByte = function() { return this.data.charCodeAt(this.read++); }; /** * Gets a uint16 from this buffer in big-endian order and advances the read * pointer by 2. * * @return the uint16. */ util.ByteStringBuffer.prototype.getInt16 = function() { var rval = ( this.data.charCodeAt(this.read) << 8 ^ this.data.charCodeAt(this.read + 1)); this.read += 2; return rval; }; /** * Gets a uint24 from this buffer in big-endian order and advances the read * pointer by 3. * * @return the uint24. */ util.ByteStringBuffer.prototype.getInt24 = function() { var rval = ( this.data.charCodeAt(this.read) << 16 ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2)); this.read += 3; return rval; }; /** * Gets a uint32 from this buffer in big-endian order and advances the read * pointer by 4. * * @return the word. */ util.ByteStringBuffer.prototype.getInt32 = function() { var rval = ( this.data.charCodeAt(this.read) << 24 ^ this.data.charCodeAt(this.read + 1) << 16 ^ this.data.charCodeAt(this.read + 2) << 8 ^ this.data.charCodeAt(this.read + 3)); this.read += 4; return rval; }; /** * Gets a uint16 from this buffer in little-endian order and advances the read * pointer by 2. * * @return the uint16. */ util.ByteStringBuffer.prototype.getInt16Le = function() { var rval = ( this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8); this.read += 2; return rval; }; /** * Gets a uint24 from this buffer in little-endian order and advances the read * pointer by 3. * * @return the uint24. */ util.ByteStringBuffer.prototype.getInt24Le = function() { var rval = ( this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16); this.read += 3; return rval; }; /** * Gets a uint32 from this buffer in little-endian order and advances the read * pointer by 4. * * @return the word. */ util.ByteStringBuffer.prototype.getInt32Le = function() { var rval = ( this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16 ^ this.data.charCodeAt(this.read + 3) << 24); this.read += 4; return rval; }; /** * Gets an n-bit integer from this buffer in big-endian order and advances the * read pointer by ceil(n/8). * * @param n the number of bits in the integer (8, 16, 24, or 32). * * @return the integer. */ util.ByteStringBuffer.prototype.getInt = function(n) { _checkBitsParam(n); var rval = 0; do { // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. rval = (rval << 8) + this.data.charCodeAt(this.read++); n -= 8; } while(n > 0); return rval; }; /** * Gets a signed n-bit integer from this buffer in big-endian order, using * two's complement, and advances the read pointer by n/8. * * @param n the number of bits in the integer (8, 16, 24, or 32). * * @return the integer. */ util.ByteStringBuffer.prototype.getSignedInt = function(n) { // getInt checks n var x = this.getInt(n); var max = 2 << (n - 2); if(x >= max) { x -= max << 1; } return x; }; /** * Reads bytes out as a binary encoded string and clears them from the * buffer. Note that the resulting string is binary encoded (in node.js this * encoding is referred to as `binary`, it is *not* `utf8`). * * @param count the number of bytes to read, undefined or null for all. * * @return a binary encoded string of bytes. */ util.ByteStringBuffer.prototype.getBytes = function(count) { var rval; if(count) { // read count bytes count = Math.min(this.length(), count); rval = this.data.slice(this.read, this.read + count); this.read += count; } else if(count === 0) { rval = ''; } else { // read all bytes, optimize to only copy when needed rval = (this.read === 0) ? this.data : this.data.slice(this.read); this.clear(); } return rval; }; /** * Gets a binary encoded string of the bytes from this buffer without * modifying the read pointer. * * @param count the number of bytes to get, omit to get all. * * @return a string full of binary encoded characters. */ util.ByteStringBuffer.prototype.bytes = function(count) { return (typeof(count) === 'undefined' ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count)); }; /** * Gets a byte at the given index without modifying the read pointer. * * @param i the byte index. * * @return the byte. */ util.ByteStringBuffer.prototype.at = function(i) { return this.data.charCodeAt(this.read + i); }; /** * Puts a byte at the given index without modifying the read pointer. * * @param i the byte index. * @param b the byte to put. * * @return this buffer. */ util.ByteStringBuffer.prototype.setAt = function(i, b) { this.data = this.data.substr(0, this.read + i) + String.fromCharCode(b) + this.data.substr(this.read + i + 1); return this; }; /** * Gets the last byte without modifying the read pointer. * * @return the last byte. */ util.ByteStringBuffer.prototype.last = function() { return this.data.charCodeAt(this.data.length - 1); }; /** * Creates a copy of this buffer. * * @return the copy. */ util.ByteStringBuffer.prototype.copy = function() { var c = util.createBuffer(this.data); c.read = this.read; return c; }; /** * Compacts this buffer. * * @return this buffer. */ util.ByteStringBuffer.prototype.compact = function() { if(this.read > 0) { this.data = this.data.slice(this.read); this.read = 0; } return this; }; /** * Clears this buffer. * * @return this buffer. */ util.ByteStringBuffer.prototype.clear = function() { this.data = ''; this.read = 0; return this; }; /** * Shortens this buffer by triming bytes off of the end of this buffer. * * @param count the number of bytes to trim off. * * @return this buffer. */ util.ByteStringBuffer.prototype.truncate = function(count) { var len = Math.max(0, this.length() - count); this.data = this.data.substr(this.read, len); this.read = 0; return this; }; /** * Converts this buffer to a hexadecimal string. * * @return a hexadecimal string. */ util.ByteStringBuffer.prototype.toHex = function() { var rval = ''; for(var i = this.read; i < this.data.length; ++i) { var b = this.data.charCodeAt(i); if(b < 16) { rval += '0'; } rval += b.toString(16); } return rval; }; /** * Converts this buffer to a UTF-16 string (standard JavaScript string). * * @return a UTF-16 string. */ util.ByteStringBuffer.prototype.toString = function() { return util.decodeUtf8(this.bytes()); }; /** End Buffer w/BinaryString backing */ /** Buffer w/UInt8Array backing */ /** * FIXME: Experimental. Do not use yet. * * Constructor for an ArrayBuffer-backed byte buffer. * * The buffer may be constructed from a string, an ArrayBuffer, DataView, or a * TypedArray. * * If a string is given, its encoding should be provided as an option, * otherwise it will default to 'binary'. A 'binary' string is encoded such * that each character is one byte in length and size. * * If an ArrayBuffer, DataView, or TypedArray is given, it will be used * *directly* without any copying. Note that, if a write to the buffer requires * more space, the buffer will allocate a new backing ArrayBuffer to * accommodate. The starting read and write offsets for the buffer may be * given as options. * * @param [b] the initial bytes for this buffer. * @param options the options to use: * [readOffset] the starting read offset to use (default: 0). * [writeOffset] the starting write offset to use (default: the * length of the first parameter). * [growSize] the minimum amount, in bytes, to grow the buffer by to * accommodate writes (default: 1024). * [encoding] the encoding ('binary', 'utf8', 'utf16', 'hex') for the * first parameter, if it is a string (default: 'binary'). */ function DataBuffer(b, options) { // default options options = options || {}; // pointers for read from/write to buffer this.read = options.readOffset || 0; this.growSize = options.growSize || 1024; var isArrayBuffer = util.isArrayBuffer(b); var isArrayBufferView = util.isArrayBufferView(b); if(isArrayBuffer || isArrayBufferView) { // use ArrayBuffer directly if(isArrayBuffer) { this.data = new DataView(b); } else { // TODO: adjust read/write offset based on the type of view // or specify that this must be done in the options ... that the // offsets are byte-based this.data = new DataView(b.buffer, b.byteOffset, b.byteLength); } this.write = ('writeOffset' in options ? options.writeOffset : this.data.byteLength); return; } // initialize to empty array buffer and add any given bytes using putBytes this.data = new DataView(new ArrayBuffer(0)); this.write = 0; if(b !== null && b !== undefined) { this.putBytes(b); } if('writeOffset' in options) { this.write = options.writeOffset; } } util.DataBuffer = DataBuffer; /** * Gets the number of bytes in this buffer. * * @return the number of bytes in this buffer. */ util.DataBuffer.prototype.length = function() { return this.write - this.read; }; /** * Gets whether or not this buffer is empty. * * @return true if this buffer is empty, false if not. */ util.DataBuffer.prototype.isEmpty = function() { return this.length() <= 0; }; /** * Ensures this buffer has enough empty space to accommodate the given number * of bytes. An optional parameter may be given that indicates a minimum * amount to grow the buffer if necessary. If the parameter is not given, * the buffer will be grown by some previously-specified default amount * or heuristic. * * @param amount the number of bytes to accommodate. * @param [growSize] the minimum amount, in bytes, to grow the buffer by if * necessary. */ util.DataBuffer.prototype.accommodate = function(amount, growSize) { if(this.length() >= amount) { return this; } growSize = Math.max(growSize || this.growSize, amount); // grow buffer var src = new Uint8Array( this.data.buffer, this.data.byteOffset, this.data.byteLength); var dst = new Uint8Array(this.length() + growSize); dst.set(src); this.data = new DataView(dst.buffer); return this; }; /** * Puts a byte in this buffer. * * @param b the byte to put. * * @return this buffer. */ util.DataBuffer.prototype.putByte = function(b) { this.accommodate(1); this.data.setUint8(this.write++, b); return this; }; /** * Puts a byte in this buffer N times. * * @param b the byte to put. * @param n the number of bytes of value b to put. * * @return this buffer. */ util.DataBuffer.prototype.fillWithByte = function(b, n) { this.accommodate(n); for(var i = 0; i < n; ++i) { this.data.setUint8(b); } return this; }; /** * Puts bytes in this buffer. The bytes may be given as a string, an * ArrayBuffer, a DataView, or a TypedArray. * * @param bytes the bytes to put. * @param [encoding] the encoding for the first parameter ('binary', 'utf8', * 'utf16', 'hex'), if it is a string (default: 'binary'). * * @return this buffer. */ util.DataBuffer.prototype.putBytes = function(bytes, encoding) { if(util.isArrayBufferView(bytes)) { var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); var len = src.byteLength - src.byteOffset; this.accommodate(len); var dst = new Uint8Array(this.data.buffer, this.write); dst.set(src); this.write += len; return this; } if(util.isArrayBuffer(bytes)) { var src = new Uint8Array(bytes); this.accommodate(src.byteLength); var dst = new Uint8Array(this.data.buffer); dst.set(src, this.write); this.write += src.byteLength; return this; } // bytes is a util.DataBuffer or equivalent if(bytes instanceof util.DataBuffer || (typeof bytes === 'object' && typeof bytes.read === 'number' && typeof bytes.write === 'number' && util.isArrayBufferView(bytes.data))) { var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length()); this.accommodate(src.byteLength); var dst = new Uint8Array(bytes.data.byteLength, this.write); dst.set(src); this.write += src.byteLength; return this; } if(bytes instanceof util.ByteStringBuffer) { // copy binary string and process as the same as a string parameter below bytes = bytes.data; encoding = 'binary'; } // string conversion encoding = encoding || 'binary'; if(typeof bytes === 'string') { var view; // decode from string if(encoding === 'hex') { this.accommodate(Math.ceil(bytes.length / 2)); view = new Uint8Array(this.data.buffer, this.write); this.write += util.binary.hex.decode(bytes, view, this.write); return this; } if(encoding === 'base64') { this.accommodate(Math.ceil(bytes.length / 4) * 3); view = new Uint8Array(this.data.buffer, this.write); this.write += util.binary.base64.decode(bytes, view, this.write); return this; } // encode text as UTF-8 bytes if(encoding === 'utf8') { // encode as UTF-8 then decode string as raw binary bytes = util.encodeUtf8(bytes); encoding = 'binary'; } // decode string as raw binary if(encoding === 'binary' || encoding === 'raw') { // one byte per character this.accommodate(bytes.length); view = new Uint8Array(this.data.buffer, this.write); this.write += util.binary.raw.decode(view); return this; } // encode text as UTF-16 bytes if(encoding === 'utf16') { // two bytes per character this.accommodate(bytes.length * 2); view = new Uint16Array(this.data.buffer, this.write); this.write += util.text.utf16.encode(view); return this; } throw new Error('Invalid encoding: ' + encoding); } throw Error('Invalid parameter: ' + bytes); }; /** * Puts the given buffer into this buffer. * * @param buffer the buffer to put into this one. * * @return this buffer. */ util.DataBuffer.prototype.putBuffer = function(buffer) { this.putBytes(buffer); buffer.clear(); return this; }; /** * Puts a string into this buffer. * * @param str the string to put. * @param [encoding] the encoding for the string (default: 'utf16'). * * @return this buffer. */ util.DataBuffer.prototype.putString = function(str) { return this.putBytes(str, 'utf16'); }; /** * Puts a 16-bit integer in this buffer in big-endian order. * * @param i the 16-bit integer. * * @return this buffer. */ util.DataBuffer.prototype.putInt16 = function(i) { this.accommodate(2); this.data.setInt16(this.write, i); this.write += 2; return this; }; /** * Puts a 24-bit integer in this buffer in big-endian order. * * @param i the 24-bit integer. * * @return this buffer. */ util.DataBuffer.prototype.putInt24 = function(i) { this.accommodate(3); this.data.setInt16(this.write, i >> 8 & 0xFFFF); this.data.setInt8(this.write, i >> 16 & 0xFF); this.write += 3; return this; }; /** * Puts a 32-bit integer in this buffer in big-endian order. * * @param i the 32-bit integer. * * @return this buffer. */ util.DataBuffer.prototype.putInt32 = function(i) { this.accommodate(4); this.data.setInt32(this.write, i); this.write += 4; return this; }; /** * Puts a 16-bit integer in this buffer in little-endian order. * * @param i the 16-bit integer. * * @return this buffer. */ util.DataBuffer.prototype.putInt16Le = function(i) { this.accommodate(2); this.data.setInt16(this.write, i, true); this.write += 2; return this; }; /** * Puts a 24-bit integer in this buffer in little-endian order. * * @param i the 24-bit integer. * * @return this buffer. */ util.DataBuffer.prototype.putInt24Le = function(i) { this.accommodate(3); this.data.setInt8(this.write, i >> 16 & 0xFF); this.data.setInt16(this.write, i >> 8 & 0xFFFF, true); this.write += 3; return this; }; /** * Puts a 32-bit integer in this buffer in little-endian order. * * @param i the 32-bit integer. * * @return this buffer. */ util.DataBuffer.prototype.putInt32Le = function(i) { this.accommodate(4); this.data.setInt32(this.write, i, true); this.write += 4; return this; }; /** * Puts an n-bit integer in this buffer in big-endian order. * * @param i the n-bit integer. * @param n the number of bits in the integer (8, 16, 24, or 32). * * @return this buffer. */ util.DataBuffer.prototype.putInt = function(i, n) { _checkBitsParam(n); this.accommodate(n / 8); do { n -= 8; this.data.setInt8(this.write++, (i >> n) & 0xFF); } while(n > 0); return this; }; /** * Puts a signed n-bit integer in this buffer in big-endian order. Two's * complement representation is used. * * @param i the n-bit integer. * @param n the number of bits in the integer. * * @return this buffer. */ util.DataBuffer.prototype.putSignedInt = function(i, n) { _checkBitsParam(n); this.accommodate(n / 8); if(i < 0) { i += 2 << (n - 1); } return this.putInt(i, n); }; /** * Gets a byte from this buffer and advances the read pointer by 1. * * @return the byte. */ util.DataBuffer.prototype.getByte = function() { return this.data.getInt8(this.read++); }; /** * Gets a uint16 from this buffer in big-endian order and advances the read * pointer by 2. * * @return the uint16. */ util.DataBuffer.prototype.getInt16 = function() { var rval = this.data.getInt16(this.read); this.read += 2; return rval; }; /** * Gets a uint24 from this buffer in big-endian order and advances the read * pointer by 3. * * @return the uint24. */ util.DataBuffer.prototype.getInt24 = function() { var rval = ( this.data.getInt16(this.read) << 8 ^ this.data.getInt8(this.read + 2)); this.read += 3; return rval; }; /** * Gets a uint32 from this buffer in big-endian order and advances the read * pointer by 4. * * @return the word. */ util.DataBuffer.prototype.getInt32 = function() { var rval = this.data.getInt32(this.read); this.read += 4; return rval; }; /** * Gets a uint16 from this buffer in little-endian order and advances the read * pointer by 2. * * @return the uint16. */ util.DataBuffer.prototype.getInt16Le = function() { var rval = this.data.getInt16(this.read, true); this.read += 2; return rval; }; /** * Gets a uint24 from this buffer in little-endian order and advances the read * pointer by 3. * * @return the uint24. */ util.DataBuffer.prototype.getInt24Le = function() { var rval = ( this.data.getInt8(this.read) ^ this.data.getInt16(this.read + 1, true) << 8); this.read += 3; return rval; }; /** * Gets a uint32 from this buffer in little-endian order and advances the read * pointer by 4. * * @return the word. */ util.DataBuffer.prototype.getInt32Le = function() { var rval = this.data.getInt32(this.read, true); this.read += 4; return rval; }; /** * Gets an n-bit integer from this buffer in big-endian order and advances the * read pointer by n/8. * * @param n the number of bits in the integer (8, 16, 24, or 32). * * @return the integer. */ util.DataBuffer.prototype.getInt = function(n) { _checkBitsParam(n); var rval = 0; do { // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. rval = (rval << 8) + this.data.getInt8(this.read++); n -= 8; } while(n > 0); return rval; }; /** * Gets a signed n-bit integer from this buffer in big-endian order, using * two's complement, and advances the read pointer by n/8. * * @param n the number of bits in the integer (8, 16, 24, or 32). * * @return the integer. */ util.DataBuffer.prototype.getSignedInt = function(n) { // getInt checks n var x = this.getInt(n); var max = 2 << (n - 2); if(x >= max) { x -= max << 1; } return x; }; /** * Reads bytes out as a binary encoded string and clears them from the * buffer. * * @param count the number of bytes to read, undefined or null for all. * * @return a binary encoded string of bytes. */ util.DataBuffer.prototype.getBytes = function(count) { // TODO: deprecate this method, it is poorly named and // this.toString('binary') replaces it // add a toTypedArray()/toArrayBuffer() function var rval; if(count) { // read count bytes count = Math.min(this.length(), count); rval = this.data.slice(this.read, this.read + count); this.read += count; } else if(count === 0) { rval = ''; } else { // read all bytes, optimize to only copy when needed rval = (this.read === 0) ? this.data : this.data.slice(this.read); this.clear(); } return rval; }; /** * Gets a binary encoded string of the bytes from this buffer without * modifying the read pointer. * * @param count the number of bytes to get, omit to get all. * * @return a string full of binary encoded characters. */ util.DataBuffer.prototype.bytes = function(count) { // TODO: deprecate this method, it is poorly named, add "getString()" return (typeof(count) === 'undefined' ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count)); }; /** * Gets a byte at the given index without modifying the read pointer. * * @param i the byte index. * * @return the byte. */ util.DataBuffer.prototype.at = function(i) { return this.data.getUint8(this.read + i); }; /** * Puts a byte at the given index without modifying the read pointer. * * @param i the byte index. * @param b the byte to put. * * @return this buffer. */ util.DataBuffer.prototype.setAt = function(i, b) { this.data.setUint8(i, b); return this; }; /** * Gets the last byte without modifying the read pointer. * * @return the last byte. */ util.DataBuffer.prototype.last = function() { return this.data.getUint8(this.write - 1); }; /** * Creates a copy of this buffer. * * @return the copy. */ util.DataBuffer.prototype.copy = function() { return new util.DataBuffer(this); }; /** * Compacts this buffer. * * @return this buffer. */ util.DataBuffer.prototype.compact = function() { if(this.read > 0) { var src = new Uint8Array(this.data.buffer, this.read); var dst = new Uint8Array(src.byteLength); dst.set(src); this.data = new DataView(dst); this.write -= this.read; this.read = 0; } return this; }; /** * Clears this buffer. * * @return this buffer. */ util.DataBuffer.prototype.clear = function() { this.data = new DataView(new ArrayBuffer(0)); this.read = this.write = 0; return this; }; /** * Shortens this buffer by triming bytes off of the end of this buffer. * * @param count the number of bytes to trim off. * * @return this buffer. */ util.DataBuffer.prototype.truncate = function(count) { this.write = Math.max(0, this.length() - count); this.read = Math.min(this.read, this.write); return this; }; /** * Converts this buffer to a hexadecimal string. * * @return a hexadecimal string. */ util.DataBuffer.prototype.toHex = function() { var rval = ''; for(var i = this.read; i < this.data.byteLength; ++i) { var b = this.data.getUint8(i); if(b < 16) { rval += '0'; } rval += b.toString(16); } return rval; }; /** * Converts this buffer to a string, using the given encoding. If no * encoding is given, 'utf8' (UTF-8) is used. * * @param [encoding] the encoding to use: 'binary', 'utf8', 'utf16', 'hex', * 'base64' (default: 'utf8'). * * @return a string representation of the bytes in this buffer. */ util.DataBuffer.prototype.toString = function(encoding) { var view = new Uint8Array(this.data, this.read, this.length()); encoding = encoding || 'utf8'; // encode to string if(encoding === 'binary' || encoding === 'raw') { return util.binary.raw.encode(view); } if(encoding === 'hex') { return util.binary.hex.encode(view); } if(encoding === 'base64') { return util.binary.base64.encode(view); } // decode to text if(encoding === 'utf8') { return util.text.utf8.decode(view); } if(encoding === 'utf16') { return util.text.utf16.decode(view); } throw new Error('Invalid encoding: ' + encoding); }; /** End Buffer w/UInt8Array backing */ /** * Creates a buffer that stores bytes. A value may be given to populate the * buffer with data. This value can either be string of encoded bytes or a * regular string of characters. When passing a string of binary encoded * bytes, the encoding `raw` should be given. This is also the default. When * passing a string of characters, the encoding `utf8` should be given. * * @param [input] a string with encoded bytes to store in the buffer. * @param [encoding] (default: 'raw', other: 'utf8'). */ util.createBuffer = function(input, encoding) { // TODO: deprecate, use new ByteBuffer() instead encoding = encoding || 'raw'; if(input !== undefined && encoding === 'utf8') { input = util.encodeUtf8(input); } return new util.ByteBuffer(input); }; /** * Fills a string with a particular value. If you want the string to be a byte * string, pass in String.fromCharCode(theByte). * * @param c the character to fill the string with, use String.fromCharCode * to fill the string with a byte value. * @param n the number of characters of value c to fill with. * * @return the filled string. */ util.fillString = function(c, n) { var s = ''; while(n > 0) { if(n & 1) { s += c; } n >>>= 1; if(n > 0) { c += c; } } return s; }; /** * Performs a per byte XOR between two byte strings and returns the result as a * string of bytes. * * @param s1 first string of bytes. * @param s2 second string of bytes. * @param n the number of bytes to XOR. * * @return the XOR'd result. */ util.xorBytes = function(s1, s2, n) { var s3 = ''; var b = ''; var t = ''; var i = 0; var c = 0; for(; n > 0; --n, ++i) { b = s1.charCodeAt(i) ^ s2.charCodeAt(i); if(c >= 10) { s3 += t; t = ''; c = 0; } t += String.fromCharCode(b); ++c; } s3 += t; return s3; }; /** * Converts a hex string into a 'binary' encoded string of bytes. * * @param hex the hexadecimal string to convert. * * @return the binary-encoded string of bytes. */ util.hexToBytes = function(hex) { // TODO: deprecate: "Deprecated. Use util.binary.hex.decode instead." var rval = ''; var i = 0; if(hex.length & 1 == 1) { // odd number of characters, convert first character alone i = 1; rval += String.fromCharCode(parseInt(hex[0], 16)); } // convert 2 characters (1 byte) at a time for(; i < hex.length; i += 2) { rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); } return rval; }; /** * Converts a 'binary' encoded string of bytes to hex. * * @param bytes the byte string to convert. * * @return the string of hexadecimal characters. */ util.bytesToHex = function(bytes) { // TODO: deprecate: "Deprecated. Use util.binary.hex.encode instead." return util.createBuffer(bytes).toHex(); }; /** * Converts an 32-bit integer to 4-big-endian byte string. * * @param i the integer. * * @return the byte string. */ util.int32ToBytes = function(i) { return ( String.fromCharCode(i >> 24 & 0xFF) + String.fromCharCode(i >> 16 & 0xFF) + String.fromCharCode(i >> 8 & 0xFF) + String.fromCharCode(i & 0xFF)); }; // base64 characters, reverse mapping var _base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; var _base64Idx = [ /*43 -43 = 0*/ /*'+', 1, 2, 3,'/' */ 62, -1, -1, -1, 63, /*'0','1','2','3','4','5','6','7','8','9' */ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, /*15, 16, 17,'=', 19, 20, 21 */ -1, -1, -1, 64, -1, -1, -1, /*65 - 43 = 22*/ /*'A','B','C','D','E','F','G','H','I','J','K','L','M', */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, /*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, /*91 - 43 = 48 */ /*48, 49, 50, 51, 52, 53 */ -1, -1, -1, -1, -1, -1, /*97 - 43 = 54*/ /*'a','b','c','d','e','f','g','h','i','j','k','l','m' */ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, /*'n','o','p','q','r','s','t','u','v','w','x','y','z' */ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 ]; // base58 characters (Bitcoin alphabet) var _base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; /** * Base64 encodes a 'binary' encoded string of bytes. * * @param input the binary encoded string of bytes to base64-encode. * @param maxline the maximum number of encoded characters per line to use, * defaults to none. * * @return the base64-encoded output. */ util.encode64 = function(input, maxline) { // TODO: deprecate: "Deprecated. Use util.binary.base64.encode instead." var line = ''; var output = ''; var chr1, chr2, chr3; var i = 0; while(i < input.length) { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); // encode 4 character group line += _base64.charAt(chr1 >> 2); line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); if(isNaN(chr2)) { line += '=='; } else { line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); } if(maxline && line.length > maxline) { output += line.substr(0, maxline) + '\r\n'; line = line.substr(maxline); } } output += line; return output; }; /** * Base64 decodes a string into a 'binary' encoded string of bytes. * * @param input the base64-encoded input. * * @return the binary encoded string. */ util.decode64 = function(input) { // TODO: deprecate: "Deprecated. Use util.binary.base64.decode instead." // remove all non-base64 characters input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); var output = ''; var enc1, enc2, enc3, enc4; var i = 0; while(i < input.length) { enc1 = _base64Idx[input.charCodeAt(i++) - 43]; enc2 = _base64Idx[input.charCodeAt(i++) - 43]; enc3 = _base64Idx[input.charCodeAt(i++) - 43]; enc4 = _base64Idx[input.charCodeAt(i++) - 43]; output += String.fromCharCode((enc1 << 2) | (enc2 >> 4)); if(enc3 !== 64) { // decoded at least 2 bytes output += String.fromCharCode(((enc2 & 15) << 4) | (enc3 >> 2)); if(enc4 !== 64) { // decoded 3 bytes output += String.fromCharCode(((enc3 & 3) << 6) | enc4); } } } return output; }; /** * Encodes the given string of characters (a standard JavaScript * string) as a binary encoded string where the bytes represent * a UTF-8 encoded string of characters. Non-ASCII characters will be * encoded as multiple bytes according to UTF-8. * * @param str a standard string of characters to encode. * * @return the binary encoded string. */ util.encodeUtf8 = function(str) { return unescape(encodeURIComponent(str)); }; /** * Decodes a binary encoded string that contains bytes that * represent a UTF-8 encoded string of characters -- into a * string of characters (a standard JavaScript string). * * @param str the binary encoded string to decode. * * @return the resulting standard string of characters. */ util.decodeUtf8 = function(str) { return decodeURIComponent(escape(str)); }; // binary encoding/decoding tools // FIXME: Experimental. Do not use yet. util.binary = { raw: {}, hex: {}, base64: {}, base58: {}, baseN : { encode: baseN.encode, decode: baseN.decode } }; /** * Encodes a Uint8Array as a binary-encoded string. This encoding uses * a value between 0 and 255 for each character. * * @param bytes the Uint8Array to encode. * * @return the binary-encoded string. */ util.binary.raw.encode = function(bytes) { return String.fromCharCode.apply(null, bytes); }; /** * Decodes a binary-encoded string to a Uint8Array. This encoding uses * a value between 0 and 255 for each character. * * @param str the binary-encoded string to decode. * @param [output] an optional Uint8Array to write the output to; if it * is too small, an exception will be thrown. * @param [offset] the start offset for writing to the output (default: 0). * * @return the Uint8Array or the number of bytes written if output was given. */ util.binary.raw.decode = function(str, output, offset) { var out = output; if(!out) { out = new Uint8Array(str.length); } offset = offset || 0; var j = offset; for(var i = 0; i < str.length; ++i) { out[j++] = str.charCodeAt(i); } return output ? (j - offset) : out; }; /** * Encodes a 'binary' string, ArrayBuffer, DataView, TypedArray, or * ByteBuffer as a string of hexadecimal characters. * * @param bytes the bytes to convert. * * @return the string of hexadecimal characters. */ util.binary.hex.encode = util.bytesToHex; /** * Decodes a hex-encoded string to a Uint8Array. * * @param hex the hexadecimal string to convert. * @param [output] an optional Uint8Array to write the output to; if it * is too small, an exception will be thrown. * @param [offset] the start offset for writing to the output (default: 0). * * @return the Uint8Array or the number of bytes written if output was given. */ util.binary.hex.decode = function(hex, output, offset) { var out = output; if(!out) { out = new Uint8Array(Math.ceil(hex.length / 2)); } offset = offset || 0; var i = 0, j = offset; if(hex.length & 1) { // odd number of characters, convert first character alone i = 1; out[j++] = parseInt(hex[0], 16); } // convert 2 characters (1 byte) at a time for(; i < hex.length; i += 2) { out[j++] = parseInt(hex.substr(i, 2), 16); } return output ? (j - offset) : out; }; /** * Base64-encodes a Uint8Array. * * @param input the Uint8Array to encode. * @param maxline the maximum number of encoded characters per line to use, * defaults to none. * * @return the base64-encoded output string. */ util.binary.base64.encode = function(input, maxline) { var line = ''; var output = ''; var chr1, chr2, chr3; var i = 0; while(i < input.byteLength) { chr1 = input[i++]; chr2 = input[i++]; chr3 = input[i++]; // encode 4 character group line += _base64.charAt(chr1 >> 2); line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); if(isNaN(chr2)) { line += '=='; } else { line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); } if(maxline && line.length > maxline) { output += line.substr(0, maxline) + '\r\n'; line = line.substr(maxline); } } output += line; return output; }; /** * Decodes a base64-encoded string to a Uint8Array. * * @param input the base64-encoded input string. * @param [output] an optional Uint8Array to write the output to; if it * is too small, an exception will be thrown. * @param [offset] the start offset for writing to the output (default: 0). * * @return the Uint8Array or the number of bytes written if output was given. */ util.binary.base64.decode = function(input, output, offset) { var out = output; if(!out) { out = new Uint8Array(Math.ceil(input.length / 4) * 3); } // remove all non-base64 characters input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); offset = offset || 0; var enc1, enc2, enc3, enc4; var i = 0, j = offset; while(i < input.length) { enc1 = _base64Idx[input.charCodeAt(i++) - 43]; enc2 = _base64Idx[input.charCodeAt(i++) - 43]; enc3 = _base64Idx[input.charCodeAt(i++) - 43]; enc4 = _base64Idx[input.charCodeAt(i++) - 43]; out[j++] = (enc1 << 2) | (enc2 >> 4); if(enc3 !== 64) { // decoded at least 2 bytes out[j++] = ((enc2 & 15) << 4) | (enc3 >> 2); if(enc4 !== 64) { // decoded 3 bytes out[j++] = ((enc3 & 3) << 6) | enc4; } } } // make sure result is the exact decoded length return output ? (j - offset) : out.subarray(0, j); }; // add support for base58 encoding/decoding with Bitcoin alphabet util.binary.base58.encode = function(input, maxline) { return util.binary.baseN.encode(input, _base58, maxline); }; util.binary.base58.decode = function(input, maxline) { return util.binary.baseN.decode(input, _base58, maxline); }; // text encoding/decoding tools // FIXME: Experimental. Do not use yet. util.text = { utf8: {}, utf16: {} }; /** * Encodes the given string as UTF-8 in a Uint8Array. * * @param str the string to encode. * @param [output] an optional Uint8Array to write the output to; if it * is too small, an exception will be thrown. * @param [offset] the start offset for writing to the output (default: 0). * * @return the Uint8Array or the number of bytes written if output was given. */ util.text.utf8.encode = function(str, output, offset) { str = util.encodeUtf8(str); var out = output; if(!out) { out = new Uint8Array(str.length); } offset = offset || 0; var j = offset; for(var i = 0; i < str.length; ++i) { out[j++] = str.charCodeAt(i); } return output ? (j - offset) : out; }; /** * Decodes the UTF-8 contents from a Uint8Array. * * @param bytes the Uint8Array to decode. * * @return the resulting string. */ util.text.utf8.decode = function(bytes) { return util.decodeUtf8(String.fromCharCode.apply(null, bytes)); }; /** * Encodes the given string as UTF-16 in a Uint8Array. * * @param str the string to encode. * @param [output] an optional Uint8Array to write the output to; if it * is too small, an exception will be thrown. * @param [offset] the start offset for writing to the output (default: 0). * * @return the Uint8Array or the number of bytes written if output was given. */ util.text.utf16.encode = function(str, output, offset) { var out = output; if(!out) { out = new Uint8Array(str.length * 2); } var view = new Uint16Array(out.buffer); offset = offset || 0; var j = offset; var k = offset; for(var i = 0; i < str.length; ++i) { view[k++] = str.charCodeAt(i); j += 2; } return output ? (j - offset) : out; }; /** * Decodes the UTF-16 contents from a Uint8Array. * * @param bytes the Uint8Array to decode. * * @return the resulting string. */ util.text.utf16.decode = function(bytes) { return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); }; /** * Deflates the given data using a flash interface. * * @param api the flash interface. * @param bytes the data. * @param raw true to return only raw deflate data, false to include zlib * header and trailer. * * @return the deflated data as a string. */ util.deflate = function(api, bytes, raw) { bytes = util.decode64(api.deflate(util.encode64(bytes)).rval); // strip zlib header and trailer if necessary if(raw) { // zlib header is 2 bytes (CMF,FLG) where FLG indicates that // there is a 4-byte DICT (alder-32) block before the data if // its 5th bit is set var start = 2; var flg = bytes.charCodeAt(1); if(flg & 0x20) { start = 6; } // zlib trailer is 4 bytes of adler-32 bytes = bytes.substring(start, bytes.length - 4); } return bytes; }; /** * Inflates the given data using a flash interface. * * @param api the flash interface. * @param bytes the data. * @param raw true if the incoming data has no zlib header or trailer and is * raw DEFLATE data. * * @return the inflated data as a string, null on error. */ util.inflate = function(api, bytes, raw) { // TODO: add zlib header and trailer if necessary/possible var rval = api.inflate(util.encode64(bytes)).rval; return (rval === null) ? null : util.decode64(rval); }; /** * Sets a storage object. * * @param api the storage interface. * @param id the storage ID to use. * @param obj the storage object, null to remove. */ var _setStorageObject = function(api, id, obj) { if(!api) { throw new Error('WebStorage not available.'); } var rval; if(obj === null) { rval = api.removeItem(id); } else { // json-encode and base64-encode object obj = util.encode64(JSON.stringify(obj)); rval = api.setItem(id, obj); } // handle potential flash error if(typeof(rval) !== 'undefined' && rval.rval !== true) { var error = new Error(rval.error.message); error.id = rval.error.id; error.name = rval.error.name; throw error; } }; /** * Gets a storage object. * * @param api the storage interface. * @param id the storage ID to use. * * @return the storage object entry or null if none exists. */ var _getStorageObject = function(api, id) { if(!api) { throw new Error('WebStorage not available.'); } // get the existing entry var rval = api.getItem(id); /* Note: We check api.init because we can't do (api == localStorage) on IE because of "Class doesn't support Automation" exception. Only the flash api has an init method so this works too, but we need a better solution in the future. */ // flash returns item wrapped in an object, handle special case if(api.init) { if(rval.rval === null) { if(rval.error) { var error = new Error(rval.error.message); error.id = rval.error.id; error.name = rval.error.name; throw error; } // no error, but also no item rval = null; } else { rval = rval.rval; } } // handle decoding if(rval !== null) { // base64-decode and json-decode data rval = JSON.parse(util.decode64(rval)); } return rval; }; /** * Stores an item in local storage. * * @param api the storage interface. * @param id the storage ID to use. * @param key the key for the item. * @param data the data for the item (any javascript object/primitive). */ var _setItem = function(api, id, key, data) { // get storage object var obj = _getStorageObject(api, id); if(obj === null) { // create a new storage object obj = {}; } // update key obj[key] = data; // set storage object _setStorageObject(api, id, obj); }; /** * Gets an item from local storage. * * @param api the storage interface. * @param id the storage ID to use. * @param key the key for the item. * * @return the item. */ var _getItem = function(api, id, key) { // get storage object var rval = _getStorageObject(api, id); if(rval !== null) { // return data at key rval = (key in rval) ? rval[key] : null; } return rval; }; /** * Removes an item from local storage. * * @param api the storage interface. * @param id the storage ID to use. * @param key the key for the item. */ var _removeItem = function(api, id, key) { // get storage object var obj = _getStorageObject(api, id); if(obj !== null && key in obj) { // remove key delete obj[key]; // see if entry has no keys remaining var empty = true; for(var prop in obj) { empty = false; break; } if(empty) { // remove entry entirely if no keys are left obj = null; } // set storage object _setStorageObject(api, id, obj); } }; /** * Clears the local disk storage identified by the given ID. * * @param api the storage interface. * @param id the storage ID to use. */ var _clearItems = function(api, id) { _setStorageObject(api, id, null); }; /** * Calls a storage function. * * @param func the function to call. * @param args the arguments for the function. * @param location the location argument. * * @return the return value from the function. */ var _callStorageFunction = function(func, args, location) { var rval = null; // default storage types if(typeof(location) === 'undefined') { location = ['web', 'flash']; } // apply storage types in order of preference var type; var done = false; var exception = null; for(var idx in location) { type = location[idx]; try { if(type === 'flash' || type === 'both') { if(args[0] === null) { throw new Error('Flash local storage not available.'); } rval = func.apply(this, args); done = (type === 'flash'); } if(type === 'web' || type === 'both') { args[0] = localStorage; rval = func.apply(this, args); done = true; } } catch(ex) { exception = ex; } if(done) { break; } } if(!done) { throw exception; } return rval; }; /** * Stores an item on local disk. * * The available types of local storage include 'flash', 'web', and 'both'. * * The type 'flash' refers to flash local storage (SharedObject). In order * to use flash local storage, the 'api' parameter must be valid. The type * 'web' refers to WebStorage, if supported by the browser. The type 'both' * refers to storing using both 'flash' and 'web', not just one or the * other. * * The location array should list the storage types to use in order of * preference: * * ['flash']: flash only storage * ['web']: web only storage * ['both']: try to store in both * ['flash','web']: store in flash first, but if not available, 'web' * ['web','flash']: store in web first, but if not available, 'flash' * * The location array defaults to: ['web', 'flash'] * * @param api the flash interface, null to use only WebStorage. * @param id the storage ID to use. * @param key the key for the item. * @param data the data for the item (any javascript object/primitive). * @param location an array with the preferred types of storage to use. */ util.setItem = function(api, id, key, data, location) { _callStorageFunction(_setItem, arguments, location); }; /** * Gets an item on local disk. * * Set setItem() for details on storage types. * * @param api the flash interface, null to use only WebStorage. * @param id the storage ID to use. * @param key the key for the item. * @param location an array with the preferred types of storage to use. * * @return the item. */ util.getItem = function(api, id, key, location) { return _callStorageFunction(_getItem, arguments, location); }; /** * Removes an item on local disk. * * Set setItem() for details on storage types. * * @param api the flash interface. * @param id the storage ID to use. * @param key the key for the item. * @param location an array with the preferred types of storage to use. */ util.removeItem = function(api, id, key, location) { _callStorageFunction(_removeItem, arguments, location); }; /** * Clears the local disk storage identified by the given ID. * * Set setItem() for details on storage types. * * @param api the flash interface if flash is available. * @param id the storage ID to use. * @param location an array with the preferred types of storage to use. */ util.clearItems = function(api, id, location) { _callStorageFunction(_clearItems, arguments, location); }; /** * Parses the scheme, host, and port from an http(s) url. * * @param str the url string. * * @return the parsed url object or null if the url is invalid. */ util.parseUrl = function(str) { // FIXME: this regex looks a bit broken var regex = /^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g; regex.lastIndex = 0; var m = regex.exec(str); var url = (m === null) ? null : { full: str, scheme: m[1], host: m[2], port: m[3], path: m[4] }; if(url) { url.fullHost = url.host; if(url.port) { if(url.port !== 80 && url.scheme === 'http') { url.fullHost += ':' + url.port; } else if(url.port !== 443 && url.scheme === 'https') { url.fullHost += ':' + url.port; } } else if(url.scheme === 'http') { url.port = 80; } else if(url.scheme === 'https') { url.port = 443; } url.full = url.scheme + '://' + url.fullHost; } return url; }; /* Storage for query variables */ var _queryVariables = null; /** * Returns the window location query variables. Query is parsed on the first * call and the same object is returned on subsequent calls. The mapping * is from keys to an array of values. Parameters without values will have * an object key set but no value added to the value array. Values are * unescaped. * * ...?k1=v1&k2=v2: * { * "k1": ["v1"], * "k2": ["v2"] * } * * ...?k1=v1&k1=v2: * { * "k1": ["v1", "v2"] * } * * ...?k1=v1&k2: * { * "k1": ["v1"], * "k2": [] * } * * ...?k1=v1&k1: * { * "k1": ["v1"] * } * * ...?k1&k1: * { * "k1": [] * } * * @param query the query string to parse (optional, default to cached * results from parsing window location search query). * * @return object mapping keys to variables. */ util.getQueryVariables = function(query) { var parse = function(q) { var rval = {}; var kvpairs = q.split('&'); for(var i = 0; i < kvpairs.length; i++) { var pos = kvpairs[i].indexOf('='); var key; var val; if(pos > 0) { key = kvpairs[i].substring(0, pos); val = kvpairs[i].substring(pos + 1); } else { key = kvpairs[i]; val = null; } if(!(key in rval)) { rval[key] = []; } // disallow overriding object prototype keys if(!(key in Object.prototype) && val !== null) { rval[key].push(unescape(val)); } } return rval; }; var rval; if(typeof(query) === 'undefined') { // set cached variables if needed if(_queryVariables === null) { if(typeof(window) !== 'undefined' && window.location && window.location.search) { // parse window search query _queryVariables = parse(window.location.search.substring(1)); } else { // no query variables available _queryVariables = {}; } } rval = _queryVariables; } else { // parse given query rval = parse(query); } return rval; }; /** * Parses a fragment into a path and query. This method will take a URI * fragment and break it up as if it were the main URI. For example: * /bar/baz?a=1&b=2 * results in: * { * path: ["bar", "baz"], * query: {"k1": ["v1"], "k2": ["v2"]} * } * * @return object with a path array and query object. */ util.parseFragment = function(fragment) { // default to whole fragment var fp = fragment; var fq = ''; // split into path and query if possible at the first '?' var pos = fragment.indexOf('?'); if(pos > 0) { fp = fragment.substring(0, pos); fq = fragment.substring(pos + 1); } // split path based on '/' and ignore first element if empty var path = fp.split('/'); if(path.length > 0 && path[0] === '') { path.shift(); } // convert query into object var query = (fq === '') ? {} : util.getQueryVariables(fq); return { pathString: fp, queryString: fq, path: path, query: query }; }; /** * Makes a request out of a URI-like request string. This is intended to * be used where a fragment id (after a URI '#') is parsed as a URI with * path and query parts. The string should have a path beginning and * delimited by '/' and optional query parameters following a '?'. The * query should be a standard URL set of key value pairs delimited by * '&'. For backwards compatibility the initial '/' on the path is not * required. The request object has the following API, (fully described * in the method code): * { * path: . * query: , * getPath(i): get part or all of the split path array, * getQuery(k, i): get part or all of a query key array, * getQueryLast(k, _default): get last element of a query key array. * } * * @return object with request parameters. */ util.makeRequest = function(reqString) { var frag = util.parseFragment(reqString); var req = { // full path string path: frag.pathString, // full query string query: frag.queryString, /** * Get path or element in path. * * @param i optional path index. * * @return path or part of path if i provided. */ getPath: function(i) { return (typeof(i) === 'undefined') ? frag.path : frag.path[i]; }, /** * Get query, values for a key, or value for a key index. * * @param k optional query key. * @param i optional query key index. * * @return query, values for a key, or value for a key index. */ getQuery: function(k, i) { var rval; if(typeof(k) === 'undefined') { rval = frag.query; } else { rval = frag.query[k]; if(rval && typeof(i) !== 'undefined') { rval = rval[i]; } } return rval; }, getQueryLast: function(k, _default) { var rval; var vals = req.getQuery(k); if(vals) { rval = vals[vals.length - 1]; } else { rval = _default; } return rval; } }; return req; }; /** * Makes a URI out of a path, an object with query parameters, and a * fragment. Uses jQuery.param() internally for query string creation. * If the path is an array, it will be joined with '/'. * * @param path string path or array of strings. * @param query object with query parameters. (optional) * @param fragment fragment string. (optional) * * @return string object with request parameters. */ util.makeLink = function(path, query, fragment) { // join path parts if needed path = jQuery.isArray(path) ? path.join('/') : path; var qstr = jQuery.param(query || {}); fragment = fragment || ''; return path + ((qstr.length > 0) ? ('?' + qstr) : '') + ((fragment.length > 0) ? ('#' + fragment) : ''); }; /** * Check if an object is empty. * * Taken from: * http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object-from-json/679937#679937 * * @param object the object to check. */ util.isEmpty = function(obj) { for(var prop in obj) { if(obj.hasOwnProperty(prop)) { return false; } } return true; }; /** * Format with simple printf-style interpolation. * * %%: literal '%' * %s,%o: convert next argument into a string. * * @param format the string to format. * @param ... arguments to interpolate into the format string. */ util.format = function(format) { var re = /%./g; // current match var match; // current part var part; // current arg index var argi = 0; // collected parts to recombine later var parts = []; // last index found var last = 0; // loop while matches remain while((match = re.exec(format))) { part = format.substring(last, re.lastIndex - 2); // don't add empty strings (ie, parts between %s%s) if(part.length > 0) { parts.push(part); } last = re.lastIndex; // switch on % code var code = match[0][1]; switch(code) { case 's': case 'o': // check if enough arguments were given if(argi < arguments.length) { parts.push(arguments[argi++ + 1]); } else { parts.push(''); } break; // FIXME: do proper formating for numbers, etc //case 'f': //case 'd': case '%': parts.push('%'); break; default: parts.push('<%' + code + '?>'); } } // add trailing part of format string parts.push(format.substring(last)); return parts.join(''); }; /** * Formats a number. * * http://snipplr.com/view/5945/javascript-numberformat--ported-from-php/ */ util.formatNumber = function(number, decimals, dec_point, thousands_sep) { // http://kevin.vanzonneveld.net // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfix by: Michael White (http://crestidg.com) // + bugfix by: Benjamin Lupton // + bugfix by: Allan Jensen (http://www.winternet.no) // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) // * example 1: number_format(1234.5678, 2, '.', ''); // * returns 1: 1234.57 var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; var d = dec_point === undefined ? ',' : dec_point; var t = thousands_sep === undefined ? '.' : thousands_sep, s = n < 0 ? '-' : ''; var i = parseInt((n = Math.abs(+n || 0).toFixed(c)), 10) + ''; var j = (i.length > 3) ? i.length % 3 : 0; return s + (j ? i.substr(0, j) + t : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); }; /** * Formats a byte size. * * http://snipplr.com/view/5949/format-humanize-file-byte-size-presentation-in-javascript/ */ util.formatSize = function(size) { if(size >= 1073741824) { size = util.formatNumber(size / 1073741824, 2, '.', '') + ' GiB'; } else if(size >= 1048576) { size = util.formatNumber(size / 1048576, 2, '.', '') + ' MiB'; } else if(size >= 1024) { size = util.formatNumber(size / 1024, 0) + ' KiB'; } else { size = util.formatNumber(size, 0) + ' bytes'; } return size; }; /** * Converts an IPv4 or IPv6 string representation into bytes (in network order). * * @param ip the IPv4 or IPv6 address to convert. * * @return the 4-byte IPv6 or 16-byte IPv6 address or null if the address can't * be parsed. */ util.bytesFromIP = function(ip) { if(ip.indexOf('.') !== -1) { return util.bytesFromIPv4(ip); } if(ip.indexOf(':') !== -1) { return util.bytesFromIPv6(ip); } return null; }; /** * Converts an IPv4 string representation into bytes (in network order). * * @param ip the IPv4 address to convert. * * @return the 4-byte address or null if the address can't be parsed. */ util.bytesFromIPv4 = function(ip) { ip = ip.split('.'); if(ip.length !== 4) { return null; } var b = util.createBuffer(); for(var i = 0; i < ip.length; ++i) { var num = parseInt(ip[i], 10); if(isNaN(num)) { return null; } b.putByte(num); } return b.getBytes(); }; /** * Converts an IPv6 string representation into bytes (in network order). * * @param ip the IPv6 address to convert. * * @return the 16-byte address or null if the address can't be parsed. */ util.bytesFromIPv6 = function(ip) { var blanks = 0; ip = ip.split(':').filter(function(e) { if(e.length === 0) ++blanks; return true; }); var zeros = (8 - ip.length + blanks) * 2; var b = util.createBuffer(); for(var i = 0; i < 8; ++i) { if(!ip[i] || ip[i].length === 0) { b.fillWithByte(0, zeros); zeros = 0; continue; } var bytes = util.hexToBytes(ip[i]); if(bytes.length < 2) { b.putByte(0); } b.putBytes(bytes); } return b.getBytes(); }; /** * Converts 4-bytes into an IPv4 string representation or 16-bytes into * an IPv6 string representation. The bytes must be in network order. * * @param bytes the bytes to convert. * * @return the IPv4 or IPv6 string representation if 4 or 16 bytes, * respectively, are given, otherwise null. */ util.bytesToIP = function(bytes) { if(bytes.length === 4) { return util.bytesToIPv4(bytes); } if(bytes.length === 16) { return util.bytesToIPv6(bytes); } return null; }; /** * Converts 4-bytes into an IPv4 string representation. The bytes must be * in network order. * * @param bytes the bytes to convert. * * @return the IPv4 string representation or null for an invalid # of bytes. */ util.bytesToIPv4 = function(bytes) { if(bytes.length !== 4) { return null; } var ip = []; for(var i = 0; i < bytes.length; ++i) { ip.push(bytes.charCodeAt(i)); } return ip.join('.'); }; /** * Converts 16-bytes into an IPv16 string representation. The bytes must be * in network order. * * @param bytes the bytes to convert. * * @return the IPv16 string representation or null for an invalid # of bytes. */ util.bytesToIPv6 = function(bytes) { if(bytes.length !== 16) { return null; } var ip = []; var zeroGroups = []; var zeroMaxGroup = 0; for(var i = 0; i < bytes.length; i += 2) { var hex = util.bytesToHex(bytes[i] + bytes[i + 1]); // canonicalize zero representation while(hex[0] === '0' && hex !== '0') { hex = hex.substr(1); } if(hex === '0') { var last = zeroGroups[zeroGroups.length - 1]; var idx = ip.length; if(!last || idx !== last.end + 1) { zeroGroups.push({start: idx, end: idx}); } else { last.end = idx; if((last.end - last.start) > (zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start)) { zeroMaxGroup = zeroGroups.length - 1; } } } ip.push(hex); } if(zeroGroups.length > 0) { var group = zeroGroups[zeroMaxGroup]; // only shorten group of length > 0 if(group.end - group.start > 0) { ip.splice(group.start, group.end - group.start + 1, ''); if(group.start === 0) { ip.unshift(''); } if(group.end === 7) { ip.push(''); } } } return ip.join(':'); }; /** * Estimates the number of processes that can be run concurrently. If * creating Web Workers, keep in mind that the main JavaScript process needs * its own core. * * @param options the options to use: * update true to force an update (not use the cached value). * @param callback(err, max) called once the operation completes. */ util.estimateCores = function(options, callback) { if(typeof options === 'function') { callback = options; options = {}; } options = options || {}; if('cores' in util && !options.update) { return callback(null, util.cores); } if(typeof navigator !== 'undefined' && 'hardwareConcurrency' in navigator && navigator.hardwareConcurrency > 0) { util.cores = navigator.hardwareConcurrency; return callback(null, util.cores); } if(typeof Worker === 'undefined') { // workers not available util.cores = 1; return callback(null, util.cores); } if(typeof Blob === 'undefined') { // can't estimate, default to 2 util.cores = 2; return callback(null, util.cores); } // create worker concurrency estimation code as blob var blobUrl = URL.createObjectURL(new Blob(['(', function() { self.addEventListener('message', function(e) { // run worker for 4 ms var st = Date.now(); var et = st + 4; while(Date.now() < et); self.postMessage({st: st, et: et}); }); }.toString(), ')()'], {type: 'application/javascript'})); // take 5 samples using 16 workers sample([], 5, 16); function sample(max, samples, numWorkers) { if(samples === 0) { // get overlap average var avg = Math.floor(max.reduce(function(avg, x) { return avg + x; }, 0) / max.length); util.cores = Math.max(1, avg); URL.revokeObjectURL(blobUrl); return callback(null, util.cores); } map(numWorkers, function(err, results) { max.push(reduce(numWorkers, results)); sample(max, samples - 1, numWorkers); }); } function map(numWorkers, callback) { var workers = []; var results = []; for(var i = 0; i < numWorkers; ++i) { var worker = new Worker(blobUrl); worker.addEventListener('message', function(e) { results.push(e.data); if(results.length === numWorkers) { for(var i = 0; i < numWorkers; ++i) { workers[i].terminate(); } callback(null, results); } }); workers.push(worker); } for(var i = 0; i < numWorkers; ++i) { workers[i].postMessage(i); } } function reduce(numWorkers, results) { // find overlapping time windows var overlaps = []; for(var n = 0; n < numWorkers; ++n) { var r1 = results[n]; var overlap = overlaps[n] = []; for(var i = 0; i < numWorkers; ++i) { if(n === i) { continue; } var r2 = results[i]; if((r1.st > r2.st && r1.st < r2.et) || (r2.st > r1.st && r2.st < r1.et)) { overlap.push(i); } } } // get maximum overlaps ... don't include overlapping worker itself // as the main JS process was also being scheduled during the work and // would have to be subtracted from the estimate anyway return overlaps.reduce(function(max, overlap) { return Math.max(max, overlap.length); }, 0); } }; /***/ }), /***/ 8180: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Javascript implementation of X.509 and related components (such as * Certification Signing Requests) of a Public Key Infrastructure. * * @author Dave Longley * * Copyright (c) 2010-2014 Digital Bazaar, Inc. * * The ASN.1 representation of an X.509v3 certificate is as follows * (see RFC 2459): * * Certificate ::= SEQUENCE { * tbsCertificate TBSCertificate, * signatureAlgorithm AlgorithmIdentifier, * signatureValue BIT STRING * } * * TBSCertificate ::= SEQUENCE { * version [0] EXPLICIT Version DEFAULT v1, * serialNumber CertificateSerialNumber, * signature AlgorithmIdentifier, * issuer Name, * validity Validity, * subject Name, * subjectPublicKeyInfo SubjectPublicKeyInfo, * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, * -- If present, version shall be v2 or v3 * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, * -- If present, version shall be v2 or v3 * extensions [3] EXPLICIT Extensions OPTIONAL * -- If present, version shall be v3 * } * * Version ::= INTEGER { v1(0), v2(1), v3(2) } * * CertificateSerialNumber ::= INTEGER * * Name ::= CHOICE { * // only one possible choice for now * RDNSequence * } * * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName * * RelativeDistinguishedName ::= SET OF AttributeTypeAndValue * * AttributeTypeAndValue ::= SEQUENCE { * type AttributeType, * value AttributeValue * } * AttributeType ::= OBJECT IDENTIFIER * AttributeValue ::= ANY DEFINED BY AttributeType * * Validity ::= SEQUENCE { * notBefore Time, * notAfter Time * } * * Time ::= CHOICE { * utcTime UTCTime, * generalTime GeneralizedTime * } * * UniqueIdentifier ::= BIT STRING * * SubjectPublicKeyInfo ::= SEQUENCE { * algorithm AlgorithmIdentifier, * subjectPublicKey BIT STRING * } * * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension * * Extension ::= SEQUENCE { * extnID OBJECT IDENTIFIER, * critical BOOLEAN DEFAULT FALSE, * extnValue OCTET STRING * } * * The only key algorithm currently supported for PKI is RSA. * * RSASSA-PSS signatures are described in RFC 3447 and RFC 4055. * * PKCS#10 v1.7 describes certificate signing requests: * * CertificationRequestInfo: * * CertificationRequestInfo ::= SEQUENCE { * version INTEGER { v1(0) } (v1,...), * subject Name, * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, * attributes [0] Attributes{{ CRIAttributes }} * } * * Attributes { ATTRIBUTE:IOSet } ::= SET OF Attribute{{ IOSet }} * * CRIAttributes ATTRIBUTE ::= { * ... -- add any locally defined attributes here -- } * * Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE { * type ATTRIBUTE.&id({IOSet}), * values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type}) * } * * CertificationRequest ::= SEQUENCE { * certificationRequestInfo CertificationRequestInfo, * signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, * signature BIT STRING * } */ var forge = __webpack_require__(89177); __webpack_require__(87994); __webpack_require__(39549); __webpack_require__(97157); __webpack_require__(86231); __webpack_require__(27973); __webpack_require__(81925); __webpack_require__(70154); __webpack_require__(4376); __webpack_require__(53921); __webpack_require__(28339); // shortcut for asn.1 API var asn1 = forge.asn1; /* Public Key Infrastructure (PKI) implementation. */ var pki = module.exports = forge.pki = forge.pki || {}; var oids = pki.oids; // short name OID mappings var _shortNames = {}; _shortNames['CN'] = oids['commonName']; _shortNames['commonName'] = 'CN'; _shortNames['C'] = oids['countryName']; _shortNames['countryName'] = 'C'; _shortNames['L'] = oids['localityName']; _shortNames['localityName'] = 'L'; _shortNames['ST'] = oids['stateOrProvinceName']; _shortNames['stateOrProvinceName'] = 'ST'; _shortNames['O'] = oids['organizationName']; _shortNames['organizationName'] = 'O'; _shortNames['OU'] = oids['organizationalUnitName']; _shortNames['organizationalUnitName'] = 'OU'; _shortNames['E'] = oids['emailAddress']; _shortNames['emailAddress'] = 'E'; // validator for an SubjectPublicKeyInfo structure // Note: Currently only works with an RSA public key var publicKeyValidator = forge.pki.rsa.publicKeyValidator; // validator for an X.509v3 certificate var x509CertificateValidator = { name: 'Certificate', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'Certificate.TBSCertificate', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'tbsCertificate', value: [{ name: 'Certificate.TBSCertificate.version', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, optional: true, value: [{ name: 'Certificate.TBSCertificate.version.integer', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'certVersion' }] }, { name: 'Certificate.TBSCertificate.serialNumber', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'certSerialNumber' }, { name: 'Certificate.TBSCertificate.signature', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'Certificate.TBSCertificate.signature.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'certinfoSignatureOid' }, { name: 'Certificate.TBSCertificate.signature.parameters', tagClass: asn1.Class.UNIVERSAL, optional: true, captureAsn1: 'certinfoSignatureParams' }] }, { name: 'Certificate.TBSCertificate.issuer', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'certIssuer' }, { name: 'Certificate.TBSCertificate.validity', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, // Note: UTC and generalized times may both appear so the capture // names are based on their detected order, the names used below // are only for the common case, which validity time really means // "notBefore" and which means "notAfter" will be determined by order value: [{ // notBefore (Time) (UTC time case) name: 'Certificate.TBSCertificate.validity.notBefore (utc)', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.UTCTIME, constructed: false, optional: true, capture: 'certValidity1UTCTime' }, { // notBefore (Time) (generalized time case) name: 'Certificate.TBSCertificate.validity.notBefore (generalized)', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.GENERALIZEDTIME, constructed: false, optional: true, capture: 'certValidity2GeneralizedTime' }, { // notAfter (Time) (only UTC time is supported) name: 'Certificate.TBSCertificate.validity.notAfter (utc)', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.UTCTIME, constructed: false, optional: true, capture: 'certValidity3UTCTime' }, { // notAfter (Time) (only UTC time is supported) name: 'Certificate.TBSCertificate.validity.notAfter (generalized)', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.GENERALIZEDTIME, constructed: false, optional: true, capture: 'certValidity4GeneralizedTime' }] }, { // Name (subject) (RDNSequence) name: 'Certificate.TBSCertificate.subject', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'certSubject' }, // SubjectPublicKeyInfo publicKeyValidator, { // issuerUniqueID (optional) name: 'Certificate.TBSCertificate.issuerUniqueID', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 1, constructed: true, optional: true, value: [{ name: 'Certificate.TBSCertificate.issuerUniqueID.id', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, // TODO: support arbitrary bit length ids captureBitStringValue: 'certIssuerUniqueId' }] }, { // subjectUniqueID (optional) name: 'Certificate.TBSCertificate.subjectUniqueID', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 2, constructed: true, optional: true, value: [{ name: 'Certificate.TBSCertificate.subjectUniqueID.id', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, // TODO: support arbitrary bit length ids captureBitStringValue: 'certSubjectUniqueId' }] }, { // Extensions (optional) name: 'Certificate.TBSCertificate.extensions', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 3, constructed: true, captureAsn1: 'certExtensions', optional: true }] }, { // AlgorithmIdentifier (signature algorithm) name: 'Certificate.signatureAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // algorithm name: 'Certificate.signatureAlgorithm.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'certSignatureOid' }, { name: 'Certificate.TBSCertificate.signature.parameters', tagClass: asn1.Class.UNIVERSAL, optional: true, captureAsn1: 'certSignatureParams' }] }, { // SignatureValue name: 'Certificate.signatureValue', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, captureBitStringValue: 'certSignature' }] }; var rsassaPssParameterValidator = { name: 'rsapss', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'rsapss.hashAlgorithm', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, value: [{ name: 'rsapss.hashAlgorithm.AlgorithmIdentifier', tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.SEQUENCE, constructed: true, optional: true, value: [{ name: 'rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'hashOid' /* parameter block omitted, for SHA1 NULL anyhow. */ }] }] }, { name: 'rsapss.maskGenAlgorithm', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 1, constructed: true, value: [{ name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier', tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.SEQUENCE, constructed: true, optional: true, value: [{ name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'maskGenOid' }, { name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'maskGenHashOid' /* parameter block omitted, for SHA1 NULL anyhow. */ }] }] }] }, { name: 'rsapss.saltLength', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 2, optional: true, value: [{ name: 'rsapss.saltLength.saltLength', tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.INTEGER, constructed: false, capture: 'saltLength' }] }, { name: 'rsapss.trailerField', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 3, optional: true, value: [{ name: 'rsapss.trailer.trailer', tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.INTEGER, constructed: false, capture: 'trailer' }] }] }; // validator for a CertificationRequestInfo structure var certificationRequestInfoValidator = { name: 'CertificationRequestInfo', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'certificationRequestInfo', value: [{ name: 'CertificationRequestInfo.integer', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: 'certificationRequestInfoVersion' }, { // Name (subject) (RDNSequence) name: 'CertificationRequestInfo.subject', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'certificationRequestInfoSubject' }, // SubjectPublicKeyInfo publicKeyValidator, { name: 'CertificationRequestInfo.attributes', tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, optional: true, capture: 'certificationRequestInfoAttributes', value: [{ name: 'CertificationRequestInfo.attributes', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: 'CertificationRequestInfo.attributes.type', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false }, { name: 'CertificationRequestInfo.attributes.value', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true }] }] }] }; // validator for a CertificationRequest structure var certificationRequestValidator = { name: 'CertificationRequest', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: 'csr', value: [ certificationRequestInfoValidator, { // AlgorithmIdentifier (signature algorithm) name: 'CertificationRequest.signatureAlgorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // algorithm name: 'CertificationRequest.signatureAlgorithm.algorithm', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: 'csrSignatureOid' }, { name: 'CertificationRequest.signatureAlgorithm.parameters', tagClass: asn1.Class.UNIVERSAL, optional: true, captureAsn1: 'csrSignatureParams' }] }, { // signature name: 'CertificationRequest.signature', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, captureBitStringValue: 'csrSignature' } ] }; /** * Converts an RDNSequence of ASN.1 DER-encoded RelativeDistinguishedName * sets into an array with objects that have type and value properties. * * @param rdn the RDNSequence to convert. * @param md a message digest to append type and value to if provided. */ pki.RDNAttributesAsArray = function(rdn, md) { var rval = []; // each value in 'rdn' in is a SET of RelativeDistinguishedName var set, attr, obj; for(var si = 0; si < rdn.value.length; ++si) { // get the RelativeDistinguishedName set set = rdn.value[si]; // each value in the SET is an AttributeTypeAndValue sequence // containing first a type (an OID) and second a value (defined by // the OID) for(var i = 0; i < set.value.length; ++i) { obj = {}; attr = set.value[i]; obj.type = asn1.derToOid(attr.value[0].value); obj.value = attr.value[1].value; obj.valueTagClass = attr.value[1].type; // if the OID is known, get its name and short name if(obj.type in oids) { obj.name = oids[obj.type]; if(obj.name in _shortNames) { obj.shortName = _shortNames[obj.name]; } } if(md) { md.update(obj.type); md.update(obj.value); } rval.push(obj); } } return rval; }; /** * Converts ASN.1 CRIAttributes into an array with objects that have type and * value properties. * * @param attributes the CRIAttributes to convert. */ pki.CRIAttributesAsArray = function(attributes) { var rval = []; // each value in 'attributes' in is a SEQUENCE with an OID and a SET for(var si = 0; si < attributes.length; ++si) { // get the attribute sequence var seq = attributes[si]; // each value in the SEQUENCE containing first a type (an OID) and // second a set of values (defined by the OID) var type = asn1.derToOid(seq.value[0].value); var values = seq.value[1].value; for(var vi = 0; vi < values.length; ++vi) { var obj = {}; obj.type = type; obj.value = values[vi].value; obj.valueTagClass = values[vi].type; // if the OID is known, get its name and short name if(obj.type in oids) { obj.name = oids[obj.type]; if(obj.name in _shortNames) { obj.shortName = _shortNames[obj.name]; } } // parse extensions if(obj.type === oids.extensionRequest) { obj.extensions = []; for(var ei = 0; ei < obj.value.length; ++ei) { obj.extensions.push(pki.certificateExtensionFromAsn1(obj.value[ei])); } } rval.push(obj); } } return rval; }; /** * Gets an issuer or subject attribute from its name, type, or short name. * * @param obj the issuer or subject object. * @param options a short name string or an object with: * shortName the short name for the attribute. * name the name for the attribute. * type the type for the attribute. * * @return the attribute. */ function _getAttribute(obj, options) { if(typeof options === 'string') { options = {shortName: options}; } var rval = null; var attr; for(var i = 0; rval === null && i < obj.attributes.length; ++i) { attr = obj.attributes[i]; if(options.type && options.type === attr.type) { rval = attr; } else if(options.name && options.name === attr.name) { rval = attr; } else if(options.shortName && options.shortName === attr.shortName) { rval = attr; } } return rval; } /** * Converts signature parameters from ASN.1 structure. * * Currently only RSASSA-PSS supported. The PKCS#1 v1.5 signature scheme had * no parameters. * * RSASSA-PSS-params ::= SEQUENCE { * hashAlgorithm [0] HashAlgorithm DEFAULT * sha1Identifier, * maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT * mgf1SHA1Identifier, * saltLength [2] INTEGER DEFAULT 20, * trailerField [3] INTEGER DEFAULT 1 * } * * HashAlgorithm ::= AlgorithmIdentifier * * MaskGenAlgorithm ::= AlgorithmIdentifier * * AlgorithmIdentifer ::= SEQUENCE { * algorithm OBJECT IDENTIFIER, * parameters ANY DEFINED BY algorithm OPTIONAL * } * * @param oid The OID specifying the signature algorithm * @param obj The ASN.1 structure holding the parameters * @param fillDefaults Whether to use return default values where omitted * @return signature parameter object */ var _readSignatureParameters = function(oid, obj, fillDefaults) { var params = {}; if(oid !== oids['RSASSA-PSS']) { return params; } if(fillDefaults) { params = { hash: { algorithmOid: oids['sha1'] }, mgf: { algorithmOid: oids['mgf1'], hash: { algorithmOid: oids['sha1'] } }, saltLength: 20 }; } var capture = {}; var errors = []; if(!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) { var error = new Error('Cannot read RSASSA-PSS parameter block.'); error.errors = errors; throw error; } if(capture.hashOid !== undefined) { params.hash = params.hash || {}; params.hash.algorithmOid = asn1.derToOid(capture.hashOid); } if(capture.maskGenOid !== undefined) { params.mgf = params.mgf || {}; params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid); params.mgf.hash = params.mgf.hash || {}; params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid); } if(capture.saltLength !== undefined) { params.saltLength = capture.saltLength.charCodeAt(0); } return params; }; /** * Converts an X.509 certificate from PEM format. * * Note: If the certificate is to be verified then compute hash should * be set to true. This will scan the TBSCertificate part of the ASN.1 * object while it is converted so it doesn't need to be converted back * to ASN.1-DER-encoding later. * * @param pem the PEM-formatted certificate. * @param computeHash true to compute the hash for verification. * @param strict true to be strict when checking ASN.1 value lengths, false to * allow truncated values (default: true). * * @return the certificate. */ pki.certificateFromPem = function(pem, computeHash, strict) { var msg = forge.pem.decode(pem)[0]; if(msg.type !== 'CERTIFICATE' && msg.type !== 'X509 CERTIFICATE' && msg.type !== 'TRUSTED CERTIFICATE') { var error = new Error( 'Could not convert certificate from PEM; PEM header type ' + 'is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'); error.headerType = msg.type; throw error; } if(msg.procType && msg.procType.type === 'ENCRYPTED') { throw new Error( 'Could not convert certificate from PEM; PEM is encrypted.'); } // convert DER to ASN.1 object var obj = asn1.fromDer(msg.body, strict); return pki.certificateFromAsn1(obj, computeHash); }; /** * Converts an X.509 certificate to PEM format. * * @param cert the certificate. * @param maxline the maximum characters per line, defaults to 64. * * @return the PEM-formatted certificate. */ pki.certificateToPem = function(cert, maxline) { // convert to ASN.1, then DER, then PEM-encode var msg = { type: 'CERTIFICATE', body: asn1.toDer(pki.certificateToAsn1(cert)).getBytes() }; return forge.pem.encode(msg, {maxline: maxline}); }; /** * Converts an RSA public key from PEM format. * * @param pem the PEM-formatted public key. * * @return the public key. */ pki.publicKeyFromPem = function(pem) { var msg = forge.pem.decode(pem)[0]; if(msg.type !== 'PUBLIC KEY' && msg.type !== 'RSA PUBLIC KEY') { var error = new Error('Could not convert public key from PEM; PEM header ' + 'type is not "PUBLIC KEY" or "RSA PUBLIC KEY".'); error.headerType = msg.type; throw error; } if(msg.procType && msg.procType.type === 'ENCRYPTED') { throw new Error('Could not convert public key from PEM; PEM is encrypted.'); } // convert DER to ASN.1 object var obj = asn1.fromDer(msg.body); return pki.publicKeyFromAsn1(obj); }; /** * Converts an RSA public key to PEM format (using a SubjectPublicKeyInfo). * * @param key the public key. * @param maxline the maximum characters per line, defaults to 64. * * @return the PEM-formatted public key. */ pki.publicKeyToPem = function(key, maxline) { // convert to ASN.1, then DER, then PEM-encode var msg = { type: 'PUBLIC KEY', body: asn1.toDer(pki.publicKeyToAsn1(key)).getBytes() }; return forge.pem.encode(msg, {maxline: maxline}); }; /** * Converts an RSA public key to PEM format (using an RSAPublicKey). * * @param key the public key. * @param maxline the maximum characters per line, defaults to 64. * * @return the PEM-formatted public key. */ pki.publicKeyToRSAPublicKeyPem = function(key, maxline) { // convert to ASN.1, then DER, then PEM-encode var msg = { type: 'RSA PUBLIC KEY', body: asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes() }; return forge.pem.encode(msg, {maxline: maxline}); }; /** * Gets a fingerprint for the given public key. * * @param options the options to use. * [md] the message digest object to use (defaults to forge.md.sha1). * [type] the type of fingerprint, such as 'RSAPublicKey', * 'SubjectPublicKeyInfo' (defaults to 'RSAPublicKey'). * [encoding] an alternative output encoding, such as 'hex' * (defaults to none, outputs a byte buffer). * [delimiter] the delimiter to use between bytes for 'hex' encoded * output, eg: ':' (defaults to none). * * @return the fingerprint as a byte buffer or other encoding based on options. */ pki.getPublicKeyFingerprint = function(key, options) { options = options || {}; var md = options.md || forge.md.sha1.create(); var type = options.type || 'RSAPublicKey'; var bytes; switch(type) { case 'RSAPublicKey': bytes = asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes(); break; case 'SubjectPublicKeyInfo': bytes = asn1.toDer(pki.publicKeyToAsn1(key)).getBytes(); break; default: throw new Error('Unknown fingerprint type "' + options.type + '".'); } // hash public key bytes md.start(); md.update(bytes); var digest = md.digest(); if(options.encoding === 'hex') { var hex = digest.toHex(); if(options.delimiter) { return hex.match(/.{2}/g).join(options.delimiter); } return hex; } else if(options.encoding === 'binary') { return digest.getBytes(); } else if(options.encoding) { throw new Error('Unknown encoding "' + options.encoding + '".'); } return digest; }; /** * Converts a PKCS#10 certification request (CSR) from PEM format. * * Note: If the certification request is to be verified then compute hash * should be set to true. This will scan the CertificationRequestInfo part of * the ASN.1 object while it is converted so it doesn't need to be converted * back to ASN.1-DER-encoding later. * * @param pem the PEM-formatted certificate. * @param computeHash true to compute the hash for verification. * @param strict true to be strict when checking ASN.1 value lengths, false to * allow truncated values (default: true). * * @return the certification request (CSR). */ pki.certificationRequestFromPem = function(pem, computeHash, strict) { var msg = forge.pem.decode(pem)[0]; if(msg.type !== 'CERTIFICATE REQUEST') { var error = new Error('Could not convert certification request from PEM; ' + 'PEM header type is not "CERTIFICATE REQUEST".'); error.headerType = msg.type; throw error; } if(msg.procType && msg.procType.type === 'ENCRYPTED') { throw new Error('Could not convert certification request from PEM; ' + 'PEM is encrypted.'); } // convert DER to ASN.1 object var obj = asn1.fromDer(msg.body, strict); return pki.certificationRequestFromAsn1(obj, computeHash); }; /** * Converts a PKCS#10 certification request (CSR) to PEM format. * * @param csr the certification request. * @param maxline the maximum characters per line, defaults to 64. * * @return the PEM-formatted certification request. */ pki.certificationRequestToPem = function(csr, maxline) { // convert to ASN.1, then DER, then PEM-encode var msg = { type: 'CERTIFICATE REQUEST', body: asn1.toDer(pki.certificationRequestToAsn1(csr)).getBytes() }; return forge.pem.encode(msg, {maxline: maxline}); }; /** * Creates an empty X.509v3 RSA certificate. * * @return the certificate. */ pki.createCertificate = function() { var cert = {}; cert.version = 0x02; cert.serialNumber = '00'; cert.signatureOid = null; cert.signature = null; cert.siginfo = {}; cert.siginfo.algorithmOid = null; cert.validity = {}; cert.validity.notBefore = new Date(); cert.validity.notAfter = new Date(); cert.issuer = {}; cert.issuer.getField = function(sn) { return _getAttribute(cert.issuer, sn); }; cert.issuer.addField = function(attr) { _fillMissingFields([attr]); cert.issuer.attributes.push(attr); }; cert.issuer.attributes = []; cert.issuer.hash = null; cert.subject = {}; cert.subject.getField = function(sn) { return _getAttribute(cert.subject, sn); }; cert.subject.addField = function(attr) { _fillMissingFields([attr]); cert.subject.attributes.push(attr); }; cert.subject.attributes = []; cert.subject.hash = null; cert.extensions = []; cert.publicKey = null; cert.md = null; /** * Sets the subject of this certificate. * * @param attrs the array of subject attributes to use. * @param uniqueId an optional a unique ID to use. */ cert.setSubject = function(attrs, uniqueId) { // set new attributes, clear hash _fillMissingFields(attrs); cert.subject.attributes = attrs; delete cert.subject.uniqueId; if(uniqueId) { // TODO: support arbitrary bit length ids cert.subject.uniqueId = uniqueId; } cert.subject.hash = null; }; /** * Sets the issuer of this certificate. * * @param attrs the array of issuer attributes to use. * @param uniqueId an optional a unique ID to use. */ cert.setIssuer = function(attrs, uniqueId) { // set new attributes, clear hash _fillMissingFields(attrs); cert.issuer.attributes = attrs; delete cert.issuer.uniqueId; if(uniqueId) { // TODO: support arbitrary bit length ids cert.issuer.uniqueId = uniqueId; } cert.issuer.hash = null; }; /** * Sets the extensions of this certificate. * * @param exts the array of extensions to use. */ cert.setExtensions = function(exts) { for(var i = 0; i < exts.length; ++i) { _fillMissingExtensionFields(exts[i], {cert: cert}); } // set new extensions cert.extensions = exts; }; /** * Gets an extension by its name or id. * * @param options the name to use or an object with: * name the name to use. * id the id to use. * * @return the extension or null if not found. */ cert.getExtension = function(options) { if(typeof options === 'string') { options = {name: options}; } var rval = null; var ext; for(var i = 0; rval === null && i < cert.extensions.length; ++i) { ext = cert.extensions[i]; if(options.id && ext.id === options.id) { rval = ext; } else if(options.name && ext.name === options.name) { rval = ext; } } return rval; }; /** * Signs this certificate using the given private key. * * @param key the private key to sign with. * @param md the message digest object to use (defaults to forge.md.sha1). */ cert.sign = function(key, md) { // TODO: get signature OID from private key cert.md = md || forge.md.sha1.create(); var algorithmOid = oids[cert.md.algorithm + 'WithRSAEncryption']; if(!algorithmOid) { var error = new Error('Could not compute certificate digest. ' + 'Unknown message digest algorithm OID.'); error.algorithm = cert.md.algorithm; throw error; } cert.signatureOid = cert.siginfo.algorithmOid = algorithmOid; // get TBSCertificate, convert to DER cert.tbsCertificate = pki.getTBSCertificate(cert); var bytes = asn1.toDer(cert.tbsCertificate); // digest and sign cert.md.update(bytes.getBytes()); cert.signature = key.sign(cert.md); }; /** * Attempts verify the signature on the passed certificate using this * certificate's public key. * * @param child the certificate to verify. * * @return true if verified, false if not. */ cert.verify = function(child) { var rval = false; if(!cert.issued(child)) { var issuer = child.issuer; var subject = cert.subject; var error = new Error( 'The parent certificate did not issue the given child ' + 'certificate; the child certificate\'s issuer does not match the ' + 'parent\'s subject.'); error.expectedIssuer = issuer.attributes; error.actualIssuer = subject.attributes; throw error; } var md = child.md; if(md === null) { // check signature OID for supported signature types if(child.signatureOid in oids) { var oid = oids[child.signatureOid]; switch(oid) { case 'sha1WithRSAEncryption': md = forge.md.sha1.create(); break; case 'md5WithRSAEncryption': md = forge.md.md5.create(); break; case 'sha256WithRSAEncryption': md = forge.md.sha256.create(); break; case 'sha384WithRSAEncryption': md = forge.md.sha384.create(); break; case 'sha512WithRSAEncryption': md = forge.md.sha512.create(); break; case 'RSASSA-PSS': md = forge.md.sha256.create(); break; } } if(md === null) { var error = new Error('Could not compute certificate digest. ' + 'Unknown signature OID.'); error.signatureOid = child.signatureOid; throw error; } // produce DER formatted TBSCertificate and digest it var tbsCertificate = child.tbsCertificate || pki.getTBSCertificate(child); var bytes = asn1.toDer(tbsCertificate); md.update(bytes.getBytes()); } if(md !== null) { var scheme; switch(child.signatureOid) { case oids.sha1WithRSAEncryption: scheme = undefined; /* use PKCS#1 v1.5 padding scheme */ break; case oids['RSASSA-PSS']: var hash, mgf; /* initialize mgf */ hash = oids[child.signatureParameters.mgf.hash.algorithmOid]; if(hash === undefined || forge.md[hash] === undefined) { var error = new Error('Unsupported MGF hash function.'); error.oid = child.signatureParameters.mgf.hash.algorithmOid; error.name = hash; throw error; } mgf = oids[child.signatureParameters.mgf.algorithmOid]; if(mgf === undefined || forge.mgf[mgf] === undefined) { var error = new Error('Unsupported MGF function.'); error.oid = child.signatureParameters.mgf.algorithmOid; error.name = mgf; throw error; } mgf = forge.mgf[mgf].create(forge.md[hash].create()); /* initialize hash function */ hash = oids[child.signatureParameters.hash.algorithmOid]; if(hash === undefined || forge.md[hash] === undefined) { throw { message: 'Unsupported RSASSA-PSS hash function.', oid: child.signatureParameters.hash.algorithmOid, name: hash }; } scheme = forge.pss.create(forge.md[hash].create(), mgf, child.signatureParameters.saltLength); break; } // verify signature on cert using public key rval = cert.publicKey.verify( md.digest().getBytes(), child.signature, scheme); } return rval; }; /** * Returns true if this certificate's issuer matches the passed * certificate's subject. Note that no signature check is performed. * * @param parent the certificate to check. * * @return true if this certificate's issuer matches the passed certificate's * subject. */ cert.isIssuer = function(parent) { var rval = false; var i = cert.issuer; var s = parent.subject; // compare hashes if present if(i.hash && s.hash) { rval = (i.hash === s.hash); } else if(i.attributes.length === s.attributes.length) { // all attributes are the same so issuer matches subject rval = true; var iattr, sattr; for(var n = 0; rval && n < i.attributes.length; ++n) { iattr = i.attributes[n]; sattr = s.attributes[n]; if(iattr.type !== sattr.type || iattr.value !== sattr.value) { // attribute mismatch rval = false; } } } return rval; }; /** * Returns true if this certificate's subject matches the issuer of the * given certificate). Note that not signature check is performed. * * @param child the certificate to check. * * @return true if this certificate's subject matches the passed * certificate's issuer. */ cert.issued = function(child) { return child.isIssuer(cert); }; /** * Generates the subjectKeyIdentifier for this certificate as byte buffer. * * @return the subjectKeyIdentifier for this certificate as byte buffer. */ cert.generateSubjectKeyIdentifier = function() { /* See: 4.2.1.2 section of the the RFC3280, keyIdentifier is either: (1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the value of the BIT STRING subjectPublicKey (excluding the tag, length, and number of unused bits). (2) The keyIdentifier is composed of a four bit type field with the value 0100 followed by the least significant 60 bits of the SHA-1 hash of the value of the BIT STRING subjectPublicKey (excluding the tag, length, and number of unused bit string bits). */ // skipping the tag, length, and number of unused bits is the same // as just using the RSAPublicKey (for RSA keys, which are the // only ones supported) return pki.getPublicKeyFingerprint(cert.publicKey, {type: 'RSAPublicKey'}); }; /** * Verifies the subjectKeyIdentifier extension value for this certificate * against its public key. If no extension is found, false will be * returned. * * @return true if verified, false if not. */ cert.verifySubjectKeyIdentifier = function() { var oid = oids['subjectKeyIdentifier']; for(var i = 0; i < cert.extensions.length; ++i) { var ext = cert.extensions[i]; if(ext.id === oid) { var ski = cert.generateSubjectKeyIdentifier().getBytes(); return (forge.util.hexToBytes(ext.subjectKeyIdentifier) === ski); } } return false; }; return cert; }; /** * Converts an X.509v3 RSA certificate from an ASN.1 object. * * Note: If the certificate is to be verified then compute hash should * be set to true. There is currently no implementation for converting * a certificate back to ASN.1 so the TBSCertificate part of the ASN.1 * object needs to be scanned before the cert object is created. * * @param obj the asn1 representation of an X.509v3 RSA certificate. * @param computeHash true to compute the hash for verification. * * @return the certificate. */ pki.certificateFromAsn1 = function(obj, computeHash) { // validate certificate and capture data var capture = {}; var errors = []; if(!asn1.validate(obj, x509CertificateValidator, capture, errors)) { var error = new Error('Cannot read X.509 certificate. ' + 'ASN.1 object is not an X509v3 Certificate.'); error.errors = errors; throw error; } // get oid var oid = asn1.derToOid(capture.publicKeyOid); if(oid !== pki.oids.rsaEncryption) { throw new Error('Cannot read public key. OID is not RSA.'); } // create certificate var cert = pki.createCertificate(); cert.version = capture.certVersion ? capture.certVersion.charCodeAt(0) : 0; var serial = forge.util.createBuffer(capture.certSerialNumber); cert.serialNumber = serial.toHex(); cert.signatureOid = forge.asn1.derToOid(capture.certSignatureOid); cert.signatureParameters = _readSignatureParameters( cert.signatureOid, capture.certSignatureParams, true); cert.siginfo.algorithmOid = forge.asn1.derToOid(capture.certinfoSignatureOid); cert.siginfo.parameters = _readSignatureParameters(cert.siginfo.algorithmOid, capture.certinfoSignatureParams, false); cert.signature = capture.certSignature; var validity = []; if(capture.certValidity1UTCTime !== undefined) { validity.push(asn1.utcTimeToDate(capture.certValidity1UTCTime)); } if(capture.certValidity2GeneralizedTime !== undefined) { validity.push(asn1.generalizedTimeToDate( capture.certValidity2GeneralizedTime)); } if(capture.certValidity3UTCTime !== undefined) { validity.push(asn1.utcTimeToDate(capture.certValidity3UTCTime)); } if(capture.certValidity4GeneralizedTime !== undefined) { validity.push(asn1.generalizedTimeToDate( capture.certValidity4GeneralizedTime)); } if(validity.length > 2) { throw new Error('Cannot read notBefore/notAfter validity times; more ' + 'than two times were provided in the certificate.'); } if(validity.length < 2) { throw new Error('Cannot read notBefore/notAfter validity times; they ' + 'were not provided as either UTCTime or GeneralizedTime.'); } cert.validity.notBefore = validity[0]; cert.validity.notAfter = validity[1]; // keep TBSCertificate to preserve signature when exporting cert.tbsCertificate = capture.tbsCertificate; if(computeHash) { // check signature OID for supported signature types cert.md = null; if(cert.signatureOid in oids) { var oid = oids[cert.signatureOid]; switch(oid) { case 'sha1WithRSAEncryption': cert.md = forge.md.sha1.create(); break; case 'md5WithRSAEncryption': cert.md = forge.md.md5.create(); break; case 'sha256WithRSAEncryption': cert.md = forge.md.sha256.create(); break; case 'sha384WithRSAEncryption': cert.md = forge.md.sha384.create(); break; case 'sha512WithRSAEncryption': cert.md = forge.md.sha512.create(); break; case 'RSASSA-PSS': cert.md = forge.md.sha256.create(); break; } } if(cert.md === null) { var error = new Error('Could not compute certificate digest. ' + 'Unknown signature OID.'); error.signatureOid = cert.signatureOid; throw error; } // produce DER formatted TBSCertificate and digest it var bytes = asn1.toDer(cert.tbsCertificate); cert.md.update(bytes.getBytes()); } // handle issuer, build issuer message digest var imd = forge.md.sha1.create(); cert.issuer.getField = function(sn) { return _getAttribute(cert.issuer, sn); }; cert.issuer.addField = function(attr) { _fillMissingFields([attr]); cert.issuer.attributes.push(attr); }; cert.issuer.attributes = pki.RDNAttributesAsArray(capture.certIssuer, imd); if(capture.certIssuerUniqueId) { cert.issuer.uniqueId = capture.certIssuerUniqueId; } cert.issuer.hash = imd.digest().toHex(); // handle subject, build subject message digest var smd = forge.md.sha1.create(); cert.subject.getField = function(sn) { return _getAttribute(cert.subject, sn); }; cert.subject.addField = function(attr) { _fillMissingFields([attr]); cert.subject.attributes.push(attr); }; cert.subject.attributes = pki.RDNAttributesAsArray(capture.certSubject, smd); if(capture.certSubjectUniqueId) { cert.subject.uniqueId = capture.certSubjectUniqueId; } cert.subject.hash = smd.digest().toHex(); // handle extensions if(capture.certExtensions) { cert.extensions = pki.certificateExtensionsFromAsn1(capture.certExtensions); } else { cert.extensions = []; } // convert RSA public key from ASN.1 cert.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo); return cert; }; /** * Converts an ASN.1 extensions object (with extension sequences as its * values) into an array of extension objects with types and values. * * Supported extensions: * * id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 } * KeyUsage ::= BIT STRING { * digitalSignature (0), * nonRepudiation (1), * keyEncipherment (2), * dataEncipherment (3), * keyAgreement (4), * keyCertSign (5), * cRLSign (6), * encipherOnly (7), * decipherOnly (8) * } * * id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 } * BasicConstraints ::= SEQUENCE { * cA BOOLEAN DEFAULT FALSE, * pathLenConstraint INTEGER (0..MAX) OPTIONAL * } * * subjectAltName EXTENSION ::= { * SYNTAX GeneralNames * IDENTIFIED BY id-ce-subjectAltName * } * * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName * * GeneralName ::= CHOICE { * otherName [0] INSTANCE OF OTHER-NAME, * rfc822Name [1] IA5String, * dNSName [2] IA5String, * x400Address [3] ORAddress, * directoryName [4] Name, * ediPartyName [5] EDIPartyName, * uniformResourceIdentifier [6] IA5String, * IPAddress [7] OCTET STRING, * registeredID [8] OBJECT IDENTIFIER * } * * OTHER-NAME ::= TYPE-IDENTIFIER * * EDIPartyName ::= SEQUENCE { * nameAssigner [0] DirectoryString {ub-name} OPTIONAL, * partyName [1] DirectoryString {ub-name} * } * * @param exts the extensions ASN.1 with extension sequences to parse. * * @return the array. */ pki.certificateExtensionsFromAsn1 = function(exts) { var rval = []; for(var i = 0; i < exts.value.length; ++i) { // get extension sequence var extseq = exts.value[i]; for(var ei = 0; ei < extseq.value.length; ++ei) { rval.push(pki.certificateExtensionFromAsn1(extseq.value[ei])); } } return rval; }; /** * Parses a single certificate extension from ASN.1. * * @param ext the extension in ASN.1 format. * * @return the parsed extension as an object. */ pki.certificateExtensionFromAsn1 = function(ext) { // an extension has: // [0] extnID OBJECT IDENTIFIER // [1] critical BOOLEAN DEFAULT FALSE // [2] extnValue OCTET STRING var e = {}; e.id = asn1.derToOid(ext.value[0].value); e.critical = false; if(ext.value[1].type === asn1.Type.BOOLEAN) { e.critical = (ext.value[1].value.charCodeAt(0) !== 0x00); e.value = ext.value[2].value; } else { e.value = ext.value[1].value; } // if the oid is known, get its name if(e.id in oids) { e.name = oids[e.id]; // handle key usage if(e.name === 'keyUsage') { // get value as BIT STRING var ev = asn1.fromDer(e.value); var b2 = 0x00; var b3 = 0x00; if(ev.value.length > 1) { // skip first byte, just indicates unused bits which // will be padded with 0s anyway // get bytes with flag bits b2 = ev.value.charCodeAt(1); b3 = ev.value.length > 2 ? ev.value.charCodeAt(2) : 0; } // set flags e.digitalSignature = (b2 & 0x80) === 0x80; e.nonRepudiation = (b2 & 0x40) === 0x40; e.keyEncipherment = (b2 & 0x20) === 0x20; e.dataEncipherment = (b2 & 0x10) === 0x10; e.keyAgreement = (b2 & 0x08) === 0x08; e.keyCertSign = (b2 & 0x04) === 0x04; e.cRLSign = (b2 & 0x02) === 0x02; e.encipherOnly = (b2 & 0x01) === 0x01; e.decipherOnly = (b3 & 0x80) === 0x80; } else if(e.name === 'basicConstraints') { // handle basic constraints // get value as SEQUENCE var ev = asn1.fromDer(e.value); // get cA BOOLEAN flag (defaults to false) if(ev.value.length > 0 && ev.value[0].type === asn1.Type.BOOLEAN) { e.cA = (ev.value[0].value.charCodeAt(0) !== 0x00); } else { e.cA = false; } // get path length constraint var value = null; if(ev.value.length > 0 && ev.value[0].type === asn1.Type.INTEGER) { value = ev.value[0].value; } else if(ev.value.length > 1) { value = ev.value[1].value; } if(value !== null) { e.pathLenConstraint = asn1.derToInteger(value); } } else if(e.name === 'extKeyUsage') { // handle extKeyUsage // value is a SEQUENCE of OIDs var ev = asn1.fromDer(e.value); for(var vi = 0; vi < ev.value.length; ++vi) { var oid = asn1.derToOid(ev.value[vi].value); if(oid in oids) { e[oids[oid]] = true; } else { e[oid] = true; } } } else if(e.name === 'nsCertType') { // handle nsCertType // get value as BIT STRING var ev = asn1.fromDer(e.value); var b2 = 0x00; if(ev.value.length > 1) { // skip first byte, just indicates unused bits which // will be padded with 0s anyway // get bytes with flag bits b2 = ev.value.charCodeAt(1); } // set flags e.client = (b2 & 0x80) === 0x80; e.server = (b2 & 0x40) === 0x40; e.email = (b2 & 0x20) === 0x20; e.objsign = (b2 & 0x10) === 0x10; e.reserved = (b2 & 0x08) === 0x08; e.sslCA = (b2 & 0x04) === 0x04; e.emailCA = (b2 & 0x02) === 0x02; e.objCA = (b2 & 0x01) === 0x01; } else if( e.name === 'subjectAltName' || e.name === 'issuerAltName') { // handle subjectAltName/issuerAltName e.altNames = []; // ev is a SYNTAX SEQUENCE var gn; var ev = asn1.fromDer(e.value); for(var n = 0; n < ev.value.length; ++n) { // get GeneralName gn = ev.value[n]; var altName = { type: gn.type, value: gn.value }; e.altNames.push(altName); // Note: Support for types 1,2,6,7,8 switch(gn.type) { // rfc822Name case 1: // dNSName case 2: // uniformResourceIdentifier (URI) case 6: break; // IPAddress case 7: // convert to IPv4/IPv6 string representation altName.ip = forge.util.bytesToIP(gn.value); break; // registeredID case 8: altName.oid = asn1.derToOid(gn.value); break; default: // unsupported } } } else if(e.name === 'subjectKeyIdentifier') { // value is an OCTETSTRING w/the hash of the key-type specific // public key structure (eg: RSAPublicKey) var ev = asn1.fromDer(e.value); e.subjectKeyIdentifier = forge.util.bytesToHex(ev.value); } } return e; }; /** * Converts a PKCS#10 certification request (CSR) from an ASN.1 object. * * Note: If the certification request is to be verified then compute hash * should be set to true. There is currently no implementation for converting * a certificate back to ASN.1 so the CertificationRequestInfo part of the * ASN.1 object needs to be scanned before the csr object is created. * * @param obj the asn1 representation of a PKCS#10 certification request (CSR). * @param computeHash true to compute the hash for verification. * * @return the certification request (CSR). */ pki.certificationRequestFromAsn1 = function(obj, computeHash) { // validate certification request and capture data var capture = {}; var errors = []; if(!asn1.validate(obj, certificationRequestValidator, capture, errors)) { var error = new Error('Cannot read PKCS#10 certificate request. ' + 'ASN.1 object is not a PKCS#10 CertificationRequest.'); error.errors = errors; throw error; } // get oid var oid = asn1.derToOid(capture.publicKeyOid); if(oid !== pki.oids.rsaEncryption) { throw new Error('Cannot read public key. OID is not RSA.'); } // create certification request var csr = pki.createCertificationRequest(); csr.version = capture.csrVersion ? capture.csrVersion.charCodeAt(0) : 0; csr.signatureOid = forge.asn1.derToOid(capture.csrSignatureOid); csr.signatureParameters = _readSignatureParameters( csr.signatureOid, capture.csrSignatureParams, true); csr.siginfo.algorithmOid = forge.asn1.derToOid(capture.csrSignatureOid); csr.siginfo.parameters = _readSignatureParameters( csr.siginfo.algorithmOid, capture.csrSignatureParams, false); csr.signature = capture.csrSignature; // keep CertificationRequestInfo to preserve signature when exporting csr.certificationRequestInfo = capture.certificationRequestInfo; if(computeHash) { // check signature OID for supported signature types csr.md = null; if(csr.signatureOid in oids) { var oid = oids[csr.signatureOid]; switch(oid) { case 'sha1WithRSAEncryption': csr.md = forge.md.sha1.create(); break; case 'md5WithRSAEncryption': csr.md = forge.md.md5.create(); break; case 'sha256WithRSAEncryption': csr.md = forge.md.sha256.create(); break; case 'sha384WithRSAEncryption': csr.md = forge.md.sha384.create(); break; case 'sha512WithRSAEncryption': csr.md = forge.md.sha512.create(); break; case 'RSASSA-PSS': csr.md = forge.md.sha256.create(); break; } } if(csr.md === null) { var error = new Error('Could not compute certification request digest. ' + 'Unknown signature OID.'); error.signatureOid = csr.signatureOid; throw error; } // produce DER formatted CertificationRequestInfo and digest it var bytes = asn1.toDer(csr.certificationRequestInfo); csr.md.update(bytes.getBytes()); } // handle subject, build subject message digest var smd = forge.md.sha1.create(); csr.subject.getField = function(sn) { return _getAttribute(csr.subject, sn); }; csr.subject.addField = function(attr) { _fillMissingFields([attr]); csr.subject.attributes.push(attr); }; csr.subject.attributes = pki.RDNAttributesAsArray( capture.certificationRequestInfoSubject, smd); csr.subject.hash = smd.digest().toHex(); // convert RSA public key from ASN.1 csr.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo); // convert attributes from ASN.1 csr.getAttribute = function(sn) { return _getAttribute(csr, sn); }; csr.addAttribute = function(attr) { _fillMissingFields([attr]); csr.attributes.push(attr); }; csr.attributes = pki.CRIAttributesAsArray( capture.certificationRequestInfoAttributes || []); return csr; }; /** * Creates an empty certification request (a CSR or certificate signing * request). Once created, its public key and attributes can be set and then * it can be signed. * * @return the empty certification request. */ pki.createCertificationRequest = function() { var csr = {}; csr.version = 0x00; csr.signatureOid = null; csr.signature = null; csr.siginfo = {}; csr.siginfo.algorithmOid = null; csr.subject = {}; csr.subject.getField = function(sn) { return _getAttribute(csr.subject, sn); }; csr.subject.addField = function(attr) { _fillMissingFields([attr]); csr.subject.attributes.push(attr); }; csr.subject.attributes = []; csr.subject.hash = null; csr.publicKey = null; csr.attributes = []; csr.getAttribute = function(sn) { return _getAttribute(csr, sn); }; csr.addAttribute = function(attr) { _fillMissingFields([attr]); csr.attributes.push(attr); }; csr.md = null; /** * Sets the subject of this certification request. * * @param attrs the array of subject attributes to use. */ csr.setSubject = function(attrs) { // set new attributes _fillMissingFields(attrs); csr.subject.attributes = attrs; csr.subject.hash = null; }; /** * Sets the attributes of this certification request. * * @param attrs the array of attributes to use. */ csr.setAttributes = function(attrs) { // set new attributes _fillMissingFields(attrs); csr.attributes = attrs; }; /** * Signs this certification request using the given private key. * * @param key the private key to sign with. * @param md the message digest object to use (defaults to forge.md.sha1). */ csr.sign = function(key, md) { // TODO: get signature OID from private key csr.md = md || forge.md.sha1.create(); var algorithmOid = oids[csr.md.algorithm + 'WithRSAEncryption']; if(!algorithmOid) { var error = new Error('Could not compute certification request digest. ' + 'Unknown message digest algorithm OID.'); error.algorithm = csr.md.algorithm; throw error; } csr.signatureOid = csr.siginfo.algorithmOid = algorithmOid; // get CertificationRequestInfo, convert to DER csr.certificationRequestInfo = pki.getCertificationRequestInfo(csr); var bytes = asn1.toDer(csr.certificationRequestInfo); // digest and sign csr.md.update(bytes.getBytes()); csr.signature = key.sign(csr.md); }; /** * Attempts verify the signature on the passed certification request using * its public key. * * A CSR that has been exported to a file in PEM format can be verified using * OpenSSL using this command: * * openssl req -in -verify -noout -text * * @return true if verified, false if not. */ csr.verify = function() { var rval = false; var md = csr.md; if(md === null) { // check signature OID for supported signature types if(csr.signatureOid in oids) { // TODO: create DRY `OID to md` function var oid = oids[csr.signatureOid]; switch(oid) { case 'sha1WithRSAEncryption': md = forge.md.sha1.create(); break; case 'md5WithRSAEncryption': md = forge.md.md5.create(); break; case 'sha256WithRSAEncryption': md = forge.md.sha256.create(); break; case 'sha384WithRSAEncryption': md = forge.md.sha384.create(); break; case 'sha512WithRSAEncryption': md = forge.md.sha512.create(); break; case 'RSASSA-PSS': md = forge.md.sha256.create(); break; } } if(md === null) { var error = new Error( 'Could not compute certification request digest. ' + 'Unknown signature OID.'); error.signatureOid = csr.signatureOid; throw error; } // produce DER formatted CertificationRequestInfo and digest it var cri = csr.certificationRequestInfo || pki.getCertificationRequestInfo(csr); var bytes = asn1.toDer(cri); md.update(bytes.getBytes()); } if(md !== null) { var scheme; switch(csr.signatureOid) { case oids.sha1WithRSAEncryption: /* use PKCS#1 v1.5 padding scheme */ break; case oids['RSASSA-PSS']: var hash, mgf; /* initialize mgf */ hash = oids[csr.signatureParameters.mgf.hash.algorithmOid]; if(hash === undefined || forge.md[hash] === undefined) { var error = new Error('Unsupported MGF hash function.'); error.oid = csr.signatureParameters.mgf.hash.algorithmOid; error.name = hash; throw error; } mgf = oids[csr.signatureParameters.mgf.algorithmOid]; if(mgf === undefined || forge.mgf[mgf] === undefined) { var error = new Error('Unsupported MGF function.'); error.oid = csr.signatureParameters.mgf.algorithmOid; error.name = mgf; throw error; } mgf = forge.mgf[mgf].create(forge.md[hash].create()); /* initialize hash function */ hash = oids[csr.signatureParameters.hash.algorithmOid]; if(hash === undefined || forge.md[hash] === undefined) { var error = new Error('Unsupported RSASSA-PSS hash function.'); error.oid = csr.signatureParameters.hash.algorithmOid; error.name = hash; throw error; } scheme = forge.pss.create(forge.md[hash].create(), mgf, csr.signatureParameters.saltLength); break; } // verify signature on csr using its public key rval = csr.publicKey.verify( md.digest().getBytes(), csr.signature, scheme); } return rval; }; return csr; }; /** * Converts an X.509 subject or issuer to an ASN.1 RDNSequence. * * @param obj the subject or issuer (distinguished name). * * @return the ASN.1 RDNSequence. */ function _dnToAsn1(obj) { // create an empty RDNSequence var rval = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); // iterate over attributes var attr, set; var attrs = obj.attributes; for(var i = 0; i < attrs.length; ++i) { attr = attrs[i]; var value = attr.value; // reuse tag class for attribute value if available var valueTagClass = asn1.Type.PRINTABLESTRING; if('valueTagClass' in attr) { valueTagClass = attr.valueTagClass; if(valueTagClass === asn1.Type.UTF8) { value = forge.util.encodeUtf8(value); } // FIXME: handle more encodings } // create a RelativeDistinguishedName set // each value in the set is an AttributeTypeAndValue first // containing the type (an OID) and second the value set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AttributeType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(attr.type).getBytes()), // AttributeValue asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value) ]) ]); rval.value.push(set); } return rval; } /** * Gets all printable attributes (typically of an issuer or subject) in a * simplified JSON format for display. * * @param attrs the attributes. * * @return the JSON for display. */ function _getAttributesAsJson(attrs) { var rval = {}; for(var i = 0; i < attrs.length; ++i) { var attr = attrs[i]; if(attr.shortName && ( attr.valueTagClass === asn1.Type.UTF8 || attr.valueTagClass === asn1.Type.PRINTABLESTRING || attr.valueTagClass === asn1.Type.IA5STRING)) { var value = attr.value; if(attr.valueTagClass === asn1.Type.UTF8) { value = forge.util.encodeUtf8(attr.value); } if(!(attr.shortName in rval)) { rval[attr.shortName] = value; } else if(forge.util.isArray(rval[attr.shortName])) { rval[attr.shortName].push(value); } else { rval[attr.shortName] = [rval[attr.shortName], value]; } } } return rval; } /** * Fills in missing fields in attributes. * * @param attrs the attributes to fill missing fields in. */ function _fillMissingFields(attrs) { var attr; for(var i = 0; i < attrs.length; ++i) { attr = attrs[i]; // populate missing name if(typeof attr.name === 'undefined') { if(attr.type && attr.type in pki.oids) { attr.name = pki.oids[attr.type]; } else if(attr.shortName && attr.shortName in _shortNames) { attr.name = pki.oids[_shortNames[attr.shortName]]; } } // populate missing type (OID) if(typeof attr.type === 'undefined') { if(attr.name && attr.name in pki.oids) { attr.type = pki.oids[attr.name]; } else { var error = new Error('Attribute type not specified.'); error.attribute = attr; throw error; } } // populate missing shortname if(typeof attr.shortName === 'undefined') { if(attr.name && attr.name in _shortNames) { attr.shortName = _shortNames[attr.name]; } } // convert extensions to value if(attr.type === oids.extensionRequest) { attr.valueConstructed = true; attr.valueTagClass = asn1.Type.SEQUENCE; if(!attr.value && attr.extensions) { attr.value = []; for(var ei = 0; ei < attr.extensions.length; ++ei) { attr.value.push(pki.certificateExtensionToAsn1( _fillMissingExtensionFields(attr.extensions[ei]))); } } } if(typeof attr.value === 'undefined') { var error = new Error('Attribute value not specified.'); error.attribute = attr; throw error; } } } /** * Fills in missing fields in certificate extensions. * * @param e the extension. * @param [options] the options to use. * [cert] the certificate the extensions are for. * * @return the extension. */ function _fillMissingExtensionFields(e, options) { options = options || {}; // populate missing name if(typeof e.name === 'undefined') { if(e.id && e.id in pki.oids) { e.name = pki.oids[e.id]; } } // populate missing id if(typeof e.id === 'undefined') { if(e.name && e.name in pki.oids) { e.id = pki.oids[e.name]; } else { var error = new Error('Extension ID not specified.'); error.extension = e; throw error; } } if(typeof e.value !== 'undefined') { return e; } // handle missing value: // value is a BIT STRING if(e.name === 'keyUsage') { // build flags var unused = 0; var b2 = 0x00; var b3 = 0x00; if(e.digitalSignature) { b2 |= 0x80; unused = 7; } if(e.nonRepudiation) { b2 |= 0x40; unused = 6; } if(e.keyEncipherment) { b2 |= 0x20; unused = 5; } if(e.dataEncipherment) { b2 |= 0x10; unused = 4; } if(e.keyAgreement) { b2 |= 0x08; unused = 3; } if(e.keyCertSign) { b2 |= 0x04; unused = 2; } if(e.cRLSign) { b2 |= 0x02; unused = 1; } if(e.encipherOnly) { b2 |= 0x01; unused = 0; } if(e.decipherOnly) { b3 |= 0x80; unused = 7; } // create bit string var value = String.fromCharCode(unused); if(b3 !== 0) { value += String.fromCharCode(b2) + String.fromCharCode(b3); } else if(b2 !== 0) { value += String.fromCharCode(b2); } e.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value); } else if(e.name === 'basicConstraints') { // basicConstraints is a SEQUENCE e.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); // cA BOOLEAN flag defaults to false if(e.cA) { e.value.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false, String.fromCharCode(0xFF))); } if('pathLenConstraint' in e) { e.value.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(e.pathLenConstraint).getBytes())); } } else if(e.name === 'extKeyUsage') { // extKeyUsage is a SEQUENCE of OIDs e.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); var seq = e.value.value; for(var key in e) { if(e[key] !== true) { continue; } // key is name in OID map if(key in oids) { seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oids[key]).getBytes())); } else if(key.indexOf('.') !== -1) { // assume key is an OID seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(key).getBytes())); } } } else if(e.name === 'nsCertType') { // nsCertType is a BIT STRING // build flags var unused = 0; var b2 = 0x00; if(e.client) { b2 |= 0x80; unused = 7; } if(e.server) { b2 |= 0x40; unused = 6; } if(e.email) { b2 |= 0x20; unused = 5; } if(e.objsign) { b2 |= 0x10; unused = 4; } if(e.reserved) { b2 |= 0x08; unused = 3; } if(e.sslCA) { b2 |= 0x04; unused = 2; } if(e.emailCA) { b2 |= 0x02; unused = 1; } if(e.objCA) { b2 |= 0x01; unused = 0; } // create bit string var value = String.fromCharCode(unused); if(b2 !== 0) { value += String.fromCharCode(b2); } e.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value); } else if(e.name === 'subjectAltName' || e.name === 'issuerAltName') { // SYNTAX SEQUENCE e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); var altName; for(var n = 0; n < e.altNames.length; ++n) { altName = e.altNames[n]; var value = altName.value; // handle IP if(altName.type === 7 && altName.ip) { value = forge.util.bytesFromIP(altName.ip); if(value === null) { var error = new Error( 'Extension "ip" value is not a valid IPv4 or IPv6 address.'); error.extension = e; throw error; } } else if(altName.type === 8) { // handle OID if(altName.oid) { value = asn1.oidToDer(asn1.oidToDer(altName.oid)); } else { // deprecated ... convert value to OID value = asn1.oidToDer(value); } } e.value.value.push(asn1.create( asn1.Class.CONTEXT_SPECIFIC, altName.type, false, value)); } } else if(e.name === 'nsComment' && options.cert) { // sanity check value is ASCII (req'd) and not too big if(!(/^[\x00-\x7F]*$/.test(e.comment)) || (e.comment.length < 1) || (e.comment.length > 128)) { throw new Error('Invalid "nsComment" content.'); } // IA5STRING opaque comment e.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.IA5STRING, false, e.comment); } else if(e.name === 'subjectKeyIdentifier' && options.cert) { var ski = options.cert.generateSubjectKeyIdentifier(); e.subjectKeyIdentifier = ski.toHex(); // OCTETSTRING w/digest e.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ski.getBytes()); } else if(e.name === 'authorityKeyIdentifier' && options.cert) { // SYNTAX SEQUENCE e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); var seq = e.value.value; if(e.keyIdentifier) { var keyIdentifier = (e.keyIdentifier === true ? options.cert.generateSubjectKeyIdentifier().getBytes() : e.keyIdentifier); seq.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, false, keyIdentifier)); } if(e.authorityCertIssuer) { var authorityCertIssuer = [ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 4, true, [ _dnToAsn1(e.authorityCertIssuer === true ? options.cert.issuer : e.authorityCertIssuer) ]) ]; seq.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, authorityCertIssuer)); } if(e.serialNumber) { var serialNumber = forge.util.hexToBytes(e.serialNumber === true ? options.cert.serialNumber : e.serialNumber); seq.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, false, serialNumber)); } } else if(e.name === 'cRLDistributionPoints') { e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); var seq = e.value.value; // Create sub SEQUENCE of DistributionPointName var subSeq = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); // Create fullName CHOICE var fullNameGeneralNames = asn1.create( asn1.Class.CONTEXT_SPECIFIC, 0, true, []); var altName; for(var n = 0; n < e.altNames.length; ++n) { altName = e.altNames[n]; var value = altName.value; // handle IP if(altName.type === 7 && altName.ip) { value = forge.util.bytesFromIP(altName.ip); if(value === null) { var error = new Error( 'Extension "ip" value is not a valid IPv4 or IPv6 address.'); error.extension = e; throw error; } } else if(altName.type === 8) { // handle OID if(altName.oid) { value = asn1.oidToDer(asn1.oidToDer(altName.oid)); } else { // deprecated ... convert value to OID value = asn1.oidToDer(value); } } fullNameGeneralNames.value.push(asn1.create( asn1.Class.CONTEXT_SPECIFIC, altName.type, false, value)); } // Add to the parent SEQUENCE subSeq.value.push(asn1.create( asn1.Class.CONTEXT_SPECIFIC, 0, true, [fullNameGeneralNames])); seq.push(subSeq); } // ensure value has been defined by now if(typeof e.value === 'undefined') { var error = new Error('Extension value not specified.'); error.extension = e; throw error; } return e; } /** * Convert signature parameters object to ASN.1 * * @param {String} oid Signature algorithm OID * @param params The signature parametrs object * @return ASN.1 object representing signature parameters */ function _signatureParametersToAsn1(oid, params) { switch(oid) { case oids['RSASSA-PSS']: var parts = []; if(params.hash.algorithmOid !== undefined) { parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(params.hash.algorithmOid).getBytes()), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ]) ])); } if(params.mgf.algorithmOid !== undefined) { parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(params.mgf.algorithmOid).getBytes()), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(params.mgf.hash.algorithmOid).getBytes()), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') ]) ]) ])); } if(params.saltLength !== undefined) { parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(params.saltLength).getBytes()) ])); } return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, parts); default: return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, ''); } } /** * Converts a certification request's attributes to an ASN.1 set of * CRIAttributes. * * @param csr certification request. * * @return the ASN.1 set of CRIAttributes. */ function _CRIAttributesToAsn1(csr) { // create an empty context-specific container var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []); // no attributes, return empty container if(csr.attributes.length === 0) { return rval; } // each attribute has a sequence with a type and a set of values var attrs = csr.attributes; for(var i = 0; i < attrs.length; ++i) { var attr = attrs[i]; var value = attr.value; // reuse tag class for attribute value if available var valueTagClass = asn1.Type.UTF8; if('valueTagClass' in attr) { valueTagClass = attr.valueTagClass; } if(valueTagClass === asn1.Type.UTF8) { value = forge.util.encodeUtf8(value); } var valueConstructed = false; if('valueConstructed' in attr) { valueConstructed = attr.valueConstructed; } // FIXME: handle more encodings // create a RelativeDistinguishedName set // each value in the set is an AttributeTypeAndValue first // containing the type (an OID) and second the value var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AttributeType asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(attr.type).getBytes()), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ // AttributeValue asn1.create( asn1.Class.UNIVERSAL, valueTagClass, valueConstructed, value) ]) ]); rval.value.push(seq); } return rval; } var jan_1_1950 = new Date('1950-01-01T00:00:00Z'); var jan_1_2050 = new Date('2050-01-01T00:00:00Z'); /** * Converts a Date object to ASN.1 * Handles the different format before and after 1st January 2050 * * @param date date object. * * @return the ASN.1 object representing the date. */ function _dateToAsn1(date) { if(date >= jan_1_1950 && date < jan_1_2050) { return asn1.create( asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false, asn1.dateToUtcTime(date)); } else { return asn1.create( asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, asn1.dateToGeneralizedTime(date)); } } /** * Gets the ASN.1 TBSCertificate part of an X.509v3 certificate. * * @param cert the certificate. * * @return the asn1 TBSCertificate. */ pki.getTBSCertificate = function(cert) { // TBSCertificate var notBefore = _dateToAsn1(cert.validity.notBefore); var notAfter = _dateToAsn1(cert.validity.notAfter); var tbs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ // integer asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(cert.version).getBytes()) ]), // serialNumber asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, forge.util.hexToBytes(cert.serialNumber)), // signature asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(cert.siginfo.algorithmOid).getBytes()), // parameters _signatureParametersToAsn1( cert.siginfo.algorithmOid, cert.siginfo.parameters) ]), // issuer _dnToAsn1(cert.issuer), // validity asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ notBefore, notAfter ]), // subject _dnToAsn1(cert.subject), // SubjectPublicKeyInfo pki.publicKeyToAsn1(cert.publicKey) ]); if(cert.issuer.uniqueId) { // issuerUniqueID (optional) tbs.value.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, // TODO: support arbitrary bit length ids String.fromCharCode(0x00) + cert.issuer.uniqueId ) ]) ); } if(cert.subject.uniqueId) { // subjectUniqueID (optional) tbs.value.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, // TODO: support arbitrary bit length ids String.fromCharCode(0x00) + cert.subject.uniqueId ) ]) ); } if(cert.extensions.length > 0) { // extensions (optional) tbs.value.push(pki.certificateExtensionsToAsn1(cert.extensions)); } return tbs; }; /** * Gets the ASN.1 CertificationRequestInfo part of a * PKCS#10 CertificationRequest. * * @param csr the certification request. * * @return the asn1 CertificationRequestInfo. */ pki.getCertificationRequestInfo = function(csr) { // CertificationRequestInfo var cri = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(csr.version).getBytes()), // subject _dnToAsn1(csr.subject), // SubjectPublicKeyInfo pki.publicKeyToAsn1(csr.publicKey), // attributes _CRIAttributesToAsn1(csr) ]); return cri; }; /** * Converts a DistinguishedName (subject or issuer) to an ASN.1 object. * * @param dn the DistinguishedName. * * @return the asn1 representation of a DistinguishedName. */ pki.distinguishedNameToAsn1 = function(dn) { return _dnToAsn1(dn); }; /** * Converts an X.509v3 RSA certificate to an ASN.1 object. * * @param cert the certificate. * * @return the asn1 representation of an X.509v3 RSA certificate. */ pki.certificateToAsn1 = function(cert) { // prefer cached TBSCertificate over generating one var tbsCertificate = cert.tbsCertificate || pki.getTBSCertificate(cert); // Certificate return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // TBSCertificate tbsCertificate, // AlgorithmIdentifier (signature algorithm) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(cert.signatureOid).getBytes()), // parameters _signatureParametersToAsn1(cert.signatureOid, cert.signatureParameters) ]), // SignatureValue asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, String.fromCharCode(0x00) + cert.signature) ]); }; /** * Converts X.509v3 certificate extensions to ASN.1. * * @param exts the extensions to convert. * * @return the extensions in ASN.1 format. */ pki.certificateExtensionsToAsn1 = function(exts) { // create top-level extension container var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 3, true, []); // create extension sequence (stores a sequence for each extension) var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); rval.value.push(seq); for(var i = 0; i < exts.length; ++i) { seq.value.push(pki.certificateExtensionToAsn1(exts[i])); } return rval; }; /** * Converts a single certificate extension to ASN.1. * * @param ext the extension to convert. * * @return the extension in ASN.1 format. */ pki.certificateExtensionToAsn1 = function(ext) { // create a sequence for each extension var extseq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); // extnID (OID) extseq.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(ext.id).getBytes())); // critical defaults to false if(ext.critical) { // critical BOOLEAN DEFAULT FALSE extseq.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false, String.fromCharCode(0xFF))); } var value = ext.value; if(typeof ext.value !== 'string') { // value is asn.1 value = asn1.toDer(value).getBytes(); } // extnValue (OCTET STRING) extseq.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, value)); return extseq; }; /** * Converts a PKCS#10 certification request to an ASN.1 object. * * @param csr the certification request. * * @return the asn1 representation of a certification request. */ pki.certificationRequestToAsn1 = function(csr) { // prefer cached CertificationRequestInfo over generating one var cri = csr.certificationRequestInfo || pki.getCertificationRequestInfo(csr); // Certificate return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // CertificationRequestInfo cri, // AlgorithmIdentifier (signature algorithm) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(csr.signatureOid).getBytes()), // parameters _signatureParametersToAsn1(csr.signatureOid, csr.signatureParameters) ]), // signature asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, String.fromCharCode(0x00) + csr.signature) ]); }; /** * Creates a CA store. * * @param certs an optional array of certificate objects or PEM-formatted * certificate strings to add to the CA store. * * @return the CA store. */ pki.createCaStore = function(certs) { // create CA store var caStore = { // stored certificates certs: {} }; /** * Gets the certificate that issued the passed certificate or its * 'parent'. * * @param cert the certificate to get the parent for. * * @return the parent certificate or null if none was found. */ caStore.getIssuer = function(cert) { var rval = getBySubject(cert.issuer); // see if there are multiple matches /*if(forge.util.isArray(rval)) { // TODO: resolve multiple matches by checking // authorityKey/subjectKey/issuerUniqueID/other identifiers, etc. // FIXME: or alternatively do authority key mapping // if possible (X.509v1 certs can't work?) throw new Error('Resolving multiple issuer matches not implemented yet.'); }*/ return rval; }; /** * Adds a trusted certificate to the store. * * @param cert the certificate to add as a trusted certificate (either a * pki.certificate object or a PEM-formatted certificate). */ caStore.addCertificate = function(cert) { // convert from pem if necessary if(typeof cert === 'string') { cert = forge.pki.certificateFromPem(cert); } ensureSubjectHasHash(cert.subject); if(!caStore.hasCertificate(cert)) { // avoid duplicate certificates in store if(cert.subject.hash in caStore.certs) { // subject hash already exists, append to array var tmp = caStore.certs[cert.subject.hash]; if(!forge.util.isArray(tmp)) { tmp = [tmp]; } tmp.push(cert); caStore.certs[cert.subject.hash] = tmp; } else { caStore.certs[cert.subject.hash] = cert; } } }; /** * Checks to see if the given certificate is in the store. * * @param cert the certificate to check (either a pki.certificate or a * PEM-formatted certificate). * * @return true if the certificate is in the store, false if not. */ caStore.hasCertificate = function(cert) { // convert from pem if necessary if(typeof cert === 'string') { cert = forge.pki.certificateFromPem(cert); } var match = getBySubject(cert.subject); if(!match) { return false; } if(!forge.util.isArray(match)) { match = [match]; } // compare DER-encoding of certificates var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes(); for(var i = 0; i < match.length; ++i) { var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes(); if(der1 === der2) { return true; } } return false; }; /** * Lists all of the certificates kept in the store. * * @return an array of all of the pki.certificate objects in the store. */ caStore.listAllCertificates = function() { var certList = []; for(var hash in caStore.certs) { if(caStore.certs.hasOwnProperty(hash)) { var value = caStore.certs[hash]; if(!forge.util.isArray(value)) { certList.push(value); } else { for(var i = 0; i < value.length; ++i) { certList.push(value[i]); } } } } return certList; }; /** * Removes a certificate from the store. * * @param cert the certificate to remove (either a pki.certificate or a * PEM-formatted certificate). * * @return the certificate that was removed or null if the certificate * wasn't in store. */ caStore.removeCertificate = function(cert) { var result; // convert from pem if necessary if(typeof cert === 'string') { cert = forge.pki.certificateFromPem(cert); } ensureSubjectHasHash(cert.subject); if(!caStore.hasCertificate(cert)) { return null; } var match = getBySubject(cert.subject); if(!forge.util.isArray(match)) { result = caStore.certs[cert.subject.hash]; delete caStore.certs[cert.subject.hash]; return result; } // compare DER-encoding of certificates var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes(); for(var i = 0; i < match.length; ++i) { var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes(); if(der1 === der2) { result = match[i]; match.splice(i, 1); } } if(match.length === 0) { delete caStore.certs[cert.subject.hash]; } return result; }; function getBySubject(subject) { ensureSubjectHasHash(subject); return caStore.certs[subject.hash] || null; } function ensureSubjectHasHash(subject) { // produce subject hash if it doesn't exist if(!subject.hash) { var md = forge.md.sha1.create(); subject.attributes = pki.RDNAttributesAsArray(_dnToAsn1(subject), md); subject.hash = md.digest().toHex(); } } // auto-add passed in certs if(certs) { // parse PEM-formatted certificates as necessary for(var i = 0; i < certs.length; ++i) { var cert = certs[i]; caStore.addCertificate(cert); } } return caStore; }; /** * Certificate verification errors, based on TLS. */ pki.certificateError = { bad_certificate: 'forge.pki.BadCertificate', unsupported_certificate: 'forge.pki.UnsupportedCertificate', certificate_revoked: 'forge.pki.CertificateRevoked', certificate_expired: 'forge.pki.CertificateExpired', certificate_unknown: 'forge.pki.CertificateUnknown', unknown_ca: 'forge.pki.UnknownCertificateAuthority' }; /** * Verifies a certificate chain against the given Certificate Authority store * with an optional custom verify callback. * * @param caStore a certificate store to verify against. * @param chain the certificate chain to verify, with the root or highest * authority at the end (an array of certificates). * @param options a callback to be called for every certificate in the chain or * an object with: * verify a callback to be called for every certificate in the * chain * validityCheckDate the date against which the certificate * validity period should be checked. Pass null to not check * the validity period. By default, the current date is used. * * The verify callback has the following signature: * * verified - Set to true if certificate was verified, otherwise the * pki.certificateError for why the certificate failed. * depth - The current index in the chain, where 0 is the end point's cert. * certs - The certificate chain, *NOTE* an empty chain indicates an anonymous * end point. * * The function returns true on success and on failure either the appropriate * pki.certificateError or an object with 'error' set to the appropriate * pki.certificateError and 'message' set to a custom error message. * * @return true if successful, error thrown if not. */ pki.verifyCertificateChain = function(caStore, chain, options) { /* From: RFC3280 - Internet X.509 Public Key Infrastructure Certificate Section 6: Certification Path Validation See inline parentheticals related to this particular implementation. The primary goal of path validation is to verify the binding between a subject distinguished name or a subject alternative name and subject public key, as represented in the end entity certificate, based on the public key of the trust anchor. This requires obtaining a sequence of certificates that support that binding. That sequence should be provided in the passed 'chain'. The trust anchor should be in the given CA store. The 'end entity' certificate is the certificate provided by the end point (typically a server) and is the first in the chain. To meet this goal, the path validation process verifies, among other things, that a prospective certification path (a sequence of n certificates or a 'chain') satisfies the following conditions: (a) for all x in {1, ..., n-1}, the subject of certificate x is the issuer of certificate x+1; (b) certificate 1 is issued by the trust anchor; (c) certificate n is the certificate to be validated; and (d) for all x in {1, ..., n}, the certificate was valid at the time in question. Note that here 'n' is index 0 in the chain and 1 is the last certificate in the chain and it must be signed by a certificate in the connection's CA store. The path validation process also determines the set of certificate policies that are valid for this path, based on the certificate policies extension, policy mapping extension, policy constraints extension, and inhibit any-policy extension. Note: Policy mapping extension not supported (Not Required). Note: If the certificate has an unsupported critical extension, then it must be rejected. Note: A certificate is self-issued if the DNs that appear in the subject and issuer fields are identical and are not empty. The path validation algorithm assumes the following seven inputs are provided to the path processing logic. What this specific implementation will use is provided parenthetically: (a) a prospective certification path of length n (the 'chain') (b) the current date/time: ('now'). (c) user-initial-policy-set: A set of certificate policy identifiers naming the policies that are acceptable to the certificate user. The user-initial-policy-set contains the special value any-policy if the user is not concerned about certificate policy (Not implemented. Any policy is accepted). (d) trust anchor information, describing a CA that serves as a trust anchor for the certification path. The trust anchor information includes: (1) the trusted issuer name, (2) the trusted public key algorithm, (3) the trusted public key, and (4) optionally, the trusted public key parameters associated with the public key. (Trust anchors are provided via certificates in the CA store). The trust anchor information may be provided to the path processing procedure in the form of a self-signed certificate. The trusted anchor information is trusted because it was delivered to the path processing procedure by some trustworthy out-of-band procedure. If the trusted public key algorithm requires parameters, then the parameters are provided along with the trusted public key (No parameters used in this implementation). (e) initial-policy-mapping-inhibit, which indicates if policy mapping is allowed in the certification path. (Not implemented, no policy checking) (f) initial-explicit-policy, which indicates if the path must be valid for at least one of the certificate policies in the user-initial- policy-set. (Not implemented, no policy checking) (g) initial-any-policy-inhibit, which indicates whether the anyPolicy OID should be processed if it is included in a certificate. (Not implemented, so any policy is valid provided that it is not marked as critical) */ /* Basic Path Processing: For each certificate in the 'chain', the following is checked: 1. The certificate validity period includes the current time. 2. The certificate was signed by its parent (where the parent is either the next in the chain or from the CA store). Allow processing to continue to the next step if no parent is found but the certificate is in the CA store. 3. TODO: The certificate has not been revoked. 4. The certificate issuer name matches the parent's subject name. 5. TODO: If the certificate is self-issued and not the final certificate in the chain, skip this step, otherwise verify that the subject name is within one of the permitted subtrees of X.500 distinguished names and that each of the alternative names in the subjectAltName extension (critical or non-critical) is within one of the permitted subtrees for that name type. 6. TODO: If the certificate is self-issued and not the final certificate in the chain, skip this step, otherwise verify that the subject name is not within one of the excluded subtrees for X.500 distinguished names and none of the subjectAltName extension names are excluded for that name type. 7. The other steps in the algorithm for basic path processing involve handling the policy extension which is not presently supported in this implementation. Instead, if a critical policy extension is found, the certificate is rejected as not supported. 8. If the certificate is not the first or if its the only certificate in the chain (having no parent from the CA store or is self-signed) and it has a critical key usage extension, verify that the keyCertSign bit is set. If the key usage extension exists, verify that the basic constraints extension exists. If the basic constraints extension exists, verify that the cA flag is set. If pathLenConstraint is set, ensure that the number of certificates that precede in the chain (come earlier in the chain as implemented below), excluding the very first in the chain (typically the end-entity one), isn't greater than the pathLenConstraint. This constraint limits the number of intermediate CAs that may appear below a CA before only end-entity certificates may be issued. */ // if a verify callback is passed as the third parameter, package it within // the options object. This is to support a legacy function signature that // expected the verify callback as the third parameter. if(typeof options === 'function') { options = {verify: options}; } options = options || {}; // copy cert chain references to another array to protect against changes // in verify callback chain = chain.slice(0); var certs = chain.slice(0); var validityCheckDate = options.validityCheckDate; // if no validityCheckDate is specified, default to the current date. Make // sure to maintain the value null because it indicates that the validity // period should not be checked. if(typeof validityCheckDate === 'undefined') { validityCheckDate = new Date(); } // verify each cert in the chain using its parent, where the parent // is either the next in the chain or from the CA store var first = true; var error = null; var depth = 0; do { var cert = chain.shift(); var parent = null; var selfSigned = false; if(validityCheckDate) { // 1. check valid time if(validityCheckDate < cert.validity.notBefore || validityCheckDate > cert.validity.notAfter) { error = { message: 'Certificate is not valid yet or has expired.', error: pki.certificateError.certificate_expired, notBefore: cert.validity.notBefore, notAfter: cert.validity.notAfter, // TODO: we might want to reconsider renaming 'now' to // 'validityCheckDate' should this API be changed in the future. now: validityCheckDate }; } } // 2. verify with parent from chain or CA store if(error === null) { parent = chain[0] || caStore.getIssuer(cert); if(parent === null) { // check for self-signed cert if(cert.isIssuer(cert)) { selfSigned = true; parent = cert; } } if(parent) { // FIXME: current CA store implementation might have multiple // certificates where the issuer can't be determined from the // certificate (happens rarely with, eg: old certificates) so normalize // by always putting parents into an array // TODO: there's may be an extreme degenerate case currently uncovered // where an old intermediate certificate seems to have a matching parent // but none of the parents actually verify ... but the intermediate // is in the CA and it should pass this check; needs investigation var parents = parent; if(!forge.util.isArray(parents)) { parents = [parents]; } // try to verify with each possible parent (typically only one) var verified = false; while(!verified && parents.length > 0) { parent = parents.shift(); try { verified = parent.verify(cert); } catch(ex) { // failure to verify, don't care why, try next one } } if(!verified) { error = { message: 'Certificate signature is invalid.', error: pki.certificateError.bad_certificate }; } } if(error === null && (!parent || selfSigned) && !caStore.hasCertificate(cert)) { // no parent issuer and certificate itself is not trusted error = { message: 'Certificate is not trusted.', error: pki.certificateError.unknown_ca }; } } // TODO: 3. check revoked // 4. check for matching issuer/subject if(error === null && parent && !cert.isIssuer(parent)) { // parent is not issuer error = { message: 'Certificate issuer is invalid.', error: pki.certificateError.bad_certificate }; } // 5. TODO: check names with permitted names tree // 6. TODO: check names against excluded names tree // 7. check for unsupported critical extensions if(error === null) { // supported extensions var se = { keyUsage: true, basicConstraints: true }; for(var i = 0; error === null && i < cert.extensions.length; ++i) { var ext = cert.extensions[i]; if(ext.critical && !(ext.name in se)) { error = { message: 'Certificate has an unsupported critical extension.', error: pki.certificateError.unsupported_certificate }; } } } // 8. check for CA if cert is not first or is the only certificate // remaining in chain with no parent or is self-signed if(error === null && (!first || (chain.length === 0 && (!parent || selfSigned)))) { // first check keyUsage extension and then basic constraints var bcExt = cert.getExtension('basicConstraints'); var keyUsageExt = cert.getExtension('keyUsage'); if(keyUsageExt !== null) { // keyCertSign must be true and there must be a basic // constraints extension if(!keyUsageExt.keyCertSign || bcExt === null) { // bad certificate error = { message: 'Certificate keyUsage or basicConstraints conflict ' + 'or indicate that the certificate is not a CA. ' + 'If the certificate is the only one in the chain or ' + 'isn\'t the first then the certificate must be a ' + 'valid CA.', error: pki.certificateError.bad_certificate }; } } // basic constraints cA flag must be set if(error === null && bcExt !== null && !bcExt.cA) { // bad certificate error = { message: 'Certificate basicConstraints indicates the certificate ' + 'is not a CA.', error: pki.certificateError.bad_certificate }; } // if error is not null and keyUsage is available, then we know it // has keyCertSign and there is a basic constraints extension too, // which means we can check pathLenConstraint (if it exists) if(error === null && keyUsageExt !== null && 'pathLenConstraint' in bcExt) { // pathLen is the maximum # of intermediate CA certs that can be // found between the current certificate and the end-entity (depth 0) // certificate; this number does not include the end-entity (depth 0, // last in the chain) even if it happens to be a CA certificate itself var pathLen = depth - 1; if(pathLen > bcExt.pathLenConstraint) { // pathLenConstraint violated, bad certificate error = { message: 'Certificate basicConstraints pathLenConstraint violated.', error: pki.certificateError.bad_certificate }; } } } // call application callback var vfd = (error === null) ? true : error.error; var ret = options.verify ? options.verify(vfd, depth, certs) : vfd; if(ret === true) { // clear any set error error = null; } else { // if passed basic tests, set default message and alert if(vfd === true) { error = { message: 'The application rejected the certificate.', error: pki.certificateError.bad_certificate }; } // check for custom error info if(ret || ret === 0) { // set custom message and error if(typeof ret === 'object' && !forge.util.isArray(ret)) { if(ret.message) { error.message = ret.message; } if(ret.error) { error.error = ret.error; } } else if(typeof ret === 'string') { // set custom error error.error = ret; } } // throw error throw error; } // no longer first cert in chain first = false; ++depth; } while(chain.length > 0); return true; }; /***/ }), /***/ 17952: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // TODO: Use the `URL` global when targeting Node.js 10 const URLParser = typeof URL === 'undefined' ? __webpack_require__(78835).URL : URL; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain'; const DATA_URL_DEFAULT_CHARSET = 'us-ascii'; const testParameter = (name, filters) => { return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name); }; const normalizeDataURL = (urlString, {stripHash}) => { const parts = urlString.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/); if (!parts) { throw new Error(`Invalid URL: ${urlString}`); } const mediaType = parts[1].split(';'); const body = parts[2]; const hash = stripHash ? '' : parts[3]; let base64 = false; if (mediaType[mediaType.length - 1] === 'base64') { mediaType.pop(); base64 = true; } // Lowercase MIME type const mimeType = (mediaType.shift() || '').toLowerCase(); const attributes = mediaType .map(attribute => { let [key, value = ''] = attribute.split('=').map(string => string.trim()); // Lowercase `charset` if (key === 'charset') { value = value.toLowerCase(); if (value === DATA_URL_DEFAULT_CHARSET) { return ''; } } return `${key}${value ? `=${value}` : ''}`; }) .filter(Boolean); const normalizedMediaType = [ ...attributes ]; if (base64) { normalizedMediaType.push('base64'); } if (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) { normalizedMediaType.unshift(mimeType); } return `data:${normalizedMediaType.join(';')},${base64 ? body.trim() : body}${hash ? `#${hash}` : ''}`; }; const normalizeUrl = (urlString, options) => { options = { defaultProtocol: 'http:', normalizeProtocol: true, forceHttp: false, forceHttps: false, stripAuthentication: true, stripHash: false, stripWWW: true, removeQueryParameters: [/^utm_\w+/i], removeTrailingSlash: true, removeDirectoryIndex: false, sortQueryParameters: true, ...options }; // TODO: Remove this at some point in the future if (Reflect.has(options, 'normalizeHttps')) { throw new Error('options.normalizeHttps is renamed to options.forceHttp'); } if (Reflect.has(options, 'normalizeHttp')) { throw new Error('options.normalizeHttp is renamed to options.forceHttps'); } if (Reflect.has(options, 'stripFragment')) { throw new Error('options.stripFragment is renamed to options.stripHash'); } urlString = urlString.trim(); // Data URL if (/^data:/i.test(urlString)) { return normalizeDataURL(urlString, options); } const hasRelativeProtocol = urlString.startsWith('//'); const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString); // Prepend protocol if (!isRelativeUrl) { urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol); } const urlObj = new URLParser(urlString); if (options.forceHttp && options.forceHttps) { throw new Error('The `forceHttp` and `forceHttps` options cannot be used together'); } if (options.forceHttp && urlObj.protocol === 'https:') { urlObj.protocol = 'http:'; } if (options.forceHttps && urlObj.protocol === 'http:') { urlObj.protocol = 'https:'; } // Remove auth if (options.stripAuthentication) { urlObj.username = ''; urlObj.password = ''; } // Remove hash if (options.stripHash) { urlObj.hash = ''; } // Remove duplicate slashes if not preceded by a protocol if (urlObj.pathname) { // TODO: Use the following instead when targeting Node.js 10 // `urlObj.pathname = urlObj.pathname.replace(/(? { if (/^(?!\/)/g.test(p1)) { return `${p1}/`; } return '/'; }); } // Decode URI octets if (urlObj.pathname) { urlObj.pathname = decodeURI(urlObj.pathname); } // Remove directory index if (options.removeDirectoryIndex === true) { options.removeDirectoryIndex = [/^index\.[a-z]+$/]; } if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) { let pathComponents = urlObj.pathname.split('/'); const lastComponent = pathComponents[pathComponents.length - 1]; if (testParameter(lastComponent, options.removeDirectoryIndex)) { pathComponents = pathComponents.slice(0, pathComponents.length - 1); urlObj.pathname = pathComponents.slice(1).join('/') + '/'; } } if (urlObj.hostname) { // Remove trailing dot urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); // Remove `www.` if (options.stripWWW && /^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(urlObj.hostname)) { // Each label should be max 63 at length (min: 2). // The extension should be max 5 at length (min: 2). // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); } } // Remove query unwanted parameters if (Array.isArray(options.removeQueryParameters)) { for (const key of [...urlObj.searchParams.keys()]) { if (testParameter(key, options.removeQueryParameters)) { urlObj.searchParams.delete(key); } } } // Sort query parameters if (options.sortQueryParameters) { urlObj.searchParams.sort(); } if (options.removeTrailingSlash) { urlObj.pathname = urlObj.pathname.replace(/\/$/, ''); } // Take advantage of many of the Node `url` normalizations urlString = urlObj.toString(); // Remove ending `/` if ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '') { urlString = urlString.replace(/\/$/, ''); } // Restore relative protocol, if applicable if (hasRelativeProtocol && !options.normalizeProtocol) { urlString = urlString.replace(/^http:\/\//, '//'); } // Remove http/https if (options.stripProtocol) { urlString = urlString.replace(/^(?:https?:)?\/\//, ''); } return urlString; }; module.exports = normalizeUrl; // TODO: Remove this for the next major release module.exports.default = normalizeUrl; /***/ }), /***/ 43248: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var crypto = __webpack_require__(76417) function sha (key, body, algorithm) { return crypto.createHmac(algorithm, key).update(body).digest('base64') } function rsa (key, body) { return crypto.createSign('RSA-SHA1').update(body).sign(key, 'base64') } function rfc3986 (str) { return encodeURIComponent(str) .replace(/!/g,'%21') .replace(/\*/g,'%2A') .replace(/\(/g,'%28') .replace(/\)/g,'%29') .replace(/'/g,'%27') } // Maps object to bi-dimensional array // Converts { foo: 'A', bar: [ 'b', 'B' ]} to // [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ] function map (obj) { var key, val, arr = [] for (key in obj) { val = obj[key] if (Array.isArray(val)) for (var i = 0; i < val.length; i++) arr.push([key, val[i]]) else if (typeof val === 'object') for (var prop in val) arr.push([key + '[' + prop + ']', val[prop]]) else arr.push([key, val]) } return arr } // Compare function for sort function compare (a, b) { return a > b ? 1 : a < b ? -1 : 0 } function generateBase (httpMethod, base_uri, params) { // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature // Parameter normalization // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2 var normalized = map(params) // 1. First, the name and value of each parameter are encoded .map(function (p) { return [ rfc3986(p[0]), rfc3986(p[1] || '') ] }) // 2. The parameters are sorted by name, using ascending byte value // ordering. If two or more parameters share the same name, they // are sorted by their value. .sort(function (a, b) { return compare(a[0], b[0]) || compare(a[1], b[1]) }) // 3. The name of each parameter is concatenated to its corresponding // value using an "=" character (ASCII code 61) as a separator, even // if the value is empty. .map(function (p) { return p.join('=') }) // 4. The sorted name/value pairs are concatenated together into a // single string by using an "&" character (ASCII code 38) as // separator. .join('&') var base = [ rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'), rfc3986(base_uri), rfc3986(normalized) ].join('&') return base } function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return sha(key, base, 'sha1') } function hmacsign256 (httpMethod, base_uri, params, consumer_secret, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return sha(key, base, 'sha256') } function rsasign (httpMethod, base_uri, params, private_key, token_secret) { var base = generateBase(httpMethod, base_uri, params) var key = private_key || '' return rsa(key, base) } function plaintext (consumer_secret, token_secret) { var key = [ consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return key } function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) { var method var skipArgs = 1 switch (signMethod) { case 'RSA-SHA1': method = rsasign break case 'HMAC-SHA1': method = hmacsign break case 'HMAC-SHA256': method = hmacsign256 break case 'PLAINTEXT': method = plaintext skipArgs = 4 break default: throw new Error('Signature method not supported: ' + signMethod) } return method.apply(null, [].slice.call(arguments, skipArgs)) } exports.hmacsign = hmacsign exports.hmacsign256 = hmacsign256 exports.rsasign = rsasign exports.plaintext = plaintext exports.sign = sign exports.rfc3986 = rfc3986 exports.generateBase = generateBase /***/ }), /***/ 24856: /***/ ((module, exports, __webpack_require__) => { "use strict"; var crypto = __webpack_require__(76417); /** * Exported function * * Options: * * - `algorithm` hash algo to be used by this instance: *'sha1', 'md5' * - `excludeValues` {true|*false} hash object keys, values ignored * - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64' * - `ignoreUnknown` {true|*false} ignore unknown object types * - `replacer` optional function that replaces values before hashing * - `respectFunctionProperties` {*true|false} consider function properties when hashing * - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing * - `respectType` {*true|false} Respect special properties (prototype, constructor) * when hashing to distinguish between types * - `unorderedArrays` {true|*false} Sort all arrays before hashing * - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing * * = default * * @param {object} object value to hash * @param {object} options hashing options * @return {string} hash value * @api public */ exports = module.exports = objectHash; function objectHash(object, options){ options = applyDefaults(object, options); return hash(object, options); } /** * Exported sugar methods * * @param {object} object value to hash * @return {string} hash value * @api public */ exports.sha1 = function(object){ return objectHash(object); }; exports.keys = function(object){ return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'}); }; exports.MD5 = function(object){ return objectHash(object, {algorithm: 'md5', encoding: 'hex'}); }; exports.keysMD5 = function(object){ return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true}); }; // Internals var hashes = crypto.getHashes ? crypto.getHashes().slice() : ['sha1', 'md5']; hashes.push('passthrough'); var encodings = ['buffer', 'hex', 'binary', 'base64']; function applyDefaults(object, sourceOptions){ sourceOptions = sourceOptions || {}; // create a copy rather than mutating var options = {}; options.algorithm = sourceOptions.algorithm || 'sha1'; options.encoding = sourceOptions.encoding || 'hex'; options.excludeValues = sourceOptions.excludeValues ? true : false; options.algorithm = options.algorithm.toLowerCase(); options.encoding = options.encoding.toLowerCase(); options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false options.respectType = sourceOptions.respectType === false ? false : true; // default to true options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true; options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true; options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true options.replacer = sourceOptions.replacer || undefined; options.excludeKeys = sourceOptions.excludeKeys || undefined; if(typeof object === 'undefined') { throw new Error('Object argument required.'); } // if there is a case-insensitive match in the hashes list, accept it // (i.e. SHA256 for sha256) for (var i = 0; i < hashes.length; ++i) { if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) { options.algorithm = hashes[i]; } } if(hashes.indexOf(options.algorithm) === -1){ throw new Error('Algorithm "' + options.algorithm + '" not supported. ' + 'supported values: ' + hashes.join(', ')); } if(encodings.indexOf(options.encoding) === -1 && options.algorithm !== 'passthrough'){ throw new Error('Encoding "' + options.encoding + '" not supported. ' + 'supported values: ' + encodings.join(', ')); } return options; } /** Check if the given function is a native function */ function isNativeFunction(f) { if ((typeof f) !== 'function') { return false; } var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i; return exp.exec(Function.prototype.toString.call(f)) != null; } function hash(object, options) { var hashingStream; if (options.algorithm !== 'passthrough') { hashingStream = crypto.createHash(options.algorithm); } else { hashingStream = new PassThrough(); } if (typeof hashingStream.write === 'undefined') { hashingStream.write = hashingStream.update; hashingStream.end = hashingStream.update; } var hasher = typeHasher(options, hashingStream); hasher.dispatch(object); if (!hashingStream.update) { hashingStream.end(''); } if (hashingStream.digest) { return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding); } var buf = hashingStream.read(); if (options.encoding === 'buffer') { return buf; } return buf.toString(options.encoding); } /** * Expose streaming API * * @param {object} object Value to serialize * @param {object} options Options, as for hash() * @param {object} stream A stream to write the serializiation to * @api public */ exports.writeToStream = function(object, options, stream) { if (typeof stream === 'undefined') { stream = options; options = {}; } options = applyDefaults(object, options); return typeHasher(options, stream).dispatch(object); }; function typeHasher(options, writeTo, context){ context = context || []; var write = function(str) { if (writeTo.update) { return writeTo.update(str, 'utf8'); } else { return writeTo.write(str, 'utf8'); } }; return { dispatch: function(value){ if (options.replacer) { value = options.replacer(value); } var type = typeof value; if (value === null) { type = 'null'; } //console.log("[DEBUG] Dispatch: ", value, "->", type, " -> ", "_" + type); return this['_' + type](value); }, _object: function(object) { var pattern = (/\[object (.*)\]/i); var objString = Object.prototype.toString.call(object); var objType = pattern.exec(objString); if (!objType) { // object type did not match [object ...] objType = 'unknown:[' + objString + ']'; } else { objType = objType[1]; // take only the class name } objType = objType.toLowerCase(); var objectNumber = null; if ((objectNumber = context.indexOf(object)) >= 0) { return this.dispatch('[CIRCULAR:' + objectNumber + ']'); } else { context.push(object); } if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) { write('buffer:'); return write(object); } if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') { if(this['_' + objType]) { this['_' + objType](object); } else if (options.ignoreUnknown) { return write('[' + objType + ']'); } else { throw new Error('Unknown object type "' + objType + '"'); } }else{ var keys = Object.keys(object); if (options.unorderedObjects) { keys = keys.sort(); } // Make sure to incorporate special properties, so // Types with different prototypes will produce // a different hash and objects derived from // different functions (`new Foo`, `new Bar`) will // produce different hashes. // We never do this for native functions since some // seem to break because of that. if (options.respectType !== false && !isNativeFunction(object)) { keys.splice(0, 0, 'prototype', '__proto__', 'constructor'); } if (options.excludeKeys) { keys = keys.filter(function(key) { return !options.excludeKeys(key); }); } write('object:' + keys.length + ':'); var self = this; return keys.forEach(function(key){ self.dispatch(key); write(':'); if(!options.excludeValues) { self.dispatch(object[key]); } write(','); }); } }, _array: function(arr, unordered){ unordered = typeof unordered !== 'undefined' ? unordered : options.unorderedArrays !== false; // default to options.unorderedArrays var self = this; write('array:' + arr.length + ':'); if (!unordered || arr.length <= 1) { return arr.forEach(function(entry) { return self.dispatch(entry); }); } // the unordered case is a little more complicated: // since there is no canonical ordering on objects, // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false, // we first serialize each entry using a PassThrough stream // before sorting. // also: we can’t use the same context array for all entries // since the order of hashing should *not* matter. instead, // we keep track of the additions to a copy of the context array // and add all of them to the global context array when we’re done var contextAdditions = []; var entries = arr.map(function(entry) { var strm = new PassThrough(); var localContext = context.slice(); // make copy var hasher = typeHasher(options, strm, localContext); hasher.dispatch(entry); // take only what was added to localContext and append it to contextAdditions contextAdditions = contextAdditions.concat(localContext.slice(context.length)); return strm.read().toString(); }); context = context.concat(contextAdditions); entries.sort(); return this._array(entries, false); }, _date: function(date){ return write('date:' + date.toJSON()); }, _symbol: function(sym){ return write('symbol:' + sym.toString()); }, _error: function(err){ return write('error:' + err.toString()); }, _boolean: function(bool){ return write('bool:' + bool.toString()); }, _string: function(string){ write('string:' + string.length + ':'); write(string.toString()); }, _function: function(fn){ write('fn:'); if (isNativeFunction(fn)) { this.dispatch('[native]'); } else { this.dispatch(fn.toString()); } if (options.respectFunctionNames !== false) { // Make sure we can still distinguish native functions // by their name, otherwise String and Function will // have the same hash this.dispatch("function-name:" + String(fn.name)); } if (options.respectFunctionProperties) { this._object(fn); } }, _number: function(number){ return write('number:' + number.toString()); }, _xml: function(xml){ return write('xml:' + xml.toString()); }, _null: function() { return write('Null'); }, _undefined: function() { return write('Undefined'); }, _regexp: function(regex){ return write('regex:' + regex.toString()); }, _uint8array: function(arr){ write('uint8array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint8clampedarray: function(arr){ write('uint8clampedarray:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int8array: function(arr){ write('uint8array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint16array: function(arr){ write('uint16array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int16array: function(arr){ write('uint16array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _uint32array: function(arr){ write('uint32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _int32array: function(arr){ write('uint32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _float32array: function(arr){ write('float32array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _float64array: function(arr){ write('float64array:'); return this.dispatch(Array.prototype.slice.call(arr)); }, _arraybuffer: function(arr){ write('arraybuffer:'); return this.dispatch(new Uint8Array(arr)); }, _url: function(url) { return write('url:' + url.toString(), 'utf8'); }, _map: function(map) { write('map:'); var arr = Array.from(map); return this._array(arr, options.unorderedSets !== false); }, _set: function(set) { write('set:'); var arr = Array.from(set); return this._array(arr, options.unorderedSets !== false); }, _file: function(file) { write('file:'); return this.dispatch([file.name, file.size, file.type, file.lastModfied]); }, _blob: function() { if (options.ignoreUnknown) { return write('[blob]'); } throw Error('Hashing Blob objects is currently not supported\n' + '(see https://github.com/puleos/object-hash/issues/26)\n' + 'Use "options.replacer" or "options.ignoreUnknown"\n'); }, _domwindow: function() { return write('domwindow'); }, /* Node.js standard native objects */ _process: function() { return write('process'); }, _timer: function() { return write('timer'); }, _pipe: function() { return write('pipe'); }, _tcp: function() { return write('tcp'); }, _udp: function() { return write('udp'); }, _tty: function() { return write('tty'); }, _statwatcher: function() { return write('statwatcher'); }, _securecontext: function() { return write('securecontext'); }, _connection: function() { return write('connection'); }, _zlib: function() { return write('zlib'); }, _context: function() { return write('context'); }, _nodescript: function() { return write('nodescript'); }, _httpparser: function() { return write('httpparser'); }, _dataview: function() { return write('dataview'); }, _signal: function() { return write('signal'); }, _fsevent: function() { return write('fsevent'); }, _tlswrap: function() { return write('tlswrap'); }, }; } // Mini-implementation of stream.PassThrough // We are far from having need for the full implementation, and we can // make assumptions like "many writes, then only one final read" // and we can ignore encoding specifics function PassThrough() { return { buf: '', write: function(b) { this.buf += b; }, end: function(b) { this.buf += b; }, read: function() { return this.buf; } }; } /***/ }), /***/ 80028: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { strict: assert } = __webpack_require__(42357); const { createHash } = __webpack_require__(76417); const { format } = __webpack_require__(31669); const shake256 = __webpack_require__(19811); let encode; if (Buffer.isEncoding('base64url')) { encode = (input) => input.toString('base64url'); } else { const fromBase64 = (base64) => base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); encode = (input) => fromBase64(input.toString('base64')); } /** SPECIFICATION * Its (_hash) value is the base64url encoding of the left-most half of the hash of the octets of * the ASCII representation of the token value, where the hash algorithm used is the hash algorithm * used in the alg Header Parameter of the ID Token's JOSE Header. For instance, if the alg is * RS256, hash the token value with SHA-256, then take the left-most 128 bits and base64url encode * them. The _hash value is a case sensitive string. */ /** * @name getHash * @api private * * returns the sha length based off the JOSE alg heade value, defaults to sha256 * * @param token {String} token value to generate the hash from * @param alg {String} ID Token JOSE header alg value (i.e. RS256, HS384, ES512, PS256) * @param [crv] {String} For EdDSA the curve decides what hash algorithm is used. Required for EdDSA */ function getHash(alg, crv) { switch (alg) { case 'HS256': case 'RS256': case 'PS256': case 'ES256': case 'ES256K': return createHash('sha256'); case 'HS384': case 'RS384': case 'PS384': case 'ES384': return createHash('sha384'); case 'HS512': case 'RS512': case 'PS512': case 'ES512': return createHash('sha512'); case 'EdDSA': switch (crv) { case 'Ed25519': return createHash('sha512'); case 'Ed448': if (!shake256) { throw new TypeError('Ed448 *_hash calculation is not supported in your Node.js runtime version'); } return createHash('shake256', { outputLength: 114 }); default: throw new TypeError('unrecognized or invalid EdDSA curve provided'); } default: throw new TypeError('unrecognized or invalid JWS algorithm provided'); } } function generate(token, alg, crv) { const digest = getHash(alg, crv).update(token).digest(); return encode(digest.slice(0, digest.length / 2)); } function validate(names, actual, source, alg, crv) { if (typeof names.claim !== 'string' || !names.claim) { throw new TypeError('names.claim must be a non-empty string'); } if (typeof names.source !== 'string' || !names.source) { throw new TypeError('names.source must be a non-empty string'); } assert(typeof actual === 'string' && actual, `${names.claim} must be a non-empty string`); assert(typeof source === 'string' && source, `${names.source} must be a non-empty string`); let expected; let msg; try { expected = generate(source, alg, crv); } catch (err) { msg = format('%s could not be validated (%s)', names.claim, err.message); } msg = msg || format('%s mismatch, expected %s, got: %s', names.claim, expected, actual); assert.equal(expected, actual, msg); } module.exports = { validate, generate, }; /***/ }), /***/ 19811: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const crypto = __webpack_require__(76417); const [major, minor] = process.version.substr(1).split('.').map((x) => parseInt(x, 10)); const xofOutputLength = major > 12 || (major === 12 && minor >= 8); const shake256 = xofOutputLength && crypto.getHashes().includes('shake256'); module.exports = shake256; /***/ }), /***/ 24694: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /*! * on-finished * Copyright(c) 2013 Jonathan Ong * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = onFinished module.exports.isFinished = isFinished /** * Module dependencies. * @private */ var first = __webpack_require__(14401) /** * Variables. * @private */ /* istanbul ignore next */ var defer = typeof setImmediate === 'function' ? setImmediate : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } /** * Invoke callback when the response has finished, useful for * cleaning up resources afterwards. * * @param {object} msg * @param {function} listener * @return {object} * @public */ function onFinished(msg, listener) { if (isFinished(msg) !== false) { defer(listener, null, msg) return msg } // attach the listener to the message attachListener(msg, listener) return msg } /** * Determine if message is already finished. * * @param {object} msg * @return {boolean} * @public */ function isFinished(msg) { var socket = msg.socket if (typeof msg.finished === 'boolean') { // OutgoingMessage return Boolean(msg.finished || (socket && !socket.writable)) } if (typeof msg.complete === 'boolean') { // IncomingMessage return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) } // don't know return undefined } /** * Attach a finished listener to the message. * * @param {object} msg * @param {function} callback * @private */ function attachFinishedListener(msg, callback) { var eeMsg var eeSocket var finished = false function onFinish(error) { eeMsg.cancel() eeSocket.cancel() finished = true callback(error) } // finished on first message event eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) function onSocket(socket) { // remove listener msg.removeListener('socket', onSocket) if (finished) return if (eeMsg !== eeSocket) return // finished on first socket event eeSocket = first([[socket, 'error', 'close']], onFinish) } if (msg.socket) { // socket already assigned onSocket(msg.socket) return } // wait for socket to be assigned msg.on('socket', onSocket) if (msg.socket === undefined) { // node.js 0.8 patch patchAssignSocket(msg, onSocket) } } /** * Attach the listener to the message. * * @param {object} msg * @return {function} * @private */ function attachListener(msg, listener) { var attached = msg.__onFinished // create a private single listener with queue if (!attached || !attached.queue) { attached = msg.__onFinished = createListener(msg) attachFinishedListener(msg, attached) } attached.queue.push(listener) } /** * Create listener on message. * * @param {object} msg * @return {function} * @private */ function createListener(msg) { function listener(err) { if (msg.__onFinished === listener) msg.__onFinished = null if (!listener.queue) return var queue = listener.queue listener.queue = null for (var i = 0; i < queue.length; i++) { queue[i](err, msg) } } listener.queue = [] return listener } /** * Patch ServerResponse.prototype.assignSocket for node.js 0.8. * * @param {ServerResponse} res * @param {function} callback * @private */ function patchAssignSocket(res, callback) { var assignSocket = res.assignSocket if (typeof assignSocket !== 'function') return // res.on('socket', callback) is broken in 0.8 res.assignSocket = function _assignSocket(socket) { assignSocket.call(this, socket) callback(socket) } } /***/ }), /***/ 1223: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var wrappy = __webpack_require__(62940) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { value: function () { return once(this) }, configurable: true }) Object.defineProperty(Function.prototype, 'onceStrict', { value: function () { return onceStrict(this) }, configurable: true }) }) function once (fn) { var f = function () { if (f.called) return f.value f.called = true return f.value = fn.apply(this, arguments) } f.called = false return f } function onceStrict (fn) { var f = function () { if (f.called) throw new Error(f.onceError) f.called = true return f.value = fn.apply(this, arguments) } var name = fn.name || 'Function wrapped with `once`' f.onceError = name + " shouldn't be called more than once" f.called = false return f } /***/ }), /***/ 19072: /***/ ((module) => { "use strict"; class CancelError extends Error { constructor(reason) { super(reason || 'Promise was canceled'); this.name = 'CancelError'; } get isCanceled() { return true; } } class PCancelable { static fn(userFn) { return (...arguments_) => { return new PCancelable((resolve, reject, onCancel) => { arguments_.push(onCancel); // eslint-disable-next-line promise/prefer-await-to-then userFn(...arguments_).then(resolve, reject); }); }; } constructor(executor) { this._cancelHandlers = []; this._isPending = true; this._isCanceled = false; this._rejectOnCancel = true; this._promise = new Promise((resolve, reject) => { this._reject = reject; const onResolve = value => { if (!this._isCanceled || !onCancel.shouldReject) { this._isPending = false; resolve(value); } }; const onReject = error => { this._isPending = false; reject(error); }; const onCancel = handler => { if (!this._isPending) { throw new Error('The `onCancel` handler was attached after the promise settled.'); } this._cancelHandlers.push(handler); }; Object.defineProperties(onCancel, { shouldReject: { get: () => this._rejectOnCancel, set: boolean => { this._rejectOnCancel = boolean; } } }); return executor(onResolve, onReject, onCancel); }); } then(onFulfilled, onRejected) { // eslint-disable-next-line promise/prefer-await-to-then return this._promise.then(onFulfilled, onRejected); } catch(onRejected) { return this._promise.catch(onRejected); } finally(onFinally) { return this._promise.finally(onFinally); } cancel(reason) { if (!this._isPending || this._isCanceled) { return; } this._isCanceled = true; if (this._cancelHandlers.length > 0) { try { for (const handler of this._cancelHandlers) { handler(); } } catch (error) { this._reject(error); return; } } if (this._rejectOnCancel) { this._reject(new CancelError(reason)); } } get isCanceled() { return this._isCanceled; } } Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); module.exports = PCancelable; module.exports.CancelError = CancelError; /***/ }), /***/ 31330: /***/ ((module) => { "use strict"; module.exports = (promise, onFinally) => { onFinally = onFinally || (() => {}); return promise.then( val => new Promise(resolve => { resolve(onFinally()); }).then(() => val), err => new Promise(resolve => { resolve(onFinally()); }).then(() => { throw err; }) ); }; /***/ }), /***/ 38714: /***/ ((module) => { "use strict"; function posix(path) { return path.charAt(0) === '/'; } function win32(path) { // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; var result = splitDeviceRe.exec(path); var device = result[1] || ''; var isUnc = Boolean(device && device.charAt(1) !== ':'); // UNC paths are always absolute return Boolean(result[2] || isUnc); } module.exports = process.platform === 'win32' ? win32 : posix; module.exports.posix = posix; module.exports.win32 = win32; /***/ }), /***/ 20539: /***/ ((module) => { "use strict"; module.exports = opts => { opts = opts || {}; const env = opts.env || process.env; const platform = opts.platform || process.platform; if (platform !== 'win32') { return 'PATH'; } return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; }; /***/ }), /***/ 85644: /***/ (function(module) { // Generated by CoffeeScript 1.12.2 (function() { var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; if ((typeof performance !== "undefined" && performance !== null) && performance.now) { module.exports = function() { return performance.now(); }; } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { module.exports = function() { return (getNanoSeconds() - nodeLoadTime) / 1e6; }; hrtime = process.hrtime; getNanoSeconds = function() { var hr; hr = hrtime(); return hr[0] * 1e9 + hr[1]; }; moduleLoadTime = getNanoSeconds(); upTime = process.uptime() * 1e9; nodeLoadTime = moduleLoadTime - upTime; } else if (Date.now) { module.exports = function() { return Date.now() - loadTime; }; loadTime = Date.now(); } else { module.exports = function() { return new Date().getTime() - loadTime; }; loadTime = new Date().getTime(); } }).call(this); //# sourceMappingURL=performance-now.js.map /***/ }), /***/ 68830: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.googleProtobufAnyFromProto3JSON = exports.googleProtobufAnyToProto3JSON = void 0; const fromproto3json_1 = __webpack_require__(71361); const toproto3json_1 = __webpack_require__(27586); // https://github.com/protocolbuffers/protobuf/blob/ba3836703b4a9e98e474aea2bac8c5b49b6d3b5c/python/google/protobuf/json_format.py#L850 const specialJSON = new Set([ 'google.protobuf.Any', 'google.protobuf.Duration', 'google.protobuf.FieldMask', 'google.protobuf.ListValue', 'google.protobuf.Struct', 'google.protobuf.Timestamp', 'google.protobuf.Value', ]); function googleProtobufAnyToProto3JSON(obj) { // https://developers.google.com/protocol-buffers/docs/proto3#json // If the Any contains a value that has a special JSON mapping, it will be converted as follows: // {"@type": xxx, "value": yyy}. // Otherwise, the value will be converted into a JSON object, and the "@type" field will be inserted // to indicate the actual data type. const typeName = obj.type_url.replace(/^.*\//, ''); let type; try { type = obj.$type.root.lookupType(typeName); } catch (err) { throw new Error(`googleProtobufAnyToProto3JSON: cannot find type ${typeName}: ${err}`); } const valueMessage = type.decode(obj.value); const valueProto3JSON = (0, toproto3json_1.toProto3JSON)(valueMessage); if (specialJSON.has(typeName)) { return { '@type': obj.type_url, value: valueProto3JSON, }; } valueProto3JSON['@type'] = obj.type_url; return valueProto3JSON; } exports.googleProtobufAnyToProto3JSON = googleProtobufAnyToProto3JSON; function googleProtobufAnyFromProto3JSON(root, json) { // Not all possible JSON values can hold Any, only real objects. if (json === null || typeof json !== 'object' || Array.isArray(json)) { throw new Error('googleProtobufAnyFromProto3JSON: must be an object to decode google.protobuf.Any'); } const typeUrl = json['@type']; if (!typeUrl || typeof typeUrl !== 'string') { throw new Error('googleProtobufAnyFromProto3JSON: JSON serialization of google.protobuf.Any must contain @type field'); } const typeName = typeUrl.replace(/^.*\//, ''); let type; try { type = root.lookupType(typeName); } catch (err) { throw new Error(`googleProtobufAnyFromProto3JSON: cannot find type ${typeName}: ${err}`); } let value = json; if (specialJSON.has(typeName)) { if (!('value' in json)) { throw new Error(`googleProtobufAnyFromProto3JSON: JSON representation of google.protobuf.Any with type ${typeName} must contain the value field`); } value = json.value; } const valueMessage = (0, fromproto3json_1.fromProto3JSON)(type, value); if (valueMessage === null) { return { type_url: typeUrl, value: null, }; } const uint8array = type.encode(valueMessage).finish(); const buffer = Buffer.from(uint8array, 0, uint8array.byteLength); const base64 = buffer.toString('base64'); return { type_url: typeUrl, value: base64, }; } exports.googleProtobufAnyFromProto3JSON = googleProtobufAnyFromProto3JSON; //# sourceMappingURL=any.js.map /***/ }), /***/ 10698: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.bytesFromProto3JSON = exports.bytesToProto3JSON = void 0; function bytesToProto3JSON(obj) { if (Buffer.isBuffer(obj)) { return obj.toString('base64'); } else { return Buffer.from(obj.buffer, 0, obj.byteLength).toString('base64'); } } exports.bytesToProto3JSON = bytesToProto3JSON; function bytesFromProto3JSON(json) { return Buffer.from(json, 'base64'); } exports.bytesFromProto3JSON = bytesFromProto3JSON; //# sourceMappingURL=bytes.js.map /***/ }), /***/ 85763: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.googleProtobufDurationFromProto3JSON = exports.googleProtobufDurationToProto3JSON = void 0; function googleProtobufDurationToProto3JSON(obj) { // seconds is an instance of Long so it won't be undefined let durationSeconds = obj.seconds.toString(); if (typeof obj.nanos === 'number' && obj.nanos > 0) { // nanosStr should contain 3, 6, or 9 fractional digits. const nanosStr = obj.nanos .toString() .padStart(9, '0') .replace(/^((?:\d\d\d)+?)(?:0*)$/, '$1'); durationSeconds += '.' + nanosStr; } durationSeconds += 's'; return durationSeconds; } exports.googleProtobufDurationToProto3JSON = googleProtobufDurationToProto3JSON; function googleProtobufDurationFromProto3JSON(json) { const match = json.match(/^(\d*)(?:\.(\d*))?s$/); if (!match) { throw new Error(`googleProtobufDurationFromProto3JSON: incorrect value ${json} passed as google.protobuf.Duration`); } let seconds = 0; let nanos = 0; if (typeof match[1] === 'string' && match[1].length > 0) { seconds = parseInt(match[1]); } if (typeof match[2] === 'string' && match[2].length > 0) { nanos = parseInt(match[2].padEnd(9, '0')); } const result = {}; if (seconds !== 0) { result.seconds = seconds; } if (nanos !== 0) { result.nanos = nanos; } return result; } exports.googleProtobufDurationFromProto3JSON = googleProtobufDurationFromProto3JSON; //# sourceMappingURL=duration.js.map /***/ }), /***/ 93584: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveEnumValueToString = void 0; function resolveEnumValueToString(enumType, enumValue) { // for unknown enum values, do not fail and try to do the best we could. // protobuf.js fromObject() will likely ignore unknown values, but at least // we won't fail. if (typeof enumValue === 'number') { const value = enumType.valuesById[enumValue]; if (typeof value === 'undefined') { // unknown value, cannot convert to string, returning number as is return enumValue; } return value; } if (typeof enumValue === 'string') { // for strings, just accept what we got return enumValue; } throw new Error('resolveEnumValueToString: enum value must be a string or a number'); } exports.resolveEnumValueToString = resolveEnumValueToString; //# sourceMappingURL=enum.js.map /***/ }), /***/ 28923: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.googleProtobufFieldMaskFromProto3JSON = exports.googleProtobufFieldMaskToProto3JSON = void 0; function googleProtobufFieldMaskToProto3JSON(obj) { return obj.paths.join(','); } exports.googleProtobufFieldMaskToProto3JSON = googleProtobufFieldMaskToProto3JSON; function googleProtobufFieldMaskFromProto3JSON(json) { return { paths: json.split(','), }; } exports.googleProtobufFieldMaskFromProto3JSON = googleProtobufFieldMaskFromProto3JSON; //# sourceMappingURL=fieldmask.js.map /***/ }), /***/ 71361: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fromProto3JSON = exports.fromProto3JSONToInternalRepresentation = void 0; const assert = __webpack_require__(42357); const any_1 = __webpack_require__(68830); const bytes_1 = __webpack_require__(10698); const enum_1 = __webpack_require__(93584); const value_1 = __webpack_require__(73027); const util_1 = __webpack_require__(79053); const duration_1 = __webpack_require__(85763); const timestamp_1 = __webpack_require__(56656); const wrappers_1 = __webpack_require__(50241); const fieldmask_1 = __webpack_require__(28923); function fromProto3JSONToInternalRepresentation(type, json) { const fullyQualifiedTypeName = typeof type === 'string' ? type : (0, util_1.getFullyQualifiedTypeName)(type); if (typeof type !== 'string' && 'values' in type) { // type is an Enum if (fullyQualifiedTypeName === '.google.protobuf.NullValue') { return 'NULL_VALUE'; } return (0, enum_1.resolveEnumValueToString)(type, json); } if (typeof type !== 'string') { type.resolveAll(); } if (typeof type === 'string') { return json; } // Types that require special handling according to // https://developers.google.com/protocol-buffers/docs/proto3#json // Types that can have meaningful "null" value if (fullyQualifiedTypeName === '.google.protobuf.Value') { return (0, value_1.googleProtobufValueFromProto3JSON)(json); } if (util_1.wrapperTypes.has(fullyQualifiedTypeName)) { if ((json !== null && typeof json === 'object') || Array.isArray(json)) { throw new Error(`fromProto3JSONToInternalRepresentation: JSON representation for ${fullyQualifiedTypeName} expects a string, a number, or a boolean, but got ${typeof json}`); } return (0, wrappers_1.wrapperFromProto3JSON)(fullyQualifiedTypeName, json); } if (json === null) { return null; } // Types that cannot be "null" if (fullyQualifiedTypeName === '.google.protobuf.Any') { return (0, any_1.googleProtobufAnyFromProto3JSON)(type.root, json); } if (fullyQualifiedTypeName === '.google.protobuf.Struct') { if (typeof json !== 'object') { throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Struct must be an object but got ${typeof json}`); } if (Array.isArray(json)) { throw new Error('fromProto3JSONToInternalRepresentation: google.protobuf.Struct must be an object but got an array'); } return (0, value_1.googleProtobufStructFromProto3JSON)(json); } if (fullyQualifiedTypeName === '.google.protobuf.ListValue') { if (!Array.isArray(json)) { throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.ListValue must be an array but got ${typeof json}`); } return (0, value_1.googleProtobufListValueFromProto3JSON)(json); } if (fullyQualifiedTypeName === '.google.protobuf.Duration') { if (typeof json !== 'string') { throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Duration must be a string but got ${typeof json}`); } return (0, duration_1.googleProtobufDurationFromProto3JSON)(json); } if (fullyQualifiedTypeName === '.google.protobuf.Timestamp') { if (typeof json !== 'string') { throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.Timestamp must be a string but got ${typeof json}`); } return (0, timestamp_1.googleProtobufTimestampFromProto3JSON)(json); } if (fullyQualifiedTypeName === '.google.protobuf.FieldMask') { if (typeof json !== 'string') { throw new Error(`fromProto3JSONToInternalRepresentation: google.protobuf.FieldMask must be a string but got ${typeof json}`); } return (0, fieldmask_1.googleProtobufFieldMaskFromProto3JSON)(json); } const result = {}; for (const [key, value] of Object.entries(json)) { const field = type.fields[key]; if (!field) { continue; } const resolvedType = field.resolvedType; const fieldType = field.type; if (field.repeated) { if (!Array.isArray(value)) { throw new Error(`fromProto3JSONToInternalRepresentation: expected an array for field ${key}`); } result[key] = value.map(element => fromProto3JSONToInternalRepresentation(resolvedType || fieldType, element)); } else if (field.map) { const map = {}; for (const [mapKey, mapValue] of Object.entries(value)) { map[mapKey] = fromProto3JSONToInternalRepresentation(resolvedType || fieldType, mapValue); } result[key] = map; } else if (fieldType.match(/^(?:(?:(?:u?int|fixed)(?:32|64))|float|double)$/)) { if (typeof value !== 'number' && typeof value !== 'string') { throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`); } result[key] = value; } else if (fieldType === 'string') { if (typeof value !== 'string') { throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`); } result[key] = value; } else if (fieldType === 'bool') { if (typeof value !== 'boolean') { throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`); } result[key] = value; } else if (fieldType === 'bytes') { if (typeof value !== 'string') { throw new Error(`fromProto3JSONToInternalRepresentation: field ${key} of type ${field.type} cannot contain value ${value}`); } result[key] = (0, bytes_1.bytesFromProto3JSON)(value); } else { // Message type assert(resolvedType, `Expected to be able to resolve type for field ${field.name}`); const deserializedValue = fromProto3JSONToInternalRepresentation(resolvedType, value); result[key] = deserializedValue; } } return result; } exports.fromProto3JSONToInternalRepresentation = fromProto3JSONToInternalRepresentation; function fromProto3JSON(type, json) { const internalRepr = fromProto3JSONToInternalRepresentation(type, json); if (internalRepr === null) { return null; } // We only expect a real object here sine all special cases should be already resolved. Everything else is an internal error assert(typeof internalRepr === 'object' && !Array.isArray(internalRepr), `fromProto3JSON: expected an object, not ${json}`); return type.fromObject(internalRepr); } exports.fromProto3JSON = fromProto3JSON; //# sourceMappingURL=fromproto3json.js.map /***/ }), /***/ 2027: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fromProto3JSON = exports.toProto3JSON = void 0; var toproto3json_1 = __webpack_require__(27586); Object.defineProperty(exports, "toProto3JSON", ({ enumerable: true, get: function () { return toproto3json_1.toProto3JSON; } })); var fromproto3json_1 = __webpack_require__(71361); Object.defineProperty(exports, "fromProto3JSON", ({ enumerable: true, get: function () { return fromproto3json_1.fromProto3JSON; } })); //# sourceMappingURL=index.js.map /***/ }), /***/ 56656: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.googleProtobufTimestampFromProto3JSON = exports.googleProtobufTimestampToProto3JSON = void 0; function googleProtobufTimestampToProto3JSON(obj) { // seconds is an instance of Long so it won't be undefined const durationSeconds = obj.seconds; const durationMilliseconds = typeof obj.nanos === 'number' && obj.nanos > 0 ? Math.floor(obj.nanos / 1000000) : 0; return new Date(durationSeconds * 1000 + durationMilliseconds).toISOString(); } exports.googleProtobufTimestampToProto3JSON = googleProtobufTimestampToProto3JSON; function googleProtobufTimestampFromProto3JSON(json) { const match = json.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?/); if (!match) { throw new Error(`googleProtobufDurationFromProto3JSON: incorrect value ${json} passed as google.protobuf.Duration`); } const date = new Date(json); const millisecondsSinceEpoch = date.getTime(); const seconds = Math.floor(millisecondsSinceEpoch / 1000); const nanos = (millisecondsSinceEpoch % 1000) * 1000000; const result = {}; if (seconds !== 0) { result.seconds = seconds; } if (nanos !== 0) { result.nanos = nanos; } return result; } exports.googleProtobufTimestampFromProto3JSON = googleProtobufTimestampFromProto3JSON; //# sourceMappingURL=timestamp.js.map /***/ }), /***/ 27586: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toProto3JSON = void 0; const assert = __webpack_require__(42357); const any_1 = __webpack_require__(68830); const bytes_1 = __webpack_require__(10698); const util_1 = __webpack_require__(79053); const enum_1 = __webpack_require__(93584); const value_1 = __webpack_require__(73027); const duration_1 = __webpack_require__(85763); const timestamp_1 = __webpack_require__(56656); const wrappers_1 = __webpack_require__(50241); const fieldmask_1 = __webpack_require__(28923); const id = (x) => { return x; }; function toProto3JSON(obj) { const objType = obj.$type; if (!objType) { throw new Error('Cannot serialize object to proto3 JSON since its .$type is unknown. Use Type.fromObject(obj) before calling toProto3JSON.'); } objType.resolveAll(); const typeName = (0, util_1.getFullyQualifiedTypeName)(objType); // Types that require special handling according to // https://developers.google.com/protocol-buffers/docs/proto3#json if (typeName === '.google.protobuf.Any') { return (0, any_1.googleProtobufAnyToProto3JSON)(obj); } if (typeName === '.google.protobuf.Value') { return (0, value_1.googleProtobufValueToProto3JSON)(obj); } if (typeName === '.google.protobuf.Struct') { return (0, value_1.googleProtobufStructToProto3JSON)(obj); } if (typeName === '.google.protobuf.ListValue') { return (0, value_1.googleProtobufListValueToProto3JSON)(obj); } if (typeName === '.google.protobuf.Duration') { return (0, duration_1.googleProtobufDurationToProto3JSON)(obj); } if (typeName === '.google.protobuf.Timestamp') { return (0, timestamp_1.googleProtobufTimestampToProto3JSON)(obj); } if (typeName === '.google.protobuf.FieldMask') { return (0, fieldmask_1.googleProtobufFieldMaskToProto3JSON)(obj); } if (util_1.wrapperTypes.has(typeName)) { return (0, wrappers_1.wrapperToProto3JSON)(obj); } const result = {}; for (const [key, value] of Object.entries(obj)) { const field = objType.fields[key]; const fieldResolvedType = field.resolvedType; const fieldFullyQualifiedTypeName = fieldResolvedType ? (0, util_1.getFullyQualifiedTypeName)(fieldResolvedType) : null; if (value === null) { result[key] = null; continue; } if (Array.isArray(value)) { if (value.length === 0) { // ignore repeated fields with no values continue; } // if the repeated value has a complex type, convert it to proto3 JSON, otherwise use as is result[key] = value.map(fieldResolvedType ? element => { return toProto3JSON(element); } : id); continue; } if (field.map) { const map = {}; for (const [mapKey, mapValue] of Object.entries(value)) { // if the map value has a complex type, convert it to proto3 JSON, otherwise use as is map[mapKey] = fieldResolvedType ? toProto3JSON(mapValue) : mapValue; } result[key] = map; continue; } if (fieldFullyQualifiedTypeName === '.google.protobuf.NullValue') { result[key] = null; continue; } if (fieldResolvedType && 'values' in fieldResolvedType && value !== null) { result[key] = (0, enum_1.resolveEnumValueToString)(fieldResolvedType, value); continue; } if (fieldResolvedType) { result[key] = toProto3JSON(value); continue; } if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null) { if (typeof value === 'number' && !Number.isFinite(value)) { result[key] = value.toString(); continue; } result[key] = value; continue; } if (Buffer.isBuffer(value) || value instanceof Uint8Array) { result[key] = (0, bytes_1.bytesToProto3JSON)(value); continue; } // The remaining case is Long, everything else is an internal error assert(value.constructor.name === 'Long', `toProto3JSON: don't know how to convert field ${key} with value ${value}`); result[key] = value.toString(); continue; } return result; } exports.toProto3JSON = toProto3JSON; //# sourceMappingURL=toproto3json.js.map /***/ }), /***/ 79053: /***/ ((__unused_webpack_module, exports) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.wrapperTypes = exports.getFullyQualifiedTypeName = void 0; function getFullyQualifiedTypeName(type) { // We assume that the protobuf package tree cannot have cycles. let fullyQualifiedTypeName = ''; while (type.parent) { fullyQualifiedTypeName = `.${type.name}${fullyQualifiedTypeName}`; type = type.parent; } return fullyQualifiedTypeName; } exports.getFullyQualifiedTypeName = getFullyQualifiedTypeName; exports.wrapperTypes = new Set([ '.google.protobuf.DoubleValue', '.google.protobuf.FloatValue', '.google.protobuf.Int64Value', '.google.protobuf.UInt64Value', '.google.protobuf.Int32Value', '.google.protobuf.UInt32Value', '.google.protobuf.BoolValue', '.google.protobuf.StringValue', '.google.protobuf.BytesValue', ]); //# sourceMappingURL=util.js.map /***/ }), /***/ 73027: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.googleProtobufValueFromProto3JSON = exports.googleProtobufListValueFromProto3JSON = exports.googleProtobufStructFromProto3JSON = exports.googleProtobufValueToProto3JSON = exports.googleProtobufListValueToProto3JSON = exports.googleProtobufStructToProto3JSON = void 0; const assert = __webpack_require__(42357); function googleProtobufStructToProto3JSON(obj) { const result = {}; const fields = obj.fields; for (const [key, value] of Object.entries(fields)) { result[key] = googleProtobufValueToProto3JSON(value); } return result; } exports.googleProtobufStructToProto3JSON = googleProtobufStructToProto3JSON; function googleProtobufListValueToProto3JSON(obj) { assert(Array.isArray(obj.values), 'ListValue internal representation must contain array of values'); return obj.values.map(googleProtobufValueToProto3JSON); } exports.googleProtobufListValueToProto3JSON = googleProtobufListValueToProto3JSON; function googleProtobufValueToProto3JSON(obj) { if (Object.prototype.hasOwnProperty.call(obj, 'nullValue')) { return null; } if (Object.prototype.hasOwnProperty.call(obj, 'numberValue') && typeof obj.numberValue === 'number') { if (!Number.isFinite(obj.numberValue)) { return obj.numberValue.toString(); } return obj.numberValue; } if (Object.prototype.hasOwnProperty.call(obj, 'stringValue') && typeof obj.stringValue === 'string') { return obj.stringValue; } if (Object.prototype.hasOwnProperty.call(obj, 'boolValue') && typeof obj.boolValue === 'boolean') { return obj.boolValue; } if (Object.prototype.hasOwnProperty.call(obj, 'structValue') && typeof obj.structValue === 'object') { return googleProtobufStructToProto3JSON(obj.structValue); } if (Object.prototype.hasOwnProperty.call(obj, 'listValue') && typeof obj === 'object' && typeof obj.listValue === 'object') { return googleProtobufListValueToProto3JSON(obj.listValue); } // Assuming empty Value to be null return null; } exports.googleProtobufValueToProto3JSON = googleProtobufValueToProto3JSON; function googleProtobufStructFromProto3JSON(json) { const fields = {}; for (const [key, value] of Object.entries(json)) { fields[key] = googleProtobufValueFromProto3JSON(value); } return { fields }; } exports.googleProtobufStructFromProto3JSON = googleProtobufStructFromProto3JSON; function googleProtobufListValueFromProto3JSON(json) { return { values: json.map(element => googleProtobufValueFromProto3JSON(element)), }; } exports.googleProtobufListValueFromProto3JSON = googleProtobufListValueFromProto3JSON; function googleProtobufValueFromProto3JSON(json) { if (json === null) { return { nullValue: 'NULL_VALUE' }; } if (typeof json === 'number') { return { numberValue: json }; } if (typeof json === 'string') { return { stringValue: json }; } if (typeof json === 'boolean') { return { boolValue: json }; } if (Array.isArray(json)) { return { listValue: googleProtobufListValueFromProto3JSON(json), }; } if (typeof json === 'object') { return { structValue: googleProtobufStructFromProto3JSON(json), }; } throw new Error(`googleProtobufValueFromProto3JSON: incorrect parameter type: ${typeof json}`); } exports.googleProtobufValueFromProto3JSON = googleProtobufValueFromProto3JSON; //# sourceMappingURL=value.js.map /***/ }), /***/ 50241: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.wrapperFromProto3JSON = exports.wrapperToProto3JSON = void 0; const assert = __webpack_require__(42357); const bytes_1 = __webpack_require__(10698); function wrapperToProto3JSON(obj) { if (!Object.prototype.hasOwnProperty.call(obj, 'value')) { return null; } if (Buffer.isBuffer(obj.value) || obj.value instanceof Uint8Array) { return (0, bytes_1.bytesToProto3JSON)(obj.value); } if (typeof obj.value === 'object') { assert(obj.value.constructor.name === 'Long', `wrapperToProto3JSON: expected to see a number, a string, a boolean, or a Long, but got ${obj.value}`); return obj.value.toString(); } // JSON accept special string values "NaN", "Infinity", and "-Infinity". if (typeof obj.value === 'number' && !Number.isFinite(obj.value)) { return obj.value.toString(); } return obj.value; } exports.wrapperToProto3JSON = wrapperToProto3JSON; function wrapperFromProto3JSON(typeName, json) { if (json === null) { return { value: null, }; } if (typeName === '.google.protobuf.BytesValue') { if (typeof json !== 'string') { throw new Error(`numberWrapperFromProto3JSON: expected to get a string for google.protobuf.BytesValue but got ${typeof json}`); } return { value: (0, bytes_1.bytesFromProto3JSON)(json), }; } return { value: json, }; } exports.wrapperFromProto3JSON = wrapperFromProto3JSON; //# sourceMappingURL=wrappers.js.map /***/ }), /***/ 21629: /***/ ((module, exports, __webpack_require__) => { "use strict"; var $protobuf = __webpack_require__(85881); module.exports = exports = $protobuf.descriptor = $protobuf.Root.fromJSON(__webpack_require__(40333)).lookup(".google.protobuf"); var Namespace = $protobuf.Namespace, Root = $protobuf.Root, Enum = $protobuf.Enum, Type = $protobuf.Type, Field = $protobuf.Field, MapField = $protobuf.MapField, OneOf = $protobuf.OneOf, Service = $protobuf.Service, Method = $protobuf.Method; // --- Root --- /** * Properties of a FileDescriptorSet message. * @interface IFileDescriptorSet * @property {IFileDescriptorProto[]} file Files */ /** * Properties of a FileDescriptorProto message. * @interface IFileDescriptorProto * @property {string} [name] File name * @property {string} [package] Package * @property {*} [dependency] Not supported * @property {*} [publicDependency] Not supported * @property {*} [weakDependency] Not supported * @property {IDescriptorProto[]} [messageType] Nested message types * @property {IEnumDescriptorProto[]} [enumType] Nested enums * @property {IServiceDescriptorProto[]} [service] Nested services * @property {IFieldDescriptorProto[]} [extension] Nested extension fields * @property {IFileOptions} [options] Options * @property {*} [sourceCodeInfo] Not supported * @property {string} [syntax="proto2"] Syntax */ /** * Properties of a FileOptions message. * @interface IFileOptions * @property {string} [javaPackage] * @property {string} [javaOuterClassname] * @property {boolean} [javaMultipleFiles] * @property {boolean} [javaGenerateEqualsAndHash] * @property {boolean} [javaStringCheckUtf8] * @property {IFileOptionsOptimizeMode} [optimizeFor=1] * @property {string} [goPackage] * @property {boolean} [ccGenericServices] * @property {boolean} [javaGenericServices] * @property {boolean} [pyGenericServices] * @property {boolean} [deprecated] * @property {boolean} [ccEnableArenas] * @property {string} [objcClassPrefix] * @property {string} [csharpNamespace] */ /** * Values of he FileOptions.OptimizeMode enum. * @typedef IFileOptionsOptimizeMode * @type {number} * @property {number} SPEED=1 * @property {number} CODE_SIZE=2 * @property {number} LITE_RUNTIME=3 */ /** * Creates a root from a descriptor set. * @param {IFileDescriptorSet|Reader|Uint8Array} descriptor Descriptor * @returns {Root} Root instance */ Root.fromDescriptor = function fromDescriptor(descriptor) { // Decode the descriptor message if specified as a buffer: if (typeof descriptor.length === "number") descriptor = exports.FileDescriptorSet.decode(descriptor); var root = new Root(); if (descriptor.file) { var fileDescriptor, filePackage; for (var j = 0, i; j < descriptor.file.length; ++j) { filePackage = root; if ((fileDescriptor = descriptor.file[j])["package"] && fileDescriptor["package"].length) filePackage = root.define(fileDescriptor["package"]); if (fileDescriptor.name && fileDescriptor.name.length) root.files.push(filePackage.filename = fileDescriptor.name); if (fileDescriptor.messageType) for (i = 0; i < fileDescriptor.messageType.length; ++i) filePackage.add(Type.fromDescriptor(fileDescriptor.messageType[i], fileDescriptor.syntax)); if (fileDescriptor.enumType) for (i = 0; i < fileDescriptor.enumType.length; ++i) filePackage.add(Enum.fromDescriptor(fileDescriptor.enumType[i])); if (fileDescriptor.extension) for (i = 0; i < fileDescriptor.extension.length; ++i) filePackage.add(Field.fromDescriptor(fileDescriptor.extension[i])); if (fileDescriptor.service) for (i = 0; i < fileDescriptor.service.length; ++i) filePackage.add(Service.fromDescriptor(fileDescriptor.service[i])); var opts = fromDescriptorOptions(fileDescriptor.options, exports.FileOptions); if (opts) { var ks = Object.keys(opts); for (i = 0; i < ks.length; ++i) filePackage.setOption(ks[i], opts[ks[i]]); } } } return root; }; /** * Converts a root to a descriptor set. * @returns {Message} Descriptor * @param {string} [syntax="proto2"] Syntax */ Root.prototype.toDescriptor = function toDescriptor(syntax) { var set = exports.FileDescriptorSet.create(); Root_toDescriptorRecursive(this, set.file, syntax); return set; }; // Traverses a namespace and assembles the descriptor set function Root_toDescriptorRecursive(ns, files, syntax) { // Create a new file var file = exports.FileDescriptorProto.create({ name: ns.filename || (ns.fullName.substring(1).replace(/\./g, "_") || "root") + ".proto" }); if (syntax) file.syntax = syntax; if (!(ns instanceof Root)) file["package"] = ns.fullName.substring(1); // Add nested types for (var i = 0, nested; i < ns.nestedArray.length; ++i) if ((nested = ns._nestedArray[i]) instanceof Type) file.messageType.push(nested.toDescriptor(syntax)); else if (nested instanceof Enum) file.enumType.push(nested.toDescriptor()); else if (nested instanceof Field) file.extension.push(nested.toDescriptor(syntax)); else if (nested instanceof Service) file.service.push(nested.toDescriptor()); else if (nested instanceof /* plain */ Namespace) Root_toDescriptorRecursive(nested, files, syntax); // requires new file // Keep package-level options file.options = toDescriptorOptions(ns.options, exports.FileOptions); // And keep the file only if there is at least one nested object if (file.messageType.length + file.enumType.length + file.extension.length + file.service.length) files.push(file); } // --- Type --- /** * Properties of a DescriptorProto message. * @interface IDescriptorProto * @property {string} [name] Message type name * @property {IFieldDescriptorProto[]} [field] Fields * @property {IFieldDescriptorProto[]} [extension] Extension fields * @property {IDescriptorProto[]} [nestedType] Nested message types * @property {IEnumDescriptorProto[]} [enumType] Nested enums * @property {IDescriptorProtoExtensionRange[]} [extensionRange] Extension ranges * @property {IOneofDescriptorProto[]} [oneofDecl] Oneofs * @property {IMessageOptions} [options] Not supported * @property {IDescriptorProtoReservedRange[]} [reservedRange] Reserved ranges * @property {string[]} [reservedName] Reserved names */ /** * Properties of a MessageOptions message. * @interface IMessageOptions * @property {boolean} [mapEntry=false] Whether this message is a map entry */ /** * Properties of an ExtensionRange message. * @interface IDescriptorProtoExtensionRange * @property {number} [start] Start field id * @property {number} [end] End field id */ /** * Properties of a ReservedRange message. * @interface IDescriptorProtoReservedRange * @property {number} [start] Start field id * @property {number} [end] End field id */ var unnamedMessageIndex = 0; /** * Creates a type from a descriptor. * @param {IDescriptorProto|Reader|Uint8Array} descriptor Descriptor * @param {string} [syntax="proto2"] Syntax * @returns {Type} Type instance */ Type.fromDescriptor = function fromDescriptor(descriptor, syntax) { // Decode the descriptor message if specified as a buffer: if (typeof descriptor.length === "number") descriptor = exports.DescriptorProto.decode(descriptor); // Create the message type var type = new Type(descriptor.name.length ? descriptor.name : "Type" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports.MessageOptions)), i; /* Oneofs */ if (descriptor.oneofDecl) for (i = 0; i < descriptor.oneofDecl.length; ++i) type.add(OneOf.fromDescriptor(descriptor.oneofDecl[i])); /* Fields */ if (descriptor.field) for (i = 0; i < descriptor.field.length; ++i) { var field = Field.fromDescriptor(descriptor.field[i], syntax); type.add(field); if (descriptor.field[i].hasOwnProperty("oneofIndex")) // eslint-disable-line no-prototype-builtins type.oneofsArray[descriptor.field[i].oneofIndex].add(field); } /* Extension fields */ if (descriptor.extension) for (i = 0; i < descriptor.extension.length; ++i) type.add(Field.fromDescriptor(descriptor.extension[i], syntax)); /* Nested types */ if (descriptor.nestedType) for (i = 0; i < descriptor.nestedType.length; ++i) { type.add(Type.fromDescriptor(descriptor.nestedType[i], syntax)); if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry) type.setOption("map_entry", true); } /* Nested enums */ if (descriptor.enumType) for (i = 0; i < descriptor.enumType.length; ++i) type.add(Enum.fromDescriptor(descriptor.enumType[i])); /* Extension ranges */ if (descriptor.extensionRange && descriptor.extensionRange.length) { type.extensions = []; for (i = 0; i < descriptor.extensionRange.length; ++i) type.extensions.push([ descriptor.extensionRange[i].start, descriptor.extensionRange[i].end ]); } /* Reserved... */ if (descriptor.reservedRange && descriptor.reservedRange.length || descriptor.reservedName && descriptor.reservedName.length) { type.reserved = []; /* Ranges */ if (descriptor.reservedRange) for (i = 0; i < descriptor.reservedRange.length; ++i) type.reserved.push([ descriptor.reservedRange[i].start, descriptor.reservedRange[i].end ]); /* Names */ if (descriptor.reservedName) for (i = 0; i < descriptor.reservedName.length; ++i) type.reserved.push(descriptor.reservedName[i]); } return type; }; /** * Converts a type to a descriptor. * @returns {Message} Descriptor * @param {string} [syntax="proto2"] Syntax */ Type.prototype.toDescriptor = function toDescriptor(syntax) { var descriptor = exports.DescriptorProto.create({ name: this.name }), i; /* Fields */ for (i = 0; i < this.fieldsArray.length; ++i) { var fieldDescriptor; descriptor.field.push(fieldDescriptor = this._fieldsArray[i].toDescriptor(syntax)); if (this._fieldsArray[i] instanceof MapField) { // map fields are repeated FieldNameEntry var keyType = toDescriptorType(this._fieldsArray[i].keyType, this._fieldsArray[i].resolvedKeyType), valueType = toDescriptorType(this._fieldsArray[i].type, this._fieldsArray[i].resolvedType), valueTypeName = valueType === /* type */ 11 || valueType === /* enum */ 14 ? this._fieldsArray[i].resolvedType && shortname(this.parent, this._fieldsArray[i].resolvedType) || this._fieldsArray[i].type : undefined; descriptor.nestedType.push(exports.DescriptorProto.create({ name: fieldDescriptor.typeName, field: [ exports.FieldDescriptorProto.create({ name: "key", number: 1, label: 1, type: keyType }), // can't reference a type or enum exports.FieldDescriptorProto.create({ name: "value", number: 2, label: 1, type: valueType, typeName: valueTypeName }) ], options: exports.MessageOptions.create({ mapEntry: true }) })); } } /* Oneofs */ for (i = 0; i < this.oneofsArray.length; ++i) descriptor.oneofDecl.push(this._oneofsArray[i].toDescriptor()); /* Nested... */ for (i = 0; i < this.nestedArray.length; ++i) { /* Extension fields */ if (this._nestedArray[i] instanceof Field) descriptor.field.push(this._nestedArray[i].toDescriptor(syntax)); /* Types */ else if (this._nestedArray[i] instanceof Type) descriptor.nestedType.push(this._nestedArray[i].toDescriptor(syntax)); /* Enums */ else if (this._nestedArray[i] instanceof Enum) descriptor.enumType.push(this._nestedArray[i].toDescriptor()); // plain nested namespaces become packages instead in Root#toDescriptor } /* Extension ranges */ if (this.extensions) for (i = 0; i < this.extensions.length; ++i) descriptor.extensionRange.push(exports.DescriptorProto.ExtensionRange.create({ start: this.extensions[i][0], end: this.extensions[i][1] })); /* Reserved... */ if (this.reserved) for (i = 0; i < this.reserved.length; ++i) /* Names */ if (typeof this.reserved[i] === "string") descriptor.reservedName.push(this.reserved[i]); /* Ranges */ else descriptor.reservedRange.push(exports.DescriptorProto.ReservedRange.create({ start: this.reserved[i][0], end: this.reserved[i][1] })); descriptor.options = toDescriptorOptions(this.options, exports.MessageOptions); return descriptor; }; // --- Field --- /** * Properties of a FieldDescriptorProto message. * @interface IFieldDescriptorProto * @property {string} [name] Field name * @property {number} [number] Field id * @property {IFieldDescriptorProtoLabel} [label] Field rule * @property {IFieldDescriptorProtoType} [type] Field basic type * @property {string} [typeName] Field type name * @property {string} [extendee] Extended type name * @property {string} [defaultValue] Literal default value * @property {number} [oneofIndex] Oneof index if part of a oneof * @property {*} [jsonName] Not supported * @property {IFieldOptions} [options] Field options */ /** * Values of the FieldDescriptorProto.Label enum. * @typedef IFieldDescriptorProtoLabel * @type {number} * @property {number} LABEL_OPTIONAL=1 * @property {number} LABEL_REQUIRED=2 * @property {number} LABEL_REPEATED=3 */ /** * Values of the FieldDescriptorProto.Type enum. * @typedef IFieldDescriptorProtoType * @type {number} * @property {number} TYPE_DOUBLE=1 * @property {number} TYPE_FLOAT=2 * @property {number} TYPE_INT64=3 * @property {number} TYPE_UINT64=4 * @property {number} TYPE_INT32=5 * @property {number} TYPE_FIXED64=6 * @property {number} TYPE_FIXED32=7 * @property {number} TYPE_BOOL=8 * @property {number} TYPE_STRING=9 * @property {number} TYPE_GROUP=10 * @property {number} TYPE_MESSAGE=11 * @property {number} TYPE_BYTES=12 * @property {number} TYPE_UINT32=13 * @property {number} TYPE_ENUM=14 * @property {number} TYPE_SFIXED32=15 * @property {number} TYPE_SFIXED64=16 * @property {number} TYPE_SINT32=17 * @property {number} TYPE_SINT64=18 */ /** * Properties of a FieldOptions message. * @interface IFieldOptions * @property {boolean} [packed] Whether packed or not (defaults to `false` for proto2 and `true` for proto3) * @property {IFieldOptionsJSType} [jstype] JavaScript value type (not used by protobuf.js) */ /** * Values of the FieldOptions.JSType enum. * @typedef IFieldOptionsJSType * @type {number} * @property {number} JS_NORMAL=0 * @property {number} JS_STRING=1 * @property {number} JS_NUMBER=2 */ // copied here from parse.js var numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/; /** * Creates a field from a descriptor. * @param {IFieldDescriptorProto|Reader|Uint8Array} descriptor Descriptor * @param {string} [syntax="proto2"] Syntax * @returns {Field} Field instance */ Field.fromDescriptor = function fromDescriptor(descriptor, syntax) { // Decode the descriptor message if specified as a buffer: if (typeof descriptor.length === "number") descriptor = exports.DescriptorProto.decode(descriptor); if (typeof descriptor.number !== "number") throw Error("missing field id"); // Rewire field type var fieldType; if (descriptor.typeName && descriptor.typeName.length) fieldType = descriptor.typeName; else fieldType = fromDescriptorType(descriptor.type); // Rewire field rule var fieldRule; switch (descriptor.label) { // 0 is reserved for errors case 1: fieldRule = undefined; break; case 2: fieldRule = "required"; break; case 3: fieldRule = "repeated"; break; default: throw Error("illegal label: " + descriptor.label); } var extendee = descriptor.extendee; if (descriptor.extendee !== undefined) { extendee = extendee.length ? extendee : undefined; } var field = new Field( descriptor.name.length ? descriptor.name : "field" + descriptor.number, descriptor.number, fieldType, fieldRule, extendee ); field.options = fromDescriptorOptions(descriptor.options, exports.FieldOptions); if (descriptor.defaultValue && descriptor.defaultValue.length) { var defaultValue = descriptor.defaultValue; switch (defaultValue) { case "true": case "TRUE": defaultValue = true; break; case "false": case "FALSE": defaultValue = false; break; default: var match = numberRe.exec(defaultValue); if (match) defaultValue = parseInt(defaultValue); // eslint-disable-line radix break; } field.setOption("default", defaultValue); } if (packableDescriptorType(descriptor.type)) { if (syntax === "proto3") { // defaults to packed=true (internal preset is packed=true) if (descriptor.options && !descriptor.options.packed) field.setOption("packed", false); } else if (!(descriptor.options && descriptor.options.packed)) // defaults to packed=false field.setOption("packed", false); } return field; }; /** * Converts a field to a descriptor. * @returns {Message} Descriptor * @param {string} [syntax="proto2"] Syntax */ Field.prototype.toDescriptor = function toDescriptor(syntax) { var descriptor = exports.FieldDescriptorProto.create({ name: this.name, number: this.id }); if (this.map) { descriptor.type = 11; // message descriptor.typeName = $protobuf.util.ucFirst(this.name); // fieldName -> FieldNameEntry (built in Type#toDescriptor) descriptor.label = 3; // repeated } else { // Rewire field type switch (descriptor.type = toDescriptorType(this.type, this.resolve().resolvedType)) { case 10: // group case 11: // type case 14: // enum descriptor.typeName = this.resolvedType ? shortname(this.parent, this.resolvedType) : this.type; break; } // Rewire field rule switch (this.rule) { case "repeated": descriptor.label = 3; break; case "required": descriptor.label = 2; break; default: descriptor.label = 1; break; } } // Handle extension field descriptor.extendee = this.extensionField ? this.extensionField.parent.fullName : this.extend; // Handle part of oneof if (this.partOf) if ((descriptor.oneofIndex = this.parent.oneofsArray.indexOf(this.partOf)) < 0) throw Error("missing oneof"); if (this.options) { descriptor.options = toDescriptorOptions(this.options, exports.FieldOptions); if (this.options["default"] != null) descriptor.defaultValue = String(this.options["default"]); } if (syntax === "proto3") { // defaults to packed=true if (!this.packed) (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = false; } else if (this.packed) // defaults to packed=false (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = true; return descriptor; }; // --- Enum --- /** * Properties of an EnumDescriptorProto message. * @interface IEnumDescriptorProto * @property {string} [name] Enum name * @property {IEnumValueDescriptorProto[]} [value] Enum values * @property {IEnumOptions} [options] Enum options */ /** * Properties of an EnumValueDescriptorProto message. * @interface IEnumValueDescriptorProto * @property {string} [name] Name * @property {number} [number] Value * @property {*} [options] Not supported */ /** * Properties of an EnumOptions message. * @interface IEnumOptions * @property {boolean} [allowAlias] Whether aliases are allowed * @property {boolean} [deprecated] */ var unnamedEnumIndex = 0; /** * Creates an enum from a descriptor. * @param {IEnumDescriptorProto|Reader|Uint8Array} descriptor Descriptor * @returns {Enum} Enum instance */ Enum.fromDescriptor = function fromDescriptor(descriptor) { // Decode the descriptor message if specified as a buffer: if (typeof descriptor.length === "number") descriptor = exports.EnumDescriptorProto.decode(descriptor); // Construct values object var values = {}; if (descriptor.value) for (var i = 0; i < descriptor.value.length; ++i) { var name = descriptor.value[i].name, value = descriptor.value[i].number || 0; values[name && name.length ? name : "NAME" + value] = value; } return new Enum( descriptor.name && descriptor.name.length ? descriptor.name : "Enum" + unnamedEnumIndex++, values, fromDescriptorOptions(descriptor.options, exports.EnumOptions) ); }; /** * Converts an enum to a descriptor. * @returns {Message} Descriptor */ Enum.prototype.toDescriptor = function toDescriptor() { // Values var values = []; for (var i = 0, ks = Object.keys(this.values); i < ks.length; ++i) values.push(exports.EnumValueDescriptorProto.create({ name: ks[i], number: this.values[ks[i]] })); return exports.EnumDescriptorProto.create({ name: this.name, value: values, options: toDescriptorOptions(this.options, exports.EnumOptions) }); }; // --- OneOf --- /** * Properties of a OneofDescriptorProto message. * @interface IOneofDescriptorProto * @property {string} [name] Oneof name * @property {*} [options] Not supported */ var unnamedOneofIndex = 0; /** * Creates a oneof from a descriptor. * @param {IOneofDescriptorProto|Reader|Uint8Array} descriptor Descriptor * @returns {OneOf} OneOf instance */ OneOf.fromDescriptor = function fromDescriptor(descriptor) { // Decode the descriptor message if specified as a buffer: if (typeof descriptor.length === "number") descriptor = exports.OneofDescriptorProto.decode(descriptor); return new OneOf( // unnamedOneOfIndex is global, not per type, because we have no ref to a type here descriptor.name && descriptor.name.length ? descriptor.name : "oneof" + unnamedOneofIndex++ // fromDescriptorOptions(descriptor.options, exports.OneofOptions) - only uninterpreted_option ); }; /** * Converts a oneof to a descriptor. * @returns {Message} Descriptor */ OneOf.prototype.toDescriptor = function toDescriptor() { return exports.OneofDescriptorProto.create({ name: this.name // options: toDescriptorOptions(this.options, exports.OneofOptions) - only uninterpreted_option }); }; // --- Service --- /** * Properties of a ServiceDescriptorProto message. * @interface IServiceDescriptorProto * @property {string} [name] Service name * @property {IMethodDescriptorProto[]} [method] Methods * @property {IServiceOptions} [options] Options */ /** * Properties of a ServiceOptions message. * @interface IServiceOptions * @property {boolean} [deprecated] */ var unnamedServiceIndex = 0; /** * Creates a service from a descriptor. * @param {IServiceDescriptorProto|Reader|Uint8Array} descriptor Descriptor * @returns {Service} Service instance */ Service.fromDescriptor = function fromDescriptor(descriptor) { // Decode the descriptor message if specified as a buffer: if (typeof descriptor.length === "number") descriptor = exports.ServiceDescriptorProto.decode(descriptor); var service = new Service(descriptor.name && descriptor.name.length ? descriptor.name : "Service" + unnamedServiceIndex++, fromDescriptorOptions(descriptor.options, exports.ServiceOptions)); if (descriptor.method) for (var i = 0; i < descriptor.method.length; ++i) service.add(Method.fromDescriptor(descriptor.method[i])); return service; }; /** * Converts a service to a descriptor. * @returns {Message} Descriptor */ Service.prototype.toDescriptor = function toDescriptor() { // Methods var methods = []; for (var i = 0; i < this.methodsArray.length; ++i) methods.push(this._methodsArray[i].toDescriptor()); return exports.ServiceDescriptorProto.create({ name: this.name, method: methods, options: toDescriptorOptions(this.options, exports.ServiceOptions) }); }; // --- Method --- /** * Properties of a MethodDescriptorProto message. * @interface IMethodDescriptorProto * @property {string} [name] Method name * @property {string} [inputType] Request type name * @property {string} [outputType] Response type name * @property {IMethodOptions} [options] Not supported * @property {boolean} [clientStreaming=false] Whether requests are streamed * @property {boolean} [serverStreaming=false] Whether responses are streamed */ /** * Properties of a MethodOptions message. * @interface IMethodOptions * @property {boolean} [deprecated] */ var unnamedMethodIndex = 0; /** * Creates a method from a descriptor. * @param {IMethodDescriptorProto|Reader|Uint8Array} descriptor Descriptor * @returns {Method} Reflected method instance */ Method.fromDescriptor = function fromDescriptor(descriptor) { // Decode the descriptor message if specified as a buffer: if (typeof descriptor.length === "number") descriptor = exports.MethodDescriptorProto.decode(descriptor); return new Method( // unnamedMethodIndex is global, not per service, because we have no ref to a service here descriptor.name && descriptor.name.length ? descriptor.name : "Method" + unnamedMethodIndex++, "rpc", descriptor.inputType, descriptor.outputType, Boolean(descriptor.clientStreaming), Boolean(descriptor.serverStreaming), fromDescriptorOptions(descriptor.options, exports.MethodOptions) ); }; /** * Converts a method to a descriptor. * @returns {Message} Descriptor */ Method.prototype.toDescriptor = function toDescriptor() { return exports.MethodDescriptorProto.create({ name: this.name, inputType: this.resolvedRequestType ? this.resolvedRequestType.fullName : this.requestType, outputType: this.resolvedResponseType ? this.resolvedResponseType.fullName : this.responseType, clientStreaming: this.requestStream, serverStreaming: this.responseStream, options: toDescriptorOptions(this.options, exports.MethodOptions) }); }; // --- utility --- // Converts a descriptor type to a protobuf.js basic type function fromDescriptorType(type) { switch (type) { // 0 is reserved for errors case 1: return "double"; case 2: return "float"; case 3: return "int64"; case 4: return "uint64"; case 5: return "int32"; case 6: return "fixed64"; case 7: return "fixed32"; case 8: return "bool"; case 9: return "string"; case 12: return "bytes"; case 13: return "uint32"; case 15: return "sfixed32"; case 16: return "sfixed64"; case 17: return "sint32"; case 18: return "sint64"; } throw Error("illegal type: " + type); } // Tests if a descriptor type is packable function packableDescriptorType(type) { switch (type) { case 1: // double case 2: // float case 3: // int64 case 4: // uint64 case 5: // int32 case 6: // fixed64 case 7: // fixed32 case 8: // bool case 13: // uint32 case 14: // enum (!) case 15: // sfixed32 case 16: // sfixed64 case 17: // sint32 case 18: // sint64 return true; } return false; } // Converts a protobuf.js basic type to a descriptor type function toDescriptorType(type, resolvedType) { switch (type) { // 0 is reserved for errors case "double": return 1; case "float": return 2; case "int64": return 3; case "uint64": return 4; case "int32": return 5; case "fixed64": return 6; case "fixed32": return 7; case "bool": return 8; case "string": return 9; case "bytes": return 12; case "uint32": return 13; case "sfixed32": return 15; case "sfixed64": return 16; case "sint32": return 17; case "sint64": return 18; } if (resolvedType instanceof Enum) return 14; if (resolvedType instanceof Type) return resolvedType.group ? 10 : 11; throw Error("illegal type: " + type); } // Converts descriptor options to an options object function fromDescriptorOptions(options, type) { if (!options) return undefined; var out = []; for (var i = 0, field, key, val; i < type.fieldsArray.length; ++i) if ((key = (field = type._fieldsArray[i]).name) !== "uninterpretedOption") if (options.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins val = options[key]; if (field.resolvedType instanceof Enum && typeof val === "number" && field.resolvedType.valuesById[val] !== undefined) val = field.resolvedType.valuesById[val]; out.push(underScore(key), val); } return out.length ? $protobuf.util.toObject(out) : undefined; } // Converts an options object to descriptor options function toDescriptorOptions(options, type) { if (!options) return undefined; var out = []; for (var i = 0, ks = Object.keys(options), key, val; i < ks.length; ++i) { val = options[key = ks[i]]; if (key === "default") continue; var field = type.fields[key]; if (!field && !(field = type.fields[key = $protobuf.util.camelCase(key)])) continue; out.push(key, val); } return out.length ? type.fromObject($protobuf.util.toObject(out)) : undefined; } // Calculates the shortest relative path from `from` to `to`. function shortname(from, to) { var fromPath = from.fullName.split("."), toPath = to.fullName.split("."), i = 0, j = 0, k = toPath.length - 1; if (!(from instanceof Root) && to instanceof Namespace) while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) { var other = to.lookup(fromPath[i++], true); if (other !== null && other !== to) break; ++j; } else for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j); return toPath.slice(j).join("."); } // copied here from cli/targets/proto.js function underScore(str) { return str.substring(0,1) + str.substring(1) .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); } // --- exports --- /** * Reflected file descriptor set. * @name FileDescriptorSet * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected file descriptor proto. * @name FileDescriptorProto * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected descriptor proto. * @name DescriptorProto * @type {Type} * @property {Type} ExtensionRange * @property {Type} ReservedRange * @const * @tstype $protobuf.Type & { * ExtensionRange: $protobuf.Type, * ReservedRange: $protobuf.Type * } */ /** * Reflected field descriptor proto. * @name FieldDescriptorProto * @type {Type} * @property {Enum} Label * @property {Enum} Type * @const * @tstype $protobuf.Type & { * Label: $protobuf.Enum, * Type: $protobuf.Enum * } */ /** * Reflected oneof descriptor proto. * @name OneofDescriptorProto * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected enum descriptor proto. * @name EnumDescriptorProto * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected service descriptor proto. * @name ServiceDescriptorProto * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected enum value descriptor proto. * @name EnumValueDescriptorProto * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected method descriptor proto. * @name MethodDescriptorProto * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected file options. * @name FileOptions * @type {Type} * @property {Enum} OptimizeMode * @const * @tstype $protobuf.Type & { * OptimizeMode: $protobuf.Enum * } */ /** * Reflected message options. * @name MessageOptions * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected field options. * @name FieldOptions * @type {Type} * @property {Enum} CType * @property {Enum} JSType * @const * @tstype $protobuf.Type & { * CType: $protobuf.Enum, * JSType: $protobuf.Enum * } */ /** * Reflected oneof options. * @name OneofOptions * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected enum options. * @name EnumOptions * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected enum value options. * @name EnumValueOptions * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected service options. * @name ServiceOptions * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected method options. * @name MethodOptions * @type {Type} * @const * @tstype $protobuf.Type */ /** * Reflected uninterpretet option. * @name UninterpretedOption * @type {Type} * @property {Type} NamePart * @const * @tstype $protobuf.Type & { * NamePart: $protobuf.Type * } */ /** * Reflected source code info. * @name SourceCodeInfo * @type {Type} * @property {Type} Location * @const * @tstype $protobuf.Type & { * Location: $protobuf.Type * } */ /** * Reflected generated code info. * @name GeneratedCodeInfo * @type {Type} * @property {Type} Annotation * @const * @tstype $protobuf.Type & { * Annotation: $protobuf.Type * } */ /***/ }), /***/ 85881: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // full library entry point. module.exports = __webpack_require__(15360); /***/ }), /***/ 96916: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // minimal library entry point. module.exports = __webpack_require__(73242); /***/ }), /***/ 12134: /***/ ((module) => { "use strict"; module.exports = common; var commonRe = /\/|\./; /** * Provides common type definitions. * Can also be used to provide additional google types or your own custom types. * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition * @returns {undefined} * @property {INamespace} google/protobuf/any.proto Any * @property {INamespace} google/protobuf/duration.proto Duration * @property {INamespace} google/protobuf/empty.proto Empty * @property {INamespace} google/protobuf/field_mask.proto FieldMask * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue * @property {INamespace} google/protobuf/timestamp.proto Timestamp * @property {INamespace} google/protobuf/wrappers.proto Wrappers * @example * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) * protobuf.common("descriptor", descriptorJson); * * // manually provides a custom definition (uses my.foo namespace) * protobuf.common("my/foo/bar.proto", myFooBarJson); */ function common(name, json) { if (!commonRe.test(name)) { name = "google/protobuf/" + name + ".proto"; json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; } common[name] = json; } // Not provided because of limited use (feel free to discuss or to provide yourself): // // google/protobuf/descriptor.proto // google/protobuf/source_context.proto // google/protobuf/type.proto // // Stripped and pre-parsed versions of these non-bundled files are instead available as part of // the repository or package within the google/protobuf directory. common("any", { /** * Properties of a google.protobuf.Any message. * @interface IAny * @type {Object} * @property {string} [typeUrl] * @property {Uint8Array} [bytes] * @memberof common */ Any: { fields: { type_url: { type: "string", id: 1 }, value: { type: "bytes", id: 2 } } } }); var timeType; common("duration", { /** * Properties of a google.protobuf.Duration message. * @interface IDuration * @type {Object} * @property {number|Long} [seconds] * @property {number} [nanos] * @memberof common */ Duration: timeType = { fields: { seconds: { type: "int64", id: 1 }, nanos: { type: "int32", id: 2 } } } }); common("timestamp", { /** * Properties of a google.protobuf.Timestamp message. * @interface ITimestamp * @type {Object} * @property {number|Long} [seconds] * @property {number} [nanos] * @memberof common */ Timestamp: timeType }); common("empty", { /** * Properties of a google.protobuf.Empty message. * @interface IEmpty * @memberof common */ Empty: { fields: {} } }); common("struct", { /** * Properties of a google.protobuf.Struct message. * @interface IStruct * @type {Object} * @property {Object.} [fields] * @memberof common */ Struct: { fields: { fields: { keyType: "string", type: "Value", id: 1 } } }, /** * Properties of a google.protobuf.Value message. * @interface IValue * @type {Object} * @property {string} [kind] * @property {0} [nullValue] * @property {number} [numberValue] * @property {string} [stringValue] * @property {boolean} [boolValue] * @property {IStruct} [structValue] * @property {IListValue} [listValue] * @memberof common */ Value: { oneofs: { kind: { oneof: [ "nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue" ] } }, fields: { nullValue: { type: "NullValue", id: 1 }, numberValue: { type: "double", id: 2 }, stringValue: { type: "string", id: 3 }, boolValue: { type: "bool", id: 4 }, structValue: { type: "Struct", id: 5 }, listValue: { type: "ListValue", id: 6 } } }, NullValue: { values: { NULL_VALUE: 0 } }, /** * Properties of a google.protobuf.ListValue message. * @interface IListValue * @type {Object} * @property {Array.} [values] * @memberof common */ ListValue: { fields: { values: { rule: "repeated", type: "Value", id: 1 } } } }); common("wrappers", { /** * Properties of a google.protobuf.DoubleValue message. * @interface IDoubleValue * @type {Object} * @property {number} [value] * @memberof common */ DoubleValue: { fields: { value: { type: "double", id: 1 } } }, /** * Properties of a google.protobuf.FloatValue message. * @interface IFloatValue * @type {Object} * @property {number} [value] * @memberof common */ FloatValue: { fields: { value: { type: "float", id: 1 } } }, /** * Properties of a google.protobuf.Int64Value message. * @interface IInt64Value * @type {Object} * @property {number|Long} [value] * @memberof common */ Int64Value: { fields: { value: { type: "int64", id: 1 } } }, /** * Properties of a google.protobuf.UInt64Value message. * @interface IUInt64Value * @type {Object} * @property {number|Long} [value] * @memberof common */ UInt64Value: { fields: { value: { type: "uint64", id: 1 } } }, /** * Properties of a google.protobuf.Int32Value message. * @interface IInt32Value * @type {Object} * @property {number} [value] * @memberof common */ Int32Value: { fields: { value: { type: "int32", id: 1 } } }, /** * Properties of a google.protobuf.UInt32Value message. * @interface IUInt32Value * @type {Object} * @property {number} [value] * @memberof common */ UInt32Value: { fields: { value: { type: "uint32", id: 1 } } }, /** * Properties of a google.protobuf.BoolValue message. * @interface IBoolValue * @type {Object} * @property {boolean} [value] * @memberof common */ BoolValue: { fields: { value: { type: "bool", id: 1 } } }, /** * Properties of a google.protobuf.StringValue message. * @interface IStringValue * @type {Object} * @property {string} [value] * @memberof common */ StringValue: { fields: { value: { type: "string", id: 1 } } }, /** * Properties of a google.protobuf.BytesValue message. * @interface IBytesValue * @type {Object} * @property {Uint8Array} [value] * @memberof common */ BytesValue: { fields: { value: { type: "bytes", id: 1 } } } }); common("field_mask", { /** * Properties of a google.protobuf.FieldMask message. * @interface IDoubleValue * @type {Object} * @property {number} [value] * @memberof common */ FieldMask: { fields: { paths: { rule: "repeated", type: "string", id: 1 } } } }); /** * Gets the root definition of the specified common proto file. * * Bundled definitions are: * - google/protobuf/any.proto * - google/protobuf/duration.proto * - google/protobuf/empty.proto * - google/protobuf/field_mask.proto * - google/protobuf/struct.proto * - google/protobuf/timestamp.proto * - google/protobuf/wrappers.proto * * @param {string} file Proto file name * @returns {INamespace|null} Root definition or `null` if not defined */ common.get = function get(file) { return common[file] || null; }; /***/ }), /***/ 13617: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Runtime message from/to plain object converters. * @namespace */ var converter = exports; var Enum = __webpack_require__(17732), util = __webpack_require__(47174); /** * Generates a partial value fromObject conveter. * @param {Codegen} gen Codegen instance * @param {Field} field Reflected field * @param {number} fieldIndex Field index * @param {string} prop Property reference * @returns {Codegen} Codegen instance * @ignore */ function genValuePartial_fromObject(gen, field, fieldIndex, prop) { /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ if (field.resolvedType) { if (field.resolvedType instanceof Enum) { gen ("switch(d%s){", prop); for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { if (field.repeated && values[keys[i]] === field.typeDefault) gen ("default:"); gen ("case%j:", keys[i]) ("case %i:", values[keys[i]]) ("m%s=%j", prop, values[keys[i]]) ("break"); } gen ("}"); } else gen ("if(typeof d%s!==\"object\")", prop) ("throw TypeError(%j)", field.fullName + ": object expected") ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); } else { var isUnsigned = false; switch (field.type) { case "double": case "float": gen ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" break; case "uint32": case "fixed32": gen ("m%s=d%s>>>0", prop, prop); break; case "int32": case "sint32": case "sfixed32": gen ("m%s=d%s|0", prop, prop); break; case "uint64": isUnsigned = true; // eslint-disable-line no-fallthrough case "int64": case "sint64": case "fixed64": case "sfixed64": gen ("if(util.Long)") ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) ("else if(typeof d%s===\"string\")", prop) ("m%s=parseInt(d%s,10)", prop, prop) ("else if(typeof d%s===\"number\")", prop) ("m%s=d%s", prop, prop) ("else if(typeof d%s===\"object\")", prop) ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); break; case "bytes": gen ("if(typeof d%s===\"string\")", prop) ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) ("else if(d%s.length)", prop) ("m%s=d%s", prop, prop); break; case "string": gen ("m%s=String(d%s)", prop, prop); break; case "bool": gen ("m%s=Boolean(d%s)", prop, prop); break; /* default: gen ("m%s=d%s", prop, prop); break; */ } } return gen; /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ } /** * Generates a plain object to runtime message converter specific to the specified message type. * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ converter.fromObject = function fromObject(mtype) { /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ var fields = mtype.fieldsArray; var gen = util.codegen(["d"], mtype.name + "$fromObject") ("if(d instanceof this.ctor)") ("return d"); if (!fields.length) return gen ("return new this.ctor"); gen ("var m=new this.ctor"); for (var i = 0; i < fields.length; ++i) { var field = fields[i].resolve(), prop = util.safeProp(field.name); // Map fields if (field.map) { gen ("if(d%s){", prop) ("if(typeof d%s!==\"object\")", prop) ("throw TypeError(%j)", field.fullName + ": object expected") ("m%s={}", prop) ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); break; case "bytes": gen ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); break; default: gen ("d%s=m%s", prop, prop); break; } } return gen; /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ } /** * Generates a runtime message to plain object converter specific to the specified message type. * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ converter.toObject = function toObject(mtype) { /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); if (!fields.length) return util.codegen()("return {}"); var gen = util.codegen(["m", "o"], mtype.name + "$toObject") ("if(!o)") ("o={}") ("var d={}"); var repeatedFields = [], mapFields = [], normalFields = [], i = 0; for (; i < fields.length; ++i) if (!fields[i].partOf) ( fields[i].resolve().repeated ? repeatedFields : fields[i].map ? mapFields : normalFields).push(fields[i]); if (repeatedFields.length) { gen ("if(o.arrays||o.defaults){"); for (i = 0; i < repeatedFields.length; ++i) gen ("d%s=[]", util.safeProp(repeatedFields[i].name)); gen ("}"); } if (mapFields.length) { gen ("if(o.objects||o.defaults){"); for (i = 0; i < mapFields.length; ++i) gen ("d%s={}", util.safeProp(mapFields[i].name)); gen ("}"); } if (normalFields.length) { gen ("if(o.defaults){"); for (i = 0; i < normalFields.length; ++i) { var field = normalFields[i], prop = util.safeProp(field.name); if (field.resolvedType instanceof Enum) gen ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); else if (field.long) gen ("if(util.Long){") ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) ("}else") ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); else if (field.bytes) { var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; gen ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) ("else{") ("d%s=%s", prop, arrayDefault) ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) ("}"); } else gen ("d%s=%j", prop, field.typeDefault); // also messages (=null) } gen ("}"); } var hasKs2 = false; for (i = 0; i < fields.length; ++i) { var field = fields[i], index = mtype._fieldsArray.indexOf(field), prop = util.safeProp(field.name); if (field.map) { if (!hasKs2) { hasKs2 = true; gen ("var ks2"); } gen ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) ("d%s={}", prop) ("for(var j=0;j { "use strict"; module.exports = decoder; var Enum = __webpack_require__(17732), types = __webpack_require__(6581), util = __webpack_require__(47174); function missing(field) { return "missing required '" + field.name + "'"; } /** * Generates a decoder specific to the specified message type. * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ function decoder(mtype) { /* eslint-disable no-unexpected-multiline */ var gen = util.codegen(["r", "l"], mtype.name + "$decode") ("if(!(r instanceof Reader))") ("r=Reader.create(r)") ("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (mtype.fieldsArray.filter(function(field) { return field.map; }).length ? ",k,value" : "")) ("while(r.pos>>3){"); var i = 0; for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { var field = mtype._fieldsArray[i].resolve(), type = field.resolvedType instanceof Enum ? "int32" : field.type, ref = "m" + util.safeProp(field.name); gen ("case %i:", field.id); // Map fields if (field.map) { gen ("if(%s===util.emptyObject)", ref) ("%s={}", ref) ("var c2 = r.uint32()+r.pos"); if (types.defaults[field.keyType] !== undefined) gen ("k=%j", types.defaults[field.keyType]); else gen ("k=null"); if (types.defaults[type] !== undefined) gen ("value=%j", types.defaults[type]); else gen ("value=null"); gen ("while(r.pos>>3){") ("case 1: k=r.%s(); break", field.keyType) ("case 2:"); if (types.basic[type] === undefined) gen ("value=types[%i].decode(r,r.uint32())", i); // can't be groups else gen ("value=r.%s()", type); gen ("break") ("default:") ("r.skipType(tag2&7)") ("break") ("}") ("}"); if (types.long[field.keyType] !== undefined) gen ("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref); else gen ("%s[k]=value", ref); // Repeated fields } else if (field.repeated) { gen ("if(!(%s&&%s.length))", ref, ref) ("%s=[]", ref); // Packable (always check for forward and backward compatiblity) if (types.packed[type] !== undefined) gen ("if((t&7)===2){") ("var c2=r.uint32()+r.pos") ("while(r.pos { "use strict"; module.exports = encoder; var Enum = __webpack_require__(17732), types = __webpack_require__(6581), util = __webpack_require__(47174); /** * Generates a partial message type encoder. * @param {Codegen} gen Codegen instance * @param {Field} field Reflected field * @param {number} fieldIndex Field index * @param {string} ref Variable reference * @returns {Codegen} Codegen instance * @ignore */ function genTypePartial(gen, field, fieldIndex, ref) { return field.resolvedType.group ? gen("types[%i].encode(%s,w.uint32(%i)).uint32(%i)", fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0) : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); } /** * Generates an encoder specific to the specified message type. * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ function encoder(mtype) { /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ var gen = util.codegen(["m", "w"], mtype.name + "$encode") ("if(!w)") ("w=Writer.create()"); var i, ref; // "when a message is serialized its known fields should be written sequentially by field number" var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); for (var i = 0; i < fields.length; ++i) { var field = fields[i].resolve(), index = mtype._fieldsArray.indexOf(field), type = field.resolvedType instanceof Enum ? "int32" : field.type, wireType = types.basic[type]; ref = "m" + util.safeProp(field.name); // Map fields if (field.map) { gen ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); if (wireType === undefined) gen ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups else gen (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); gen ("}") ("}"); // Repeated fields } else if (field.repeated) { gen ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null // Packed repeated if (field.packed && types.packed[type] !== undefined) { gen ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) ("for(var i=0;i<%s.length;++i)", ref) ("w.%s(%s[i])", type, ref) ("w.ldelim()"); // Non-packed } else { gen ("for(var i=0;i<%s.length;++i)", ref); if (wireType === undefined) genTypePartial(gen, field, index, ref + "[i]"); else gen ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); } gen ("}"); // Non-repeated } else { if (field.optional) gen ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null if (wireType === undefined) genTypePartial(gen, field, index, ref); else gen ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); } } return gen ("return w"); /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ } /***/ }), /***/ 17732: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Enum; // extends ReflectionObject var ReflectionObject = __webpack_require__(83575); ((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; var Namespace = __webpack_require__(76189), util = __webpack_require__(47174); /** * Constructs a new enum instance. * @classdesc Reflected enum. * @extends ReflectionObject * @constructor * @param {string} name Unique name within its namespace * @param {Object.} [values] Enum values as an object, by name * @param {Object.} [options] Declared options * @param {string} [comment] The comment for this enum * @param {Object.} [comments] The value comments for this enum */ function Enum(name, values, options, comment, comments) { ReflectionObject.call(this, name, options); if (values && typeof values !== "object") throw TypeError("values must be an object"); /** * Enum values by id. * @type {Object.} */ this.valuesById = {}; /** * Enum values by name. * @type {Object.} */ this.values = Object.create(this.valuesById); // toJSON, marker /** * Enum comment text. * @type {string|null} */ this.comment = comment; /** * Value comment texts, if any. * @type {Object.} */ this.comments = comments || {}; /** * Reserved ranges, if any. * @type {Array.} */ this.reserved = undefined; // toJSON // Note that values inherit valuesById on their prototype which makes them a TypeScript- // compatible enum. This is used by pbts to write actual enum definitions that work for // static and reflection code alike instead of emitting generic object definitions. if (values) for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) if (typeof values[keys[i]] === "number") // use forward entries only this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; } /** * Enum descriptor. * @interface IEnum * @property {Object.} values Enum values * @property {Object.} [options] Enum options */ /** * Constructs an enum from an enum descriptor. * @param {string} name Enum name * @param {IEnum} json Enum descriptor * @returns {Enum} Created enum * @throws {TypeError} If arguments are invalid */ Enum.fromJSON = function fromJSON(name, json) { var enm = new Enum(name, json.values, json.options, json.comment, json.comments); enm.reserved = json.reserved; return enm; }; /** * Converts this enum to an enum descriptor. * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {IEnum} Enum descriptor */ Enum.prototype.toJSON = function toJSON(toJSONOptions) { var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; return util.toObject([ "options" , this.options, "values" , this.values, "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, "comment" , keepComments ? this.comment : undefined, "comments" , keepComments ? this.comments : undefined ]); }; /** * Adds a value to this enum. * @param {string} name Value name * @param {number} id Value id * @param {string} [comment] Comment, if any * @returns {Enum} `this` * @throws {TypeError} If arguments are invalid * @throws {Error} If there is already a value with this name or id */ Enum.prototype.add = function add(name, id, comment) { // utilized by the parser but not by .fromJSON if (!util.isString(name)) throw TypeError("name must be a string"); if (!util.isInteger(id)) throw TypeError("id must be an integer"); if (this.values[name] !== undefined) throw Error("duplicate name '" + name + "' in " + this); if (this.isReservedId(id)) throw Error("id " + id + " is reserved in " + this); if (this.isReservedName(name)) throw Error("name '" + name + "' is reserved in " + this); if (this.valuesById[id] !== undefined) { if (!(this.options && this.options.allow_alias)) throw Error("duplicate id " + id + " in " + this); this.values[name] = id; } else this.valuesById[this.values[name] = id] = name; this.comments[name] = comment || null; return this; }; /** * Removes a value from this enum * @param {string} name Value name * @returns {Enum} `this` * @throws {TypeError} If arguments are invalid * @throws {Error} If `name` is not a name of this enum */ Enum.prototype.remove = function remove(name) { if (!util.isString(name)) throw TypeError("name must be a string"); var val = this.values[name]; if (val == null) throw Error("name '" + name + "' does not exist in " + this); delete this.valuesById[val]; delete this.values[name]; delete this.comments[name]; return this; }; /** * Tests if the specified id is reserved. * @param {number} id Id to test * @returns {boolean} `true` if reserved, otherwise `false` */ Enum.prototype.isReservedId = function isReservedId(id) { return Namespace.isReservedId(this.reserved, id); }; /** * Tests if the specified name is reserved. * @param {string} name Name to test * @returns {boolean} `true` if reserved, otherwise `false` */ Enum.prototype.isReservedName = function isReservedName(name) { return Namespace.isReservedName(this.reserved, name); }; /***/ }), /***/ 48213: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Field; // extends ReflectionObject var ReflectionObject = __webpack_require__(83575); ((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; var Enum = __webpack_require__(17732), types = __webpack_require__(6581), util = __webpack_require__(47174); var Type; // cyclic var ruleRe = /^required|optional|repeated$/; /** * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. * @name Field * @classdesc Reflected message field. * @extends FieldBase * @constructor * @param {string} name Unique name within its namespace * @param {number} id Unique id within its namespace * @param {string} type Value type * @param {string|Object.} [rule="optional"] Field rule * @param {string|Object.} [extend] Extended type if different from parent * @param {Object.} [options] Declared options */ /** * Constructs a field from a field descriptor. * @param {string} name Field name * @param {IField} json Field descriptor * @returns {Field} Created field * @throws {TypeError} If arguments are invalid */ Field.fromJSON = function fromJSON(name, json) { return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); }; /** * Not an actual constructor. Use {@link Field} instead. * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. * @exports FieldBase * @extends ReflectionObject * @constructor * @param {string} name Unique name within its namespace * @param {number} id Unique id within its namespace * @param {string} type Value type * @param {string|Object.} [rule="optional"] Field rule * @param {string|Object.} [extend] Extended type if different from parent * @param {Object.} [options] Declared options * @param {string} [comment] Comment associated with this field */ function Field(name, id, type, rule, extend, options, comment) { if (util.isObject(rule)) { comment = extend; options = rule; rule = extend = undefined; } else if (util.isObject(extend)) { comment = options; options = extend; extend = undefined; } ReflectionObject.call(this, name, options); if (!util.isInteger(id) || id < 0) throw TypeError("id must be a non-negative integer"); if (!util.isString(type)) throw TypeError("type must be a string"); if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) throw TypeError("rule must be a string rule"); if (extend !== undefined && !util.isString(extend)) throw TypeError("extend must be a string"); if (rule === "proto3_optional") { rule = "optional"; } /** * Field rule, if any. * @type {string|undefined} */ this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON /** * Field type. * @type {string} */ this.type = type; // toJSON /** * Unique field id. * @type {number} */ this.id = id; // toJSON, marker /** * Extended type if different from parent. * @type {string|undefined} */ this.extend = extend || undefined; // toJSON /** * Whether this field is required. * @type {boolean} */ this.required = rule === "required"; /** * Whether this field is optional. * @type {boolean} */ this.optional = !this.required; /** * Whether this field is repeated. * @type {boolean} */ this.repeated = rule === "repeated"; /** * Whether this field is a map or not. * @type {boolean} */ this.map = false; /** * Message this field belongs to. * @type {Type|null} */ this.message = null; /** * OneOf this field belongs to, if any, * @type {OneOf|null} */ this.partOf = null; /** * The field type's default value. * @type {*} */ this.typeDefault = null; /** * The field's default value on prototypes. * @type {*} */ this.defaultValue = null; /** * Whether this field's value should be treated as a long. * @type {boolean} */ this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; /** * Whether this field's value is a buffer. * @type {boolean} */ this.bytes = type === "bytes"; /** * Resolved type if not a basic type. * @type {Type|Enum|null} */ this.resolvedType = null; /** * Sister-field within the extended type if a declaring extension field. * @type {Field|null} */ this.extensionField = null; /** * Sister-field within the declaring namespace if an extended field. * @type {Field|null} */ this.declaringField = null; /** * Internally remembers whether this field is packed. * @type {boolean|null} * @private */ this._packed = null; /** * Comment for this field. * @type {string|null} */ this.comment = comment; } /** * Determines whether this field is packed. Only relevant when repeated and working with proto2. * @name Field#packed * @type {boolean} * @readonly */ Object.defineProperty(Field.prototype, "packed", { get: function() { // defaults to packed=true if not explicity set to false if (this._packed === null) this._packed = this.getOption("packed") !== false; return this._packed; } }); /** * @override */ Field.prototype.setOption = function setOption(name, value, ifNotSet) { if (name === "packed") // clear cached before setting this._packed = null; return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); }; /** * Field descriptor. * @interface IField * @property {string} [rule="optional"] Field rule * @property {string} type Field type * @property {number} id Field id * @property {Object.} [options] Field options */ /** * Extension field descriptor. * @interface IExtensionField * @extends IField * @property {string} extend Extended type */ /** * Converts this field to a field descriptor. * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {IField} Field descriptor */ Field.prototype.toJSON = function toJSON(toJSONOptions) { var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; return util.toObject([ "rule" , this.rule !== "optional" && this.rule || undefined, "type" , this.type, "id" , this.id, "extend" , this.extend, "options" , this.options, "comment" , keepComments ? this.comment : undefined ]); }; /** * Resolves this field's type references. * @returns {Field} `this` * @throws {Error} If any reference cannot be resolved */ Field.prototype.resolve = function resolve() { if (this.resolved) return this; if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); if (this.resolvedType instanceof Type) this.typeDefault = null; else // instanceof Enum this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined } // use explicitly set default value if present if (this.options && this.options["default"] != null) { this.typeDefault = this.options["default"]; if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") this.typeDefault = this.resolvedType.values[this.typeDefault]; } // remove unnecessary options if (this.options) { if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) delete this.options.packed; if (!Object.keys(this.options).length) this.options = undefined; } // convert to internal data type if necesssary if (this.long) { this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); /* istanbul ignore else */ if (Object.freeze) Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) } else if (this.bytes && typeof this.typeDefault === "string") { var buf; if (util.base64.test(this.typeDefault)) util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); else util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); this.typeDefault = buf; } // take special care of maps and repeated fields if (this.map) this.defaultValue = util.emptyObject; else if (this.repeated) this.defaultValue = util.emptyArray; else this.defaultValue = this.typeDefault; // ensure proper value on prototype if (this.parent instanceof Type) this.parent.ctor.prototype[this.name] = this.defaultValue; return ReflectionObject.prototype.resolve.call(this); }; /** * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). * @typedef FieldDecorator * @type {function} * @param {Object} prototype Target prototype * @param {string} fieldName Field name * @returns {undefined} */ /** * Field decorator (TypeScript). * @name Field.d * @function * @param {number} fieldId Field id * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule * @param {T} [defaultValue] Default value * @returns {FieldDecorator} Decorator function * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] */ Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { // submessage: decorate the submessage and use its name as the type if (typeof fieldType === "function") fieldType = util.decorateType(fieldType).name; // enum reference: create a reflected copy of the enum and keep reuseing it else if (fieldType && typeof fieldType === "object") fieldType = util.decorateEnum(fieldType).name; return function fieldDecorator(prototype, fieldName) { util.decorateType(prototype.constructor) .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); }; }; /** * Field decorator (TypeScript). * @name Field.d * @function * @param {number} fieldId Field id * @param {Constructor|string} fieldType Field type * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule * @returns {FieldDecorator} Decorator function * @template T extends Message * @variation 2 */ // like Field.d but without a default value // Sets up cyclic dependencies (called in index-light) Field._configure = function configure(Type_) { Type = Type_; }; /***/ }), /***/ 26119: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var protobuf = module.exports = __webpack_require__(73242); protobuf.build = "light"; /** * A node-style callback as used by {@link load} and {@link Root#load}. * @typedef LoadCallback * @type {function} * @param {Error|null} error Error, if any, otherwise `null` * @param {Root} [root] Root, if there hasn't been an error * @returns {undefined} */ /** * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. * @param {string|string[]} filename One or multiple files to load * @param {Root} root Root namespace, defaults to create a new one if omitted. * @param {LoadCallback} callback Callback function * @returns {undefined} * @see {@link Root#load} */ function load(filename, root, callback) { if (typeof root === "function") { callback = root; root = new protobuf.Root(); } else if (!root) root = new protobuf.Root(); return root.load(filename, callback); } /** * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. * @name load * @function * @param {string|string[]} filename One or multiple files to load * @param {LoadCallback} callback Callback function * @returns {undefined} * @see {@link Root#load} * @variation 2 */ // function load(filename:string, callback:LoadCallback):undefined /** * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. * @name load * @function * @param {string|string[]} filename One or multiple files to load * @param {Root} [root] Root namespace, defaults to create a new one if omitted. * @returns {Promise} Promise * @see {@link Root#load} * @variation 3 */ // function load(filename:string, [root:Root]):Promise protobuf.load = load; /** * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). * @param {string|string[]} filename One or multiple files to load * @param {Root} [root] Root namespace, defaults to create a new one if omitted. * @returns {Root} Root namespace * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid * @see {@link Root#loadSync} */ function loadSync(filename, root) { if (!root) root = new protobuf.Root(); return root.loadSync(filename); } protobuf.loadSync = loadSync; // Serialization protobuf.encoder = __webpack_require__(23072); protobuf.decoder = __webpack_require__(65871); protobuf.verifier = __webpack_require__(34334); protobuf.converter = __webpack_require__(13617); // Reflection protobuf.ReflectionObject = __webpack_require__(83575); protobuf.Namespace = __webpack_require__(76189); protobuf.Root = __webpack_require__(32614); protobuf.Enum = __webpack_require__(17732); protobuf.Type = __webpack_require__(38520); protobuf.Field = __webpack_require__(48213); protobuf.OneOf = __webpack_require__(44408); protobuf.MapField = __webpack_require__(67777); protobuf.Service = __webpack_require__(6178); protobuf.Method = __webpack_require__(57771); // Runtime protobuf.Message = __webpack_require__(68027); protobuf.wrappers = __webpack_require__(63216); // Utility protobuf.types = __webpack_require__(6581); protobuf.util = __webpack_require__(47174); // Set up possibly cyclic reflection dependencies protobuf.ReflectionObject._configure(protobuf.Root); protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); protobuf.Root._configure(protobuf.Type); protobuf.Field._configure(protobuf.Type); /***/ }), /***/ 73242: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var protobuf = exports; /** * Build type, one of `"full"`, `"light"` or `"minimal"`. * @name build * @type {string} * @const */ protobuf.build = "minimal"; // Serialization protobuf.Writer = __webpack_require__(13098); protobuf.BufferWriter = __webpack_require__(41863); protobuf.Reader = __webpack_require__(41011); protobuf.BufferReader = __webpack_require__(80339); // Utility protobuf.util = __webpack_require__(71241); protobuf.rpc = __webpack_require__(86444); protobuf.roots = __webpack_require__(50073); protobuf.configure = configure; /* istanbul ignore next */ /** * Reconfigures the library according to the environment. * @returns {undefined} */ function configure() { protobuf.util._configure(); protobuf.Writer._configure(protobuf.BufferWriter); protobuf.Reader._configure(protobuf.BufferReader); } // Set up buffer utility according to the environment configure(); /***/ }), /***/ 15360: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var protobuf = module.exports = __webpack_require__(26119); protobuf.build = "full"; // Parser protobuf.tokenize = __webpack_require__(61157); protobuf.parse = __webpack_require__(32137); protobuf.common = __webpack_require__(12134); // Configure parser protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); /***/ }), /***/ 67777: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = MapField; // extends Field var Field = __webpack_require__(48213); ((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; var types = __webpack_require__(6581), util = __webpack_require__(47174); /** * Constructs a new map field instance. * @classdesc Reflected map field. * @extends FieldBase * @constructor * @param {string} name Unique name within its namespace * @param {number} id Unique id within its namespace * @param {string} keyType Key type * @param {string} type Value type * @param {Object.} [options] Declared options * @param {string} [comment] Comment associated with this field */ function MapField(name, id, keyType, type, options, comment) { Field.call(this, name, id, type, undefined, undefined, options, comment); /* istanbul ignore if */ if (!util.isString(keyType)) throw TypeError("keyType must be a string"); /** * Key type. * @type {string} */ this.keyType = keyType; // toJSON, marker /** * Resolved key type if not a basic type. * @type {ReflectionObject|null} */ this.resolvedKeyType = null; // Overrides Field#map this.map = true; } /** * Map field descriptor. * @interface IMapField * @extends {IField} * @property {string} keyType Key type */ /** * Extension map field descriptor. * @interface IExtensionMapField * @extends IMapField * @property {string} extend Extended type */ /** * Constructs a map field from a map field descriptor. * @param {string} name Field name * @param {IMapField} json Map field descriptor * @returns {MapField} Created map field * @throws {TypeError} If arguments are invalid */ MapField.fromJSON = function fromJSON(name, json) { return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); }; /** * Converts this map field to a map field descriptor. * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {IMapField} Map field descriptor */ MapField.prototype.toJSON = function toJSON(toJSONOptions) { var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; return util.toObject([ "keyType" , this.keyType, "type" , this.type, "id" , this.id, "extend" , this.extend, "options" , this.options, "comment" , keepComments ? this.comment : undefined ]); }; /** * @override */ MapField.prototype.resolve = function resolve() { if (this.resolved) return this; // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" if (types.mapKey[this.keyType] === undefined) throw Error("invalid key type: " + this.keyType); return Field.prototype.resolve.call(this); }; /** * Map field decorator (TypeScript). * @name MapField.d * @function * @param {number} fieldId Field id * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type * @returns {FieldDecorator} Decorator function * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } */ MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { // submessage value: decorate the submessage and use its name as the type if (typeof fieldValueType === "function") fieldValueType = util.decorateType(fieldValueType).name; // enum reference value: create a reflected copy of the enum and keep reuseing it else if (fieldValueType && typeof fieldValueType === "object") fieldValueType = util.decorateEnum(fieldValueType).name; return function mapFieldDecorator(prototype, fieldName) { util.decorateType(prototype.constructor) .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); }; }; /***/ }), /***/ 68027: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Message; var util = __webpack_require__(71241); /** * Constructs a new message instance. * @classdesc Abstract runtime message. * @constructor * @param {Properties} [properties] Properties to set * @template T extends object = object */ function Message(properties) { // not used internally if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) this[keys[i]] = properties[keys[i]]; } /** * Reference to the reflected type. * @name Message.$type * @type {Type} * @readonly */ /** * Reference to the reflected type. * @name Message#$type * @type {Type} * @readonly */ /*eslint-disable valid-jsdoc*/ /** * Creates a new message of this type using the specified properties. * @param {Object.} [properties] Properties to set * @returns {Message} Message instance * @template T extends Message * @this Constructor */ Message.create = function create(properties) { return this.$type.create(properties); }; /** * Encodes a message of this type. * @param {T|Object.} message Message to encode * @param {Writer} [writer] Writer to use * @returns {Writer} Writer * @template T extends Message * @this Constructor */ Message.encode = function encode(message, writer) { return this.$type.encode(message, writer); }; /** * Encodes a message of this type preceeded by its length as a varint. * @param {T|Object.} message Message to encode * @param {Writer} [writer] Writer to use * @returns {Writer} Writer * @template T extends Message * @this Constructor */ Message.encodeDelimited = function encodeDelimited(message, writer) { return this.$type.encodeDelimited(message, writer); }; /** * Decodes a message of this type. * @name Message.decode * @function * @param {Reader|Uint8Array} reader Reader or buffer to decode * @returns {T} Decoded message * @template T extends Message * @this Constructor */ Message.decode = function decode(reader) { return this.$type.decode(reader); }; /** * Decodes a message of this type preceeded by its length as a varint. * @name Message.decodeDelimited * @function * @param {Reader|Uint8Array} reader Reader or buffer to decode * @returns {T} Decoded message * @template T extends Message * @this Constructor */ Message.decodeDelimited = function decodeDelimited(reader) { return this.$type.decodeDelimited(reader); }; /** * Verifies a message of this type. * @name Message.verify * @function * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Message.verify = function verify(message) { return this.$type.verify(message); }; /** * Creates a new message of this type from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object * @returns {T} Message instance * @template T extends Message * @this Constructor */ Message.fromObject = function fromObject(object) { return this.$type.fromObject(object); }; /** * Creates a plain object from a message of this type. Also converts values to other types if specified. * @param {T} message Message instance * @param {IConversionOptions} [options] Conversion options * @returns {Object.} Plain object * @template T extends Message * @this Constructor */ Message.toObject = function toObject(message, options) { return this.$type.toObject(message, options); }; /** * Converts this message to JSON. * @returns {Object.} JSON object */ Message.prototype.toJSON = function toJSON() { return this.$type.toObject(this, util.toJSONOptions); }; /*eslint-enable valid-jsdoc*/ /***/ }), /***/ 57771: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Method; // extends ReflectionObject var ReflectionObject = __webpack_require__(83575); ((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; var util = __webpack_require__(47174); /** * Constructs a new service method instance. * @classdesc Reflected service method. * @extends ReflectionObject * @constructor * @param {string} name Method name * @param {string|undefined} type Method type, usually `"rpc"` * @param {string} requestType Request message type * @param {string} responseType Response message type * @param {boolean|Object.} [requestStream] Whether the request is streamed * @param {boolean|Object.} [responseStream] Whether the response is streamed * @param {Object.} [options] Declared options * @param {string} [comment] The comment for this method * @param {Object.} [parsedOptions] Declared options, properly parsed into an object */ function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) { /* istanbul ignore next */ if (util.isObject(requestStream)) { options = requestStream; requestStream = responseStream = undefined; } else if (util.isObject(responseStream)) { options = responseStream; responseStream = undefined; } /* istanbul ignore if */ if (!(type === undefined || util.isString(type))) throw TypeError("type must be a string"); /* istanbul ignore if */ if (!util.isString(requestType)) throw TypeError("requestType must be a string"); /* istanbul ignore if */ if (!util.isString(responseType)) throw TypeError("responseType must be a string"); ReflectionObject.call(this, name, options); /** * Method type. * @type {string} */ this.type = type || "rpc"; // toJSON /** * Request type. * @type {string} */ this.requestType = requestType; // toJSON, marker /** * Whether requests are streamed or not. * @type {boolean|undefined} */ this.requestStream = requestStream ? true : undefined; // toJSON /** * Response type. * @type {string} */ this.responseType = responseType; // toJSON /** * Whether responses are streamed or not. * @type {boolean|undefined} */ this.responseStream = responseStream ? true : undefined; // toJSON /** * Resolved request type. * @type {Type|null} */ this.resolvedRequestType = null; /** * Resolved response type. * @type {Type|null} */ this.resolvedResponseType = null; /** * Comment for this method * @type {string|null} */ this.comment = comment; /** * Options properly parsed into an object */ this.parsedOptions = parsedOptions; } /** * Method descriptor. * @interface IMethod * @property {string} [type="rpc"] Method type * @property {string} requestType Request type * @property {string} responseType Response type * @property {boolean} [requestStream=false] Whether requests are streamed * @property {boolean} [responseStream=false] Whether responses are streamed * @property {Object.} [options] Method options * @property {string} comment Method comments * @property {Object.} [parsedOptions] Method options properly parsed into an object */ /** * Constructs a method from a method descriptor. * @param {string} name Method name * @param {IMethod} json Method descriptor * @returns {Method} Created method * @throws {TypeError} If arguments are invalid */ Method.fromJSON = function fromJSON(name, json) { return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment, json.parsedOptions); }; /** * Converts this method to a method descriptor. * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {IMethod} Method descriptor */ Method.prototype.toJSON = function toJSON(toJSONOptions) { var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; return util.toObject([ "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, "requestType" , this.requestType, "requestStream" , this.requestStream, "responseType" , this.responseType, "responseStream" , this.responseStream, "options" , this.options, "comment" , keepComments ? this.comment : undefined, "parsedOptions" , this.parsedOptions, ]); }; /** * @override */ Method.prototype.resolve = function resolve() { /* istanbul ignore if */ if (this.resolved) return this; this.resolvedRequestType = this.parent.lookupType(this.requestType); this.resolvedResponseType = this.parent.lookupType(this.responseType); return ReflectionObject.prototype.resolve.call(this); }; /***/ }), /***/ 76189: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Namespace; // extends ReflectionObject var ReflectionObject = __webpack_require__(83575); ((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; var Field = __webpack_require__(48213), OneOf = __webpack_require__(44408), util = __webpack_require__(47174); var Type, // cyclic Service, Enum; /** * Constructs a new namespace instance. * @name Namespace * @classdesc Reflected namespace. * @extends NamespaceBase * @constructor * @param {string} name Namespace name * @param {Object.} [options] Declared options */ /** * Constructs a namespace from JSON. * @memberof Namespace * @function * @param {string} name Namespace name * @param {Object.} json JSON object * @returns {Namespace} Created namespace * @throws {TypeError} If arguments are invalid */ Namespace.fromJSON = function fromJSON(name, json) { return new Namespace(name, json.options).addJSON(json.nested); }; /** * Converts an array of reflection objects to JSON. * @memberof Namespace * @param {ReflectionObject[]} array Object array * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {Object.|undefined} JSON object or `undefined` when array is empty */ function arrayToJSON(array, toJSONOptions) { if (!(array && array.length)) return undefined; var obj = {}; for (var i = 0; i < array.length; ++i) obj[array[i].name] = array[i].toJSON(toJSONOptions); return obj; } Namespace.arrayToJSON = arrayToJSON; /** * Tests if the specified id is reserved. * @param {Array.|undefined} reserved Array of reserved ranges and names * @param {number} id Id to test * @returns {boolean} `true` if reserved, otherwise `false` */ Namespace.isReservedId = function isReservedId(reserved, id) { if (reserved) for (var i = 0; i < reserved.length; ++i) if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) return true; return false; }; /** * Tests if the specified name is reserved. * @param {Array.|undefined} reserved Array of reserved ranges and names * @param {string} name Name to test * @returns {boolean} `true` if reserved, otherwise `false` */ Namespace.isReservedName = function isReservedName(reserved, name) { if (reserved) for (var i = 0; i < reserved.length; ++i) if (reserved[i] === name) return true; return false; }; /** * Not an actual constructor. Use {@link Namespace} instead. * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. * @exports NamespaceBase * @extends ReflectionObject * @abstract * @constructor * @param {string} name Namespace name * @param {Object.} [options] Declared options * @see {@link Namespace} */ function Namespace(name, options) { ReflectionObject.call(this, name, options); /** * Nested objects by name. * @type {Object.|undefined} */ this.nested = undefined; // toJSON /** * Cached nested objects as an array. * @type {ReflectionObject[]|null} * @private */ this._nestedArray = null; } function clearCache(namespace) { namespace._nestedArray = null; return namespace; } /** * Nested objects of this namespace as an array for iteration. * @name NamespaceBase#nestedArray * @type {ReflectionObject[]} * @readonly */ Object.defineProperty(Namespace.prototype, "nestedArray", { get: function() { return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); } }); /** * Namespace descriptor. * @interface INamespace * @property {Object.} [options] Namespace options * @property {Object.} [nested] Nested object descriptors */ /** * Any extension field descriptor. * @typedef AnyExtensionField * @type {IExtensionField|IExtensionMapField} */ /** * Any nested object descriptor. * @typedef AnyNestedObject * @type {IEnum|IType|IService|AnyExtensionField|INamespace} */ // ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place) /** * Converts this namespace to a namespace descriptor. * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {INamespace} Namespace descriptor */ Namespace.prototype.toJSON = function toJSON(toJSONOptions) { return util.toObject([ "options" , this.options, "nested" , arrayToJSON(this.nestedArray, toJSONOptions) ]); }; /** * Adds nested objects to this namespace from nested object descriptors. * @param {Object.} nestedJson Any nested object descriptors * @returns {Namespace} `this` */ Namespace.prototype.addJSON = function addJSON(nestedJson) { var ns = this; /* istanbul ignore else */ if (nestedJson) { for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { nested = nestedJson[names[i]]; ns.add( // most to least likely ( nested.fields !== undefined ? Type.fromJSON : nested.values !== undefined ? Enum.fromJSON : nested.methods !== undefined ? Service.fromJSON : nested.id !== undefined ? Field.fromJSON : Namespace.fromJSON )(names[i], nested) ); } } return this; }; /** * Gets the nested object of the specified name. * @param {string} name Nested object name * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist */ Namespace.prototype.get = function get(name) { return this.nested && this.nested[name] || null; }; /** * Gets the values of the nested {@link Enum|enum} of the specified name. * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. * @param {string} name Nested enum name * @returns {Object.} Enum values * @throws {Error} If there is no such enum */ Namespace.prototype.getEnum = function getEnum(name) { if (this.nested && this.nested[name] instanceof Enum) return this.nested[name].values; throw Error("no such enum: " + name); }; /** * Adds a nested object to this namespace. * @param {ReflectionObject} object Nested object to add * @returns {Namespace} `this` * @throws {TypeError} If arguments are invalid * @throws {Error} If there is already a nested object with this name */ Namespace.prototype.add = function add(object) { if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace || object instanceof OneOf)) throw TypeError("object must be a valid nested object"); if (!this.nested) this.nested = {}; else { var prev = this.get(object.name); if (prev) { if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { // replace plain namespace but keep existing nested elements and options var nested = prev.nestedArray; for (var i = 0; i < nested.length; ++i) object.add(nested[i]); this.remove(prev); if (!this.nested) this.nested = {}; object.setOptions(prev.options, true); } else throw Error("duplicate name '" + object.name + "' in " + this); } } this.nested[object.name] = object; object.onAdd(this); return clearCache(this); }; /** * Removes a nested object from this namespace. * @param {ReflectionObject} object Nested object to remove * @returns {Namespace} `this` * @throws {TypeError} If arguments are invalid * @throws {Error} If `object` is not a member of this namespace */ Namespace.prototype.remove = function remove(object) { if (!(object instanceof ReflectionObject)) throw TypeError("object must be a ReflectionObject"); if (object.parent !== this) throw Error(object + " is not a member of " + this); delete this.nested[object.name]; if (!Object.keys(this.nested).length) this.nested = undefined; object.onRemove(this); return clearCache(this); }; /** * Defines additial namespaces within this one if not yet existing. * @param {string|string[]} path Path to create * @param {*} [json] Nested types to create from JSON * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty */ Namespace.prototype.define = function define(path, json) { if (util.isString(path)) path = path.split("."); else if (!Array.isArray(path)) throw TypeError("illegal path"); if (path && path.length && path[0] === "") throw Error("path must be relative"); var ptr = this; while (path.length > 0) { var part = path.shift(); if (ptr.nested && ptr.nested[part]) { ptr = ptr.nested[part]; if (!(ptr instanceof Namespace)) throw Error("path conflicts with non-namespace objects"); } else ptr.add(ptr = new Namespace(part)); } if (json) ptr.addJSON(json); return ptr; }; /** * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. * @returns {Namespace} `this` */ Namespace.prototype.resolveAll = function resolveAll() { var nested = this.nestedArray, i = 0; while (i < nested.length) if (nested[i] instanceof Namespace) nested[i++].resolveAll(); else nested[i++].resolve(); return this.resolve(); }; /** * Recursively looks up the reflection object matching the specified path in the scope of this namespace. * @param {string|string[]} path Path to look up * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked * @returns {ReflectionObject|null} Looked up object or `null` if none could be found */ Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { /* istanbul ignore next */ if (typeof filterTypes === "boolean") { parentAlreadyChecked = filterTypes; filterTypes = undefined; } else if (filterTypes && !Array.isArray(filterTypes)) filterTypes = [ filterTypes ]; if (util.isString(path) && path.length) { if (path === ".") return this.root; path = path.split("."); } else if (!path.length) return this; // Start at root if path is absolute if (path[0] === "") return this.root.lookup(path.slice(1), filterTypes); // Test if the first part matches any nested object, and if so, traverse if path contains more var found = this.get(path[0]); if (found) { if (path.length === 1) { if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) return found; } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) return found; // Otherwise try each nested namespace } else for (var i = 0; i < this.nestedArray.length; ++i) if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) return found; // If there hasn't been a match, try again at the parent if (this.parent === null || parentAlreadyChecked) return null; return this.parent.lookup(path, filterTypes); }; /** * Looks up the reflection object at the specified path, relative to this namespace. * @name NamespaceBase#lookup * @function * @param {string|string[]} path Path to look up * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked * @returns {ReflectionObject|null} Looked up object or `null` if none could be found * @variation 2 */ // lookup(path: string, [parentAlreadyChecked: boolean]) /** * Looks up the {@link Type|type} at the specified path, relative to this namespace. * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. * @param {string|string[]} path Path to look up * @returns {Type} Looked up type * @throws {Error} If `path` does not point to a type */ Namespace.prototype.lookupType = function lookupType(path) { var found = this.lookup(path, [ Type ]); if (!found) throw Error("no such type: " + path); return found; }; /** * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. * @param {string|string[]} path Path to look up * @returns {Enum} Looked up enum * @throws {Error} If `path` does not point to an enum */ Namespace.prototype.lookupEnum = function lookupEnum(path) { var found = this.lookup(path, [ Enum ]); if (!found) throw Error("no such Enum '" + path + "' in " + this); return found; }; /** * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. * @param {string|string[]} path Path to look up * @returns {Type} Looked up type or enum * @throws {Error} If `path` does not point to a type or enum */ Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { var found = this.lookup(path, [ Type, Enum ]); if (!found) throw Error("no such Type or Enum '" + path + "' in " + this); return found; }; /** * Looks up the {@link Service|service} at the specified path, relative to this namespace. * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. * @param {string|string[]} path Path to look up * @returns {Service} Looked up service * @throws {Error} If `path` does not point to a service */ Namespace.prototype.lookupService = function lookupService(path) { var found = this.lookup(path, [ Service ]); if (!found) throw Error("no such Service '" + path + "' in " + this); return found; }; // Sets up cyclic dependencies (called in index-light) Namespace._configure = function(Type_, Service_, Enum_) { Type = Type_; Service = Service_; Enum = Enum_; }; /***/ }), /***/ 83575: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = ReflectionObject; ReflectionObject.className = "ReflectionObject"; var util = __webpack_require__(47174); var Root; // cyclic /** * Constructs a new reflection object instance. * @classdesc Base class of all reflection objects. * @constructor * @param {string} name Object name * @param {Object.} [options] Declared options * @abstract */ function ReflectionObject(name, options) { if (!util.isString(name)) throw TypeError("name must be a string"); if (options && !util.isObject(options)) throw TypeError("options must be an object"); /** * Options. * @type {Object.|undefined} */ this.options = options; // toJSON /** * Parsed Options. * @type {Array.>|undefined} */ this.parsedOptions = null; /** * Unique name within its namespace. * @type {string} */ this.name = name; /** * Parent namespace. * @type {Namespace|null} */ this.parent = null; /** * Whether already resolved or not. * @type {boolean} */ this.resolved = false; /** * Comment text, if any. * @type {string|null} */ this.comment = null; /** * Defining file name. * @type {string|null} */ this.filename = null; } Object.defineProperties(ReflectionObject.prototype, { /** * Reference to the root namespace. * @name ReflectionObject#root * @type {Root} * @readonly */ root: { get: function() { var ptr = this; while (ptr.parent !== null) ptr = ptr.parent; return ptr; } }, /** * Full name including leading dot. * @name ReflectionObject#fullName * @type {string} * @readonly */ fullName: { get: function() { var path = [ this.name ], ptr = this.parent; while (ptr) { path.unshift(ptr.name); ptr = ptr.parent; } return path.join("."); } } }); /** * Converts this reflection object to its descriptor representation. * @returns {Object.} Descriptor * @abstract */ ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { throw Error(); // not implemented, shouldn't happen }; /** * Called when this object is added to a parent. * @param {ReflectionObject} parent Parent added to * @returns {undefined} */ ReflectionObject.prototype.onAdd = function onAdd(parent) { if (this.parent && this.parent !== parent) this.parent.remove(this); this.parent = parent; this.resolved = false; var root = parent.root; if (root instanceof Root) root._handleAdd(this); }; /** * Called when this object is removed from a parent. * @param {ReflectionObject} parent Parent removed from * @returns {undefined} */ ReflectionObject.prototype.onRemove = function onRemove(parent) { var root = parent.root; if (root instanceof Root) root._handleRemove(this); this.parent = null; this.resolved = false; }; /** * Resolves this objects type references. * @returns {ReflectionObject} `this` */ ReflectionObject.prototype.resolve = function resolve() { if (this.resolved) return this; if (this.root instanceof Root) this.resolved = true; // only if part of a root return this; }; /** * Gets an option value. * @param {string} name Option name * @returns {*} Option value or `undefined` if not set */ ReflectionObject.prototype.getOption = function getOption(name) { if (this.options) return this.options[name]; return undefined; }; /** * Sets an option. * @param {string} name Option name * @param {*} value Option value * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set * @returns {ReflectionObject} `this` */ ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { if (!ifNotSet || !this.options || this.options[name] === undefined) (this.options || (this.options = {}))[name] = value; return this; }; /** * Sets a parsed option. * @param {string} name parsed Option name * @param {*} value Option value * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value * @returns {ReflectionObject} `this` */ ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) { if (!this.parsedOptions) { this.parsedOptions = []; } var parsedOptions = this.parsedOptions; if (propName) { // If setting a sub property of an option then try to merge it // with an existing option var opt = parsedOptions.find(function (opt) { return Object.prototype.hasOwnProperty.call(opt, name); }); if (opt) { // If we found an existing option - just merge the property value var newValue = opt[name]; util.setProperty(newValue, propName, value); } else { // otherwise, create a new option, set it's property and add it to the list opt = {}; opt[name] = util.setProperty({}, propName, value); parsedOptions.push(opt); } } else { // Always create a new option when setting the value of the option itself var newOpt = {}; newOpt[name] = value; parsedOptions.push(newOpt); } return this; }; /** * Sets multiple options. * @param {Object.} options Options to set * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set * @returns {ReflectionObject} `this` */ ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { if (options) for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) this.setOption(keys[i], options[keys[i]], ifNotSet); return this; }; /** * Converts this instance to its string representation. * @returns {string} Class name[, space, full name] */ ReflectionObject.prototype.toString = function toString() { var className = this.constructor.className, fullName = this.fullName; if (fullName.length) return className + " " + fullName; return className; }; // Sets up cyclic dependencies (called in index-light) ReflectionObject._configure = function(Root_) { Root = Root_; }; /***/ }), /***/ 44408: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = OneOf; // extends ReflectionObject var ReflectionObject = __webpack_require__(83575); ((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; var Field = __webpack_require__(48213), util = __webpack_require__(47174); /** * Constructs a new oneof instance. * @classdesc Reflected oneof. * @extends ReflectionObject * @constructor * @param {string} name Oneof name * @param {string[]|Object.} [fieldNames] Field names * @param {Object.} [options] Declared options * @param {string} [comment] Comment associated with this field */ function OneOf(name, fieldNames, options, comment) { if (!Array.isArray(fieldNames)) { options = fieldNames; fieldNames = undefined; } ReflectionObject.call(this, name, options); /* istanbul ignore if */ if (!(fieldNames === undefined || Array.isArray(fieldNames))) throw TypeError("fieldNames must be an Array"); /** * Field names that belong to this oneof. * @type {string[]} */ this.oneof = fieldNames || []; // toJSON, marker /** * Fields that belong to this oneof as an array for iteration. * @type {Field[]} * @readonly */ this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent /** * Comment for this field. * @type {string|null} */ this.comment = comment; } /** * Oneof descriptor. * @interface IOneOf * @property {Array.} oneof Oneof field names * @property {Object.} [options] Oneof options */ /** * Constructs a oneof from a oneof descriptor. * @param {string} name Oneof name * @param {IOneOf} json Oneof descriptor * @returns {OneOf} Created oneof * @throws {TypeError} If arguments are invalid */ OneOf.fromJSON = function fromJSON(name, json) { return new OneOf(name, json.oneof, json.options, json.comment); }; /** * Converts this oneof to a oneof descriptor. * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {IOneOf} Oneof descriptor */ OneOf.prototype.toJSON = function toJSON(toJSONOptions) { var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; return util.toObject([ "options" , this.options, "oneof" , this.oneof, "comment" , keepComments ? this.comment : undefined ]); }; /** * Adds the fields of the specified oneof to the parent if not already done so. * @param {OneOf} oneof The oneof * @returns {undefined} * @inner * @ignore */ function addFieldsToParent(oneof) { if (oneof.parent) for (var i = 0; i < oneof.fieldsArray.length; ++i) if (!oneof.fieldsArray[i].parent) oneof.parent.add(oneof.fieldsArray[i]); } /** * Adds a field to this oneof and removes it from its current parent, if any. * @param {Field} field Field to add * @returns {OneOf} `this` */ OneOf.prototype.add = function add(field) { /* istanbul ignore if */ if (!(field instanceof Field)) throw TypeError("field must be a Field"); if (field.parent && field.parent !== this.parent) field.parent.remove(field); this.oneof.push(field.name); this.fieldsArray.push(field); field.partOf = this; // field.parent remains null addFieldsToParent(this); return this; }; /** * Removes a field from this oneof and puts it back to the oneof's parent. * @param {Field} field Field to remove * @returns {OneOf} `this` */ OneOf.prototype.remove = function remove(field) { /* istanbul ignore if */ if (!(field instanceof Field)) throw TypeError("field must be a Field"); var index = this.fieldsArray.indexOf(field); /* istanbul ignore if */ if (index < 0) throw Error(field + " is not a member of " + this); this.fieldsArray.splice(index, 1); index = this.oneof.indexOf(field.name); /* istanbul ignore else */ if (index > -1) // theoretical this.oneof.splice(index, 1); field.partOf = null; return this; }; /** * @override */ OneOf.prototype.onAdd = function onAdd(parent) { ReflectionObject.prototype.onAdd.call(this, parent); var self = this; // Collect present fields for (var i = 0; i < this.oneof.length; ++i) { var field = parent.get(this.oneof[i]); if (field && !field.partOf) { field.partOf = self; self.fieldsArray.push(field); } } // Add not yet present fields addFieldsToParent(this); }; /** * @override */ OneOf.prototype.onRemove = function onRemove(parent) { for (var i = 0, field; i < this.fieldsArray.length; ++i) if ((field = this.fieldsArray[i]).parent) field.parent.remove(field); ReflectionObject.prototype.onRemove.call(this, parent); }; /** * Decorator function as returned by {@link OneOf.d} (TypeScript). * @typedef OneOfDecorator * @type {function} * @param {Object} prototype Target prototype * @param {string} oneofName OneOf name * @returns {undefined} */ /** * OneOf decorator (TypeScript). * @function * @param {...string} fieldNames Field names * @returns {OneOfDecorator} Decorator function * @template T extends string */ OneOf.d = function decorateOneOf() { var fieldNames = new Array(arguments.length), index = 0; while (index < arguments.length) fieldNames[index] = arguments[index++]; return function oneOfDecorator(prototype, oneofName) { util.decorateType(prototype.constructor) .add(new OneOf(oneofName, fieldNames)); Object.defineProperty(prototype, oneofName, { get: util.oneOfGetter(fieldNames), set: util.oneOfSetter(fieldNames) }); }; }; /***/ }), /***/ 32137: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = parse; parse.filename = null; parse.defaults = { keepCase: false }; var tokenize = __webpack_require__(61157), Root = __webpack_require__(32614), Type = __webpack_require__(38520), Field = __webpack_require__(48213), MapField = __webpack_require__(67777), OneOf = __webpack_require__(44408), Enum = __webpack_require__(17732), Service = __webpack_require__(6178), Method = __webpack_require__(57771), types = __webpack_require__(6581), util = __webpack_require__(47174); var base10Re = /^[1-9][0-9]*$/, base10NegRe = /^-?[1-9][0-9]*$/, base16Re = /^0[x][0-9a-fA-F]+$/, base16NegRe = /^-?0[x][0-9a-fA-F]+$/, base8Re = /^0[0-7]+$/, base8NegRe = /^-?0[0-7]+$/, numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; /** * Result object returned from {@link parse}. * @interface IParserResult * @property {string|undefined} package Package name, if declared * @property {string[]|undefined} imports Imports, if any * @property {string[]|undefined} weakImports Weak imports, if any * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) * @property {Root} root Populated root instance */ /** * Options modifying the behavior of {@link parse}. * @interface IParseOptions * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist. */ /** * Options modifying the behavior of JSON serialization. * @interface IToJSONOptions * @property {boolean} [keepComments=false] Serializes comments. */ /** * Parses the given .proto source and returns an object with the parsed contents. * @param {string} source Source contents * @param {Root} root Root to populate * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. * @returns {IParserResult} Parser result * @property {string} filename=null Currently processing file name for error reporting, if known * @property {IParseOptions} defaults Default {@link IParseOptions} */ function parse(source, root, options) { /* eslint-disable callback-return */ if (!(root instanceof Root)) { options = root; root = new Root(); } if (!options) options = parse.defaults; var preferTrailingComment = options.preferTrailingComment || false; var tn = tokenize(source, options.alternateCommentMode || false), next = tn.next, push = tn.push, peek = tn.peek, skip = tn.skip, cmnt = tn.cmnt; var head = true, pkg, imports, weakImports, syntax, isProto3 = false; var ptr = root; var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; /* istanbul ignore next */ function illegal(token, name, insideTryCatch) { var filename = parse.filename; if (!insideTryCatch) parse.filename = null; return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); } function readString() { var values = [], token; do { /* istanbul ignore if */ if ((token = next()) !== "\"" && token !== "'") throw illegal(token); values.push(next()); skip(token); token = peek(); } while (token === "\"" || token === "'"); return values.join(""); } function readValue(acceptTypeRef) { var token = next(); switch (token) { case "'": case "\"": push(token); return readString(); case "true": case "TRUE": return true; case "false": case "FALSE": return false; } try { return parseNumber(token, /* insideTryCatch */ true); } catch (e) { /* istanbul ignore else */ if (acceptTypeRef && typeRefRe.test(token)) return token; /* istanbul ignore next */ throw illegal(token, "value"); } } function readRanges(target, acceptStrings) { var token, start; do { if (acceptStrings && ((token = peek()) === "\"" || token === "'")) target.push(readString()); else target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); } while (skip(",", true)); skip(";"); } function parseNumber(token, insideTryCatch) { var sign = 1; if (token.charAt(0) === "-") { sign = -1; token = token.substring(1); } switch (token) { case "inf": case "INF": case "Inf": return sign * Infinity; case "nan": case "NAN": case "Nan": case "NaN": return NaN; case "0": return 0; } if (base10Re.test(token)) return sign * parseInt(token, 10); if (base16Re.test(token)) return sign * parseInt(token, 16); if (base8Re.test(token)) return sign * parseInt(token, 8); /* istanbul ignore else */ if (numberRe.test(token)) return sign * parseFloat(token); /* istanbul ignore next */ throw illegal(token, "number", insideTryCatch); } function parseId(token, acceptNegative) { switch (token) { case "max": case "MAX": case "Max": return 536870911; case "0": return 0; } /* istanbul ignore if */ if (!acceptNegative && token.charAt(0) === "-") throw illegal(token, "id"); if (base10NegRe.test(token)) return parseInt(token, 10); if (base16NegRe.test(token)) return parseInt(token, 16); /* istanbul ignore else */ if (base8NegRe.test(token)) return parseInt(token, 8); /* istanbul ignore next */ throw illegal(token, "id"); } function parsePackage() { /* istanbul ignore if */ if (pkg !== undefined) throw illegal("package"); pkg = next(); /* istanbul ignore if */ if (!typeRefRe.test(pkg)) throw illegal(pkg, "name"); ptr = ptr.define(pkg); skip(";"); } function parseImport() { var token = peek(); var whichImports; switch (token) { case "weak": whichImports = weakImports || (weakImports = []); next(); break; case "public": next(); // eslint-disable-line no-fallthrough default: whichImports = imports || (imports = []); break; } token = readString(); skip(";"); whichImports.push(token); } function parseSyntax() { skip("="); syntax = readString(); isProto3 = syntax === "proto3"; /* istanbul ignore if */ if (!isProto3 && syntax !== "proto2") throw illegal(syntax, "syntax"); skip(";"); } function parseCommon(parent, token) { switch (token) { case "option": parseOption(parent, token); skip(";"); return true; case "message": parseType(parent, token); return true; case "enum": parseEnum(parent, token); return true; case "service": parseService(parent, token); return true; case "extend": parseExtension(parent, token); return true; } return false; } function ifBlock(obj, fnIf, fnElse) { var trailingLine = tn.line; if (obj) { if(typeof obj.comment !== "string") { obj.comment = cmnt(); // try block-type comment } obj.filename = parse.filename; } if (skip("{", true)) { var token; while ((token = next()) !== "}") fnIf(token); skip(";", true); } else { if (fnElse) fnElse(); skip(";"); if (obj && (typeof obj.comment !== "string" || preferTrailingComment)) obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment } } function parseType(parent, token) { /* istanbul ignore if */ if (!nameRe.test(token = next())) throw illegal(token, "type name"); var type = new Type(token); ifBlock(type, function parseType_block(token) { if (parseCommon(type, token)) return; switch (token) { case "map": parseMapField(type, token); break; case "required": case "repeated": parseField(type, token); break; case "optional": /* istanbul ignore if */ if (isProto3) { parseField(type, "proto3_optional"); } else { parseField(type, "optional"); } break; case "oneof": parseOneOf(type, token); break; case "extensions": readRanges(type.extensions || (type.extensions = [])); break; case "reserved": readRanges(type.reserved || (type.reserved = []), true); break; default: /* istanbul ignore if */ if (!isProto3 || !typeRefRe.test(token)) throw illegal(token); push(token); parseField(type, "optional"); break; } }); parent.add(type); } function parseField(parent, rule, extend) { var type = next(); if (type === "group") { parseGroup(parent, rule); return; } /* istanbul ignore if */ if (!typeRefRe.test(type)) throw illegal(type, "type"); var name = next(); /* istanbul ignore if */ if (!nameRe.test(name)) throw illegal(name, "name"); name = applyCase(name); skip("="); var field = new Field(name, parseId(next()), type, rule, extend); ifBlock(field, function parseField_block(token) { /* istanbul ignore else */ if (token === "option") { parseOption(field, token); skip(";"); } else throw illegal(token); }, function parseField_line() { parseInlineOptions(field); }); if (rule === "proto3_optional") { // for proto3 optional fields, we create a single-member Oneof to mimic "optional" behavior var oneof = new OneOf("_" + name); field.setOption("proto3_optional", true); oneof.add(field); parent.add(oneof); } else { parent.add(field); } // JSON defaults to packed=true if not set so we have to set packed=false explicity when // parsing proto2 descriptors without the option, where applicable. This must be done for // all known packable types and anything that could be an enum (= is not a basic type). if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) field.setOption("packed", false, /* ifNotSet */ true); } function parseGroup(parent, rule) { var name = next(); /* istanbul ignore if */ if (!nameRe.test(name)) throw illegal(name, "name"); var fieldName = util.lcFirst(name); if (name === fieldName) name = util.ucFirst(name); skip("="); var id = parseId(next()); var type = new Type(name); type.group = true; var field = new Field(fieldName, id, name, rule); field.filename = parse.filename; ifBlock(type, function parseGroup_block(token) { switch (token) { case "option": parseOption(type, token); skip(";"); break; case "required": case "repeated": parseField(type, token); break; case "optional": /* istanbul ignore if */ if (isProto3) { parseField(type, "proto3_optional"); } else { parseField(type, "optional"); } break; /* istanbul ignore next */ default: throw illegal(token); // there are no groups with proto3 semantics } }); parent.add(type) .add(field); } function parseMapField(parent) { skip("<"); var keyType = next(); /* istanbul ignore if */ if (types.mapKey[keyType] === undefined) throw illegal(keyType, "type"); skip(","); var valueType = next(); /* istanbul ignore if */ if (!typeRefRe.test(valueType)) throw illegal(valueType, "type"); skip(">"); var name = next(); /* istanbul ignore if */ if (!nameRe.test(name)) throw illegal(name, "name"); skip("="); var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); ifBlock(field, function parseMapField_block(token) { /* istanbul ignore else */ if (token === "option") { parseOption(field, token); skip(";"); } else throw illegal(token); }, function parseMapField_line() { parseInlineOptions(field); }); parent.add(field); } function parseOneOf(parent, token) { /* istanbul ignore if */ if (!nameRe.test(token = next())) throw illegal(token, "name"); var oneof = new OneOf(applyCase(token)); ifBlock(oneof, function parseOneOf_block(token) { if (token === "option") { parseOption(oneof, token); skip(";"); } else { push(token); parseField(oneof, "optional"); } }); parent.add(oneof); } function parseEnum(parent, token) { /* istanbul ignore if */ if (!nameRe.test(token = next())) throw illegal(token, "name"); var enm = new Enum(token); ifBlock(enm, function parseEnum_block(token) { switch(token) { case "option": parseOption(enm, token); skip(";"); break; case "reserved": readRanges(enm.reserved || (enm.reserved = []), true); break; default: parseEnumValue(enm, token); } }); parent.add(enm); } function parseEnumValue(parent, token) { /* istanbul ignore if */ if (!nameRe.test(token)) throw illegal(token, "name"); skip("="); var value = parseId(next(), true), dummy = {}; ifBlock(dummy, function parseEnumValue_block(token) { /* istanbul ignore else */ if (token === "option") { parseOption(dummy, token); // skip skip(";"); } else throw illegal(token); }, function parseEnumValue_line() { parseInlineOptions(dummy); // skip }); parent.add(token, value, dummy.comment); } function parseOption(parent, token) { var isCustom = skip("(", true); /* istanbul ignore if */ if (!typeRefRe.test(token = next())) throw illegal(token, "name"); var name = token; var option = name; var propName; if (isCustom) { skip(")"); name = "(" + name + ")"; option = name; token = peek(); if (fqTypeRefRe.test(token)) { propName = token.substr(1); //remove '.' before property name name += token; next(); } } skip("="); var optionValue = parseOptionValue(parent, name); setParsedOption(parent, option, optionValue, propName); } function parseOptionValue(parent, name) { if (skip("{", true)) { // { a: "foo" b { c: "bar" } } var result = {}; while (!skip("}", true)) { /* istanbul ignore if */ if (!nameRe.test(token = next())) throw illegal(token, "name"); var value; var propName = token; if (peek() === "{") value = parseOptionValue(parent, name + "." + token); else { skip(":"); if (peek() === "{") value = parseOptionValue(parent, name + "." + token); else { value = readValue(true); setOption(parent, name + "." + token, value); } } var prevValue = result[propName]; if (prevValue) value = [].concat(prevValue).concat(value); result[propName] = value; skip(",", true); } return result; } var simpleValue = readValue(true); setOption(parent, name, simpleValue); return simpleValue; // Does not enforce a delimiter to be universal } function setOption(parent, name, value) { if (parent.setOption) parent.setOption(name, value); } function setParsedOption(parent, name, value, propName) { if (parent.setParsedOption) parent.setParsedOption(name, value, propName); } function parseInlineOptions(parent) { if (skip("[", true)) { do { parseOption(parent, "option"); } while (skip(",", true)); skip("]"); } return parent; } function parseService(parent, token) { /* istanbul ignore if */ if (!nameRe.test(token = next())) throw illegal(token, "service name"); var service = new Service(token); ifBlock(service, function parseService_block(token) { if (parseCommon(service, token)) return; /* istanbul ignore else */ if (token === "rpc") parseMethod(service, token); else throw illegal(token); }); parent.add(service); } function parseMethod(parent, token) { // Get the comment of the preceding line now (if one exists) in case the // method is defined across multiple lines. var commentText = cmnt(); var type = token; /* istanbul ignore if */ if (!nameRe.test(token = next())) throw illegal(token, "name"); var name = token, requestType, requestStream, responseType, responseStream; skip("("); if (skip("stream", true)) requestStream = true; /* istanbul ignore if */ if (!typeRefRe.test(token = next())) throw illegal(token); requestType = token; skip(")"); skip("returns"); skip("("); if (skip("stream", true)) responseStream = true; /* istanbul ignore if */ if (!typeRefRe.test(token = next())) throw illegal(token); responseType = token; skip(")"); var method = new Method(name, type, requestType, responseType, requestStream, responseStream); method.comment = commentText; ifBlock(method, function parseMethod_block(token) { /* istanbul ignore else */ if (token === "option") { parseOption(method, token); skip(";"); } else throw illegal(token); }); parent.add(method); } function parseExtension(parent, token) { /* istanbul ignore if */ if (!typeRefRe.test(token = next())) throw illegal(token, "reference"); var reference = token; ifBlock(null, function parseExtension_block(token) { switch (token) { case "required": case "repeated": parseField(parent, token, reference); break; case "optional": /* istanbul ignore if */ if (isProto3) { parseField(parent, "proto3_optional", reference); } else { parseField(parent, "optional", reference); } break; default: /* istanbul ignore if */ if (!isProto3 || !typeRefRe.test(token)) throw illegal(token); push(token); parseField(parent, "optional", reference); break; } }); } var token; while ((token = next()) !== null) { switch (token) { case "package": /* istanbul ignore if */ if (!head) throw illegal(token); parsePackage(); break; case "import": /* istanbul ignore if */ if (!head) throw illegal(token); parseImport(); break; case "syntax": /* istanbul ignore if */ if (!head) throw illegal(token); parseSyntax(); break; case "option": parseOption(ptr, token); skip(";"); break; default: /* istanbul ignore else */ if (parseCommon(ptr, token)) { head = false; continue; } /* istanbul ignore next */ throw illegal(token); } } parse.filename = null; return { "package" : pkg, "imports" : imports, weakImports : weakImports, syntax : syntax, root : root }; } /** * Parses the given .proto source and returns an object with the parsed contents. * @name parse * @function * @param {string} source Source contents * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. * @returns {IParserResult} Parser result * @property {string} filename=null Currently processing file name for error reporting, if known * @property {IParseOptions} defaults Default {@link IParseOptions} * @variation 2 */ /***/ }), /***/ 41011: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Reader; var util = __webpack_require__(71241); var BufferReader; // cyclic var LongBits = util.LongBits, utf8 = util.utf8; /* istanbul ignore next */ function indexOutOfRange(reader, writeLength) { return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); } /** * Constructs a new reader instance using the specified buffer. * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. * @constructor * @param {Uint8Array} buffer Buffer to read from */ function Reader(buffer) { /** * Read buffer. * @type {Uint8Array} */ this.buf = buffer; /** * Read buffer position. * @type {number} */ this.pos = 0; /** * Read buffer length. * @type {number} */ this.len = buffer.length; } var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) { if (buffer instanceof Uint8Array || Array.isArray(buffer)) return new Reader(buffer); throw Error("illegal buffer"); } /* istanbul ignore next */ : function create_array(buffer) { if (Array.isArray(buffer)) return new Reader(buffer); throw Error("illegal buffer"); }; var create = function create() { return util.Buffer ? function create_buffer_setup(buffer) { return (Reader.create = function create_buffer(buffer) { return util.Buffer.isBuffer(buffer) ? new BufferReader(buffer) /* istanbul ignore next */ : create_array(buffer); })(buffer); } /* istanbul ignore next */ : create_array; }; /** * Creates a new reader using the specified buffer. * @function * @param {Uint8Array|Buffer} buffer Buffer to read from * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} * @throws {Error} If `buffer` is not a valid buffer */ Reader.create = create(); Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; /** * Reads a varint as an unsigned 32 bit value. * @function * @returns {number} Value read */ Reader.prototype.uint32 = (function read_uint32_setup() { var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) return function read_uint32() { value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; /* istanbul ignore if */ if ((this.pos += 5) > this.len) { this.pos = this.len; throw indexOutOfRange(this, 10); } return value; }; })(); /** * Reads a varint as a signed 32 bit value. * @returns {number} Value read */ Reader.prototype.int32 = function read_int32() { return this.uint32() | 0; }; /** * Reads a zig-zag encoded varint as a signed 32 bit value. * @returns {number} Value read */ Reader.prototype.sint32 = function read_sint32() { var value = this.uint32(); return value >>> 1 ^ -(value & 1) | 0; }; /* eslint-disable no-invalid-this */ function readLongVarint() { // tends to deopt with local vars for octet etc. var bits = new LongBits(0, 0); var i = 0; if (this.len - this.pos > 4) { // fast route (lo) for (; i < 4; ++i) { // 1st..4th bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; if (this.buf[this.pos++] < 128) return bits; } // 5th bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; if (this.buf[this.pos++] < 128) return bits; i = 0; } else { for (; i < 3; ++i) { /* istanbul ignore if */ if (this.pos >= this.len) throw indexOutOfRange(this); // 1st..3th bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; if (this.buf[this.pos++] < 128) return bits; } // 4th bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; return bits; } if (this.len - this.pos > 4) { // fast route (hi) for (; i < 5; ++i) { // 6th..10th bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; if (this.buf[this.pos++] < 128) return bits; } } else { for (; i < 5; ++i) { /* istanbul ignore if */ if (this.pos >= this.len) throw indexOutOfRange(this); // 6th..10th bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; if (this.buf[this.pos++] < 128) return bits; } } /* istanbul ignore next */ throw Error("invalid varint encoding"); } /* eslint-enable no-invalid-this */ /** * Reads a varint as a signed 64 bit value. * @name Reader#int64 * @function * @returns {Long} Value read */ /** * Reads a varint as an unsigned 64 bit value. * @name Reader#uint64 * @function * @returns {Long} Value read */ /** * Reads a zig-zag encoded varint as a signed 64 bit value. * @name Reader#sint64 * @function * @returns {Long} Value read */ /** * Reads a varint as a boolean. * @returns {boolean} Value read */ Reader.prototype.bool = function read_bool() { return this.uint32() !== 0; }; function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0; } /** * Reads fixed 32 bits as an unsigned 32 bit integer. * @returns {number} Value read */ Reader.prototype.fixed32 = function read_fixed32() { /* istanbul ignore if */ if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); return readFixed32_end(this.buf, this.pos += 4); }; /** * Reads fixed 32 bits as a signed 32 bit integer. * @returns {number} Value read */ Reader.prototype.sfixed32 = function read_sfixed32() { /* istanbul ignore if */ if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); return readFixed32_end(this.buf, this.pos += 4) | 0; }; /* eslint-disable no-invalid-this */ function readFixed64(/* this: Reader */) { /* istanbul ignore if */ if (this.pos + 8 > this.len) throw indexOutOfRange(this, 8); return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); } /* eslint-enable no-invalid-this */ /** * Reads fixed 64 bits. * @name Reader#fixed64 * @function * @returns {Long} Value read */ /** * Reads zig-zag encoded fixed 64 bits. * @name Reader#sfixed64 * @function * @returns {Long} Value read */ /** * Reads a float (32 bit) as a number. * @function * @returns {number} Value read */ Reader.prototype.float = function read_float() { /* istanbul ignore if */ if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); var value = util.float.readFloatLE(this.buf, this.pos); this.pos += 4; return value; }; /** * Reads a double (64 bit float) as a number. * @function * @returns {number} Value read */ Reader.prototype.double = function read_double() { /* istanbul ignore if */ if (this.pos + 8 > this.len) throw indexOutOfRange(this, 4); var value = util.float.readDoubleLE(this.buf, this.pos); this.pos += 8; return value; }; /** * Reads a sequence of bytes preceeded by its length as a varint. * @returns {Uint8Array} Value read */ Reader.prototype.bytes = function read_bytes() { var length = this.uint32(), start = this.pos, end = this.pos + length; /* istanbul ignore if */ if (end > this.len) throw indexOutOfRange(this, length); this.pos += length; if (Array.isArray(this.buf)) // plain array return this.buf.slice(start, end); return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 ? new this.buf.constructor(0) : this._slice.call(this.buf, start, end); }; /** * Reads a string preceeded by its byte length as a varint. * @returns {string} Value read */ Reader.prototype.string = function read_string() { var bytes = this.bytes(); return utf8.read(bytes, 0, bytes.length); }; /** * Skips the specified number of bytes if specified, otherwise skips a varint. * @param {number} [length] Length if known, otherwise a varint is assumed * @returns {Reader} `this` */ Reader.prototype.skip = function skip(length) { if (typeof length === "number") { /* istanbul ignore if */ if (this.pos + length > this.len) throw indexOutOfRange(this, length); this.pos += length; } else { do { /* istanbul ignore if */ if (this.pos >= this.len) throw indexOutOfRange(this); } while (this.buf[this.pos++] & 128); } return this; }; /** * Skips the next element of the specified wire type. * @param {number} wireType Wire type received * @returns {Reader} `this` */ Reader.prototype.skipType = function(wireType) { switch (wireType) { case 0: this.skip(); break; case 1: this.skip(8); break; case 2: this.skip(this.uint32()); break; case 3: while ((wireType = this.uint32() & 7) !== 4) { this.skipType(wireType); } break; case 5: this.skip(4); break; /* istanbul ignore next */ default: throw Error("invalid wire type " + wireType + " at offset " + this.pos); } return this; }; Reader._configure = function(BufferReader_) { BufferReader = BufferReader_; Reader.create = create(); BufferReader._configure(); var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; util.merge(Reader.prototype, { int64: function read_int64() { return readLongVarint.call(this)[fn](false); }, uint64: function read_uint64() { return readLongVarint.call(this)[fn](true); }, sint64: function read_sint64() { return readLongVarint.call(this).zzDecode()[fn](false); }, fixed64: function read_fixed64() { return readFixed64.call(this)[fn](true); }, sfixed64: function read_sfixed64() { return readFixed64.call(this)[fn](false); } }); }; /***/ }), /***/ 80339: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = BufferReader; // extends Reader var Reader = __webpack_require__(41011); (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; var util = __webpack_require__(71241); /** * Constructs a new buffer reader instance. * @classdesc Wire format reader using node buffers. * @extends Reader * @constructor * @param {Buffer} buffer Buffer to read from */ function BufferReader(buffer) { Reader.call(this, buffer); /** * Read buffer. * @name BufferReader#buf * @type {Buffer} */ } BufferReader._configure = function () { /* istanbul ignore else */ if (util.Buffer) BufferReader.prototype._slice = util.Buffer.prototype.slice; }; /** * @override */ BufferReader.prototype.string = function read_string_buffer() { var len = this.uint32(); // modifies pos return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); }; /** * Reads a sequence of bytes preceeded by its length as a varint. * @name BufferReader#bytes * @function * @returns {Buffer} Value read */ BufferReader._configure(); /***/ }), /***/ 32614: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Root; // extends Namespace var Namespace = __webpack_require__(76189); ((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; var Field = __webpack_require__(48213), Enum = __webpack_require__(17732), OneOf = __webpack_require__(44408), util = __webpack_require__(47174); var Type, // cyclic parse, // might be excluded common; // " /** * Constructs a new root namespace instance. * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. * @extends NamespaceBase * @constructor * @param {Object.} [options] Top level options */ function Root(options) { Namespace.call(this, "", options); /** * Deferred extension fields. * @type {Field[]} */ this.deferred = []; /** * Resolved file names of loaded files. * @type {string[]} */ this.files = []; } /** * Loads a namespace descriptor into a root namespace. * @param {INamespace} json Nameespace descriptor * @param {Root} [root] Root namespace, defaults to create a new one if omitted * @returns {Root} Root namespace */ Root.fromJSON = function fromJSON(json, root) { if (!root) root = new Root(); if (json.options) root.setOptions(json.options); return root.addJSON(json.nested); }; /** * Resolves the path of an imported file, relative to the importing origin. * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. * @function * @param {string} origin The file name of the importing file * @param {string} target The file name being imported * @returns {string|null} Resolved path to `target` or `null` to skip the file */ Root.prototype.resolvePath = util.path.resolve; /** * Fetch content from file path or url * This method exists so you can override it with your own logic. * @function * @param {string} path File path or url * @param {FetchCallback} callback Callback function * @returns {undefined} */ Root.prototype.fetch = util.fetch; // A symbol-like function to safely signal synchronous loading /* istanbul ignore next */ function SYNC() {} // eslint-disable-line no-empty-function /** * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. * @param {string|string[]} filename Names of one or multiple files to load * @param {IParseOptions} options Parse options * @param {LoadCallback} callback Callback function * @returns {undefined} */ Root.prototype.load = function load(filename, options, callback) { if (typeof options === "function") { callback = options; options = undefined; } var self = this; if (!callback) return util.asPromise(load, self, filename, options); var sync = callback === SYNC; // undocumented // Finishes loading by calling the callback (exactly once) function finish(err, root) { /* istanbul ignore if */ if (!callback) return; var cb = callback; callback = null; if (sync) throw err; cb(err, root); } // Bundled definition existence checking function getBundledFileName(filename) { var idx = filename.lastIndexOf("google/protobuf/"); if (idx > -1) { var altname = filename.substring(idx); if (altname in common) return altname; } return null; } // Processes a single file function process(filename, source) { try { if (util.isString(source) && source.charAt(0) === "{") source = JSON.parse(source); if (!util.isString(source)) self.setOptions(source.options).addJSON(source.nested); else { parse.filename = filename; var parsed = parse(source, self, options), resolved, i = 0; if (parsed.imports) for (; i < parsed.imports.length; ++i) if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])) fetch(resolved); if (parsed.weakImports) for (i = 0; i < parsed.weakImports.length; ++i) if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])) fetch(resolved, true); } } catch (err) { finish(err); } if (!sync && !queued) finish(null, self); // only once anyway } // Fetches a single file function fetch(filename, weak) { // Skip if already loaded / attempted if (self.files.indexOf(filename) > -1) return; self.files.push(filename); // Shortcut bundled definitions if (filename in common) { if (sync) process(filename, common[filename]); else { ++queued; setTimeout(function() { --queued; process(filename, common[filename]); }); } return; } // Otherwise fetch from disk or network if (sync) { var source; try { source = util.fs.readFileSync(filename).toString("utf8"); } catch (err) { if (!weak) finish(err); return; } process(filename, source); } else { ++queued; self.fetch(filename, function(err, source) { --queued; /* istanbul ignore if */ if (!callback) return; // terminated meanwhile if (err) { /* istanbul ignore else */ if (!weak) finish(err); else if (!queued) // can't be covered reliably finish(null, self); return; } process(filename, source); }); } } var queued = 0; // Assembling the root namespace doesn't require working type // references anymore, so we can load everything in parallel if (util.isString(filename)) filename = [ filename ]; for (var i = 0, resolved; i < filename.length; ++i) if (resolved = self.resolvePath("", filename[i])) fetch(resolved); if (sync) return self; if (!queued) finish(null, self); return undefined; }; // function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined /** * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. * @function Root#load * @param {string|string[]} filename Names of one or multiple files to load * @param {LoadCallback} callback Callback function * @returns {undefined} * @variation 2 */ // function load(filename:string, callback:LoadCallback):undefined /** * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. * @function Root#load * @param {string|string[]} filename Names of one or multiple files to load * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. * @returns {Promise} Promise * @variation 3 */ // function load(filename:string, [options:IParseOptions]):Promise /** * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). * @function Root#loadSync * @param {string|string[]} filename Names of one or multiple files to load * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. * @returns {Root} Root namespace * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid */ Root.prototype.loadSync = function loadSync(filename, options) { if (!util.isNode) throw Error("not supported"); return this.load(filename, options, SYNC); }; /** * @override */ Root.prototype.resolveAll = function resolveAll() { if (this.deferred.length) throw Error("unresolvable extensions: " + this.deferred.map(function(field) { return "'extend " + field.extend + "' in " + field.parent.fullName; }).join(", ")); return Namespace.prototype.resolveAll.call(this); }; // only uppercased (and thus conflict-free) children are exposed, see below var exposeRe = /^[A-Z]/; /** * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. * @param {Root} root Root instance * @param {Field} field Declaring extension field witin the declaring type * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise * @inner * @ignore */ function tryHandleExtension(root, field) { var extendedType = field.parent.lookup(field.extend); if (extendedType) { var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); sisterField.declaringField = field; field.extensionField = sisterField; extendedType.add(sisterField); return true; } return false; } /** * Called when any object is added to this root or its sub-namespaces. * @param {ReflectionObject} object Object added * @returns {undefined} * @private */ Root.prototype._handleAdd = function _handleAdd(object) { if (object instanceof Field) { if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) if (!tryHandleExtension(this, object)) this.deferred.push(object); } else if (object instanceof Enum) { if (exposeRe.test(object.name)) object.parent[object.name] = object.values; // expose enum values as property of its parent } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { if (object instanceof Type) // Try to handle any deferred extensions for (var i = 0; i < this.deferred.length;) if (tryHandleExtension(this, this.deferred[i])) this.deferred.splice(i, 1); else ++i; for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace this._handleAdd(object._nestedArray[j]); if (exposeRe.test(object.name)) object.parent[object.name] = object; // expose namespace as property of its parent } // The above also adds uppercased (and thus conflict-free) nested types, services and enums as // properties of namespaces just like static code does. This allows using a .d.ts generated for // a static module with reflection-based solutions where the condition is met. }; /** * Called when any object is removed from this root or its sub-namespaces. * @param {ReflectionObject} object Object removed * @returns {undefined} * @private */ Root.prototype._handleRemove = function _handleRemove(object) { if (object instanceof Field) { if (/* an extension field */ object.extend !== undefined) { if (/* already handled */ object.extensionField) { // remove its sister field object.extensionField.parent.remove(object.extensionField); object.extensionField = null; } else { // cancel the extension var index = this.deferred.indexOf(object); /* istanbul ignore else */ if (index > -1) this.deferred.splice(index, 1); } } } else if (object instanceof Enum) { if (exposeRe.test(object.name)) delete object.parent[object.name]; // unexpose enum values } else if (object instanceof Namespace) { for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace this._handleRemove(object._nestedArray[i]); if (exposeRe.test(object.name)) delete object.parent[object.name]; // unexpose namespaces } }; // Sets up cyclic dependencies (called in index-light) Root._configure = function(Type_, parse_, common_) { Type = Type_; parse = parse_; common = common_; }; /***/ }), /***/ 50073: /***/ ((module) => { "use strict"; module.exports = {}; /** * Named roots. * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). * Can also be used manually to make roots available accross modules. * @name roots * @type {Object.} * @example * // pbjs -r myroot -o compiled.js ... * * // in another module: * require("./compiled.js"); * * // in any subsequent module: * var root = protobuf.roots["myroot"]; */ /***/ }), /***/ 86444: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Streaming RPC helpers. * @namespace */ var rpc = exports; /** * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. * @typedef RPCImpl * @type {function} * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called * @param {Uint8Array} requestData Request data * @param {RPCImplCallback} callback Callback function * @returns {undefined} * @example * function rpcImpl(method, requestData, callback) { * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code * throw Error("no such method"); * asynchronouslyObtainAResponse(requestData, function(err, responseData) { * callback(err, responseData); * }); * } */ /** * Node-style callback as used by {@link RPCImpl}. * @typedef RPCImplCallback * @type {function} * @param {Error|null} error Error, if any, otherwise `null` * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error * @returns {undefined} */ rpc.Service = __webpack_require__(12439); /***/ }), /***/ 12439: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Service; var util = __webpack_require__(71241); // Extends EventEmitter (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; /** * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. * * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. * @typedef rpc.ServiceMethodCallback * @template TRes extends Message * @type {function} * @param {Error|null} error Error, if any * @param {TRes} [response] Response message * @returns {undefined} */ /** * A service method part of a {@link rpc.Service} as created by {@link Service.create}. * @typedef rpc.ServiceMethod * @template TReq extends Message * @template TRes extends Message * @type {function} * @param {TReq|Properties} request Request message or plain object * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` */ /** * Constructs a new RPC service instance. * @classdesc An RPC service as returned by {@link Service#create}. * @exports rpc.Service * @extends util.EventEmitter * @constructor * @param {RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ function Service(rpcImpl, requestDelimited, responseDelimited) { if (typeof rpcImpl !== "function") throw TypeError("rpcImpl must be a function"); util.EventEmitter.call(this); /** * RPC implementation. Becomes `null` once the service is ended. * @type {RPCImpl|null} */ this.rpcImpl = rpcImpl; /** * Whether requests are length-delimited. * @type {boolean} */ this.requestDelimited = Boolean(requestDelimited); /** * Whether responses are length-delimited. * @type {boolean} */ this.responseDelimited = Boolean(responseDelimited); } /** * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. * @param {Method|rpc.ServiceMethod} method Reflected or static method * @param {Constructor} requestCtor Request constructor * @param {Constructor} responseCtor Response constructor * @param {TReq|Properties} request Request message or plain object * @param {rpc.ServiceMethodCallback} callback Service callback * @returns {undefined} * @template TReq extends Message * @template TRes extends Message */ Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { if (!request) throw TypeError("request must be specified"); var self = this; if (!callback) return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); if (!self.rpcImpl) { setTimeout(function() { callback(Error("already ended")); }, 0); return undefined; } try { return self.rpcImpl( method, requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), function rpcCallback(err, response) { if (err) { self.emit("error", err, method); return callback(err); } if (response === null) { self.end(/* endedByRPC */ true); return undefined; } if (!(response instanceof responseCtor)) { try { response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); } catch (err) { self.emit("error", err, method); return callback(err); } } self.emit("data", response, method); return callback(null, response); } ); } catch (err) { self.emit("error", err, method); setTimeout(function() { callback(err); }, 0); return undefined; } }; /** * Ends this service and emits the `end` event. * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. * @returns {rpc.Service} `this` */ Service.prototype.end = function end(endedByRPC) { if (this.rpcImpl) { if (!endedByRPC) // signal end to rpcImpl this.rpcImpl(null, null, null); this.rpcImpl = null; this.emit("end").off(); } return this; }; /***/ }), /***/ 6178: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Service; // extends Namespace var Namespace = __webpack_require__(76189); ((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; var Method = __webpack_require__(57771), util = __webpack_require__(47174), rpc = __webpack_require__(86444); /** * Constructs a new service instance. * @classdesc Reflected service. * @extends NamespaceBase * @constructor * @param {string} name Service name * @param {Object.} [options] Service options * @throws {TypeError} If arguments are invalid */ function Service(name, options) { Namespace.call(this, name, options); /** * Service methods. * @type {Object.} */ this.methods = {}; // toJSON, marker /** * Cached methods as an array. * @type {Method[]|null} * @private */ this._methodsArray = null; } /** * Service descriptor. * @interface IService * @extends INamespace * @property {Object.} methods Method descriptors */ /** * Constructs a service from a service descriptor. * @param {string} name Service name * @param {IService} json Service descriptor * @returns {Service} Created service * @throws {TypeError} If arguments are invalid */ Service.fromJSON = function fromJSON(name, json) { var service = new Service(name, json.options); /* istanbul ignore else */ if (json.methods) for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) service.add(Method.fromJSON(names[i], json.methods[names[i]])); if (json.nested) service.addJSON(json.nested); service.comment = json.comment; return service; }; /** * Converts this service to a service descriptor. * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {IService} Service descriptor */ Service.prototype.toJSON = function toJSON(toJSONOptions) { var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; return util.toObject([ "options" , inherited && inherited.options || undefined, "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, "nested" , inherited && inherited.nested || undefined, "comment" , keepComments ? this.comment : undefined ]); }; /** * Methods of this service as an array for iteration. * @name Service#methodsArray * @type {Method[]} * @readonly */ Object.defineProperty(Service.prototype, "methodsArray", { get: function() { return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); } }); function clearCache(service) { service._methodsArray = null; return service; } /** * @override */ Service.prototype.get = function get(name) { return this.methods[name] || Namespace.prototype.get.call(this, name); }; /** * @override */ Service.prototype.resolveAll = function resolveAll() { var methods = this.methodsArray; for (var i = 0; i < methods.length; ++i) methods[i].resolve(); return Namespace.prototype.resolve.call(this); }; /** * @override */ Service.prototype.add = function add(object) { /* istanbul ignore if */ if (this.get(object.name)) throw Error("duplicate name '" + object.name + "' in " + this); if (object instanceof Method) { this.methods[object.name] = object; object.parent = this; return clearCache(this); } return Namespace.prototype.add.call(this, object); }; /** * @override */ Service.prototype.remove = function remove(object) { if (object instanceof Method) { /* istanbul ignore if */ if (this.methods[object.name] !== object) throw Error(object + " is not a member of " + this); delete this.methods[object.name]; object.parent = null; return clearCache(this); } return Namespace.prototype.remove.call(this, object); }; /** * Creates a runtime service using the specified rpc implementation. * @param {RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. */ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ m: method, q: method.resolvedRequestType.ctor, s: method.resolvedResponseType.ctor }); } return rpcService; }; /***/ }), /***/ 61157: /***/ ((module) => { "use strict"; module.exports = tokenize; var delimRe = /[\s{}=;:[\],'"()<>]/g, stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; var setCommentRe = /^ *[*/]+ */, setCommentAltRe = /^\s*\*?\/*/, setCommentSplitRe = /\n/g, whitespaceRe = /\s/, unescapeRe = /\\(.?)/g; var unescapeMap = { "0": "\0", "r": "\r", "n": "\n", "t": "\t" }; /** * Unescapes a string. * @param {string} str String to unescape * @returns {string} Unescaped string * @property {Object.} map Special characters map * @memberof tokenize */ function unescape(str) { return str.replace(unescapeRe, function($0, $1) { switch ($1) { case "\\": case "": return $1; default: return unescapeMap[$1] || ""; } }); } tokenize.unescape = unescape; /** * Gets the next token and advances. * @typedef TokenizerHandleNext * @type {function} * @returns {string|null} Next token or `null` on eof */ /** * Peeks for the next token. * @typedef TokenizerHandlePeek * @type {function} * @returns {string|null} Next token or `null` on eof */ /** * Pushes a token back to the stack. * @typedef TokenizerHandlePush * @type {function} * @param {string} token Token * @returns {undefined} */ /** * Skips the next token. * @typedef TokenizerHandleSkip * @type {function} * @param {string} expected Expected token * @param {boolean} [optional=false] If optional * @returns {boolean} Whether the token matched * @throws {Error} If the token didn't match and is not optional */ /** * Gets the comment on the previous line or, alternatively, the line comment on the specified line. * @typedef TokenizerHandleCmnt * @type {function} * @param {number} [line] Line number * @returns {string|null} Comment text or `null` if none */ /** * Handle object returned from {@link tokenize}. * @interface ITokenizerHandle * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) * @property {TokenizerHandlePush} push Pushes a token back to the stack * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any * @property {number} line Current line number */ /** * Tokenizes the given .proto source and returns an object with useful utility functions. * @param {string} source Source contents * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. * @returns {ITokenizerHandle} Tokenizer handle */ function tokenize(source, alternateCommentMode) { /* eslint-disable callback-return */ source = source.toString(); var offset = 0, length = source.length, line = 1, commentType = null, commentText = null, commentLine = 0, commentLineEmpty = false, commentIsLeading = false; var stack = []; var stringDelim = null; /* istanbul ignore next */ /** * Creates an error for illegal syntax. * @param {string} subject Subject * @returns {Error} Error created * @inner */ function illegal(subject) { return Error("illegal " + subject + " (line " + line + ")"); } /** * Reads a string till its end. * @returns {string} String read * @inner */ function readString() { var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; re.lastIndex = offset - 1; var match = re.exec(source); if (!match) throw illegal("string"); offset = re.lastIndex; push(stringDelim); stringDelim = null; return unescape(match[1]); } /** * Gets the character at `pos` within the source. * @param {number} pos Position * @returns {string} Character * @inner */ function charAt(pos) { return source.charAt(pos); } /** * Sets the current comment text. * @param {number} start Start offset * @param {number} end End offset * @param {boolean} isLeading set if a leading comment * @returns {undefined} * @inner */ function setComment(start, end, isLeading) { commentType = source.charAt(start++); commentLine = line; commentLineEmpty = false; commentIsLeading = isLeading; var lookback; if (alternateCommentMode) { lookback = 2; // alternate comment parsing: "//" or "/*" } else { lookback = 3; // "///" or "/**" } var commentOffset = start - lookback, c; do { if (--commentOffset < 0 || (c = source.charAt(commentOffset)) === "\n") { commentLineEmpty = true; break; } } while (c === " " || c === "\t"); var lines = source .substring(start, end) .split(setCommentSplitRe); for (var i = 0; i < lines.length; ++i) lines[i] = lines[i] .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") .trim(); commentText = lines .join("\n") .trim(); } function isDoubleSlashCommentLine(startOffset) { var endOffset = findEndOfLine(startOffset); // see if remaining line matches comment pattern var lineText = source.substring(startOffset, endOffset); // look for 1 or 2 slashes since startOffset would already point past // the first slash that started the comment. var isComment = /^\s*\/{1,2}/.test(lineText); return isComment; } function findEndOfLine(cursor) { // find end of cursor's line var endOffset = cursor; while (endOffset < length && charAt(endOffset) !== "\n") { endOffset++; } return endOffset; } /** * Obtains the next token. * @returns {string|null} Next token or `null` on eof * @inner */ function next() { if (stack.length > 0) return stack.shift(); if (stringDelim) return readString(); var repeat, prev, curr, start, isDoc, isLeadingComment = offset === 0; do { if (offset === length) return null; repeat = false; while (whitespaceRe.test(curr = charAt(offset))) { if (curr === "\n") { isLeadingComment = true; ++line; } if (++offset === length) return null; } if (charAt(offset) === "/") { if (++offset === length) { throw illegal("comment"); } if (charAt(offset) === "/") { // Line if (!alternateCommentMode) { // check for triple-slash comment isDoc = charAt(start = offset + 1) === "/"; while (charAt(++offset) !== "\n") { if (offset === length) { return null; } } ++offset; if (isDoc) { setComment(start, offset - 1, isLeadingComment); } ++line; repeat = true; } else { // check for double-slash comments, consolidating consecutive lines start = offset; isDoc = false; if (isDoubleSlashCommentLine(offset)) { isDoc = true; do { offset = findEndOfLine(offset); if (offset === length) { break; } offset++; } while (isDoubleSlashCommentLine(offset)); } else { offset = Math.min(length, findEndOfLine(offset) + 1); } if (isDoc) { setComment(start, offset, isLeadingComment); } line++; repeat = true; } } else if ((curr = charAt(offset)) === "*") { /* Block */ // check for /** (regular comment mode) or /* (alternate comment mode) start = offset + 1; isDoc = alternateCommentMode || charAt(start) === "*"; do { if (curr === "\n") { ++line; } if (++offset === length) { throw illegal("comment"); } prev = curr; curr = charAt(offset); } while (prev !== "*" || curr !== "/"); ++offset; if (isDoc) { setComment(start, offset - 2, isLeadingComment); } repeat = true; } else { return "/"; } } } while (repeat); // offset !== length if we got here var end = offset; delimRe.lastIndex = 0; var delim = delimRe.test(charAt(end++)); if (!delim) while (end < length && !delimRe.test(charAt(end))) ++end; var token = source.substring(offset, offset = end); if (token === "\"" || token === "'") stringDelim = token; return token; } /** * Pushes a token back to the stack. * @param {string} token Token * @returns {undefined} * @inner */ function push(token) { stack.push(token); } /** * Peeks for the next token. * @returns {string|null} Token or `null` on eof * @inner */ function peek() { if (!stack.length) { var token = next(); if (token === null) return null; push(token); } return stack[0]; } /** * Skips a token. * @param {string} expected Expected token * @param {boolean} [optional=false] Whether the token is optional * @returns {boolean} `true` when skipped, `false` if not * @throws {Error} When a required token is not present * @inner */ function skip(expected, optional) { var actual = peek(), equals = actual === expected; if (equals) { next(); return true; } if (!optional) throw illegal("token '" + actual + "', '" + expected + "' expected"); return false; } /** * Gets a comment. * @param {number} [trailingLine] Line number if looking for a trailing comment * @returns {string|null} Comment text * @inner */ function cmnt(trailingLine) { var ret = null; if (trailingLine === undefined) { if (commentLine === line - 1 && (alternateCommentMode || commentType === "*" || commentLineEmpty)) { ret = commentIsLeading ? commentText : null; } } else { /* istanbul ignore else */ if (commentLine < trailingLine) { peek(); } if (commentLine === trailingLine && !commentLineEmpty && (alternateCommentMode || commentType === "/")) { ret = commentIsLeading ? null : commentText; } } return ret; } return Object.defineProperty({ next: next, peek: peek, push: push, skip: skip, cmnt: cmnt }, "line", { get: function() { return line; } }); /* eslint-enable callback-return */ } /***/ }), /***/ 38520: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Type; // extends Namespace var Namespace = __webpack_require__(76189); ((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; var Enum = __webpack_require__(17732), OneOf = __webpack_require__(44408), Field = __webpack_require__(48213), MapField = __webpack_require__(67777), Service = __webpack_require__(6178), Message = __webpack_require__(68027), Reader = __webpack_require__(41011), Writer = __webpack_require__(13098), util = __webpack_require__(47174), encoder = __webpack_require__(23072), decoder = __webpack_require__(65871), verifier = __webpack_require__(34334), converter = __webpack_require__(13617), wrappers = __webpack_require__(63216); /** * Constructs a new reflected message type instance. * @classdesc Reflected message type. * @extends NamespaceBase * @constructor * @param {string} name Message name * @param {Object.} [options] Declared options */ function Type(name, options) { Namespace.call(this, name, options); /** * Message fields. * @type {Object.} */ this.fields = {}; // toJSON, marker /** * Oneofs declared within this namespace, if any. * @type {Object.} */ this.oneofs = undefined; // toJSON /** * Extension ranges, if any. * @type {number[][]} */ this.extensions = undefined; // toJSON /** * Reserved ranges, if any. * @type {Array.} */ this.reserved = undefined; // toJSON /*? * Whether this type is a legacy group. * @type {boolean|undefined} */ this.group = undefined; // toJSON /** * Cached fields by id. * @type {Object.|null} * @private */ this._fieldsById = null; /** * Cached fields as an array. * @type {Field[]|null} * @private */ this._fieldsArray = null; /** * Cached oneofs as an array. * @type {OneOf[]|null} * @private */ this._oneofsArray = null; /** * Cached constructor. * @type {Constructor<{}>} * @private */ this._ctor = null; } Object.defineProperties(Type.prototype, { /** * Message fields by id. * @name Type#fieldsById * @type {Object.} * @readonly */ fieldsById: { get: function() { /* istanbul ignore if */ if (this._fieldsById) return this._fieldsById; this._fieldsById = {}; for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { var field = this.fields[names[i]], id = field.id; /* istanbul ignore if */ if (this._fieldsById[id]) throw Error("duplicate id " + id + " in " + this); this._fieldsById[id] = field; } return this._fieldsById; } }, /** * Fields of this message as an array for iteration. * @name Type#fieldsArray * @type {Field[]} * @readonly */ fieldsArray: { get: function() { return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); } }, /** * Oneofs of this message as an array for iteration. * @name Type#oneofsArray * @type {OneOf[]} * @readonly */ oneofsArray: { get: function() { return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); } }, /** * The registered constructor, if any registered, otherwise a generic constructor. * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. * @name Type#ctor * @type {Constructor<{}>} */ ctor: { get: function() { return this._ctor || (this.ctor = Type.generateConstructor(this)()); }, set: function(ctor) { // Ensure proper prototype var prototype = ctor.prototype; if (!(prototype instanceof Message)) { (ctor.prototype = new Message()).constructor = ctor; util.merge(ctor.prototype, prototype); } // Classes and messages reference their reflected type ctor.$type = ctor.prototype.$type = this; // Mix in static methods util.merge(ctor, Message, true); this._ctor = ctor; // Messages have non-enumerable default values on their prototype var i = 0; for (; i < /* initializes */ this.fieldsArray.length; ++i) this._fieldsArray[i].resolve(); // ensures a proper value // Messages have non-enumerable getters and setters for each virtual oneof field var ctorProperties = {}; for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) ctorProperties[this._oneofsArray[i].resolve().name] = { get: util.oneOfGetter(this._oneofsArray[i].oneof), set: util.oneOfSetter(this._oneofsArray[i].oneof) }; if (i) Object.defineProperties(ctor.prototype, ctorProperties); } } }); /** * Generates a constructor function for the specified type. * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ Type.generateConstructor = function generateConstructor(mtype) { /* eslint-disable no-unexpected-multiline */ var gen = util.codegen(["p"], mtype.name); // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype for (var i = 0, field; i < mtype.fieldsArray.length; ++i) if ((field = mtype._fieldsArray[i]).map) gen ("this%s={}", util.safeProp(field.name)); else if (field.repeated) gen ("this%s=[]", util.safeProp(field.name)); return gen ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors * @property {Object.} fields Field descriptors * @property {number[][]} [extensions] Extension ranges * @property {number[][]} [reserved] Reserved ranges * @property {boolean} [group=false] Whether a legacy group or not */ /** * Creates a message type from a message type descriptor. * @param {string} name Message name * @param {IType} json Message type descriptor * @returns {Type} Created message type */ Type.fromJSON = function fromJSON(name, json) { var type = new Type(name, json.options); type.extensions = json.extensions; type.reserved = json.reserved; var names = Object.keys(json.fields), i = 0; for (; i < names.length; ++i) type.add( ( typeof json.fields[names[i]].keyType !== "undefined" ? MapField.fromJSON : Field.fromJSON )(names[i], json.fields[names[i]]) ); if (json.oneofs) for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); if (json.nested) for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { var nested = json.nested[names[i]]; type.add( // most to least likely ( nested.id !== undefined ? Field.fromJSON : nested.fields !== undefined ? Type.fromJSON : nested.values !== undefined ? Enum.fromJSON : nested.methods !== undefined ? Service.fromJSON : Namespace.fromJSON )(names[i], nested) ); } if (json.extensions && json.extensions.length) type.extensions = json.extensions; if (json.reserved && json.reserved.length) type.reserved = json.reserved; if (json.group) type.group = true; if (json.comment) type.comment = json.comment; return type; }; /** * Converts this message type to a message type descriptor. * @param {IToJSONOptions} [toJSONOptions] JSON conversion options * @returns {IType} Message type descriptor */ Type.prototype.toJSON = function toJSON(toJSONOptions) { var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; return util.toObject([ "options" , inherited && inherited.options || undefined, "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, "group" , this.group || undefined, "nested" , inherited && inherited.nested || undefined, "comment" , keepComments ? this.comment : undefined ]); }; /** * @override */ Type.prototype.resolveAll = function resolveAll() { var fields = this.fieldsArray, i = 0; while (i < fields.length) fields[i++].resolve(); var oneofs = this.oneofsArray; i = 0; while (i < oneofs.length) oneofs[i++].resolve(); return Namespace.prototype.resolveAll.call(this); }; /** * @override */ Type.prototype.get = function get(name) { return this.fields[name] || this.oneofs && this.oneofs[name] || this.nested && this.nested[name] || null; }; /** * Adds a nested object to this type. * @param {ReflectionObject} object Nested object to add * @returns {Type} `this` * @throws {TypeError} If arguments are invalid * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id */ Type.prototype.add = function add(object) { if (this.get(object.name)) throw Error("duplicate name '" + object.name + "' in " + this); if (object instanceof Field && object.extend === undefined) { // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. // The root object takes care of adding distinct sister-fields to the respective extended // type instead. // avoids calling the getter if not absolutely necessary because it's called quite frequently if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) throw Error("duplicate id " + object.id + " in " + this); if (this.isReservedId(object.id)) throw Error("id " + object.id + " is reserved in " + this); if (this.isReservedName(object.name)) throw Error("name '" + object.name + "' is reserved in " + this); if (object.parent) object.parent.remove(object); this.fields[object.name] = object; object.message = this; object.onAdd(this); return clearCache(this); } if (object instanceof OneOf) { if (!this.oneofs) this.oneofs = {}; this.oneofs[object.name] = object; object.onAdd(this); return clearCache(this); } return Namespace.prototype.add.call(this, object); }; /** * Removes a nested object from this type. * @param {ReflectionObject} object Nested object to remove * @returns {Type} `this` * @throws {TypeError} If arguments are invalid * @throws {Error} If `object` is not a member of this type */ Type.prototype.remove = function remove(object) { if (object instanceof Field && object.extend === undefined) { // See Type#add for the reason why extension fields are excluded here. /* istanbul ignore if */ if (!this.fields || this.fields[object.name] !== object) throw Error(object + " is not a member of " + this); delete this.fields[object.name]; object.parent = null; object.onRemove(this); return clearCache(this); } if (object instanceof OneOf) { /* istanbul ignore if */ if (!this.oneofs || this.oneofs[object.name] !== object) throw Error(object + " is not a member of " + this); delete this.oneofs[object.name]; object.parent = null; object.onRemove(this); return clearCache(this); } return Namespace.prototype.remove.call(this, object); }; /** * Tests if the specified id is reserved. * @param {number} id Id to test * @returns {boolean} `true` if reserved, otherwise `false` */ Type.prototype.isReservedId = function isReservedId(id) { return Namespace.isReservedId(this.reserved, id); }; /** * Tests if the specified name is reserved. * @param {string} name Name to test * @returns {boolean} `true` if reserved, otherwise `false` */ Type.prototype.isReservedName = function isReservedName(name) { return Namespace.isReservedName(this.reserved, name); }; /** * Creates a new message of this type using the specified properties. * @param {Object.} [properties] Properties to set * @returns {Message<{}>} Message instance */ Type.prototype.create = function create(properties) { return new this.ctor(properties); }; /** * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. * @returns {Type} `this` */ Type.prototype.setup = function setup() { // Sets up everything at once so that the prototype chain does not have to be re-evaluated // multiple times (V8, soft-deopt prototype-check). var fullName = this.fullName, types = []; for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) types.push(this._fieldsArray[i].resolve().resolvedType); // Replace setup methods with type-specific generated functions this.encode = encoder(this)({ Writer : Writer, types : types, util : util }); this.decode = decoder(this)({ Reader : Reader, types : types, util : util }); this.verify = verifier(this)({ types : types, util : util }); this.fromObject = converter.fromObject(this)({ types : types, util : util }); this.toObject = converter.toObject(this)({ types : types, util : util }); // Inject custom wrappers for common types var wrapper = wrappers[fullName]; if (wrapper) { var originalThis = Object.create(this); // if (wrapper.fromObject) { originalThis.fromObject = this.fromObject; this.fromObject = wrapper.fromObject.bind(originalThis); // } // if (wrapper.toObject) { originalThis.toObject = this.toObject; this.toObject = wrapper.toObject.bind(originalThis); // } } return this; }; /** * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. * @param {Message<{}>|Object.} message Message instance or plain object * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ Type.prototype.encode = function encode_setup(message, writer) { return this.setup().encode(message, writer); // overrides this method }; /** * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. * @param {Message<{}>|Object.} message Message instance or plain object * @param {Writer} [writer] Writer to encode to * @returns {Writer} writer */ Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** * Decodes a message of this type. * @param {Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Length of the message, if known beforehand * @returns {Message<{}>} Decoded message * @throws {Error} If the payload is not a reader or valid buffer * @throws {util.ProtocolError<{}>} If required fields are missing */ Type.prototype.decode = function decode_setup(reader, length) { return this.setup().decode(reader, length); // overrides this method }; /** * Decodes a message of this type preceeded by its byte length as a varint. * @param {Reader|Uint8Array} reader Reader or buffer to decode from * @returns {Message<{}>} Decoded message * @throws {Error} If the payload is not a reader or valid buffer * @throws {util.ProtocolError} If required fields are missing */ Type.prototype.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof Reader)) reader = Reader.create(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies that field values are valid and that required fields are present. * @param {Object.} message Plain object to verify * @returns {null|string} `null` if valid, otherwise the reason why it is not */ Type.prototype.verify = function verify_setup(message) { return this.setup().verify(message); // overrides this method }; /** * Creates a new message of this type from a plain object. Also converts values to their respective internal types. * @param {Object.} object Plain object to convert * @returns {Message<{}>} Message instance */ Type.prototype.fromObject = function fromObject(object) { return this.setup().fromObject(object); }; /** * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. * @interface IConversionOptions * @property {Function} [longs] Long conversion type. * Valid values are `String` and `Number` (the global types). * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. * @property {Function} [enums] Enum value conversion type. * Only valid value is `String` (the global type). * Defaults to copy the present value, which is the numeric id. * @property {Function} [bytes] Bytes value conversion type. * Valid values are `Array` and (a base64 encoded) `String` (the global types). * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. * @property {boolean} [defaults=false] Also sets default values on the resulting object * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings */ /** * Creates a plain object from a message of this type. Also converts values to other types if specified. * @param {Message<{}>} message Message instance * @param {IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ Type.prototype.toObject = function toObject(message, options) { return this.setup().toObject(message, options); }; /** * Decorator function as returned by {@link Type.d} (TypeScript). * @typedef TypeDecorator * @type {function} * @param {Constructor} target Target constructor * @returns {undefined} * @template T extends Message */ /** * Type decorator (TypeScript). * @param {string} [typeName] Type name, defaults to the constructor's name * @returns {TypeDecorator} Decorator function * @template T extends Message */ Type.d = function decorateType(typeName) { return function typeDecorator(target) { util.decorateType(target, typeName); }; }; /***/ }), /***/ 6581: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * Common type constants. * @namespace */ var types = exports; var util = __webpack_require__(47174); var s = [ "double", // 0 "float", // 1 "int32", // 2 "uint32", // 3 "sint32", // 4 "fixed32", // 5 "sfixed32", // 6 "int64", // 7 "uint64", // 8 "sint64", // 9 "fixed64", // 10 "sfixed64", // 11 "bool", // 12 "string", // 13 "bytes" // 14 ]; function bake(values, offset) { var i = 0, o = {}; offset |= 0; while (i < values.length) o[s[i + offset]] = values[i++]; return o; } /** * Basic type wire types. * @type {Object.} * @const * @property {number} double=1 Fixed64 wire type * @property {number} float=5 Fixed32 wire type * @property {number} int32=0 Varint wire type * @property {number} uint32=0 Varint wire type * @property {number} sint32=0 Varint wire type * @property {number} fixed32=5 Fixed32 wire type * @property {number} sfixed32=5 Fixed32 wire type * @property {number} int64=0 Varint wire type * @property {number} uint64=0 Varint wire type * @property {number} sint64=0 Varint wire type * @property {number} fixed64=1 Fixed64 wire type * @property {number} sfixed64=1 Fixed64 wire type * @property {number} bool=0 Varint wire type * @property {number} string=2 Ldelim wire type * @property {number} bytes=2 Ldelim wire type */ types.basic = bake([ /* double */ 1, /* float */ 5, /* int32 */ 0, /* uint32 */ 0, /* sint32 */ 0, /* fixed32 */ 5, /* sfixed32 */ 5, /* int64 */ 0, /* uint64 */ 0, /* sint64 */ 0, /* fixed64 */ 1, /* sfixed64 */ 1, /* bool */ 0, /* string */ 2, /* bytes */ 2 ]); /** * Basic type defaults. * @type {Object.} * @const * @property {number} double=0 Double default * @property {number} float=0 Float default * @property {number} int32=0 Int32 default * @property {number} uint32=0 Uint32 default * @property {number} sint32=0 Sint32 default * @property {number} fixed32=0 Fixed32 default * @property {number} sfixed32=0 Sfixed32 default * @property {number} int64=0 Int64 default * @property {number} uint64=0 Uint64 default * @property {number} sint64=0 Sint32 default * @property {number} fixed64=0 Fixed64 default * @property {number} sfixed64=0 Sfixed64 default * @property {boolean} bool=false Bool default * @property {string} string="" String default * @property {Array.} bytes=Array(0) Bytes default * @property {null} message=null Message default */ types.defaults = bake([ /* double */ 0, /* float */ 0, /* int32 */ 0, /* uint32 */ 0, /* sint32 */ 0, /* fixed32 */ 0, /* sfixed32 */ 0, /* int64 */ 0, /* uint64 */ 0, /* sint64 */ 0, /* fixed64 */ 0, /* sfixed64 */ 0, /* bool */ false, /* string */ "", /* bytes */ util.emptyArray, /* message */ null ]); /** * Basic long type wire types. * @type {Object.} * @const * @property {number} int64=0 Varint wire type * @property {number} uint64=0 Varint wire type * @property {number} sint64=0 Varint wire type * @property {number} fixed64=1 Fixed64 wire type * @property {number} sfixed64=1 Fixed64 wire type */ types.long = bake([ /* int64 */ 0, /* uint64 */ 0, /* sint64 */ 0, /* fixed64 */ 1, /* sfixed64 */ 1 ], 7); /** * Allowed types for map keys with their associated wire type. * @type {Object.} * @const * @property {number} int32=0 Varint wire type * @property {number} uint32=0 Varint wire type * @property {number} sint32=0 Varint wire type * @property {number} fixed32=5 Fixed32 wire type * @property {number} sfixed32=5 Fixed32 wire type * @property {number} int64=0 Varint wire type * @property {number} uint64=0 Varint wire type * @property {number} sint64=0 Varint wire type * @property {number} fixed64=1 Fixed64 wire type * @property {number} sfixed64=1 Fixed64 wire type * @property {number} bool=0 Varint wire type * @property {number} string=2 Ldelim wire type */ types.mapKey = bake([ /* int32 */ 0, /* uint32 */ 0, /* sint32 */ 0, /* fixed32 */ 5, /* sfixed32 */ 5, /* int64 */ 0, /* uint64 */ 0, /* sint64 */ 0, /* fixed64 */ 1, /* sfixed64 */ 1, /* bool */ 0, /* string */ 2 ], 2); /** * Allowed types for packed repeated fields with their associated wire type. * @type {Object.} * @const * @property {number} double=1 Fixed64 wire type * @property {number} float=5 Fixed32 wire type * @property {number} int32=0 Varint wire type * @property {number} uint32=0 Varint wire type * @property {number} sint32=0 Varint wire type * @property {number} fixed32=5 Fixed32 wire type * @property {number} sfixed32=5 Fixed32 wire type * @property {number} int64=0 Varint wire type * @property {number} uint64=0 Varint wire type * @property {number} sint64=0 Varint wire type * @property {number} fixed64=1 Fixed64 wire type * @property {number} sfixed64=1 Fixed64 wire type * @property {number} bool=0 Varint wire type */ types.packed = bake([ /* double */ 1, /* float */ 5, /* int32 */ 0, /* uint32 */ 0, /* sint32 */ 0, /* fixed32 */ 5, /* sfixed32 */ 5, /* int64 */ 0, /* uint64 */ 0, /* sint64 */ 0, /* fixed64 */ 1, /* sfixed64 */ 1, /* bool */ 0 ]); /***/ }), /***/ 47174: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Various utility functions. * @namespace */ var util = module.exports = __webpack_require__(71241); var roots = __webpack_require__(50073); var Type, // cyclic Enum; util.codegen = __webpack_require__(58882); util.fetch = __webpack_require__(50663); util.path = __webpack_require__(24761); /** * Node's fs module if available. * @type {Object.} */ util.fs = util.inquire("fs"); /** * Converts an object's values to an array. * @param {Object.} object Object to convert * @returns {Array.<*>} Converted array */ util.toArray = function toArray(object) { if (object) { var keys = Object.keys(object), array = new Array(keys.length), index = 0; while (index < keys.length) array[index] = object[keys[index++]]; return array; } return []; }; /** * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. * @param {Array.<*>} array Array to convert * @returns {Object.} Converted object */ util.toObject = function toObject(array) { var object = {}, index = 0; while (index < array.length) { var key = array[index++], val = array[index++]; if (val !== undefined) object[key] = val; } return object; }; var safePropBackslashRe = /\\/g, safePropQuoteRe = /"/g; /** * Tests whether the specified name is a reserved word in JS. * @param {string} name Name to test * @returns {boolean} `true` if reserved, otherwise `false` */ util.isReserved = function isReserved(name) { return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); }; /** * Returns a safe property accessor for the specified property name. * @param {string} prop Property name * @returns {string} Safe accessor */ util.safeProp = function safeProp(prop) { if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; return "." + prop; }; /** * Converts the first character of a string to upper case. * @param {string} str String to convert * @returns {string} Converted string */ util.ucFirst = function ucFirst(str) { return str.charAt(0).toUpperCase() + str.substring(1); }; var camelCaseRe = /_([a-z])/g; /** * Converts a string to camel case. * @param {string} str String to convert * @returns {string} Converted string */ util.camelCase = function camelCase(str) { return str.substring(0, 1) + str.substring(1) .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); }; /** * Compares reflected fields by id. * @param {Field} a First field * @param {Field} b Second field * @returns {number} Comparison value */ util.compareFieldsById = function compareFieldsById(a, b) { return a.id - b.id; }; /** * Decorator helper for types (TypeScript). * @param {Constructor} ctor Constructor function * @param {string} [typeName] Type name, defaults to the constructor's name * @returns {Type} Reflected type * @template T extends Message * @property {Root} root Decorators root */ util.decorateType = function decorateType(ctor, typeName) { /* istanbul ignore if */ if (ctor.$type) { if (typeName && ctor.$type.name !== typeName) { util.decorateRoot.remove(ctor.$type); ctor.$type.name = typeName; util.decorateRoot.add(ctor.$type); } return ctor.$type; } /* istanbul ignore next */ if (!Type) Type = __webpack_require__(38520); var type = new Type(typeName || ctor.name); util.decorateRoot.add(type); type.ctor = ctor; // sets up .encode, .decode etc. Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); return type; }; var decorateEnumIndex = 0; /** * Decorator helper for enums (TypeScript). * @param {Object} object Enum object * @returns {Enum} Reflected enum */ util.decorateEnum = function decorateEnum(object) { /* istanbul ignore if */ if (object.$type) return object.$type; /* istanbul ignore next */ if (!Enum) Enum = __webpack_require__(17732); var enm = new Enum("Enum" + decorateEnumIndex++, object); util.decorateRoot.add(enm); Object.defineProperty(object, "$type", { value: enm, enumerable: false }); return enm; }; /** * Sets the value of a property by property path. If a value already exists, it is turned to an array * @param {Object.} dst Destination object * @param {string} path dot '.' delimited path of the property to set * @param {Object} value the value to set * @returns {Object.} Destination object */ util.setProperty = function setProperty(dst, path, value) { function setProp(dst, path, value) { var part = path.shift(); if (path.length > 0) { dst[part] = setProp(dst[part] || {}, path, value); } else { var prevValue = dst[part]; if (prevValue) value = [].concat(prevValue).concat(value); dst[part] = value; } return dst; } if (typeof dst !== "object") throw TypeError("dst must be an object"); if (!path) throw TypeError("path must be specified"); path = path.split("."); return setProp(dst, path, value); }; /** * Decorator root (TypeScript). * @name util.decorateRoot * @type {Root} * @readonly */ Object.defineProperty(util, "decorateRoot", { get: function() { return roots["decorated"] || (roots["decorated"] = new (__webpack_require__(32614))()); } }); /***/ }), /***/ 8374: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = LongBits; var util = __webpack_require__(71241); /** * Constructs new long bits. * @classdesc Helper class for working with the low and high bits of a 64 bit value. * @memberof util * @constructor * @param {number} lo Low 32 bits, unsigned * @param {number} hi High 32 bits, unsigned */ function LongBits(lo, hi) { // note that the casts below are theoretically unnecessary as of today, but older statically // generated converter code might still call the ctor with signed 32bits. kept for compat. /** * Low bits. * @type {number} */ this.lo = lo >>> 0; /** * High bits. * @type {number} */ this.hi = hi >>> 0; } /** * Zero bits. * @memberof util.LongBits * @type {util.LongBits} */ var zero = LongBits.zero = new LongBits(0, 0); zero.toNumber = function() { return 0; }; zero.zzEncode = zero.zzDecode = function() { return this; }; zero.length = function() { return 1; }; /** * Zero hash. * @memberof util.LongBits * @type {string} */ var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; /** * Constructs new long bits from the specified number. * @param {number} value Value * @returns {util.LongBits} Instance */ LongBits.fromNumber = function fromNumber(value) { if (value === 0) return zero; var sign = value < 0; if (sign) value = -value; var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0; if (sign) { hi = ~hi >>> 0; lo = ~lo >>> 0; if (++lo > 4294967295) { lo = 0; if (++hi > 4294967295) hi = 0; } } return new LongBits(lo, hi); }; /** * Constructs new long bits from a number, long or string. * @param {Long|number|string} value Value * @returns {util.LongBits} Instance */ LongBits.from = function from(value) { if (typeof value === "number") return LongBits.fromNumber(value); if (util.isString(value)) { /* istanbul ignore else */ if (util.Long) value = util.Long.fromString(value); else return LongBits.fromNumber(parseInt(value, 10)); } return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; }; /** * Converts this long bits to a possibly unsafe JavaScript number. * @param {boolean} [unsigned=false] Whether unsigned or not * @returns {number} Possibly unsafe number */ LongBits.prototype.toNumber = function toNumber(unsigned) { if (!unsigned && this.hi >>> 31) { var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0; if (!lo) hi = hi + 1 >>> 0; return -(lo + hi * 4294967296); } return this.lo + this.hi * 4294967296; }; /** * Converts this long bits to a long. * @param {boolean} [unsigned=false] Whether unsigned or not * @returns {Long} Long */ LongBits.prototype.toLong = function toLong(unsigned) { return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) /* istanbul ignore next */ : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; }; var charCodeAt = String.prototype.charCodeAt; /** * Constructs new long bits from the specified 8 characters long hash. * @param {string} hash Hash * @returns {util.LongBits} Bits */ LongBits.fromHash = function fromHash(hash) { if (hash === zeroHash) return zero; return new LongBits( ( charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0 , ( charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0 ); }; /** * Converts this long bits to a 8 characters long hash. * @returns {string} Hash */ LongBits.prototype.toHash = function toHash() { return String.fromCharCode( this.lo & 255, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24 , this.hi & 255, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24 ); }; /** * Zig-zag encodes this long bits. * @returns {util.LongBits} `this` */ LongBits.prototype.zzEncode = function zzEncode() { var mask = this.hi >> 31; this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; this.lo = ( this.lo << 1 ^ mask) >>> 0; return this; }; /** * Zig-zag decodes this long bits. * @returns {util.LongBits} `this` */ LongBits.prototype.zzDecode = function zzDecode() { var mask = -(this.lo & 1); this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; this.hi = ( this.hi >>> 1 ^ mask) >>> 0; return this; }; /** * Calculates the length of this longbits when encoded as a varint. * @returns {number} Length */ LongBits.prototype.length = function length() { var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24; return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10; }; /***/ }), /***/ 71241: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var util = exports; // used to return a Promise where callback is omitted util.asPromise = __webpack_require__(252); // converts to / from base64 encoded strings util.base64 = __webpack_require__(26718); // base class of rpc.Service util.EventEmitter = __webpack_require__(86850); // float handling accross browsers util.float = __webpack_require__(33182); // requires modules optionally and hides the call from bundlers util.inquire = __webpack_require__(60094); // converts to / from utf8 encoded strings util.utf8 = __webpack_require__(99049); // provides a node-like buffer pool in the browser util.pool = __webpack_require__(47743); // utility to work with the low and high bits of a 64 bit value util.LongBits = __webpack_require__(8374); /** * Whether running within node or not. * @memberof util * @type {boolean} */ util.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node); /** * Global object reference. * @memberof util * @type {Object} */ util.global = util.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || this; // eslint-disable-line no-invalid-this /** * An immuable empty array. * @memberof util * @type {Array.<*>} * @const */ util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes /** * An immutable empty object. * @type {Object} * @const */ util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes /** * Tests if the specified value is an integer. * @function * @param {*} value Value to test * @returns {boolean} `true` if the value is an integer */ util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { return typeof value === "number" && isFinite(value) && Math.floor(value) === value; }; /** * Tests if the specified value is a string. * @param {*} value Value to test * @returns {boolean} `true` if the value is a string */ util.isString = function isString(value) { return typeof value === "string" || value instanceof String; }; /** * Tests if the specified value is a non-null object. * @param {*} value Value to test * @returns {boolean} `true` if the value is a non-null object */ util.isObject = function isObject(value) { return value && typeof value === "object"; }; /** * Checks if a property on a message is considered to be present. * This is an alias of {@link util.isSet}. * @function * @param {Object} obj Plain object or message instance * @param {string} prop Property name * @returns {boolean} `true` if considered to be present, otherwise `false` */ util.isset = /** * Checks if a property on a message is considered to be present. * @param {Object} obj Plain object or message instance * @param {string} prop Property name * @returns {boolean} `true` if considered to be present, otherwise `false` */ util.isSet = function isSet(obj, prop) { var value = obj[prop]; if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; return false; }; /** * Any compatible Buffer instance. * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. * @interface Buffer * @extends Uint8Array */ /** * Node's Buffer class if available. * @type {Constructor} */ util.Buffer = (function() { try { var Buffer = util.inquire("buffer").Buffer; // refuse to use non-node buffers if not explicitly assigned (perf reasons): return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; } catch (e) { /* istanbul ignore next */ return null; } })(); // Internal alias of or polyfull for Buffer.from. util._Buffer_from = null; // Internal alias of or polyfill for Buffer.allocUnsafe. util._Buffer_allocUnsafe = null; /** * Creates a new buffer of whatever type supported by the environment. * @param {number|number[]} [sizeOrArray=0] Buffer size or number array * @returns {Uint8Array|Buffer} Buffer */ util.newBuffer = function newBuffer(sizeOrArray) { /* istanbul ignore next */ return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); }; /** * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. * @type {Constructor} */ util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; /** * Any compatible Long instance. * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. * @interface Long * @property {number} low Low bits * @property {number} high High bits * @property {boolean} unsigned Whether unsigned or not */ /** * Long.js's Long class if available. * @type {Constructor} */ util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long || /* istanbul ignore next */ util.global.Long || util.inquire("long"); /** * Regular expression used to verify 2 bit (`bool`) map keys. * @type {RegExp} * @const */ util.key2Re = /^true|false|0|1$/; /** * Regular expression used to verify 32 bit (`int32` etc.) map keys. * @type {RegExp} * @const */ util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; /** * Regular expression used to verify 64 bit (`int64` etc.) map keys. * @type {RegExp} * @const */ util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; /** * Converts a number or long to an 8 characters long hash string. * @param {Long|number} value Value to convert * @returns {string} Hash */ util.longToHash = function longToHash(value) { return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash; }; /** * Converts an 8 characters long hash string to a long or number. * @param {string} hash Hash * @param {boolean} [unsigned=false] Whether unsigned or not * @returns {Long|number} Original value */ util.longFromHash = function longFromHash(hash, unsigned) { var bits = util.LongBits.fromHash(hash); if (util.Long) return util.Long.fromBits(bits.lo, bits.hi, unsigned); return bits.toNumber(Boolean(unsigned)); }; /** * Merges the properties of the source object into the destination object. * @memberof util * @param {Object.} dst Destination object * @param {Object.} src Source object * @param {boolean} [ifNotSet=false] Merges only if the key is not already set * @returns {Object.} Destination object */ function merge(dst, src, ifNotSet) { // used by converters for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) if (dst[keys[i]] === undefined || !ifNotSet) dst[keys[i]] = src[keys[i]]; return dst; } util.merge = merge; /** * Converts the first character of a string to lower case. * @param {string} str String to convert * @returns {string} Converted string */ util.lcFirst = function lcFirst(str) { return str.charAt(0).toLowerCase() + str.substring(1); }; /** * Creates a custom error constructor. * @memberof util * @param {string} name Error name * @returns {Constructor} Custom error constructor */ function newError(name) { function CustomError(message, properties) { if (!(this instanceof CustomError)) return new CustomError(message, properties); // Error.call(this, message); // ^ just returns a new error instance because the ctor can be called as a function Object.defineProperty(this, "message", { get: function() { return message; } }); /* istanbul ignore next */ if (Error.captureStackTrace) // node Error.captureStackTrace(this, CustomError); else Object.defineProperty(this, "stack", { value: new Error().stack || "" }); if (properties) merge(this, properties); } (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError; Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } }); CustomError.prototype.toString = function toString() { return this.name + ": " + this.message; }; return CustomError; } util.newError = newError; /** * Constructs a new protocol error. * @classdesc Error subclass indicating a protocol specifc error. * @memberof util * @extends Error * @template T extends Message * @constructor * @param {string} message Error message * @param {Object.} [properties] Additional properties * @example * try { * MyMessage.decode(someBuffer); // throws if required fields are missing * } catch (e) { * if (e instanceof ProtocolError && e.instance) * console.log("decoded so far: " + JSON.stringify(e.instance)); * } */ util.ProtocolError = newError("ProtocolError"); /** * So far decoded message instance. * @name util.ProtocolError#instance * @type {Message} */ /** * A OneOf getter as returned by {@link util.oneOfGetter}. * @typedef OneOfGetter * @type {function} * @returns {string|undefined} Set field name, if any */ /** * Builds a getter for a oneof's present field name. * @param {string[]} fieldNames Field names * @returns {OneOfGetter} Unbound getter */ util.oneOfGetter = function getOneOf(fieldNames) { var fieldMap = {}; for (var i = 0; i < fieldNames.length; ++i) fieldMap[fieldNames[i]] = 1; /** * @returns {string|undefined} Set field name, if any * @this Object * @ignore */ return function() { // eslint-disable-line consistent-return for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) return keys[i]; }; }; /** * A OneOf setter as returned by {@link util.oneOfSetter}. * @typedef OneOfSetter * @type {function} * @param {string|undefined} value Field name * @returns {undefined} */ /** * Builds a setter for a oneof's present field name. * @param {string[]} fieldNames Field names * @returns {OneOfSetter} Unbound setter */ util.oneOfSetter = function setOneOf(fieldNames) { /** * @param {string} name Field name * @returns {undefined} * @this Object * @ignore */ return function(name) { for (var i = 0; i < fieldNames.length; ++i) if (fieldNames[i] !== name) delete this[fieldNames[i]]; }; }; /** * Default conversion options used for {@link Message#toJSON} implementations. * * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: * * - Longs become strings * - Enums become string keys * - Bytes become base64 encoded strings * - (Sub-)Messages become plain objects * - Maps become plain objects with all string keys * - Repeated fields become arrays * - NaN and Infinity for float and double fields become strings * * @type {IConversionOptions} * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json */ util.toJSONOptions = { longs: String, enums: String, bytes: String, json: true }; // Sets up buffer utility according to the environment (called in index-minimal) util._configure = function() { var Buffer = util.Buffer; /* istanbul ignore if */ if (!Buffer) { util._Buffer_from = util._Buffer_allocUnsafe = null; return; } // because node 4.x buffers are incompatible & immutable // see: https://github.com/dcodeIO/protobuf.js/pull/665 util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || /* istanbul ignore next */ function Buffer_from(value, encoding) { return new Buffer(value, encoding); }; util._Buffer_allocUnsafe = Buffer.allocUnsafe || /* istanbul ignore next */ function Buffer_allocUnsafe(size) { return new Buffer(size); }; }; /***/ }), /***/ 34334: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = verifier; var Enum = __webpack_require__(17732), util = __webpack_require__(47174); function invalid(field, expected) { return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; } /** * Generates a partial value verifier. * @param {Codegen} gen Codegen instance * @param {Field} field Reflected field * @param {number} fieldIndex Field index * @param {string} ref Variable reference * @returns {Codegen} Codegen instance * @ignore */ function genVerifyValue(gen, field, fieldIndex, ref) { /* eslint-disable no-unexpected-multiline */ if (field.resolvedType) { if (field.resolvedType instanceof Enum) { gen ("switch(%s){", ref) ("default:") ("return%j", invalid(field, "enum value")); for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen ("case %i:", field.resolvedType.values[keys[j]]); gen ("break") ("}"); } else { gen ("{") ("var e=types[%i].verify(%s);", fieldIndex, ref) ("if(e)") ("return%j+e", field.name + ".") ("}"); } } else { switch (field.type) { case "int32": case "uint32": case "sint32": case "fixed32": case "sfixed32": gen ("if(!util.isInteger(%s))", ref) ("return%j", invalid(field, "integer")); break; case "int64": case "uint64": case "sint64": case "fixed64": case "sfixed64": gen ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) ("return%j", invalid(field, "integer|Long")); break; case "float": case "double": gen ("if(typeof %s!==\"number\")", ref) ("return%j", invalid(field, "number")); break; case "bool": gen ("if(typeof %s!==\"boolean\")", ref) ("return%j", invalid(field, "boolean")); break; case "string": gen ("if(!util.isString(%s))", ref) ("return%j", invalid(field, "string")); break; case "bytes": gen ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) ("return%j", invalid(field, "buffer")); break; } } return gen; /* eslint-enable no-unexpected-multiline */ } /** * Generates a partial key verifier. * @param {Codegen} gen Codegen instance * @param {Field} field Reflected field * @param {string} ref Variable reference * @returns {Codegen} Codegen instance * @ignore */ function genVerifyKey(gen, field, ref) { /* eslint-disable no-unexpected-multiline */ switch (field.keyType) { case "int32": case "uint32": case "sint32": case "fixed32": case "sfixed32": gen ("if(!util.key32Re.test(%s))", ref) ("return%j", invalid(field, "integer key")); break; case "int64": case "uint64": case "sint64": case "fixed64": case "sfixed64": gen ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not ("return%j", invalid(field, "integer|Long key")); break; case "bool": gen ("if(!util.key2Re.test(%s))", ref) ("return%j", invalid(field, "boolean key")); break; } return gen; /* eslint-enable no-unexpected-multiline */ } /** * Generates a verifier specific to the specified message type. * @param {Type} mtype Message type * @returns {Codegen} Codegen instance */ function verifier(mtype) { /* eslint-disable no-unexpected-multiline */ var gen = util.codegen(["m"], mtype.name + "$verify") ("if(typeof m!==\"object\"||m===null)") ("return%j", "object expected"); var oneofs = mtype.oneofsArray, seenFirstField = {}; if (oneofs.length) gen ("var p={}"); for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { var field = mtype._fieldsArray[i].resolve(), ref = "m" + util.safeProp(field.name); if (field.optional) gen ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null // map fields if (field.map) { gen ("if(!util.isObject(%s))", ref) ("return%j", invalid(field, "object")) ("var k=Object.keys(%s)", ref) ("for(var i=0;i { "use strict"; /** * Wrappers for common types. * @type {Object.} * @const */ var wrappers = exports; var Message = __webpack_require__(68027); /** * From object converter part of an {@link IWrapper}. * @typedef WrapperFromObjectConverter * @type {function} * @param {Object.} object Plain object * @returns {Message<{}>} Message instance * @this Type */ /** * To object converter part of an {@link IWrapper}. * @typedef WrapperToObjectConverter * @type {function} * @param {Message<{}>} message Message instance * @param {IConversionOptions} [options] Conversion options * @returns {Object.} Plain object * @this Type */ /** * Common type wrapper part of {@link wrappers}. * @interface IWrapper * @property {WrapperFromObjectConverter} [fromObject] From object converter * @property {WrapperToObjectConverter} [toObject] To object converter */ // Custom wrapper for Any wrappers[".google.protobuf.Any"] = { fromObject: function(object) { // unwrap value type if mapped if (object && object["@type"]) { // Only use fully qualified type name after the last '/' var name = object["@type"].substring(object["@type"].lastIndexOf("/") + 1); var type = this.lookup(name); /* istanbul ignore else */ if (type) { // type_url does not accept leading "." var type_url = object["@type"].charAt(0) === "." ? object["@type"].substr(1) : object["@type"]; // type_url prefix is optional, but path seperator is required if (type_url.indexOf("/") === -1) { type_url = "/" + type_url; } return this.create({ type_url: type_url, value: type.encode(type.fromObject(object)).finish() }); } } return this.fromObject(object); }, toObject: function(message, options) { // Default prefix var googleApi = "type.googleapis.com/"; var prefix = ""; var name = ""; // decode value if requested and unmapped if (options && options.json && message.type_url && message.value) { // Only use fully qualified type name after the last '/' name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); // Separate the prefix used prefix = message.type_url.substring(0, message.type_url.lastIndexOf("/") + 1); var type = this.lookup(name); /* istanbul ignore else */ if (type) message = type.decode(message.value); } // wrap value if unmapped if (!(message instanceof this.ctor) && message instanceof Message) { var object = message.$type.toObject(message, options); var messageName = message.$type.fullName[0] === "." ? message.$type.fullName.substr(1) : message.$type.fullName; // Default to type.googleapis.com prefix if no prefix is used if (prefix === "") { prefix = googleApi; } name = prefix + messageName; object["@type"] = name; return object; } return this.toObject(message, options); } }; /***/ }), /***/ 13098: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Writer; var util = __webpack_require__(71241); var BufferWriter; // cyclic var LongBits = util.LongBits, base64 = util.base64, utf8 = util.utf8; /** * Constructs a new writer operation instance. * @classdesc Scheduled writer operation. * @constructor * @param {function(*, Uint8Array, number)} fn Function to call * @param {number} len Value byte length * @param {*} val Value to write * @ignore */ function Op(fn, len, val) { /** * Function to call. * @type {function(Uint8Array, number, *)} */ this.fn = fn; /** * Value byte length. * @type {number} */ this.len = len; /** * Next operation. * @type {Writer.Op|undefined} */ this.next = undefined; /** * Value to write. * @type {*} */ this.val = val; // type varies } /* istanbul ignore next */ function noop() {} // eslint-disable-line no-empty-function /** * Constructs a new writer state instance. * @classdesc Copied writer state. * @memberof Writer * @constructor * @param {Writer} writer Writer to copy state from * @ignore */ function State(writer) { /** * Current head. * @type {Writer.Op} */ this.head = writer.head; /** * Current tail. * @type {Writer.Op} */ this.tail = writer.tail; /** * Current buffer length. * @type {number} */ this.len = writer.len; /** * Next state. * @type {State|null} */ this.next = writer.states; } /** * Constructs a new writer instance. * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. * @constructor */ function Writer() { /** * Current length. * @type {number} */ this.len = 0; /** * Operations head. * @type {Object} */ this.head = new Op(noop, 0, 0); /** * Operations tail * @type {Object} */ this.tail = this.head; /** * Linked forked states. * @type {Object|null} */ this.states = null; // When a value is written, the writer calculates its byte length and puts it into a linked // list of operations to perform when finish() is called. This both allows us to allocate // buffers of the exact required size and reduces the amount of work we have to do compared // to first calculating over objects and then encoding over objects. In our case, the encoding // part is just a linked list walk calling operations with already prepared values. } var create = function create() { return util.Buffer ? function create_buffer_setup() { return (Writer.create = function create_buffer() { return new BufferWriter(); })(); } /* istanbul ignore next */ : function create_array() { return new Writer(); }; }; /** * Creates a new writer. * @function * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} */ Writer.create = create(); /** * Allocates a buffer of the specified size. * @param {number} size Buffer size * @returns {Uint8Array} Buffer */ Writer.alloc = function alloc(size) { return new util.Array(size); }; // Use Uint8Array buffer pool in the browser, just like node does with buffers /* istanbul ignore else */ if (util.Array !== Array) Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); /** * Pushes a new operation to the queue. * @param {function(Uint8Array, number, *)} fn Function to call * @param {number} len Value byte length * @param {number} val Value to write * @returns {Writer} `this` * @private */ Writer.prototype._push = function push(fn, len, val) { this.tail = this.tail.next = new Op(fn, len, val); this.len += len; return this; }; function writeByte(val, buf, pos) { buf[pos] = val & 255; } function writeVarint32(val, buf, pos) { while (val > 127) { buf[pos++] = val & 127 | 128; val >>>= 7; } buf[pos] = val; } /** * Constructs a new varint writer operation instance. * @classdesc Scheduled varint writer operation. * @extends Op * @constructor * @param {number} len Value byte length * @param {number} val Value to write * @ignore */ function VarintOp(len, val) { this.len = len; this.next = undefined; this.val = val; } VarintOp.prototype = Object.create(Op.prototype); VarintOp.prototype.fn = writeVarint32; /** * Writes an unsigned 32 bit value as a varint. * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.uint32 = function write_uint32(value) { // here, the call to this.push has been inlined and a varint specific Op subclass is used. // uint32 is by far the most frequently used operation and benefits significantly from this. this.len += (this.tail = this.tail.next = new VarintOp( (value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, value)).len; return this; }; /** * Writes a signed 32 bit value as a varint. * @function * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.int32 = function write_int32(value) { return value < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec : this.uint32(value); }; /** * Writes a 32 bit value as a varint, zig-zag encoded. * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.sint32 = function write_sint32(value) { return this.uint32((value << 1 ^ value >> 31) >>> 0); }; function writeVarint64(val, buf, pos) { while (val.hi) { buf[pos++] = val.lo & 127 | 128; val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; val.hi >>>= 7; } while (val.lo > 127) { buf[pos++] = val.lo & 127 | 128; val.lo = val.lo >>> 7; } buf[pos++] = val.lo; } /** * Writes an unsigned 64 bit value as a varint. * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.uint64 = function write_uint64(value) { var bits = LongBits.from(value); return this._push(writeVarint64, bits.length(), bits); }; /** * Writes a signed 64 bit value as a varint. * @function * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.int64 = Writer.prototype.uint64; /** * Writes a signed 64 bit value as a varint, zig-zag encoded. * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.sint64 = function write_sint64(value) { var bits = LongBits.from(value).zzEncode(); return this._push(writeVarint64, bits.length(), bits); }; /** * Writes a boolish value as a varint. * @param {boolean} value Value to write * @returns {Writer} `this` */ Writer.prototype.bool = function write_bool(value) { return this._push(writeByte, 1, value ? 1 : 0); }; function writeFixed32(val, buf, pos) { buf[pos ] = val & 255; buf[pos + 1] = val >>> 8 & 255; buf[pos + 2] = val >>> 16 & 255; buf[pos + 3] = val >>> 24; } /** * Writes an unsigned 32 bit value as fixed 32 bits. * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.fixed32 = function write_fixed32(value) { return this._push(writeFixed32, 4, value >>> 0); }; /** * Writes a signed 32 bit value as fixed 32 bits. * @function * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.sfixed32 = Writer.prototype.fixed32; /** * Writes an unsigned 64 bit value as fixed 64 bits. * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.fixed64 = function write_fixed64(value) { var bits = LongBits.from(value); return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); }; /** * Writes a signed 64 bit value as fixed 64 bits. * @function * @param {Long|number|string} value Value to write * @returns {Writer} `this` * @throws {TypeError} If `value` is a string and no long library is present. */ Writer.prototype.sfixed64 = Writer.prototype.fixed64; /** * Writes a float (32 bit). * @function * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.float = function write_float(value) { return this._push(util.float.writeFloatLE, 4, value); }; /** * Writes a double (64 bit float). * @function * @param {number} value Value to write * @returns {Writer} `this` */ Writer.prototype.double = function write_double(value) { return this._push(util.float.writeDoubleLE, 8, value); }; var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) { buf.set(val, pos); // also works for plain array values } /* istanbul ignore next */ : function writeBytes_for(val, buf, pos) { for (var i = 0; i < val.length; ++i) buf[pos + i] = val[i]; }; /** * Writes a sequence of bytes. * @param {Uint8Array|string} value Buffer or base64 encoded string to write * @returns {Writer} `this` */ Writer.prototype.bytes = function write_bytes(value) { var len = value.length >>> 0; if (!len) return this._push(writeByte, 1, 0); if (util.isString(value)) { var buf = Writer.alloc(len = base64.length(value)); base64.decode(value, buf, 0); value = buf; } return this.uint32(len)._push(writeBytes, len, value); }; /** * Writes a string. * @param {string} value Value to write * @returns {Writer} `this` */ Writer.prototype.string = function write_string(value) { var len = utf8.length(value); return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0); }; /** * Forks this writer's state by pushing it to a stack. * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. * @returns {Writer} `this` */ Writer.prototype.fork = function fork() { this.states = new State(this); this.head = this.tail = new Op(noop, 0, 0); this.len = 0; return this; }; /** * Resets this instance to the last state. * @returns {Writer} `this` */ Writer.prototype.reset = function reset() { if (this.states) { this.head = this.states.head; this.tail = this.states.tail; this.len = this.states.len; this.states = this.states.next; } else { this.head = this.tail = new Op(noop, 0, 0); this.len = 0; } return this; }; /** * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. * @returns {Writer} `this` */ Writer.prototype.ldelim = function ldelim() { var head = this.head, tail = this.tail, len = this.len; this.reset().uint32(len); if (len) { this.tail.next = head.next; // skip noop this.tail = tail; this.len += len; } return this; }; /** * Finishes the write operation. * @returns {Uint8Array} Finished buffer */ Writer.prototype.finish = function finish() { var head = this.head.next, // skip noop buf = this.constructor.alloc(this.len), pos = 0; while (head) { head.fn(head.val, buf, pos); pos += head.len; head = head.next; } // this.head = this.tail = null; return buf; }; Writer._configure = function(BufferWriter_) { BufferWriter = BufferWriter_; Writer.create = create(); BufferWriter._configure(); }; /***/ }), /***/ 41863: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = BufferWriter; // extends Writer var Writer = __webpack_require__(13098); (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; var util = __webpack_require__(71241); /** * Constructs a new buffer writer instance. * @classdesc Wire format writer using node buffers. * @extends Writer * @constructor */ function BufferWriter() { Writer.call(this); } BufferWriter._configure = function () { /** * Allocates a buffer of the specified size. * @function * @param {number} size Buffer size * @returns {Buffer} Buffer */ BufferWriter.alloc = util._Buffer_allocUnsafe; BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) // also works for plain array values } /* istanbul ignore next */ : function writeBytesBuffer_copy(val, buf, pos) { if (val.copy) // Buffer values val.copy(buf, pos, 0, val.length); else for (var i = 0; i < val.length;) // plain array values buf[pos++] = val[i++]; }; }; /** * @override */ BufferWriter.prototype.bytes = function write_bytes_buffer(value) { if (util.isString(value)) value = util._Buffer_from(value, "base64"); var len = value.length >>> 0; this.uint32(len); if (len) this._push(BufferWriter.writeBytesBuffer, len, value); return this; }; function writeStringBuffer(val, buf, pos) { if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) util.utf8.write(val, buf, pos); else if (buf.utf8Write) buf.utf8Write(val, pos); else buf.write(val, pos); } /** * @override */ BufferWriter.prototype.string = function write_string_buffer(value) { var len = util.Buffer.byteLength(value); this.uint32(len); if (len) this._push(writeStringBuffer, len, value); return this; }; /** * Finishes the write operation. * @name BufferWriter#finish * @function * @returns {Buffer} Finished buffer */ BufferWriter._configure(); /***/ }), /***/ 29975: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */ var Punycode = __webpack_require__(94213); var internals = {}; // // Read rules from file. // internals.rules = __webpack_require__(2156).map(function (rule) { return { rule: rule, suffix: rule.replace(/^(\*\.|\!)/, ''), punySuffix: -1, wildcard: rule.charAt(0) === '*', exception: rule.charAt(0) === '!' }; }); // // Check is given string ends with `suffix`. // internals.endsWith = function (str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; }; // // Find rule for a given domain. // internals.findRule = function (domain) { var punyDomain = Punycode.toASCII(domain); return internals.rules.reduce(function (memo, rule) { if (rule.punySuffix === -1){ rule.punySuffix = Punycode.toASCII(rule.suffix); } if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) { return memo; } // This has been commented out as it never seems to run. This is because // sub tlds always appear after their parents and we never find a shorter // match. //if (memo) { // var memoSuffix = Punycode.toASCII(memo.suffix); // if (memoSuffix.length >= punySuffix.length) { // return memo; // } //} return rule; }, null); }; // // Error codes and messages. // exports.errorCodes = { DOMAIN_TOO_SHORT: 'Domain name too short.', DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.', LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.', LABEL_ENDS_WITH_DASH: 'Domain name label can not end with a dash.', LABEL_TOO_LONG: 'Domain name label should be at most 63 chars long.', LABEL_TOO_SHORT: 'Domain name label should be at least 1 character long.', LABEL_INVALID_CHARS: 'Domain name label can only contain alphanumeric characters or dashes.' }; // // Validate domain name and throw if not valid. // // From wikipedia: // // Hostnames are composed of series of labels concatenated with dots, as are all // domain names. Each label must be between 1 and 63 characters long, and the // entire hostname (including the delimiting dots) has a maximum of 255 chars. // // Allowed chars: // // * `a-z` // * `0-9` // * `-` but not as a starting or ending character // * `.` as a separator for the textual portions of a domain name // // * http://en.wikipedia.org/wiki/Domain_name // * http://en.wikipedia.org/wiki/Hostname // internals.validate = function (input) { // Before we can validate we need to take care of IDNs with unicode chars. var ascii = Punycode.toASCII(input); if (ascii.length < 1) { return 'DOMAIN_TOO_SHORT'; } if (ascii.length > 255) { return 'DOMAIN_TOO_LONG'; } // Check each part's length and allowed chars. var labels = ascii.split('.'); var label; for (var i = 0; i < labels.length; ++i) { label = labels[i]; if (!label.length) { return 'LABEL_TOO_SHORT'; } if (label.length > 63) { return 'LABEL_TOO_LONG'; } if (label.charAt(0) === '-') { return 'LABEL_STARTS_WITH_DASH'; } if (label.charAt(label.length - 1) === '-') { return 'LABEL_ENDS_WITH_DASH'; } if (!/^[a-z0-9\-]+$/.test(label)) { return 'LABEL_INVALID_CHARS'; } } }; // // Public API // // // Parse domain. // exports.parse = function (input) { if (typeof input !== 'string') { throw new TypeError('Domain name must be a string.'); } // Force domain to lowercase. var domain = input.slice(0).toLowerCase(); // Handle FQDN. // TODO: Simply remove trailing dot? if (domain.charAt(domain.length - 1) === '.') { domain = domain.slice(0, domain.length - 1); } // Validate and sanitise input. var error = internals.validate(domain); if (error) { return { input: input, error: { message: exports.errorCodes[error], code: error } }; } var parsed = { input: input, tld: null, sld: null, domain: null, subdomain: null, listed: false }; var domainParts = domain.split('.'); // Non-Internet TLD if (domainParts[domainParts.length - 1] === 'local') { return parsed; } var handlePunycode = function () { if (!/xn--/.test(domain)) { return parsed; } if (parsed.domain) { parsed.domain = Punycode.toASCII(parsed.domain); } if (parsed.subdomain) { parsed.subdomain = Punycode.toASCII(parsed.subdomain); } return parsed; }; var rule = internals.findRule(domain); // Unlisted tld. if (!rule) { if (domainParts.length < 2) { return parsed; } parsed.tld = domainParts.pop(); parsed.sld = domainParts.pop(); parsed.domain = [parsed.sld, parsed.tld].join('.'); if (domainParts.length) { parsed.subdomain = domainParts.pop(); } return handlePunycode(); } // At this point we know the public suffix is listed. parsed.listed = true; var tldParts = rule.suffix.split('.'); var privateParts = domainParts.slice(0, domainParts.length - tldParts.length); if (rule.exception) { privateParts.push(tldParts.shift()); } parsed.tld = tldParts.join('.'); if (!privateParts.length) { return handlePunycode(); } if (rule.wildcard) { tldParts.unshift(privateParts.pop()); parsed.tld = tldParts.join('.'); } if (!privateParts.length) { return handlePunycode(); } parsed.sld = privateParts.pop(); parsed.domain = [parsed.sld, parsed.tld].join('.'); if (privateParts.length) { parsed.subdomain = privateParts.join('.'); } return handlePunycode(); }; // // Get domain. // exports.get = function (domain) { if (!domain) { return null; } return exports.parse(domain).domain || null; }; // // Check whether domain belongs to a known public suffix. // exports.isValid = function (domain) { var parsed = exports.parse(domain); return Boolean(parsed.domain && parsed.listed); }; /***/ }), /***/ 18341: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var once = __webpack_require__(1223) var eos = __webpack_require__(81205) var fs = __webpack_require__(35747) // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} var ancient = /^v?\.0/.test(process.version) var isFn = function (fn) { return typeof fn === 'function' } var isFS = function (stream) { if (!ancient) return false // newer node version do not need to care about fs is a special way if (!fs) return false // browser return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) } var isRequest = function (stream) { return stream.setHeader && isFn(stream.abort) } var destroyer = function (stream, reading, writing, callback) { callback = once(callback) var closed = false stream.on('close', function () { closed = true }) eos(stream, {readable: reading, writable: writing}, function (err) { if (err) return callback(err) closed = true callback() }) var destroyed = false return function (err) { if (closed) return if (destroyed) return destroyed = true if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want if (isFn(stream.destroy)) return stream.destroy() callback(err || new Error('stream was destroyed')) } } var call = function (fn) { fn() } var pipe = function (from, to) { return from.pipe(to) } var pump = function () { var streams = Array.prototype.slice.call(arguments) var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop if (Array.isArray(streams[0])) streams = streams[0] if (streams.length < 2) throw new Error('pump requires two streams per minimum') var error var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1 var writing = i > 0 return destroyer(stream, reading, writing, function (err) { if (!error) error = err if (err) destroys.forEach(call) if (reading) return destroys.forEach(call) callback(error) }) }) return streams.reduce(pipe) } module.exports = pump /***/ }), /***/ 40212: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var pump = __webpack_require__(18341) var inherits = __webpack_require__(44124) var Duplexify = __webpack_require__(76599) var toArray = function(args) { if (!args.length) return [] return Array.isArray(args[0]) ? args[0] : Array.prototype.slice.call(args) } var define = function(opts) { var Pumpify = function() { var streams = toArray(arguments) if (!(this instanceof Pumpify)) return new Pumpify(streams) Duplexify.call(this, null, null, opts) if (streams.length) this.setPipeline(streams) } inherits(Pumpify, Duplexify) Pumpify.prototype.setPipeline = function() { var streams = toArray(arguments) var self = this var ended = false var w = streams[0] var r = streams[streams.length-1] r = r.readable ? r : null w = w.writable ? w : null var onclose = function() { streams[0].emit('error', new Error('stream was destroyed')) } this.on('close', onclose) this.on('prefinish', function() { if (!ended) self.cork() }) pump(streams, function(err) { self.removeListener('close', onclose) if (err) return self.destroy(err.message === 'premature close' ? null : err) ended = true // pump ends after the last stream is not writable *but* // pumpify still forwards the readable part so we need to catch errors // still, so reenable autoDestroy in this case if (self._autoDestroy === false) self._autoDestroy = true self.uncork() }) if (this.destroyed) return onclose() this.setWritable(w) this.setReadable(r) } return Pumpify } module.exports = define({autoDestroy:false, destroy:false}) module.exports.obj = define({autoDestroy: false, destroy:false, objectMode:true, highWaterMark:16}) module.exports.ctor = define /***/ }), /***/ 49273: /***/ ((module) => { "use strict"; class QuickLRU { constructor(options = {}) { if (!(options.maxSize && options.maxSize > 0)) { throw new TypeError('`maxSize` must be a number greater than 0'); } this.maxSize = options.maxSize; this.onEviction = options.onEviction; this.cache = new Map(); this.oldCache = new Map(); this._size = 0; } _set(key, value) { this.cache.set(key, value); this._size++; if (this._size >= this.maxSize) { this._size = 0; if (typeof this.onEviction === 'function') { for (const [key, value] of this.oldCache.entries()) { this.onEviction(key, value); } } this.oldCache = this.cache; this.cache = new Map(); } } get(key) { if (this.cache.has(key)) { return this.cache.get(key); } if (this.oldCache.has(key)) { const value = this.oldCache.get(key); this.oldCache.delete(key); this._set(key, value); return value; } } set(key, value) { if (this.cache.has(key)) { this.cache.set(key, value); } else { this._set(key, value); } return this; } has(key) { return this.cache.has(key) || this.oldCache.has(key); } peek(key) { if (this.cache.has(key)) { return this.cache.get(key); } if (this.oldCache.has(key)) { return this.oldCache.get(key); } } delete(key) { const deleted = this.cache.delete(key); if (deleted) { this._size--; } return this.oldCache.delete(key) || deleted; } clear() { this.cache.clear(); this.oldCache.clear(); this._size = 0; } * keys() { for (const [key] of this) { yield key; } } * values() { for (const [, value] of this) { yield value; } } * [Symbol.iterator]() { for (const item of this.cache) { yield item; } for (const item of this.oldCache) { const [key] = item; if (!this.cache.has(key)) { yield item; } } } get size() { let oldCacheSize = 0; for (const key of this.oldCache.keys()) { if (!this.cache.has(key)) { oldCacheSize++; } } return Math.min(this._size + oldCacheSize, this.maxSize); } } module.exports = QuickLRU; /***/ }), /***/ 67214: /***/ ((module) => { "use strict"; const codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error } function getMessage (arg1, arg2, arg3) { if (typeof message === 'string') { return message } else { return message(arg1, arg2, arg3) } } class NodeError extends Base { constructor (arg1, arg2, arg3) { super(getMessage(arg1, arg2, arg3)); } } NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { const len = expected.length; expected = expected.map((i) => String(i)); if (len > 2) { return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + expected[len - 1]; } else if (len === 2) { return `one of ${thing} ${expected[0]} or ${expected[1]}`; } else { return `of ${thing} ${expected[0]}`; } } else { return `of ${thing} ${String(expected)}`; } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"' }, TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { // determiner: 'must be' or 'must not be' let determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } let msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; } else { const type = includes(name, '.') ? 'property' : 'argument'; msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; } msg += `. Received type ${typeof actual}`; return msg; }, TypeError); createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { return 'The ' + name + ' method is not implemented' }); createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); createErrorType('ERR_STREAM_DESTROYED', function (name) { return 'Cannot call ' + name + ' after a stream was destroyed'; }); createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { return 'Unknown encoding: ' + arg }, TypeError); createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.q = codes; /***/ }), /***/ 45375: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. /**/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { keys.push(key); } return keys; }; /**/ module.exports = Duplex; var Readable = __webpack_require__(51433); var Writable = __webpack_require__(26993); __webpack_require__(44124)(Duplex, Readable); { // Allow the keys array to be GC'ed. var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); this.allowHalfOpen = true; if (options) { if (options.readable === false) this.readable = false; if (options.writable === false) this.writable = false; if (options.allowHalfOpen === false) { this.allowHalfOpen = false; this.once('end', onend); } } } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); Object.defineProperty(Duplex.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(Duplex.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); // the no-half-open enforcer function onend() { // If the writable side ended, then we're ok. if (this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. process.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } }); /***/ }), /***/ 81542: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. module.exports = PassThrough; var Transform = __webpack_require__(34415); __webpack_require__(44124)(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; /***/ }), /***/ 51433: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. module.exports = Readable; /**/ var Duplex; /**/ Readable.ReadableState = ReadableState; /**/ var EE = __webpack_require__(28614).EventEmitter; var EElistenerCount = function EElistenerCount(emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream = __webpack_require__(62387); /**/ var Buffer = __webpack_require__(64293).Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ var debugUtil = __webpack_require__(31669); var debug; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function debug() {}; } /**/ var BufferList = __webpack_require__(52746); var destroyImpl = __webpack_require__(97049); var _require = __webpack_require__(39948), getHighWaterMark = _require.getHighWaterMark; var _require$codes = __webpack_require__(67214)/* .codes */ .q, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. var StringDecoder; var createReadableStreamAsyncIterator; var from; __webpack_require__(44124)(Readable, Stream); var errorOrDestroy = destroyImpl.errorOrDestroy; var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream, isDuplex) { Duplex = Duplex || __webpack_require__(45375); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') this.autoDestroy = !!options.autoDestroy; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = __webpack_require__(94841)/* .StringDecoder */ .s; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || __webpack_require__(45375); if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside // the ReadableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; this._readableState = new ReadableState(options, this, isDuplex); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { debug('readableAddChunk', chunk); var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { errorOrDestroy(stream, er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); } else if (state.ended) { errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state.destroyed) { return false; } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; maybeReadMore(stream, state); } } // We can push more data if we are below the highWaterMark. // Also, if we have no data yet, we can stand some more bytes. // This is to work around cases where hwm=0, such as the repl. return !state.ended && (state.length < state.highWaterMark || state.length === 0); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { state.awaitDrain = 0; stream.emit('data', chunk); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); } return er; } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = __webpack_require__(94841)/* .StringDecoder */ .s; var decoder = new StringDecoder(enc); this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: var p = this._readableState.buffer.head; var content = ''; while (p !== null) { content += decoder.write(p.data); p = p.next; } this._readableState.buffer.clear(); if (content !== '') this._readableState.buffer.push(content); this._readableState.length = content.length; return this; }; // Don't raise the hwm > 1GB var MAX_HWM = 0x40000000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = state.length <= state.highWaterMark; n = 0; } else { state.length -= n; state.awaitDrain = 0; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { debug('onEofChunk'); if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; if (state.sync) { // if we are sync, wait until next tick to emit the data. // Otherwise we risk emitting data in the flow() // the readable code triggers during a read() call emitReadable(stream); } else { // emit 'readable' now to make sure it gets picked up. state.needReadable = false; if (!state.emittedReadable) { state.emittedReadable = true; emitReadable_(stream); } } } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } } function emitReadable_(stream) { var state = stream._readableState; debug('emitReadable_', state.destroyed, state.length, state.ended); if (!state.destroyed && (state.length || state.ended)) { stream.emit('readable'); state.emittedReadable = false; } // The stream needs another readable event if // 1. It is not flowing, as the flow mechanism will take // care of it. // 2. It is not ended. // 3. It is below the highWaterMark, so we can schedule // another readable later. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { // Attempt to read more data if we should. // // The conditions for reading more data are (one of): // - Not enough data buffered (state.length < state.highWaterMark). The loop // is responsible for filling the buffer with enough data if such data // is available. If highWaterMark is 0 and we are not in the flowing mode // we should _not_ attempt to buffer any extra data. We'll get more data // when the stream consumer calls read() instead. // - No data in the buffer, and the stream is in flowing mode. In this mode // the loop below is responsible for ensuring read() is called. Failing to // call read here would abort the flow and there's no other mechanism for // continuing the flow if the stream consumer has just subscribed to the // 'data' event. // // In addition to the above conditions to keep reading data, the following // conditions prevent the data from being read: // - The stream has ended (state.ended). // - There is already a pending 'read' operation (state.reading). This is a // case where the the stream has called the implementation defined _read() // method, but they are processing the call asynchronously and have _not_ // called push() with new data. In this case we skip performing more // read()s. The execution ends in this method again after the _read() ends // up calling push() with more data. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { var len = state.length; debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); function ondata(chunk) { debug('ondata'); var ret = dest.write(chunk); debug('dest.write', ret); if (ret === false) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function pipeOnDrainFunctionResult() { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit('unpipe', this, { hasUnpiped: false }); } return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); var state = this._readableState; if (ev === 'data') { // update readableListening so that resume() may be a no-op // a few lines down. This is needed to support once('readable'). state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused if (state.flowing !== false) this.resume(); } else if (ev === 'readable') { if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.flowing = false; state.emittedReadable = false; debug('on readable', state.length, state.reading); if (state.length) { emitReadable(this); } else if (!state.reading) { process.nextTick(nReadingNextTick, this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.removeListener = function (ev, fn) { var res = Stream.prototype.removeListener.call(this, ev, fn); if (ev === 'readable') { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; Readable.prototype.removeAllListeners = function (ev) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev === 'readable' || ev === undefined) { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; function updateReadableListening(self) { var state = self._readableState; state.readableListening = self.listenerCount('readable') > 0; if (state.resumeScheduled && !state.paused) { // flowing needs to be set to true now, otherwise // the upcoming resume will not flow. state.flowing = true; // crude way to check if we should resume } else if (self.listenerCount('data') > 0) { self.resume(); } } function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); // we flow only if there is no one listening // for readable, but we still have to call // resume() state.flowing = !state.readableListening; resume(this, state); } state.paused = false; return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; process.nextTick(resume_, stream, state); } } function resume_(stream, state) { debug('resume', state.reading); if (!state.reading) { stream.read(0); } state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (this._readableState.flowing !== false) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } this._readableState.paused = true; return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null) { ; } } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function methodWrap(method) { return function methodWrapReturnFunction() { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; if (typeof Symbol === 'function') { Readable.prototype[Symbol.asyncIterator] = function () { if (createReadableStreamAsyncIterator === undefined) { createReadableStreamAsyncIterator = __webpack_require__(43306); } return createReadableStreamAsyncIterator(this); }; } Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.highWaterMark; } }); Object.defineProperty(Readable.prototype, 'readableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(Readable.prototype, 'readableFlowing', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.flowing; }, set: function set(state) { if (this._readableState) { this._readableState.flowing = state; } } }); // exposed for testing purposes only. Readable._fromList = fromList; Object.defineProperty(Readable.prototype, 'readableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.length; } }); // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = state.buffer.consume(n, state.decoder); } return ret; } function endReadable(stream) { var state = stream._readableState; debug('endReadable', state.endEmitted); if (!state.endEmitted) { state.ended = true; process.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the writable side is ready for autoDestroy as well var wState = stream._writableState; if (!wState || wState.autoDestroy && wState.finished) { stream.destroy(); } } } } if (typeof Symbol === 'function') { Readable.from = function (iterable, opts) { if (from === undefined) { from = __webpack_require__(39082); } return from(Readable, iterable, opts); }; } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } /***/ }), /***/ 34415: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. module.exports = Transform; var _require$codes = __webpack_require__(67214)/* .codes */ .q, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; var Duplex = __webpack_require__(45375); __webpack_require__(44124)(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (cb === null) { return this.emit('error', new ERR_MULTIPLE_CALLBACK()); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function' && !this._readableState.destroyed) { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // TODO(BridgeAR): Write a test for these two error cases // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } /***/ }), /***/ 26993: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. module.exports = Writable; /* */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* */ /**/ var Duplex; /**/ Writable.WritableState = WritableState; /**/ var internalUtil = { deprecate: __webpack_require__(65278) }; /**/ /**/ var Stream = __webpack_require__(62387); /**/ var Buffer = __webpack_require__(64293).Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = __webpack_require__(97049); var _require = __webpack_require__(39948), getHighWaterMark = _require.getHighWaterMark; var _require$codes = __webpack_require__(67214)/* .codes */ .q, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; var errorOrDestroy = destroyImpl.errorOrDestroy; __webpack_require__(44124)(Writable, Stream); function nop() {} function WritableState(options, stream, isDuplex) { Duplex = Duplex || __webpack_require__(45375); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream, // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') this.autoDestroy = !!options.autoDestroy; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function writableStateBufferGetter() { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || __webpack_require__(45375); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. // Checking for a Stream.Duplex instance is faster here instead of inside // the WritableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function writeAfterEnd(stream, cb) { var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb errorOrDestroy(stream, er); process.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { errorOrDestroy(stream, er); process.nextTick(cb, er); return false; } return true; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { this._writableState.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; Object.defineProperty(Writable.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack process.nextTick(cb, er); // this can emit finish, and it will always happen // after error process.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state) || stream.destroyed; if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { process.nextTick(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); return this; }; Object.defineProperty(Writable.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { errorOrDestroy(stream, err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function' && !state.destroyed) { state.pendingcb++; state.finalCalled = true; process.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the readable side is ready for autoDestroy as well var rState = stream._readableState; if (!rState || rState.autoDestroy && rState.endEmitted) { stream.destroy(); } } } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } // reuse the free corkReq. state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { cb(err); }; /***/ }), /***/ 43306: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var finished = __webpack_require__(76080); var kLastResolve = Symbol('lastResolve'); var kLastReject = Symbol('lastReject'); var kError = Symbol('error'); var kEnded = Symbol('ended'); var kLastPromise = Symbol('lastPromise'); var kHandlePromise = Symbol('handlePromise'); var kStream = Symbol('stream'); function createIterResult(value, done) { return { value: value, done: done }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (resolve !== null) { var data = iter[kStream].read(); // we defer if data is null // we can be expecting either 'end' or // 'error' if (data !== null) { iter[kLastPromise] = null; iter[kLastResolve] = null; iter[kLastReject] = null; resolve(createIterResult(data, false)); } } } function onReadable(iter) { // we wait for the next tick, because it might // emit an error with process.nextTick process.nextTick(readAndResolve, iter); } function wrapForNext(lastPromise, iter) { return function (resolve, reject) { lastPromise.then(function () { if (iter[kEnded]) { resolve(createIterResult(undefined, true)); return; } iter[kHandlePromise](resolve, reject); }, reject); }; } var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function next() { var _this = this; // if we have detected an error in the meanwhile // reject straight away var error = this[kError]; if (error !== null) { return Promise.reject(error); } if (this[kEnded]) { return Promise.resolve(createIterResult(undefined, true)); } if (this[kStream].destroyed) { // We need to defer via nextTick because if .destroy(err) is // called, the error will be emitted via nextTick, and // we cannot guarantee that there is no error lingering around // waiting to be emitted. return new Promise(function (resolve, reject) { process.nextTick(function () { if (_this[kError]) { reject(_this[kError]); } else { resolve(createIterResult(undefined, true)); } }); }); } // if we have multiple next() calls // we will wait for the previous Promise to finish // this logic is optimized to support for await loops, // where next() is only called once at a time var lastPromise = this[kLastPromise]; var promise; if (lastPromise) { promise = new Promise(wrapForNext(lastPromise, this)); } else { // fast path needed to support multiple this.push() // without triggering the next() queue var data = this[kStream].read(); if (data !== null) { return Promise.resolve(createIterResult(data, false)); } promise = new Promise(this[kHandlePromise]); } this[kLastPromise] = promise; return promise; } }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { return this; }), _defineProperty(_Object$setPrototypeO, "return", function _return() { var _this2 = this; // destroy(err, cb) is a private API // we can guarantee we have that here, because we control the // Readable class this is attached to return new Promise(function (resolve, reject) { _this2[kStream].destroy(null, function (err) { if (err) { reject(err); return; } resolve(createIterResult(undefined, true)); }); }); }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { var _Object$create; var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream, writable: true }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: true }), _defineProperty(_Object$create, kLastReject, { value: null, writable: true }), _defineProperty(_Object$create, kError, { value: null, writable: true }), _defineProperty(_Object$create, kEnded, { value: stream._readableState.endEmitted, writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { var data = iterator[kStream].read(); if (data) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(data, false)); } else { iterator[kLastResolve] = resolve; iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); iterator[kLastPromise] = null; finished(stream, function (err) { if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise // returned by next() and store the error if (reject !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; reject(err); } iterator[kError] = err; return; } var resolve = iterator[kLastResolve]; if (resolve !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(undefined, true)); } iterator[kEnded] = true; }); stream.on('readable', onReadable.bind(null, iterator)); return iterator; }; module.exports = createReadableStreamAsyncIterator; /***/ }), /***/ 52746: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var _require = __webpack_require__(64293), Buffer = _require.Buffer; var _require2 = __webpack_require__(31669), inspect = _require2.inspect; var custom = inspect && inspect.custom || 'inspect'; function copyBuffer(src, target, offset) { Buffer.prototype.copy.call(src, target, offset); } module.exports = /*#__PURE__*/ function () { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } _createClass(BufferList, [{ key: "push", value: function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; } }, { key: "unshift", value: function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; } }, { key: "shift", value: function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; } }, { key: "clear", value: function clear() { this.head = this.tail = null; this.length = 0; } }, { key: "join", value: function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) { ret += s + p.data; } return ret; } }, { key: "concat", value: function concat(n) { if (this.length === 0) return Buffer.alloc(0); var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. }, { key: "consume", value: function consume(n, hasStrings) { var ret; if (n < this.head.data.length) { // `slice` is the same for buffers and strings. ret = this.head.data.slice(0, n); this.head.data = this.head.data.slice(n); } else if (n === this.head.data.length) { // First chunk is a perfect match. ret = this.shift(); } else { // Result spans more than one buffer. ret = hasStrings ? this._getString(n) : this._getBuffer(n); } return ret; } }, { key: "first", value: function first() { return this.head.data; } // Consumes a specified amount of characters from the buffered data. }, { key: "_getString", value: function _getString(n) { var p = this.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = str.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Consumes a specified amount of bytes from the buffered data. }, { key: "_getBuffer", value: function _getBuffer(n) { var ret = Buffer.allocUnsafe(n); var p = this.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = buf.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Make sure the linked list only shows the minimal necessary information. }, { key: custom, value: function value(_, options) { return inspect(this, _objectSpread({}, options, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: false })); } }]); return BufferList; }(); /***/ }), /***/ 97049: /***/ ((module) => { "use strict"; // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err); } else { process.nextTick(emitCloseNT, _this); } }); return this; } function emitErrorAndCloseNT(self, err) { emitErrorNT(self, err); emitCloseNT(self); } function emitCloseNT(self) { if (self._writableState && !self._writableState.emitClose) return; if (self._readableState && !self._readableState.emitClose) return; self.emit('close'); } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } function errorOrDestroy(stream, err) { // We have tests that rely on errors being emitted // in the same tick, so changing this is semver major. // For now when you opt-in to autoDestroy we allow // the error to be emitted nextTick. In a future // semver major update we should change the default to this. var rState = stream._readableState; var wState = stream._writableState; if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy, errorOrDestroy: errorOrDestroy }; /***/ }), /***/ 76080: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(67214)/* .codes.ERR_STREAM_PREMATURE_CLOSE */ .q.ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { if (called) return; called = true; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callback.apply(this, args); }; } function noop() {} function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function eos(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var readable = opts.readable || opts.readable !== false && stream.readable; var writable = opts.writable || opts.writable !== false && stream.writable; var onlegacyfinish = function onlegacyfinish() { if (!stream.writable) onfinish(); }; var writableEnded = stream._writableState && stream._writableState.finished; var onfinish = function onfinish() { writable = false; writableEnded = true; if (!readable) callback.call(stream); }; var readableEnded = stream._readableState && stream._readableState.endEmitted; var onend = function onend() { readable = false; readableEnded = true; if (!writable) callback.call(stream); }; var onerror = function onerror(err) { callback.call(stream, err); }; var onclose = function onclose() { var err; if (readable && !readableEnded) { if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } if (writable && !writableEnded) { if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } }; var onrequest = function onrequest() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest();else stream.on('request', onrequest); } else if (writable && !stream._writableState) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function () { stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; } module.exports = eos; /***/ }), /***/ 39082: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var ERR_INVALID_ARG_TYPE = __webpack_require__(67214)/* .codes.ERR_INVALID_ARG_TYPE */ .q.ERR_INVALID_ARG_TYPE; function from(Readable, iterable, opts) { var iterator; if (iterable && typeof iterable.next === 'function') { iterator = iterable; } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); var readable = new Readable(_objectSpread({ objectMode: true }, opts)); // Reading boolean to protect against _read // being called before last iteration completion. var reading = false; readable._read = function () { if (!reading) { reading = true; next(); } }; function next() { return _next2.apply(this, arguments); } function _next2() { _next2 = _asyncToGenerator(function* () { try { var _ref = yield iterator.next(), value = _ref.value, done = _ref.done; if (done) { readable.push(null); } else if (readable.push((yield value))) { next(); } else { reading = false; } } catch (err) { readable.destroy(err); } }); return _next2.apply(this, arguments); } return readable; } module.exports = from; /***/ }), /***/ 76989: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). var eos; function once(callback) { var called = false; return function () { if (called) return; called = true; callback.apply(void 0, arguments); }; } var _require$codes = __webpack_require__(67214)/* .codes */ .q, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop(err) { // Rethrow the error if it exists to avoid swallowing it if (err) throw err; } function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function destroyer(stream, reading, writing, callback) { callback = once(callback); var closed = false; stream.on('close', function () { closed = true; }); if (eos === undefined) eos = __webpack_require__(76080); eos(stream, { readable: reading, writable: writing }, function (err) { if (err) return callback(err); closed = true; callback(); }); var destroyed = false; return function (err) { if (closed) return; if (destroyed) return; destroyed = true; // request.destroy just do .end - .abort is what we want if (isRequest(stream)) return stream.abort(); if (typeof stream.destroy === 'function') return stream.destroy(); callback(err || new ERR_STREAM_DESTROYED('pipe')); }; } function call(fn) { fn(); } function pipe(from, to) { return from.pipe(to); } function popCallback(streams) { if (!streams.length) return noop; if (typeof streams[streams.length - 1] !== 'function') return noop; return streams.pop(); } function pipeline() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } var callback = popCallback(streams); if (Array.isArray(streams[0])) streams = streams[0]; if (streams.length < 2) { throw new ERR_MISSING_ARGS('streams'); } var error; var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1; var writing = i > 0; return destroyer(stream, reading, writing, function (err) { if (!error) error = err; if (err) destroys.forEach(call); if (reading) return; destroys.forEach(call); callback(error); }); }); return streams.reduce(pipe); } module.exports = pipeline; /***/ }), /***/ 39948: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var ERR_INVALID_OPT_VALUE = __webpack_require__(67214)/* .codes.ERR_INVALID_OPT_VALUE */ .q.ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } function getHighWaterMark(state, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name = isDuplex ? duplexKey : 'highWaterMark'; throw new ERR_INVALID_OPT_VALUE(name, hwm); } return Math.floor(hwm); } // Default value return state.objectMode ? 16 : 16 * 1024; } module.exports = { getHighWaterMark: getHighWaterMark }; /***/ }), /***/ 62387: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(92413); /***/ }), /***/ 51642: /***/ ((module, exports, __webpack_require__) => { var Stream = __webpack_require__(92413); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream.Readable; Object.assign(module.exports, Stream); module.exports.Stream = Stream; } else { exports = module.exports = __webpack_require__(51433); exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = __webpack_require__(26993); exports.Duplex = __webpack_require__(45375); exports.Transform = __webpack_require__(34415); exports.PassThrough = __webpack_require__(81542); exports.finished = __webpack_require__(76080); exports.pipeline = __webpack_require__(76989); } /***/ }), /***/ 29977: /***/ (() => { /*! ***************************************************************************** Copyright (C) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var Reflect; (function (Reflect) { // Metadata Proposal // https://rbuckton.github.io/reflect-metadata/ (function (factory) { var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : Function("return this;")(); var exporter = makeExporter(Reflect); if (typeof root.Reflect === "undefined") { root.Reflect = Reflect; } else { exporter = makeExporter(root.Reflect, exporter); } factory(exporter); function makeExporter(target, previous) { return function (key, value) { if (typeof target[key] !== "function") { Object.defineProperty(target, key, { configurable: true, writable: true, value: value }); } if (previous) previous(key, value); }; } })(function (exporter) { var hasOwn = Object.prototype.hasOwnProperty; // feature test for Symbol support var supportsSymbol = typeof Symbol === "function"; var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive"; var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator"; var supportsCreate = typeof Object.create === "function"; // feature test for Object.create support var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support var downLevel = !supportsCreate && !supportsProto; var HashMap = { // create an object in dictionary mode (a.k.a. "slow" mode in v8) create: supportsCreate ? function () { return MakeDictionary(Object.create(null)); } : supportsProto ? function () { return MakeDictionary({ __proto__: null }); } : function () { return MakeDictionary({}); }, has: downLevel ? function (map, key) { return hasOwn.call(map, key); } : function (map, key) { return key in map; }, get: downLevel ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; } : function (map, key) { return map[key]; }, }; // Load global or shim versions of Map, Set, and WeakMap var functionPrototype = Object.getPrototypeOf(Function); var usePolyfill = typeof process === "object" && process.env && process.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true"; var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill(); var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill(); var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill(); // [[Metadata]] internal slot // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots var Metadata = new _WeakMap(); /** * Applies a set of decorators to a property of a target object. * @param decorators An array of decorators. * @param target The target object. * @param propertyKey (Optional) The property key to decorate. * @param attributes (Optional) The property descriptor for the target key. * @remarks Decorators are applied in reverse order. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * Example = Reflect.decorate(decoratorsArray, Example); * * // property (on constructor) * Reflect.decorate(decoratorsArray, Example, "staticProperty"); * * // property (on prototype) * Reflect.decorate(decoratorsArray, Example.prototype, "property"); * * // method (on constructor) * Object.defineProperty(Example, "staticMethod", * Reflect.decorate(decoratorsArray, Example, "staticMethod", * Object.getOwnPropertyDescriptor(Example, "staticMethod"))); * * // method (on prototype) * Object.defineProperty(Example.prototype, "method", * Reflect.decorate(decoratorsArray, Example.prototype, "method", * Object.getOwnPropertyDescriptor(Example.prototype, "method"))); * */ function decorate(decorators, target, propertyKey, attributes) { if (!IsUndefined(propertyKey)) { if (!IsArray(decorators)) throw new TypeError(); if (!IsObject(target)) throw new TypeError(); if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) throw new TypeError(); if (IsNull(attributes)) attributes = undefined; propertyKey = ToPropertyKey(propertyKey); return DecorateProperty(decorators, target, propertyKey, attributes); } else { if (!IsArray(decorators)) throw new TypeError(); if (!IsConstructor(target)) throw new TypeError(); return DecorateConstructor(decorators, target); } } exporter("decorate", decorate); // 4.1.2 Reflect.metadata(metadataKey, metadataValue) // https://rbuckton.github.io/reflect-metadata/#reflect.metadata /** * A default metadata decorator factory that can be used on a class, class member, or parameter. * @param metadataKey The key for the metadata entry. * @param metadataValue The value for the metadata entry. * @returns A decorator function. * @remarks * If `metadataKey` is already defined for the target and target key, the * metadataValue for that key will be overwritten. * @example * * // constructor * @Reflect.metadata(key, value) * class Example { * } * * // property (on constructor, TypeScript only) * class Example { * @Reflect.metadata(key, value) * static staticProperty; * } * * // property (on prototype, TypeScript only) * class Example { * @Reflect.metadata(key, value) * property; * } * * // method (on constructor) * class Example { * @Reflect.metadata(key, value) * static staticMethod() { } * } * * // method (on prototype) * class Example { * @Reflect.metadata(key, value) * method() { } * } * */ function metadata(metadataKey, metadataValue) { function decorator(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) throw new TypeError(); OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); } return decorator; } exporter("metadata", metadata); /** * Define a unique metadata entry on the target. * @param metadataKey A key used to store and retrieve metadata. * @param metadataValue A value that contains attached metadata. * @param target The target object on which to define metadata. * @param propertyKey (Optional) The property key for the target. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * Reflect.defineMetadata("custom:annotation", options, Example); * * // property (on constructor) * Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty"); * * // property (on prototype) * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property"); * * // method (on constructor) * Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod"); * * // method (on prototype) * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method"); * * // decorator factory as metadata-producing annotation. * function MyAnnotation(options): Decorator { * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key); * } * */ function defineMetadata(metadataKey, metadataValue, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); } exporter("defineMetadata", defineMetadata); /** * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.hasMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method"); * */ function hasMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryHasMetadata(metadataKey, target, propertyKey); } exporter("hasMetadata", hasMetadata); /** * Gets a value indicating whether the target object has the provided metadata key defined. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.hasOwnMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method"); * */ function hasOwnMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey); } exporter("hasOwnMetadata", hasOwnMetadata); /** * Gets the metadata value for the provided metadata key on the target object or its prototype chain. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns The metadata value for the metadata key if found; otherwise, `undefined`. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.getMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method"); * */ function getMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryGetMetadata(metadataKey, target, propertyKey); } exporter("getMetadata", getMetadata); /** * Gets the metadata value for the provided metadata key on the target object. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns The metadata value for the metadata key if found; otherwise, `undefined`. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.getOwnMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method"); * */ function getOwnMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey); } exporter("getOwnMetadata", getOwnMetadata); /** * Gets the metadata keys defined on the target object or its prototype chain. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns An array of unique metadata keys. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.getMetadataKeys(Example); * * // property (on constructor) * result = Reflect.getMetadataKeys(Example, "staticProperty"); * * // property (on prototype) * result = Reflect.getMetadataKeys(Example.prototype, "property"); * * // method (on constructor) * result = Reflect.getMetadataKeys(Example, "staticMethod"); * * // method (on prototype) * result = Reflect.getMetadataKeys(Example.prototype, "method"); * */ function getMetadataKeys(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryMetadataKeys(target, propertyKey); } exporter("getMetadataKeys", getMetadataKeys); /** * Gets the unique metadata keys defined on the target object. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns An array of unique metadata keys. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.getOwnMetadataKeys(Example); * * // property (on constructor) * result = Reflect.getOwnMetadataKeys(Example, "staticProperty"); * * // property (on prototype) * result = Reflect.getOwnMetadataKeys(Example.prototype, "property"); * * // method (on constructor) * result = Reflect.getOwnMetadataKeys(Example, "staticMethod"); * * // method (on prototype) * result = Reflect.getOwnMetadataKeys(Example.prototype, "method"); * */ function getOwnMetadataKeys(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryOwnMetadataKeys(target, propertyKey); } exporter("getOwnMetadataKeys", getOwnMetadataKeys); /** * Deletes the metadata entry from the target object with the provided key. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns `true` if the metadata entry was found and deleted; otherwise, false. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.deleteMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method"); * */ function deleteMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false); if (IsUndefined(metadataMap)) return false; if (!metadataMap.delete(metadataKey)) return false; if (metadataMap.size > 0) return true; var targetMetadata = Metadata.get(target); targetMetadata.delete(propertyKey); if (targetMetadata.size > 0) return true; Metadata.delete(target); return true; } exporter("deleteMetadata", deleteMetadata); function DecorateConstructor(decorators, target) { for (var i = decorators.length - 1; i >= 0; --i) { var decorator = decorators[i]; var decorated = decorator(target); if (!IsUndefined(decorated) && !IsNull(decorated)) { if (!IsConstructor(decorated)) throw new TypeError(); target = decorated; } } return target; } function DecorateProperty(decorators, target, propertyKey, descriptor) { for (var i = decorators.length - 1; i >= 0; --i) { var decorator = decorators[i]; var decorated = decorator(target, propertyKey, descriptor); if (!IsUndefined(decorated) && !IsNull(decorated)) { if (!IsObject(decorated)) throw new TypeError(); descriptor = decorated; } } return descriptor; } function GetOrCreateMetadataMap(O, P, Create) { var targetMetadata = Metadata.get(O); if (IsUndefined(targetMetadata)) { if (!Create) return undefined; targetMetadata = new _Map(); Metadata.set(O, targetMetadata); } var metadataMap = targetMetadata.get(P); if (IsUndefined(metadataMap)) { if (!Create) return undefined; metadataMap = new _Map(); targetMetadata.set(P, metadataMap); } return metadataMap; } // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata function OrdinaryHasMetadata(MetadataKey, O, P) { var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); if (hasOwn) return true; var parent = OrdinaryGetPrototypeOf(O); if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P); return false; } // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata function OrdinaryHasOwnMetadata(MetadataKey, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); if (IsUndefined(metadataMap)) return false; return ToBoolean(metadataMap.has(MetadataKey)); } // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata function OrdinaryGetMetadata(MetadataKey, O, P) { var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); if (hasOwn) return OrdinaryGetOwnMetadata(MetadataKey, O, P); var parent = OrdinaryGetPrototypeOf(O); if (!IsNull(parent)) return OrdinaryGetMetadata(MetadataKey, parent, P); return undefined; } // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata function OrdinaryGetOwnMetadata(MetadataKey, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); if (IsUndefined(metadataMap)) return undefined; return metadataMap.get(MetadataKey); } // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true); metadataMap.set(MetadataKey, MetadataValue); } // 3.1.6.1 OrdinaryMetadataKeys(O, P) // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys function OrdinaryMetadataKeys(O, P) { var ownKeys = OrdinaryOwnMetadataKeys(O, P); var parent = OrdinaryGetPrototypeOf(O); if (parent === null) return ownKeys; var parentKeys = OrdinaryMetadataKeys(parent, P); if (parentKeys.length <= 0) return ownKeys; if (ownKeys.length <= 0) return parentKeys; var set = new _Set(); var keys = []; for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) { var key = ownKeys_1[_i]; var hasKey = set.has(key); if (!hasKey) { set.add(key); keys.push(key); } } for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) { var key = parentKeys_1[_a]; var hasKey = set.has(key); if (!hasKey) { set.add(key); keys.push(key); } } return keys; } // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P) // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys function OrdinaryOwnMetadataKeys(O, P) { var keys = []; var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); if (IsUndefined(metadataMap)) return keys; var keysObj = metadataMap.keys(); var iterator = GetIterator(keysObj); var k = 0; while (true) { var next = IteratorStep(iterator); if (!next) { keys.length = k; return keys; } var nextValue = IteratorValue(next); try { keys[k] = nextValue; } catch (e) { try { IteratorClose(iterator); } finally { throw e; } } k++; } } // 6 ECMAScript Data Typ0es and Values // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values function Type(x) { if (x === null) return 1 /* Null */; switch (typeof x) { case "undefined": return 0 /* Undefined */; case "boolean": return 2 /* Boolean */; case "string": return 3 /* String */; case "symbol": return 4 /* Symbol */; case "number": return 5 /* Number */; case "object": return x === null ? 1 /* Null */ : 6 /* Object */; default: return 6 /* Object */; } } // 6.1.1 The Undefined Type // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type function IsUndefined(x) { return x === undefined; } // 6.1.2 The Null Type // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type function IsNull(x) { return x === null; } // 6.1.5 The Symbol Type // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type function IsSymbol(x) { return typeof x === "symbol"; } // 6.1.7 The Object Type // https://tc39.github.io/ecma262/#sec-object-type function IsObject(x) { return typeof x === "object" ? x !== null : typeof x === "function"; } // 7.1 Type Conversion // https://tc39.github.io/ecma262/#sec-type-conversion // 7.1.1 ToPrimitive(input [, PreferredType]) // https://tc39.github.io/ecma262/#sec-toprimitive function ToPrimitive(input, PreferredType) { switch (Type(input)) { case 0 /* Undefined */: return input; case 1 /* Null */: return input; case 2 /* Boolean */: return input; case 3 /* String */: return input; case 4 /* Symbol */: return input; case 5 /* Number */: return input; } var hint = PreferredType === 3 /* String */ ? "string" : PreferredType === 5 /* Number */ ? "number" : "default"; var exoticToPrim = GetMethod(input, toPrimitiveSymbol); if (exoticToPrim !== undefined) { var result = exoticToPrim.call(input, hint); if (IsObject(result)) throw new TypeError(); return result; } return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint); } // 7.1.1.1 OrdinaryToPrimitive(O, hint) // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive function OrdinaryToPrimitive(O, hint) { if (hint === "string") { var toString_1 = O.toString; if (IsCallable(toString_1)) { var result = toString_1.call(O); if (!IsObject(result)) return result; } var valueOf = O.valueOf; if (IsCallable(valueOf)) { var result = valueOf.call(O); if (!IsObject(result)) return result; } } else { var valueOf = O.valueOf; if (IsCallable(valueOf)) { var result = valueOf.call(O); if (!IsObject(result)) return result; } var toString_2 = O.toString; if (IsCallable(toString_2)) { var result = toString_2.call(O); if (!IsObject(result)) return result; } } throw new TypeError(); } // 7.1.2 ToBoolean(argument) // https://tc39.github.io/ecma262/2016/#sec-toboolean function ToBoolean(argument) { return !!argument; } // 7.1.12 ToString(argument) // https://tc39.github.io/ecma262/#sec-tostring function ToString(argument) { return "" + argument; } // 7.1.14 ToPropertyKey(argument) // https://tc39.github.io/ecma262/#sec-topropertykey function ToPropertyKey(argument) { var key = ToPrimitive(argument, 3 /* String */); if (IsSymbol(key)) return key; return ToString(key); } // 7.2 Testing and Comparison Operations // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations // 7.2.2 IsArray(argument) // https://tc39.github.io/ecma262/#sec-isarray function IsArray(argument) { return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]"; } // 7.2.3 IsCallable(argument) // https://tc39.github.io/ecma262/#sec-iscallable function IsCallable(argument) { // NOTE: This is an approximation as we cannot check for [[Call]] internal method. return typeof argument === "function"; } // 7.2.4 IsConstructor(argument) // https://tc39.github.io/ecma262/#sec-isconstructor function IsConstructor(argument) { // NOTE: This is an approximation as we cannot check for [[Construct]] internal method. return typeof argument === "function"; } // 7.2.7 IsPropertyKey(argument) // https://tc39.github.io/ecma262/#sec-ispropertykey function IsPropertyKey(argument) { switch (Type(argument)) { case 3 /* String */: return true; case 4 /* Symbol */: return true; default: return false; } } // 7.3 Operations on Objects // https://tc39.github.io/ecma262/#sec-operations-on-objects // 7.3.9 GetMethod(V, P) // https://tc39.github.io/ecma262/#sec-getmethod function GetMethod(V, P) { var func = V[P]; if (func === undefined || func === null) return undefined; if (!IsCallable(func)) throw new TypeError(); return func; } // 7.4 Operations on Iterator Objects // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects function GetIterator(obj) { var method = GetMethod(obj, iteratorSymbol); if (!IsCallable(method)) throw new TypeError(); // from Call var iterator = method.call(obj); if (!IsObject(iterator)) throw new TypeError(); return iterator; } // 7.4.4 IteratorValue(iterResult) // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue function IteratorValue(iterResult) { return iterResult.value; } // 7.4.5 IteratorStep(iterator) // https://tc39.github.io/ecma262/#sec-iteratorstep function IteratorStep(iterator) { var result = iterator.next(); return result.done ? false : result; } // 7.4.6 IteratorClose(iterator, completion) // https://tc39.github.io/ecma262/#sec-iteratorclose function IteratorClose(iterator) { var f = iterator["return"]; if (f) f.call(iterator); } // 9.1 Ordinary Object Internal Methods and Internal Slots // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots // 9.1.1.1 OrdinaryGetPrototypeOf(O) // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof function OrdinaryGetPrototypeOf(O) { var proto = Object.getPrototypeOf(O); if (typeof O !== "function" || O === functionPrototype) return proto; // TypeScript doesn't set __proto__ in ES5, as it's non-standard. // Try to determine the superclass constructor. Compatible implementations // must either set __proto__ on a subclass constructor to the superclass constructor, // or ensure each class has a valid `constructor` property on its prototype that // points back to the constructor. // If this is not the same as Function.[[Prototype]], then this is definately inherited. // This is the case when in ES6 or when using __proto__ in a compatible browser. if (proto !== functionPrototype) return proto; // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. var prototype = O.prototype; var prototypeProto = prototype && Object.getPrototypeOf(prototype); if (prototypeProto == null || prototypeProto === Object.prototype) return proto; // If the constructor was not a function, then we cannot determine the heritage. var constructor = prototypeProto.constructor; if (typeof constructor !== "function") return proto; // If we have some kind of self-reference, then we cannot determine the heritage. if (constructor === O) return proto; // we have a pretty good guess at the heritage. return constructor; } // naive Map shim function CreateMapPolyfill() { var cacheSentinel = {}; var arraySentinel = []; var MapIterator = /** @class */ (function () { function MapIterator(keys, values, selector) { this._index = 0; this._keys = keys; this._values = values; this._selector = selector; } MapIterator.prototype["@@iterator"] = function () { return this; }; MapIterator.prototype[iteratorSymbol] = function () { return this; }; MapIterator.prototype.next = function () { var index = this._index; if (index >= 0 && index < this._keys.length) { var result = this._selector(this._keys[index], this._values[index]); if (index + 1 >= this._keys.length) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } else { this._index++; } return { value: result, done: false }; } return { value: undefined, done: true }; }; MapIterator.prototype.throw = function (error) { if (this._index >= 0) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } throw error; }; MapIterator.prototype.return = function (value) { if (this._index >= 0) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } return { value: value, done: true }; }; return MapIterator; }()); return /** @class */ (function () { function Map() { this._keys = []; this._values = []; this._cacheKey = cacheSentinel; this._cacheIndex = -2; } Object.defineProperty(Map.prototype, "size", { get: function () { return this._keys.length; }, enumerable: true, configurable: true }); Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; }; Map.prototype.get = function (key) { var index = this._find(key, /*insert*/ false); return index >= 0 ? this._values[index] : undefined; }; Map.prototype.set = function (key, value) { var index = this._find(key, /*insert*/ true); this._values[index] = value; return this; }; Map.prototype.delete = function (key) { var index = this._find(key, /*insert*/ false); if (index >= 0) { var size = this._keys.length; for (var i = index + 1; i < size; i++) { this._keys[i - 1] = this._keys[i]; this._values[i - 1] = this._values[i]; } this._keys.length--; this._values.length--; if (key === this._cacheKey) { this._cacheKey = cacheSentinel; this._cacheIndex = -2; } return true; } return false; }; Map.prototype.clear = function () { this._keys.length = 0; this._values.length = 0; this._cacheKey = cacheSentinel; this._cacheIndex = -2; }; Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); }; Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); }; Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); }; Map.prototype["@@iterator"] = function () { return this.entries(); }; Map.prototype[iteratorSymbol] = function () { return this.entries(); }; Map.prototype._find = function (key, insert) { if (this._cacheKey !== key) { this._cacheIndex = this._keys.indexOf(this._cacheKey = key); } if (this._cacheIndex < 0 && insert) { this._cacheIndex = this._keys.length; this._keys.push(key); this._values.push(undefined); } return this._cacheIndex; }; return Map; }()); function getKey(key, _) { return key; } function getValue(_, value) { return value; } function getEntry(key, value) { return [key, value]; } } // naive Set shim function CreateSetPolyfill() { return /** @class */ (function () { function Set() { this._map = new _Map(); } Object.defineProperty(Set.prototype, "size", { get: function () { return this._map.size; }, enumerable: true, configurable: true }); Set.prototype.has = function (value) { return this._map.has(value); }; Set.prototype.add = function (value) { return this._map.set(value, value), this; }; Set.prototype.delete = function (value) { return this._map.delete(value); }; Set.prototype.clear = function () { this._map.clear(); }; Set.prototype.keys = function () { return this._map.keys(); }; Set.prototype.values = function () { return this._map.values(); }; Set.prototype.entries = function () { return this._map.entries(); }; Set.prototype["@@iterator"] = function () { return this.keys(); }; Set.prototype[iteratorSymbol] = function () { return this.keys(); }; return Set; }()); } // naive WeakMap shim function CreateWeakMapPolyfill() { var UUID_SIZE = 16; var keys = HashMap.create(); var rootKey = CreateUniqueKey(); return /** @class */ (function () { function WeakMap() { this._key = CreateUniqueKey(); } WeakMap.prototype.has = function (target) { var table = GetOrCreateWeakMapTable(target, /*create*/ false); return table !== undefined ? HashMap.has(table, this._key) : false; }; WeakMap.prototype.get = function (target) { var table = GetOrCreateWeakMapTable(target, /*create*/ false); return table !== undefined ? HashMap.get(table, this._key) : undefined; }; WeakMap.prototype.set = function (target, value) { var table = GetOrCreateWeakMapTable(target, /*create*/ true); table[this._key] = value; return this; }; WeakMap.prototype.delete = function (target) { var table = GetOrCreateWeakMapTable(target, /*create*/ false); return table !== undefined ? delete table[this._key] : false; }; WeakMap.prototype.clear = function () { // NOTE: not a real clear, just makes the previous data unreachable this._key = CreateUniqueKey(); }; return WeakMap; }()); function CreateUniqueKey() { var key; do key = "@@WeakMap@@" + CreateUUID(); while (HashMap.has(keys, key)); keys[key] = true; return key; } function GetOrCreateWeakMapTable(target, create) { if (!hasOwn.call(target, rootKey)) { if (!create) return undefined; Object.defineProperty(target, rootKey, { value: HashMap.create() }); } return target[rootKey]; } function FillRandomBytes(buffer, size) { for (var i = 0; i < size; ++i) buffer[i] = Math.random() * 0xff | 0; return buffer; } function GenRandomBytes(size) { if (typeof Uint8Array === "function") { if (typeof crypto !== "undefined") return crypto.getRandomValues(new Uint8Array(size)); if (typeof msCrypto !== "undefined") return msCrypto.getRandomValues(new Uint8Array(size)); return FillRandomBytes(new Uint8Array(size), size); } return FillRandomBytes(new Array(size), size); } function CreateUUID() { var data = GenRandomBytes(UUID_SIZE); // mark as random - RFC 4122 § 4.4 data[6] = data[6] & 0x4f | 0x40; data[8] = data[8] & 0xbf | 0x80; var result = ""; for (var offset = 0; offset < UUID_SIZE; ++offset) { var byte = data[offset]; if (offset === 4 || offset === 6 || offset === 8) result += "-"; if (byte < 16) result += "0"; result += byte.toString(16).toLowerCase(); } return result; } } // uses a heuristic used by v8 and chakra to force an object into dictionary mode. function MakeDictionary(obj) { obj.__ = undefined; delete obj.__; return obj; } }); })(Reflect || (Reflect = {})); /***/ }), /***/ 48699: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright 2010-2012 Mikeal Rogers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. var extend = __webpack_require__(38171) var cookies = __webpack_require__(50976) var helpers = __webpack_require__(74845) var paramsHaveRequestBody = helpers.paramsHaveRequestBody // organize params for patch, post, put, head, del function initParams (uri, options, callback) { if (typeof options === 'function') { callback = options } var params = {} if (options !== null && typeof options === 'object') { extend(params, options, {uri: uri}) } else if (typeof uri === 'string') { extend(params, {uri: uri}) } else { extend(params, uri) } params.callback = callback || params.callback return params } function request (uri, options, callback) { if (typeof uri === 'undefined') { throw new Error('undefined is not a valid uri or options object.') } var params = initParams(uri, options, callback) if (params.method === 'HEAD' && paramsHaveRequestBody(params)) { throw new Error('HTTP HEAD requests MUST NOT include a request body.') } return new request.Request(params) } function verbFunc (verb) { var method = verb.toUpperCase() return function (uri, options, callback) { var params = initParams(uri, options, callback) params.method = method return request(params, params.callback) } } // define like this to please codeintel/intellisense IDEs request.get = verbFunc('get') request.head = verbFunc('head') request.options = verbFunc('options') request.post = verbFunc('post') request.put = verbFunc('put') request.patch = verbFunc('patch') request.del = verbFunc('delete') request['delete'] = verbFunc('delete') request.jar = function (store) { return cookies.jar(store) } request.cookie = function (str) { return cookies.parse(str) } function wrapRequestMethod (method, options, requester, verb) { return function (uri, opts, callback) { var params = initParams(uri, opts, callback) var target = {} extend(true, target, options, params) target.pool = params.pool || options.pool if (verb) { target.method = verb.toUpperCase() } if (typeof requester === 'function') { method = requester } return method(target, target.callback) } } request.defaults = function (options, requester) { var self = this options = options || {} if (typeof options === 'function') { requester = options options = {} } var defaults = wrapRequestMethod(self, options, requester) var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete'] verbs.forEach(function (verb) { defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb) }) defaults.cookie = wrapRequestMethod(self.cookie, options, requester) defaults.jar = self.jar defaults.defaults = self.defaults return defaults } request.forever = function (agentOptions, optionsArg) { var options = {} if (optionsArg) { extend(options, optionsArg) } if (agentOptions) { options.agentOptions = agentOptions } options.forever = true return request.defaults(options) } // Exports module.exports = request request.Request = __webpack_require__(70304) request.initParams = initParams // Backwards compatibility for request.debug Object.defineProperty(request, 'debug', { enumerable: true, get: function () { return request.Request.debug }, set: function (debug) { request.Request.debug = debug } }) /***/ }), /***/ 76996: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var caseless = __webpack_require__(35684) var uuid = __webpack_require__(71435) var helpers = __webpack_require__(74845) var md5 = helpers.md5 var toBase64 = helpers.toBase64 function Auth (request) { // define all public properties here this.request = request this.hasAuth = false this.sentAuth = false this.bearerToken = null this.user = null this.pass = null } Auth.prototype.basic = function (user, pass, sendImmediately) { var self = this if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { self.request.emit('error', new Error('auth() received invalid user or password')) } self.user = user self.pass = pass self.hasAuth = true var header = user + ':' + (pass || '') if (sendImmediately || typeof sendImmediately === 'undefined') { var authHeader = 'Basic ' + toBase64(header) self.sentAuth = true return authHeader } } Auth.prototype.bearer = function (bearer, sendImmediately) { var self = this self.bearerToken = bearer self.hasAuth = true if (sendImmediately || typeof sendImmediately === 'undefined') { if (typeof bearer === 'function') { bearer = bearer() } var authHeader = 'Bearer ' + (bearer || '') self.sentAuth = true return authHeader } } Auth.prototype.digest = function (method, path, authHeader) { // TODO: More complete implementation of RFC 2617. // - handle challenge.domain // - support qop="auth-int" only // - handle Authentication-Info (not necessarily?) // - check challenge.stale (not necessarily?) // - increase nc (not necessarily?) // For reference: // http://tools.ietf.org/html/rfc2617#section-3 // https://github.com/bagder/curl/blob/master/lib/http_digest.c var self = this var challenge = {} var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi while (true) { var match = re.exec(authHeader) if (!match) { break } challenge[match[1]] = match[2] || match[3] } /** * RFC 2617: handle both MD5 and MD5-sess algorithms. * * If the algorithm directive's value is "MD5" or unspecified, then HA1 is * HA1=MD5(username:realm:password) * If the algorithm directive's value is "MD5-sess", then HA1 is * HA1=MD5(MD5(username:realm:password):nonce:cnonce) */ var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) { var ha1 = md5(user + ':' + realm + ':' + pass) if (algorithm && algorithm.toLowerCase() === 'md5-sess') { return md5(ha1 + ':' + nonce + ':' + cnonce) } else { return ha1 } } var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' var nc = qop && '00000001' var cnonce = qop && uuid().replace(/-/g, '') var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce) var ha2 = md5(method + ':' + path) var digestResponse = qop ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) : md5(ha1 + ':' + challenge.nonce + ':' + ha2) var authValues = { username: self.user, realm: challenge.realm, nonce: challenge.nonce, uri: path, qop: qop, response: digestResponse, nc: nc, cnonce: cnonce, algorithm: challenge.algorithm, opaque: challenge.opaque } authHeader = [] for (var k in authValues) { if (authValues[k]) { if (k === 'qop' || k === 'nc' || k === 'algorithm') { authHeader.push(k + '=' + authValues[k]) } else { authHeader.push(k + '="' + authValues[k] + '"') } } } authHeader = 'Digest ' + authHeader.join(', ') self.sentAuth = true return authHeader } Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) { var self = this var request = self.request var authHeader if (bearer === undefined && user === undefined) { self.request.emit('error', new Error('no auth mechanism defined')) } else if (bearer !== undefined) { authHeader = self.bearer(bearer, sendImmediately) } else { authHeader = self.basic(user, pass, sendImmediately) } if (authHeader) { request.setHeader('authorization', authHeader) } } Auth.prototype.onResponse = function (response) { var self = this var request = self.request if (!self.hasAuth || self.sentAuth) { return null } var c = caseless(response.headers) var authHeader = c.get('www-authenticate') var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase() request.debug('reauth', authVerb) switch (authVerb) { case 'basic': return self.basic(self.user, self.pass, true) case 'bearer': return self.bearer(self.bearerToken, true) case 'digest': return self.digest(request.method, request.path, authHeader) } } exports.g = Auth /***/ }), /***/ 50976: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var tough = __webpack_require__(47372) var Cookie = tough.Cookie var CookieJar = tough.CookieJar exports.parse = function (str) { if (str && str.uri) { str = str.uri } if (typeof str !== 'string') { throw new Error('The cookie function only accepts STRING as param') } return Cookie.parse(str, {loose: true}) } // Adapt the sometimes-Async api of tough.CookieJar to our requirements function RequestJar (store) { var self = this self._jar = new CookieJar(store, {looseMode: true}) } RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) { var self = this return self._jar.setCookieSync(cookieOrStr, uri, options || {}) } RequestJar.prototype.getCookieString = function (uri) { var self = this return self._jar.getCookieStringSync(uri) } RequestJar.prototype.getCookies = function (uri) { var self = this return self._jar.getCookiesSync(uri) } exports.jar = function (store) { return new RequestJar(store) } /***/ }), /***/ 75654: /***/ ((module) => { "use strict"; function formatHostname (hostname) { // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' return hostname.replace(/^\.*/, '.').toLowerCase() } function parseNoProxyZone (zone) { zone = zone.trim().toLowerCase() var zoneParts = zone.split(':', 2) var zoneHost = formatHostname(zoneParts[0]) var zonePort = zoneParts[1] var hasPort = zone.indexOf(':') > -1 return {hostname: zoneHost, port: zonePort, hasPort: hasPort} } function uriInNoProxy (uri, noProxy) { var port = uri.port || (uri.protocol === 'https:' ? '443' : '80') var hostname = formatHostname(uri.hostname) var noProxyList = noProxy.split(',') // iterate through the noProxyList until it finds a match. return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) { var isMatchedAt = hostname.indexOf(noProxyZone.hostname) var hostnameMatched = ( isMatchedAt > -1 && (isMatchedAt === hostname.length - noProxyZone.hostname.length) ) if (noProxyZone.hasPort) { return (port === noProxyZone.port) && hostnameMatched } return hostnameMatched }) } function getProxyFromURI (uri) { // Decide the proper request proxy to use based on the request URI object and the // environmental variables (NO_PROXY, HTTP_PROXY, etc.) // respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html) var noProxy = process.env.NO_PROXY || process.env.no_proxy || '' // if the noProxy is a wildcard then return null if (noProxy === '*') { return null } // if the noProxy is not empty and the uri is found return null if (noProxy !== '' && uriInNoProxy(uri, noProxy)) { return null } // Check for HTTP or HTTPS Proxy in environment Else default to null if (uri.protocol === 'http:') { return process.env.HTTP_PROXY || process.env.http_proxy || null } if (uri.protocol === 'https:') { return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null } // if none of that works, return null // (What uri protocol are you using then?) return null } module.exports = getProxyFromURI /***/ }), /***/ 3248: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var fs = __webpack_require__(35747) var qs = __webpack_require__(71191) var validate = __webpack_require__(75697) var extend = __webpack_require__(38171) function Har (request) { this.request = request } Har.prototype.reducer = function (obj, pair) { // new property ? if (obj[pair.name] === undefined) { obj[pair.name] = pair.value return obj } // existing? convert to array var arr = [ obj[pair.name], pair.value ] obj[pair.name] = arr return obj } Har.prototype.prep = function (data) { // construct utility properties data.queryObj = {} data.headersObj = {} data.postData.jsonObj = false data.postData.paramsObj = false // construct query objects if (data.queryString && data.queryString.length) { data.queryObj = data.queryString.reduce(this.reducer, {}) } // construct headers objects if (data.headers && data.headers.length) { // loweCase header keys data.headersObj = data.headers.reduceRight(function (headers, header) { headers[header.name] = header.value return headers }, {}) } // construct Cookie header if (data.cookies && data.cookies.length) { var cookies = data.cookies.map(function (cookie) { return cookie.name + '=' + cookie.value }) if (cookies.length) { data.headersObj.cookie = cookies.join('; ') } } // prep body function some (arr) { return arr.some(function (type) { return data.postData.mimeType.indexOf(type) === 0 }) } if (some([ 'multipart/mixed', 'multipart/related', 'multipart/form-data', 'multipart/alternative'])) { // reset values data.postData.mimeType = 'multipart/form-data' } else if (some([ 'application/x-www-form-urlencoded'])) { if (!data.postData.params) { data.postData.text = '' } else { data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}) // always overwrite data.postData.text = qs.stringify(data.postData.paramsObj) } } else if (some([ 'text/json', 'text/x-json', 'application/json', 'application/x-json'])) { data.postData.mimeType = 'application/json' if (data.postData.text) { try { data.postData.jsonObj = JSON.parse(data.postData.text) } catch (e) { this.request.debug(e) // force back to text/plain data.postData.mimeType = 'text/plain' } } } return data } Har.prototype.options = function (options) { // skip if no har property defined if (!options.har) { return options } var har = {} extend(har, options.har) // only process the first entry if (har.log && har.log.entries) { har = har.log.entries[0] } // add optional properties to make validation successful har.url = har.url || options.url || options.uri || options.baseUrl || '/' har.httpVersion = har.httpVersion || 'HTTP/1.1' har.queryString = har.queryString || [] har.headers = har.headers || [] har.cookies = har.cookies || [] har.postData = har.postData || {} har.postData.mimeType = har.postData.mimeType || 'application/octet-stream' har.bodySize = 0 har.headersSize = 0 har.postData.size = 0 if (!validate.request(har)) { return options } // clean up and get some utility properties var req = this.prep(har) // construct new options if (req.url) { options.url = req.url } if (req.method) { options.method = req.method } if (Object.keys(req.queryObj).length) { options.qs = req.queryObj } if (Object.keys(req.headersObj).length) { options.headers = req.headersObj } function test (type) { return req.postData.mimeType.indexOf(type) === 0 } if (test('application/x-www-form-urlencoded')) { options.form = req.postData.paramsObj } else if (test('application/json')) { if (req.postData.jsonObj) { options.body = req.postData.jsonObj options.json = true } } else if (test('multipart/form-data')) { options.formData = {} req.postData.params.forEach(function (param) { var attachment = {} if (!param.fileName && !param.contentType) { options.formData[param.name] = param.value return } // attempt to read from disk! if (param.fileName && !param.value) { attachment.value = fs.createReadStream(param.fileName) } else if (param.value) { attachment.value = param.value } if (param.fileName) { attachment.options = { filename: param.fileName, contentType: param.contentType ? param.contentType : null } } options.formData[param.name] = attachment }) } else { if (req.postData.text) { options.body = req.postData.text } } return options } exports.t = Har /***/ }), /***/ 34473: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var crypto = __webpack_require__(76417) function randomString (size) { var bits = (size + 1) * 6 var buffer = crypto.randomBytes(Math.ceil(bits / 8)) var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '') return string.slice(0, size) } function calculatePayloadHash (payload, algorithm, contentType) { var hash = crypto.createHash(algorithm) hash.update('hawk.1.payload\n') hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n') hash.update(payload || '') hash.update('\n') return hash.digest('base64') } exports.calculateMac = function (credentials, opts) { var normalized = 'hawk.1.header\n' + opts.ts + '\n' + opts.nonce + '\n' + (opts.method || '').toUpperCase() + '\n' + opts.resource + '\n' + opts.host.toLowerCase() + '\n' + opts.port + '\n' + (opts.hash || '') + '\n' if (opts.ext) { normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n') } normalized = normalized + '\n' if (opts.app) { normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n' } var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized) var digest = hmac.digest('base64') return digest } exports.header = function (uri, method, opts) { var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000) var credentials = opts.credentials if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) { return '' } if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) { return '' } var artifacts = { ts: timestamp, nonce: opts.nonce || randomString(6), method: method, resource: uri.pathname + (uri.search || ''), host: uri.hostname, port: uri.port || (uri.protocol === 'http:' ? 80 : 443), hash: opts.hash, ext: opts.ext, app: opts.app, dlg: opts.dlg } if (!artifacts.hash && (opts.payload || opts.payload === '')) { artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType) } var mac = exports.calculateMac(credentials, artifacts) var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== '' var header = 'Hawk id="' + credentials.id + '", ts="' + artifacts.ts + '", nonce="' + artifacts.nonce + (artifacts.hash ? '", hash="' + artifacts.hash : '') + (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') + '", mac="' + mac + '"' if (artifacts.app) { header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"' } return header } /***/ }), /***/ 74845: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var jsonSafeStringify = __webpack_require__(57073) var crypto = __webpack_require__(76417) var Buffer = __webpack_require__(21867).Buffer var defer = typeof setImmediate === 'undefined' ? process.nextTick : setImmediate function paramsHaveRequestBody (params) { return ( params.body || params.requestBodyStream || (params.json && typeof params.json !== 'boolean') || params.multipart ) } function safeStringify (obj, replacer) { var ret try { ret = JSON.stringify(obj, replacer) } catch (e) { ret = jsonSafeStringify(obj, replacer) } return ret } function md5 (str) { return crypto.createHash('md5').update(str).digest('hex') } function isReadStream (rs) { return rs.readable && rs.path && rs.mode } function toBase64 (str) { return Buffer.from(str || '', 'utf8').toString('base64') } function copy (obj) { var o = {} Object.keys(obj).forEach(function (i) { o[i] = obj[i] }) return o } function version () { var numbers = process.version.replace('v', '').split('.') return { major: parseInt(numbers[0], 10), minor: parseInt(numbers[1], 10), patch: parseInt(numbers[2], 10) } } exports.paramsHaveRequestBody = paramsHaveRequestBody exports.safeStringify = safeStringify exports.md5 = md5 exports.isReadStream = isReadStream exports.toBase64 = toBase64 exports.copy = copy exports.version = version exports.defer = defer /***/ }), /***/ 87810: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var uuid = __webpack_require__(71435) var CombinedStream = __webpack_require__(85443) var isstream = __webpack_require__(83362) var Buffer = __webpack_require__(21867).Buffer function Multipart (request) { this.request = request this.boundary = uuid() this.chunked = false this.body = null } Multipart.prototype.isChunked = function (options) { var self = this var chunked = false var parts = options.data || options if (!parts.forEach) { self.request.emit('error', new Error('Argument error, options.multipart.')) } if (options.chunked !== undefined) { chunked = options.chunked } if (self.request.getHeader('transfer-encoding') === 'chunked') { chunked = true } if (!chunked) { parts.forEach(function (part) { if (typeof part.body === 'undefined') { self.request.emit('error', new Error('Body attribute missing in multipart.')) } if (isstream(part.body)) { chunked = true } }) } return chunked } Multipart.prototype.setHeaders = function (chunked) { var self = this if (chunked && !self.request.hasHeader('transfer-encoding')) { self.request.setHeader('transfer-encoding', 'chunked') } var header = self.request.getHeader('content-type') if (!header || header.indexOf('multipart') === -1) { self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary) } else { if (header.indexOf('boundary') !== -1) { self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1') } else { self.request.setHeader('content-type', header + '; boundary=' + self.boundary) } } } Multipart.prototype.build = function (parts, chunked) { var self = this var body = chunked ? new CombinedStream() : [] function add (part) { if (typeof part === 'number') { part = part.toString() } return chunked ? body.append(part) : body.push(Buffer.from(part)) } if (self.request.preambleCRLF) { add('\r\n') } parts.forEach(function (part) { var preamble = '--' + self.boundary + '\r\n' Object.keys(part).forEach(function (key) { if (key === 'body') { return } preamble += key + ': ' + part[key] + '\r\n' }) preamble += '\r\n' add(preamble) add(part.body) add('\r\n') }) add('--' + self.boundary + '--') if (self.request.postambleCRLF) { add('\r\n') } return body } Multipart.prototype.onRequest = function (options) { var self = this var chunked = self.isChunked(options) var parts = options.data || options self.setHeaders(chunked) self.chunked = chunked self.body = self.build(parts, chunked) } exports.$ = Multipart /***/ }), /***/ 41174: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var url = __webpack_require__(78835) var qs = __webpack_require__(47457) var caseless = __webpack_require__(35684) var uuid = __webpack_require__(71435) var oauth = __webpack_require__(43248) var crypto = __webpack_require__(76417) var Buffer = __webpack_require__(21867).Buffer function OAuth (request) { this.request = request this.params = null } OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) { var oa = {} for (var i in _oauth) { oa['oauth_' + i] = _oauth[i] } if (!oa.oauth_version) { oa.oauth_version = '1.0' } if (!oa.oauth_timestamp) { oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString() } if (!oa.oauth_nonce) { oa.oauth_nonce = uuid().replace(/-/g, '') } if (!oa.oauth_signature_method) { oa.oauth_signature_method = 'HMAC-SHA1' } var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase delete oa.oauth_consumer_secret delete oa.oauth_private_key var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase delete oa.oauth_token_secret var realm = oa.oauth_realm delete oa.oauth_realm delete oa.oauth_transport_method var baseurl = uri.protocol + '//' + uri.host + uri.pathname var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&')) oa.oauth_signature = oauth.sign( oa.oauth_signature_method, method, baseurl, params, consumer_secret_or_private_key, // eslint-disable-line camelcase token_secret // eslint-disable-line camelcase ) if (realm) { oa.realm = realm } return oa } OAuth.prototype.buildBodyHash = function (_oauth, body) { if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) { this.request.emit('error', new Error('oauth: ' + _oauth.signature_method + ' signature_method not supported with body_hash signing.')) } var shasum = crypto.createHash('sha1') shasum.update(body || '') var sha1 = shasum.digest('hex') return Buffer.from(sha1, 'hex').toString('base64') } OAuth.prototype.concatParams = function (oa, sep, wrap) { wrap = wrap || '' var params = Object.keys(oa).filter(function (i) { return i !== 'realm' && i !== 'oauth_signature' }).sort() if (oa.realm) { params.splice(0, 0, 'realm') } params.push('oauth_signature') return params.map(function (i) { return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap }).join(sep) } OAuth.prototype.onRequest = function (_oauth) { var self = this self.params = _oauth var uri = self.request.uri || {} var method = self.request.method || '' var headers = caseless(self.request.headers) var body = self.request.body || '' var qsLib = self.request.qsLib || qs var form var query var contentType = headers.get('content-type') || '' var formContentType = 'application/x-www-form-urlencoded' var transport = _oauth.transport_method || 'header' if (contentType.slice(0, formContentType.length) === formContentType) { contentType = formContentType form = body } if (uri.query) { query = uri.query } if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) { self.request.emit('error', new Error('oauth: transport_method of body requires POST ' + 'and content-type ' + formContentType)) } if (!form && typeof _oauth.body_hash === 'boolean') { _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString()) } var oa = self.buildParams(_oauth, uri, method, query, form, qsLib) switch (transport) { case 'header': self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"')) break case 'query': var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&') self.request.uri = url.parse(href) self.request.path = self.request.uri.path break case 'body': self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&') break default: self.request.emit('error', new Error('oauth: transport_method invalid')) } } exports.f = OAuth /***/ }), /***/ 66476: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var qs = __webpack_require__(47457) var querystring = __webpack_require__(71191) function Querystring (request) { this.request = request this.lib = null this.useQuerystring = null this.parseOptions = null this.stringifyOptions = null } Querystring.prototype.init = function (options) { if (this.lib) { return } this.useQuerystring = options.useQuerystring this.lib = (this.useQuerystring ? querystring : qs) this.parseOptions = options.qsParseOptions || {} this.stringifyOptions = options.qsStringifyOptions || {} } Querystring.prototype.stringify = function (obj) { return (this.useQuerystring) ? this.rfc3986(this.lib.stringify(obj, this.stringifyOptions.sep || null, this.stringifyOptions.eq || null, this.stringifyOptions)) : this.lib.stringify(obj, this.stringifyOptions) } Querystring.prototype.parse = function (str) { return (this.useQuerystring) ? this.lib.parse(str, this.parseOptions.sep || null, this.parseOptions.eq || null, this.parseOptions) : this.lib.parse(str, this.parseOptions) } Querystring.prototype.rfc3986 = function (str) { return str.replace(/[!'()*]/g, function (c) { return '%' + c.charCodeAt(0).toString(16).toUpperCase() }) } Querystring.prototype.unescape = querystring.unescape exports.h = Querystring /***/ }), /***/ 3048: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var url = __webpack_require__(78835) var isUrl = /^https?:/ function Redirect (request) { this.request = request this.followRedirect = true this.followRedirects = true this.followAllRedirects = false this.followOriginalHttpMethod = false this.allowRedirect = function () { return true } this.maxRedirects = 10 this.redirects = [] this.redirectsFollowed = 0 this.removeRefererHeader = false } Redirect.prototype.onRequest = function (options) { var self = this if (options.maxRedirects !== undefined) { self.maxRedirects = options.maxRedirects } if (typeof options.followRedirect === 'function') { self.allowRedirect = options.followRedirect } if (options.followRedirect !== undefined) { self.followRedirects = !!options.followRedirect } if (options.followAllRedirects !== undefined) { self.followAllRedirects = options.followAllRedirects } if (self.followRedirects || self.followAllRedirects) { self.redirects = self.redirects || [] } if (options.removeRefererHeader !== undefined) { self.removeRefererHeader = options.removeRefererHeader } if (options.followOriginalHttpMethod !== undefined) { self.followOriginalHttpMethod = options.followOriginalHttpMethod } } Redirect.prototype.redirectTo = function (response) { var self = this var request = self.request var redirectTo = null if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) { var location = response.caseless.get('location') request.debug('redirect', location) if (self.followAllRedirects) { redirectTo = location } else if (self.followRedirects) { switch (request.method) { case 'PATCH': case 'PUT': case 'POST': case 'DELETE': // Do not follow redirects break default: redirectTo = location break } } } else if (response.statusCode === 401) { var authHeader = request._auth.onResponse(response) if (authHeader) { request.setHeader('authorization', authHeader) redirectTo = request.uri } } return redirectTo } Redirect.prototype.onResponse = function (response) { var self = this var request = self.request var redirectTo = self.redirectTo(response) if (!redirectTo || !self.allowRedirect.call(request, response)) { return false } request.debug('redirect to', redirectTo) // ignore any potential response body. it cannot possibly be useful // to us at this point. // response.resume should be defined, but check anyway before calling. Workaround for browserify. if (response.resume) { response.resume() } if (self.redirectsFollowed >= self.maxRedirects) { request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href)) return false } self.redirectsFollowed += 1 if (!isUrl.test(redirectTo)) { redirectTo = url.resolve(request.uri.href, redirectTo) } var uriPrev = request.uri request.uri = url.parse(redirectTo) // handle the case where we change protocol from https to http or vice versa if (request.uri.protocol !== uriPrev.protocol) { delete request.agent } self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo }) if (self.followAllRedirects && request.method !== 'HEAD' && response.statusCode !== 401 && response.statusCode !== 307) { request.method = self.followOriginalHttpMethod ? request.method : 'GET' } // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215 delete request.src delete request.req delete request._started if (response.statusCode !== 401 && response.statusCode !== 307) { // Remove parameters from the previous response, unless this is the second request // for a server that requires digest authentication. delete request.body delete request._form if (request.headers) { request.removeHeader('host') request.removeHeader('content-type') request.removeHeader('content-length') if (request.uri.hostname !== request.originalHost.split(':')[0]) { // Remove authorization if changing hostnames (but not if just // changing ports or protocols). This matches the behavior of curl: // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710 request.removeHeader('authorization') } } } if (!self.removeRefererHeader) { request.setHeader('referer', uriPrev.href) } request.emit('redirect') request.init() return true } exports.l = Redirect /***/ }), /***/ 17619: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var url = __webpack_require__(78835) var tunnel = __webpack_require__(11137) var defaultProxyHeaderWhiteList = [ 'accept', 'accept-charset', 'accept-encoding', 'accept-language', 'accept-ranges', 'cache-control', 'content-encoding', 'content-language', 'content-location', 'content-md5', 'content-range', 'content-type', 'connection', 'date', 'expect', 'max-forwards', 'pragma', 'referer', 'te', 'user-agent', 'via' ] var defaultProxyHeaderExclusiveList = [ 'proxy-authorization' ] function constructProxyHost (uriObject) { var port = uriObject.port var protocol = uriObject.protocol var proxyHost = uriObject.hostname + ':' if (port) { proxyHost += port } else if (protocol === 'https:') { proxyHost += '443' } else { proxyHost += '80' } return proxyHost } function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) { var whiteList = proxyHeaderWhiteList .reduce(function (set, header) { set[header.toLowerCase()] = true return set }, {}) return Object.keys(headers) .filter(function (header) { return whiteList[header.toLowerCase()] }) .reduce(function (set, header) { set[header] = headers[header] return set }, {}) } function constructTunnelOptions (request, proxyHeaders) { var proxy = request.proxy var tunnelOptions = { proxy: { host: proxy.hostname, port: +proxy.port, proxyAuth: proxy.auth, headers: proxyHeaders }, headers: request.headers, ca: request.ca, cert: request.cert, key: request.key, passphrase: request.passphrase, pfx: request.pfx, ciphers: request.ciphers, rejectUnauthorized: request.rejectUnauthorized, secureOptions: request.secureOptions, secureProtocol: request.secureProtocol } return tunnelOptions } function constructTunnelFnName (uri, proxy) { var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http') var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http') return [uriProtocol, proxyProtocol].join('Over') } function getTunnelFn (request) { var uri = request.uri var proxy = request.proxy var tunnelFnName = constructTunnelFnName(uri, proxy) return tunnel[tunnelFnName] } function Tunnel (request) { this.request = request this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList this.proxyHeaderExclusiveList = [] if (typeof request.tunnel !== 'undefined') { this.tunnelOverride = request.tunnel } } Tunnel.prototype.isEnabled = function () { var self = this var request = self.request // Tunnel HTTPS by default. Allow the user to override this setting. // If self.tunnelOverride is set (the user specified a value), use it. if (typeof self.tunnelOverride !== 'undefined') { return self.tunnelOverride } // If the destination is HTTPS, tunnel. if (request.uri.protocol === 'https:') { return true } // Otherwise, do not use tunnel. return false } Tunnel.prototype.setup = function (options) { var self = this var request = self.request options = options || {} if (typeof request.proxy === 'string') { request.proxy = url.parse(request.proxy) } if (!request.proxy || !request.tunnel) { return false } // Setup Proxy Header Exclusive List and White List if (options.proxyHeaderWhiteList) { self.proxyHeaderWhiteList = options.proxyHeaderWhiteList } if (options.proxyHeaderExclusiveList) { self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList } var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList) var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList) // Setup Proxy Headers and Proxy Headers Host // Only send the Proxy White Listed Header names var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList) proxyHeaders.host = constructProxyHost(request.uri) proxyHeaderExclusiveList.forEach(request.removeHeader, request) // Set Agent from Tunnel Data var tunnelFn = getTunnelFn(request) var tunnelOptions = constructTunnelOptions(request, proxyHeaders) request.agent = tunnelFn(tunnelOptions) return true } Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList exports.n = Tunnel /***/ }), /***/ 11377: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var CombinedStream = __webpack_require__(85443); var util = __webpack_require__(31669); var path = __webpack_require__(85622); var http = __webpack_require__(98605); var https = __webpack_require__(57211); var parseUrl = __webpack_require__(78835).parse; var fs = __webpack_require__(35747); var mime = __webpack_require__(43583); var asynckit = __webpack_require__(14812); var populate = __webpack_require__(94932); // Public API module.exports = FormData; // make it a Stream util.inherits(FormData, CombinedStream); /** * Create readable "multipart/form-data" streams. * Can be used to submit forms * and file uploads to other web applications. * * @constructor * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream */ function FormData(options) { if (!(this instanceof FormData)) { return new FormData(); } this._overheadLength = 0; this._valueLength = 0; this._valuesToMeasure = []; CombinedStream.call(this); options = options || {}; for (var option in options) { this[option] = options[option]; } } FormData.LINE_BREAK = '\r\n'; FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; FormData.prototype.append = function(field, value, options) { options = options || {}; // allow filename as single option if (typeof options == 'string') { options = {filename: options}; } var append = CombinedStream.prototype.append.bind(this); // all that streamy business can't handle numbers if (typeof value == 'number') { value = '' + value; } // https://github.com/felixge/node-form-data/issues/38 if (util.isArray(value)) { // Please convert your array into string // the way web server expects it this._error(new Error('Arrays are not supported.')); return; } var header = this._multiPartHeader(field, value, options); var footer = this._multiPartFooter(); append(header); append(value); append(footer); // pass along options.knownLength this._trackLength(header, value, options); }; FormData.prototype._trackLength = function(header, value, options) { var valueLength = 0; // used w/ getLengthSync(), when length is known. // e.g. for streaming directly from a remote server, // w/ a known file a size, and not wanting to wait for // incoming file to finish to get its size. if (options.knownLength != null) { valueLength += +options.knownLength; } else if (Buffer.isBuffer(value)) { valueLength = value.length; } else if (typeof value === 'string') { valueLength = Buffer.byteLength(value); } this._valueLength += valueLength; // @check why add CRLF? does this account for custom/multiple CRLFs? this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length; // empty or either doesn't have path or not an http response if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { return; } // no need to bother with the length if (!options.knownLength) { this._valuesToMeasure.push(value); } }; FormData.prototype._lengthRetriever = function(value, callback) { if (value.hasOwnProperty('fd')) { // take read range into a account // `end` = Infinity –> read file till the end // // TODO: Looks like there is bug in Node fs.createReadStream // it doesn't respect `end` options without `start` options // Fix it when node fixes it. // https://github.com/joyent/node/issues/7819 if (value.end != undefined && value.end != Infinity && value.start != undefined) { // when end specified // no need to calculate range // inclusive, starts with 0 callback(null, value.end + 1 - (value.start ? value.start : 0)); // not that fast snoopy } else { // still need to fetch file size from fs fs.stat(value.path, function(err, stat) { var fileSize; if (err) { callback(err); return; } // update final size based on the range options fileSize = stat.size - (value.start ? value.start : 0); callback(null, fileSize); }); } // or http response } else if (value.hasOwnProperty('httpVersion')) { callback(null, +value.headers['content-length']); // or request stream http://github.com/mikeal/request } else if (value.hasOwnProperty('httpModule')) { // wait till response come back value.on('response', function(response) { value.pause(); callback(null, +response.headers['content-length']); }); value.resume(); // something else } else { callback('Unknown stream'); } }; FormData.prototype._multiPartHeader = function(field, value, options) { // custom header specified (as string)? // it becomes responsible for boundary // (e.g. to handle extra CRLFs on .NET servers) if (typeof options.header == 'string') { return options.header; } var contentDisposition = this._getContentDisposition(value, options); var contentType = this._getContentType(value, options); var contents = ''; var headers = { // add custom disposition as third element or keep it two elements if not 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), // if no content type. allow it to be empty array 'Content-Type': [].concat(contentType || []) }; // allow custom headers. if (typeof options.header == 'object') { populate(headers, options.header); } var header; for (var prop in headers) { if (!headers.hasOwnProperty(prop)) continue; header = headers[prop]; // skip nullish headers. if (header == null) { continue; } // convert all headers to arrays. if (!Array.isArray(header)) { header = [header]; } // add non-empty headers. if (header.length) { contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; } } return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; }; FormData.prototype._getContentDisposition = function(value, options) { var filename , contentDisposition ; if (typeof options.filepath === 'string') { // custom filepath for relative paths filename = path.normalize(options.filepath).replace(/\\/g, '/'); } else if (options.filename || value.name || value.path) { // custom filename take precedence // formidable and the browser add a name property // fs- and request- streams have path property filename = path.basename(options.filename || value.name || value.path); } else if (value.readable && value.hasOwnProperty('httpVersion')) { // or try http response filename = path.basename(value.client._httpMessage.path); } if (filename) { contentDisposition = 'filename="' + filename + '"'; } return contentDisposition; }; FormData.prototype._getContentType = function(value, options) { // use custom content-type above all var contentType = options.contentType; // or try `name` from formidable, browser if (!contentType && value.name) { contentType = mime.lookup(value.name); } // or try `path` from fs-, request- streams if (!contentType && value.path) { contentType = mime.lookup(value.path); } // or if it's http-reponse if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { contentType = value.headers['content-type']; } // or guess it from the filepath or filename if (!contentType && (options.filepath || options.filename)) { contentType = mime.lookup(options.filepath || options.filename); } // fallback to the default content type if `value` is not simple value if (!contentType && typeof value == 'object') { contentType = FormData.DEFAULT_CONTENT_TYPE; } return contentType; }; FormData.prototype._multiPartFooter = function() { return function(next) { var footer = FormData.LINE_BREAK; var lastPart = (this._streams.length === 0); if (lastPart) { footer += this._lastBoundary(); } next(footer); }.bind(this); }; FormData.prototype._lastBoundary = function() { return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; }; FormData.prototype.getHeaders = function(userHeaders) { var header; var formHeaders = { 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() }; for (header in userHeaders) { if (userHeaders.hasOwnProperty(header)) { formHeaders[header.toLowerCase()] = userHeaders[header]; } } return formHeaders; }; FormData.prototype.getBoundary = function() { if (!this._boundary) { this._generateBoundary(); } return this._boundary; }; FormData.prototype._generateBoundary = function() { // This generates a 50 character boundary similar to those used by Firefox. // They are optimized for boyer-moore parsing. var boundary = '--------------------------'; for (var i = 0; i < 24; i++) { boundary += Math.floor(Math.random() * 10).toString(16); } this._boundary = boundary; }; // Note: getLengthSync DOESN'T calculate streams length // As workaround one can calculate file size manually // and add it as knownLength option FormData.prototype.getLengthSync = function() { var knownLength = this._overheadLength + this._valueLength; // Don't get confused, there are 3 "internal" streams for each keyval pair // so it basically checks if there is any value added to the form if (this._streams.length) { knownLength += this._lastBoundary().length; } // https://github.com/form-data/form-data/issues/40 if (!this.hasKnownLength()) { // Some async length retrievers are present // therefore synchronous length calculation is false. // Please use getLength(callback) to get proper length this._error(new Error('Cannot calculate proper length in synchronous way.')); } return knownLength; }; // Public API to check if length of added values is known // https://github.com/form-data/form-data/issues/196 // https://github.com/form-data/form-data/issues/262 FormData.prototype.hasKnownLength = function() { var hasKnownLength = true; if (this._valuesToMeasure.length) { hasKnownLength = false; } return hasKnownLength; }; FormData.prototype.getLength = function(cb) { var knownLength = this._overheadLength + this._valueLength; if (this._streams.length) { knownLength += this._lastBoundary().length; } if (!this._valuesToMeasure.length) { process.nextTick(cb.bind(this, null, knownLength)); return; } asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { if (err) { cb(err); return; } values.forEach(function(length) { knownLength += length; }); cb(null, knownLength); }); }; FormData.prototype.submit = function(params, cb) { var request , options , defaults = {method: 'post'} ; // parse provided url if it's string // or treat it as options object if (typeof params == 'string') { params = parseUrl(params); options = populate({ port: params.port, path: params.pathname, host: params.hostname, protocol: params.protocol }, defaults); // use custom params } else { options = populate(params, defaults); // if no port provided use default one if (!options.port) { options.port = options.protocol == 'https:' ? 443 : 80; } } // put that good code in getHeaders to some use options.headers = this.getHeaders(params.headers); // https if specified, fallback to http in any other case if (options.protocol == 'https:') { request = https.request(options); } else { request = http.request(options); } // get content length and fire away this.getLength(function(err, length) { if (err) { this._error(err); return; } // add content length request.setHeader('Content-Length', length); this.pipe(request); if (cb) { request.on('error', cb); request.on('response', cb.bind(this, null)); } }.bind(this)); return request; }; FormData.prototype._error = function(err) { if (!this.error) { this.error = err; this.pause(); this.emit('error', err); } }; FormData.prototype.toString = function () { return '[object FormData]'; }; /***/ }), /***/ 94932: /***/ ((module) => { // populates missing values module.exports = function(dst, src) { Object.keys(src).forEach(function(prop) { dst[prop] = dst[prop] || src[prop]; }); return dst; }; /***/ }), /***/ 28321: /***/ ((module) => { "use strict"; var replace = String.prototype.replace; var percentTwenties = /%20/g; module.exports = { 'default': 'RFC3986', formatters: { RFC1738: function (value) { return replace.call(value, percentTwenties, '+'); }, RFC3986: function (value) { return value; } }, RFC1738: 'RFC1738', RFC3986: 'RFC3986' }; /***/ }), /***/ 47457: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var stringify = __webpack_require__(64021); var parse = __webpack_require__(90693); var formats = __webpack_require__(28321); module.exports = { formats: formats, parse: parse, stringify: stringify }; /***/ }), /***/ 90693: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(17409); var has = Object.prototype.hasOwnProperty; var defaults = { allowDots: false, allowPrototypes: false, arrayLimit: 20, decoder: utils.decode, delimiter: '&', depth: 5, parameterLimit: 1000, plainObjects: false, strictNullHandling: false }; var parseValues = function parseQueryStringValues(str, options) { var obj = {}; var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; var parts = cleanStr.split(options.delimiter, limit); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var bracketEqualsPos = part.indexOf(']='); var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { key = options.decoder(part, defaults.decoder); val = options.strictNullHandling ? null : ''; } else { key = options.decoder(part.slice(0, pos), defaults.decoder); val = options.decoder(part.slice(pos + 1), defaults.decoder); } if (has.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); } else { obj[key] = val; } } return obj; }; var parseObject = function (chain, val, options) { var leaf = val; for (var i = chain.length - 1; i >= 0; --i) { var obj; var root = chain[i]; if (root === '[]') { obj = []; obj = obj.concat(leaf); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var index = parseInt(cleanRoot, 10); if ( !isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit) ) { obj = []; obj[index] = leaf; } else { obj[cleanRoot] = leaf; } } leaf = obj; } return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { if (!givenKey) { return; } // Transform dot notation to bracket notation var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; // The regex chunks var brackets = /(\[[^[\]]*])/; var child = /(\[[^[\]]*])/g; // Get the parent var segment = brackets.exec(key); var parent = segment ? key.slice(0, segment.index) : key; // Stash the parent if it exists var keys = []; if (parent) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties if (!options.plainObjects && has.call(Object.prototype, parent)) { if (!options.allowPrototypes) { return; } } keys.push(parent); } // Loop through children appending to the array until we hit depth var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { if (!options.allowPrototypes) { return; } } keys.push(segment[1]); } // If there's a remainder, just add whatever is left if (segment) { keys.push('[' + key.slice(segment.index) + ']'); } return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts ? utils.assign({}, opts) : {}; if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = parseKeys(key, tempObj[key], options); obj = utils.merge(obj, newObj, options); } return utils.compact(obj); }; /***/ }), /***/ 64021: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(17409); var formats = __webpack_require__(28321); var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching return prefix + '[]'; }, indices: function indices(prefix, key) { // eslint-disable-line func-name-matching return prefix + '[' + key + ']'; }, repeat: function repeat(prefix) { // eslint-disable-line func-name-matching return prefix; } }; var toISO = Date.prototype.toISOString; var defaults = { delimiter: '&', encode: true, encoder: utils.encode, encodeValuesOnly: false, serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching return toISO.call(date); }, skipNulls: false, strictNullHandling: false }; var stringify = function stringify( // eslint-disable-line func-name-matching object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly ) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); } else if (obj instanceof Date) { obj = serializeDate(obj); } else if (obj === null) { if (strictNullHandling) { return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; } obj = ''; } if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys; if (Array.isArray(filter)) { objKeys = filter; } else { var keys = Object.keys(obj); objKeys = sort ? keys.sort(sort) : keys; } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } if (Array.isArray(obj)) { values = values.concat(stringify( obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } else { values = values.concat(stringify( obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } } return values; }; module.exports = function (object, opts) { var obj = object; var options = opts ? utils.assign({}, opts) : {}; if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); } var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; if (typeof options.format === 'undefined') { options.format = formats['default']; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); } var formatter = formats.formatters[options.format]; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); } else if (Array.isArray(options.filter)) { filter = options.filter; objKeys = filter; } var keys = []; if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); } if (sort) { objKeys.sort(sort); } for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; if (skipNulls && obj[key] === null) { continue; } keys = keys.concat(stringify( obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode ? encoder : null, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly )); } var joined = keys.join(delimiter); var prefix = options.addQueryPrefix === true ? '?' : ''; return joined.length > 0 ? prefix + joined : ''; }; /***/ }), /***/ 17409: /***/ ((module) => { "use strict"; var has = Object.prototype.hasOwnProperty; var hexTable = (function () { var array = []; for (var i = 0; i < 256; ++i) { array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); } return array; }()); var compactQueue = function compactQueue(queue) { var obj; while (queue.length) { var item = queue.pop(); obj = item.obj[item.prop]; if (Array.isArray(obj)) { var compacted = []; for (var j = 0; j < obj.length; ++j) { if (typeof obj[j] !== 'undefined') { compacted.push(obj[j]); } } item.obj[item.prop] = compacted; } } return obj; }; var arrayToObject = function arrayToObject(source, options) { var obj = options && options.plainObjects ? Object.create(null) : {}; for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { obj[i] = source[i]; } } return obj; }; var merge = function merge(target, source, options) { if (!source) { return target; } if (typeof source !== 'object') { if (Array.isArray(target)) { target.push(source); } else if (typeof target === 'object') { if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { target[source] = true; } } else { return [target, source]; } return target; } if (typeof target !== 'object') { return [target].concat(source); } var mergeTarget = target; if (Array.isArray(target) && !Array.isArray(source)) { mergeTarget = arrayToObject(target, options); } if (Array.isArray(target) && Array.isArray(source)) { source.forEach(function (item, i) { if (has.call(target, i)) { if (target[i] && typeof target[i] === 'object') { target[i] = merge(target[i], item, options); } else { target.push(item); } } else { target[i] = item; } }); return target; } return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (has.call(acc, key)) { acc[key] = merge(acc[key], value, options); } else { acc[key] = value; } return acc; }, mergeTarget); }; var assign = function assignSingleSource(target, source) { return Object.keys(source).reduce(function (acc, key) { acc[key] = source[key]; return acc; }, target); }; var decode = function (str) { try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { return str; } }; var encode = function encode(str) { // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } var string = typeof str === 'string' ? str : String(str); var out = ''; for (var i = 0; i < string.length; ++i) { var c = string.charCodeAt(i); if ( c === 0x2D // - || c === 0x2E // . || c === 0x5F // _ || c === 0x7E // ~ || (c >= 0x30 && c <= 0x39) // 0-9 || (c >= 0x41 && c <= 0x5A) // a-z || (c >= 0x61 && c <= 0x7A) // A-Z ) { out += string.charAt(i); continue; } if (c < 0x80) { out = out + hexTable[c]; continue; } if (c < 0x800) { out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; }; var compact = function compact(value) { var queue = [{ obj: { o: value }, prop: 'o' }]; var refs = []; for (var i = 0; i < queue.length; ++i) { var item = queue[i]; var obj = item.obj[item.prop]; var keys = Object.keys(obj); for (var j = 0; j < keys.length; ++j) { var key = keys[j]; var val = obj[key]; if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { queue.push({ obj: obj, prop: key }); refs.push(val); } } } return compactQueue(queue); }; var isRegExp = function isRegExp(obj) { return Object.prototype.toString.call(obj) === '[object RegExp]'; }; var isBuffer = function isBuffer(obj) { if (obj === null || typeof obj === 'undefined') { return false; } return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; module.exports = { arrayToObject: arrayToObject, assign: assign, compact: compact, decode: decode, encode: encode, isBuffer: isBuffer, isRegExp: isRegExp, merge: merge }; /***/ }), /***/ 67087: /***/ ((module) => { /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 return ([ bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]] ]).join(''); } module.exports = bytesToUuid; /***/ }), /***/ 9117: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. var crypto = __webpack_require__(76417); module.exports = function nodeRNG() { return crypto.randomBytes(16); }; /***/ }), /***/ 71435: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var rng = __webpack_require__(9117); var bytesToUuid = __webpack_require__(67087); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }), /***/ 70304: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var http = __webpack_require__(98605) var https = __webpack_require__(57211) var url = __webpack_require__(78835) var util = __webpack_require__(31669) var stream = __webpack_require__(92413) var zlib = __webpack_require__(78761) var aws2 = __webpack_require__(96342) var aws4 = __webpack_require__(16071) var httpSignature = __webpack_require__(42479) var mime = __webpack_require__(43583) var caseless = __webpack_require__(35684) var ForeverAgent = __webpack_require__(47568) var FormData = __webpack_require__(11377) var extend = __webpack_require__(38171) var isstream = __webpack_require__(83362) var isTypedArray = __webpack_require__(10657).strict var helpers = __webpack_require__(74845) var cookies = __webpack_require__(50976) var getProxyFromURI = __webpack_require__(75654) var Querystring = __webpack_require__(66476)/* .Querystring */ .h var Har = __webpack_require__(3248)/* .Har */ .t var Auth = __webpack_require__(76996)/* .Auth */ .g var OAuth = __webpack_require__(41174)/* .OAuth */ .f var hawk = __webpack_require__(34473) var Multipart = __webpack_require__(87810)/* .Multipart */ .$ var Redirect = __webpack_require__(3048)/* .Redirect */ .l var Tunnel = __webpack_require__(17619)/* .Tunnel */ .n var now = __webpack_require__(85644) var Buffer = __webpack_require__(21867).Buffer var safeStringify = helpers.safeStringify var isReadStream = helpers.isReadStream var toBase64 = helpers.toBase64 var defer = helpers.defer var copy = helpers.copy var version = helpers.version var globalCookieJar = cookies.jar() var globalPool = {} function filterForNonReserved (reserved, options) { // Filter out properties that are not reserved. // Reserved values are passed in at call site. var object = {} for (var i in options) { var notReserved = (reserved.indexOf(i) === -1) if (notReserved) { object[i] = options[i] } } return object } function filterOutReservedFunctions (reserved, options) { // Filter out properties that are functions and are reserved. // Reserved values are passed in at call site. var object = {} for (var i in options) { var isReserved = !(reserved.indexOf(i) === -1) var isFunction = (typeof options[i] === 'function') if (!(isReserved && isFunction)) { object[i] = options[i] } } return object } // Return a simpler request object to allow serialization function requestToJSON () { var self = this return { uri: self.uri, method: self.method, headers: self.headers } } // Return a simpler response object to allow serialization function responseToJSON () { var self = this return { statusCode: self.statusCode, body: self.body, headers: self.headers, request: requestToJSON.call(self.request) } } function Request (options) { // if given the method property in options, set property explicitMethod to true // extend the Request instance with any non-reserved properties // remove any reserved functions from the options object // set Request instance to be readable and writable // call init var self = this // start with HAR, then override with additional options if (options.har) { self._har = new Har(self) options = self._har.options(options) } stream.Stream.call(self) var reserved = Object.keys(Request.prototype) var nonReserved = filterForNonReserved(reserved, options) extend(self, nonReserved) options = filterOutReservedFunctions(reserved, options) self.readable = true self.writable = true if (options.method) { self.explicitMethod = true } self._qs = new Querystring(self) self._auth = new Auth(self) self._oauth = new OAuth(self) self._multipart = new Multipart(self) self._redirect = new Redirect(self) self._tunnel = new Tunnel(self) self.init(options) } util.inherits(Request, stream.Stream) // Debugging Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) function debug () { if (Request.debug) { console.error('REQUEST %s', util.format.apply(util, arguments)) } } Request.prototype.debug = debug Request.prototype.init = function (options) { // init() contains all the code to setup the request object. // the actual outgoing request is not started until start() is called // this function is called from both the constructor and on redirect. var self = this if (!options) { options = {} } self.headers = self.headers ? copy(self.headers) : {} // Delete headers with value undefined since they break // ClientRequest.OutgoingMessage.setHeader in node 0.12 for (var headerName in self.headers) { if (typeof self.headers[headerName] === 'undefined') { delete self.headers[headerName] } } caseless.httpify(self, self.headers) if (!self.method) { self.method = options.method || 'GET' } if (!self.localAddress) { self.localAddress = options.localAddress } self._qs.init(options) debug(options) if (!self.pool && self.pool !== false) { self.pool = globalPool } self.dests = self.dests || [] self.__isRequestRequest = true // Protect against double callback if (!self._callback && self.callback) { self._callback = self.callback self.callback = function () { if (self._callbackCalled) { return // Print a warning maybe? } self._callbackCalled = true self._callback.apply(self, arguments) } self.on('error', self.callback.bind()) self.on('complete', self.callback.bind(self, null)) } // People use this property instead all the time, so support it if (!self.uri && self.url) { self.uri = self.url delete self.url } // If there's a baseUrl, then use it as the base URL (i.e. uri must be // specified as a relative path and is appended to baseUrl). if (self.baseUrl) { if (typeof self.baseUrl !== 'string') { return self.emit('error', new Error('options.baseUrl must be a string')) } if (typeof self.uri !== 'string') { return self.emit('error', new Error('options.uri must be a string when using options.baseUrl')) } if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) { return self.emit('error', new Error('options.uri must be a path when using options.baseUrl')) } // Handle all cases to make sure that there's only one slash between // baseUrl and uri. var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1 var uriStartsWithSlash = self.uri.indexOf('/') === 0 if (baseUrlEndsWithSlash && uriStartsWithSlash) { self.uri = self.baseUrl + self.uri.slice(1) } else if (baseUrlEndsWithSlash || uriStartsWithSlash) { self.uri = self.baseUrl + self.uri } else if (self.uri === '') { self.uri = self.baseUrl } else { self.uri = self.baseUrl + '/' + self.uri } delete self.baseUrl } // A URI is needed by this point, emit error if we haven't been able to get one if (!self.uri) { return self.emit('error', new Error('options.uri is a required argument')) } // If a string URI/URL was given, parse it into a URL object if (typeof self.uri === 'string') { self.uri = url.parse(self.uri) } // Some URL objects are not from a URL parsed string and need href added if (!self.uri.href) { self.uri.href = url.format(self.uri) } // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme if (self.uri.protocol === 'unix:') { return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) } // Support Unix Sockets if (self.uri.host === 'unix') { self.enableUnixSocket() } if (self.strictSSL === false) { self.rejectUnauthorized = false } if (!self.uri.pathname) { self.uri.pathname = '/' } if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar // Detect and reject it as soon as possible var faultyUri = url.format(self.uri) var message = 'Invalid URI "' + faultyUri + '"' if (Object.keys(options).length === 0) { // No option ? This can be the sign of a redirect // As this is a case where the user cannot do anything (they didn't call request directly with this URL) // they should be warned that it can be caused by a redirection (can save some hair) message += '. This can be caused by a crappy redirection.' } // This error was fatal self.abort() return self.emit('error', new Error(message)) } if (!self.hasOwnProperty('proxy')) { self.proxy = getProxyFromURI(self.uri) } self.tunnel = self._tunnel.isEnabled() if (self.proxy) { self._tunnel.setup(options) } self._redirect.onRequest(options) self.setHost = false if (!self.hasHeader('host')) { var hostHeaderName = self.originalHostHeaderName || 'host' self.setHeader(hostHeaderName, self.uri.host) // Drop :port suffix from Host header if known protocol. if (self.uri.port) { if ((self.uri.port === '80' && self.uri.protocol === 'http:') || (self.uri.port === '443' && self.uri.protocol === 'https:')) { self.setHeader(hostHeaderName, self.uri.hostname) } } self.setHost = true } self.jar(self._jar || options.jar) if (!self.uri.port) { if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 } } if (self.proxy && !self.tunnel) { self.port = self.proxy.port self.host = self.proxy.hostname } else { self.port = self.uri.port self.host = self.uri.hostname } if (options.form) { self.form(options.form) } if (options.formData) { var formData = options.formData var requestForm = self.form() var appendFormValue = function (key, value) { if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { requestForm.append(key, value.value, value.options) } else { requestForm.append(key, value) } } for (var formKey in formData) { if (formData.hasOwnProperty(formKey)) { var formValue = formData[formKey] if (formValue instanceof Array) { for (var j = 0; j < formValue.length; j++) { appendFormValue(formKey, formValue[j]) } } else { appendFormValue(formKey, formValue) } } } } if (options.qs) { self.qs(options.qs) } if (self.uri.path) { self.path = self.uri.path } else { self.path = self.uri.pathname + (self.uri.search || '') } if (self.path.length === 0) { self.path = '/' } // Auth must happen last in case signing is dependent on other headers if (options.aws) { self.aws(options.aws) } if (options.hawk) { self.hawk(options.hawk) } if (options.httpSignature) { self.httpSignature(options.httpSignature) } if (options.auth) { if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { options.auth.user = options.auth.username } if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { options.auth.pass = options.auth.password } self.auth( options.auth.user, options.auth.pass, options.auth.sendImmediately, options.auth.bearer ) } if (self.gzip && !self.hasHeader('accept-encoding')) { self.setHeader('accept-encoding', 'gzip, deflate') } if (self.uri.auth && !self.hasHeader('authorization')) { var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) }) self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) } if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) }) var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) self.setHeader('proxy-authorization', authHeader) } if (self.proxy && !self.tunnel) { self.path = (self.uri.protocol + '//' + self.uri.host + self.path) } if (options.json) { self.json(options.json) } if (options.multipart) { self.multipart(options.multipart) } if (options.time) { self.timing = true // NOTE: elapsedTime is deprecated in favor of .timings self.elapsedTime = self.elapsedTime || 0 } function setContentLength () { if (isTypedArray(self.body)) { self.body = Buffer.from(self.body) } if (!self.hasHeader('content-length')) { var length if (typeof self.body === 'string') { length = Buffer.byteLength(self.body) } else if (Array.isArray(self.body)) { length = self.body.reduce(function (a, b) { return a + b.length }, 0) } else { length = self.body.length } if (length) { self.setHeader('content-length', length) } else { self.emit('error', new Error('Argument error, options.body.')) } } } if (self.body && !isstream(self.body)) { setContentLength() } if (options.oauth) { self.oauth(options.oauth) } else if (self._oauth.params && self.hasHeader('authorization')) { self.oauth(self._oauth.params) } var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol var defaultModules = {'http:': http, 'https:': https} var httpModules = self.httpModules || {} self.httpModule = httpModules[protocol] || defaultModules[protocol] if (!self.httpModule) { return self.emit('error', new Error('Invalid protocol: ' + protocol)) } if (options.ca) { self.ca = options.ca } if (!self.agent) { if (options.agentOptions) { self.agentOptions = options.agentOptions } if (options.agentClass) { self.agentClass = options.agentClass } else if (options.forever) { var v = version() // use ForeverAgent in node 0.10- only if (v.major === 0 && v.minor <= 10) { self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL } else { self.agentClass = self.httpModule.Agent self.agentOptions = self.agentOptions || {} self.agentOptions.keepAlive = true } } else { self.agentClass = self.httpModule.Agent } } if (self.pool === false) { self.agent = false } else { self.agent = self.agent || self.getNewAgent() } self.on('pipe', function (src) { if (self.ntick && self._started) { self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.')) } self.src = src if (isReadStream(src)) { if (!self.hasHeader('content-type')) { self.setHeader('content-type', mime.lookup(src.path)) } } else { if (src.headers) { for (var i in src.headers) { if (!self.hasHeader(i)) { self.setHeader(i, src.headers[i]) } } } if (self._json && !self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } if (src.method && !self.explicitMethod) { self.method = src.method } } // self.on('pipe', function () { // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') // }) }) defer(function () { if (self._aborted) { return } var end = function () { if (self._form) { if (!self._auth.hasAuth) { self._form.pipe(self) } else if (self._auth.hasAuth && self._auth.sentAuth) { self._form.pipe(self) } } if (self._multipart && self._multipart.chunked) { self._multipart.body.pipe(self) } if (self.body) { if (isstream(self.body)) { self.body.pipe(self) } else { setContentLength() if (Array.isArray(self.body)) { self.body.forEach(function (part) { self.write(part) }) } else { self.write(self.body) } self.end() } } else if (self.requestBodyStream) { console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') self.requestBodyStream.pipe(self) } else if (!self.src) { if (self._auth.hasAuth && !self._auth.sentAuth) { self.end() return } if (self.method !== 'GET' && typeof self.method !== 'undefined') { self.setHeader('content-length', 0) } self.end() } } if (self._form && !self.hasHeader('content-length')) { // Before ending the request, we had to compute the length of the whole form, asyncly self.setHeader(self._form.getHeaders(), true) self._form.getLength(function (err, length) { if (!err && !isNaN(length)) { self.setHeader('content-length', length) } end() }) } else { end() } self.ntick = true }) } Request.prototype.getNewAgent = function () { var self = this var Agent = self.agentClass var options = {} if (self.agentOptions) { for (var i in self.agentOptions) { options[i] = self.agentOptions[i] } } if (self.ca) { options.ca = self.ca } if (self.ciphers) { options.ciphers = self.ciphers } if (self.secureProtocol) { options.secureProtocol = self.secureProtocol } if (self.secureOptions) { options.secureOptions = self.secureOptions } if (typeof self.rejectUnauthorized !== 'undefined') { options.rejectUnauthorized = self.rejectUnauthorized } if (self.cert && self.key) { options.key = self.key options.cert = self.cert } if (self.pfx) { options.pfx = self.pfx } if (self.passphrase) { options.passphrase = self.passphrase } var poolKey = '' // different types of agents are in different pools if (Agent !== self.httpModule.Agent) { poolKey += Agent.name } // ca option is only relevant if proxy or destination are https var proxy = self.proxy if (typeof proxy === 'string') { proxy = url.parse(proxy) } var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' if (isHttps) { if (options.ca) { if (poolKey) { poolKey += ':' } poolKey += options.ca } if (typeof options.rejectUnauthorized !== 'undefined') { if (poolKey) { poolKey += ':' } poolKey += options.rejectUnauthorized } if (options.cert) { if (poolKey) { poolKey += ':' } poolKey += options.cert.toString('ascii') + options.key.toString('ascii') } if (options.pfx) { if (poolKey) { poolKey += ':' } poolKey += options.pfx.toString('ascii') } if (options.ciphers) { if (poolKey) { poolKey += ':' } poolKey += options.ciphers } if (options.secureProtocol) { if (poolKey) { poolKey += ':' } poolKey += options.secureProtocol } if (options.secureOptions) { if (poolKey) { poolKey += ':' } poolKey += options.secureOptions } } if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { // not doing anything special. Use the globalAgent return self.httpModule.globalAgent } // we're using a stored agent. Make sure it's protocol-specific poolKey = self.uri.protocol + poolKey // generate a new agent for this setting if none yet exists if (!self.pool[poolKey]) { self.pool[poolKey] = new Agent(options) // properly set maxSockets on new agents if (self.pool.maxSockets) { self.pool[poolKey].maxSockets = self.pool.maxSockets } } return self.pool[poolKey] } Request.prototype.start = function () { // start() is called once we are ready to send the outgoing HTTP request. // this is usually called on the first write(), end() or on nextTick() var self = this if (self.timing) { // All timings will be relative to this request's startTime. In order to do this, // we need to capture the wall-clock start time (via Date), immediately followed // by the high-resolution timer (via now()). While these two won't be set // at the _exact_ same time, they should be close enough to be able to calculate // high-resolution, monotonically non-decreasing timestamps relative to startTime. var startTime = new Date().getTime() var startTimeNow = now() } if (self._aborted) { return } self._started = true self.method = self.method || 'GET' self.href = self.uri.href if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { self.setHeader('content-length', self.src.stat.size) } if (self._aws) { self.aws(self._aws, true) } // We have a method named auth, which is completely different from the http.request // auth option. If we don't remove it, we're gonna have a bad time. var reqOptions = copy(self) delete reqOptions.auth debug('make request', self.uri.href) // node v6.8.0 now supports a `timeout` value in `http.request()`, but we // should delete it for now since we handle timeouts manually for better // consistency with node versions before v6.8.0 delete reqOptions.timeout try { self.req = self.httpModule.request(reqOptions) } catch (err) { self.emit('error', err) return } if (self.timing) { self.startTime = startTime self.startTimeNow = startTimeNow // Timing values will all be relative to startTime (by comparing to startTimeNow // so we have an accurate clock) self.timings = {} } var timeout if (self.timeout && !self.timeoutTimer) { if (self.timeout < 0) { timeout = 0 } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) { timeout = self.timeout } } self.req.on('response', self.onRequestResponse.bind(self)) self.req.on('error', self.onRequestError.bind(self)) self.req.on('drain', function () { self.emit('drain') }) self.req.on('socket', function (socket) { // `._connecting` was the old property which was made public in node v6.1.0 var isConnecting = socket._connecting || socket.connecting if (self.timing) { self.timings.socket = now() - self.startTimeNow if (isConnecting) { var onLookupTiming = function () { self.timings.lookup = now() - self.startTimeNow } var onConnectTiming = function () { self.timings.connect = now() - self.startTimeNow } socket.once('lookup', onLookupTiming) socket.once('connect', onConnectTiming) // clean up timing event listeners if needed on error self.req.once('error', function () { socket.removeListener('lookup', onLookupTiming) socket.removeListener('connect', onConnectTiming) }) } } var setReqTimeout = function () { // This timeout sets the amount of time to wait *between* bytes sent // from the server once connected. // // In particular, it's useful for erroring if the server fails to send // data halfway through streaming a response. self.req.setTimeout(timeout, function () { if (self.req) { self.abort() var e = new Error('ESOCKETTIMEDOUT') e.code = 'ESOCKETTIMEDOUT' e.connect = false self.emit('error', e) } }) } if (timeout !== undefined) { // Only start the connection timer if we're actually connecting a new // socket, otherwise if we're already connected (because this is a // keep-alive connection) do not bother. This is important since we won't // get a 'connect' event for an already connected socket. if (isConnecting) { var onReqSockConnect = function () { socket.removeListener('connect', onReqSockConnect) self.clearTimeout() setReqTimeout() } socket.on('connect', onReqSockConnect) self.req.on('error', function (err) { // eslint-disable-line handle-callback-err socket.removeListener('connect', onReqSockConnect) }) // Set a timeout in memory - this block will throw if the server takes more // than `timeout` to write the HTTP status and headers (corresponding to // the on('response') event on the client). NB: this measures wall-clock // time, not the time between bytes sent by the server. self.timeoutTimer = setTimeout(function () { socket.removeListener('connect', onReqSockConnect) self.abort() var e = new Error('ETIMEDOUT') e.code = 'ETIMEDOUT' e.connect = true self.emit('error', e) }, timeout) } else { // We're already connected setReqTimeout() } } self.emit('socket', socket) }) self.emit('request', self.req) } Request.prototype.onRequestError = function (error) { var self = this if (self._aborted) { return } if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' && self.agent.addRequestNoreuse) { self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } self.start() self.req.end() return } self.clearTimeout() self.emit('error', error) } Request.prototype.onRequestResponse = function (response) { var self = this if (self.timing) { self.timings.response = now() - self.startTimeNow } debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) response.on('end', function () { if (self.timing) { self.timings.end = now() - self.startTimeNow response.timingStart = self.startTime // fill in the blanks for any periods that didn't trigger, such as // no lookup or connect due to keep alive if (!self.timings.socket) { self.timings.socket = 0 } if (!self.timings.lookup) { self.timings.lookup = self.timings.socket } if (!self.timings.connect) { self.timings.connect = self.timings.lookup } if (!self.timings.response) { self.timings.response = self.timings.connect } debug('elapsed time', self.timings.end) // elapsedTime includes all redirects self.elapsedTime += Math.round(self.timings.end) // NOTE: elapsedTime is deprecated in favor of .timings response.elapsedTime = self.elapsedTime // timings is just for the final fetch response.timings = self.timings // pre-calculate phase timings as well response.timingPhases = { wait: self.timings.socket, dns: self.timings.lookup - self.timings.socket, tcp: self.timings.connect - self.timings.lookup, firstByte: self.timings.response - self.timings.connect, download: self.timings.end - self.timings.response, total: self.timings.end } } debug('response end', self.uri.href, response.statusCode, response.headers) }) if (self._aborted) { debug('aborted', self.uri.href) response.resume() return } self.response = response response.request = self response.toJSON = responseToJSON // XXX This is different on 0.10, because SSL is strict by default if (self.httpModule === https && self.strictSSL && (!response.hasOwnProperty('socket') || !response.socket.authorized)) { debug('strict ssl error', self.uri.href) var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL' self.emit('error', new Error('SSL Error: ' + sslErr)) return } // Save the original host before any redirect (if it changes, we need to // remove any authorization headers). Also remember the case of the header // name because lots of broken servers expect Host instead of host and we // want the caller to be able to specify this. self.originalHost = self.getHeader('host') if (!self.originalHostHeaderName) { self.originalHostHeaderName = self.hasHeader('host') } if (self.setHost) { self.removeHeader('host') } self.clearTimeout() var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar var addCookie = function (cookie) { // set the cookie if it's domain in the href's domain. try { targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) } catch (e) { self.emit('error', e) } } response.caseless = caseless(response.headers) if (response.caseless.has('set-cookie') && (!self._disableCookies)) { var headerName = response.caseless.has('set-cookie') if (Array.isArray(response.headers[headerName])) { response.headers[headerName].forEach(addCookie) } else { addCookie(response.headers[headerName]) } } if (self._redirect.onResponse(response)) { return // Ignore the rest of the response } else { // Be a good stream and emit end when the response is finished. // Hack to emit end on close because of a core bug that never fires end response.on('close', function () { if (!self._ended) { self.response.emit('end') } }) response.once('end', function () { self._ended = true }) var noBody = function (code) { return ( self.method === 'HEAD' || // Informational (code >= 100 && code < 200) || // No Content code === 204 || // Not Modified code === 304 ) } var responseContent if (self.gzip && !noBody(response.statusCode)) { var contentEncoding = response.headers['content-encoding'] || 'identity' contentEncoding = contentEncoding.trim().toLowerCase() // Be more lenient with decoding compressed responses, since (very rarely) // servers send slightly invalid gzip responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. var zlibOptions = { flush: zlib.Z_SYNC_FLUSH, finishFlush: zlib.Z_SYNC_FLUSH } if (contentEncoding === 'gzip') { responseContent = zlib.createGunzip(zlibOptions) response.pipe(responseContent) } else if (contentEncoding === 'deflate') { responseContent = zlib.createInflate(zlibOptions) response.pipe(responseContent) } else { // Since previous versions didn't check for Content-Encoding header, // ignore any invalid values to preserve backwards-compatibility if (contentEncoding !== 'identity') { debug('ignoring unrecognized Content-Encoding ' + contentEncoding) } responseContent = response } } else { responseContent = response } if (self.encoding) { if (self.dests.length !== 0) { console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') } else { responseContent.setEncoding(self.encoding) } } if (self._paused) { responseContent.pause() } self.responseContent = responseContent self.emit('response', response) self.dests.forEach(function (dest) { self.pipeDest(dest) }) responseContent.on('data', function (chunk) { if (self.timing && !self.responseStarted) { self.responseStartTime = (new Date()).getTime() // NOTE: responseStartTime is deprecated in favor of .timings response.responseStartTime = self.responseStartTime } self._destdata = true self.emit('data', chunk) }) responseContent.once('end', function (chunk) { self.emit('end', chunk) }) responseContent.on('error', function (error) { self.emit('error', error) }) responseContent.on('close', function () { self.emit('close') }) if (self.callback) { self.readResponseBody(response) } else { // if no callback self.on('end', function () { if (self._aborted) { debug('aborted', self.uri.href) return } self.emit('complete', response) }) } } debug('finish init function', self.uri.href) } Request.prototype.readResponseBody = function (response) { var self = this debug("reading response's body") var buffers = [] var bufferLength = 0 var strings = [] self.on('data', function (chunk) { if (!Buffer.isBuffer(chunk)) { strings.push(chunk) } else if (chunk.length) { bufferLength += chunk.length buffers.push(chunk) } }) self.on('end', function () { debug('end event', self.uri.href) if (self._aborted) { debug('aborted', self.uri.href) // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request. // This can lead to leaky behavior if the user retains a reference to the request object. buffers = [] bufferLength = 0 return } if (bufferLength) { debug('has body', self.uri.href, bufferLength) response.body = Buffer.concat(buffers, bufferLength) if (self.encoding !== null) { response.body = response.body.toString(self.encoding) } // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request. // This can lead to leaky behavior if the user retains a reference to the request object. buffers = [] bufferLength = 0 } else if (strings.length) { // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { strings[0] = strings[0].substring(1) } response.body = strings.join('') } if (self._json) { try { response.body = JSON.parse(response.body, self._jsonReviver) } catch (e) { debug('invalid JSON received', self.uri.href) } } debug('emitting complete', self.uri.href) if (typeof response.body === 'undefined' && !self._json) { response.body = self.encoding === null ? Buffer.alloc(0) : '' } self.emit('complete', response, response.body) }) } Request.prototype.abort = function () { var self = this self._aborted = true if (self.req) { self.req.abort() } else if (self.response) { self.response.destroy() } self.clearTimeout() self.emit('abort') } Request.prototype.pipeDest = function (dest) { var self = this var response = self.response // Called after the response is received if (dest.headers && !dest.headersSent) { if (response.caseless.has('content-type')) { var ctname = response.caseless.has('content-type') if (dest.setHeader) { dest.setHeader(ctname, response.headers[ctname]) } else { dest.headers[ctname] = response.headers[ctname] } } if (response.caseless.has('content-length')) { var clname = response.caseless.has('content-length') if (dest.setHeader) { dest.setHeader(clname, response.headers[clname]) } else { dest.headers[clname] = response.headers[clname] } } } if (dest.setHeader && !dest.headersSent) { for (var i in response.headers) { // If the response content is being decoded, the Content-Encoding header // of the response doesn't represent the piped content, so don't pass it. if (!self.gzip || i !== 'content-encoding') { dest.setHeader(i, response.headers[i]) } } dest.statusCode = response.statusCode } if (self.pipefilter) { self.pipefilter(response, dest) } } Request.prototype.qs = function (q, clobber) { var self = this var base if (!clobber && self.uri.query) { base = self._qs.parse(self.uri.query) } else { base = {} } for (var i in q) { base[i] = q[i] } var qs = self._qs.stringify(base) if (qs === '') { return self } self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) self.url = self.uri self.path = self.uri.path if (self.uri.host === 'unix') { self.enableUnixSocket() } return self } Request.prototype.form = function (form) { var self = this if (form) { if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { self.setHeader('content-type', 'application/x-www-form-urlencoded') } self.body = (typeof form === 'string') ? self._qs.rfc3986(form.toString('utf8')) : self._qs.stringify(form).toString('utf8') return self } // create form-data object self._form = new FormData() self._form.on('error', function (err) { err.message = 'form-data: ' + err.message self.emit('error', err) self.abort() }) return self._form } Request.prototype.multipart = function (multipart) { var self = this self._multipart.onRequest(multipart) if (!self._multipart.chunked) { self.body = self._multipart.body } return self } Request.prototype.json = function (val) { var self = this if (!self.hasHeader('accept')) { self.setHeader('accept', 'application/json') } if (typeof self.jsonReplacer === 'function') { self._jsonReplacer = self.jsonReplacer } self._json = true if (typeof val === 'boolean') { if (self.body !== undefined) { if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { self.body = safeStringify(self.body, self._jsonReplacer) } else { self.body = self._qs.rfc3986(self.body) } if (!self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } } } else { self.body = safeStringify(val, self._jsonReplacer) if (!self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') } } if (typeof self.jsonReviver === 'function') { self._jsonReviver = self.jsonReviver } return self } Request.prototype.getHeader = function (name, headers) { var self = this var result, re, match if (!headers) { headers = self.headers } Object.keys(headers).forEach(function (key) { if (key.length !== name.length) { return } re = new RegExp(name, 'i') match = key.match(re) if (match) { result = headers[key] } }) return result } Request.prototype.enableUnixSocket = function () { // Get the socket & request paths from the URL var unixParts = this.uri.path.split(':') var host = unixParts[0] var path = unixParts[1] // Apply unix properties to request this.socketPath = host this.uri.pathname = path this.uri.path = path this.uri.host = host this.uri.hostname = host this.uri.isUnix = true } Request.prototype.auth = function (user, pass, sendImmediately, bearer) { var self = this self._auth.onRequest(user, pass, sendImmediately, bearer) return self } Request.prototype.aws = function (opts, now) { var self = this if (!now) { self._aws = opts return self } if (opts.sign_version === 4 || opts.sign_version === '4') { // use aws4 var options = { host: self.uri.host, path: self.uri.path, method: self.method, headers: self.headers, body: self.body } if (opts.service) { options.service = opts.service } var signRes = aws4.sign(options, { accessKeyId: opts.key, secretAccessKey: opts.secret, sessionToken: opts.session }) self.setHeader('authorization', signRes.headers.Authorization) self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) if (signRes.headers['X-Amz-Security-Token']) { self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token']) } } else { // default: use aws-sign2 var date = new Date() self.setHeader('date', date.toUTCString()) var auth = { key: opts.key, secret: opts.secret, verb: self.method.toUpperCase(), date: date, contentType: self.getHeader('content-type') || '', md5: self.getHeader('content-md5') || '', amazonHeaders: aws2.canonicalizeHeaders(self.headers) } var path = self.uri.path if (opts.bucket && path) { auth.resource = '/' + opts.bucket + path } else if (opts.bucket && !path) { auth.resource = '/' + opts.bucket } else if (!opts.bucket && path) { auth.resource = path } else if (!opts.bucket && !path) { auth.resource = '/' } auth.resource = aws2.canonicalizeResource(auth.resource) self.setHeader('authorization', aws2.authorization(auth)) } return self } Request.prototype.httpSignature = function (opts) { var self = this httpSignature.signRequest({ getHeader: function (header) { return self.getHeader(header, self.headers) }, setHeader: function (header, value) { self.setHeader(header, value) }, method: self.method, path: self.path }, opts) debug('httpSignature authorization', self.getHeader('authorization')) return self } Request.prototype.hawk = function (opts) { var self = this self.setHeader('Authorization', hawk.header(self.uri, self.method, opts)) } Request.prototype.oauth = function (_oauth) { var self = this self._oauth.onRequest(_oauth) return self } Request.prototype.jar = function (jar) { var self = this var cookies if (self._redirect.redirectsFollowed === 0) { self.originalCookieHeader = self.getHeader('cookie') } if (!jar) { // disable cookies cookies = false self._disableCookies = true } else { var targetCookieJar = jar.getCookieString ? jar : globalCookieJar var urihref = self.uri.href // fetch cookie in the Specified host if (targetCookieJar) { cookies = targetCookieJar.getCookieString(urihref) } } // if need cookie and cookie is not empty if (cookies && cookies.length) { if (self.originalCookieHeader) { // Don't overwrite existing Cookie header self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) } else { self.setHeader('cookie', cookies) } } self._jar = jar return self } // Stream API Request.prototype.pipe = function (dest, opts) { var self = this if (self.response) { if (self._destdata) { self.emit('error', new Error('You cannot pipe after data has been emitted from the response.')) } else if (self._ended) { self.emit('error', new Error('You cannot pipe after the response has been ended.')) } else { stream.Stream.prototype.pipe.call(self, dest, opts) self.pipeDest(dest) return dest } } else { self.dests.push(dest) stream.Stream.prototype.pipe.call(self, dest, opts) return dest } } Request.prototype.write = function () { var self = this if (self._aborted) { return } if (!self._started) { self.start() } if (self.req) { return self.req.write.apply(self.req, arguments) } } Request.prototype.end = function (chunk) { var self = this if (self._aborted) { return } if (chunk) { self.write(chunk) } if (!self._started) { self.start() } if (self.req) { self.req.end() } } Request.prototype.pause = function () { var self = this if (!self.responseContent) { self._paused = true } else { self.responseContent.pause.apply(self.responseContent, arguments) } } Request.prototype.resume = function () { var self = this if (!self.responseContent) { self._paused = false } else { self.responseContent.resume.apply(self.responseContent, arguments) } } Request.prototype.destroy = function () { var self = this this.clearTimeout() if (!self._ended) { self.end() } else if (self.response) { self.response.destroy() } } Request.prototype.clearTimeout = function () { if (this.timeoutTimer) { clearTimeout(this.timeoutTimer) this.timeoutTimer = null } } Request.defaultProxyHeaderWhiteList = Tunnel.defaultProxyHeaderWhiteList.slice() Request.defaultProxyHeaderExclusiveList = Tunnel.defaultProxyHeaderExclusiveList.slice() // Exports Request.prototype.toJSON = requestToJSON module.exports = Request /***/ }), /***/ 46624: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const tls = __webpack_require__(4016); module.exports = (options = {}) => new Promise((resolve, reject) => { let timeout = false; const callback = async () => { socket.off('timeout', onTimeout); socket.off('error', reject); if (options.resolveSocket) { resolve({alpnProtocol: socket.alpnProtocol, socket, timeout}); if (timeout) { await Promise.resolve(); socket.emit('timeout'); } } else { socket.destroy(); resolve({alpnProtocol: socket.alpnProtocol, timeout}); } }; const onTimeout = async () => { timeout = true; callback(); }; const socket = tls.connect(options, callback); socket.on('error', reject); socket.once('timeout', onTimeout); }); /***/ }), /***/ 9004: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const Readable = __webpack_require__(92413).Readable; const lowercaseKeys = __webpack_require__(9662); class Response extends Readable { constructor(statusCode, headers, body, url) { if (typeof statusCode !== 'number') { throw new TypeError('Argument `statusCode` should be a number'); } if (typeof headers !== 'object') { throw new TypeError('Argument `headers` should be an object'); } if (!(body instanceof Buffer)) { throw new TypeError('Argument `body` should be a buffer'); } if (typeof url !== 'string') { throw new TypeError('Argument `url` should be a string'); } super(); this.statusCode = statusCode; this.headers = lowercaseKeys(headers); this.body = body; this.url = url; } _read() { this.push(this.body); this.push(null); } } module.exports = Response; /***/ }), /***/ 63515: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var { PassThrough } = __webpack_require__(92413); var debug = __webpack_require__(38237)('retry-request'); var extend = __webpack_require__(38171); var DEFAULTS = { objectMode: false, retries: 2, /* The maximum time to delay in seconds. If retryDelayMultiplier results in a delay greater than maxRetryDelay, retries should delay by maxRetryDelay seconds instead. */ maxRetryDelay: 64, /* The multiplier by which to increase the delay time between the completion of failed requests, and the initiation of the subsequent retrying request. */ retryDelayMultiplier: 2, /* The length of time to keep retrying in seconds. The last sleep period will be shortened as necessary, so that the last retry runs at deadline (and not considerably beyond it). The total time starting from when the initial request is sent, after which an error will be returned, regardless of the retrying attempts made meanwhile. */ totalTimeout: 600, noResponseRetries: 2, currentRetryAttempt: 0, shouldRetryFn: function (response) { var retryRanges = [ // https://en.wikipedia.org/wiki/List_of_HTTP_status_codes // 1xx - Retry (Informational, request still processing) // 2xx - Do not retry (Success) // 3xx - Do not retry (Redirect) // 4xx - Do not retry (Client errors) // 429 - Retry ("Too Many Requests") // 5xx - Retry (Server errors) [100, 199], [429, 429], [500, 599] ]; var statusCode = response.statusCode; debug(`Response status: ${statusCode}`); var range; while ((range = retryRanges.shift())) { if (statusCode >= range[0] && statusCode <= range[1]) { // Not a successful status or redirect. return true; } } } }; function retryRequest(requestOpts, opts, callback) { var streamMode = typeof arguments[arguments.length - 1] !== 'function'; if (typeof opts === 'function') { callback = opts; } var manualCurrentRetryAttemptWasSet = opts && typeof opts.currentRetryAttempt === 'number'; opts = extend({}, DEFAULTS, opts); if (typeof opts.request === 'undefined') { try { opts.request = __webpack_require__(48699); } catch (e) { throw new Error('A request library must be provided to retry-request.'); } } var currentRetryAttempt = opts.currentRetryAttempt; var numNoResponseAttempts = 0; var streamResponseHandled = false; var retryStream; var requestStream; var delayStream; var activeRequest; var retryRequest = { abort: function () { if (activeRequest && activeRequest.abort) { activeRequest.abort(); } } }; if (streamMode) { retryStream = new PassThrough({ objectMode: opts.objectMode }); retryStream.abort = resetStreams; } var timeOfFirstRequest = Date.now(); if (currentRetryAttempt > 0) { retryAfterDelay(currentRetryAttempt); } else { makeRequest(); } if (streamMode) { return retryStream; } else { return retryRequest; } function resetStreams() { delayStream = null; if (requestStream) { requestStream.abort && requestStream.abort(); requestStream.cancel && requestStream.cancel(); if (requestStream.destroy) { requestStream.destroy(); } else if (requestStream.end) { requestStream.end(); } } } function makeRequest() { currentRetryAttempt++; debug(`Current retry attempt: ${currentRetryAttempt}`); if (streamMode) { streamResponseHandled = false; delayStream = new PassThrough({ objectMode: opts.objectMode }); requestStream = opts.request(requestOpts); setImmediate(function () { retryStream.emit('request'); }); requestStream // gRPC via google-cloud-node can emit an `error` as well as a `response` // Whichever it emits, we run with-- we can't run with both. That's what // is up with the `streamResponseHandled` tracking. .on('error', function (err) { if (streamResponseHandled) { return; } streamResponseHandled = true; onResponse(err); }) .on('response', function (resp, body) { if (streamResponseHandled) { return; } streamResponseHandled = true; onResponse(null, resp, body); }) .on('complete', retryStream.emit.bind(retryStream, 'complete')); requestStream.pipe(delayStream); } else { activeRequest = opts.request(requestOpts, onResponse); } } function retryAfterDelay(currentRetryAttempt) { if (streamMode) { resetStreams(); } var nextRetryDelay = getNextRetryDelay({ maxRetryDelay: opts.maxRetryDelay, retryDelayMultiplier: opts.retryDelayMultiplier, retryNumber: currentRetryAttempt, timeOfFirstRequest, totalTimeout: opts.totalTimeout, }); debug(`Next retry delay: ${nextRetryDelay}`); setTimeout(makeRequest, nextRetryDelay); } function onResponse(err, response, body) { // An error such as DNS resolution. if (err) { numNoResponseAttempts++; if (numNoResponseAttempts <= opts.noResponseRetries) { retryAfterDelay(numNoResponseAttempts); } else { if (streamMode) { retryStream.emit('error', err); retryStream.end(); } else { callback(err, response, body); } } return; } // Send the response to see if we should try again. // NOTE: "currentRetryAttempt" isn't accurate by default, as it counts // the very first request sent as the first "retry". It is only accurate // when a user provides their own "currentRetryAttempt" option at // instantiation. var adjustedCurrentRetryAttempt = manualCurrentRetryAttemptWasSet ? currentRetryAttempt : currentRetryAttempt - 1; if (adjustedCurrentRetryAttempt < opts.retries && opts.shouldRetryFn(response)) { retryAfterDelay(currentRetryAttempt); return; } // No more attempts need to be made, just continue on. if (streamMode) { retryStream.emit('response', response); delayStream.pipe(retryStream); requestStream.on('error', function (err) { retryStream.destroy(err); }); } else { callback(err, response, body); } } } module.exports = retryRequest; function getNextRetryDelay(config) { var { maxRetryDelay, retryDelayMultiplier, retryNumber, timeOfFirstRequest, totalTimeout, } = config; var maxRetryDelayMs = maxRetryDelay * 1000; var totalTimeoutMs = totalTimeout * 1000; var jitter = Math.floor(Math.random() * 1000); var calculatedNextRetryDelay = Math.pow(retryDelayMultiplier, retryNumber) * 1000 + jitter; var maxAllowableDelayMs = totalTimeoutMs - (Date.now() - timeOfFirstRequest); return Math.min(calculatedNextRetryDelay, maxAllowableDelayMs, maxRetryDelayMs); } module.exports.getNextRetryDelay = getNextRetryDelay; /***/ }), /***/ 3487: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); /* eslint-disable @typescript-eslint/strict-boolean-expressions */ function parse(string, encoding, opts) { if (opts === void 0) { opts = {}; } // Build the character lookup table: if (!encoding.codes) { encoding.codes = {}; for (var i = 0; i < encoding.chars.length; ++i) { encoding.codes[encoding.chars[i]] = i; } } // The string must have a whole number of bytes: if (!opts.loose && string.length * encoding.bits & 7) { throw new SyntaxError('Invalid padding'); } // Count the padding bytes: var end = string.length; while (string[end - 1] === '=') { --end; // If we get a whole number of bytes, there is too much padding: if (!opts.loose && !((string.length - end) * encoding.bits & 7)) { throw new SyntaxError('Invalid padding'); } } // Allocate the output: var out = new (opts.out || Uint8Array)(end * encoding.bits / 8 | 0); // Parse the data: var bits = 0; // Number of bits currently in the buffer var buffer = 0; // Bits waiting to be written out, MSB first var written = 0; // Next byte to write for (var _i = 0; _i < end; ++_i) { // Read one character from the string: var value = encoding.codes[string[_i]]; if (value === undefined) { throw new SyntaxError('Invalid character ' + string[_i]); } // Append the bits to the buffer: buffer = buffer << encoding.bits | value; bits += encoding.bits; // Write out some bits if the buffer has a byte's worth: if (bits >= 8) { bits -= 8; out[written++] = 0xff & buffer >> bits; } } // Verify that we have received just enough bits: if (bits >= encoding.bits || 0xff & buffer << 8 - bits) { throw new SyntaxError('Unexpected end of data'); } return out; } function stringify(data, encoding, opts) { if (opts === void 0) { opts = {}; } var _opts = opts, _opts$pad = _opts.pad, pad = _opts$pad === void 0 ? true : _opts$pad; var mask = (1 << encoding.bits) - 1; var out = ''; var bits = 0; // Number of bits currently in the buffer var buffer = 0; // Bits waiting to be written out, MSB first for (var i = 0; i < data.length; ++i) { // Slurp data into the buffer: buffer = buffer << 8 | 0xff & data[i]; bits += 8; // Write out as much as we can: while (bits > encoding.bits) { bits -= encoding.bits; out += encoding.chars[mask & buffer >> bits]; } } // Partial character: if (bits) { out += encoding.chars[mask & buffer << encoding.bits - bits]; } // Add padding characters until we hit a byte boundary: if (pad) { while (out.length * encoding.bits & 7) { out += '='; } } return out; } /* eslint-disable @typescript-eslint/strict-boolean-expressions */ var base16Encoding = { chars: '0123456789ABCDEF', bits: 4 }; var base32Encoding = { chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', bits: 5 }; var base32HexEncoding = { chars: '0123456789ABCDEFGHIJKLMNOPQRSTUV', bits: 5 }; var base64Encoding = { chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', bits: 6 }; var base64UrlEncoding = { chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', bits: 6 }; var base16 = { parse: function parse$1(string, opts) { return parse(string.toUpperCase(), base16Encoding, opts); }, stringify: function stringify$1(data, opts) { return stringify(data, base16Encoding, opts); } }; var base32 = { parse: function parse$1(string, opts) { if (opts === void 0) { opts = {}; } return parse(opts.loose ? string.toUpperCase().replace(/0/g, 'O').replace(/1/g, 'L').replace(/8/g, 'B') : string, base32Encoding, opts); }, stringify: function stringify$1(data, opts) { return stringify(data, base32Encoding, opts); } }; var base32hex = { parse: function parse$1(string, opts) { return parse(string, base32HexEncoding, opts); }, stringify: function stringify$1(data, opts) { return stringify(data, base32HexEncoding, opts); } }; var base64 = { parse: function parse$1(string, opts) { return parse(string, base64Encoding, opts); }, stringify: function stringify$1(data, opts) { return stringify(data, base64Encoding, opts); } }; var base64url = { parse: function parse$1(string, opts) { return parse(string, base64UrlEncoding, opts); }, stringify: function stringify$1(data, opts) { return stringify(data, base64UrlEncoding, opts); } }; var codec = { parse: parse, stringify: stringify }; exports.base16 = base16; exports.base32 = base32; exports.base32hex = base32hex; exports.base64 = base64; exports.base64url = base64url; exports.codec = codec; //# sourceMappingURL=index.cjs.js.map /***/ }), /***/ 14959: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const assert = __webpack_require__(42357) const path = __webpack_require__(85622) const fs = __webpack_require__(35747) let glob = undefined try { glob = __webpack_require__(91957) } catch (_err) { // treat glob as optional. } const defaultGlobOpts = { nosort: true, silent: true } // for EMFILE handling let timeout = 0 const isWindows = (process.platform === "win32") const defaults = options => { const methods = [ 'unlink', 'chmod', 'stat', 'lstat', 'rmdir', 'readdir' ] methods.forEach(m => { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] }) options.maxBusyTries = options.maxBusyTries || 3 options.emfileWait = options.emfileWait || 1000 if (options.glob === false) { options.disableGlob = true } if (options.disableGlob !== true && glob === undefined) { throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') } options.disableGlob = options.disableGlob || false options.glob = options.glob || defaultGlobOpts } const rimraf = (p, options, cb) => { if (typeof options === 'function') { cb = options options = {} } assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert.equal(typeof cb, 'function', 'rimraf: callback function required') assert(options, 'rimraf: invalid options argument provided') assert.equal(typeof options, 'object', 'rimraf: options should be object') defaults(options) let busyTries = 0 let errState = null let n = 0 const next = (er) => { errState = errState || er if (--n === 0) cb(errState) } const afterGlob = (er, results) => { if (er) return cb(er) n = results.length if (n === 0) return cb() results.forEach(p => { const CB = (er) => { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ // try again, with the same exact callback as this one. return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(() => rimraf_(p, options, CB), timeout ++) } // already gone if (er.code === "ENOENT") er = null } timeout = 0 next(er) } rimraf_(p, options, CB) }) } if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]) options.lstat(p, (er, stat) => { if (!er) return afterGlob(null, [p]) glob(p, options.glob, afterGlob) }) } // Two possible strategies. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR // // Both result in an extra syscall when you guess wrong. However, there // are likely far more normal files in the world than directories. This // is based on the assumption that a the average number of files per // directory is >= 1. // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. const rimraf_ = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. options.lstat(p, (er, st) => { if (er && er.code === "ENOENT") return cb(null) // Windows can EPERM on stat. Life is suffering. if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb) if (st && st.isDirectory()) return rmdir(p, options, er, cb) options.unlink(p, er => { if (er) { if (er.code === "ENOENT") return cb(null) if (er.code === "EPERM") return (isWindows) ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb) if (er.code === "EISDIR") return rmdir(p, options, er, cb) } return cb(er) }) }) } const fixWinEPERM = (p, options, er, cb) => { assert(p) assert(options) assert(typeof cb === 'function') options.chmod(p, 0o666, er2 => { if (er2) cb(er2.code === "ENOENT" ? null : er) else options.stat(p, (er3, stats) => { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) rmdir(p, options, er, cb) else options.unlink(p, cb) }) }) } const fixWinEPERMSync = (p, options, er) => { assert(p) assert(options) try { options.chmodSync(p, 0o666) } catch (er2) { if (er2.code === "ENOENT") return else throw er } let stats try { stats = options.statSync(p) } catch (er3) { if (er3.code === "ENOENT") return else throw er } if (stats.isDirectory()) rmdirSync(p, options, er) else options.unlinkSync(p) } const rmdir = (p, options, originalEr, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. options.rmdir(p, er => { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") cb(originalEr) else cb(er) }) } const rmkids = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') options.readdir(p, (er, files) => { if (er) return cb(er) let n = files.length if (n === 0) return options.rmdir(p, cb) let errState files.forEach(f => { rimraf(path.join(p, f), options, er => { if (errState) return if (er) return cb(errState = er) if (--n === 0) options.rmdir(p, cb) }) }) }) } // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. const rimrafSync = (p, options) => { options = options || {} defaults(options) assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert(options, 'rimraf: missing options') assert.equal(typeof options, 'object', 'rimraf: options should be object') let results if (options.disableGlob || !glob.hasMagic(p)) { results = [p] } else { try { options.lstatSync(p) results = [p] } catch (er) { results = glob.sync(p, options.glob) } } if (!results.length) return for (let i = 0; i < results.length; i++) { const p = results[i] let st try { st = options.lstatSync(p) } catch (er) { if (er.code === "ENOENT") return // Windows can EPERM on stat. Life is suffering. if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p, options, er) } try { // sunos lets the root user unlink directories, which is... weird. if (st && st.isDirectory()) rmdirSync(p, options, null) else options.unlinkSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) if (er.code !== "EISDIR") throw er rmdirSync(p, options, er) } } } const rmdirSync = (p, options, originalEr) => { assert(p) assert(options) try { options.rmdirSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "ENOTDIR") throw originalEr if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options) } } const rmkidsSync = (p, options) => { assert(p) assert(options) options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. // So, we know that it won't be ENOENT or ENOTDIR or anything else. // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. const retries = isWindows ? 100 : 1 let i = 0 do { let threw = true try { const ret = options.rmdirSync(p, options) threw = false return ret } finally { if (++i < retries && threw) continue } } while (true) } module.exports = rimraf rimraf.sync = rimrafSync /***/ }), /***/ 21867: /***/ ((module, exports, __webpack_require__) => { /*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(64293) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } SafeBuffer.prototype = Object.create(Buffer.prototype) // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }), /***/ 15118: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(64293) var Buffer = buffer.Buffer var safer = {} var key for (key in buffer) { if (!buffer.hasOwnProperty(key)) continue if (key === 'SlowBuffer' || key === 'Buffer') continue safer[key] = buffer[key] } var Safer = safer.Buffer = {} for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue Safer[key] = Buffer[key] } safer.Buffer.prototype = Buffer.prototype if (!Safer.from || Safer.from === Uint8Array.from) { Safer.from = function (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } if (value && typeof value.length === 'undefined') { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) } return Buffer(value, encodingOrOffset, length) } } if (!Safer.alloc) { Safer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } var buf = Buffer(size) if (!fill || fill.length === 0) { buf.fill(0) } else if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } return buf } } if (!safer.kStringMaxLength) { try { safer.kStringMaxLength = process.binding('buffer').kStringMaxLength } catch (e) { // we can't determine kStringMaxLength in environments where process.binding // is unsupported, so let's not set it } } if (!safer.constants) { safer.constants = { MAX_LENGTH: safer.kMaxLength } if (safer.kStringMaxLength) { safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } } module.exports = safer /***/ }), /***/ 91532: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency class Comparator { static get ANY () { return ANY } constructor (comp, options) { options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } parse (comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const m = comp.match(r) if (!m) { throw new TypeError(`Invalid comparator: ${comp}`) } this.operator = m[1] !== undefined ? m[1] : '' if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } toString () { return this.value } test (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY || version === ANY) { return true } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } return cmp(version, this.operator, this.semver, this.options) } intersects (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (this.operator === '') { if (this.value === '') { return true } return new Range(comp.value, options).test(this.value) } else if (comp.operator === '') { if (comp.value === '') { return true } return new Range(this.value, options).test(comp.semver) } const sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') const sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') const sameSemVer = this.semver.version === comp.semver.version const differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') const oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<') const oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>') return ( sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan ) } } module.exports = Comparator const parseOptions = __webpack_require__(40785) const {re, t} = __webpack_require__(9523) const cmp = __webpack_require__(75098) const debug = __webpack_require__(50427) const SemVer = __webpack_require__(48088) const Range = __webpack_require__(9828) /***/ }), /***/ 9828: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // hoisted class for cyclic dependency class Range { constructor (range, options) { options = parseOptions(options) if (range instanceof Range) { if ( range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { // just put it in the set and return this.raw = range.value this.set = [[range]] this.format() return this } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range .split(/\s*\|\|\s*/) // map the range to a 2d array of comparators .map(range => this.parseRange(range.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter(c => c.length) if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${range}`) } // if we have any that are not the null set, throw out null sets. if (this.set.length > 1) { // keep the first one, in case they're all null sets const first = this.set[0] this.set = this.set.filter(c => !isNullSet(c[0])) if (this.set.length === 0) this.set = [first] else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { this.set = [c] break } } } } this.format() } format () { this.range = this.set .map((comps) => { return comps.join(' ').trim() }) .join('||') .trim() return this.range } toString () { return this.range } parseRange (range) { range = range.trim() // memoize range parsing for performance. // this is a very hot path, and fully deterministic. const memoOpts = Object.keys(this.options).join(',') const memoKey = `parseRange:${memoOpts}:${range}` const cached = cache.get(memoKey) if (cached) return cached const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) // in loose mode, throw out any that are not valid comparators .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) .map(comp => new Comparator(comp, this.options)) // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once const l = rangeList.length const rangeMap = new Map() for (const comp of rangeList) { if (isNullSet(comp)) return [comp] rangeMap.set(comp.value, comp) } if (rangeMap.size > 1 && rangeMap.has('')) rangeMap.delete('') const result = [...rangeMap.values()] cache.set(memoKey, result) return result } intersects (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some((thisComparators) => { return ( isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return ( isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options) }) }) ) }) ) }) } // if ANY of the sets match ALL of its comparators, then pass test (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } } module.exports = Range const LRU = __webpack_require__(7129) const cache = new LRU({ max: 1000 }) const parseOptions = __webpack_require__(40785) const Comparator = __webpack_require__(91532) const debug = __webpack_require__(50427) const SemVer = __webpack_require__(48088) const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = __webpack_require__(9523) const isNullSet = c => c.value === '<0.0.0-0' const isAny = c => c.value === '' // take a set of comparators and determine whether there // exists a version which can satisfy it const isSatisfiable = (comparators, options) => { let result = true const remainingComparators = comparators.slice() let testComparator = remainingComparators.pop() while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options) }) testComparator = remainingComparators.pop() } return result } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceTilde(comp, options) }).join(' ') const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, (_, M, m, p, pr) => { debug('tilde', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0 <${+M + 1}.0.0-0` } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0-0 ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` } else if (pr) { debug('replaceTilde pr', pr) ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } else { // ~1.2.3 == >=1.2.3 <1.3.0-0 ret = `>=${M}.${m}.${p } <${M}.${+m + 1}.0-0` } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceCaret(comp, options) }).join(' ') const replaceCaret = (comp, options) => { debug('caret', comp, options) const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] const z = options.includePrerelease ? '-0' : '' return comp.replace(r, (_, M, m, p, pr) => { debug('caret', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` } else if (isX(p)) { if (M === '0') { ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` } else { ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p}-${pr } <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p}-${pr } <${+M + 1}.0.0-0` } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p }${z} <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p }${z} <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p } <${+M + 1}.0.0-0` } } debug('caret return', ret) return ret }) } const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map((comp) => { return replaceXRange(comp, options) }).join(' ') } const replaceXRange = (comp, options) => { comp = comp.trim() const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, (ret, gtlt, M, m, p, pr) => { debug('xRange', comp, ret, gtlt, M, m, p, pr) const xM = isX(M) const xm = xM || isX(m) const xp = xm || isX(p) const anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } if (gtlt === '<') pr = '-0' ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` } else if (xp) { ret = `>=${M}.${m}.0${pr } <${M}.${+m + 1}.0-0` } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. const replaceStars = (comp, options) => { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[t.STAR], '') } const replaceGTE0 = (comp, options) => { debug('replaceGTE0', comp, options) return comp.trim() .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { if (isX(fM)) { from = '' } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? '-0' : ''}` } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` } else if (fpr) { from = `>=${from}` } else { from = `>=${from}${incPr ? '-0' : ''}` } if (isX(tM)) { to = '' } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0` } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0` } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}` } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0` } else { to = `<=${to}` } return (`${from} ${to}`).trim() } const testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (let i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === Comparator.ANY) { continue } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } /***/ }), /***/ 48088: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const debug = __webpack_require__(50427) const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(42293) const { re, t } = __webpack_require__(9523) const parseOptions = __webpack_require__(40785) const { compareIdentifiers } = __webpack_require__(92463) class SemVer { constructor (version, options) { options = parseOptions(options) if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError(`Invalid Version: ${version}`) } if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose // this isn't actually relevant for versions, but keep it so that we // don't run into trouble passing this.options around. this.includePrerelease = !!options.includePrerelease const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError(`Invalid Version: ${version}`) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } format () { this.version = `${this.major}.${this.minor}.${this.patch}` if (this.prerelease.length) { this.version += `-${this.prerelease.join('.')}` } return this.version } toString () { return this.version } compare (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { if (typeof other === 'string' && other === this.version) { return 0 } other = new SemVer(other, this.options) } if (other.version === this.version) { return 0 } return this.compareMain(other) || this.comparePre(other) } compareMain (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return ( compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) ) } comparePre (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } let i = 0 do { const a = this.prerelease[i] const b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } compareBuild (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } let i = 0 do { const a = this.build[i] const b = other.build[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if ( this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0 ) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { let i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error(`invalid increment argument: ${release}`) } this.format() this.raw = this.version return this } } module.exports = SemVer /***/ }), /***/ 48848: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(75925) const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } module.exports = clean /***/ }), /***/ 75098: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const eq = __webpack_require__(91898) const neq = __webpack_require__(6017) const gt = __webpack_require__(84123) const gte = __webpack_require__(15522) const lt = __webpack_require__(80194) const lte = __webpack_require__(77520) const cmp = (a, op, b, loose) => { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError(`Invalid operator: ${op}`) } } module.exports = cmp /***/ }), /***/ 13466: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const parse = __webpack_require__(75925) const {re, t} = __webpack_require__(9523) const coerce = (version, options) => { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} let match = null if (!options.rtl) { match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. let next while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state re[t.COERCERTL].lastIndex = -1 } if (match === null) return null return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } module.exports = coerce /***/ }), /***/ 92156: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) return versionA.compare(versionB) || versionA.compareBuild(versionB) } module.exports = compareBuild /***/ }), /***/ 62804: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose /***/ }), /***/ 44309: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) module.exports = compare /***/ }), /***/ 64297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(75925) const eq = __webpack_require__(91898) const diff = (version1, version2) => { if (eq(version1, version2)) { return null } else { const v1 = parse(version1) const v2 = parse(version2) const hasPre = v1.prerelease.length || v2.prerelease.length const prefix = hasPre ? 'pre' : '' const defaultResult = hasPre ? 'prerelease' : '' for (const key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } module.exports = diff /***/ }), /***/ 91898: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq /***/ }), /***/ 84123: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt /***/ }), /***/ 15522: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte /***/ }), /***/ 30900: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { identifier = options options = undefined } try { return new SemVer(version, options).inc(release, identifier).version } catch (er) { return null } } module.exports = inc /***/ }), /***/ 80194: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt /***/ }), /***/ 77520: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte /***/ }), /***/ 76688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const major = (a, loose) => new SemVer(a, loose).major module.exports = major /***/ }), /***/ 38447: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor /***/ }), /***/ 6017: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq /***/ }), /***/ 75925: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const {MAX_LENGTH} = __webpack_require__(42293) const { re, t } = __webpack_require__(9523) const SemVer = __webpack_require__(48088) const parseOptions = __webpack_require__(40785) const parse = (version, options) => { options = parseOptions(options) if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } const r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } module.exports = parse /***/ }), /***/ 42866: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch /***/ }), /***/ 24016: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(75925) const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } module.exports = prerelease /***/ }), /***/ 87499: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compare = __webpack_require__(44309) const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare /***/ }), /***/ 8701: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compareBuild = __webpack_require__(92156) const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort /***/ }), /***/ 6055: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const satisfies = (version, range, options) => { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } module.exports = satisfies /***/ }), /***/ 61426: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const compareBuild = __webpack_require__(92156) const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort /***/ }), /***/ 19601: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const parse = __webpack_require__(75925) const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null } module.exports = valid /***/ }), /***/ 11383: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // just pre-load all the stuff that index.js lazily exports const internalRe = __webpack_require__(9523) module.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: __webpack_require__(42293).SEMVER_SPEC_VERSION, SemVer: __webpack_require__(48088), compareIdentifiers: __webpack_require__(92463).compareIdentifiers, rcompareIdentifiers: __webpack_require__(92463).rcompareIdentifiers, parse: __webpack_require__(75925), valid: __webpack_require__(19601), clean: __webpack_require__(48848), inc: __webpack_require__(30900), diff: __webpack_require__(64297), major: __webpack_require__(76688), minor: __webpack_require__(38447), patch: __webpack_require__(42866), prerelease: __webpack_require__(24016), compare: __webpack_require__(44309), rcompare: __webpack_require__(87499), compareLoose: __webpack_require__(62804), compareBuild: __webpack_require__(92156), sort: __webpack_require__(61426), rsort: __webpack_require__(8701), gt: __webpack_require__(84123), lt: __webpack_require__(80194), eq: __webpack_require__(91898), neq: __webpack_require__(6017), gte: __webpack_require__(15522), lte: __webpack_require__(77520), cmp: __webpack_require__(75098), coerce: __webpack_require__(13466), Comparator: __webpack_require__(91532), Range: __webpack_require__(9828), satisfies: __webpack_require__(6055), toComparators: __webpack_require__(52706), maxSatisfying: __webpack_require__(20579), minSatisfying: __webpack_require__(10832), minVersion: __webpack_require__(34179), validRange: __webpack_require__(2098), outside: __webpack_require__(60420), gtr: __webpack_require__(9380), ltr: __webpack_require__(33323), intersects: __webpack_require__(27008), simplifyRange: __webpack_require__(75297), subset: __webpack_require__(7863), } /***/ }), /***/ 42293: /***/ ((module) => { // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 module.exports = { SEMVER_SPEC_VERSION, MAX_LENGTH, MAX_SAFE_INTEGER, MAX_SAFE_COMPONENT_LENGTH } /***/ }), /***/ 50427: /***/ ((module) => { const debug = ( typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ) ? (...args) => console.error('SEMVER', ...args) : () => {} module.exports = debug /***/ }), /***/ 92463: /***/ ((module) => { const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { const anum = numeric.test(a) const bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, rcompareIdentifiers } /***/ }), /***/ 40785: /***/ ((module) => { // parse out just the options we care about so we always get a consistent // obj with keys in a consistent order. const opts = ['includePrerelease', 'loose', 'rtl'] const parseOptions = options => !options ? {} : typeof options !== 'object' ? { loose: true } : opts.filter(k => options[k]).reduce((options, k) => { options[k] = true return options }, {}) module.exports = parseOptions /***/ }), /***/ 9523: /***/ ((module, exports, __webpack_require__) => { const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(42293) const debug = __webpack_require__(50427) exports = module.exports = {} // The actual regexps go on exports.re const re = exports.re = [] const src = exports.src = [] const t = exports.t = {} let R = 0 const createToken = (name, value, isGlobal) => { const index = R++ debug(index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) } // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') // ## Main Version // Three dot-separated numeric identifiers. createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`) createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] }|${src[t.NONNUMERICIDENTIFIER]})`) createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] }|${src[t.NONNUMERICIDENTIFIER]})`) // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] }(?:\\.${src[t.BUILDIDENTIFIER]})*))`) // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. createToken('FULLPLAIN', `v?${src[t.MAINVERSION] }${src[t.PRERELEASE]}?${ src[t.BUILD]}?`) createToken('FULL', `^${src[t.FULLPLAIN]}$`) // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] }${src[t.PRERELEASELOOSE]}?${ src[t.BUILD]}?`) createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) createToken('GTLT', '((?:<|>)?=?)') // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) // Coercion. // Extract anything that could conceivably be a part of a valid semver createToken('COERCE', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:$|[^\\d])`) createToken('COERCERTL', src[t.COERCE], true) // Tilde ranges. // Meaning is "reasonably at or greater than" createToken('LONETILDE', '(?:~>?)') createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) exports.tildeTrimReplace = '$1~' createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) // Caret ranges. // Meaning is "at least and backwards compatible with" createToken('LONECARET', '(?:\\^)') createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) exports.caretTrimReplace = '$1^' createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) // A simple gt/lt/eq thing, or just "" to indicate "any version" createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) exports.comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`) createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`) // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') /***/ }), /***/ 9380: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Determine if version is greater than all the versions possible in the range. const outside = __webpack_require__(60420) const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr /***/ }), /***/ 27008: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } module.exports = intersects /***/ }), /***/ 33323: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const outside = __webpack_require__(60420) // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr /***/ }), /***/ 20579: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const Range = __webpack_require__(9828) const maxSatisfying = (versions, range, options) => { let max = null let maxSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } module.exports = maxSatisfying /***/ }), /***/ 10832: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const Range = __webpack_require__(9828) const minSatisfying = (versions, range, options) => { let min = null let minSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } module.exports = minSatisfying /***/ }), /***/ 34179: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const Range = __webpack_require__(9828) const gt = __webpack_require__(84123) const minVersion = (range, loose) => { range = new Range(range, loose) let minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let setMin = null comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!setMin || gt(compver, setMin)) { setMin = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error(`Unexpected operation: ${comparator.operator}`) } }) if (setMin && (!minver || gt(minver, setMin))) minver = setMin } if (minver && range.test(minver)) { return minver } return null } module.exports = minVersion /***/ }), /***/ 60420: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const SemVer = __webpack_require__(48088) const Comparator = __webpack_require__(91532) const {ANY} = Comparator const Range = __webpack_require__(9828) const satisfies = __webpack_require__(6055) const gt = __webpack_require__(84123) const lt = __webpack_require__(80194) const lte = __webpack_require__(77520) const gte = __webpack_require__(15522) const outside = (version, range, hilo, options) => { version = new SemVer(version, options) range = new Range(range, options) let gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let high = null let low = null comparators.forEach((comparator) => { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } module.exports = outside /***/ }), /***/ 75297: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. const satisfies = __webpack_require__(6055) const compare = __webpack_require__(44309) module.exports = (versions, range, options) => { const set = [] let min = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version if (!min) min = version } else { if (prev) { set.push([min, prev]) } prev = null min = null } } if (min) set.push([min, null]) const ranges = [] for (const [min, max] of set) { if (min === max) ranges.push(min) else if (!max && min === v[0]) ranges.push('*') else if (!max) ranges.push(`>=${min}`) else if (min === v[0]) ranges.push(`<=${max}`) else ranges.push(`${min} - ${max}`) } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) return simplified.length < original.length ? simplified : range } /***/ }), /***/ 7863: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const Comparator = __webpack_require__(91532) const { ANY } = Comparator const satisfies = __webpack_require__(6055) const compare = __webpack_require__(44309) // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a null set, OR // - Every simple range `r1, r2, ...` which is not a null set is a subset of // some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true // - Else if in prerelease mode, return false // - else replace c with `[>=0.0.0]` // - If C is only the ANY comparator // - if in prerelease mode, return true // - else replace C with `[>=0.0.0]` // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) // - If any C is a = range, and GT or LT are set, return false // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) // - If EQ satisfies every C, return true // - Else return false // - If GT // - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the GT.semver tuple, return false // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true const subset = (sub, dom, options = {}) => { if (sub === dom) return true sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null if (isSub) continue OUTER } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. if (sawNonNull) return false } return true } const simpleSubset = (sub, dom, options) => { if (sub === dom) return true if (sub.length === 1 && sub[0].semver === ANY) { if (dom.length === 1 && dom[0].semver === ANY) return true else if (options.includePrerelease) sub = [ new Comparator('>=0.0.0-0') ] else sub = [ new Comparator('>=0.0.0') ] } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) return true else dom = [ new Comparator('>=0.0.0') ] } const eqSet = new Set() let gt, lt for (const c of sub) { if (c.operator === '>' || c.operator === '>=') gt = higherGT(gt, c, options) else if (c.operator === '<' || c.operator === '<=') lt = lowerLT(lt, c, options) else eqSet.add(c.semver) } if (eqSet.size > 1) return null let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) if (gtltComp > 0) return null else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) return null } // will iterate one or zero times for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) return null if (lt && !satisfies(eq, String(lt), options)) return null for (const c of dom) { if (!satisfies(eq, String(c), options)) return false } return true } let higher, lower let hasDomLT, hasDomGT // if the subset has a prerelease, we need a comparator in the superset // with the same tuple and a prerelease, or it's not a subset let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false // exception: <1.2.3-0 is the same as <1.2.3 if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false } for (const c of dom) { hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' if (gt) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false } } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) if (higher === c && higher !== gt) return false } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false } if (lt) { if (needDomLTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { needDomLTPre = false } } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) if (lower === c && lower !== lt) return false } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false } if (!c.operator && (lt || gt) && gtltComp !== 0) return false } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 if (gt && hasDomLT && !lt && gtltComp !== 0) return false if (lt && hasDomGT && !gt && gtltComp !== 0) return false // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple if (needDomGTPre || needDomLTPre) return false return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a } // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a } module.exports = subset /***/ }), /***/ 52706: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) // Mostly just for testing and legacy API reasons const toComparators = (range, options) => new Range(range, options).set .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) module.exports = toComparators /***/ }), /***/ 2098: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const Range = __webpack_require__(9828) const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } module.exports = validRange /***/ }), /***/ 45123: /***/ ((module) => { module.exports = [ 'cat', 'cd', 'chmod', 'cp', 'dirs', 'echo', 'exec', 'find', 'grep', 'head', 'ln', 'ls', 'mkdir', 'mv', 'pwd', 'rm', 'sed', 'set', 'sort', 'tail', 'tempdir', 'test', 'to', 'toEnd', 'touch', 'uniq', 'which', ]; /***/ }), /***/ 33516: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { // // ShellJS // Unix shell commands on top of Node's API // // Copyright (c) 2012 Artur Adib // http://github.com/shelljs/shelljs // function __ncc_wildcard$0 (arg) { if (arg === "cat.js" || arg === "cat") return __webpack_require__(30271); else if (arg === "cd.js" || arg === "cd") return __webpack_require__(42051); else if (arg === "chmod.js" || arg === "chmod") return __webpack_require__(24975); else if (arg === "common.js" || arg === "common") return __webpack_require__(53687); else if (arg === "cp.js" || arg === "cp") return __webpack_require__(34932); else if (arg === "dirs.js" || arg === "dirs") return __webpack_require__(41178); else if (arg === "echo.js" || arg === "echo") return __webpack_require__(10243); else if (arg === "error.js" || arg === "error") return __webpack_require__(10232); else if (arg === "exec-child.js" || arg === "exec-child") return __webpack_require__(69607); else if (arg === "exec.js" || arg === "exec") return __webpack_require__(10896); else if (arg === "find.js" || arg === "find") return __webpack_require__(47838); else if (arg === "grep.js" || arg === "grep") return __webpack_require__(17417); else if (arg === "head.js" || arg === "head") return __webpack_require__(6613); else if (arg === "ln.js" || arg === "ln") return __webpack_require__(15787); else if (arg === "ls.js" || arg === "ls") return __webpack_require__(35561); else if (arg === "mkdir.js" || arg === "mkdir") return __webpack_require__(72695); else if (arg === "mv.js" || arg === "mv") return __webpack_require__(39849); else if (arg === "popd.js" || arg === "popd") return __webpack_require__(50227); else if (arg === "pushd.js" || arg === "pushd") return __webpack_require__(44177); else if (arg === "pwd.js" || arg === "pwd") return __webpack_require__(58553); else if (arg === "rm.js" || arg === "rm") return __webpack_require__(22830); else if (arg === "sed.js" || arg === "sed") return __webpack_require__(25899); else if (arg === "set.js" || arg === "set") return __webpack_require__(11411); else if (arg === "sort.js" || arg === "sort") return __webpack_require__(72116); else if (arg === "tail.js" || arg === "tail") return __webpack_require__(42284); else if (arg === "tempdir.js" || arg === "tempdir") return __webpack_require__(76150); else if (arg === "test.js" || arg === "test") return __webpack_require__(79723); else if (arg === "to.js" || arg === "to") return __webpack_require__(71961); else if (arg === "toEnd.js" || arg === "toEnd") return __webpack_require__(33736); else if (arg === "touch.js" || arg === "touch") return __webpack_require__(28358); else if (arg === "uniq.js" || arg === "uniq") return __webpack_require__(77286); else if (arg === "which.js" || arg === "which") return __webpack_require__(64766); } var common = __webpack_require__(53687); //@ //@ All commands run synchronously, unless otherwise stated. //@ All commands accept standard bash globbing characters (`*`, `?`, etc.), //@ compatible with the [node `glob` module](https://github.com/isaacs/node-glob). //@ //@ For less-commonly used commands and features, please check out our [wiki //@ page](https://github.com/shelljs/shelljs/wiki). //@ // Include the docs for all the default commands //@commands // Load all default commands __webpack_require__(45123).forEach(function (command) { __ncc_wildcard$0(command); }); //@ //@ ### exit(code) //@ //@ Exits the current process with the given exit `code`. exports.exit = process.exit; //@include ./src/error exports.error = __webpack_require__(10232); //@include ./src/common exports.ShellString = common.ShellString; //@ //@ ### env['VAR_NAME'] //@ //@ Object containing environment variables (both getter and setter). Shortcut //@ to `process.env`. exports.env = process.env; //@ //@ ### Pipes //@ //@ Examples: //@ //@ ```javascript //@ grep('foo', 'file1.txt', 'file2.txt').sed(/o/g, 'a').to('output.txt'); //@ echo('files with o\'s in the name:\n' + ls().grep('o')); //@ cat('test.js').exec('node'); // pipe to exec() call //@ ``` //@ //@ Commands can send their output to another command in a pipe-like fashion. //@ `sed`, `grep`, `cat`, `exec`, `to`, and `toEnd` can appear on the right-hand //@ side of a pipe. Pipes can be chained. //@ //@ ## Configuration //@ exports.config = common.config; //@ //@ ### config.silent //@ //@ Example: //@ //@ ```javascript //@ var sh = require('shelljs'); //@ var silentState = sh.config.silent; // save old silent state //@ sh.config.silent = true; //@ /* ... */ //@ sh.config.silent = silentState; // restore old silent state //@ ``` //@ //@ Suppresses all command output if `true`, except for `echo()` calls. //@ Default is `false`. //@ //@ ### config.fatal //@ //@ Example: //@ //@ ```javascript //@ require('shelljs/global'); //@ config.fatal = true; // or set('-e'); //@ cp('this_file_does_not_exist', '/dev/null'); // throws Error here //@ /* more commands... */ //@ ``` //@ //@ If `true`, the script will throw a Javascript error when any shell.js //@ command encounters an error. Default is `false`. This is analogous to //@ Bash's `set -e`. //@ //@ ### config.verbose //@ //@ Example: //@ //@ ```javascript //@ config.verbose = true; // or set('-v'); //@ cd('dir/'); //@ rm('-rf', 'foo.txt', 'bar.txt'); //@ exec('echo hello'); //@ ``` //@ //@ Will print each command as follows: //@ //@ ``` //@ cd dir/ //@ rm -rf foo.txt bar.txt //@ exec echo hello //@ ``` //@ //@ ### config.globOptions //@ //@ Example: //@ //@ ```javascript //@ config.globOptions = {nodir: true}; //@ ``` //@ //@ Use this value for calls to `glob.sync()` instead of the default options. //@ //@ ### config.reset() //@ //@ Example: //@ //@ ```javascript //@ var shell = require('shelljs'); //@ // Make changes to shell.config, and do stuff... //@ /* ... */ //@ shell.config.reset(); // reset to original state //@ // Do more stuff, but with original settings //@ /* ... */ //@ ``` //@ //@ Reset `shell.config` to the defaults: //@ //@ ```javascript //@ { //@ fatal: false, //@ globOptions: {}, //@ maxdepth: 255, //@ noglob: false, //@ silent: false, //@ verbose: false, //@ } //@ ``` /***/ }), /***/ 30271: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('cat', _cat, { canReceivePipe: true, cmdOptions: { 'n': 'number', }, }); //@ //@ ### cat([options,] file [, file ...]) //@ ### cat([options,] file_array) //@ //@ Available options: //@ //@ + `-n`: number all output lines //@ //@ Examples: //@ //@ ```javascript //@ var str = cat('file*.txt'); //@ var str = cat('file1', 'file2'); //@ var str = cat(['file1', 'file2']); // same as above //@ ``` //@ //@ Returns a string containing the given file, or a concatenated string //@ containing the files if more than one file is given (a new line character is //@ introduced between each file). function _cat(options, files) { var cat = common.readFromPipe(); if (!files && !cat) common.error('no paths given'); files = [].slice.call(arguments, 1); files.forEach(function (file) { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file); } else if (common.statFollowLinks(file).isDirectory()) { common.error(file + ': Is a directory'); } cat += fs.readFileSync(file, 'utf8'); }); if (options.number) { cat = addNumbers(cat); } return cat; } module.exports = _cat; function addNumbers(cat) { var lines = cat.split('\n'); var lastLine = lines.pop(); lines = lines.map(function (line, i) { return numberedLine(i + 1, line); }); if (lastLine.length) { lastLine = numberedLine(lines.length + 1, lastLine); } lines.push(lastLine); return lines.join('\n'); } function numberedLine(n, line) { // GNU cat use six pad start number + tab. See http://lingrok.org/xref/coreutils/src/cat.c#57 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart var number = (' ' + n).slice(-6) + '\t'; return number + line; } /***/ }), /***/ 42051: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var os = __webpack_require__(12087); var common = __webpack_require__(53687); common.register('cd', _cd, {}); //@ //@ ### cd([dir]) //@ //@ Changes to directory `dir` for the duration of the script. Changes to home //@ directory if no argument is supplied. function _cd(options, dir) { if (!dir) dir = os.homedir(); if (dir === '-') { if (!process.env.OLDPWD) { common.error('could not find previous directory'); } else { dir = process.env.OLDPWD; } } try { var curDir = process.cwd(); process.chdir(dir); process.env.OLDPWD = curDir; } catch (e) { // something went wrong, let's figure out the error var err; try { common.statFollowLinks(dir); // if this succeeds, it must be some sort of file err = 'not a directory: ' + dir; } catch (e2) { err = 'no such file or directory: ' + dir; } if (err) common.error(err); } return ''; } module.exports = _cd; /***/ }), /***/ 24975: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); var PERMS = (function (base) { return { OTHER_EXEC: base.EXEC, OTHER_WRITE: base.WRITE, OTHER_READ: base.READ, GROUP_EXEC: base.EXEC << 3, GROUP_WRITE: base.WRITE << 3, GROUP_READ: base.READ << 3, OWNER_EXEC: base.EXEC << 6, OWNER_WRITE: base.WRITE << 6, OWNER_READ: base.READ << 6, // Literal octal numbers are apparently not allowed in "strict" javascript. STICKY: parseInt('01000', 8), SETGID: parseInt('02000', 8), SETUID: parseInt('04000', 8), TYPE_MASK: parseInt('0770000', 8), }; }({ EXEC: 1, WRITE: 2, READ: 4, })); common.register('chmod', _chmod, { }); //@ //@ ### chmod([options,] octal_mode || octal_string, file) //@ ### chmod([options,] symbolic_mode, file) //@ //@ Available options: //@ //@ + `-v`: output a diagnostic for every file processed//@ //@ + `-c`: like verbose, but report only when a change is made//@ //@ + `-R`: change files and directories recursively//@ //@ //@ Examples: //@ //@ ```javascript //@ chmod(755, '/Users/brandon'); //@ chmod('755', '/Users/brandon'); // same as above //@ chmod('u+x', '/Users/brandon'); //@ chmod('-R', 'a-w', '/Users/brandon'); //@ ``` //@ //@ Alters the permissions of a file or directory by either specifying the //@ absolute permissions in octal form or expressing the changes in symbols. //@ This command tries to mimic the POSIX behavior as much as possible. //@ Notable exceptions: //@ //@ + In symbolic modes, `a-r` and `-r` are identical. No consideration is //@ given to the `umask`. //@ + There is no "quiet" option, since default behavior is to run silent. function _chmod(options, mode, filePattern) { if (!filePattern) { if (options.length > 0 && options.charAt(0) === '-') { // Special case where the specified file permissions started with - to subtract perms, which // get picked up by the option parser as command flags. // If we are down by one argument and options starts with -, shift everything over. [].unshift.call(arguments, ''); } else { common.error('You must specify a file.'); } } options = common.parseOptions(options, { 'R': 'recursive', 'c': 'changes', 'v': 'verbose', }); filePattern = [].slice.call(arguments, 2); var files; // TODO: replace this with a call to common.expand() if (options.recursive) { files = []; filePattern.forEach(function addFile(expandedFile) { var stat = common.statNoFollowLinks(expandedFile); if (!stat.isSymbolicLink()) { files.push(expandedFile); if (stat.isDirectory()) { // intentionally does not follow symlinks. fs.readdirSync(expandedFile).forEach(function (child) { addFile(expandedFile + '/' + child); }); } } }); } else { files = filePattern; } files.forEach(function innerChmod(file) { file = path.resolve(file); if (!fs.existsSync(file)) { common.error('File not found: ' + file); } // When recursing, don't follow symlinks. if (options.recursive && common.statNoFollowLinks(file).isSymbolicLink()) { return; } var stat = common.statFollowLinks(file); var isDir = stat.isDirectory(); var perms = stat.mode; var type = perms & PERMS.TYPE_MASK; var newPerms = perms; if (isNaN(parseInt(mode, 8))) { // parse options mode.split(',').forEach(function (symbolicMode) { var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; var matches = pattern.exec(symbolicMode); if (matches) { var applyTo = matches[1]; var operator = matches[2]; var change = matches[3]; var changeOwner = applyTo.indexOf('u') !== -1 || applyTo === 'a' || applyTo === ''; var changeGroup = applyTo.indexOf('g') !== -1 || applyTo === 'a' || applyTo === ''; var changeOther = applyTo.indexOf('o') !== -1 || applyTo === 'a' || applyTo === ''; var changeRead = change.indexOf('r') !== -1; var changeWrite = change.indexOf('w') !== -1; var changeExec = change.indexOf('x') !== -1; var changeExecDir = change.indexOf('X') !== -1; var changeSticky = change.indexOf('t') !== -1; var changeSetuid = change.indexOf('s') !== -1; if (changeExecDir && isDir) { changeExec = true; } var mask = 0; if (changeOwner) { mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); } if (changeGroup) { mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); } if (changeOther) { mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); } // Sticky bit is special - it's not tied to user, group or other. if (changeSticky) { mask |= PERMS.STICKY; } switch (operator) { case '+': newPerms |= mask; break; case '-': newPerms &= ~mask; break; case '=': newPerms = type + mask; // According to POSIX, when using = to explicitly set the // permissions, setuid and setgid can never be cleared. if (common.statFollowLinks(file).isDirectory()) { newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; } break; default: common.error('Could not recognize operator: `' + operator + '`'); } if (options.verbose) { console.log(file + ' -> ' + newPerms.toString(8)); } if (perms !== newPerms) { if (!options.verbose && options.changes) { console.log(file + ' -> ' + newPerms.toString(8)); } fs.chmodSync(file, newPerms); perms = newPerms; // for the next round of changes! } } else { common.error('Invalid symbolic mode change: ' + symbolicMode); } }); } else { // they gave us a full number newPerms = type + parseInt(mode, 8); // POSIX rules are that setuid and setgid can only be added using numeric // form, but not cleared. if (common.statFollowLinks(file).isDirectory()) { newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; } fs.chmodSync(file, newPerms); } }); return ''; } module.exports = _chmod; /***/ }), /***/ 53687: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Ignore warning about 'new String()' /* eslint no-new-wrappers: 0 */ var os = __webpack_require__(12087); var fs = __webpack_require__(35747); var glob = __webpack_require__(91957); var shell = __webpack_require__(33516); var shellMethods = Object.create(shell); exports.extend = Object.assign; // Check if we're running under electron var isElectron = Boolean(process.versions.electron); // Module globals (assume no execPath by default) var DEFAULT_CONFIG = { fatal: false, globOptions: {}, maxdepth: 255, noglob: false, silent: false, verbose: false, execPath: null, bufLength: 64 * 1024, // 64KB }; var config = { reset: function () { Object.assign(this, DEFAULT_CONFIG); if (!isElectron) { this.execPath = process.execPath; } }, resetForTesting: function () { this.reset(); this.silent = true; }, }; config.reset(); exports.config = config; // Note: commands should generally consider these as read-only values. var state = { error: null, errorCode: 0, currentCmd: 'shell.js', }; exports.state = state; delete process.env.OLDPWD; // initially, there's no previous directory // Reliably test if something is any sort of javascript object function isObject(a) { return typeof a === 'object' && a !== null; } exports.isObject = isObject; function log() { /* istanbul ignore next */ if (!config.silent) { console.error.apply(console, arguments); } } exports.log = log; // Converts strings to be equivalent across all platforms. Primarily responsible // for making sure we use '/' instead of '\' as path separators, but this may be // expanded in the future if necessary function convertErrorOutput(msg) { if (typeof msg !== 'string') { throw new TypeError('input must be a string'); } return msg.replace(/\\/g, '/'); } exports.convertErrorOutput = convertErrorOutput; // Shows error message. Throws if config.fatal is true function error(msg, _code, options) { // Validate input if (typeof msg !== 'string') throw new Error('msg must be a string'); var DEFAULT_OPTIONS = { continue: false, code: 1, prefix: state.currentCmd + ': ', silent: false, }; if (typeof _code === 'number' && isObject(options)) { options.code = _code; } else if (isObject(_code)) { // no 'code' options = _code; } else if (typeof _code === 'number') { // no 'options' options = { code: _code }; } else if (typeof _code !== 'number') { // only 'msg' options = {}; } options = Object.assign({}, DEFAULT_OPTIONS, options); if (!state.errorCode) state.errorCode = options.code; var logEntry = convertErrorOutput(options.prefix + msg); state.error = state.error ? state.error + '\n' : ''; state.error += logEntry; // Throw an error, or log the entry if (config.fatal) throw new Error(logEntry); if (msg.length > 0 && !options.silent) log(logEntry); if (!options.continue) { throw { msg: 'earlyExit', retValue: (new ShellString('', state.error, state.errorCode)), }; } } exports.error = error; //@ //@ ### ShellString(str) //@ //@ Examples: //@ //@ ```javascript //@ var foo = ShellString('hello world'); //@ ``` //@ //@ Turns a regular string into a string-like object similar to what each //@ command returns. This has special methods, like `.to()` and `.toEnd()`. function ShellString(stdout, stderr, code) { var that; if (stdout instanceof Array) { that = stdout; that.stdout = stdout.join('\n'); if (stdout.length > 0) that.stdout += '\n'; } else { that = new String(stdout); that.stdout = stdout; } that.stderr = stderr; that.code = code; // A list of all commands that can appear on the right-hand side of a pipe // (populated by calls to common.wrap()) pipeMethods.forEach(function (cmd) { that[cmd] = shellMethods[cmd].bind(that); }); return that; } exports.ShellString = ShellString; // Returns {'alice': true, 'bob': false} when passed a string and dictionary as follows: // parseOptions('-a', {'a':'alice', 'b':'bob'}); // Returns {'reference': 'string-value', 'bob': false} when passed two dictionaries of the form: // parseOptions({'-r': 'string-value'}, {'r':'reference', 'b':'bob'}); // Throws an error when passed a string that does not start with '-': // parseOptions('a', {'a':'alice'}); // throws function parseOptions(opt, map, errorOptions) { // Validate input if (typeof opt !== 'string' && !isObject(opt)) { throw new Error('options must be strings or key-value pairs'); } else if (!isObject(map)) { throw new Error('parseOptions() internal error: map must be an object'); } else if (errorOptions && !isObject(errorOptions)) { throw new Error('parseOptions() internal error: errorOptions must be object'); } if (opt === '--') { // This means there are no options. return {}; } // All options are false by default var options = {}; Object.keys(map).forEach(function (letter) { var optName = map[letter]; if (optName[0] !== '!') { options[optName] = false; } }); if (opt === '') return options; // defaults if (typeof opt === 'string') { if (opt[0] !== '-') { throw new Error("Options string must start with a '-'"); } // e.g. chars = ['R', 'f'] var chars = opt.slice(1).split(''); chars.forEach(function (c) { if (c in map) { var optionName = map[c]; if (optionName[0] === '!') { options[optionName.slice(1)] = false; } else { options[optionName] = true; } } else { error('option not recognized: ' + c, errorOptions || {}); } }); } else { // opt is an Object Object.keys(opt).forEach(function (key) { // key is a string of the form '-r', '-d', etc. var c = key[1]; if (c in map) { var optionName = map[c]; options[optionName] = opt[key]; // assign the given value } else { error('option not recognized: ' + c, errorOptions || {}); } }); } return options; } exports.parseOptions = parseOptions; // Expands wildcards with matching (ie. existing) file names. // For example: // expand(['file*.js']) = ['file1.js', 'file2.js', ...] // (if the files 'file1.js', 'file2.js', etc, exist in the current dir) function expand(list) { if (!Array.isArray(list)) { throw new TypeError('must be an array'); } var expanded = []; list.forEach(function (listEl) { // Don't expand non-strings if (typeof listEl !== 'string') { expanded.push(listEl); } else { var ret; try { ret = glob.sync(listEl, config.globOptions); // if nothing matched, interpret the string literally ret = ret.length > 0 ? ret : [listEl]; } catch (e) { // if glob fails, interpret the string literally ret = [listEl]; } expanded = expanded.concat(ret); } }); return expanded; } exports.expand = expand; // Normalizes Buffer creation, using Buffer.alloc if possible. // Also provides a good default buffer length for most use cases. var buffer = typeof Buffer.alloc === 'function' ? function (len) { return Buffer.alloc(len || config.bufLength); } : function (len) { return new Buffer(len || config.bufLength); }; exports.buffer = buffer; // Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. // file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 function unlinkSync(file) { try { fs.unlinkSync(file); } catch (e) { // Try to override file permission /* istanbul ignore next */ if (e.code === 'EPERM') { fs.chmodSync(file, '0666'); fs.unlinkSync(file); } else { throw e; } } } exports.unlinkSync = unlinkSync; // wrappers around common.statFollowLinks and common.statNoFollowLinks that clarify intent // and improve readability function statFollowLinks() { return fs.statSync.apply(fs, arguments); } exports.statFollowLinks = statFollowLinks; function statNoFollowLinks() { return fs.lstatSync.apply(fs, arguments); } exports.statNoFollowLinks = statNoFollowLinks; // e.g. 'shelljs_a5f185d0443ca...' function randomFileName() { function randomHash(count) { if (count === 1) { return parseInt(16 * Math.random(), 10).toString(16); } var hash = ''; for (var i = 0; i < count; i++) { hash += randomHash(1); } return hash; } return 'shelljs_' + randomHash(20); } exports.randomFileName = randomFileName; // Common wrapper for all Unix-like commands that performs glob expansion, // command-logging, and other nice things function wrap(cmd, fn, options) { options = options || {}; return function () { var retValue = null; state.currentCmd = cmd; state.error = null; state.errorCode = 0; try { var args = [].slice.call(arguments, 0); // Log the command to stderr, if appropriate if (config.verbose) { console.error.apply(console, [cmd].concat(args)); } // If this is coming from a pipe, let's set the pipedValue (otherwise, set // it to the empty string) state.pipedValue = (this && typeof this.stdout === 'string') ? this.stdout : ''; if (options.unix === false) { // this branch is for exec() retValue = fn.apply(this, args); } else { // and this branch is for everything else if (isObject(args[0]) && args[0].constructor.name === 'Object') { // a no-op, allowing the syntax `touch({'-r': file}, ...)` } else if (args.length === 0 || typeof args[0] !== 'string' || args[0].length <= 1 || args[0][0] !== '-') { args.unshift(''); // only add dummy option if '-option' not already present } // flatten out arrays that are arguments, to make the syntax: // `cp([file1, file2, file3], dest);` // equivalent to: // `cp(file1, file2, file3, dest);` args = args.reduce(function (accum, cur) { if (Array.isArray(cur)) { return accum.concat(cur); } accum.push(cur); return accum; }, []); // Convert ShellStrings (basically just String objects) to regular strings args = args.map(function (arg) { if (isObject(arg) && arg.constructor.name === 'String') { return arg.toString(); } return arg; }); // Expand the '~' if appropriate var homeDir = os.homedir(); args = args.map(function (arg) { if (typeof arg === 'string' && arg.slice(0, 2) === '~/' || arg === '~') { return arg.replace(/^~/, homeDir); } return arg; }); // Perform glob-expansion on all arguments after globStart, but preserve // the arguments before it (like regexes for sed and grep) if (!config.noglob && options.allowGlobbing === true) { args = args.slice(0, options.globStart).concat(expand(args.slice(options.globStart))); } try { // parse options if options are provided if (isObject(options.cmdOptions)) { args[0] = parseOptions(args[0], options.cmdOptions); } retValue = fn.apply(this, args); } catch (e) { /* istanbul ignore else */ if (e.msg === 'earlyExit') { retValue = e.retValue; } else { throw e; // this is probably a bug that should be thrown up the call stack } } } } catch (e) { /* istanbul ignore next */ if (!state.error) { // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug... e.name = 'ShellJSInternalError'; throw e; } if (config.fatal) throw e; } if (options.wrapOutput && (typeof retValue === 'string' || Array.isArray(retValue))) { retValue = new ShellString(retValue, state.error, state.errorCode); } state.currentCmd = 'shell.js'; return retValue; }; } // wrap exports.wrap = wrap; // This returns all the input that is piped into the current command (or the // empty string, if this isn't on the right-hand side of a pipe function _readFromPipe() { return state.pipedValue; } exports.readFromPipe = _readFromPipe; var DEFAULT_WRAP_OPTIONS = { allowGlobbing: true, canReceivePipe: false, cmdOptions: null, globStart: 1, pipeOnly: false, wrapOutput: true, unix: true, }; // This is populated during plugin registration var pipeMethods = []; // Register a new ShellJS command function _register(name, implementation, wrapOptions) { wrapOptions = wrapOptions || {}; // Validate options Object.keys(wrapOptions).forEach(function (option) { if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) { throw new Error("Unknown option '" + option + "'"); } if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) { throw new TypeError("Unsupported type '" + typeof wrapOptions[option] + "' for option '" + option + "'"); } }); // If an option isn't specified, use the default wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions); if (shell.hasOwnProperty(name)) { throw new Error('Command `' + name + '` already exists'); } if (wrapOptions.pipeOnly) { wrapOptions.canReceivePipe = true; shellMethods[name] = wrap(name, implementation, wrapOptions); } else { shell[name] = wrap(name, implementation, wrapOptions); } if (wrapOptions.canReceivePipe) { pipeMethods.push(name); } } exports.register = _register; /***/ }), /***/ 34932: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(35747); var path = __webpack_require__(85622); var common = __webpack_require__(53687); common.register('cp', _cp, { cmdOptions: { 'f': '!no_force', 'n': 'no_force', 'u': 'update', 'R': 'recursive', 'r': 'recursive', 'L': 'followsymlink', 'P': 'noFollowsymlink', }, wrapOutput: false, }); // Buffered file copy, synchronous // (Using readFileSync() + writeFileSync() could easily cause a memory overflow // with large files) function copyFileSync(srcFile, destFile, options) { if (!fs.existsSync(srcFile)) { common.error('copyFileSync: no such file or directory: ' + srcFile); } var isWindows = process.platform === 'win32'; // Check the mtimes of the files if the '-u' flag is provided try { if (options.update && common.statFollowLinks(srcFile).mtime < fs.statSync(destFile).mtime) { return; } } catch (e) { // If we're here, destFile probably doesn't exist, so just do a normal copy } if (common.statNoFollowLinks(srcFile).isSymbolicLink() && !options.followsymlink) { try { common.statNoFollowLinks(destFile); common.unlinkSync(destFile); // re-link it } catch (e) { // it doesn't exist, so no work needs to be done } var symlinkFull = fs.readlinkSync(srcFile); fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); } else { var buf = common.buffer(); var bufLength = buf.length; var bytesRead = bufLength; var pos = 0; var fdr = null; var fdw = null; try { fdr = fs.openSync(srcFile, 'r'); } catch (e) { /* istanbul ignore next */ common.error('copyFileSync: could not read src file (' + srcFile + ')'); } try { fdw = fs.openSync(destFile, 'w'); } catch (e) { /* istanbul ignore next */ common.error('copyFileSync: could not write to dest file (code=' + e.code + '):' + destFile); } while (bytesRead === bufLength) { bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos); fs.writeSync(fdw, buf, 0, bytesRead); pos += bytesRead; } fs.closeSync(fdr); fs.closeSync(fdw); fs.chmodSync(destFile, common.statFollowLinks(srcFile).mode); } } // Recursively copies 'sourceDir' into 'destDir' // Adapted from https://github.com/ryanmcgrath/wrench-js // // Copyright (c) 2010 Ryan McGrath // Copyright (c) 2012 Artur Adib // // Licensed under the MIT License // http://www.opensource.org/licenses/mit-license.php function cpdirSyncRecursive(sourceDir, destDir, currentDepth, opts) { if (!opts) opts = {}; // Ensure there is not a run away recursive copy if (currentDepth >= common.config.maxdepth) return; currentDepth++; var isWindows = process.platform === 'win32'; // Create the directory where all our junk is moving to; read the mode of the // source directory and mirror it try { fs.mkdirSync(destDir); } catch (e) { // if the directory already exists, that's okay if (e.code !== 'EEXIST') throw e; } var files = fs.readdirSync(sourceDir); for (var i = 0; i < files.length; i++) { var srcFile = sourceDir + '/' + files[i]; var destFile = destDir + '/' + files[i]; var srcFileStat = common.statNoFollowLinks(srcFile); var symlinkFull; if (opts.followsymlink) { if (cpcheckcycle(sourceDir, srcFile)) { // Cycle link found. console.error('Cycle link found.'); symlinkFull = fs.readlinkSync(srcFile); fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); continue; } } if (srcFileStat.isDirectory()) { /* recursion this thing right on back. */ cpdirSyncRecursive(srcFile, destFile, currentDepth, opts); } else if (srcFileStat.isSymbolicLink() && !opts.followsymlink) { symlinkFull = fs.readlinkSync(srcFile); try { common.statNoFollowLinks(destFile); common.unlinkSync(destFile); // re-link it } catch (e) { // it doesn't exist, so no work needs to be done } fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null); } else if (srcFileStat.isSymbolicLink() && opts.followsymlink) { srcFileStat = common.statFollowLinks(srcFile); if (srcFileStat.isDirectory()) { cpdirSyncRecursive(srcFile, destFile, currentDepth, opts); } else { copyFileSync(srcFile, destFile, opts); } } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ if (fs.existsSync(destFile) && opts.no_force) { common.log('skipping existing file: ' + files[i]); } else { copyFileSync(srcFile, destFile, opts); } } } // for files // finally change the mode for the newly created directory (otherwise, we // couldn't add files to a read-only directory). var checkDir = common.statFollowLinks(sourceDir); fs.chmodSync(destDir, checkDir.mode); } // cpdirSyncRecursive // Checks if cureent file was created recently function checkRecentCreated(sources, index) { var lookedSource = sources[index]; return sources.slice(0, index).some(function (src) { return path.basename(src) === path.basename(lookedSource); }); } function cpcheckcycle(sourceDir, srcFile) { var srcFileStat = common.statNoFollowLinks(srcFile); if (srcFileStat.isSymbolicLink()) { // Do cycle check. For example: // $ mkdir -p 1/2/3/4 // $ cd 1/2/3/4 // $ ln -s ../../3 link // $ cd ../../../.. // $ cp -RL 1 copy var cyclecheck = common.statFollowLinks(srcFile); if (cyclecheck.isDirectory()) { var sourcerealpath = fs.realpathSync(sourceDir); var symlinkrealpath = fs.realpathSync(srcFile); var re = new RegExp(symlinkrealpath); if (re.test(sourcerealpath)) { return true; } } } return false; } //@ //@ ### cp([options,] source [, source ...], dest) //@ ### cp([options,] source_array, dest) //@ //@ Available options: //@ //@ + `-f`: force (default behavior) //@ + `-n`: no-clobber //@ + `-u`: only copy if `source` is newer than `dest` //@ + `-r`, `-R`: recursive //@ + `-L`: follow symlinks //@ + `-P`: don't follow symlinks //@ //@ Examples: //@ //@ ```javascript //@ cp('file1', 'dir1'); //@ cp('-R', 'path/to/dir/', '~/newCopy/'); //@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); //@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above //@ ``` //@ //@ Copies files. function _cp(options, sources, dest) { // If we're missing -R, it actually implies -L (unless -P is explicit) if (options.followsymlink) { options.noFollowsymlink = false; } if (!options.recursive && !options.noFollowsymlink) { options.followsymlink = true; } // Get sources, dest if (arguments.length < 3) { common.error('missing and/or '); } else { sources = [].slice.call(arguments, 1, arguments.length - 1); dest = arguments[arguments.length - 1]; } var destExists = fs.existsSync(dest); var destStat = destExists && common.statFollowLinks(dest); // Dest is not existing dir, but multiple sources given if ((!destExists || !destStat.isDirectory()) && sources.length > 1) { common.error('dest is not a directory (too many sources)'); } // Dest is an existing file, but -n is given if (destExists && destStat.isFile() && options.no_force) { return new common.ShellString('', '', 0); } sources.forEach(function (src, srcIndex) { if (!fs.existsSync(src)) { if (src === '') src = "''"; // if src was empty string, display empty string common.error('no such file or directory: ' + src, { continue: true }); return; // skip file } var srcStat = common.statFollowLinks(src); if (!options.noFollowsymlink && srcStat.isDirectory()) { if (!options.recursive) { // Non-Recursive common.error("omitting directory '" + src + "'", { continue: true }); } else { // Recursive // 'cp /a/source dest' should create 'source' in 'dest' var newDest = (destStat && destStat.isDirectory()) ? path.join(dest, path.basename(src)) : dest; try { common.statFollowLinks(path.dirname(dest)); cpdirSyncRecursive(src, newDest, 0, { no_force: options.no_force, followsymlink: options.followsymlink }); } catch (e) { /* istanbul ignore next */ common.error("cannot create directory '" + dest + "': No such file or directory"); } } } else { // If here, src is a file // When copying to '/path/dir': // thisDest = '/path/dir/file1' var thisDest = dest; if (destStat && destStat.isDirectory()) { thisDest = path.normalize(dest + '/' + path.basename(src)); } var thisDestExists = fs.existsSync(thisDest); if (thisDestExists && checkRecentCreated(sources, srcIndex)) { // cannot overwrite file created recently in current execution, but we want to continue copying other files if (!options.no_force) { common.error("will not overwrite just-created '" + thisDest + "' with '" + src + "'", { continue: true }); } return; } if (thisDestExists && options.no_force) { return; // skip file } if (path.relative(src, thisDest) === '') { // a file cannot be copied to itself, but we want to continue copying other files common.error("'" + thisDest + "' and '" + src + "' are the same file", { continue: true }); return; } copyFileSync(src, thisDest, options); } }); // forEach(src) return new common.ShellString('', common.state.error, common.state.errorCode); } module.exports = _cp; /***/ }), /***/ 41178: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var common = __webpack_require__(53687); var _cd = __webpack_require__(42051); var path = __webpack_require__(85622); common.register('dirs', _dirs, { wrapOutput: false, }); common.register('pushd', _pushd, { wrapOutput: false, }); common.register('popd', _popd, { wrapOutput: false, }); // Pushd/popd/dirs internals var _dirStack = []; function _isStackIndex(index) { return (/^[\-+]\d+$/).test(index); } function _parseStackIndex(index) { if (_isStackIndex(index)) { if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd return (/^-/).test(index) ? Number(index) - 1 : Number(index); } common.error(index + ': directory stack index out of range'); } else { common.error(index + ': invalid number'); } } function _actualDirStack() { return [process.cwd()].concat(_dirStack); } //@ //@ ### pushd([options,] [dir | '-N' | '+N']) //@ //@ Available options: //@ //@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `dir`: Sets the current working directory to the top of the stack, then executes the equivalent of `cd dir`. //@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. //@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. //@ //@ Examples: //@ //@ ```javascript //@ // process.cwd() === '/usr' //@ pushd('/etc'); // Returns /etc /usr //@ pushd('+1'); // Returns /usr /etc //@ ``` //@ //@ Save the current directory on the top of the directory stack and then `cd` to `dir`. With no arguments, `pushd` exchanges the top two directories. Returns an array of paths in the stack. function _pushd(options, dir) { if (_isStackIndex(options)) { dir = options; options = ''; } options = common.parseOptions(options, { 'n': 'no-cd', 'q': 'quiet', }); var dirs = _actualDirStack(); if (dir === '+0') { return dirs; // +0 is a noop } else if (!dir) { if (dirs.length > 1) { dirs = dirs.splice(1, 1).concat(dirs); } else { return common.error('no other directory'); } } else if (_isStackIndex(dir)) { var n = _parseStackIndex(dir); dirs = dirs.slice(n).concat(dirs.slice(0, n)); } else { if (options['no-cd']) { dirs.splice(1, 0, dir); } else { dirs.unshift(dir); } } if (options['no-cd']) { dirs = dirs.slice(1); } else { dir = path.resolve(dirs.shift()); _cd('', dir); } _dirStack = dirs; return _dirs(options.quiet ? '-q' : ''); } exports.pushd = _pushd; //@ //@ //@ ### popd([options,] ['-N' | '+N']) //@ //@ Available options: //@ //@ + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. //@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. //@ //@ Examples: //@ //@ ```javascript //@ echo(process.cwd()); // '/usr' //@ pushd('/etc'); // '/etc /usr' //@ echo(process.cwd()); // '/etc' //@ popd(); // '/usr' //@ echo(process.cwd()); // '/usr' //@ ``` //@ //@ When no arguments are given, `popd` removes the top directory from the stack and performs a `cd` to the new top directory. The elements are numbered from 0, starting at the first directory listed with dirs (i.e., `popd` is equivalent to `popd +0`). Returns an array of paths in the stack. function _popd(options, index) { if (_isStackIndex(options)) { index = options; options = ''; } options = common.parseOptions(options, { 'n': 'no-cd', 'q': 'quiet', }); if (!_dirStack.length) { return common.error('directory stack empty'); } index = _parseStackIndex(index || '+0'); if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { index = index > 0 ? index - 1 : index; _dirStack.splice(index, 1); } else { var dir = path.resolve(_dirStack.shift()); _cd('', dir); } return _dirs(options.quiet ? '-q' : ''); } exports.popd = _popd; //@ //@ //@ ### dirs([options | '+N' | '-N']) //@ //@ Available options: //@ //@ + `-c`: Clears the directory stack by deleting all of the elements. //@ + `-q`: Supresses output to the console. //@ //@ Arguments: //@ //@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. //@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. //@ //@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if `+N` or `-N` was specified. //@ //@ See also: `pushd`, `popd` function _dirs(options, index) { if (_isStackIndex(options)) { index = options; options = ''; } options = common.parseOptions(options, { 'c': 'clear', 'q': 'quiet', }); if (options.clear) { _dirStack = []; return _dirStack; } var stack = _actualDirStack(); if (index) { index = _parseStackIndex(index); if (index < 0) { index = stack.length + index; } if (!options.quiet) { common.log(stack[index]); } return stack[index]; } if (!options.quiet) { common.log(stack.join(' ')); } return stack; } exports.dirs = _dirs; /***/ }), /***/ 10243: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var format = __webpack_require__(31669).format; var common = __webpack_require__(53687); common.register('echo', _echo, { allowGlobbing: false, }); //@ //@ ### echo([options,] string [, string ...]) //@ //@ Available options: //@ //@ + `-e`: interpret backslash escapes (default) //@ + `-n`: remove trailing newline from output //@ //@ Examples: //@ //@ ```javascript //@ echo('hello world'); //@ var str = echo('hello world'); //@ echo('-n', 'no newline at end'); //@ ``` //@ //@ Prints `string` to stdout, and returns string with additional utility methods //@ like `.to()`. function _echo(opts) { // allow strings starting with '-', see issue #20 var messages = [].slice.call(arguments, opts ? 0 : 1); var options = {}; // If the first argument starts with '-', parse it as options string. // If parseOptions throws, it wasn't an options string. try { options = common.parseOptions(messages[0], { 'e': 'escapes', 'n': 'no_newline', }, { silent: true, }); // Allow null to be echoed if (messages[0]) { messages.shift(); } } catch (_) { // Clear out error if an error occurred common.state.error = null; } var output = format.apply(null, messages); // Add newline if -n is not passed. if (!options.no_newline) { output += '\n'; } process.stdout.write(output); return output; } module.exports = _echo; /***/ }), /***/ 10232: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); //@ //@ ### error() //@ //@ Tests if error occurred in the last command. Returns a truthy value if an //@ error returned, or a falsy value otherwise. //@ //@ **Note**: do not rely on the //@ return value to be an error message. If you need the last error message, use //@ the `.stderr` attribute from the last command's return value instead. function error() { return common.state.error; } module.exports = error; /***/ }), /***/ 69607: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); if (require.main !== module) { throw new Error('This file should not be required'); } var childProcess = __webpack_require__(63129); var fs = __webpack_require__(35747); var paramFilePath = process.argv[2]; var serializedParams = fs.readFileSync(paramFilePath, 'utf8'); var params = JSON.parse(serializedParams); var cmd = params.command; var execOptions = params.execOptions; var pipe = params.pipe; var stdoutFile = params.stdoutFile; var stderrFile = params.stderrFile; var c = childProcess.exec(cmd, execOptions, function (err) { if (!err) { process.exitCode = 0; } else if (err.code === undefined) { process.exitCode = 1; } else { process.exitCode = err.code; } }); var stdoutStream = fs.createWriteStream(stdoutFile); var stderrStream = fs.createWriteStream(stderrFile); c.stdout.pipe(stdoutStream); c.stderr.pipe(stderrStream); c.stdout.pipe(process.stdout); c.stderr.pipe(process.stderr); if (pipe) { c.stdin.end(pipe); } /***/ }), /***/ 10896: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var _tempDir = __webpack_require__(76150).tempDir; var _pwd = __webpack_require__(58553); var path = __webpack_require__(85622); var fs = __webpack_require__(35747); var child = __webpack_require__(63129); var DEFAULT_MAXBUFFER_SIZE = 20 * 1024 * 1024; var DEFAULT_ERROR_CODE = 1; common.register('exec', _exec, { unix: false, canReceivePipe: true, wrapOutput: false, }); // We use this function to run `exec` synchronously while also providing realtime // output. function execSync(cmd, opts, pipe) { if (!common.config.execPath) { common.error('Unable to find a path to the node binary. Please manually set config.execPath'); } var tempDir = _tempDir(); var paramsFile = path.resolve(tempDir + '/' + common.randomFileName()); var stderrFile = path.resolve(tempDir + '/' + common.randomFileName()); var stdoutFile = path.resolve(tempDir + '/' + common.randomFileName()); opts = common.extend({ silent: common.config.silent, cwd: _pwd().toString(), env: process.env, maxBuffer: DEFAULT_MAXBUFFER_SIZE, encoding: 'utf8', }, opts); if (fs.existsSync(paramsFile)) common.unlinkSync(paramsFile); if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); opts.cwd = path.resolve(opts.cwd); var paramsToSerialize = { command: cmd, execOptions: opts, pipe: pipe, stdoutFile: stdoutFile, stderrFile: stderrFile, }; fs.writeFileSync(paramsFile, JSON.stringify(paramsToSerialize), 'utf8'); var execArgs = [ __webpack_require__.ab + "exec-child.js", paramsFile, ]; /* istanbul ignore else */ if (opts.silent) { opts.stdio = 'ignore'; } else { opts.stdio = [0, 1, 2]; } var code = 0; // Welcome to the future try { // Bad things if we pass in a `shell` option to child_process.execFileSync, // so we need to explicitly remove it here. delete opts.shell; child.execFileSync(common.config.execPath, execArgs, opts); } catch (e) { // Commands with non-zero exit code raise an exception. code = e.status || DEFAULT_ERROR_CODE; } // fs.readFileSync uses buffer encoding by default, so call // it without the encoding option if the encoding is 'buffer'. // Also, if the exec timeout is too short for node to start up, // the files will not be created, so these calls will throw. var stdout = ''; var stderr = ''; if (opts.encoding === 'buffer') { stdout = fs.readFileSync(stdoutFile); stderr = fs.readFileSync(stderrFile); } else { stdout = fs.readFileSync(stdoutFile, opts.encoding); stderr = fs.readFileSync(stderrFile, opts.encoding); } // No biggie if we can't erase the files now -- they're in a temp dir anyway try { common.unlinkSync(paramsFile); } catch (e) {} try { common.unlinkSync(stderrFile); } catch (e) {} try { common.unlinkSync(stdoutFile); } catch (e) {} if (code !== 0) { // Note: `silent` should be unconditionally true to avoid double-printing // the command's stderr, and to avoid printing any stderr when the user has // set `shell.config.silent`. common.error(stderr, code, { continue: true, silent: true }); } var obj = common.ShellString(stdout, stderr, code); return obj; } // execSync() // Wrapper around exec() to enable echoing output to console in real time function execAsync(cmd, opts, pipe, callback) { opts = common.extend({ silent: common.config.silent, cwd: _pwd().toString(), env: process.env, maxBuffer: DEFAULT_MAXBUFFER_SIZE, encoding: 'utf8', }, opts); var c = child.exec(cmd, opts, function (err, stdout, stderr) { if (callback) { if (!err) { callback(0, stdout, stderr); } else if (err.code === undefined) { // See issue #536 /* istanbul ignore next */ callback(1, stdout, stderr); } else { callback(err.code, stdout, stderr); } } }); if (pipe) c.stdin.end(pipe); if (!opts.silent) { c.stdout.pipe(process.stdout); c.stderr.pipe(process.stderr); } return c; } //@ //@ ### exec(command [, options] [, callback]) //@ //@ Available options: //@ //@ + `async`: Asynchronous execution. If a callback is provided, it will be set to //@ `true`, regardless of the passed value (default: `false`). //@ + `silent`: Do not echo program output to console (default: `false`). //@ + `encoding`: Character encoding to use. Affects the values returned to stdout and stderr, and //@ what is written to stdout and stderr when not in silent mode (default: `'utf8'`). //@ + and any option available to Node.js's //@ [`child_process.exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) //@ //@ Examples: //@ //@ ```javascript //@ var version = exec('node --version', {silent:true}).stdout; //@ //@ var child = exec('some_long_running_process', {async:true}); //@ child.stdout.on('data', function(data) { //@ /* ... do something with data ... */ //@ }); //@ //@ exec('some_long_running_process', function(code, stdout, stderr) { //@ console.log('Exit code:', code); //@ console.log('Program output:', stdout); //@ console.log('Program stderr:', stderr); //@ }); //@ ``` //@ //@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous //@ mode, this returns a `ShellString` (compatible with ShellJS v0.6.x, which returns an object //@ of the form `{ code:..., stdout:... , stderr:... }`). Otherwise, this returns the child process //@ object, and the `callback` receives the arguments `(code, stdout, stderr)`. //@ //@ Not seeing the behavior you want? `exec()` runs everything through `sh` //@ by default (or `cmd.exe` on Windows), which differs from `bash`. If you //@ need bash-specific behavior, try out the `{shell: 'path/to/bash'}` option. function _exec(command, options, callback) { options = options || {}; if (!command) common.error('must specify command'); var pipe = common.readFromPipe(); // Callback is defined instead of options. if (typeof options === 'function') { callback = options; options = { async: true }; } // Callback is defined with options. if (typeof options === 'object' && typeof callback === 'function') { options.async = true; } options = common.extend({ silent: common.config.silent, async: false, }, options); if (options.async) { return execAsync(command, options, pipe, callback); } else { return execSync(command, options, pipe); } } module.exports = _exec; /***/ }), /***/ 47838: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var path = __webpack_require__(85622); var common = __webpack_require__(53687); var _ls = __webpack_require__(35561); common.register('find', _find, {}); //@ //@ ### find(path [, path ...]) //@ ### find(path_array) //@ //@ Examples: //@ //@ ```javascript //@ find('src', 'lib'); //@ find(['src', 'lib']); // same as above //@ find('.').filter(function(file) { return file.match(/\.js$/); }); //@ ``` //@ //@ Returns array of all files (however deep) in the given paths. //@ //@ The main difference from `ls('-R', path)` is that the resulting file names //@ include the base directories (e.g., `lib/resources/file1` instead of just `file1`). function _find(options, paths) { if (!paths) { common.error('no path specified'); } else if (typeof paths === 'string') { paths = [].slice.call(arguments, 1); } var list = []; function pushFile(file) { if (process.platform === 'win32') { file = file.replace(/\\/g, '/'); } list.push(file); } // why not simply do `ls('-R', paths)`? because the output wouldn't give the base dirs // to get the base dir in the output, we need instead `ls('-R', 'dir/*')` for every directory paths.forEach(function (file) { var stat; try { stat = common.statFollowLinks(file); } catch (e) { common.error('no such file or directory: ' + file); } pushFile(file); if (stat.isDirectory()) { _ls({ recursive: true, all: true }, file).forEach(function (subfile) { pushFile(path.join(file, subfile)); }); } }); return list; } module.exports = _find; /***/ }), /***/ 17417: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('grep', _grep, { globStart: 2, // don't glob-expand the regex canReceivePipe: true, cmdOptions: { 'v': 'inverse', 'l': 'nameOnly', 'i': 'ignoreCase', }, }); //@ //@ ### grep([options,] regex_filter, file [, file ...]) //@ ### grep([options,] regex_filter, file_array) //@ //@ Available options: //@ //@ + `-v`: Invert `regex_filter` (only print non-matching lines). //@ + `-l`: Print only filenames of matching files. //@ + `-i`: Ignore case. //@ //@ Examples: //@ //@ ```javascript //@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); //@ grep('GLOBAL_VARIABLE', '*.js'); //@ ``` //@ //@ Reads input string from given files and returns a string containing all lines of the //@ file that match the given `regex_filter`. function _grep(options, regex, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given', 2); files = [].slice.call(arguments, 2); if (pipe) { files.unshift('-'); } var grep = []; if (options.ignoreCase) { regex = new RegExp(regex, 'i'); } files.forEach(function (file) { if (!fs.existsSync(file) && file !== '-') { common.error('no such file or directory: ' + file, 2, { continue: true }); return; } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); if (options.nameOnly) { if (contents.match(regex)) { grep.push(file); } } else { var lines = contents.split('\n'); lines.forEach(function (line) { var matched = line.match(regex); if ((options.inverse && !matched) || (!options.inverse && matched)) { grep.push(line); } }); } }); return grep.join('\n') + '\n'; } module.exports = _grep; /***/ }), /***/ 6613: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('head', _head, { canReceivePipe: true, cmdOptions: { 'n': 'numLines', }, }); // Reads |numLines| lines or the entire file, whichever is less. function readSomeLines(file, numLines) { var buf = common.buffer(); var bufLength = buf.length; var bytesRead = bufLength; var pos = 0; var fdr = fs.openSync(file, 'r'); var numLinesRead = 0; var ret = ''; while (bytesRead === bufLength && numLinesRead < numLines) { bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos); var bufStr = buf.toString('utf8', 0, bytesRead); numLinesRead += bufStr.split('\n').length - 1; ret += bufStr; pos += bytesRead; } fs.closeSync(fdr); return ret; } //@ //@ ### head([{'-n': \},] file [, file ...]) //@ ### head([{'-n': \},] file_array) //@ //@ Available options: //@ //@ + `-n `: Show the first `` lines of the files //@ //@ Examples: //@ //@ ```javascript //@ var str = head({'-n': 1}, 'file*.txt'); //@ var str = head('file1', 'file2'); //@ var str = head(['file1', 'file2']); // same as above //@ ``` //@ //@ Read the start of a file. function _head(options, files) { var head = []; var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given'); var idx = 1; if (options.numLines === true) { idx = 2; options.numLines = Number(arguments[1]); } else if (options.numLines === false) { options.numLines = 10; } files = [].slice.call(arguments, idx); if (pipe) { files.unshift('-'); } var shouldAppendNewline = false; files.forEach(function (file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return; } else if (common.statFollowLinks(file).isDirectory()) { common.error("error reading '" + file + "': Is a directory", { continue: true, }); return; } } var contents; if (file === '-') { contents = pipe; } else if (options.numLines < 0) { contents = fs.readFileSync(file, 'utf8'); } else { contents = readSomeLines(file, options.numLines); } var lines = contents.split('\n'); var hasTrailingNewline = (lines[lines.length - 1] === ''); if (hasTrailingNewline) { lines.pop(); } shouldAppendNewline = (hasTrailingNewline || options.numLines < lines.length); head = head.concat(lines.slice(0, options.numLines)); }); if (shouldAppendNewline) { head.push(''); // to add a trailing newline once we join } return head.join('\n'); } module.exports = _head; /***/ }), /***/ 15787: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(35747); var path = __webpack_require__(85622); var common = __webpack_require__(53687); common.register('ln', _ln, { cmdOptions: { 's': 'symlink', 'f': 'force', }, }); //@ //@ ### ln([options,] source, dest) //@ //@ Available options: //@ //@ + `-s`: symlink //@ + `-f`: force //@ //@ Examples: //@ //@ ```javascript //@ ln('file', 'newlink'); //@ ln('-sf', 'file', 'existing'); //@ ``` //@ //@ Links `source` to `dest`. Use `-f` to force the link, should `dest` already exist. function _ln(options, source, dest) { if (!source || !dest) { common.error('Missing and/or '); } source = String(source); var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), ''); var isAbsolute = (path.resolve(source) === sourcePath); dest = path.resolve(process.cwd(), String(dest)); if (fs.existsSync(dest)) { if (!options.force) { common.error('Destination file exists', { continue: true }); } fs.unlinkSync(dest); } if (options.symlink) { var isWindows = process.platform === 'win32'; var linkType = isWindows ? 'file' : null; var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source); if (!fs.existsSync(resolvedSourcePath)) { common.error('Source file does not exist', { continue: true }); } else if (isWindows && common.statFollowLinks(resolvedSourcePath).isDirectory()) { linkType = 'junction'; } try { fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath : source, dest, linkType); } catch (err) { common.error(err.message); } } else { if (!fs.existsSync(source)) { common.error('Source file does not exist', { continue: true }); } try { fs.linkSync(source, dest); } catch (err) { common.error(err.message); } } return ''; } module.exports = _ln; /***/ }), /***/ 35561: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var path = __webpack_require__(85622); var fs = __webpack_require__(35747); var common = __webpack_require__(53687); var glob = __webpack_require__(91957); var globPatternRecursive = path.sep + '**'; common.register('ls', _ls, { cmdOptions: { 'R': 'recursive', 'A': 'all', 'L': 'link', 'a': 'all_deprecated', 'd': 'directory', 'l': 'long', }, }); //@ //@ ### ls([options,] [path, ...]) //@ ### ls([options,] path_array) //@ //@ Available options: //@ //@ + `-R`: recursive //@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) //@ + `-L`: follow symlinks //@ + `-d`: list directories themselves, not their contents //@ + `-l`: list objects representing each file, each with fields containing `ls //@ -l` output fields. See //@ [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) //@ for more info //@ //@ Examples: //@ //@ ```javascript //@ ls('projs/*.js'); //@ ls('-R', '/users/me', '/tmp'); //@ ls('-R', ['/users/me', '/tmp']); // same as above //@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} //@ ``` //@ //@ Returns array of files in the given `path`, or files in //@ the current directory if no `path` is provided. function _ls(options, paths) { if (options.all_deprecated) { // We won't support the -a option as it's hard to image why it's useful // (it includes '.' and '..' in addition to '.*' files) // For backwards compatibility we'll dump a deprecated message and proceed as before common.log('ls: Option -a is deprecated. Use -A instead'); options.all = true; } if (!paths) { paths = ['.']; } else { paths = [].slice.call(arguments, 1); } var list = []; function pushFile(abs, relName, stat) { if (process.platform === 'win32') { relName = relName.replace(/\\/g, '/'); } if (options.long) { stat = stat || (options.link ? common.statFollowLinks(abs) : common.statNoFollowLinks(abs)); list.push(addLsAttributes(relName, stat)); } else { // list.push(path.relative(rel || '.', file)); list.push(relName); } } paths.forEach(function (p) { var stat; try { stat = options.link ? common.statFollowLinks(p) : common.statNoFollowLinks(p); // follow links to directories by default if (stat.isSymbolicLink()) { /* istanbul ignore next */ // workaround for https://github.com/shelljs/shelljs/issues/795 // codecov seems to have a bug that miscalculate this block as uncovered. // but according to nyc report this block does get covered. try { var _stat = common.statFollowLinks(p); if (_stat.isDirectory()) { stat = _stat; } } catch (_) {} // bad symlink, treat it like a file } } catch (e) { common.error('no such file or directory: ' + p, 2, { continue: true }); return; } // If the stat succeeded if (stat.isDirectory() && !options.directory) { if (options.recursive) { // use glob, because it's simple glob.sync(p + globPatternRecursive, { dot: options.all, follow: options.link }) .forEach(function (item) { // Glob pattern returns the directory itself and needs to be filtered out. if (path.relative(p, item)) { pushFile(item, path.relative(p, item)); } }); } else if (options.all) { // use fs.readdirSync, because it's fast fs.readdirSync(p).forEach(function (item) { pushFile(path.join(p, item), item); }); } else { // use fs.readdirSync and then filter out secret files fs.readdirSync(p).forEach(function (item) { if (item[0] !== '.') { pushFile(path.join(p, item), item); } }); } } else { pushFile(p, p, stat); } }); // Add methods, to make this more compatible with ShellStrings return list; } function addLsAttributes(pathName, stats) { // Note: this object will contain more information than .toString() returns stats.name = pathName; stats.toString = function () { // Return a string resembling unix's `ls -l` format return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' '); }; return stats; } module.exports = _ls; /***/ }), /***/ 72695: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); common.register('mkdir', _mkdir, { cmdOptions: { 'p': 'fullpath', }, }); // Recursively creates `dir` function mkdirSyncRecursive(dir) { var baseDir = path.dirname(dir); // Prevents some potential problems arising from malformed UNCs or // insufficient permissions. /* istanbul ignore next */ if (baseDir === dir) { common.error('dirname() failed: [' + dir + ']'); } // Base dir exists, no recursion necessary if (fs.existsSync(baseDir)) { fs.mkdirSync(dir, parseInt('0777', 8)); return; } // Base dir does not exist, go recursive mkdirSyncRecursive(baseDir); // Base dir created, can create dir fs.mkdirSync(dir, parseInt('0777', 8)); } //@ //@ ### mkdir([options,] dir [, dir ...]) //@ ### mkdir([options,] dir_array) //@ //@ Available options: //@ //@ + `-p`: full path (and create intermediate directories, if necessary) //@ //@ Examples: //@ //@ ```javascript //@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); //@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above //@ ``` //@ //@ Creates directories. function _mkdir(options, dirs) { if (!dirs) common.error('no paths given'); if (typeof dirs === 'string') { dirs = [].slice.call(arguments, 1); } // if it's array leave it as it is dirs.forEach(function (dir) { try { var stat = common.statNoFollowLinks(dir); if (!options.fullpath) { common.error('path already exists: ' + dir, { continue: true }); } else if (stat.isFile()) { common.error('cannot create directory ' + dir + ': File exists', { continue: true }); } return; // skip dir } catch (e) { // do nothing } // Base dir does not exist, and no -p option given var baseDir = path.dirname(dir); if (!fs.existsSync(baseDir) && !options.fullpath) { common.error('no such file or directory: ' + baseDir, { continue: true }); return; // skip dir } try { if (options.fullpath) { mkdirSyncRecursive(path.resolve(dir)); } else { fs.mkdirSync(dir, parseInt('0777', 8)); } } catch (e) { var reason; if (e.code === 'EACCES') { reason = 'Permission denied'; } else if (e.code === 'ENOTDIR' || e.code === 'ENOENT') { reason = 'Not a directory'; } else { /* istanbul ignore next */ throw e; } common.error('cannot create directory ' + dir + ': ' + reason, { continue: true }); } }); return ''; } // mkdir module.exports = _mkdir; /***/ }), /***/ 39849: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(35747); var path = __webpack_require__(85622); var common = __webpack_require__(53687); var cp = __webpack_require__(34932); var rm = __webpack_require__(22830); common.register('mv', _mv, { cmdOptions: { 'f': '!no_force', 'n': 'no_force', }, }); // Checks if cureent file was created recently function checkRecentCreated(sources, index) { var lookedSource = sources[index]; return sources.slice(0, index).some(function (src) { return path.basename(src) === path.basename(lookedSource); }); } //@ //@ ### mv([options ,] source [, source ...], dest') //@ ### mv([options ,] source_array, dest') //@ //@ Available options: //@ //@ + `-f`: force (default behavior) //@ + `-n`: no-clobber //@ //@ Examples: //@ //@ ```javascript //@ mv('-n', 'file', 'dir/'); //@ mv('file1', 'file2', 'dir/'); //@ mv(['file1', 'file2'], 'dir/'); // same as above //@ ``` //@ //@ Moves `source` file(s) to `dest`. function _mv(options, sources, dest) { // Get sources, dest if (arguments.length < 3) { common.error('missing and/or '); } else if (arguments.length > 3) { sources = [].slice.call(arguments, 1, arguments.length - 1); dest = arguments[arguments.length - 1]; } else if (typeof sources === 'string') { sources = [sources]; } else { // TODO(nate): figure out if we actually need this line common.error('invalid arguments'); } var exists = fs.existsSync(dest); var stats = exists && common.statFollowLinks(dest); // Dest is not existing dir, but multiple sources given if ((!exists || !stats.isDirectory()) && sources.length > 1) { common.error('dest is not a directory (too many sources)'); } // Dest is an existing file, but no -f given if (exists && stats.isFile() && options.no_force) { common.error('dest file already exists: ' + dest); } sources.forEach(function (src, srcIndex) { if (!fs.existsSync(src)) { common.error('no such file or directory: ' + src, { continue: true }); return; // skip file } // If here, src exists // When copying to '/path/dir': // thisDest = '/path/dir/file1' var thisDest = dest; if (fs.existsSync(dest) && common.statFollowLinks(dest).isDirectory()) { thisDest = path.normalize(dest + '/' + path.basename(src)); } var thisDestExists = fs.existsSync(thisDest); if (thisDestExists && checkRecentCreated(sources, srcIndex)) { // cannot overwrite file created recently in current execution, but we want to continue copying other files if (!options.no_force) { common.error("will not overwrite just-created '" + thisDest + "' with '" + src + "'", { continue: true }); } return; } if (fs.existsSync(thisDest) && options.no_force) { common.error('dest file already exists: ' + thisDest, { continue: true }); return; // skip file } if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { common.error('cannot move to self: ' + src, { continue: true }); return; // skip file } try { fs.renameSync(src, thisDest); } catch (e) { /* istanbul ignore next */ if (e.code === 'EXDEV') { // If we're trying to `mv` to an external partition, we'll actually need // to perform a copy and then clean up the original file. If either the // copy or the rm fails with an exception, we should allow this // exception to pass up to the top level. cp('-r', src, thisDest); rm('-rf', src); } } }); // forEach(src) return ''; } // mv module.exports = _mv; /***/ }), /***/ 50227: /***/ (() => { // see dirs.js /***/ }), /***/ 44177: /***/ (() => { // see dirs.js /***/ }), /***/ 58553: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var path = __webpack_require__(85622); var common = __webpack_require__(53687); common.register('pwd', _pwd, { allowGlobbing: false, }); //@ //@ ### pwd() //@ //@ Returns the current directory. function _pwd() { var pwd = path.resolve(process.cwd()); return pwd; } module.exports = _pwd; /***/ }), /***/ 22830: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('rm', _rm, { cmdOptions: { 'f': 'force', 'r': 'recursive', 'R': 'recursive', }, }); // Recursively removes 'dir' // Adapted from https://github.com/ryanmcgrath/wrench-js // // Copyright (c) 2010 Ryan McGrath // Copyright (c) 2012 Artur Adib // // Licensed under the MIT License // http://www.opensource.org/licenses/mit-license.php function rmdirSyncRecursive(dir, force, fromSymlink) { var files; files = fs.readdirSync(dir); // Loop through and delete everything in the sub-tree after checking it for (var i = 0; i < files.length; i++) { var file = dir + '/' + files[i]; var currFile = common.statNoFollowLinks(file); if (currFile.isDirectory()) { // Recursive function back to the beginning rmdirSyncRecursive(file, force); } else { // Assume it's a file - perhaps a try/catch belongs here? if (force || isWriteable(file)) { try { common.unlinkSync(file); } catch (e) { /* istanbul ignore next */ common.error('could not remove file (code ' + e.code + '): ' + file, { continue: true, }); } } } } // if was directory was referenced through a symbolic link, // the contents should be removed, but not the directory itself if (fromSymlink) return; // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. // Huzzah for the shopkeep. var result; try { // Retry on windows, sometimes it takes a little time before all the files in the directory are gone var start = Date.now(); // TODO: replace this with a finite loop for (;;) { try { result = fs.rmdirSync(dir); if (fs.existsSync(dir)) throw { code: 'EAGAIN' }; break; } catch (er) { /* istanbul ignore next */ // In addition to error codes, also check if the directory still exists and loop again if true if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) { if (Date.now() - start > 1000) throw er; } else if (er.code === 'ENOENT') { // Directory did not exist, deletion was successful break; } else { throw er; } } } } catch (e) { common.error('could not remove directory (code ' + e.code + '): ' + dir, { continue: true }); } return result; } // rmdirSyncRecursive // Hack to determine if file has write permissions for current user // Avoids having to check user, group, etc, but it's probably slow function isWriteable(file) { var writePermission = true; try { var __fd = fs.openSync(file, 'a'); fs.closeSync(__fd); } catch (e) { writePermission = false; } return writePermission; } function handleFile(file, options) { if (options.force || isWriteable(file)) { // -f was passed, or file is writable, so it can be removed common.unlinkSync(file); } else { common.error('permission denied: ' + file, { continue: true }); } } function handleDirectory(file, options) { if (options.recursive) { // -r was passed, so directory can be removed rmdirSyncRecursive(file, options.force); } else { common.error('path is a directory', { continue: true }); } } function handleSymbolicLink(file, options) { var stats; try { stats = common.statFollowLinks(file); } catch (e) { // symlink is broken, so remove the symlink itself common.unlinkSync(file); return; } if (stats.isFile()) { common.unlinkSync(file); } else if (stats.isDirectory()) { if (file[file.length - 1] === '/') { // trailing separator, so remove the contents, not the link if (options.recursive) { // -r was passed, so directory can be removed var fromSymlink = true; rmdirSyncRecursive(file, options.force, fromSymlink); } else { common.error('path is a directory', { continue: true }); } } else { // no trailing separator, so remove the link common.unlinkSync(file); } } } function handleFIFO(file) { common.unlinkSync(file); } //@ //@ ### rm([options,] file [, file ...]) //@ ### rm([options,] file_array) //@ //@ Available options: //@ //@ + `-f`: force //@ + `-r, -R`: recursive //@ //@ Examples: //@ //@ ```javascript //@ rm('-rf', '/tmp/*'); //@ rm('some_file.txt', 'another_file.txt'); //@ rm(['some_file.txt', 'another_file.txt']); // same as above //@ ``` //@ //@ Removes files. function _rm(options, files) { if (!files) common.error('no paths given'); // Convert to array files = [].slice.call(arguments, 1); files.forEach(function (file) { var lstats; try { var filepath = (file[file.length - 1] === '/') ? file.slice(0, -1) // remove the '/' so lstatSync can detect symlinks : file; lstats = common.statNoFollowLinks(filepath); // test for existence } catch (e) { // Path does not exist, no force flag given if (!options.force) { common.error('no such file or directory: ' + file, { continue: true }); } return; // skip file } // If here, path exists if (lstats.isFile()) { handleFile(file, options); } else if (lstats.isDirectory()) { handleDirectory(file, options); } else if (lstats.isSymbolicLink()) { handleSymbolicLink(file, options); } else if (lstats.isFIFO()) { handleFIFO(file); } }); // forEach(file) return ''; } // rm module.exports = _rm; /***/ }), /***/ 25899: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('sed', _sed, { globStart: 3, // don't glob-expand regexes canReceivePipe: true, cmdOptions: { 'i': 'inplace', }, }); //@ //@ ### sed([options,] search_regex, replacement, file [, file ...]) //@ ### sed([options,] search_regex, replacement, file_array) //@ //@ Available options: //@ //@ + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_ //@ //@ Examples: //@ //@ ```javascript //@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); //@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); //@ ``` //@ //@ Reads an input string from `file`s, and performs a JavaScript `replace()` on the input //@ using the given `search_regex` and `replacement` string or function. Returns the new string after replacement. //@ //@ Note: //@ //@ Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified //@ using the `$n` syntax: //@ //@ ```javascript //@ sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt'); //@ ``` function _sed(options, regex, replacement, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (typeof replacement !== 'string' && typeof replacement !== 'function') { if (typeof replacement === 'number') { replacement = replacement.toString(); // fallback } else { common.error('invalid replacement string'); } } // Convert all search strings to RegExp if (typeof regex === 'string') { regex = RegExp(regex); } if (!files && !pipe) { common.error('no files given'); } files = [].slice.call(arguments, 3); if (pipe) { files.unshift('-'); } var sed = []; files.forEach(function (file) { if (!fs.existsSync(file) && file !== '-') { common.error('no such file or directory: ' + file, 2, { continue: true }); return; } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); var lines = contents.split('\n'); var result = lines.map(function (line) { return line.replace(regex, replacement); }).join('\n'); sed.push(result); if (options.inplace) { fs.writeFileSync(file, result, 'utf8'); } }); return sed.join('\n'); } module.exports = _sed; /***/ }), /***/ 11411: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); common.register('set', _set, { allowGlobbing: false, wrapOutput: false, }); //@ //@ ### set(options) //@ //@ Available options: //@ //@ + `+/-e`: exit upon error (`config.fatal`) //@ + `+/-v`: verbose: show all commands (`config.verbose`) //@ + `+/-f`: disable filename expansion (globbing) //@ //@ Examples: //@ //@ ```javascript //@ set('-e'); // exit upon first error //@ set('+e'); // this undoes a "set('-e')" //@ ``` //@ //@ Sets global configuration variables. function _set(options) { if (!options) { var args = [].slice.call(arguments, 0); if (args.length < 2) common.error('must provide an argument'); options = args[1]; } var negate = (options[0] === '+'); if (negate) { options = '-' + options.slice(1); // parseOptions needs a '-' prefix } options = common.parseOptions(options, { 'e': 'fatal', 'v': 'verbose', 'f': 'noglob', }); if (negate) { Object.keys(options).forEach(function (key) { options[key] = !options[key]; }); } Object.keys(options).forEach(function (key) { // Only change the global config if `negate` is false and the option is true // or if `negate` is true and the option is false (aka negate !== option) if (negate !== options[key]) { common.config[key] = options[key]; } }); return; } module.exports = _set; /***/ }), /***/ 72116: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('sort', _sort, { canReceivePipe: true, cmdOptions: { 'r': 'reverse', 'n': 'numerical', }, }); // parse out the number prefix of a line function parseNumber(str) { var match = str.match(/^\s*(\d*)\s*(.*)$/); return { num: Number(match[1]), value: match[2] }; } // compare two strings case-insensitively, but examine case for strings that are // case-insensitive equivalent function unixCmp(a, b) { var aLower = a.toLowerCase(); var bLower = b.toLowerCase(); return (aLower === bLower ? -1 * a.localeCompare(b) : // unix sort treats case opposite how javascript does aLower.localeCompare(bLower)); } // compare two strings in the fashion that unix sort's -n option works function numericalCmp(a, b) { var objA = parseNumber(a); var objB = parseNumber(b); if (objA.hasOwnProperty('num') && objB.hasOwnProperty('num')) { return ((objA.num !== objB.num) ? (objA.num - objB.num) : unixCmp(objA.value, objB.value)); } else { return unixCmp(objA.value, objB.value); } } //@ //@ ### sort([options,] file [, file ...]) //@ ### sort([options,] file_array) //@ //@ Available options: //@ //@ + `-r`: Reverse the results //@ + `-n`: Compare according to numerical value //@ //@ Examples: //@ //@ ```javascript //@ sort('foo.txt', 'bar.txt'); //@ sort('-r', 'foo.txt'); //@ ``` //@ //@ Return the contents of the `file`s, sorted line-by-line. Sorting multiple //@ files mixes their content (just as unix `sort` does). function _sort(options, files) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no files given'); files = [].slice.call(arguments, 1); if (pipe) { files.unshift('-'); } var lines = files.reduce(function (accum, file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return accum; } else if (common.statFollowLinks(file).isDirectory()) { common.error('read failed: ' + file + ': Is a directory', { continue: true, }); return accum; } } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); return accum.concat(contents.trimRight().split('\n')); }, []); var sorted = lines.sort(options.numerical ? numericalCmp : unixCmp); if (options.reverse) { sorted = sorted.reverse(); } return sorted.join('\n') + '\n'; } module.exports = _sort; /***/ }), /***/ 42284: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('tail', _tail, { canReceivePipe: true, cmdOptions: { 'n': 'numLines', }, }); //@ //@ ### tail([{'-n': \},] file [, file ...]) //@ ### tail([{'-n': \},] file_array) //@ //@ Available options: //@ //@ + `-n `: Show the last `` lines of `file`s //@ //@ Examples: //@ //@ ```javascript //@ var str = tail({'-n': 1}, 'file*.txt'); //@ var str = tail('file1', 'file2'); //@ var str = tail(['file1', 'file2']); // same as above //@ ``` //@ //@ Read the end of a `file`. function _tail(options, files) { var tail = []; var pipe = common.readFromPipe(); if (!files && !pipe) common.error('no paths given'); var idx = 1; if (options.numLines === true) { idx = 2; options.numLines = Number(arguments[1]); } else if (options.numLines === false) { options.numLines = 10; } options.numLines = -1 * Math.abs(options.numLines); files = [].slice.call(arguments, idx); if (pipe) { files.unshift('-'); } var shouldAppendNewline = false; files.forEach(function (file) { if (file !== '-') { if (!fs.existsSync(file)) { common.error('no such file or directory: ' + file, { continue: true }); return; } else if (common.statFollowLinks(file).isDirectory()) { common.error("error reading '" + file + "': Is a directory", { continue: true, }); return; } } var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); var lines = contents.split('\n'); if (lines[lines.length - 1] === '') { lines.pop(); shouldAppendNewline = true; } else { shouldAppendNewline = false; } tail = tail.concat(lines.slice(options.numLines)); }); if (shouldAppendNewline) { tail.push(''); // to add a trailing newline once we join } return tail.join('\n'); } module.exports = _tail; /***/ }), /***/ 76150: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var os = __webpack_require__(12087); var fs = __webpack_require__(35747); common.register('tempdir', _tempDir, { allowGlobbing: false, wrapOutput: false, }); // Returns false if 'dir' is not a writeable directory, 'dir' otherwise function writeableDir(dir) { if (!dir || !fs.existsSync(dir)) return false; if (!common.statFollowLinks(dir).isDirectory()) return false; var testFile = dir + '/' + common.randomFileName(); try { fs.writeFileSync(testFile, ' '); common.unlinkSync(testFile); return dir; } catch (e) { /* istanbul ignore next */ return false; } } // Variable to cache the tempdir value for successive lookups. var cachedTempDir; //@ //@ ### tempdir() //@ //@ Examples: //@ //@ ```javascript //@ var tmp = tempdir(); // "/tmp" for most *nix platforms //@ ``` //@ //@ Searches and returns string containing a writeable, platform-dependent temporary directory. //@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). function _tempDir() { if (cachedTempDir) return cachedTempDir; cachedTempDir = writeableDir(os.tmpdir()) || writeableDir(process.env.TMPDIR) || writeableDir(process.env.TEMP) || writeableDir(process.env.TMP) || writeableDir(process.env.Wimp$ScrapDir) || // RiscOS writeableDir('C:\\TEMP') || // Windows writeableDir('C:\\TMP') || // Windows writeableDir('\\TEMP') || // Windows writeableDir('\\TMP') || // Windows writeableDir('/tmp') || writeableDir('/var/tmp') || writeableDir('/usr/tmp') || writeableDir('.'); // last resort return cachedTempDir; } // Indicates if the tempdir value is currently cached. This is exposed for tests // only. The return value should only be tested for truthiness. function isCached() { return cachedTempDir; } // Clears the cached tempDir value, if one is cached. This is exposed for tests // only. function clearCache() { cachedTempDir = undefined; } module.exports.tempDir = _tempDir; module.exports.isCached = isCached; module.exports.clearCache = clearCache; /***/ }), /***/ 79723: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('test', _test, { cmdOptions: { 'b': 'block', 'c': 'character', 'd': 'directory', 'e': 'exists', 'f': 'file', 'L': 'link', 'p': 'pipe', 'S': 'socket', }, wrapOutput: false, allowGlobbing: false, }); //@ //@ ### test(expression) //@ //@ Available expression primaries: //@ //@ + `'-b', 'path'`: true if path is a block device //@ + `'-c', 'path'`: true if path is a character device //@ + `'-d', 'path'`: true if path is a directory //@ + `'-e', 'path'`: true if path exists //@ + `'-f', 'path'`: true if path is a regular file //@ + `'-L', 'path'`: true if path is a symbolic link //@ + `'-p', 'path'`: true if path is a pipe (FIFO) //@ + `'-S', 'path'`: true if path is a socket //@ //@ Examples: //@ //@ ```javascript //@ if (test('-d', path)) { /* do something with dir */ }; //@ if (!test('-f', path)) continue; // skip if it's a regular file //@ ``` //@ //@ Evaluates `expression` using the available primaries and returns corresponding value. function _test(options, path) { if (!path) common.error('no path given'); var canInterpret = false; Object.keys(options).forEach(function (key) { if (options[key] === true) { canInterpret = true; } }); if (!canInterpret) common.error('could not interpret expression'); if (options.link) { try { return common.statNoFollowLinks(path).isSymbolicLink(); } catch (e) { return false; } } if (!fs.existsSync(path)) return false; if (options.exists) return true; var stats = common.statFollowLinks(path); if (options.block) return stats.isBlockDevice(); if (options.character) return stats.isCharacterDevice(); if (options.directory) return stats.isDirectory(); if (options.file) return stats.isFile(); /* istanbul ignore next */ if (options.pipe) return stats.isFIFO(); /* istanbul ignore next */ if (options.socket) return stats.isSocket(); /* istanbul ignore next */ return false; // fallback } // test module.exports = _test; /***/ }), /***/ 71961: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); common.register('to', _to, { pipeOnly: true, wrapOutput: false, }); //@ //@ ### ShellString.prototype.to(file) //@ //@ Examples: //@ //@ ```javascript //@ cat('input.txt').to('output.txt'); //@ ``` //@ //@ Analogous to the redirection operator `>` in Unix, but works with //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix //@ redirections, `to()` will overwrite any existing file!_ function _to(options, file) { if (!file) common.error('wrong arguments'); if (!fs.existsSync(path.dirname(file))) { common.error('no such file or directory: ' + path.dirname(file)); } try { fs.writeFileSync(file, this.stdout || this.toString(), 'utf8'); return this; } catch (e) { /* istanbul ignore next */ common.error('could not write to file (code ' + e.code + '): ' + file, { continue: true }); } } module.exports = _to; /***/ }), /***/ 33736: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); common.register('toEnd', _toEnd, { pipeOnly: true, wrapOutput: false, }); //@ //@ ### ShellString.prototype.toEnd(file) //@ //@ Examples: //@ //@ ```javascript //@ cat('input.txt').toEnd('output.txt'); //@ ``` //@ //@ Analogous to the redirect-and-append operator `>>` in Unix, but works with //@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). function _toEnd(options, file) { if (!file) common.error('wrong arguments'); if (!fs.existsSync(path.dirname(file))) { common.error('no such file or directory: ' + path.dirname(file)); } try { fs.appendFileSync(file, this.stdout || this.toString(), 'utf8'); return this; } catch (e) { /* istanbul ignore next */ common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true }); } } module.exports = _toEnd; /***/ }), /***/ 28358: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); common.register('touch', _touch, { cmdOptions: { 'a': 'atime_only', 'c': 'no_create', 'd': 'date', 'm': 'mtime_only', 'r': 'reference', }, }); //@ //@ ### touch([options,] file [, file ...]) //@ ### touch([options,] file_array) //@ //@ Available options: //@ //@ + `-a`: Change only the access time //@ + `-c`: Do not create any files //@ + `-m`: Change only the modification time //@ + `-d DATE`: Parse `DATE` and use it instead of current time //@ + `-r FILE`: Use `FILE`'s times instead of current time //@ //@ Examples: //@ //@ ```javascript //@ touch('source.js'); //@ touch('-c', '/path/to/some/dir/source.js'); //@ touch({ '-r': FILE }, '/path/to/some/dir/source.js'); //@ ``` //@ //@ Update the access and modification times of each `FILE` to the current time. //@ A `FILE` argument that does not exist is created empty, unless `-c` is supplied. //@ This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch). function _touch(opts, files) { if (!files) { common.error('no files given'); } else if (typeof files === 'string') { files = [].slice.call(arguments, 1); } else { common.error('file arg should be a string file path or an Array of string file paths'); } files.forEach(function (f) { touchFile(opts, f); }); return ''; } function touchFile(opts, file) { var stat = tryStatFile(file); if (stat && stat.isDirectory()) { // don't error just exit return; } // if the file doesn't already exist and the user has specified --no-create then // this script is finished if (!stat && opts.no_create) { return; } // open the file and then close it. this will create it if it doesn't exist but will // not truncate the file fs.closeSync(fs.openSync(file, 'a')); // // Set timestamps // // setup some defaults var now = new Date(); var mtime = opts.date || now; var atime = opts.date || now; // use reference file if (opts.reference) { var refStat = tryStatFile(opts.reference); if (!refStat) { common.error('failed to get attributess of ' + opts.reference); } mtime = refStat.mtime; atime = refStat.atime; } else if (opts.date) { mtime = opts.date; atime = opts.date; } if (opts.atime_only && opts.mtime_only) { // keep the new values of mtime and atime like GNU } else if (opts.atime_only) { mtime = stat.mtime; } else if (opts.mtime_only) { atime = stat.atime; } fs.utimesSync(file, atime, mtime); } module.exports = _touch; function tryStatFile(filePath) { try { return common.statFollowLinks(filePath); } catch (e) { return null; } } /***/ }), /***/ 77286: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); // add c spaces to the left of str function lpad(c, str) { var res = '' + str; if (res.length < c) { res = Array((c - res.length) + 1).join(' ') + res; } return res; } common.register('uniq', _uniq, { canReceivePipe: true, cmdOptions: { 'i': 'ignoreCase', 'c': 'count', 'd': 'duplicates', }, }); //@ //@ ### uniq([options,] [input, [output]]) //@ //@ Available options: //@ //@ + `-i`: Ignore case while comparing //@ + `-c`: Prefix lines by the number of occurrences //@ + `-d`: Only print duplicate lines, one for each group of identical lines //@ //@ Examples: //@ //@ ```javascript //@ uniq('foo.txt'); //@ uniq('-i', 'foo.txt'); //@ uniq('-cd', 'foo.txt', 'bar.txt'); //@ ``` //@ //@ Filter adjacent matching lines from `input`. function _uniq(options, input, output) { // Check if this is coming from a pipe var pipe = common.readFromPipe(); if (!pipe) { if (!input) common.error('no input given'); if (!fs.existsSync(input)) { common.error(input + ': No such file or directory'); } else if (common.statFollowLinks(input).isDirectory()) { common.error("error reading '" + input + "'"); } } if (output && fs.existsSync(output) && common.statFollowLinks(output).isDirectory()) { common.error(output + ': Is a directory'); } var lines = (input ? fs.readFileSync(input, 'utf8') : pipe). trimRight(). split('\n'); var compare = function (a, b) { return options.ignoreCase ? a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()) : a.localeCompare(b); }; var uniqed = lines.reduceRight(function (res, e) { // Perform uniq -c on the input if (res.length === 0) { return [{ count: 1, ln: e }]; } else if (compare(res[0].ln, e) === 0) { return [{ count: res[0].count + 1, ln: e }].concat(res.slice(1)); } else { return [{ count: 1, ln: e }].concat(res); } }, []).filter(function (obj) { // Do we want only duplicated objects? return options.duplicates ? obj.count > 1 : true; }).map(function (obj) { // Are we tracking the counts of each line? return (options.count ? (lpad(7, obj.count) + ' ') : '') + obj.ln; }).join('\n') + '\n'; if (output) { (new common.ShellString(uniqed)).to(output); // if uniq writes to output, nothing is passed to the next command in the pipeline (if any) return ''; } else { return uniqed; } } module.exports = _uniq; /***/ }), /***/ 64766: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var common = __webpack_require__(53687); var fs = __webpack_require__(35747); var path = __webpack_require__(85622); common.register('which', _which, { allowGlobbing: false, cmdOptions: { 'a': 'all', }, }); // XP's system default value for `PATHEXT` system variable, just in case it's not // set on Windows. var XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh'; // For earlier versions of NodeJS that doesn't have a list of constants (< v6) var FILE_EXECUTABLE_MODE = 1; function isWindowsPlatform() { return process.platform === 'win32'; } // Cross-platform method for splitting environment `PATH` variables function splitPath(p) { return p ? p.split(path.delimiter) : []; } // Tests are running all cases for this func but it stays uncovered by codecov due to unknown reason /* istanbul ignore next */ function isExecutable(pathName) { try { // TODO(node-support): replace with fs.constants.X_OK once remove support for node < v6 fs.accessSync(pathName, FILE_EXECUTABLE_MODE); } catch (err) { return false; } return true; } function checkPath(pathName) { return fs.existsSync(pathName) && !common.statFollowLinks(pathName).isDirectory() && (isWindowsPlatform() || isExecutable(pathName)); } //@ //@ ### which(command) //@ //@ Examples: //@ //@ ```javascript //@ var nodeExec = which('node'); //@ ``` //@ //@ Searches for `command` in the system's `PATH`. On Windows, this uses the //@ `PATHEXT` variable to append the extension if it's not already executable. //@ Returns string containing the absolute path to `command`. function _which(options, cmd) { if (!cmd) common.error('must specify command'); var isWindows = isWindowsPlatform(); var pathArray = splitPath(process.env.PATH); var queryMatches = []; // No relative/absolute paths provided? if (cmd.indexOf('/') === -1) { // Assume that there are no extensions to append to queries (this is the // case for unix) var pathExtArray = ['']; if (isWindows) { // In case the PATHEXT variable is somehow not set (e.g. // child_process.spawn with an empty environment), use the XP default. var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT; pathExtArray = splitPath(pathExtEnv.toUpperCase()); } // Search for command in PATH for (var k = 0; k < pathArray.length; k++) { // already found it if (queryMatches.length > 0 && !options.all) break; var attempt = path.resolve(pathArray[k], cmd); if (isWindows) { attempt = attempt.toUpperCase(); } var match = attempt.match(/\.[^<>:"/\|?*.]+$/); if (match && pathExtArray.indexOf(match[0]) >= 0) { // this is Windows-only // The user typed a query with the file extension, like // `which('node.exe')` if (checkPath(attempt)) { queryMatches.push(attempt); break; } } else { // All-platforms // Cycle through the PATHEXT array, and check each extension // Note: the array is always [''] on Unix for (var i = 0; i < pathExtArray.length; i++) { var ext = pathExtArray[i]; var newAttempt = attempt + ext; if (checkPath(newAttempt)) { queryMatches.push(newAttempt); break; } } } } } else if (checkPath(cmd)) { // a valid absolute or relative path queryMatches.push(path.resolve(cmd)); } if (queryMatches.length > 0) { return options.all ? queryMatches : queryMatches[0]; } return options.all ? [] : null; } module.exports = _which; /***/ }), /***/ 24931: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. var assert = __webpack_require__(42357) var signals = __webpack_require__(63710) var isWin = /^win/i.test(process.platform) var EE = __webpack_require__(28614) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter } var emitter if (process.__signal_exit_emitter__) { emitter = process.__signal_exit_emitter__ } else { emitter = process.__signal_exit_emitter__ = new EE() emitter.count = 0 emitter.emitted = {} } // Because this emitter is a global, we have to check to see if a // previous version of this library failed to enable infinite listeners. // I know what you're about to say. But literally everything about // signal-exit is a compromise with evil. Get used to it. if (!emitter.infinite) { emitter.setMaxListeners(Infinity) emitter.infinite = true } module.exports = function (cb, opts) { assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') if (loaded === false) { load() } var ev = 'exit' if (opts && opts.alwaysLast) { ev = 'afterexit' } var remove = function () { emitter.removeListener(ev, cb) if (emitter.listeners('exit').length === 0 && emitter.listeners('afterexit').length === 0) { unload() } } emitter.on(ev, cb) return remove } module.exports.unload = unload function unload () { if (!loaded) { return } loaded = false signals.forEach(function (sig) { try { process.removeListener(sig, sigListeners[sig]) } catch (er) {} }) process.emit = originalProcessEmit process.reallyExit = originalProcessReallyExit emitter.count -= 1 } function emit (event, code, signal) { if (emitter.emitted[event]) { return } emitter.emitted[event] = true emitter.emit(event, code, signal) } // { : , ... } var sigListeners = {} signals.forEach(function (sig) { sigListeners[sig] = function listener () { // If there are no other listeners, an exit is coming! // Simplest way: remove us and then re-send the signal. // We know that this will kill the process, so we can // safely emit now. var listeners = process.listeners(sig) if (listeners.length === emitter.count) { unload() emit('exit', null, sig) /* istanbul ignore next */ emit('afterexit', null, sig) /* istanbul ignore next */ if (isWin && sig === 'SIGHUP') { // "SIGHUP" throws an `ENOSYS` error on Windows, // so use a supported signal instead sig = 'SIGINT' } process.kill(process.pid, sig) } } }) module.exports.signals = function () { return signals } module.exports.load = load var loaded = false function load () { if (loaded) { return } loaded = true // This is the number of onSignalExit's that are in play. // It's important so that we can count the correct number of // listeners on signals, and don't wait for the other one to // handle it instead of us. emitter.count += 1 signals = signals.filter(function (sig) { try { process.on(sig, sigListeners[sig]) return true } catch (er) { return false } }) process.emit = processEmit process.reallyExit = processReallyExit } var originalProcessReallyExit = process.reallyExit function processReallyExit (code) { process.exitCode = code || 0 emit('exit', process.exitCode, null) /* istanbul ignore next */ emit('afterexit', process.exitCode, null) /* istanbul ignore next */ originalProcessReallyExit.call(process, process.exitCode) } var originalProcessEmit = process.emit function processEmit (ev, arg) { if (ev === 'exit') { if (arg !== undefined) { process.exitCode = arg } var ret = originalProcessEmit.apply(this, arguments) emit('exit', process.exitCode, null) /* istanbul ignore next */ emit('afterexit', process.exitCode, null) return ret } else { return originalProcessEmit.apply(this, arguments) } } /***/ }), /***/ 63710: /***/ ((module) => { // This is not the set of all possible signals. // // It IS, however, the set of all signals that trigger // an exit on either Linux or BSD systems. Linux is a // superset of the signal names supported on BSD, and // the unknown signals just fail to register, so we can // catch that easily enough. // // Don't bother with SIGKILL. It's uncatchable, which // means that we can't fire any callbacks anyway. // // If a user does happen to register a handler on a non- // fatal signal like SIGWINCH or something, and then // exit, it'll end up firing `process.emit('exit')`, so // the handler will be fired anyway. // // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised // artificially, inherently leave the process in a // state from which it is not safe to try and enter JS // listeners. module.exports = [ 'SIGABRT', 'SIGALRM', 'SIGHUP', 'SIGINT', 'SIGTERM' ] if (process.platform !== 'win32') { module.exports.push( 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' // should detect profiler and enable/disable accordingly. // see #21 // 'SIGPROF' ) } if (process.platform === 'linux') { module.exports.push( 'SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED' ) } /***/ }), /***/ 66126: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var Buffer = __webpack_require__(15118).Buffer; var algInfo = { 'dsa': { parts: ['p', 'q', 'g', 'y'], sizePart: 'p' }, 'rsa': { parts: ['e', 'n'], sizePart: 'n' }, 'ecdsa': { parts: ['curve', 'Q'], sizePart: 'Q' }, 'ed25519': { parts: ['A'], sizePart: 'A' } }; algInfo['curve25519'] = algInfo['ed25519']; var algPrivInfo = { 'dsa': { parts: ['p', 'q', 'g', 'y', 'x'] }, 'rsa': { parts: ['n', 'e', 'd', 'iqmp', 'p', 'q'] }, 'ecdsa': { parts: ['curve', 'Q', 'd'] }, 'ed25519': { parts: ['A', 'k'] } }; algPrivInfo['curve25519'] = algPrivInfo['ed25519']; var hashAlgs = { 'md5': true, 'sha1': true, 'sha256': true, 'sha384': true, 'sha512': true }; /* * Taken from * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf */ var curves = { 'nistp256': { size: 256, pkcs8oid: '1.2.840.10045.3.1.7', p: Buffer.from(('00' + 'ffffffff 00000001 00000000 00000000' + '00000000 ffffffff ffffffff ffffffff'). replace(/ /g, ''), 'hex'), a: Buffer.from(('00' + 'FFFFFFFF 00000001 00000000 00000000' + '00000000 FFFFFFFF FFFFFFFF FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(( '5ac635d8 aa3a93e7 b3ebbd55 769886bc' + '651d06b0 cc53b0f6 3bce3c3e 27d2604b'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'c49d3608 86e70493 6a6678e1 139d26b7' + '819f7e90'). replace(/ /g, ''), 'hex'), n: Buffer.from(('00' + 'ffffffff 00000000 ffffffff ffffffff' + 'bce6faad a7179e84 f3b9cac2 fc632551'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + '6b17d1f2 e12c4247 f8bce6e5 63a440f2' + '77037d81 2deb33a0 f4a13945 d898c296' + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' + '2bce3357 6b315ece cbb64068 37bf51f5'). replace(/ /g, ''), 'hex') }, 'nistp384': { size: 384, pkcs8oid: '1.3.132.0.34', p: Buffer.from(('00' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff fffffffe' + 'ffffffff 00000000 00000000 ffffffff'). replace(/ /g, ''), 'hex'), a: Buffer.from(('00' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' + 'FFFFFFFF 00000000 00000000 FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(( 'b3312fa7 e23ee7e4 988e056b e3f82d19' + '181d9c6e fe814112 0314088f 5013875a' + 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'a335926a a319a27a 1d00896a 6773a482' + '7acdac73'). replace(/ /g, ''), 'hex'), n: Buffer.from(('00' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff c7634d81 f4372ddf' + '581a0db2 48b0a77a ecec196a ccc52973'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + 'aa87ca22 be8b0537 8eb1c71e f320ad74' + '6e1d3b62 8ba79b98 59f741e0 82542a38' + '5502f25d bf55296c 3a545e38 72760ab7' + '3617de4a 96262c6f 5d9e98bf 9292dc29' + 'f8f41dbd 289a147c e9da3113 b5f0b8c0' + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'). replace(/ /g, ''), 'hex') }, 'nistp521': { size: 521, pkcs8oid: '1.3.132.0.35', p: Buffer.from(( '01ffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffff').replace(/ /g, ''), 'hex'), a: Buffer.from(('01FF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(('51' + '953eb961 8e1c9a1f 929a21a0 b68540ee' + 'a2da725b 99b315f3 b8b48991 8ef109e1' + '56193951 ec7e937b 1652c0bd 3bb1bf07' + '3573df88 3d2c34f1 ef451fd4 6b503f00'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'd09e8800 291cb853 96cc6717 393284aa' + 'a0da64ba').replace(/ /g, ''), 'hex'), n: Buffer.from(('01ff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff fffffffa' + '51868783 bf2f966b 7fcc0148 f709a5d0' + '3bb5c9b8 899c47ae bb6fb71e 91386409'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' + '9c648139 053fb521 f828af60 6b4d3dba' + 'a14b5e77 efe75928 fe1dc127 a2ffa8de' + '3348b3c1 856a429b f97e7e31 c2e5bd66' + '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' + '98f54449 579b4468 17afbd17 273e662c' + '97ee7299 5ef42640 c550b901 3fad0761' + '353c7086 a272c240 88be9476 9fd16650'). replace(/ /g, ''), 'hex') } }; module.exports = { info: algInfo, privInfo: algPrivInfo, hashAlgs: hashAlgs, curves: curves }; /***/ }), /***/ 7406: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2016 Joyent, Inc. module.exports = Certificate; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var crypto = __webpack_require__(76417); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var errs = __webpack_require__(27979); var util = __webpack_require__(31669); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var Identity = __webpack_require__(70508); var formats = {}; formats['openssh'] = __webpack_require__(94033); formats['x509'] = __webpack_require__(10267); formats['pem'] = __webpack_require__(30217); var CertificateParseError = errs.CertificateParseError; var InvalidAlgorithmError = errs.InvalidAlgorithmError; function Certificate(opts) { assert.object(opts, 'options'); assert.arrayOfObject(opts.subjects, 'options.subjects'); utils.assertCompatible(opts.subjects[0], Identity, [1, 0], 'options.subjects'); utils.assertCompatible(opts.subjectKey, Key, [1, 0], 'options.subjectKey'); utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer'); if (opts.issuerKey !== undefined) { utils.assertCompatible(opts.issuerKey, Key, [1, 0], 'options.issuerKey'); } assert.object(opts.signatures, 'options.signatures'); assert.buffer(opts.serial, 'options.serial'); assert.date(opts.validFrom, 'options.validFrom'); assert.date(opts.validUntil, 'optons.validUntil'); assert.optionalArrayOfString(opts.purposes, 'options.purposes'); this._hashCache = {}; this.subjects = opts.subjects; this.issuer = opts.issuer; this.subjectKey = opts.subjectKey; this.issuerKey = opts.issuerKey; this.signatures = opts.signatures; this.serial = opts.serial; this.validFrom = opts.validFrom; this.validUntil = opts.validUntil; this.purposes = opts.purposes; } Certificate.formats = formats; Certificate.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'x509'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); return (formats[format].write(this, options)); }; Certificate.prototype.toString = function (format, options) { if (format === undefined) format = 'pem'; return (this.toBuffer(format, options).toString()); }; Certificate.prototype.fingerprint = function (algo) { if (algo === undefined) algo = 'sha256'; assert.string(algo, 'algorithm'); var opts = { type: 'certificate', hash: this.hash(algo), algorithm: algo }; return (new Fingerprint(opts)); }; Certificate.prototype.hash = function (algo) { assert.string(algo, 'algorithm'); algo = algo.toLowerCase(); if (algs.hashAlgs[algo] === undefined) throw (new InvalidAlgorithmError(algo)); if (this._hashCache[algo]) return (this._hashCache[algo]); var hash = crypto.createHash(algo). update(this.toBuffer('x509')).digest(); this._hashCache[algo] = hash; return (hash); }; Certificate.prototype.isExpired = function (when) { if (when === undefined) when = new Date(); return (!((when.getTime() >= this.validFrom.getTime()) && (when.getTime() < this.validUntil.getTime()))); }; Certificate.prototype.isSignedBy = function (issuerCert) { utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); if (!this.issuer.equals(issuerCert.subjects[0])) return (false); if (this.issuer.purposes && this.issuer.purposes.length > 0 && this.issuer.purposes.indexOf('ca') === -1) { return (false); } return (this.isSignedByKey(issuerCert.subjectKey)); }; Certificate.prototype.getExtension = function (keyOrOid) { assert.string(keyOrOid, 'keyOrOid'); var ext = this.getExtensions().filter(function (maybeExt) { if (maybeExt.format === 'x509') return (maybeExt.oid === keyOrOid); if (maybeExt.format === 'openssh') return (maybeExt.name === keyOrOid); return (false); })[0]; return (ext); }; Certificate.prototype.getExtensions = function () { var exts = []; var x509 = this.signatures.x509; if (x509 && x509.extras && x509.extras.exts) { x509.extras.exts.forEach(function (ext) { ext.format = 'x509'; exts.push(ext); }); } var openssh = this.signatures.openssh; if (openssh && openssh.exts) { openssh.exts.forEach(function (ext) { ext.format = 'openssh'; exts.push(ext); }); } return (exts); }; Certificate.prototype.isSignedByKey = function (issuerKey) { utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); if (this.issuerKey !== undefined) { return (this.issuerKey. fingerprint('sha512').matches(issuerKey)); } var fmt = Object.keys(this.signatures)[0]; var valid = formats[fmt].verify(this, issuerKey); if (valid) this.issuerKey = issuerKey; return (valid); }; Certificate.prototype.signWith = function (key) { utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); var fmts = Object.keys(formats); var didOne = false; for (var i = 0; i < fmts.length; ++i) { if (fmts[i] !== 'pem') { var ret = formats[fmts[i]].sign(this, key); if (ret === true) didOne = true; } } if (!didOne) { throw (new Error('Failed to sign the certificate for any ' + 'available certificate formats')); } }; Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { var subjects; if (Array.isArray(subjectOrSubjects)) subjects = subjectOrSubjects; else subjects = [subjectOrSubjects]; assert.arrayOfObject(subjects); subjects.forEach(function (subject) { utils.assertCompatible(subject, Identity, [1, 0], 'subject'); }); utils.assertCompatible(key, PrivateKey, [1, 2], 'private key'); assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalObject(options.validFrom, 'options.validFrom'); assert.optionalObject(options.validUntil, 'options.validUntil'); var validFrom = options.validFrom; var validUntil = options.validUntil; if (validFrom === undefined) validFrom = new Date(); if (validUntil === undefined) { assert.optionalNumber(options.lifetime, 'options.lifetime'); var lifetime = options.lifetime; if (lifetime === undefined) lifetime = 10*365*24*3600; validUntil = new Date(); validUntil.setTime(validUntil.getTime() + lifetime*1000); } assert.optionalBuffer(options.serial, 'options.serial'); var serial = options.serial; if (serial === undefined) serial = Buffer.from('0000000000000001', 'hex'); var purposes = options.purposes; if (purposes === undefined) purposes = []; if (purposes.indexOf('signature') === -1) purposes.push('signature'); /* Self-signed certs are always CAs. */ if (purposes.indexOf('ca') === -1) purposes.push('ca'); if (purposes.indexOf('crl') === -1) purposes.push('crl'); /* * If we weren't explicitly given any other purposes, do the sensible * thing and add some basic ones depending on the subject type. */ if (purposes.length <= 3) { var hostSubjects = subjects.filter(function (subject) { return (subject.type === 'host'); }); var userSubjects = subjects.filter(function (subject) { return (subject.type === 'user'); }); if (hostSubjects.length > 0) { if (purposes.indexOf('serverAuth') === -1) purposes.push('serverAuth'); } if (userSubjects.length > 0) { if (purposes.indexOf('clientAuth') === -1) purposes.push('clientAuth'); } if (userSubjects.length > 0 || hostSubjects.length > 0) { if (purposes.indexOf('keyAgreement') === -1) purposes.push('keyAgreement'); if (key.type === 'rsa' && purposes.indexOf('encryption') === -1) purposes.push('encryption'); } } var cert = new Certificate({ subjects: subjects, issuer: subjects[0], subjectKey: key.toPublic(), issuerKey: key.toPublic(), signatures: {}, serial: serial, validFrom: validFrom, validUntil: validUntil, purposes: purposes }); cert.signWith(key); return (cert); }; Certificate.create = function (subjectOrSubjects, key, issuer, issuerKey, options) { var subjects; if (Array.isArray(subjectOrSubjects)) subjects = subjectOrSubjects; else subjects = [subjectOrSubjects]; assert.arrayOfObject(subjects); subjects.forEach(function (subject) { utils.assertCompatible(subject, Identity, [1, 0], 'subject'); }); utils.assertCompatible(key, Key, [1, 0], 'key'); if (PrivateKey.isPrivateKey(key)) key = key.toPublic(); utils.assertCompatible(issuer, Identity, [1, 0], 'issuer'); utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key'); assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalObject(options.validFrom, 'options.validFrom'); assert.optionalObject(options.validUntil, 'options.validUntil'); var validFrom = options.validFrom; var validUntil = options.validUntil; if (validFrom === undefined) validFrom = new Date(); if (validUntil === undefined) { assert.optionalNumber(options.lifetime, 'options.lifetime'); var lifetime = options.lifetime; if (lifetime === undefined) lifetime = 10*365*24*3600; validUntil = new Date(); validUntil.setTime(validUntil.getTime() + lifetime*1000); } assert.optionalBuffer(options.serial, 'options.serial'); var serial = options.serial; if (serial === undefined) serial = Buffer.from('0000000000000001', 'hex'); var purposes = options.purposes; if (purposes === undefined) purposes = []; if (purposes.indexOf('signature') === -1) purposes.push('signature'); if (options.ca === true) { if (purposes.indexOf('ca') === -1) purposes.push('ca'); if (purposes.indexOf('crl') === -1) purposes.push('crl'); } var hostSubjects = subjects.filter(function (subject) { return (subject.type === 'host'); }); var userSubjects = subjects.filter(function (subject) { return (subject.type === 'user'); }); if (hostSubjects.length > 0) { if (purposes.indexOf('serverAuth') === -1) purposes.push('serverAuth'); } if (userSubjects.length > 0) { if (purposes.indexOf('clientAuth') === -1) purposes.push('clientAuth'); } if (userSubjects.length > 0 || hostSubjects.length > 0) { if (purposes.indexOf('keyAgreement') === -1) purposes.push('keyAgreement'); if (key.type === 'rsa' && purposes.indexOf('encryption') === -1) purposes.push('encryption'); } var cert = new Certificate({ subjects: subjects, issuer: issuer, subjectKey: key, issuerKey: issuerKey.toPublic(), signatures: {}, serial: serial, validFrom: validFrom, validUntil: validUntil, purposes: purposes }); cert.signWith(issuerKey); return (cert); }; Certificate.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); return (k); } catch (e) { throw (new CertificateParseError(options.filename, format, e)); } }; Certificate.isCertificate = function (obj, ver) { return (utils.isCompatible(obj, Certificate, ver)); }; /* * API versions for Certificate: * [1,0] -- initial ver * [1,1] -- openssh format now unpacks extensions */ Certificate.prototype._sshpkApiVersion = [1, 1]; Certificate._oldVersionDetect = function (obj) { return ([1, 0]); }; /***/ }), /***/ 57602: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = { DiffieHellman: DiffieHellman, generateECDSA: generateECDSA, generateED25519: generateED25519 }; var assert = __webpack_require__(66631); var crypto = __webpack_require__(76417); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var nacl = __webpack_require__(68729); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined); var ecdh = __webpack_require__(49865); var ec = __webpack_require__(3943); var jsbn = __webpack_require__(85587).BigInteger; function DiffieHellman(key) { utils.assertCompatible(key, Key, [1, 4], 'key'); this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]); this._algo = key.type; this._curve = key.curve; this._key = key; if (key.type === 'dsa') { if (!CRYPTO_HAVE_ECDH) { throw (new Error('Due to bugs in the node 0.10 ' + 'crypto API, node 0.12.x or later is required ' + 'to use DH')); } this._dh = crypto.createDiffieHellman( key.part.p.data, undefined, key.part.g.data, undefined); this._p = key.part.p; this._g = key.part.g; if (this._isPriv) this._dh.setPrivateKey(key.part.x.data); this._dh.setPublicKey(key.part.y.data); } else if (key.type === 'ecdsa') { if (!CRYPTO_HAVE_ECDH) { this._ecParams = new X9ECParameters(this._curve); if (this._isPriv) { this._priv = new ECPrivate( this._ecParams, key.part.d.data); } return; } var curve = { 'nistp256': 'prime256v1', 'nistp384': 'secp384r1', 'nistp521': 'secp521r1' }[key.curve]; this._dh = crypto.createECDH(curve); if (typeof (this._dh) !== 'object' || typeof (this._dh.setPrivateKey) !== 'function') { CRYPTO_HAVE_ECDH = false; DiffieHellman.call(this, key); return; } if (this._isPriv) this._dh.setPrivateKey(key.part.d.data); this._dh.setPublicKey(key.part.Q.data); } else if (key.type === 'curve25519') { if (this._isPriv) { utils.assertCompatible(key, PrivateKey, [1, 5], 'key'); this._priv = key.part.k.data; } } else { throw (new Error('DH not supported for ' + key.type + ' keys')); } } DiffieHellman.prototype.getPublicKey = function () { if (this._isPriv) return (this._key.toPublic()); return (this._key); }; DiffieHellman.prototype.getPrivateKey = function () { if (this._isPriv) return (this._key); else return (undefined); }; DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey; DiffieHellman.prototype._keyCheck = function (pk, isPub) { assert.object(pk, 'key'); if (!isPub) utils.assertCompatible(pk, PrivateKey, [1, 3], 'key'); utils.assertCompatible(pk, Key, [1, 4], 'key'); if (pk.type !== this._algo) { throw (new Error('A ' + pk.type + ' key cannot be used in ' + this._algo + ' Diffie-Hellman')); } if (pk.curve !== this._curve) { throw (new Error('A key from the ' + pk.curve + ' curve ' + 'cannot be used with a ' + this._curve + ' Diffie-Hellman')); } if (pk.type === 'dsa') { assert.deepEqual(pk.part.p, this._p, 'DSA key prime does not match'); assert.deepEqual(pk.part.g, this._g, 'DSA key generator does not match'); } }; DiffieHellman.prototype.setKey = function (pk) { this._keyCheck(pk); if (pk.type === 'dsa') { this._dh.setPrivateKey(pk.part.x.data); this._dh.setPublicKey(pk.part.y.data); } else if (pk.type === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { this._dh.setPrivateKey(pk.part.d.data); this._dh.setPublicKey(pk.part.Q.data); } else { this._priv = new ECPrivate( this._ecParams, pk.part.d.data); } } else if (pk.type === 'curve25519') { var k = pk.part.k; if (!pk.part.k) k = pk.part.r; this._priv = k.data; if (this._priv[0] === 0x00) this._priv = this._priv.slice(1); this._priv = this._priv.slice(0, 32); } this._key = pk; this._isPriv = true; }; DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey; DiffieHellman.prototype.computeSecret = function (otherpk) { this._keyCheck(otherpk, true); if (!this._isPriv) throw (new Error('DH exchange has not been initialized with ' + 'a private key yet')); var pub; if (this._algo === 'dsa') { return (this._dh.computeSecret( otherpk.part.y.data)); } else if (this._algo === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { return (this._dh.computeSecret( otherpk.part.Q.data)); } else { pub = new ECPublic( this._ecParams, otherpk.part.Q.data); return (this._priv.deriveSharedSecret(pub)); } } else if (this._algo === 'curve25519') { pub = otherpk.part.A.data; while (pub[0] === 0x00 && pub.length > 32) pub = pub.slice(1); var priv = this._priv; assert.strictEqual(pub.length, 32); assert.strictEqual(priv.length, 32); var secret = nacl.box.before(new Uint8Array(pub), new Uint8Array(priv)); return (Buffer.from(secret)); } throw (new Error('Invalid algorithm: ' + this._algo)); }; DiffieHellman.prototype.generateKey = function () { var parts = []; var priv, pub; if (this._algo === 'dsa') { this._dh.generateKeys(); parts.push({name: 'p', data: this._p.data}); parts.push({name: 'q', data: this._key.part.q.data}); parts.push({name: 'g', data: this._g.data}); parts.push({name: 'y', data: this._dh.getPublicKey()}); parts.push({name: 'x', data: this._dh.getPrivateKey()}); this._key = new PrivateKey({ type: 'dsa', parts: parts }); this._isPriv = true; return (this._key); } else if (this._algo === 'ecdsa') { if (CRYPTO_HAVE_ECDH) { this._dh.generateKeys(); parts.push({name: 'curve', data: Buffer.from(this._curve)}); parts.push({name: 'Q', data: this._dh.getPublicKey()}); parts.push({name: 'd', data: this._dh.getPrivateKey()}); this._key = new PrivateKey({ type: 'ecdsa', curve: this._curve, parts: parts }); this._isPriv = true; return (this._key); } else { var n = this._ecParams.getN(); var r = new jsbn(crypto.randomBytes(n.bitLength())); var n1 = n.subtract(jsbn.ONE); priv = r.mod(n1).add(jsbn.ONE); pub = this._ecParams.getG().multiply(priv); priv = Buffer.from(priv.toByteArray()); pub = Buffer.from(this._ecParams.getCurve(). encodePointHex(pub), 'hex'); this._priv = new ECPrivate(this._ecParams, priv); parts.push({name: 'curve', data: Buffer.from(this._curve)}); parts.push({name: 'Q', data: pub}); parts.push({name: 'd', data: priv}); this._key = new PrivateKey({ type: 'ecdsa', curve: this._curve, parts: parts }); this._isPriv = true; return (this._key); } } else if (this._algo === 'curve25519') { var pair = nacl.box.keyPair(); priv = Buffer.from(pair.secretKey); pub = Buffer.from(pair.publicKey); priv = Buffer.concat([priv, pub]); assert.strictEqual(priv.length, 64); assert.strictEqual(pub.length, 32); parts.push({name: 'A', data: pub}); parts.push({name: 'k', data: priv}); this._key = new PrivateKey({ type: 'curve25519', parts: parts }); this._isPriv = true; return (this._key); } throw (new Error('Invalid algorithm: ' + this._algo)); }; DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey; /* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */ function X9ECParameters(name) { var params = algs.curves[name]; assert.object(params); var p = new jsbn(params.p); var a = new jsbn(params.a); var b = new jsbn(params.b); var n = new jsbn(params.n); var h = jsbn.ONE; var curve = new ec.ECCurveFp(p, a, b); var G = curve.decodePointHex(params.G.toString('hex')); this.curve = curve; this.g = G; this.n = n; this.h = h; } X9ECParameters.prototype.getCurve = function () { return (this.curve); }; X9ECParameters.prototype.getG = function () { return (this.g); }; X9ECParameters.prototype.getN = function () { return (this.n); }; X9ECParameters.prototype.getH = function () { return (this.h); }; function ECPublic(params, buffer) { this._params = params; if (buffer[0] === 0x00) buffer = buffer.slice(1); this._pub = params.getCurve().decodePointHex(buffer.toString('hex')); } function ECPrivate(params, buffer) { this._params = params; this._priv = new jsbn(utils.mpNormalize(buffer)); } ECPrivate.prototype.deriveSharedSecret = function (pubKey) { assert.ok(pubKey instanceof ECPublic); var S = pubKey._pub.multiply(this._priv); return (Buffer.from(S.getX().toBigInteger().toByteArray())); }; function generateED25519() { var pair = nacl.sign.keyPair(); var priv = Buffer.from(pair.secretKey); var pub = Buffer.from(pair.publicKey); assert.strictEqual(priv.length, 64); assert.strictEqual(pub.length, 32); var parts = []; parts.push({name: 'A', data: pub}); parts.push({name: 'k', data: priv.slice(0, 32)}); var key = new PrivateKey({ type: 'ed25519', parts: parts }); return (key); } /* Generates a new ECDSA private key on a given curve. */ function generateECDSA(curve) { var parts = []; var key; if (CRYPTO_HAVE_ECDH) { /* * Node crypto doesn't expose key generation directly, but the * ECDH instances can generate keys. It turns out this just * calls into the OpenSSL generic key generator, and we can * read its output happily without doing an actual DH. So we * use that here. */ var osCurve = { 'nistp256': 'prime256v1', 'nistp384': 'secp384r1', 'nistp521': 'secp521r1' }[curve]; var dh = crypto.createECDH(osCurve); dh.generateKeys(); parts.push({name: 'curve', data: Buffer.from(curve)}); parts.push({name: 'Q', data: dh.getPublicKey()}); parts.push({name: 'd', data: dh.getPrivateKey()}); key = new PrivateKey({ type: 'ecdsa', curve: curve, parts: parts }); return (key); } else { var ecParams = new X9ECParameters(curve); /* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */ var n = ecParams.getN(); /* * The crypto.randomBytes() function can only give us whole * bytes, so taking a nod from X9.62, we round up. */ var cByteLen = Math.ceil((n.bitLength() + 64) / 8); var c = new jsbn(crypto.randomBytes(cByteLen)); var n1 = n.subtract(jsbn.ONE); var priv = c.mod(n1).add(jsbn.ONE); var pub = ecParams.getG().multiply(priv); priv = Buffer.from(priv.toByteArray()); pub = Buffer.from(ecParams.getCurve(). encodePointHex(pub), 'hex'); parts.push({name: 'curve', data: Buffer.from(curve)}); parts.push({name: 'Q', data: pub}); parts.push({name: 'd', data: priv}); key = new PrivateKey({ type: 'ecdsa', curve: curve, parts: parts }); return (key); } } /***/ }), /***/ 14694: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { Verifier: Verifier, Signer: Signer }; var nacl = __webpack_require__(68729); var stream = __webpack_require__(92413); var util = __webpack_require__(31669); var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var Signature = __webpack_require__(91394); function Verifier(key, hashAlgo) { if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); this.key = key; this.chunks = []; stream.Writable.call(this, {}); } util.inherits(Verifier, stream.Writable); Verifier.prototype._write = function (chunk, enc, cb) { this.chunks.push(chunk); cb(); }; Verifier.prototype.update = function (chunk) { if (typeof (chunk) === 'string') chunk = Buffer.from(chunk, 'binary'); this.chunks.push(chunk); }; Verifier.prototype.verify = function (signature, fmt) { var sig; if (Signature.isSignature(signature, [2, 0])) { if (signature.type !== 'ed25519') return (false); sig = signature.toBuffer('raw'); } else if (typeof (signature) === 'string') { sig = Buffer.from(signature, 'base64'); } else if (Signature.isSignature(signature, [1, 0])) { throw (new Error('signature was created by too old ' + 'a version of sshpk and cannot be verified')); } assert.buffer(sig); return (nacl.sign.detached.verify( new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(sig), new Uint8Array(this.key.part.A.data))); }; function Signer(key, hashAlgo) { if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); this.key = key; this.chunks = []; stream.Writable.call(this, {}); } util.inherits(Signer, stream.Writable); Signer.prototype._write = function (chunk, enc, cb) { this.chunks.push(chunk); cb(); }; Signer.prototype.update = function (chunk) { if (typeof (chunk) === 'string') chunk = Buffer.from(chunk, 'binary'); this.chunks.push(chunk); }; Signer.prototype.sign = function () { var sig = nacl.sign.detached( new Uint8Array(Buffer.concat(this.chunks)), new Uint8Array(Buffer.concat([ this.key.part.k.data, this.key.part.A.data]))); var sigBuf = Buffer.from(sig); var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw'); sigObj.hashAlgorithm = 'sha512'; return (sigObj); }; /***/ }), /***/ 27979: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(66631); var util = __webpack_require__(31669); function FingerprintFormatError(fp, format) { if (Error.captureStackTrace) Error.captureStackTrace(this, FingerprintFormatError); this.name = 'FingerprintFormatError'; this.fingerprint = fp; this.format = format; this.message = 'Fingerprint format is not supported, or is invalid: '; if (fp !== undefined) this.message += ' fingerprint = ' + fp; if (format !== undefined) this.message += ' format = ' + format; } util.inherits(FingerprintFormatError, Error); function InvalidAlgorithmError(alg) { if (Error.captureStackTrace) Error.captureStackTrace(this, InvalidAlgorithmError); this.name = 'InvalidAlgorithmError'; this.algorithm = alg; this.message = 'Algorithm "' + alg + '" is not supported'; } util.inherits(InvalidAlgorithmError, Error); function KeyParseError(name, format, innerErr) { if (Error.captureStackTrace) Error.captureStackTrace(this, KeyParseError); this.name = 'KeyParseError'; this.format = format; this.keyName = name; this.innerErr = innerErr; this.message = 'Failed to parse ' + name + ' as a valid ' + format + ' format key: ' + innerErr.message; } util.inherits(KeyParseError, Error); function SignatureParseError(type, format, innerErr) { if (Error.captureStackTrace) Error.captureStackTrace(this, SignatureParseError); this.name = 'SignatureParseError'; this.type = type; this.format = format; this.innerErr = innerErr; this.message = 'Failed to parse the given data as a ' + type + ' signature in ' + format + ' format: ' + innerErr.message; } util.inherits(SignatureParseError, Error); function CertificateParseError(name, format, innerErr) { if (Error.captureStackTrace) Error.captureStackTrace(this, CertificateParseError); this.name = 'CertificateParseError'; this.format = format; this.certName = name; this.innerErr = innerErr; this.message = 'Failed to parse ' + name + ' as a valid ' + format + ' format certificate: ' + innerErr.message; } util.inherits(CertificateParseError, Error); function KeyEncryptedError(name, format) { if (Error.captureStackTrace) Error.captureStackTrace(this, KeyEncryptedError); this.name = 'KeyEncryptedError'; this.format = format; this.keyName = name; this.message = 'The ' + format + ' format key ' + name + ' is ' + 'encrypted (password-protected), and no passphrase was ' + 'provided in `options`'; } util.inherits(KeyEncryptedError, Error); module.exports = { FingerprintFormatError: FingerprintFormatError, InvalidAlgorithmError: InvalidAlgorithmError, KeyParseError: KeyParseError, SignatureParseError: SignatureParseError, KeyEncryptedError: KeyEncryptedError, CertificateParseError: CertificateParseError }; /***/ }), /***/ 13079: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = Fingerprint; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var crypto = __webpack_require__(76417); var errs = __webpack_require__(27979); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var Certificate = __webpack_require__(7406); var utils = __webpack_require__(80575); var FingerprintFormatError = errs.FingerprintFormatError; var InvalidAlgorithmError = errs.InvalidAlgorithmError; function Fingerprint(opts) { assert.object(opts, 'options'); assert.string(opts.type, 'options.type'); assert.buffer(opts.hash, 'options.hash'); assert.string(opts.algorithm, 'options.algorithm'); this.algorithm = opts.algorithm.toLowerCase(); if (algs.hashAlgs[this.algorithm] !== true) throw (new InvalidAlgorithmError(this.algorithm)); this.hash = opts.hash; this.type = opts.type; this.hashType = opts.hashType; } Fingerprint.prototype.toString = function (format) { if (format === undefined) { if (this.algorithm === 'md5' || this.hashType === 'spki') format = 'hex'; else format = 'base64'; } assert.string(format); switch (format) { case 'hex': if (this.hashType === 'spki') return (this.hash.toString('hex')); return (addColons(this.hash.toString('hex'))); case 'base64': if (this.hashType === 'spki') return (this.hash.toString('base64')); return (sshBase64Format(this.algorithm, this.hash.toString('base64'))); default: throw (new FingerprintFormatError(undefined, format)); } }; Fingerprint.prototype.matches = function (other) { assert.object(other, 'key or certificate'); if (this.type === 'key' && this.hashType !== 'ssh') { utils.assertCompatible(other, Key, [1, 7], 'key with spki'); if (PrivateKey.isPrivateKey(other)) { utils.assertCompatible(other, PrivateKey, [1, 6], 'privatekey with spki support'); } } else if (this.type === 'key') { utils.assertCompatible(other, Key, [1, 0], 'key'); } else { utils.assertCompatible(other, Certificate, [1, 0], 'certificate'); } var theirHash = other.hash(this.algorithm, this.hashType); var theirHash2 = crypto.createHash(this.algorithm). update(theirHash).digest('base64'); if (this.hash2 === undefined) this.hash2 = crypto.createHash(this.algorithm). update(this.hash).digest('base64'); return (this.hash2 === theirHash2); }; /*JSSTYLED*/ var base64RE = /^[A-Za-z0-9+\/=]+$/; /*JSSTYLED*/ var hexRE = /^[a-fA-F0-9]+$/; Fingerprint.parse = function (fp, options) { assert.string(fp, 'fingerprint'); var alg, hash, enAlgs; if (Array.isArray(options)) { enAlgs = options; options = {}; } assert.optionalObject(options, 'options'); if (options === undefined) options = {}; if (options.enAlgs !== undefined) enAlgs = options.enAlgs; if (options.algorithms !== undefined) enAlgs = options.algorithms; assert.optionalArrayOfString(enAlgs, 'algorithms'); var hashType = 'ssh'; if (options.hashType !== undefined) hashType = options.hashType; assert.string(hashType, 'options.hashType'); var parts = fp.split(':'); if (parts.length == 2) { alg = parts[0].toLowerCase(); if (!base64RE.test(parts[1])) throw (new FingerprintFormatError(fp)); try { hash = Buffer.from(parts[1], 'base64'); } catch (e) { throw (new FingerprintFormatError(fp)); } } else if (parts.length > 2) { alg = 'md5'; if (parts[0].toLowerCase() === 'md5') parts = parts.slice(1); parts = parts.map(function (p) { while (p.length < 2) p = '0' + p; if (p.length > 2) throw (new FingerprintFormatError(fp)); return (p); }); parts = parts.join(''); if (!hexRE.test(parts) || parts.length % 2 !== 0) throw (new FingerprintFormatError(fp)); try { hash = Buffer.from(parts, 'hex'); } catch (e) { throw (new FingerprintFormatError(fp)); } } else { if (hexRE.test(fp)) { hash = Buffer.from(fp, 'hex'); } else if (base64RE.test(fp)) { hash = Buffer.from(fp, 'base64'); } else { throw (new FingerprintFormatError(fp)); } switch (hash.length) { case 32: alg = 'sha256'; break; case 16: alg = 'md5'; break; case 20: alg = 'sha1'; break; case 64: alg = 'sha512'; break; default: throw (new FingerprintFormatError(fp)); } /* Plain hex/base64: guess it's probably SPKI unless told. */ if (options.hashType === undefined) hashType = 'spki'; } if (alg === undefined) throw (new FingerprintFormatError(fp)); if (algs.hashAlgs[alg] === undefined) throw (new InvalidAlgorithmError(alg)); if (enAlgs !== undefined) { enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); }); if (enAlgs.indexOf(alg) === -1) throw (new InvalidAlgorithmError(alg)); } return (new Fingerprint({ algorithm: alg, hash: hash, type: options.type || 'key', hashType: hashType })); }; function addColons(s) { /*JSSTYLED*/ return (s.replace(/(.{2})(?=.)/g, '$1:')); } function base64Strip(s) { /*JSSTYLED*/ return (s.replace(/=*$/, '')); } function sshBase64Format(alg, h) { return (alg.toUpperCase() + ':' + base64Strip(h)); } Fingerprint.isFingerprint = function (obj, ver) { return (utils.isCompatible(obj, Fingerprint, ver)); }; /* * API versions for Fingerprint: * [1,0] -- initial ver * [1,1] -- first tagged ver * [1,2] -- hashType and spki support */ Fingerprint.prototype._sshpkApiVersion = [1, 2]; Fingerprint._oldVersionDetect = function (obj) { assert.func(obj.toString); assert.func(obj.matches); return ([1, 0]); }; /***/ }), /***/ 8243: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var ssh = __webpack_require__(68927); var rfc4253 = __webpack_require__(88688); var dnssec = __webpack_require__(63561); var putty = __webpack_require__(80974); var DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1'; function read(buf, options) { if (typeof (buf) === 'string') { if (buf.trim().match(/^[-]+[ ]*BEGIN/)) return (pem.read(buf, options)); if (buf.match(/^\s*ssh-[a-z]/)) return (ssh.read(buf, options)); if (buf.match(/^\s*ecdsa-/)) return (ssh.read(buf, options)); if (buf.match(/^putty-user-key-file-2:/i)) return (putty.read(buf, options)); if (findDNSSECHeader(buf)) return (dnssec.read(buf, options)); buf = Buffer.from(buf, 'binary'); } else { assert.buffer(buf); if (findPEMHeader(buf)) return (pem.read(buf, options)); if (findSSHHeader(buf)) return (ssh.read(buf, options)); if (findPuTTYHeader(buf)) return (putty.read(buf, options)); if (findDNSSECHeader(buf)) return (dnssec.read(buf, options)); } if (buf.readUInt32BE(0) < buf.length) return (rfc4253.read(buf, options)); throw (new Error('Failed to auto-detect format of key')); } function findPuTTYHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) ++offset; if (offset + 22 <= buf.length && buf.slice(offset, offset + 22).toString('ascii').toLowerCase() === 'putty-user-key-file-2:') return (true); return (false); } function findSSHHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) ++offset; if (offset + 4 <= buf.length && buf.slice(offset, offset + 4).toString('ascii') === 'ssh-') return (true); if (offset + 6 <= buf.length && buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-') return (true); return (false); } function findPEMHeader(buf) { var offset = 0; while (offset < buf.length && (buf[offset] === 32 || buf[offset] === 10)) ++offset; if (buf[offset] !== 45) return (false); while (offset < buf.length && (buf[offset] === 45)) ++offset; while (offset < buf.length && (buf[offset] === 32)) ++offset; if (offset + 5 > buf.length || buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN') return (false); return (true); } function findDNSSECHeader(buf) { // private case first if (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length) return (false); var headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length); if (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX) return (true); // public-key RFC3110 ? // 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...' // skip any comment-lines if (typeof (buf) !== 'string') { buf = buf.toString('ascii'); } var lines = buf.split('\n'); var line = 0; /* JSSTYLED */ while (lines[line].match(/^\;/)) line++; if (lines[line].toString('ascii').match(/\. IN KEY /)) return (true); if (lines[line].toString('ascii').match(/\. IN DNSKEY /)) return (true); return (false); } function write(key, options) { throw (new Error('"auto" format cannot be used for writing')); } /***/ }), /***/ 63561: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var utils = __webpack_require__(80575); var SSHBuffer = __webpack_require__(25621); var Dhe = __webpack_require__(57602); var supportedAlgos = { 'rsa-sha1' : 5, 'rsa-sha256' : 8, 'rsa-sha512' : 10, 'ecdsa-p256-sha256' : 13, 'ecdsa-p384-sha384' : 14 /* * ed25519 is hypothetically supported with id 15 * but the common tools available don't appear to be * capable of generating/using ed25519 keys */ }; var supportedAlgosById = {}; Object.keys(supportedAlgos).forEach(function (k) { supportedAlgosById[supportedAlgos[k]] = k.toUpperCase(); }); function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.split('\n'); if (lines[0].match(/^Private-key-format\: v1/)) { var algElems = lines[1].split(' '); var algoNum = parseInt(algElems[1], 10); var algoName = algElems[2]; if (!supportedAlgosById[algoNum]) throw (new Error('Unsupported algorithm: ' + algoName)); return (readDNSSECPrivateKey(algoNum, lines.slice(2))); } // skip any comment-lines var line = 0; /* JSSTYLED */ while (lines[line].match(/^\;/)) line++; // we should now have *one single* line left with our KEY on it. if ((lines[line].match(/\. IN KEY /) || lines[line].match(/\. IN DNSKEY /)) && lines[line+1].length === 0) { return (readRFC3110(lines[line])); } throw (new Error('Cannot parse dnssec key')); } function readRFC3110(keyString) { var elems = keyString.split(' '); //unused var flags = parseInt(elems[3], 10); //unused var protocol = parseInt(elems[4], 10); var algorithm = parseInt(elems[5], 10); if (!supportedAlgosById[algorithm]) throw (new Error('Unsupported algorithm: ' + algorithm)); var base64key = elems.slice(6, elems.length).join(); var keyBuffer = Buffer.from(base64key, 'base64'); if (supportedAlgosById[algorithm].match(/^RSA-/)) { // join the rest of the body into a single base64-blob var publicExponentLen = keyBuffer.readUInt8(0); if (publicExponentLen != 3 && publicExponentLen != 1) throw (new Error('Cannot parse dnssec key: ' + 'unsupported exponent length')); var publicExponent = keyBuffer.slice(1, publicExponentLen+1); publicExponent = utils.mpNormalize(publicExponent); var modulus = keyBuffer.slice(1+publicExponentLen); modulus = utils.mpNormalize(modulus); // now, make the key var rsaKey = { type: 'rsa', parts: [] }; rsaKey.parts.push({ name: 'e', data: publicExponent}); rsaKey.parts.push({ name: 'n', data: modulus}); return (new Key(rsaKey)); } if (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' || supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') { var curve = 'nistp384'; var size = 384; if (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) { curve = 'nistp256'; size = 256; } var ecdsaKey = { type: 'ecdsa', curve: curve, size: size, parts: [ {name: 'curve', data: Buffer.from(curve) }, {name: 'Q', data: utils.ecNormalize(keyBuffer) } ] }; return (new Key(ecdsaKey)); } throw (new Error('Unsupported algorithm: ' + supportedAlgosById[algorithm])); } function elementToBuf(e) { return (Buffer.from(e.split(' ')[1], 'base64')); } function readDNSSECRSAPrivateKey(elements) { var rsaParams = {}; elements.forEach(function (element) { if (element.split(' ')[0] === 'Modulus:') rsaParams['n'] = elementToBuf(element); else if (element.split(' ')[0] === 'PublicExponent:') rsaParams['e'] = elementToBuf(element); else if (element.split(' ')[0] === 'PrivateExponent:') rsaParams['d'] = elementToBuf(element); else if (element.split(' ')[0] === 'Prime1:') rsaParams['p'] = elementToBuf(element); else if (element.split(' ')[0] === 'Prime2:') rsaParams['q'] = elementToBuf(element); else if (element.split(' ')[0] === 'Exponent1:') rsaParams['dmodp'] = elementToBuf(element); else if (element.split(' ')[0] === 'Exponent2:') rsaParams['dmodq'] = elementToBuf(element); else if (element.split(' ')[0] === 'Coefficient:') rsaParams['iqmp'] = elementToBuf(element); }); // now, make the key var key = { type: 'rsa', parts: [ { name: 'e', data: utils.mpNormalize(rsaParams['e'])}, { name: 'n', data: utils.mpNormalize(rsaParams['n'])}, { name: 'd', data: utils.mpNormalize(rsaParams['d'])}, { name: 'p', data: utils.mpNormalize(rsaParams['p'])}, { name: 'q', data: utils.mpNormalize(rsaParams['q'])}, { name: 'dmodp', data: utils.mpNormalize(rsaParams['dmodp'])}, { name: 'dmodq', data: utils.mpNormalize(rsaParams['dmodq'])}, { name: 'iqmp', data: utils.mpNormalize(rsaParams['iqmp'])} ] }; return (new PrivateKey(key)); } function readDNSSECPrivateKey(alg, elements) { if (supportedAlgosById[alg].match(/^RSA-/)) { return (readDNSSECRSAPrivateKey(elements)); } if (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' || supportedAlgosById[alg] === 'ECDSA-P256-SHA256') { var d = Buffer.from(elements[0].split(' ')[1], 'base64'); var curve = 'nistp384'; var size = 384; if (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') { curve = 'nistp256'; size = 256; } // DNSSEC generates the public-key on the fly (go calculate it) var publicKey = utils.publicFromPrivateECDSA(curve, d); var Q = publicKey.part['Q'].data; var ecdsaKey = { type: 'ecdsa', curve: curve, size: size, parts: [ {name: 'curve', data: Buffer.from(curve) }, {name: 'd', data: d }, {name: 'Q', data: Q } ] }; return (new PrivateKey(ecdsaKey)); } throw (new Error('Unsupported algorithm: ' + supportedAlgosById[alg])); } function dnssecTimestamp(date) { var year = date.getFullYear() + ''; //stringify var month = (date.getMonth() + 1); var timestampStr = year + month + date.getUTCDate(); timestampStr += '' + date.getUTCHours() + date.getUTCMinutes(); timestampStr += date.getUTCSeconds(); return (timestampStr); } function rsaAlgFromOptions(opts) { if (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1') return ('5 (RSASHA1)'); else if (opts.hashAlgo === 'sha256') return ('8 (RSASHA256)'); else if (opts.hashAlgo === 'sha512') return ('10 (RSASHA512)'); else throw (new Error('Unknown or unsupported hash: ' + opts.hashAlgo)); } function writeRSA(key, options) { // if we're missing parts, add them. if (!key.part.dmodp || !key.part.dmodq) { utils.addRSAMissing(key); } var out = ''; out += 'Private-key-format: v1.3\n'; out += 'Algorithm: ' + rsaAlgFromOptions(options) + '\n'; var n = utils.mpDenormalize(key.part['n'].data); out += 'Modulus: ' + n.toString('base64') + '\n'; var e = utils.mpDenormalize(key.part['e'].data); out += 'PublicExponent: ' + e.toString('base64') + '\n'; var d = utils.mpDenormalize(key.part['d'].data); out += 'PrivateExponent: ' + d.toString('base64') + '\n'; var p = utils.mpDenormalize(key.part['p'].data); out += 'Prime1: ' + p.toString('base64') + '\n'; var q = utils.mpDenormalize(key.part['q'].data); out += 'Prime2: ' + q.toString('base64') + '\n'; var dmodp = utils.mpDenormalize(key.part['dmodp'].data); out += 'Exponent1: ' + dmodp.toString('base64') + '\n'; var dmodq = utils.mpDenormalize(key.part['dmodq'].data); out += 'Exponent2: ' + dmodq.toString('base64') + '\n'; var iqmp = utils.mpDenormalize(key.part['iqmp'].data); out += 'Coefficient: ' + iqmp.toString('base64') + '\n'; // Assume that we're valid as-of now var timestamp = new Date(); out += 'Created: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n'; return (Buffer.from(out, 'ascii')); } function writeECDSA(key, options) { var out = ''; out += 'Private-key-format: v1.3\n'; if (key.curve === 'nistp256') { out += 'Algorithm: 13 (ECDSAP256SHA256)\n'; } else if (key.curve === 'nistp384') { out += 'Algorithm: 14 (ECDSAP384SHA384)\n'; } else { throw (new Error('Unsupported curve')); } var base64Key = key.part['d'].data.toString('base64'); out += 'PrivateKey: ' + base64Key + '\n'; // Assume that we're valid as-of now var timestamp = new Date(); out += 'Created: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n'; out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n'; return (Buffer.from(out, 'ascii')); } function write(key, options) { if (PrivateKey.isPrivateKey(key)) { if (key.type === 'rsa') { return (writeRSA(key, options)); } else if (key.type === 'ecdsa') { return (writeECDSA(key, options)); } else { throw (new Error('Unsupported algorithm: ' + key.type)); } } else if (Key.isKey(key)) { /* * RFC3110 requires a keyname, and a keytype, which we * don't really have a mechanism for specifying such * additional metadata. */ throw (new Error('Format "dnssec" only supports ' + 'writing private keys')); } else { throw (new Error('key is not a Key or PrivateKey')); } } /***/ }), /***/ 94033: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = { read: read, verify: verify, sign: sign, signAsync: signAsync, write: write, /* Internal private API */ fromBuffer: fromBuffer, toBuffer: toBuffer }; var assert = __webpack_require__(66631); var SSHBuffer = __webpack_require__(25621); var crypto = __webpack_require__(76417); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var Identity = __webpack_require__(70508); var rfc4253 = __webpack_require__(88688); var Signature = __webpack_require__(91394); var utils = __webpack_require__(80575); var Certificate = __webpack_require__(7406); function verify(cert, key) { /* * We always give an issuerKey, so if our verify() is being called then * there was no signature. Return false. */ return (false); } var TYPES = { 'user': 1, 'host': 2 }; Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; }); var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/; function read(buf, options) { if (Buffer.isBuffer(buf)) buf = buf.toString('ascii'); var parts = buf.trim().split(/[ \t\n]+/g); if (parts.length < 2 || parts.length > 3) throw (new Error('Not a valid SSH certificate line')); var algo = parts[0]; var data = parts[1]; data = Buffer.from(data, 'base64'); return (fromBuffer(data, algo)); } function fromBuffer(data, algo, partial) { var sshbuf = new SSHBuffer({ buffer: data }); var innerAlgo = sshbuf.readString(); if (algo !== undefined && innerAlgo !== algo) throw (new Error('SSH certificate algorithm mismatch')); if (algo === undefined) algo = innerAlgo; var cert = {}; cert.signatures = {}; cert.signatures.openssh = {}; cert.signatures.openssh.nonce = sshbuf.readBuffer(); var key = {}; var parts = (key.parts = []); key.type = getAlg(algo); var partCount = algs.info[key.type].parts.length; while (parts.length < partCount) parts.push(sshbuf.readPart()); assert.ok(parts.length >= 1, 'key must have at least one part'); var algInfo = algs.info[key.type]; if (key.type === 'ecdsa') { var res = ECDSA_ALGO.exec(algo); assert.ok(res !== null); assert.strictEqual(res[1], parts[0].data.toString()); } for (var i = 0; i < algInfo.parts.length; ++i) { parts[i].name = algInfo.parts[i]; if (parts[i].name !== 'curve' && algInfo.normalize !== false) { var p = parts[i]; p.data = utils.mpNormalize(p.data); } } cert.subjectKey = new Key(key); cert.serial = sshbuf.readInt64(); var type = TYPES[sshbuf.readInt()]; assert.string(type, 'valid cert type'); cert.signatures.openssh.keyId = sshbuf.readString(); var principals = []; var pbuf = sshbuf.readBuffer(); var psshbuf = new SSHBuffer({ buffer: pbuf }); while (!psshbuf.atEnd()) principals.push(psshbuf.readString()); if (principals.length === 0) principals = ['*']; cert.subjects = principals.map(function (pr) { if (type === 'user') return (Identity.forUser(pr)); else if (type === 'host') return (Identity.forHost(pr)); throw (new Error('Unknown identity type ' + type)); }); cert.validFrom = int64ToDate(sshbuf.readInt64()); cert.validUntil = int64ToDate(sshbuf.readInt64()); var exts = []; var extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); var ext; while (!extbuf.atEnd()) { ext = { critical: true }; ext.name = extbuf.readString(); ext.data = extbuf.readBuffer(); exts.push(ext); } extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); while (!extbuf.atEnd()) { ext = { critical: false }; ext.name = extbuf.readString(); ext.data = extbuf.readBuffer(); exts.push(ext); } cert.signatures.openssh.exts = exts; /* reserved */ sshbuf.readBuffer(); var signingKeyBuf = sshbuf.readBuffer(); cert.issuerKey = rfc4253.read(signingKeyBuf); /* * OpenSSH certs don't give the identity of the issuer, just their * public key. So, we use an Identity that matches anything. The * isSignedBy() function will later tell you if the key matches. */ cert.issuer = Identity.forHost('**'); var sigBuf = sshbuf.readBuffer(); cert.signatures.openssh.signature = Signature.parse(sigBuf, cert.issuerKey.type, 'ssh'); if (partial !== undefined) { partial.remainder = sshbuf.remainder(); partial.consumed = sshbuf._offset; } return (new Certificate(cert)); } function int64ToDate(buf) { var i = buf.readUInt32BE(0) * 4294967296; i += buf.readUInt32BE(4); var d = new Date(); d.setTime(i * 1000); d.sourceInt64 = buf; return (d); } function dateToInt64(date) { if (date.sourceInt64 !== undefined) return (date.sourceInt64); var i = Math.round(date.getTime() / 1000); var upper = Math.floor(i / 4294967296); var lower = Math.floor(i % 4294967296); var buf = Buffer.alloc(8); buf.writeUInt32BE(upper, 0); buf.writeUInt32BE(lower, 4); return (buf); } function sign(cert, key) { if (cert.signatures.openssh === undefined) cert.signatures.openssh = {}; try { var blob = toBuffer(cert, true); } catch (e) { delete (cert.signatures.openssh); return (false); } var sig = cert.signatures.openssh; var hashAlgo = undefined; if (key.type === 'rsa' || key.type === 'dsa') hashAlgo = 'sha1'; var signer = key.createSign(hashAlgo); signer.write(blob); sig.signature = signer.sign(); return (true); } function signAsync(cert, signer, done) { if (cert.signatures.openssh === undefined) cert.signatures.openssh = {}; try { var blob = toBuffer(cert, true); } catch (e) { delete (cert.signatures.openssh); done(e); return; } var sig = cert.signatures.openssh; signer(blob, function (err, signature) { if (err) { done(err); return; } try { /* * This will throw if the signature isn't of a * type/algo that can be used for SSH. */ signature.toBuffer('ssh'); } catch (e) { done(e); return; } sig.signature = signature; done(); }); } function write(cert, options) { if (options === undefined) options = {}; var blob = toBuffer(cert); var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64'); if (options.comment) out = out + ' ' + options.comment; return (out); } function toBuffer(cert, noSig) { assert.object(cert.signatures.openssh, 'signature for openssh format'); var sig = cert.signatures.openssh; if (sig.nonce === undefined) sig.nonce = crypto.randomBytes(16); var buf = new SSHBuffer({}); buf.writeString(getCertType(cert.subjectKey)); buf.writeBuffer(sig.nonce); var key = cert.subjectKey; var algInfo = algs.info[key.type]; algInfo.parts.forEach(function (part) { buf.writePart(key.part[part]); }); buf.writeInt64(cert.serial); var type = cert.subjects[0].type; assert.notStrictEqual(type, 'unknown'); cert.subjects.forEach(function (id) { assert.strictEqual(id.type, type); }); type = TYPES[type]; buf.writeInt(type); if (sig.keyId === undefined) { sig.keyId = cert.subjects[0].type + '_' + (cert.subjects[0].uid || cert.subjects[0].hostname); } buf.writeString(sig.keyId); var sub = new SSHBuffer({}); cert.subjects.forEach(function (id) { if (type === TYPES.host) sub.writeString(id.hostname); else if (type === TYPES.user) sub.writeString(id.uid); }); buf.writeBuffer(sub.toBuffer()); buf.writeInt64(dateToInt64(cert.validFrom)); buf.writeInt64(dateToInt64(cert.validUntil)); var exts = sig.exts; if (exts === undefined) exts = []; var extbuf = new SSHBuffer({}); exts.forEach(function (ext) { if (ext.critical !== true) return; extbuf.writeString(ext.name); extbuf.writeBuffer(ext.data); }); buf.writeBuffer(extbuf.toBuffer()); extbuf = new SSHBuffer({}); exts.forEach(function (ext) { if (ext.critical === true) return; extbuf.writeString(ext.name); extbuf.writeBuffer(ext.data); }); buf.writeBuffer(extbuf.toBuffer()); /* reserved */ buf.writeBuffer(Buffer.alloc(0)); sub = rfc4253.write(cert.issuerKey); buf.writeBuffer(sub); if (!noSig) buf.writeBuffer(sig.signature.toBuffer('ssh')); return (buf.toBuffer()); } function getAlg(certType) { if (certType === 'ssh-rsa-cert-v01@openssh.com') return ('rsa'); if (certType === 'ssh-dss-cert-v01@openssh.com') return ('dsa'); if (certType.match(ECDSA_ALGO)) return ('ecdsa'); if (certType === 'ssh-ed25519-cert-v01@openssh.com') return ('ed25519'); throw (new Error('Unsupported cert type ' + certType)); } function getCertType(key) { if (key.type === 'rsa') return ('ssh-rsa-cert-v01@openssh.com'); if (key.type === 'dsa') return ('ssh-dss-cert-v01@openssh.com'); if (key.type === 'ecdsa') return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com'); if (key.type === 'ed25519') return ('ssh-ed25519-cert-v01@openssh.com'); throw (new Error('Unsupported key type ' + key.type)); } /***/ }), /***/ 14324: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var crypto = __webpack_require__(76417); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pkcs1 = __webpack_require__(69367); var pkcs8 = __webpack_require__(4173); var sshpriv = __webpack_require__(3923); var rfc4253 = __webpack_require__(88688); var errors = __webpack_require__(27979); var OID_PBES2 = '1.2.840.113549.1.5.13'; var OID_PBKDF2 = '1.2.840.113549.1.5.12'; var OID_TO_CIPHER = { '1.2.840.113549.3.7': '3des-cbc', '2.16.840.1.101.3.4.1.2': 'aes128-cbc', '2.16.840.1.101.3.4.1.42': 'aes256-cbc' }; var CIPHER_TO_OID = {}; Object.keys(OID_TO_CIPHER).forEach(function (k) { CIPHER_TO_OID[OID_TO_CIPHER[k]] = k; }); var OID_TO_HASH = { '1.2.840.113549.2.7': 'sha1', '1.2.840.113549.2.9': 'sha256', '1.2.840.113549.2.11': 'sha512' }; var HASH_TO_OID = {}; Object.keys(OID_TO_HASH).forEach(function (k) { HASH_TO_OID[OID_TO_HASH[k]] = k; }); /* * For reading we support both PKCS#1 and PKCS#8. If we find a private key, * we just take the public component of it and use that. */ function read(buf, options, forceType) { var input = buf; if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.trim().split(/[\r\n]+/g); var m; var si = -1; while (!m && si < lines.length) { m = lines[++si].match(/*JSSTYLED*/ /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); } assert.ok(m, 'invalid PEM header'); var m2; var ei = lines.length; while (!m2 && ei > 0) { m2 = lines[--ei].match(/*JSSTYLED*/ /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); } assert.ok(m2, 'invalid PEM footer'); /* Begin and end banners must match key type */ assert.equal(m[2], m2[2]); var type = m[2].toLowerCase(); var alg; if (m[1]) { /* They also must match algorithms, if given */ assert.equal(m[1], m2[1], 'PEM header and footer mismatch'); alg = m[1].trim(); } lines = lines.slice(si, ei + 1); var headers = {}; while (true) { lines = lines.slice(1); m = lines[0].match(/*JSSTYLED*/ /^([A-Za-z0-9-]+): (.+)$/); if (!m) break; headers[m[1].toLowerCase()] = m[2]; } /* Chop off the first and last lines */ lines = lines.slice(0, -1).join(''); buf = Buffer.from(lines, 'base64'); var cipher, key, iv; if (headers['proc-type']) { var parts = headers['proc-type'].split(','); if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from( options.passphrase, 'utf-8'); } if (!Buffer.isBuffer(options.passphrase)) { throw (new errors.KeyEncryptedError( options.filename, 'PEM')); } else { parts = headers['dek-info'].split(','); assert.ok(parts.length === 2); cipher = parts[0].toLowerCase(); iv = Buffer.from(parts[1], 'hex'); key = utils.opensslKeyDeriv(cipher, iv, options.passphrase, 1).key; } } } if (alg && alg.toLowerCase() === 'encrypted') { var eder = new asn1.BerReader(buf); var pbesEnd; eder.readSequence(); eder.readSequence(); pbesEnd = eder.offset + eder.length; var method = eder.readOID(); if (method !== OID_PBES2) { throw (new Error('Unsupported PEM/PKCS8 encryption ' + 'scheme: ' + method)); } eder.readSequence(); /* PBES2-params */ eder.readSequence(); /* keyDerivationFunc */ var kdfEnd = eder.offset + eder.length; var kdfOid = eder.readOID(); if (kdfOid !== OID_PBKDF2) throw (new Error('Unsupported PBES2 KDF: ' + kdfOid)); eder.readSequence(); var salt = eder.readString(asn1.Ber.OctetString, true); var iterations = eder.readInt(); var hashAlg = 'sha1'; if (eder.offset < kdfEnd) { eder.readSequence(); var hashAlgOid = eder.readOID(); hashAlg = OID_TO_HASH[hashAlgOid]; if (hashAlg === undefined) { throw (new Error('Unsupported PBKDF2 hash: ' + hashAlgOid)); } } eder._offset = kdfEnd; eder.readSequence(); /* encryptionScheme */ var cipherOid = eder.readOID(); cipher = OID_TO_CIPHER[cipherOid]; if (cipher === undefined) { throw (new Error('Unsupported PBES2 cipher: ' + cipherOid)); } iv = eder.readString(asn1.Ber.OctetString, true); eder._offset = pbesEnd; buf = eder.readString(asn1.Ber.OctetString, true); if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from( options.passphrase, 'utf-8'); } if (!Buffer.isBuffer(options.passphrase)) { throw (new errors.KeyEncryptedError( options.filename, 'PEM')); } var cinfo = utils.opensshCipherInfo(cipher); cipher = cinfo.opensslName; key = utils.pbkdf2(hashAlg, salt, iterations, cinfo.keySize, options.passphrase); alg = undefined; } if (cipher && key && iv) { var cipherStream = crypto.createDecipheriv(cipher, key, iv); var chunk, chunks = []; cipherStream.once('error', function (e) { if (e.toString().indexOf('bad decrypt') !== -1) { throw (new Error('Incorrect passphrase ' + 'supplied, could not decrypt key')); } throw (e); }); cipherStream.write(buf); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); buf = Buffer.concat(chunks); } /* The new OpenSSH internal format abuses PEM headers */ if (alg && alg.toLowerCase() === 'openssh') return (sshpriv.readSSHPrivate(type, buf, options)); if (alg && alg.toLowerCase() === 'ssh2') return (rfc4253.readType(type, buf, options)); var der = new asn1.BerReader(buf); der.originalInput = input; /* * All of the PEM file types start with a sequence tag, so chop it * off here */ der.readSequence(); /* PKCS#1 type keys name an algorithm in the banner explicitly */ if (alg) { if (forceType) assert.strictEqual(forceType, 'pkcs1'); return (pkcs1.readPkcs1(alg, type, der)); } else { if (forceType) assert.strictEqual(forceType, 'pkcs8'); return (pkcs8.readPkcs8(alg, type, der)); } } function write(key, options, type) { assert.object(key); var alg = { 'ecdsa': 'EC', 'rsa': 'RSA', 'dsa': 'DSA', 'ed25519': 'EdDSA' }[key.type]; var header; var der = new asn1.BerWriter(); if (PrivateKey.isPrivateKey(key)) { if (type && type === 'pkcs8') { header = 'PRIVATE KEY'; pkcs8.writePkcs8(der, key); } else { if (type) assert.strictEqual(type, 'pkcs1'); header = alg + ' PRIVATE KEY'; pkcs1.writePkcs1(der, key); } } else if (Key.isKey(key)) { if (type && type === 'pkcs1') { header = alg + ' PUBLIC KEY'; pkcs1.writePkcs1(der, key); } else { if (type) assert.strictEqual(type, 'pkcs8'); header = 'PUBLIC KEY'; pkcs8.writePkcs8(der, key); } } else { throw (new Error('key is not a Key or PrivateKey')); } var tmp = der.buffer.toString('base64'); var len = tmp.length + (tmp.length / 64) + 18 + 16 + header.length*2 + 10; var buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 64; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /***/ 69367: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { read: read, readPkcs1: readPkcs1, write: write, writePkcs1: writePkcs1 }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var pkcs8 = __webpack_require__(4173); var readECDSACurve = pkcs8.readECDSACurve; function read(buf, options) { return (pem.read(buf, options, 'pkcs1')); } function write(key, options) { return (pem.write(key, options, 'pkcs1')); } /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function readPkcs1(alg, type, der) { switch (alg) { case 'RSA': if (type === 'public') return (readPkcs1RSAPublic(der)); else if (type === 'private') return (readPkcs1RSAPrivate(der)); throw (new Error('Unknown key type: ' + type)); case 'DSA': if (type === 'public') return (readPkcs1DSAPublic(der)); else if (type === 'private') return (readPkcs1DSAPrivate(der)); throw (new Error('Unknown key type: ' + type)); case 'EC': case 'ECDSA': if (type === 'private') return (readPkcs1ECDSAPrivate(der)); else if (type === 'public') return (readPkcs1ECDSAPublic(der)); throw (new Error('Unknown key type: ' + type)); case 'EDDSA': case 'EdDSA': if (type === 'private') return (readPkcs1EdDSAPrivate(der)); throw (new Error(type + ' keys not supported with EdDSA')); default: throw (new Error('Unknown key algo: ' + alg)); } } function readPkcs1RSAPublic(der) { // modulus and exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'exponent'); // now, make the key var key = { type: 'rsa', parts: [ { name: 'e', data: e }, { name: 'n', data: n } ] }; return (new Key(key)); } function readPkcs1RSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version[0], 0); // modulus then public exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'public exponent'); var d = readMPInt(der, 'private exponent'); var p = readMPInt(der, 'prime1'); var q = readMPInt(der, 'prime2'); var dmodp = readMPInt(der, 'exponent1'); var dmodq = readMPInt(der, 'exponent2'); var iqmp = readMPInt(der, 'iqmp'); // now, make the key var key = { type: 'rsa', parts: [ { name: 'n', data: n }, { name: 'e', data: e }, { name: 'd', data: d }, { name: 'iqmp', data: iqmp }, { name: 'p', data: p }, { name: 'q', data: q }, { name: 'dmodp', data: dmodp }, { name: 'dmodq', data: dmodq } ] }; return (new PrivateKey(key)); } function readPkcs1DSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 0); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); var y = readMPInt(der, 'y'); var x = readMPInt(der, 'x'); // now, make the key var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y }, { name: 'x', data: x } ] }; return (new PrivateKey(key)); } function readPkcs1EdDSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 1); // private key var k = der.readString(asn1.Ber.OctetString, true); der.readSequence(0xa0); var oid = der.readOID(); assert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier'); der.readSequence(0xa1); var A = utils.readBitString(der); var key = { type: 'ed25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) }, { name: 'k', data: k } ] }; return (new PrivateKey(key)); } function readPkcs1DSAPublic(der) { var y = readMPInt(der, 'y'); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); var key = { type: 'dsa', parts: [ { name: 'y', data: y }, { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g } ] }; return (new Key(key)); } function readPkcs1ECDSAPublic(der) { der.readSequence(); var oid = der.readOID(); assert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey'); var curveOid = der.readOID(); var curve; var curves = Object.keys(algs.curves); for (var j = 0; j < curves.length; ++j) { var c = curves[j]; var cd = algs.curves[c]; if (cd.pkcs8oid === curveOid) { curve = c; break; } } assert.string(curve, 'a known ECDSA named curve'); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curve) }, { name: 'Q', data: Q } ] }; return (new Key(key)); } function readPkcs1ECDSAPrivate(der) { var version = readMPInt(der, 'version'); assert.strictEqual(version.readUInt8(0), 1); // private key var d = der.readString(asn1.Ber.OctetString, true); der.readSequence(0xa0); var curve = readECDSACurve(der); assert.string(curve, 'a known elliptic curve'); der.readSequence(0xa1); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curve) }, { name: 'Q', data: Q }, { name: 'd', data: d } ] }; return (new PrivateKey(key)); } function writePkcs1(der, key) { der.startSequence(); switch (key.type) { case 'rsa': if (PrivateKey.isPrivateKey(key)) writePkcs1RSAPrivate(der, key); else writePkcs1RSAPublic(der, key); break; case 'dsa': if (PrivateKey.isPrivateKey(key)) writePkcs1DSAPrivate(der, key); else writePkcs1DSAPublic(der, key); break; case 'ecdsa': if (PrivateKey.isPrivateKey(key)) writePkcs1ECDSAPrivate(der, key); else writePkcs1ECDSAPublic(der, key); break; case 'ed25519': if (PrivateKey.isPrivateKey(key)) writePkcs1EdDSAPrivate(der, key); else writePkcs1EdDSAPublic(der, key); break; default: throw (new Error('Unknown key algo: ' + key.type)); } der.endSequence(); } function writePkcs1RSAPublic(der, key) { der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); } function writePkcs1RSAPrivate(der, key) { var ver = Buffer.from([0]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.Integer); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); if (!key.part.dmodp || !key.part.dmodq) utils.addRSAMissing(key); der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); } function writePkcs1DSAPrivate(der, key) { var ver = Buffer.from([0]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); der.writeBuffer(key.part.g.data, asn1.Ber.Integer); der.writeBuffer(key.part.y.data, asn1.Ber.Integer); der.writeBuffer(key.part.x.data, asn1.Ber.Integer); } function writePkcs1DSAPublic(der, key) { der.writeBuffer(key.part.y.data, asn1.Ber.Integer); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); der.writeBuffer(key.part.g.data, asn1.Ber.Integer); } function writePkcs1ECDSAPublic(der, key) { der.startSequence(); der.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */ var curve = key.part.curve.data.toString(); var curveOid = algs.curves[curve].pkcs8oid; assert.string(curveOid, 'a known ECDSA named curve'); der.writeOID(curveOid); der.endSequence(); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); } function writePkcs1ECDSAPrivate(der, key) { var ver = Buffer.from([1]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); der.startSequence(0xa0); var curve = key.part.curve.data.toString(); var curveOid = algs.curves[curve].pkcs8oid; assert.string(curveOid, 'a known ECDSA named curve'); der.writeOID(curveOid); der.endSequence(); der.startSequence(0xa1); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); der.endSequence(); } function writePkcs1EdDSAPrivate(der, key) { var ver = Buffer.from([1]); der.writeBuffer(ver, asn1.Ber.Integer); der.writeBuffer(key.part.k.data, asn1.Ber.OctetString); der.startSequence(0xa0); der.writeOID('1.3.101.112'); der.endSequence(); der.startSequence(0xa1); utils.writeBitString(der, key.part.A.data); der.endSequence(); } function writePkcs1EdDSAPublic(der, key) { throw (new Error('Public keys are not supported for EdDSA PKCS#1')); } /***/ }), /***/ 4173: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = { read: read, readPkcs8: readPkcs8, write: write, writePkcs8: writePkcs8, pkcs8ToBuffer: pkcs8ToBuffer, readECDSACurve: readECDSACurve, writeECDSACurve: writeECDSACurve }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); function read(buf, options) { return (pem.read(buf, options, 'pkcs8')); } function write(key, options) { return (pem.write(key, options, 'pkcs8')); } /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function readPkcs8(alg, type, der) { /* Private keys in pkcs#8 format have a weird extra int */ if (der.peek() === asn1.Ber.Integer) { assert.strictEqual(type, 'private', 'unexpected Integer at start of public key'); der.readString(asn1.Ber.Integer, true); } der.readSequence(); var next = der.offset + der.length; var oid = der.readOID(); switch (oid) { case '1.2.840.113549.1.1.1': der._offset = next; if (type === 'public') return (readPkcs8RSAPublic(der)); else return (readPkcs8RSAPrivate(der)); case '1.2.840.10040.4.1': if (type === 'public') return (readPkcs8DSAPublic(der)); else return (readPkcs8DSAPrivate(der)); case '1.2.840.10045.2.1': if (type === 'public') return (readPkcs8ECDSAPublic(der)); else return (readPkcs8ECDSAPrivate(der)); case '1.3.101.112': if (type === 'public') { return (readPkcs8EdDSAPublic(der)); } else { return (readPkcs8EdDSAPrivate(der)); } case '1.3.101.110': if (type === 'public') { return (readPkcs8X25519Public(der)); } else { return (readPkcs8X25519Private(der)); } default: throw (new Error('Unknown key type OID ' + oid)); } } function readPkcs8RSAPublic(der) { // bit string sequence der.readSequence(asn1.Ber.BitString); der.readByte(); der.readSequence(); // modulus var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'exponent'); // now, make the key var key = { type: 'rsa', source: der.originalInput, parts: [ { name: 'e', data: e }, { name: 'n', data: n } ] }; return (new Key(key)); } function readPkcs8RSAPrivate(der) { der.readSequence(asn1.Ber.OctetString); der.readSequence(); var ver = readMPInt(der, 'version'); assert.equal(ver[0], 0x0, 'unknown RSA private key version'); // modulus then public exponent var n = readMPInt(der, 'modulus'); var e = readMPInt(der, 'public exponent'); var d = readMPInt(der, 'private exponent'); var p = readMPInt(der, 'prime1'); var q = readMPInt(der, 'prime2'); var dmodp = readMPInt(der, 'exponent1'); var dmodq = readMPInt(der, 'exponent2'); var iqmp = readMPInt(der, 'iqmp'); // now, make the key var key = { type: 'rsa', parts: [ { name: 'n', data: n }, { name: 'e', data: e }, { name: 'd', data: d }, { name: 'iqmp', data: iqmp }, { name: 'p', data: p }, { name: 'q', data: q }, { name: 'dmodp', data: dmodp }, { name: 'dmodq', data: dmodq } ] }; return (new PrivateKey(key)); } function readPkcs8DSAPublic(der) { der.readSequence(); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); // bit string sequence der.readSequence(asn1.Ber.BitString); der.readByte(); var y = readMPInt(der, 'y'); // now, make the key var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y } ] }; return (new Key(key)); } function readPkcs8DSAPrivate(der) { der.readSequence(); var p = readMPInt(der, 'p'); var q = readMPInt(der, 'q'); var g = readMPInt(der, 'g'); der.readSequence(asn1.Ber.OctetString); var x = readMPInt(der, 'x'); /* The pkcs#8 format does not include the public key */ var y = utils.calculateDSAPublic(g, p, x); var key = { type: 'dsa', parts: [ { name: 'p', data: p }, { name: 'q', data: q }, { name: 'g', data: g }, { name: 'y', data: y }, { name: 'x', data: x } ] }; return (new PrivateKey(key)); } function readECDSACurve(der) { var curveName, curveNames; var j, c, cd; if (der.peek() === asn1.Ber.OID) { var oid = der.readOID(); curveNames = Object.keys(algs.curves); for (j = 0; j < curveNames.length; ++j) { c = curveNames[j]; cd = algs.curves[c]; if (cd.pkcs8oid === oid) { curveName = c; break; } } } else { // ECParameters sequence der.readSequence(); var version = der.readString(asn1.Ber.Integer, true); assert.strictEqual(version[0], 1, 'ECDSA key not version 1'); var curve = {}; // FieldID sequence der.readSequence(); var fieldTypeOid = der.readOID(); assert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1', 'ECDSA key is not from a prime-field'); var p = curve.p = utils.mpNormalize( der.readString(asn1.Ber.Integer, true)); /* * p always starts with a 1 bit, so count the zeros to get its * real size. */ curve.size = p.length * 8 - utils.countZeros(p); // Curve sequence der.readSequence(); curve.a = utils.mpNormalize( der.readString(asn1.Ber.OctetString, true)); curve.b = utils.mpNormalize( der.readString(asn1.Ber.OctetString, true)); if (der.peek() === asn1.Ber.BitString) curve.s = der.readString(asn1.Ber.BitString, true); // Combined Gx and Gy curve.G = der.readString(asn1.Ber.OctetString, true); assert.strictEqual(curve.G[0], 0x4, 'uncompressed G is required'); curve.n = utils.mpNormalize( der.readString(asn1.Ber.Integer, true)); curve.h = utils.mpNormalize( der.readString(asn1.Ber.Integer, true)); assert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' + 'required'); curveNames = Object.keys(algs.curves); var ks = Object.keys(curve); for (j = 0; j < curveNames.length; ++j) { c = curveNames[j]; cd = algs.curves[c]; var equal = true; for (var i = 0; i < ks.length; ++i) { var k = ks[i]; if (cd[k] === undefined) continue; if (typeof (cd[k]) === 'object' && cd[k].equals !== undefined) { if (!cd[k].equals(curve[k])) { equal = false; break; } } else if (Buffer.isBuffer(cd[k])) { if (cd[k].toString('binary') !== curve[k].toString('binary')) { equal = false; break; } } else { if (cd[k] !== curve[k]) { equal = false; break; } } } if (equal) { curveName = c; break; } } } return (curveName); } function readPkcs8ECDSAPrivate(der) { var curveName = readECDSACurve(der); assert.string(curveName, 'a known elliptic curve'); der.readSequence(asn1.Ber.OctetString); der.readSequence(); var version = readMPInt(der, 'version'); assert.equal(version[0], 1, 'unknown version of ECDSA key'); var d = der.readString(asn1.Ber.OctetString, true); var Q; if (der.peek() == 0xa0) { der.readSequence(0xa0); der._offset += der.length; } if (der.peek() == 0xa1) { der.readSequence(0xa1); Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); } if (Q === undefined) { var pub = utils.publicFromPrivateECDSA(curveName, d); Q = pub.part.Q.data; } var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curveName) }, { name: 'Q', data: Q }, { name: 'd', data: d } ] }; return (new PrivateKey(key)); } function readPkcs8ECDSAPublic(der) { var curveName = readECDSACurve(der); assert.string(curveName, 'a known elliptic curve'); var Q = der.readString(asn1.Ber.BitString, true); Q = utils.ecNormalize(Q); var key = { type: 'ecdsa', parts: [ { name: 'curve', data: Buffer.from(curveName) }, { name: 'Q', data: Q } ] }; return (new Key(key)); } function readPkcs8EdDSAPublic(der) { if (der.peek() === 0x00) der.readByte(); var A = utils.readBitString(der); var key = { type: 'ed25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) } ] }; return (new Key(key)); } function readPkcs8X25519Public(der) { var A = utils.readBitString(der); var key = { type: 'curve25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) } ] }; return (new Key(key)); } function readPkcs8EdDSAPrivate(der) { if (der.peek() === 0x00) der.readByte(); der.readSequence(asn1.Ber.OctetString); var k = der.readString(asn1.Ber.OctetString, true); k = utils.zeroPadToLength(k, 32); var A; if (der.peek() === asn1.Ber.BitString) { A = utils.readBitString(der); A = utils.zeroPadToLength(A, 32); } else { A = utils.calculateED25519Public(k); } var key = { type: 'ed25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) }, { name: 'k', data: utils.zeroPadToLength(k, 32) } ] }; return (new PrivateKey(key)); } function readPkcs8X25519Private(der) { if (der.peek() === 0x00) der.readByte(); der.readSequence(asn1.Ber.OctetString); var k = der.readString(asn1.Ber.OctetString, true); k = utils.zeroPadToLength(k, 32); var A = utils.calculateX25519Public(k); var key = { type: 'curve25519', parts: [ { name: 'A', data: utils.zeroPadToLength(A, 32) }, { name: 'k', data: utils.zeroPadToLength(k, 32) } ] }; return (new PrivateKey(key)); } function pkcs8ToBuffer(key) { var der = new asn1.BerWriter(); writePkcs8(der, key); return (der.buffer); } function writePkcs8(der, key) { der.startSequence(); if (PrivateKey.isPrivateKey(key)) { var sillyInt = Buffer.from([0]); der.writeBuffer(sillyInt, asn1.Ber.Integer); } der.startSequence(); switch (key.type) { case 'rsa': der.writeOID('1.2.840.113549.1.1.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8RSAPrivate(key, der); else writePkcs8RSAPublic(key, der); break; case 'dsa': der.writeOID('1.2.840.10040.4.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8DSAPrivate(key, der); else writePkcs8DSAPublic(key, der); break; case 'ecdsa': der.writeOID('1.2.840.10045.2.1'); if (PrivateKey.isPrivateKey(key)) writePkcs8ECDSAPrivate(key, der); else writePkcs8ECDSAPublic(key, der); break; case 'ed25519': der.writeOID('1.3.101.112'); if (PrivateKey.isPrivateKey(key)) throw (new Error('Ed25519 private keys in pkcs8 ' + 'format are not supported')); writePkcs8EdDSAPublic(key, der); break; default: throw (new Error('Unsupported key type: ' + key.type)); } der.endSequence(); } function writePkcs8RSAPrivate(key, der) { der.writeNull(); der.endSequence(); der.startSequence(asn1.Ber.OctetString); der.startSequence(); var version = Buffer.from([0]); der.writeBuffer(version, asn1.Ber.Integer); der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.Integer); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); if (!key.part.dmodp || !key.part.dmodq) utils.addRSAMissing(key); der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); } function writePkcs8RSAPublic(key, der) { der.writeNull(); der.endSequence(); der.startSequence(asn1.Ber.BitString); der.writeByte(0x00); der.startSequence(); der.writeBuffer(key.part.n.data, asn1.Ber.Integer); der.writeBuffer(key.part.e.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); } function writePkcs8DSAPrivate(key, der) { der.startSequence(); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); der.writeBuffer(key.part.g.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); der.startSequence(asn1.Ber.OctetString); der.writeBuffer(key.part.x.data, asn1.Ber.Integer); der.endSequence(); } function writePkcs8DSAPublic(key, der) { der.startSequence(); der.writeBuffer(key.part.p.data, asn1.Ber.Integer); der.writeBuffer(key.part.q.data, asn1.Ber.Integer); der.writeBuffer(key.part.g.data, asn1.Ber.Integer); der.endSequence(); der.endSequence(); der.startSequence(asn1.Ber.BitString); der.writeByte(0x00); der.writeBuffer(key.part.y.data, asn1.Ber.Integer); der.endSequence(); } function writeECDSACurve(key, der) { var curve = algs.curves[key.curve]; if (curve.pkcs8oid) { /* This one has a name in pkcs#8, so just write the oid */ der.writeOID(curve.pkcs8oid); } else { // ECParameters sequence der.startSequence(); var version = Buffer.from([1]); der.writeBuffer(version, asn1.Ber.Integer); // FieldID sequence der.startSequence(); der.writeOID('1.2.840.10045.1.1'); // prime-field der.writeBuffer(curve.p, asn1.Ber.Integer); der.endSequence(); // Curve sequence der.startSequence(); var a = curve.p; if (a[0] === 0x0) a = a.slice(1); der.writeBuffer(a, asn1.Ber.OctetString); der.writeBuffer(curve.b, asn1.Ber.OctetString); der.writeBuffer(curve.s, asn1.Ber.BitString); der.endSequence(); der.writeBuffer(curve.G, asn1.Ber.OctetString); der.writeBuffer(curve.n, asn1.Ber.Integer); var h = curve.h; if (!h) { h = Buffer.from([1]); } der.writeBuffer(h, asn1.Ber.Integer); // ECParameters der.endSequence(); } } function writePkcs8ECDSAPublic(key, der) { writeECDSACurve(key, der); der.endSequence(); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); } function writePkcs8ECDSAPrivate(key, der) { writeECDSACurve(key, der); der.endSequence(); der.startSequence(asn1.Ber.OctetString); der.startSequence(); var version = Buffer.from([1]); der.writeBuffer(version, asn1.Ber.Integer); der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); der.startSequence(0xa1); var Q = utils.ecNormalize(key.part.Q.data, true); der.writeBuffer(Q, asn1.Ber.BitString); der.endSequence(); der.endSequence(); der.endSequence(); } function writePkcs8EdDSAPublic(key, der) { der.endSequence(); utils.writeBitString(der, key.part.A.data); } function writePkcs8EdDSAPrivate(key, der) { der.endSequence(); var k = utils.mpNormalize(key.part.k.data, true); der.startSequence(asn1.Ber.OctetString); der.writeBuffer(k, asn1.Ber.OctetString); der.endSequence(); } /***/ }), /***/ 80974: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var rfc4253 = __webpack_require__(88688); var Key = __webpack_require__(36814); var errors = __webpack_require__(27979); function read(buf, options) { var lines = buf.toString('ascii').split(/[\r\n]+/); var found = false; var parts; var si = 0; while (si < lines.length) { parts = splitHeader(lines[si++]); if (parts && parts[0].toLowerCase() === 'putty-user-key-file-2') { found = true; break; } } if (!found) { throw (new Error('No PuTTY format first line found')); } var alg = parts[1]; parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'encryption'); parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'comment'); var comment = parts[1]; parts = splitHeader(lines[si++]); assert.equal(parts[0].toLowerCase(), 'public-lines'); var publicLines = parseInt(parts[1], 10); if (!isFinite(publicLines) || publicLines < 0 || publicLines > lines.length) { throw (new Error('Invalid public-lines count')); } var publicBuf = Buffer.from( lines.slice(si, si + publicLines).join(''), 'base64'); var keyType = rfc4253.algToKeyType(alg); var key = rfc4253.read(publicBuf); if (key.type !== keyType) { throw (new Error('Outer key algorithm mismatch')); } key.comment = comment; return (key); } function splitHeader(line) { var idx = line.indexOf(':'); if (idx === -1) return (null); var header = line.slice(0, idx); ++idx; while (line[idx] === ' ') ++idx; var rest = line.slice(idx); return ([header, rest]); } function write(key, options) { assert.object(key); if (!Key.isKey(key)) throw (new Error('Must be a public key')); var alg = rfc4253.keyTypeToAlg(key); var buf = rfc4253.write(key); var comment = key.comment || ''; var b64 = buf.toString('base64'); var lines = wrap(b64, 64); lines.unshift('Public-Lines: ' + lines.length); lines.unshift('Comment: ' + comment); lines.unshift('Encryption: none'); lines.unshift('PuTTY-User-Key-File-2: ' + alg); return (Buffer.from(lines.join('\n') + '\n')); } function wrap(txt, len) { var lines = []; var pos = 0; while (pos < txt.length) { lines.push(txt.slice(pos, pos + 64)); pos += 64; } return (lines); } /***/ }), /***/ 88688: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { read: read.bind(undefined, false, undefined), readType: read.bind(undefined, false), write: write, /* semi-private api, used by sshpk-agent */ readPartial: read.bind(undefined, true), /* shared with ssh format */ readInternal: read, keyTypeToAlg: keyTypeToAlg, algToKeyType: algToKeyType }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var SSHBuffer = __webpack_require__(25621); function algToKeyType(alg) { assert.string(alg); if (alg === 'ssh-dss') return ('dsa'); else if (alg === 'ssh-rsa') return ('rsa'); else if (alg === 'ssh-ed25519') return ('ed25519'); else if (alg === 'ssh-curve25519') return ('curve25519'); else if (alg.match(/^ecdsa-sha2-/)) return ('ecdsa'); else throw (new Error('Unknown algorithm ' + alg)); } function keyTypeToAlg(key) { assert.object(key); if (key.type === 'dsa') return ('ssh-dss'); else if (key.type === 'rsa') return ('ssh-rsa'); else if (key.type === 'ed25519') return ('ssh-ed25519'); else if (key.type === 'curve25519') return ('ssh-curve25519'); else if (key.type === 'ecdsa') return ('ecdsa-sha2-' + key.part.curve.data.toString()); else throw (new Error('Unknown key type ' + key.type)); } function read(partial, type, buf, options) { if (typeof (buf) === 'string') buf = Buffer.from(buf); assert.buffer(buf, 'buf'); var key = {}; var parts = key.parts = []; var sshbuf = new SSHBuffer({buffer: buf}); var alg = sshbuf.readString(); assert.ok(!sshbuf.atEnd(), 'key must have at least one part'); key.type = algToKeyType(alg); var partCount = algs.info[key.type].parts.length; if (type && type === 'private') partCount = algs.privInfo[key.type].parts.length; while (!sshbuf.atEnd() && parts.length < partCount) parts.push(sshbuf.readPart()); while (!partial && !sshbuf.atEnd()) parts.push(sshbuf.readPart()); assert.ok(parts.length >= 1, 'key must have at least one part'); assert.ok(partial || sshbuf.atEnd(), 'leftover bytes at end of key'); var Constructor = Key; var algInfo = algs.info[key.type]; if (type === 'private' || algInfo.parts.length !== parts.length) { algInfo = algs.privInfo[key.type]; Constructor = PrivateKey; } assert.strictEqual(algInfo.parts.length, parts.length); if (key.type === 'ecdsa') { var res = /^ecdsa-sha2-(.+)$/.exec(alg); assert.ok(res !== null); assert.strictEqual(res[1], parts[0].data.toString()); } var normalized = true; for (var i = 0; i < algInfo.parts.length; ++i) { var p = parts[i]; p.name = algInfo.parts[i]; /* * OpenSSH stores ed25519 "private" keys as seed + public key * concat'd together (k followed by A). We want to keep them * separate for other formats that don't do this. */ if (key.type === 'ed25519' && p.name === 'k') p.data = p.data.slice(0, 32); if (p.name !== 'curve' && algInfo.normalize !== false) { var nd; if (key.type === 'ed25519') { nd = utils.zeroPadToLength(p.data, 32); } else { nd = utils.mpNormalize(p.data); } if (nd.toString('binary') !== p.data.toString('binary')) { p.data = nd; normalized = false; } } } if (normalized) key._rfc4253Cache = sshbuf.toBuffer(); if (partial && typeof (partial) === 'object') { partial.remainder = sshbuf.remainder(); partial.consumed = sshbuf._offset; } return (new Constructor(key)); } function write(key, options) { assert.object(key); var alg = keyTypeToAlg(key); var i; var algInfo = algs.info[key.type]; if (PrivateKey.isPrivateKey(key)) algInfo = algs.privInfo[key.type]; var parts = algInfo.parts; var buf = new SSHBuffer({}); buf.writeString(alg); for (i = 0; i < parts.length; ++i) { var data = key.part[parts[i]].data; if (algInfo.normalize !== false) { if (key.type === 'ed25519') data = utils.zeroPadToLength(data, 32); else data = utils.mpNormalize(data); } if (key.type === 'ed25519' && parts[i] === 'k') data = Buffer.concat([data, key.part.A.data]); buf.writeBuffer(data); } return (buf.toBuffer()); } /***/ }), /***/ 3923: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { read: read, readSSHPrivate: readSSHPrivate, write: write }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var crypto = __webpack_require__(76417); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var rfc4253 = __webpack_require__(88688); var SSHBuffer = __webpack_require__(25621); var errors = __webpack_require__(27979); var bcrypt; function read(buf, options) { return (pem.read(buf, options)); } var MAGIC = 'openssh-key-v1'; function readSSHPrivate(type, buf, options) { buf = new SSHBuffer({buffer: buf}); var magic = buf.readCString(); assert.strictEqual(magic, MAGIC, 'bad magic string'); var cipher = buf.readString(); var kdf = buf.readString(); var kdfOpts = buf.readBuffer(); var nkeys = buf.readInt(); if (nkeys !== 1) { throw (new Error('OpenSSH-format key file contains ' + 'multiple keys: this is unsupported.')); } var pubKey = buf.readBuffer(); if (type === 'public') { assert.ok(buf.atEnd(), 'excess bytes left after key'); return (rfc4253.read(pubKey)); } var privKeyBlob = buf.readBuffer(); assert.ok(buf.atEnd(), 'excess bytes left after key'); var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts }); switch (kdf) { case 'none': if (cipher !== 'none') { throw (new Error('OpenSSH-format key uses KDF "none" ' + 'but specifies a cipher other than "none"')); } break; case 'bcrypt': var salt = kdfOptsBuf.readBuffer(); var rounds = kdfOptsBuf.readInt(); var cinf = utils.opensshCipherInfo(cipher); if (bcrypt === undefined) { bcrypt = __webpack_require__(45447); } if (typeof (options.passphrase) === 'string') { options.passphrase = Buffer.from(options.passphrase, 'utf-8'); } if (!Buffer.isBuffer(options.passphrase)) { throw (new errors.KeyEncryptedError( options.filename, 'OpenSSH')); } var pass = new Uint8Array(options.passphrase); var salti = new Uint8Array(salt); /* Use the pbkdf to derive both the key and the IV. */ var out = new Uint8Array(cinf.keySize + cinf.blockSize); var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, rounds); if (res !== 0) { throw (new Error('bcrypt_pbkdf function returned ' + 'failure, parameters invalid')); } out = Buffer.from(out); var ckey = out.slice(0, cinf.keySize); var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); var cipherStream = crypto.createDecipheriv(cinf.opensslName, ckey, iv); cipherStream.setAutoPadding(false); var chunk, chunks = []; cipherStream.once('error', function (e) { if (e.toString().indexOf('bad decrypt') !== -1) { throw (new Error('Incorrect passphrase ' + 'supplied, could not decrypt key')); } throw (e); }); cipherStream.write(privKeyBlob); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); privKeyBlob = Buffer.concat(chunks); break; default: throw (new Error( 'OpenSSH-format key uses unknown KDF "' + kdf + '"')); } buf = new SSHBuffer({buffer: privKeyBlob}); var checkInt1 = buf.readInt(); var checkInt2 = buf.readInt(); if (checkInt1 !== checkInt2) { throw (new Error('Incorrect passphrase supplied, could not ' + 'decrypt key')); } var ret = {}; var key = rfc4253.readInternal(ret, 'private', buf.remainder()); buf.skip(ret.consumed); var comment = buf.readString(); key.comment = comment; return (key); } function write(key, options) { var pubKey; if (PrivateKey.isPrivateKey(key)) pubKey = key.toPublic(); else pubKey = key; var cipher = 'none'; var kdf = 'none'; var kdfopts = Buffer.alloc(0); var cinf = { blockSize: 8 }; var passphrase; if (options !== undefined) { passphrase = options.passphrase; if (typeof (passphrase) === 'string') passphrase = Buffer.from(passphrase, 'utf-8'); if (passphrase !== undefined) { assert.buffer(passphrase, 'options.passphrase'); assert.optionalString(options.cipher, 'options.cipher'); cipher = options.cipher; if (cipher === undefined) cipher = 'aes128-ctr'; cinf = utils.opensshCipherInfo(cipher); kdf = 'bcrypt'; } } var privBuf; if (PrivateKey.isPrivateKey(key)) { privBuf = new SSHBuffer({}); var checkInt = crypto.randomBytes(4).readUInt32BE(0); privBuf.writeInt(checkInt); privBuf.writeInt(checkInt); privBuf.write(key.toBuffer('rfc4253')); privBuf.writeString(key.comment || ''); var n = 1; while (privBuf._offset % cinf.blockSize !== 0) privBuf.writeChar(n++); privBuf = privBuf.toBuffer(); } switch (kdf) { case 'none': break; case 'bcrypt': var salt = crypto.randomBytes(16); var rounds = 16; var kdfssh = new SSHBuffer({}); kdfssh.writeBuffer(salt); kdfssh.writeInt(rounds); kdfopts = kdfssh.toBuffer(); if (bcrypt === undefined) { bcrypt = __webpack_require__(45447); } var pass = new Uint8Array(passphrase); var salti = new Uint8Array(salt); /* Use the pbkdf to derive both the key and the IV. */ var out = new Uint8Array(cinf.keySize + cinf.blockSize); var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, rounds); if (res !== 0) { throw (new Error('bcrypt_pbkdf function returned ' + 'failure, parameters invalid')); } out = Buffer.from(out); var ckey = out.slice(0, cinf.keySize); var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); var cipherStream = crypto.createCipheriv(cinf.opensslName, ckey, iv); cipherStream.setAutoPadding(false); var chunk, chunks = []; cipherStream.once('error', function (e) { throw (e); }); cipherStream.write(privBuf); cipherStream.end(); while ((chunk = cipherStream.read()) !== null) chunks.push(chunk); privBuf = Buffer.concat(chunks); break; default: throw (new Error('Unsupported kdf ' + kdf)); } var buf = new SSHBuffer({}); buf.writeCString(MAGIC); buf.writeString(cipher); /* cipher */ buf.writeString(kdf); /* kdf */ buf.writeBuffer(kdfopts); /* kdfoptions */ buf.writeInt(1); /* nkeys */ buf.writeBuffer(pubKey.toBuffer('rfc4253')); if (privBuf) buf.writeBuffer(privBuf); buf = buf.toBuffer(); var header; if (PrivateKey.isPrivateKey(key)) header = 'OPENSSH PRIVATE KEY'; else header = 'OPENSSH PUBLIC KEY'; var tmp = buf.toString('base64'); var len = tmp.length + (tmp.length / 70) + 18 + 16 + header.length*2 + 10; buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 70; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /***/ 68927: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { read: read, write: write }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var rfc4253 = __webpack_require__(88688); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var sshpriv = __webpack_require__(3923); /*JSSTYLED*/ var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/; /*JSSTYLED*/ var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/; function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var trimmed = buf.trim().replace(/[\\\r]/g, ''); var m = trimmed.match(SSHKEY_RE); if (!m) m = trimmed.match(SSHKEY_RE2); assert.ok(m, 'key must match regex'); var type = rfc4253.algToKeyType(m[1]); var kbuf = Buffer.from(m[2], 'base64'); /* * This is a bit tricky. If we managed to parse the key and locate the * key comment with the regex, then do a non-partial read and assert * that we have consumed all bytes. If we couldn't locate the key * comment, though, there may be whitespace shenanigans going on that * have conjoined the comment to the rest of the key. We do a partial * read in this case to try to make the best out of a sorry situation. */ var key; var ret = {}; if (m[4]) { try { key = rfc4253.read(kbuf); } catch (e) { m = trimmed.match(SSHKEY_RE2); assert.ok(m, 'key must match regex'); kbuf = Buffer.from(m[2], 'base64'); key = rfc4253.readInternal(ret, 'public', kbuf); } } else { key = rfc4253.readInternal(ret, 'public', kbuf); } assert.strictEqual(type, key.type); if (m[4] && m[4].length > 0) { key.comment = m[4]; } else if (ret.consumed) { /* * Now the magic: trying to recover the key comment when it's * gotten conjoined to the key or otherwise shenanigan'd. * * Work out how much base64 we used, then drop all non-base64 * chars from the beginning up to this point in the the string. * Then offset in this and try to make up for missing = chars. */ var data = m[2] + (m[3] ? m[3] : ''); var realOffset = Math.ceil(ret.consumed / 3) * 4; data = data.slice(0, realOffset - 2). /*JSSTYLED*/ replace(/[^a-zA-Z0-9+\/=]/g, '') + data.slice(realOffset - 2); var padding = ret.consumed % 3; if (padding > 0 && data.slice(realOffset - 1, realOffset) !== '=') realOffset--; while (data.slice(realOffset, realOffset + 1) === '=') realOffset++; /* Finally, grab what we think is the comment & clean it up. */ var trailer = data.slice(realOffset); trailer = trailer.replace(/[\r\n]/g, ' '). replace(/^\s+/, ''); if (trailer.match(/^[a-zA-Z0-9]/)) key.comment = trailer; } return (key); } function write(key, options) { assert.object(key); if (!Key.isKey(key)) throw (new Error('Must be a public key')); var parts = []; var alg = rfc4253.keyTypeToAlg(key); parts.push(alg); var buf = rfc4253.write(key); parts.push(buf.toString('base64')); if (key.comment) parts.push(key.comment); return (Buffer.from(parts.join(' '))); } /***/ }), /***/ 30217: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2016 Joyent, Inc. var x509 = __webpack_require__(10267); module.exports = { read: read, verify: x509.verify, sign: x509.sign, write: write }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var Identity = __webpack_require__(70508); var Signature = __webpack_require__(91394); var Certificate = __webpack_require__(7406); function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); } var lines = buf.trim().split(/[\r\n]+/g); var m; var si = -1; while (!m && si < lines.length) { m = lines[++si].match(/*JSSTYLED*/ /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); } assert.ok(m, 'invalid PEM header'); var m2; var ei = lines.length; while (!m2 && ei > 0) { m2 = lines[--ei].match(/*JSSTYLED*/ /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); } assert.ok(m2, 'invalid PEM footer'); lines = lines.slice(si, ei + 1); var headers = {}; while (true) { lines = lines.slice(1); m = lines[0].match(/*JSSTYLED*/ /^([A-Za-z0-9-]+): (.+)$/); if (!m) break; headers[m[1].toLowerCase()] = m[2]; } /* Chop off the first and last lines */ lines = lines.slice(0, -1).join(''); buf = Buffer.from(lines, 'base64'); return (x509.read(buf, options)); } function write(cert, options) { var dbuf = x509.write(cert, options); var header = 'CERTIFICATE'; var tmp = dbuf.toString('base64'); var len = tmp.length + (tmp.length / 64) + 18 + 16 + header.length*2 + 10; var buf = Buffer.alloc(len); var o = 0; o += buf.write('-----BEGIN ' + header + '-----\n', o); for (var i = 0; i < tmp.length; ) { var limit = i + 64; if (limit > tmp.length) limit = tmp.length; o += buf.write(tmp.slice(i, limit), o); buf[o++] = 10; i = limit; } o += buf.write('-----END ' + header + '-----\n', o); return (buf.slice(0, o)); } /***/ }), /***/ 10267: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = { read: read, verify: verify, sign: sign, signAsync: signAsync, write: write }; var assert = __webpack_require__(66631); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var utils = __webpack_require__(80575); var Key = __webpack_require__(36814); var PrivateKey = __webpack_require__(29602); var pem = __webpack_require__(14324); var Identity = __webpack_require__(70508); var Signature = __webpack_require__(91394); var Certificate = __webpack_require__(7406); var pkcs8 = __webpack_require__(4173); /* * This file is based on RFC5280 (X.509). */ /* Helper to read in a single mpint */ function readMPInt(der, nm) { assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + ' is not an Integer'); return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); } function verify(cert, key) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); var algParts = sig.algo.split('-'); if (algParts[0] !== key.type) return (false); var blob = sig.cache; if (blob === undefined) { var der = new asn1.BerWriter(); writeTBSCert(cert, der); blob = der.buffer; } var verifier = key.createVerify(algParts[1]); verifier.write(blob); return (verifier.verify(sig.signature)); } function Local(i) { return (asn1.Ber.Context | asn1.Ber.Constructor | i); } function Context(i) { return (asn1.Ber.Context | i); } var SIGN_ALGS = { 'rsa-md5': '1.2.840.113549.1.1.4', 'rsa-sha1': '1.2.840.113549.1.1.5', 'rsa-sha256': '1.2.840.113549.1.1.11', 'rsa-sha384': '1.2.840.113549.1.1.12', 'rsa-sha512': '1.2.840.113549.1.1.13', 'dsa-sha1': '1.2.840.10040.4.3', 'dsa-sha256': '2.16.840.1.101.3.4.3.2', 'ecdsa-sha1': '1.2.840.10045.4.1', 'ecdsa-sha256': '1.2.840.10045.4.3.2', 'ecdsa-sha384': '1.2.840.10045.4.3.3', 'ecdsa-sha512': '1.2.840.10045.4.3.4', 'ed25519-sha512': '1.3.101.112' }; Object.keys(SIGN_ALGS).forEach(function (k) { SIGN_ALGS[SIGN_ALGS[k]] = k; }); SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5'; SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1'; var EXTS = { 'issuerKeyId': '2.5.29.35', 'altName': '2.5.29.17', 'basicConstraints': '2.5.29.19', 'keyUsage': '2.5.29.15', 'extKeyUsage': '2.5.29.37' }; function read(buf, options) { if (typeof (buf) === 'string') { buf = Buffer.from(buf, 'binary'); } assert.buffer(buf, 'buf'); var der = new asn1.BerReader(buf); der.readSequence(); if (Math.abs(der.length - der.remain) > 1) { throw (new Error('DER sequence does not contain whole byte ' + 'stream')); } var tbsStart = der.offset; der.readSequence(); var sigOffset = der.offset + der.length; var tbsEnd = sigOffset; if (der.peek() === Local(0)) { der.readSequence(Local(0)); var version = der.readInt(); assert.ok(version <= 3, 'only x.509 versions up to v3 supported'); } var cert = {}; cert.signatures = {}; var sig = (cert.signatures.x509 = {}); sig.extras = {}; cert.serial = readMPInt(der, 'serial'); der.readSequence(); var after = der.offset + der.length; var certAlgOid = der.readOID(); var certAlg = SIGN_ALGS[certAlgOid]; if (certAlg === undefined) throw (new Error('unknown signature algorithm ' + certAlgOid)); der._offset = after; cert.issuer = Identity.parseAsn1(der); der.readSequence(); cert.validFrom = readDate(der); cert.validUntil = readDate(der); cert.subjects = [Identity.parseAsn1(der)]; der.readSequence(); after = der.offset + der.length; cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der); der._offset = after; /* issuerUniqueID */ if (der.peek() === Local(1)) { der.readSequence(Local(1)); sig.extras.issuerUniqueID = buf.slice(der.offset, der.offset + der.length); der._offset += der.length; } /* subjectUniqueID */ if (der.peek() === Local(2)) { der.readSequence(Local(2)); sig.extras.subjectUniqueID = buf.slice(der.offset, der.offset + der.length); der._offset += der.length; } /* extensions */ if (der.peek() === Local(3)) { der.readSequence(Local(3)); var extEnd = der.offset + der.length; der.readSequence(); while (der.offset < extEnd) readExtension(cert, buf, der); assert.strictEqual(der.offset, extEnd); } assert.strictEqual(der.offset, sigOffset); der.readSequence(); after = der.offset + der.length; var sigAlgOid = der.readOID(); var sigAlg = SIGN_ALGS[sigAlgOid]; if (sigAlg === undefined) throw (new Error('unknown signature algorithm ' + sigAlgOid)); der._offset = after; var sigData = der.readString(asn1.Ber.BitString, true); if (sigData[0] === 0) sigData = sigData.slice(1); var algParts = sigAlg.split('-'); sig.signature = Signature.parse(sigData, algParts[0], 'asn1'); sig.signature.hashAlgorithm = algParts[1]; sig.algo = sigAlg; sig.cache = buf.slice(tbsStart, tbsEnd); return (new Certificate(cert)); } function readDate(der) { if (der.peek() === asn1.Ber.UTCTime) { return (utcTimeToDate(der.readString(asn1.Ber.UTCTime))); } else if (der.peek() === asn1.Ber.GeneralizedTime) { return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime))); } else { throw (new Error('Unsupported date format')); } } function writeDate(der, date) { if (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) { der.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime); } else { der.writeString(dateToUTCTime(date), asn1.Ber.UTCTime); } } /* RFC5280, section 4.2.1.6 (GeneralName type) */ var ALTNAME = { OtherName: Local(0), RFC822Name: Context(1), DNSName: Context(2), X400Address: Local(3), DirectoryName: Local(4), EDIPartyName: Local(5), URI: Context(6), IPAddress: Context(7), OID: Context(8) }; /* RFC5280, section 4.2.1.12 (KeyPurposeId) */ var EXTPURPOSE = { 'serverAuth': '1.3.6.1.5.5.7.3.1', 'clientAuth': '1.3.6.1.5.5.7.3.2', 'codeSigning': '1.3.6.1.5.5.7.3.3', /* See https://github.com/joyent/oid-docs/blob/master/root.md */ 'joyentDocker': '1.3.6.1.4.1.38678.1.4.1', 'joyentCmon': '1.3.6.1.4.1.38678.1.4.2' }; var EXTPURPOSE_REV = {}; Object.keys(EXTPURPOSE).forEach(function (k) { EXTPURPOSE_REV[EXTPURPOSE[k]] = k; }); var KEYUSEBITS = [ 'signature', 'identity', 'keyEncryption', 'encryption', 'keyAgreement', 'ca', 'crl' ]; function readExtension(cert, buf, der) { der.readSequence(); var after = der.offset + der.length; var extId = der.readOID(); var id; var sig = cert.signatures.x509; if (!sig.extras.exts) sig.extras.exts = []; var critical; if (der.peek() === asn1.Ber.Boolean) critical = der.readBoolean(); switch (extId) { case (EXTS.basicConstraints): der.readSequence(asn1.Ber.OctetString); der.readSequence(); var bcEnd = der.offset + der.length; var ca = false; if (der.peek() === asn1.Ber.Boolean) ca = der.readBoolean(); if (cert.purposes === undefined) cert.purposes = []; if (ca === true) cert.purposes.push('ca'); var bc = { oid: extId, critical: critical }; if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer) bc.pathLen = der.readInt(); sig.extras.exts.push(bc); break; case (EXTS.extKeyUsage): der.readSequence(asn1.Ber.OctetString); der.readSequence(); if (cert.purposes === undefined) cert.purposes = []; var ekEnd = der.offset + der.length; while (der.offset < ekEnd) { var oid = der.readOID(); cert.purposes.push(EXTPURPOSE_REV[oid] || oid); } /* * This is a bit of a hack: in the case where we have a cert * that's only allowed to do serverAuth or clientAuth (and not * the other), we want to make sure all our Subjects are of * the right type. But we already parsed our Subjects and * decided if they were hosts or users earlier (since it appears * first in the cert). * * So we go through and mutate them into the right kind here if * it doesn't match. This might not be hugely beneficial, as it * seems that single-purpose certs are not often seen in the * wild. */ if (cert.purposes.indexOf('serverAuth') !== -1 && cert.purposes.indexOf('clientAuth') === -1) { cert.subjects.forEach(function (ide) { if (ide.type !== 'host') { ide.type = 'host'; ide.hostname = ide.uid || ide.email || ide.components[0].value; } }); } else if (cert.purposes.indexOf('clientAuth') !== -1 && cert.purposes.indexOf('serverAuth') === -1) { cert.subjects.forEach(function (ide) { if (ide.type !== 'user') { ide.type = 'user'; ide.uid = ide.hostname || ide.email || ide.components[0].value; } }); } sig.extras.exts.push({ oid: extId, critical: critical }); break; case (EXTS.keyUsage): der.readSequence(asn1.Ber.OctetString); var bits = der.readString(asn1.Ber.BitString, true); var setBits = readBitField(bits, KEYUSEBITS); setBits.forEach(function (bit) { if (cert.purposes === undefined) cert.purposes = []; if (cert.purposes.indexOf(bit) === -1) cert.purposes.push(bit); }); sig.extras.exts.push({ oid: extId, critical: critical, bits: bits }); break; case (EXTS.altName): der.readSequence(asn1.Ber.OctetString); der.readSequence(); var aeEnd = der.offset + der.length; while (der.offset < aeEnd) { switch (der.peek()) { case ALTNAME.OtherName: case ALTNAME.EDIPartyName: der.readSequence(); der._offset += der.length; break; case ALTNAME.OID: der.readOID(ALTNAME.OID); break; case ALTNAME.RFC822Name: /* RFC822 specifies email addresses */ var email = der.readString(ALTNAME.RFC822Name); id = Identity.forEmail(email); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; case ALTNAME.DirectoryName: der.readSequence(ALTNAME.DirectoryName); id = Identity.parseAsn1(der); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; case ALTNAME.DNSName: var host = der.readString( ALTNAME.DNSName); id = Identity.forHost(host); if (!cert.subjects[0].equals(id)) cert.subjects.push(id); break; default: der.readString(der.peek()); break; } } sig.extras.exts.push({ oid: extId, critical: critical }); break; default: sig.extras.exts.push({ oid: extId, critical: critical, data: der.readString(asn1.Ber.OctetString, true) }); break; } der._offset = after; } var UTCTIME_RE = /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; function utcTimeToDate(t) { var m = t.match(UTCTIME_RE); assert.ok(m, 'timestamps must be in UTC'); var d = new Date(); var thisYear = d.getUTCFullYear(); var century = Math.floor(thisYear / 100) * 100; var year = parseInt(m[1], 10); if (thisYear % 100 < 50 && year >= 60) year += (century - 1); else year += century; d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)); d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); if (m[6] && m[6].length > 0) d.setUTCSeconds(parseInt(m[6], 10)); return (d); } var GTIME_RE = /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; function gTimeToDate(t) { var m = t.match(GTIME_RE); assert.ok(m); var d = new Date(); d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, parseInt(m[3], 10)); d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); if (m[6] && m[6].length > 0) d.setUTCSeconds(parseInt(m[6], 10)); return (d); } function zeroPad(n, m) { if (m === undefined) m = 2; var s = '' + n; while (s.length < m) s = '0' + s; return (s); } function dateToUTCTime(d) { var s = ''; s += zeroPad(d.getUTCFullYear() % 100); s += zeroPad(d.getUTCMonth() + 1); s += zeroPad(d.getUTCDate()); s += zeroPad(d.getUTCHours()); s += zeroPad(d.getUTCMinutes()); s += zeroPad(d.getUTCSeconds()); s += 'Z'; return (s); } function dateToGTime(d) { var s = ''; s += zeroPad(d.getUTCFullYear(), 4); s += zeroPad(d.getUTCMonth() + 1); s += zeroPad(d.getUTCDate()); s += zeroPad(d.getUTCHours()); s += zeroPad(d.getUTCMinutes()); s += zeroPad(d.getUTCSeconds()); s += 'Z'; return (s); } function sign(cert, key) { if (cert.signatures.x509 === undefined) cert.signatures.x509 = {}; var sig = cert.signatures.x509; sig.algo = key.type + '-' + key.defaultHashAlgorithm(); if (SIGN_ALGS[sig.algo] === undefined) return (false); var der = new asn1.BerWriter(); writeTBSCert(cert, der); var blob = der.buffer; sig.cache = blob; var signer = key.createSign(); signer.write(blob); cert.signatures.x509.signature = signer.sign(); return (true); } function signAsync(cert, signer, done) { if (cert.signatures.x509 === undefined) cert.signatures.x509 = {}; var sig = cert.signatures.x509; var der = new asn1.BerWriter(); writeTBSCert(cert, der); var blob = der.buffer; sig.cache = blob; signer(blob, function (err, signature) { if (err) { done(err); return; } sig.algo = signature.type + '-' + signature.hashAlgorithm; if (SIGN_ALGS[sig.algo] === undefined) { done(new Error('Invalid signing algorithm "' + sig.algo + '"')); return; } sig.signature = signature; done(); }); } function write(cert, options) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); var der = new asn1.BerWriter(); der.startSequence(); if (sig.cache) { der._ensure(sig.cache.length); sig.cache.copy(der._buf, der._offset); der._offset += sig.cache.length; } else { writeTBSCert(cert, der); } der.startSequence(); der.writeOID(SIGN_ALGS[sig.algo]); if (sig.algo.match(/^rsa-/)) der.writeNull(); der.endSequence(); var sigData = sig.signature.toBuffer('asn1'); var data = Buffer.alloc(sigData.length + 1); data[0] = 0; sigData.copy(data, 1); der.writeBuffer(data, asn1.Ber.BitString); der.endSequence(); return (der.buffer); } function writeTBSCert(cert, der) { var sig = cert.signatures.x509; assert.object(sig, 'x509 signature'); der.startSequence(); der.startSequence(Local(0)); der.writeInt(2); der.endSequence(); der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer); der.startSequence(); der.writeOID(SIGN_ALGS[sig.algo]); if (sig.algo.match(/^rsa-/)) der.writeNull(); der.endSequence(); cert.issuer.toAsn1(der); der.startSequence(); writeDate(der, cert.validFrom); writeDate(der, cert.validUntil); der.endSequence(); var subject = cert.subjects[0]; var altNames = cert.subjects.slice(1); subject.toAsn1(der); pkcs8.writePkcs8(der, cert.subjectKey); if (sig.extras && sig.extras.issuerUniqueID) { der.writeBuffer(sig.extras.issuerUniqueID, Local(1)); } if (sig.extras && sig.extras.subjectUniqueID) { der.writeBuffer(sig.extras.subjectUniqueID, Local(2)); } if (altNames.length > 0 || subject.type === 'host' || (cert.purposes !== undefined && cert.purposes.length > 0) || (sig.extras && sig.extras.exts)) { der.startSequence(Local(3)); der.startSequence(); var exts = []; if (cert.purposes !== undefined && cert.purposes.length > 0) { exts.push({ oid: EXTS.basicConstraints, critical: true }); exts.push({ oid: EXTS.keyUsage, critical: true }); exts.push({ oid: EXTS.extKeyUsage, critical: true }); } exts.push({ oid: EXTS.altName }); if (sig.extras && sig.extras.exts) exts = sig.extras.exts; for (var i = 0; i < exts.length; ++i) { der.startSequence(); der.writeOID(exts[i].oid); if (exts[i].critical !== undefined) der.writeBoolean(exts[i].critical); if (exts[i].oid === EXTS.altName) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); if (subject.type === 'host') { der.writeString(subject.hostname, Context(2)); } for (var j = 0; j < altNames.length; ++j) { if (altNames[j].type === 'host') { der.writeString( altNames[j].hostname, ALTNAME.DNSName); } else if (altNames[j].type === 'email') { der.writeString( altNames[j].email, ALTNAME.RFC822Name); } else { /* * Encode anything else as a * DN style name for now. */ der.startSequence( ALTNAME.DirectoryName); altNames[j].toAsn1(der); der.endSequence(); } } der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.basicConstraints) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); var ca = (cert.purposes.indexOf('ca') !== -1); var pathLen = exts[i].pathLen; der.writeBoolean(ca); if (pathLen !== undefined) der.writeInt(pathLen); der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.extKeyUsage) { der.startSequence(asn1.Ber.OctetString); der.startSequence(); cert.purposes.forEach(function (purpose) { if (purpose === 'ca') return; if (KEYUSEBITS.indexOf(purpose) !== -1) return; var oid = purpose; if (EXTPURPOSE[purpose] !== undefined) oid = EXTPURPOSE[purpose]; der.writeOID(oid); }); der.endSequence(); der.endSequence(); } else if (exts[i].oid === EXTS.keyUsage) { der.startSequence(asn1.Ber.OctetString); /* * If we parsed this certificate from a byte * stream (i.e. we didn't generate it in sshpk) * then we'll have a ".bits" property on the * ext with the original raw byte contents. * * If we have this, use it here instead of * regenerating it. This guarantees we output * the same data we parsed, so signatures still * validate. */ if (exts[i].bits !== undefined) { der.writeBuffer(exts[i].bits, asn1.Ber.BitString); } else { var bits = writeBitField(cert.purposes, KEYUSEBITS); der.writeBuffer(bits, asn1.Ber.BitString); } der.endSequence(); } else { der.writeBuffer(exts[i].data, asn1.Ber.OctetString); } der.endSequence(); } der.endSequence(); der.endSequence(); } der.endSequence(); } /* * Reads an ASN.1 BER bitfield out of the Buffer produced by doing * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw * contents of the BitString tag, which is a count of unused bits followed by * the bits as a right-padded byte string. * * `bits` is the Buffer, `bitIndex` should contain an array of string names * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec. * * Returns an array of Strings, the names of the bits that were set to 1. */ function readBitField(bits, bitIndex) { var bitLen = 8 * (bits.length - 1) - bits[0]; var setBits = {}; for (var i = 0; i < bitLen; ++i) { var byteN = 1 + Math.floor(i / 8); var bit = 7 - (i % 8); var mask = 1 << bit; var bitVal = ((bits[byteN] & mask) !== 0); var name = bitIndex[i]; if (bitVal && typeof (name) === 'string') { setBits[name] = true; } } return (Object.keys(setBits)); } /* * `setBits` is an array of strings, containing the names for each bit that * sould be set to 1. `bitIndex` is same as in `readBitField()`. * * Returns a Buffer, ready to be written out with `BerWriter#writeString()`. */ function writeBitField(setBits, bitIndex) { var bitLen = bitIndex.length; var blen = Math.ceil(bitLen / 8); var unused = blen * 8 - bitLen; var bits = Buffer.alloc(1 + blen); // zero-filled bits[0] = unused; for (var i = 0; i < bitLen; ++i) { var byteN = 1 + Math.floor(i / 8); var bit = 7 - (i % 8); var mask = 1 << bit; var name = bitIndex[i]; if (name === undefined) continue; var bitVal = (setBits.indexOf(name) !== -1); if (bitVal) { bits[byteN] |= mask; } } return (bits); } /***/ }), /***/ 70508: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = Identity; var assert = __webpack_require__(66631); var algs = __webpack_require__(66126); var crypto = __webpack_require__(76417); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var errs = __webpack_require__(27979); var util = __webpack_require__(31669); var utils = __webpack_require__(80575); var asn1 = __webpack_require__(80970); var Buffer = __webpack_require__(15118).Buffer; /*JSSTYLED*/ var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; var oids = {}; oids.cn = '2.5.4.3'; oids.o = '2.5.4.10'; oids.ou = '2.5.4.11'; oids.l = '2.5.4.7'; oids.s = '2.5.4.8'; oids.c = '2.5.4.6'; oids.sn = '2.5.4.4'; oids.postalCode = '2.5.4.17'; oids.serialNumber = '2.5.4.5'; oids.street = '2.5.4.9'; oids.x500UniqueIdentifier = '2.5.4.45'; oids.role = '2.5.4.72'; oids.telephoneNumber = '2.5.4.20'; oids.description = '2.5.4.13'; oids.dc = '0.9.2342.19200300.100.1.25'; oids.uid = '0.9.2342.19200300.100.1.1'; oids.mail = '0.9.2342.19200300.100.1.3'; oids.title = '2.5.4.12'; oids.gn = '2.5.4.42'; oids.initials = '2.5.4.43'; oids.pseudonym = '2.5.4.65'; oids.emailAddress = '1.2.840.113549.1.9.1'; var unoids = {}; Object.keys(oids).forEach(function (k) { unoids[oids[k]] = k; }); function Identity(opts) { var self = this; assert.object(opts, 'options'); assert.arrayOfObject(opts.components, 'options.components'); this.components = opts.components; this.componentLookup = {}; this.components.forEach(function (c) { if (c.name && !c.oid) c.oid = oids[c.name]; if (c.oid && !c.name) c.name = unoids[c.oid]; if (self.componentLookup[c.name] === undefined) self.componentLookup[c.name] = []; self.componentLookup[c.name].push(c); }); if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { this.cn = this.componentLookup.cn[0].value; } assert.optionalString(opts.type, 'options.type'); if (opts.type === undefined) { if (this.components.length === 1 && this.componentLookup.cn && this.componentLookup.cn.length === 1 && this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { this.type = 'host'; this.hostname = this.componentLookup.cn[0].value; } else if (this.componentLookup.dc && this.components.length === this.componentLookup.dc.length) { this.type = 'host'; this.hostname = this.componentLookup.dc.map( function (c) { return (c.value); }).join('.'); } else if (this.componentLookup.uid && this.components.length === this.componentLookup.uid.length) { this.type = 'user'; this.uid = this.componentLookup.uid[0].value; } else if (this.componentLookup.cn && this.componentLookup.cn.length === 1 && this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { this.type = 'host'; this.hostname = this.componentLookup.cn[0].value; } else if (this.componentLookup.uid && this.componentLookup.uid.length === 1) { this.type = 'user'; this.uid = this.componentLookup.uid[0].value; } else if (this.componentLookup.mail && this.componentLookup.mail.length === 1) { this.type = 'email'; this.email = this.componentLookup.mail[0].value; } else if (this.componentLookup.cn && this.componentLookup.cn.length === 1) { this.type = 'user'; this.uid = this.componentLookup.cn[0].value; } else { this.type = 'unknown'; } } else { this.type = opts.type; if (this.type === 'host') this.hostname = opts.hostname; else if (this.type === 'user') this.uid = opts.uid; else if (this.type === 'email') this.email = opts.email; else throw (new Error('Unknown type ' + this.type)); } } Identity.prototype.toString = function () { return (this.components.map(function (c) { var n = c.name.toUpperCase(); /*JSSTYLED*/ n = n.replace(/=/g, '\\='); var v = c.value; /*JSSTYLED*/ v = v.replace(/,/g, '\\,'); return (n + '=' + v); }).join(', ')); }; Identity.prototype.get = function (name, asArray) { assert.string(name, 'name'); var arr = this.componentLookup[name]; if (arr === undefined || arr.length === 0) return (undefined); if (!asArray && arr.length > 1) throw (new Error('Multiple values for attribute ' + name)); if (!asArray) return (arr[0].value); return (arr.map(function (c) { return (c.value); })); }; Identity.prototype.toArray = function (idx) { return (this.components.map(function (c) { return ({ name: c.name, value: c.value }); })); }; /* * These are from X.680 -- PrintableString allowed chars are in section 37.4 * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006 * (the basic ASCII character set). */ /* JSSTYLED */ var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/; /* JSSTYLED */ var NOT_IA5 = /[^\x00-\x7f]/; Identity.prototype.toAsn1 = function (der, tag) { der.startSequence(tag); this.components.forEach(function (c) { der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); der.startSequence(); der.writeOID(c.oid); /* * If we fit in a PrintableString, use that. Otherwise use an * IA5String or UTF8String. * * If this identity was parsed from a DN, use the ASN.1 types * from the original representation (otherwise this might not * be a full match for the original in some validators). */ if (c.asn1type === asn1.Ber.Utf8String || c.value.match(NOT_IA5)) { var v = Buffer.from(c.value, 'utf8'); der.writeBuffer(v, asn1.Ber.Utf8String); } else if (c.asn1type === asn1.Ber.IA5String || c.value.match(NOT_PRINTABLE)) { der.writeString(c.value, asn1.Ber.IA5String); } else { var type = asn1.Ber.PrintableString; if (c.asn1type !== undefined) type = c.asn1type; der.writeString(c.value, type); } der.endSequence(); der.endSequence(); }); der.endSequence(); }; function globMatch(a, b) { if (a === '**' || b === '**') return (true); var aParts = a.split('.'); var bParts = b.split('.'); if (aParts.length !== bParts.length) return (false); for (var i = 0; i < aParts.length; ++i) { if (aParts[i] === '*' || bParts[i] === '*') continue; if (aParts[i] !== bParts[i]) return (false); } return (true); } Identity.prototype.equals = function (other) { if (!Identity.isIdentity(other, [1, 0])) return (false); if (other.components.length !== this.components.length) return (false); for (var i = 0; i < this.components.length; ++i) { if (this.components[i].oid !== other.components[i].oid) return (false); if (!globMatch(this.components[i].value, other.components[i].value)) { return (false); } } return (true); }; Identity.forHost = function (hostname) { assert.string(hostname, 'hostname'); return (new Identity({ type: 'host', hostname: hostname, components: [ { name: 'cn', value: hostname } ] })); }; Identity.forUser = function (uid) { assert.string(uid, 'uid'); return (new Identity({ type: 'user', uid: uid, components: [ { name: 'uid', value: uid } ] })); }; Identity.forEmail = function (email) { assert.string(email, 'email'); return (new Identity({ type: 'email', email: email, components: [ { name: 'mail', value: email } ] })); }; Identity.parseDN = function (dn) { assert.string(dn, 'dn'); var parts = ['']; var idx = 0; var rem = dn; while (rem.length > 0) { var m; /*JSSTYLED*/ if ((m = /^,/.exec(rem)) !== null) { parts[++idx] = ''; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^\\,/.exec(rem)) !== null) { parts[idx] += ','; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^\\./.exec(rem)) !== null) { parts[idx] += m[0]; rem = rem.slice(m[0].length); /*JSSTYLED*/ } else if ((m = /^[^\\,]+/.exec(rem)) !== null) { parts[idx] += m[0]; rem = rem.slice(m[0].length); } else { throw (new Error('Failed to parse DN')); } } var cmps = parts.map(function (c) { c = c.trim(); var eqPos = c.indexOf('='); while (eqPos > 0 && c.charAt(eqPos - 1) === '\\') eqPos = c.indexOf('=', eqPos + 1); if (eqPos === -1) { throw (new Error('Failed to parse DN')); } /*JSSTYLED*/ var name = c.slice(0, eqPos).toLowerCase().replace(/\\=/g, '='); var value = c.slice(eqPos + 1); return ({ name: name, value: value }); }); return (new Identity({ components: cmps })); }; Identity.fromArray = function (components) { assert.arrayOfObject(components, 'components'); components.forEach(function (cmp) { assert.object(cmp, 'component'); assert.string(cmp.name, 'component.name'); if (!Buffer.isBuffer(cmp.value) && !(typeof (cmp.value) === 'string')) { throw (new Error('Invalid component value')); } }); return (new Identity({ components: components })); }; Identity.parseAsn1 = function (der, top) { var components = []; der.readSequence(top); var end = der.offset + der.length; while (der.offset < end) { der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); var after = der.offset + der.length; der.readSequence(); var oid = der.readOID(); var type = der.peek(); var value; switch (type) { case asn1.Ber.PrintableString: case asn1.Ber.IA5String: case asn1.Ber.OctetString: case asn1.Ber.T61String: value = der.readString(type); break; case asn1.Ber.Utf8String: value = der.readString(type, true); value = value.toString('utf8'); break; case asn1.Ber.CharacterString: case asn1.Ber.BMPString: value = der.readString(type, true); value = value.toString('utf16le'); break; default: throw (new Error('Unknown asn1 type ' + type)); } components.push({ oid: oid, asn1type: type, value: value }); der._offset = after; } der._offset = end; return (new Identity({ components: components })); }; Identity.isIdentity = function (obj, ver) { return (utils.isCompatible(obj, Identity, ver)); }; /* * API versions for Identity: * [1,0] -- initial ver */ Identity.prototype._sshpkApiVersion = [1, 0]; Identity._oldVersionDetect = function (obj) { return ([1, 0]); }; /***/ }), /***/ 87022: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. var Key = __webpack_require__(36814); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var PrivateKey = __webpack_require__(29602); var Certificate = __webpack_require__(7406); var Identity = __webpack_require__(70508); var errs = __webpack_require__(27979); module.exports = { /* top-level classes */ Key: Key, parseKey: Key.parse, Fingerprint: Fingerprint, parseFingerprint: Fingerprint.parse, Signature: Signature, parseSignature: Signature.parse, PrivateKey: PrivateKey, parsePrivateKey: PrivateKey.parse, generatePrivateKey: PrivateKey.generate, Certificate: Certificate, parseCertificate: Certificate.parse, createSelfSignedCertificate: Certificate.createSelfSigned, createCertificate: Certificate.create, Identity: Identity, identityFromDN: Identity.parseDN, identityForHost: Identity.forHost, identityForUser: Identity.forUser, identityForEmail: Identity.forEmail, identityFromArray: Identity.fromArray, /* errors */ FingerprintFormatError: errs.FingerprintFormatError, InvalidAlgorithmError: errs.InvalidAlgorithmError, KeyParseError: errs.KeyParseError, SignatureParseError: errs.SignatureParseError, KeyEncryptedError: errs.KeyEncryptedError, CertificateParseError: errs.CertificateParseError }; /***/ }), /***/ 36814: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2018 Joyent, Inc. module.exports = Key; var assert = __webpack_require__(66631); var algs = __webpack_require__(66126); var crypto = __webpack_require__(76417); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var DiffieHellman = __webpack_require__(57602).DiffieHellman; var errs = __webpack_require__(27979); var utils = __webpack_require__(80575); var PrivateKey = __webpack_require__(29602); var edCompat; try { edCompat = __webpack_require__(14694); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var formats = {}; formats['auto'] = __webpack_require__(8243); formats['pem'] = __webpack_require__(14324); formats['pkcs1'] = __webpack_require__(69367); formats['pkcs8'] = __webpack_require__(4173); formats['rfc4253'] = __webpack_require__(88688); formats['ssh'] = __webpack_require__(68927); formats['ssh-private'] = __webpack_require__(3923); formats['openssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(63561); formats['putty'] = __webpack_require__(80974); formats['ppk'] = formats['putty']; function Key(opts) { assert.object(opts, 'options'); assert.arrayOfObject(opts.parts, 'options.parts'); assert.string(opts.type, 'options.type'); assert.optionalString(opts.comment, 'options.comment'); var algInfo = algs.info[opts.type]; if (typeof (algInfo) !== 'object') throw (new InvalidAlgorithmError(opts.type)); var partLookup = {}; for (var i = 0; i < opts.parts.length; ++i) { var part = opts.parts[i]; partLookup[part.name] = part; } this.type = opts.type; this.parts = opts.parts; this.part = partLookup; this.comment = undefined; this.source = opts.source; /* for speeding up hashing/fingerprint operations */ this._rfc4253Cache = opts._rfc4253Cache; this._hashCache = {}; var sz; this.curve = undefined; if (this.type === 'ecdsa') { var curve = this.part.curve.data.toString(); this.curve = curve; sz = algs.curves[curve].size; } else if (this.type === 'ed25519' || this.type === 'curve25519') { sz = 256; this.curve = 'curve25519'; } else { var szPart = this.part[algInfo.sizePart]; sz = szPart.data.length; sz = sz * 8 - utils.countZeros(szPart.data); } this.size = sz; } Key.formats = formats; Key.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'ssh'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); if (format === 'rfc4253') { if (this._rfc4253Cache === undefined) this._rfc4253Cache = formats['rfc4253'].write(this); return (this._rfc4253Cache); } return (formats[format].write(this, options)); }; Key.prototype.toString = function (format, options) { return (this.toBuffer(format, options).toString()); }; Key.prototype.hash = function (algo, type) { assert.string(algo, 'algorithm'); assert.optionalString(type, 'type'); if (type === undefined) type = 'ssh'; algo = algo.toLowerCase(); if (algs.hashAlgs[algo] === undefined) throw (new InvalidAlgorithmError(algo)); var cacheKey = algo + '||' + type; if (this._hashCache[cacheKey]) return (this._hashCache[cacheKey]); var buf; if (type === 'ssh') { buf = this.toBuffer('rfc4253'); } else if (type === 'spki') { buf = formats.pkcs8.pkcs8ToBuffer(this); } else { throw (new Error('Hash type ' + type + ' not supported')); } var hash = crypto.createHash(algo).update(buf).digest(); this._hashCache[cacheKey] = hash; return (hash); }; Key.prototype.fingerprint = function (algo, type) { if (algo === undefined) algo = 'sha256'; if (type === undefined) type = 'ssh'; assert.string(algo, 'algorithm'); assert.string(type, 'type'); var opts = { type: 'key', hash: this.hash(algo, type), algorithm: algo, hashType: type }; return (new Fingerprint(opts)); }; Key.prototype.defaultHashAlgorithm = function () { var hashAlgo = 'sha1'; if (this.type === 'rsa') hashAlgo = 'sha256'; if (this.type === 'dsa' && this.size > 1024) hashAlgo = 'sha256'; if (this.type === 'ed25519') hashAlgo = 'sha512'; if (this.type === 'ecdsa') { if (this.size <= 256) hashAlgo = 'sha256'; else if (this.size <= 384) hashAlgo = 'sha384'; else hashAlgo = 'sha512'; } return (hashAlgo); }; Key.prototype.createVerify = function (hashAlgo) { if (hashAlgo === undefined) hashAlgo = this.defaultHashAlgorithm(); assert.string(hashAlgo, 'hash algorithm'); /* ED25519 is not supported by OpenSSL, use a javascript impl. */ if (this.type === 'ed25519' && edCompat !== undefined) return (new edCompat.Verifier(this, hashAlgo)); if (this.type === 'curve25519') throw (new Error('Curve25519 keys are not suitable for ' + 'signing or verification')); var v, nm, err; try { nm = hashAlgo.toUpperCase(); v = crypto.createVerify(nm); } catch (e) { err = e; } if (v === undefined || (err instanceof Error && err.message.match(/Unknown message digest/))) { nm = 'RSA-'; nm += hashAlgo.toUpperCase(); v = crypto.createVerify(nm); } assert.ok(v, 'failed to create verifier'); var oldVerify = v.verify.bind(v); var key = this.toBuffer('pkcs8'); var curve = this.curve; var self = this; v.verify = function (signature, fmt) { if (Signature.isSignature(signature, [2, 0])) { if (signature.type !== self.type) return (false); if (signature.hashAlgorithm && signature.hashAlgorithm !== hashAlgo) return (false); if (signature.curve && self.type === 'ecdsa' && signature.curve !== curve) return (false); return (oldVerify(key, signature.toBuffer('asn1'))); } else if (typeof (signature) === 'string' || Buffer.isBuffer(signature)) { return (oldVerify(key, signature, fmt)); /* * Avoid doing this on valid arguments, walking the prototype * chain can be quite slow. */ } else if (Signature.isSignature(signature, [1, 0])) { throw (new Error('signature was created by too old ' + 'a version of sshpk and cannot be verified')); } else { throw (new TypeError('signature must be a string, ' + 'Buffer, or Signature object')); } }; return (v); }; Key.prototype.createDiffieHellman = function () { if (this.type === 'rsa') throw (new Error('RSA keys do not support Diffie-Hellman')); return (new DiffieHellman(this)); }; Key.prototype.createDH = Key.prototype.createDiffieHellman; Key.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); if (k instanceof PrivateKey) k = k.toPublic(); if (!k.comment) k.comment = options.filename; return (k); } catch (e) { if (e.name === 'KeyEncryptedError') throw (e); throw (new KeyParseError(options.filename, format, e)); } }; Key.isKey = function (obj, ver) { return (utils.isCompatible(obj, Key, ver)); }; /* * API versions for Key: * [1,0] -- initial ver, may take Signature for createVerify or may not * [1,1] -- added pkcs1, pkcs8 formats * [1,2] -- added auto, ssh-private, openssh formats * [1,3] -- added defaultHashAlgorithm * [1,4] -- added ed support, createDH * [1,5] -- first explicitly tagged version * [1,6] -- changed ed25519 part names * [1,7] -- spki hash types */ Key.prototype._sshpkApiVersion = [1, 7]; Key._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); assert.func(obj.fingerprint); if (obj.createDH) return ([1, 4]); if (obj.defaultHashAlgorithm) return ([1, 3]); if (obj.formats['auto']) return ([1, 2]); if (obj.formats['pkcs1']) return ([1, 1]); return ([1, 0]); }; /***/ }), /***/ 29602: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2017 Joyent, Inc. module.exports = PrivateKey; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var crypto = __webpack_require__(76417); var Fingerprint = __webpack_require__(13079); var Signature = __webpack_require__(91394); var errs = __webpack_require__(27979); var util = __webpack_require__(31669); var utils = __webpack_require__(80575); var dhe = __webpack_require__(57602); var generateECDSA = dhe.generateECDSA; var generateED25519 = dhe.generateED25519; var edCompat = __webpack_require__(14694); var nacl = __webpack_require__(68729); var Key = __webpack_require__(36814); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; formats['auto'] = __webpack_require__(8243); formats['pem'] = __webpack_require__(14324); formats['pkcs1'] = __webpack_require__(69367); formats['pkcs8'] = __webpack_require__(4173); formats['rfc4253'] = __webpack_require__(88688); formats['ssh-private'] = __webpack_require__(3923); formats['openssh'] = formats['ssh-private']; formats['ssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(63561); function PrivateKey(opts) { assert.object(opts, 'options'); Key.call(this, opts); this._pubCache = undefined; } util.inherits(PrivateKey, Key); PrivateKey.formats = formats; PrivateKey.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'pkcs1'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); return (formats[format].write(this, options)); }; PrivateKey.prototype.hash = function (algo, type) { return (this.toPublic().hash(algo, type)); }; PrivateKey.prototype.fingerprint = function (algo, type) { return (this.toPublic().fingerprint(algo, type)); }; PrivateKey.prototype.toPublic = function () { if (this._pubCache) return (this._pubCache); var algInfo = algs.info[this.type]; var pubParts = []; for (var i = 0; i < algInfo.parts.length; ++i) { var p = algInfo.parts[i]; pubParts.push(this.part[p]); } this._pubCache = new Key({ type: this.type, source: this, parts: pubParts }); if (this.comment) this._pubCache.comment = this.comment; return (this._pubCache); }; PrivateKey.prototype.derive = function (newType) { assert.string(newType, 'type'); var priv, pub, pair; if (this.type === 'ed25519' && newType === 'curve25519') { priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)); pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'curve25519', parts: [ { name: 'A', data: utils.mpNormalize(pub) }, { name: 'k', data: utils.mpNormalize(priv) } ] })); } else if (this.type === 'curve25519' && newType === 'ed25519') { priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)); pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'ed25519', parts: [ { name: 'A', data: utils.mpNormalize(pub) }, { name: 'k', data: utils.mpNormalize(priv) } ] })); } throw (new Error('Key derivation not supported from ' + this.type + ' to ' + newType)); }; PrivateKey.prototype.createVerify = function (hashAlgo) { return (this.toPublic().createVerify(hashAlgo)); }; PrivateKey.prototype.createSign = function (hashAlgo) { if (hashAlgo === undefined) hashAlgo = this.defaultHashAlgorithm(); assert.string(hashAlgo, 'hash algorithm'); /* ED25519 is not supported by OpenSSL, use a javascript impl. */ if (this.type === 'ed25519' && edCompat !== undefined) return (new edCompat.Signer(this, hashAlgo)); if (this.type === 'curve25519') throw (new Error('Curve25519 keys are not suitable for ' + 'signing or verification')); var v, nm, err; try { nm = hashAlgo.toUpperCase(); v = crypto.createSign(nm); } catch (e) { err = e; } if (v === undefined || (err instanceof Error && err.message.match(/Unknown message digest/))) { nm = 'RSA-'; nm += hashAlgo.toUpperCase(); v = crypto.createSign(nm); } assert.ok(v, 'failed to create verifier'); var oldSign = v.sign.bind(v); var key = this.toBuffer('pkcs1'); var type = this.type; var curve = this.curve; v.sign = function () { var sig = oldSign(key); if (typeof (sig) === 'string') sig = Buffer.from(sig, 'binary'); sig = Signature.parse(sig, type, 'asn1'); sig.hashAlgorithm = hashAlgo; sig.curve = curve; return (sig); }; return (v); }; PrivateKey.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); assert.ok(k instanceof PrivateKey, 'key is not a private key'); if (!k.comment) k.comment = options.filename; return (k); } catch (e) { if (e.name === 'KeyEncryptedError') throw (e); throw (new KeyParseError(options.filename, format, e)); } }; PrivateKey.isPrivateKey = function (obj, ver) { return (utils.isCompatible(obj, PrivateKey, ver)); }; PrivateKey.generate = function (type, options) { if (options === undefined) options = {}; assert.object(options, 'options'); switch (type) { case 'ecdsa': if (options.curve === undefined) options.curve = 'nistp256'; assert.string(options.curve, 'options.curve'); return (generateECDSA(options.curve)); case 'ed25519': return (generateED25519()); default: throw (new Error('Key generation not supported with key ' + 'type "' + type + '"')); } }; /* * API versions for PrivateKey: * [1,0] -- initial ver * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats * [1,2] -- added defaultHashAlgorithm * [1,3] -- added derive, ed, createDH * [1,4] -- first tagged version * [1,5] -- changed ed25519 part names and format * [1,6] -- type arguments for hash() and fingerprint() */ PrivateKey.prototype._sshpkApiVersion = [1, 6]; PrivateKey._oldVersionDetect = function (obj) { assert.func(obj.toPublic); assert.func(obj.createSign); if (obj.derive) return ([1, 3]); if (obj.defaultHashAlgorithm) return ([1, 2]); if (obj.formats['auto']) return ([1, 1]); return ([1, 0]); }; /***/ }), /***/ 91394: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = Signature; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var algs = __webpack_require__(66126); var crypto = __webpack_require__(76417); var errs = __webpack_require__(27979); var utils = __webpack_require__(80575); var asn1 = __webpack_require__(80970); var SSHBuffer = __webpack_require__(25621); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var SignatureParseError = errs.SignatureParseError; function Signature(opts) { assert.object(opts, 'options'); assert.arrayOfObject(opts.parts, 'options.parts'); assert.string(opts.type, 'options.type'); var partLookup = {}; for (var i = 0; i < opts.parts.length; ++i) { var part = opts.parts[i]; partLookup[part.name] = part; } this.type = opts.type; this.hashAlgorithm = opts.hashAlgo; this.curve = opts.curve; this.parts = opts.parts; this.part = partLookup; } Signature.prototype.toBuffer = function (format) { if (format === undefined) format = 'asn1'; assert.string(format, 'format'); var buf; var stype = 'ssh-' + this.type; switch (this.type) { case 'rsa': switch (this.hashAlgorithm) { case 'sha256': stype = 'rsa-sha2-256'; break; case 'sha512': stype = 'rsa-sha2-512'; break; case 'sha1': case undefined: break; default: throw (new Error('SSH signature ' + 'format does not support hash ' + 'algorithm ' + this.hashAlgorithm)); } if (format === 'ssh') { buf = new SSHBuffer({}); buf.writeString(stype); buf.writePart(this.part.sig); return (buf.toBuffer()); } else { return (this.part.sig.data); } break; case 'ed25519': if (format === 'ssh') { buf = new SSHBuffer({}); buf.writeString(stype); buf.writePart(this.part.sig); return (buf.toBuffer()); } else { return (this.part.sig.data); } break; case 'dsa': case 'ecdsa': var r, s; if (format === 'asn1') { var der = new asn1.BerWriter(); der.startSequence(); r = utils.mpNormalize(this.part.r.data); s = utils.mpNormalize(this.part.s.data); der.writeBuffer(r, asn1.Ber.Integer); der.writeBuffer(s, asn1.Ber.Integer); der.endSequence(); return (der.buffer); } else if (format === 'ssh' && this.type === 'dsa') { buf = new SSHBuffer({}); buf.writeString('ssh-dss'); r = this.part.r.data; if (r.length > 20 && r[0] === 0x00) r = r.slice(1); s = this.part.s.data; if (s.length > 20 && s[0] === 0x00) s = s.slice(1); if ((this.hashAlgorithm && this.hashAlgorithm !== 'sha1') || r.length + s.length !== 40) { throw (new Error('OpenSSH only supports ' + 'DSA signatures with SHA1 hash')); } buf.writeBuffer(Buffer.concat([r, s])); return (buf.toBuffer()); } else if (format === 'ssh' && this.type === 'ecdsa') { var inner = new SSHBuffer({}); r = this.part.r.data; inner.writeBuffer(r); inner.writePart(this.part.s); buf = new SSHBuffer({}); /* XXX: find a more proper way to do this? */ var curve; if (r[0] === 0x00) r = r.slice(1); var sz = r.length * 8; if (sz === 256) curve = 'nistp256'; else if (sz === 384) curve = 'nistp384'; else if (sz === 528) curve = 'nistp521'; buf.writeString('ecdsa-sha2-' + curve); buf.writeBuffer(inner.toBuffer()); return (buf.toBuffer()); } throw (new Error('Invalid signature format')); default: throw (new Error('Invalid signature data')); } }; Signature.prototype.toString = function (format) { assert.optionalString(format, 'format'); return (this.toBuffer(format).toString('base64')); }; Signature.parse = function (data, type, format) { if (typeof (data) === 'string') data = Buffer.from(data, 'base64'); assert.buffer(data, 'data'); assert.string(format, 'format'); assert.string(type, 'type'); var opts = {}; opts.type = type.toLowerCase(); opts.parts = []; try { assert.ok(data.length > 0, 'signature must not be empty'); switch (opts.type) { case 'rsa': return (parseOneNum(data, type, format, opts)); case 'ed25519': return (parseOneNum(data, type, format, opts)); case 'dsa': case 'ecdsa': if (format === 'asn1') return (parseDSAasn1(data, type, format, opts)); else if (opts.type === 'dsa') return (parseDSA(data, type, format, opts)); else return (parseECDSA(data, type, format, opts)); default: throw (new InvalidAlgorithmError(type)); } } catch (e) { if (e instanceof InvalidAlgorithmError) throw (e); throw (new SignatureParseError(type, format, e)); } }; function parseOneNum(data, type, format, opts) { if (format === 'ssh') { try { var buf = new SSHBuffer({buffer: data}); var head = buf.readString(); } catch (e) { /* fall through */ } if (buf !== undefined) { var msg = 'SSH signature does not match expected ' + 'type (expected ' + type + ', got ' + head + ')'; switch (head) { case 'ssh-rsa': assert.strictEqual(type, 'rsa', msg); opts.hashAlgo = 'sha1'; break; case 'rsa-sha2-256': assert.strictEqual(type, 'rsa', msg); opts.hashAlgo = 'sha256'; break; case 'rsa-sha2-512': assert.strictEqual(type, 'rsa', msg); opts.hashAlgo = 'sha512'; break; case 'ssh-ed25519': assert.strictEqual(type, 'ed25519', msg); opts.hashAlgo = 'sha512'; break; default: throw (new Error('Unknown SSH signature ' + 'type: ' + head)); } var sig = buf.readPart(); assert.ok(buf.atEnd(), 'extra trailing bytes'); sig.name = 'sig'; opts.parts.push(sig); return (new Signature(opts)); } } opts.parts.push({name: 'sig', data: data}); return (new Signature(opts)); } function parseDSAasn1(data, type, format, opts) { var der = new asn1.BerReader(data); der.readSequence(); var r = der.readString(asn1.Ber.Integer, true); var s = der.readString(asn1.Ber.Integer, true); opts.parts.push({name: 'r', data: utils.mpNormalize(r)}); opts.parts.push({name: 's', data: utils.mpNormalize(s)}); return (new Signature(opts)); } function parseDSA(data, type, format, opts) { if (data.length != 40) { var buf = new SSHBuffer({buffer: data}); var d = buf.readBuffer(); if (d.toString('ascii') === 'ssh-dss') d = buf.readBuffer(); assert.ok(buf.atEnd(), 'extra trailing bytes'); assert.strictEqual(d.length, 40, 'invalid inner length'); data = d; } opts.parts.push({name: 'r', data: data.slice(0, 20)}); opts.parts.push({name: 's', data: data.slice(20, 40)}); return (new Signature(opts)); } function parseECDSA(data, type, format, opts) { var buf = new SSHBuffer({buffer: data}); var r, s; var inner = buf.readBuffer(); var stype = inner.toString('ascii'); if (stype.slice(0, 6) === 'ecdsa-') { var parts = stype.split('-'); assert.strictEqual(parts[0], 'ecdsa'); assert.strictEqual(parts[1], 'sha2'); opts.curve = parts[2]; switch (opts.curve) { case 'nistp256': opts.hashAlgo = 'sha256'; break; case 'nistp384': opts.hashAlgo = 'sha384'; break; case 'nistp521': opts.hashAlgo = 'sha512'; break; default: throw (new Error('Unsupported ECDSA curve: ' + opts.curve)); } inner = buf.readBuffer(); assert.ok(buf.atEnd(), 'extra trailing bytes on outer'); buf = new SSHBuffer({buffer: inner}); r = buf.readPart(); } else { r = {data: inner}; } s = buf.readPart(); assert.ok(buf.atEnd(), 'extra trailing bytes'); r.name = 'r'; s.name = 's'; opts.parts.push(r); opts.parts.push(s); return (new Signature(opts)); } Signature.isSignature = function (obj, ver) { return (utils.isCompatible(obj, Signature, ver)); }; /* * API versions for Signature: * [1,0] -- initial ver * [2,0] -- support for rsa in full ssh format, compat with sshpk-agent * hashAlgorithm property * [2,1] -- first tagged version */ Signature.prototype._sshpkApiVersion = [2, 1]; Signature._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); if (obj.hasOwnProperty('hashAlgorithm')) return ([2, 0]); return ([1, 0]); }; /***/ }), /***/ 25621: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = SSHBuffer; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; function SSHBuffer(opts) { assert.object(opts, 'options'); if (opts.buffer !== undefined) assert.buffer(opts.buffer, 'options.buffer'); this._size = opts.buffer ? opts.buffer.length : 1024; this._buffer = opts.buffer || Buffer.alloc(this._size); this._offset = 0; } SSHBuffer.prototype.toBuffer = function () { return (this._buffer.slice(0, this._offset)); }; SSHBuffer.prototype.atEnd = function () { return (this._offset >= this._buffer.length); }; SSHBuffer.prototype.remainder = function () { return (this._buffer.slice(this._offset)); }; SSHBuffer.prototype.skip = function (n) { this._offset += n; }; SSHBuffer.prototype.expand = function () { this._size *= 2; var buf = Buffer.alloc(this._size); this._buffer.copy(buf, 0); this._buffer = buf; }; SSHBuffer.prototype.readPart = function () { return ({data: this.readBuffer()}); }; SSHBuffer.prototype.readBuffer = function () { var len = this._buffer.readUInt32BE(this._offset); this._offset += 4; assert.ok(this._offset + len <= this._buffer.length, 'length out of bounds at +0x' + this._offset.toString(16) + ' (data truncated?)'); var buf = this._buffer.slice(this._offset, this._offset + len); this._offset += len; return (buf); }; SSHBuffer.prototype.readString = function () { return (this.readBuffer().toString()); }; SSHBuffer.prototype.readCString = function () { var offset = this._offset; while (offset < this._buffer.length && this._buffer[offset] !== 0x00) offset++; assert.ok(offset < this._buffer.length, 'c string does not terminate'); var str = this._buffer.slice(this._offset, offset).toString(); this._offset = offset + 1; return (str); }; SSHBuffer.prototype.readInt = function () { var v = this._buffer.readUInt32BE(this._offset); this._offset += 4; return (v); }; SSHBuffer.prototype.readInt64 = function () { assert.ok(this._offset + 8 < this._buffer.length, 'buffer not long enough to read Int64'); var v = this._buffer.slice(this._offset, this._offset + 8); this._offset += 8; return (v); }; SSHBuffer.prototype.readChar = function () { var v = this._buffer[this._offset++]; return (v); }; SSHBuffer.prototype.writeBuffer = function (buf) { while (this._offset + 4 + buf.length > this._size) this.expand(); this._buffer.writeUInt32BE(buf.length, this._offset); this._offset += 4; buf.copy(this._buffer, this._offset); this._offset += buf.length; }; SSHBuffer.prototype.writeString = function (str) { this.writeBuffer(Buffer.from(str, 'utf8')); }; SSHBuffer.prototype.writeCString = function (str) { while (this._offset + 1 + str.length > this._size) this.expand(); this._buffer.write(str, this._offset); this._offset += str.length; this._buffer[this._offset++] = 0; }; SSHBuffer.prototype.writeInt = function (v) { while (this._offset + 4 > this._size) this.expand(); this._buffer.writeUInt32BE(v, this._offset); this._offset += 4; }; SSHBuffer.prototype.writeInt64 = function (v) { assert.buffer(v, 'value'); if (v.length > 8) { var lead = v.slice(0, v.length - 8); for (var i = 0; i < lead.length; ++i) { assert.strictEqual(lead[i], 0, 'must fit in 64 bits of precision'); } v = v.slice(v.length - 8, v.length); } while (this._offset + 8 > this._size) this.expand(); v.copy(this._buffer, this._offset); this._offset += 8; }; SSHBuffer.prototype.writeChar = function (v) { while (this._offset + 1 > this._size) this.expand(); this._buffer[this._offset++] = v; }; SSHBuffer.prototype.writePart = function (p) { this.writeBuffer(p.data); }; SSHBuffer.prototype.write = function (buf) { while (this._offset + buf.length > this._size) this.expand(); buf.copy(this._buffer, this._offset); this._offset += buf.length; }; /***/ }), /***/ 80575: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Copyright 2015 Joyent, Inc. module.exports = { bufferSplit: bufferSplit, addRSAMissing: addRSAMissing, calculateDSAPublic: calculateDSAPublic, calculateED25519Public: calculateED25519Public, calculateX25519Public: calculateX25519Public, mpNormalize: mpNormalize, mpDenormalize: mpDenormalize, ecNormalize: ecNormalize, countZeros: countZeros, assertCompatible: assertCompatible, isCompatible: isCompatible, opensslKeyDeriv: opensslKeyDeriv, opensshCipherInfo: opensshCipherInfo, publicFromPrivateECDSA: publicFromPrivateECDSA, zeroPadToLength: zeroPadToLength, writeBitString: writeBitString, readBitString: readBitString, pbkdf2: pbkdf2 }; var assert = __webpack_require__(66631); var Buffer = __webpack_require__(15118).Buffer; var PrivateKey = __webpack_require__(29602); var Key = __webpack_require__(36814); var crypto = __webpack_require__(76417); var algs = __webpack_require__(66126); var asn1 = __webpack_require__(80970); var ec = __webpack_require__(3943); var jsbn = __webpack_require__(85587).BigInteger; var nacl = __webpack_require__(68729); var MAX_CLASS_DEPTH = 3; function isCompatible(obj, klass, needVer) { if (obj === null || typeof (obj) !== 'object') return (false); if (needVer === undefined) needVer = klass.prototype._sshpkApiVersion; if (obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return (true); var proto = Object.getPrototypeOf(obj); var depth = 0; while (proto.constructor.name !== klass.name) { proto = Object.getPrototypeOf(proto); if (!proto || ++depth > MAX_CLASS_DEPTH) return (false); } if (proto.constructor.name !== klass.name) return (false); var ver = proto._sshpkApiVersion; if (ver === undefined) ver = klass._oldVersionDetect(obj); if (ver[0] != needVer[0] || ver[1] < needVer[1]) return (false); return (true); } function assertCompatible(obj, klass, needVer, name) { if (name === undefined) name = 'object'; assert.ok(obj, name + ' must not be null'); assert.object(obj, name + ' must be an object'); if (needVer === undefined) needVer = klass.prototype._sshpkApiVersion; if (obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return; var proto = Object.getPrototypeOf(obj); var depth = 0; while (proto.constructor.name !== klass.name) { proto = Object.getPrototypeOf(proto); assert.ok(proto && ++depth <= MAX_CLASS_DEPTH, name + ' must be a ' + klass.name + ' instance'); } assert.strictEqual(proto.constructor.name, klass.name, name + ' must be a ' + klass.name + ' instance'); var ver = proto._sshpkApiVersion; if (ver === undefined) ver = klass._oldVersionDetect(obj); assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1], name + ' must be compatible with ' + klass.name + ' klass ' + 'version ' + needVer[0] + '.' + needVer[1]); } var CIPHER_LEN = { 'des-ede3-cbc': { key: 24, iv: 8 }, 'aes-128-cbc': { key: 16, iv: 16 }, 'aes-256-cbc': { key: 32, iv: 16 } }; var PKCS5_SALT_LEN = 8; function opensslKeyDeriv(cipher, salt, passphrase, count) { assert.buffer(salt, 'salt'); assert.buffer(passphrase, 'passphrase'); assert.number(count, 'iteration count'); var clen = CIPHER_LEN[cipher]; assert.object(clen, 'supported cipher'); salt = salt.slice(0, PKCS5_SALT_LEN); var D, D_prev, bufs; var material = Buffer.alloc(0); while (material.length < clen.key + clen.iv) { bufs = []; if (D_prev) bufs.push(D_prev); bufs.push(passphrase); bufs.push(salt); D = Buffer.concat(bufs); for (var j = 0; j < count; ++j) D = crypto.createHash('md5').update(D).digest(); material = Buffer.concat([material, D]); D_prev = D; } return ({ key: material.slice(0, clen.key), iv: material.slice(clen.key, clen.key + clen.iv) }); } /* See: RFC2898 */ function pbkdf2(hashAlg, salt, iterations, size, passphrase) { var hkey = Buffer.alloc(salt.length + 4); salt.copy(hkey); var gen = 0, ts = []; var i = 1; while (gen < size) { var t = T(i++); gen += t.length; ts.push(t); } return (Buffer.concat(ts).slice(0, size)); function T(I) { hkey.writeUInt32BE(I, hkey.length - 4); var hmac = crypto.createHmac(hashAlg, passphrase); hmac.update(hkey); var Ti = hmac.digest(); var Uc = Ti; var c = 1; while (c++ < iterations) { hmac = crypto.createHmac(hashAlg, passphrase); hmac.update(Uc); Uc = hmac.digest(); for (var x = 0; x < Ti.length; ++x) Ti[x] ^= Uc[x]; } return (Ti); } } /* Count leading zero bits on a buffer */ function countZeros(buf) { var o = 0, obit = 8; while (o < buf.length) { var mask = (1 << obit); if ((buf[o] & mask) === mask) break; obit--; if (obit < 0) { o++; obit = 8; } } return (o*8 + (8 - obit) - 1); } function bufferSplit(buf, chr) { assert.buffer(buf); assert.string(chr); var parts = []; var lastPart = 0; var matches = 0; for (var i = 0; i < buf.length; ++i) { if (buf[i] === chr.charCodeAt(matches)) ++matches; else if (buf[i] === chr.charCodeAt(0)) matches = 1; else matches = 0; if (matches >= chr.length) { var newPart = i + 1; parts.push(buf.slice(lastPart, newPart - matches)); lastPart = newPart; matches = 0; } } if (lastPart <= buf.length) parts.push(buf.slice(lastPart, buf.length)); return (parts); } function ecNormalize(buf, addZero) { assert.buffer(buf); if (buf[0] === 0x00 && buf[1] === 0x04) { if (addZero) return (buf); return (buf.slice(1)); } else if (buf[0] === 0x04) { if (!addZero) return (buf); } else { while (buf[0] === 0x00) buf = buf.slice(1); if (buf[0] === 0x02 || buf[0] === 0x03) throw (new Error('Compressed elliptic curve points ' + 'are not supported')); if (buf[0] !== 0x04) throw (new Error('Not a valid elliptic curve point')); if (!addZero) return (buf); } var b = Buffer.alloc(buf.length + 1); b[0] = 0x0; buf.copy(b, 1); return (b); } function readBitString(der, tag) { if (tag === undefined) tag = asn1.Ber.BitString; var buf = der.readString(tag, true); assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' + 'not supported (0x' + buf[0].toString(16) + ')'); return (buf.slice(1)); } function writeBitString(der, buf, tag) { if (tag === undefined) tag = asn1.Ber.BitString; var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); der.writeBuffer(b, tag); } function mpNormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00) buf = buf.slice(1); if ((buf[0] & 0x80) === 0x80) { var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; } return (buf); } function mpDenormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00) buf = buf.slice(1); return (buf); } function zeroPadToLength(buf, len) { assert.buffer(buf); assert.number(len); while (buf.length > len) { assert.equal(buf[0], 0x00); buf = buf.slice(1); } while (buf.length < len) { var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; } return (buf); } function bigintToMpBuf(bigint) { var buf = Buffer.from(bigint.toByteArray()); buf = mpNormalize(buf); return (buf); } function calculateDSAPublic(g, p, x) { assert.buffer(g); assert.buffer(p); assert.buffer(x); g = new jsbn(g); p = new jsbn(p); x = new jsbn(x); var y = g.modPow(x, p); var ybuf = bigintToMpBuf(y); return (ybuf); } function calculateED25519Public(k) { assert.buffer(k); var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } function calculateX25519Public(k) { assert.buffer(k); var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } function addRSAMissing(key) { assert.object(key); assertCompatible(key, PrivateKey, [1, 1]); var d = new jsbn(key.part.d.data); var buf; if (!key.part.dmodp) { var p = new jsbn(key.part.p.data); var dmodp = d.mod(p.subtract(1)); buf = bigintToMpBuf(dmodp); key.part.dmodp = {name: 'dmodp', data: buf}; key.parts.push(key.part.dmodp); } if (!key.part.dmodq) { var q = new jsbn(key.part.q.data); var dmodq = d.mod(q.subtract(1)); buf = bigintToMpBuf(dmodq); key.part.dmodq = {name: 'dmodq', data: buf}; key.parts.push(key.part.dmodq); } } function publicFromPrivateECDSA(curveName, priv) { assert.string(curveName, 'curveName'); assert.buffer(priv); var params = algs.curves[curveName]; var p = new jsbn(params.p); var a = new jsbn(params.a); var b = new jsbn(params.b); var curve = new ec.ECCurveFp(p, a, b); var G = curve.decodePointHex(params.G.toString('hex')); var d = new jsbn(mpNormalize(priv)); var pub = G.multiply(d); pub = Buffer.from(curve.encodePointHex(pub), 'hex'); var parts = []; parts.push({name: 'curve', data: Buffer.from(curveName)}); parts.push({name: 'Q', data: pub}); var key = new Key({type: 'ecdsa', curve: curve, parts: parts}); return (key); } function opensshCipherInfo(cipher) { var inf = {}; switch (cipher) { case '3des-cbc': inf.keySize = 24; inf.blockSize = 8; inf.opensslName = 'des-ede3-cbc'; break; case 'blowfish-cbc': inf.keySize = 16; inf.blockSize = 8; inf.opensslName = 'bf-cbc'; break; case 'aes128-cbc': case 'aes128-ctr': case 'aes128-gcm@openssh.com': inf.keySize = 16; inf.blockSize = 16; inf.opensslName = 'aes-128-' + cipher.slice(7, 10); break; case 'aes192-cbc': case 'aes192-ctr': case 'aes192-gcm@openssh.com': inf.keySize = 24; inf.blockSize = 16; inf.opensslName = 'aes-192-' + cipher.slice(7, 10); break; case 'aes256-cbc': case 'aes256-ctr': case 'aes256-gcm@openssh.com': inf.keySize = 32; inf.blockSize = 16; inf.opensslName = 'aes-256-' + cipher.slice(7, 10); break; default: throw (new Error( 'Unsupported openssl cipher "' + cipher + '"')); } return (inf); } /***/ }), /***/ 2619: /***/ ((module) => { "use strict"; module.exports = { DEFAULT_INITIAL_SIZE: (8 * 1024), DEFAULT_INCREMENT_AMOUNT: (8 * 1024), DEFAULT_FREQUENCY: 1, DEFAULT_CHUNK_SIZE: 1024 }; /***/ }), /***/ 18838: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var stream = __webpack_require__(92413); var constants = __webpack_require__(2619); var util = __webpack_require__(31669); var ReadableStreamBuffer = module.exports = function(opts) { var that = this; opts = opts || {}; stream.Readable.call(this, opts); this.stopped = false; var frequency = opts.hasOwnProperty('frequency') ? opts.frequency : constants.DEFAULT_FREQUENCY; var chunkSize = opts.chunkSize || constants.DEFAULT_CHUNK_SIZE; var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE; var incrementAmount = opts.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT; var size = 0; var buffer = new Buffer(initialSize); var allowPush = false; var sendData = function() { var amount = Math.min(chunkSize, size); var sendMore = false; if (amount > 0) { var chunk = null; chunk = new Buffer(amount); buffer.copy(chunk, 0, 0, amount); sendMore = that.push(chunk) !== false; allowPush = sendMore; buffer.copy(buffer, 0, amount, size); size -= amount; } if(size === 0 && that.stopped) { that.push(null); } if (sendMore) { sendData.timeout = setTimeout(sendData, frequency); } else { sendData.timeout = null; } }; this.stop = function() { if (this.stopped) { throw new Error('stop() called on already stopped ReadableStreamBuffer'); } this.stopped = true; if (size === 0) { this.push(null); } }; this.size = function() { return size; }; this.maxSize = function() { return buffer.length; }; var increaseBufferIfNecessary = function(incomingDataSize) { if((buffer.length - size) < incomingDataSize) { var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount); var newBuffer = new Buffer(buffer.length + (incrementAmount * factor)); buffer.copy(newBuffer, 0, 0, size); buffer = newBuffer; } }; var kickSendDataTask = function () { if (!sendData.timeout && allowPush) { sendData.timeout = setTimeout(sendData, frequency); } } this.put = function(data, encoding) { if (that.stopped) { throw new Error('Tried to write data to a stopped ReadableStreamBuffer'); } if(Buffer.isBuffer(data)) { increaseBufferIfNecessary(data.length); data.copy(buffer, size, 0); size += data.length; } else { data = data + ''; var dataSizeInBytes = Buffer.byteLength(data); increaseBufferIfNecessary(dataSizeInBytes); buffer.write(data, size, encoding || 'utf8'); size += dataSizeInBytes; } kickSendDataTask(); }; this._read = function() { allowPush = true; kickSendDataTask(); }; }; util.inherits(ReadableStreamBuffer, stream.Readable); /***/ }), /***/ 48168: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = __webpack_require__(2619); module.exports.ReadableStreamBuffer = __webpack_require__(18838); module.exports.WritableStreamBuffer = __webpack_require__(86055); /***/ }), /***/ 86055: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var util = __webpack_require__(31669); var stream = __webpack_require__(92413); var constants = __webpack_require__(2619); var WritableStreamBuffer = module.exports = function(opts) { opts = opts || {}; opts.decodeStrings = true; stream.Writable.call(this, opts); var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE; var incrementAmount = opts.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT; var buffer = new Buffer(initialSize); var size = 0; this.size = function() { return size; }; this.maxSize = function() { return buffer.length; }; this.getContents = function(length) { if(!size) return false; var data = new Buffer(Math.min(length || size, size)); buffer.copy(data, 0, 0, data.length); if(data.length < size) buffer.copy(buffer, 0, data.length); size -= data.length; return data; }; this.getContentsAsString = function(encoding, length) { if(!size) return false; var data = buffer.toString(encoding || 'utf8', 0, Math.min(length || size, size)); var dataLength = Buffer.byteLength(data); if(dataLength < size) buffer.copy(buffer, 0, dataLength); size -= dataLength; return data; }; var increaseBufferIfNecessary = function(incomingDataSize) { if((buffer.length - size) < incomingDataSize) { var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount); var newBuffer = new Buffer(buffer.length + (incrementAmount * factor)); buffer.copy(newBuffer, 0, 0, size); buffer = newBuffer; } }; this._write = function(chunk, encoding, callback) { increaseBufferIfNecessary(chunk.length); chunk.copy(buffer, size, 0); size += chunk.length; callback(); }; }; util.inherits(WritableStreamBuffer, stream.Writable); /***/ }), /***/ 79626: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var stubs = __webpack_require__(63052) /* * StreamEvents can be used 2 ways: * * 1: * function MyStream() { * require('stream-events').call(this) * } * * 2: * require('stream-events')(myStream) */ function StreamEvents(stream) { stream = stream || this var cfg = { callthrough: true, calls: 1 } stubs(stream, '_read', cfg, stream.emit.bind(stream, 'reading')) stubs(stream, '_write', cfg, stream.emit.bind(stream, 'writing')) return stream } module.exports = StreamEvents /***/ }), /***/ 66121: /***/ ((module) => { module.exports = shift function shift (stream) { var rs = stream._readableState if (!rs) return null return (rs.objectMode || typeof stream._duplexState === 'number') ? stream.read() : stream.read(getStateLength(rs)) } function getStateLength (state) { if (state.buffer.length) { // Since node 6.3.0 state.buffer is a BufferList not an array if (state.buffer.head) { return state.buffer.head.data.length } return state.buffer[0].length } return state.length } /***/ }), /***/ 94841: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. /**/ var Buffer = __webpack_require__(21867).Buffer; /**/ var isEncoding = Buffer.isEncoding || function (encoding) { encoding = '' + encoding; switch (encoding && encoding.toLowerCase()) { case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': return true; default: return false; } }; function _normalizeEncoding(enc) { if (!enc) return 'utf8'; var retried; while (true) { switch (enc) { case 'utf8': case 'utf-8': return 'utf8'; case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return 'utf16le'; case 'latin1': case 'binary': return 'latin1'; case 'base64': case 'ascii': case 'hex': return enc; default: if (retried) return; // undefined enc = ('' + enc).toLowerCase(); retried = true; } } }; // Do not cache `Buffer.isEncoding` when checking encoding names as some // modules monkey-patch it to support additional encodings function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; } // StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. exports.s = StringDecoder; function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (this.encoding) { case 'utf16le': this.text = utf16Text; this.end = utf16End; nb = 4; break; case 'utf8': this.fillLast = utf8FillLast; nb = 4; break; case 'base64': this.text = base64Text; this.end = base64End; nb = 3; break; default: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer.allocUnsafe(nb); } StringDecoder.prototype.write = function (buf) { if (buf.length === 0) return ''; var r; var i; if (this.lastNeed) { r = this.fillLast(buf); if (r === undefined) return ''; i = this.lastNeed; this.lastNeed = 0; } else { i = 0; } if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); return r || ''; }; StringDecoder.prototype.end = utf8End; // Returns only complete characters in a Buffer StringDecoder.prototype.text = utf8Text; // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer StringDecoder.prototype.fillLast = function (buf) { if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); this.lastNeed -= buf.length; }; // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a // continuation byte. If an invalid byte is detected, -2 is returned. function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return byte >> 6 === 0x02 ? -1 : -2; } // Checks at most 3 bytes at the end of a Buffer in order to detect an // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) // needed to complete the UTF-8 character (if applicable) are returned. function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } return nb; } return 0; } // Validates as many continuation bytes for a multi-byte UTF-8 character as // needed or are available. If we see a non-continuation byte where we expect // one, we "replace" the validated continuation bytes we've seen so far with // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding // behavior. The continuation byte check is included three times in the case // where all of the continuation bytes for a character exist in the same buffer. // It is also done this way as a slight performance increase instead of using a // loop. function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 0xC0) !== 0x80) { self.lastNeed = 2; return '\ufffd'; } } } } // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p, 0, buf.length); this.lastNeed -= buf.length; } // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a // partial character, the character's bytes are buffered until the required // number of bytes are available. function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); } // For UTF-8, a replacement character is added when ending on a partial // character. function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + '\ufffd'; return r; } // UTF-16LE typically needs two bytes per character, but even if we have an even // number of bytes available, we need to check if we end on a leading/high // surrogate. In that case, we need to wait for the next two bytes in order to // decode the last character properly. function utf16Text(buf, i) { if ((buf.length - i) % 2 === 0) { var r = buf.toString('utf16le', i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 0xD800 && c <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString('utf16le', i, buf.length - 1); } // For UTF-16LE we do not explicitly append special replacement characters if we // end on a partial character, we simply let v8 handle that. function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString('utf16le', 0, end); } return r; } function base64Text(buf, i) { var n = (buf.length - i) % 3; if (n === 0) return buf.toString('base64', i); this.lastNeed = 3 - n; this.lastTotal = 3; if (n === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } return buf.toString('base64', i, buf.length - n); } function base64End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); return r; } // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } /***/ }), /***/ 85515: /***/ ((module) => { "use strict"; module.exports = function (x) { var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); if (x[x.length - 1] === lf) { x = x.slice(0, x.length - 1); } if (x[x.length - 1] === cr) { x = x.slice(0, x.length - 1); } return x; }; /***/ }), /***/ 63052: /***/ ((module) => { "use strict"; module.exports = function stubs(obj, method, cfg, stub) { if (!obj || !method || !obj[method]) throw new Error('You must provide an object and a key for an existing method') if (!stub) { stub = cfg cfg = {} } stub = stub || function() {} cfg.callthrough = cfg.callthrough || false cfg.calls = cfg.calls || 0 var norevert = cfg.calls === 0 var cached = obj[method].bind(obj) obj[method] = function() { var args = [].slice.call(arguments) var returnVal if (cfg.callthrough) returnVal = cached.apply(obj, args) returnVal = stub.apply(obj, args) || returnVal if (!norevert && --cfg.calls === 0) obj[method] = cached return returnVal } } /***/ }), /***/ 59318: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const os = __webpack_require__(12087); const tty = __webpack_require__(33867); const hasFlag = __webpack_require__(31621); const {env} = process; let forceColor; if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) { forceColor = 0; } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { forceColor = 1; } if ('FORCE_COLOR' in env) { if (env.FORCE_COLOR === 'true') { forceColor = 1; } else if (env.FORCE_COLOR === 'false') { forceColor = 0; } else { forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); } } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function supportsColor(haveStream, streamIsTTY) { if (forceColor === 0) { return 0; } if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) { return 3; } if (hasFlag('color=256')) { return 2; } if (haveStream && !streamIsTTY && forceColor === undefined) { return 0; } const min = forceColor || 0; if (env.TERM === 'dumb') { return min; } if (process.platform === 'win32') { // Windows 10 build 10586 is the first Windows release that supports 256 colors. // Windows 10 build 14931 is the first release that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ('CI' in env) { if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } return min; } if ('TEAMCITY_VERSION' in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } if (env.COLORTERM === 'truecolor') { return 3; } if ('TERM_PROGRAM' in env) { const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); switch (env.TERM_PROGRAM) { case 'iTerm.app': return version >= 3 ? 3 : 2; case 'Apple_Terminal': return 2; // No default } } if (/-256(color)?$/i.test(env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } if ('COLORTERM' in env) { return 1; } return min; } function getSupportLevel(stream) { const level = supportsColor(stream, stream && stream.isTTY); return translateLevel(level); } module.exports = { supportsColor: getSupportLevel, stdout: translateLevel(supportsColor(true, tty.isatty(1))), stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; /***/ }), /***/ 74674: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // high-level commands exports.c = exports.create = __webpack_require__(44016) exports.r = exports.replace = __webpack_require__(45923) exports.t = exports.list = __webpack_require__(51525) exports.u = exports.update = __webpack_require__(94404) exports.x = exports.extract = __webpack_require__(75317) // classes exports.Pack = __webpack_require__(7900) exports.Unpack = __webpack_require__(17628) exports.Parse = __webpack_require__(78221) exports.ReadEntry = __webpack_require__(38116) exports.WriteEntry = __webpack_require__(55450) exports.Header = __webpack_require__(66043) exports.Pax = __webpack_require__(77996) exports.types = __webpack_require__(24173) /***/ }), /***/ 44016: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // tar -c const hlo = __webpack_require__(95274) const Pack = __webpack_require__(7900) const fsm = __webpack_require__(27714) const t = __webpack_require__(51525) const path = __webpack_require__(85622) module.exports = (opt_, files, cb) => { if (typeof files === 'function') cb = files if (Array.isArray(opt_)) files = opt_, opt_ = {} if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') return opt.file && opt.sync ? createFileSync(opt, files) : opt.file ? createFile(opt, files, cb) : opt.sync ? createSync(opt, files) : create(opt, files) } const createFileSync = (opt, files) => { const p = new Pack.Sync(opt) const stream = new fsm.WriteStreamSync(opt.file, { mode: opt.mode || 0o666, }) p.pipe(stream) addFilesSync(p, files) } const createFile = (opt, files, cb) => { const p = new Pack(opt) const stream = new fsm.WriteStream(opt.file, { mode: opt.mode || 0o666, }) p.pipe(stream) const promise = new Promise((res, rej) => { stream.on('error', rej) stream.on('close', res) p.on('error', rej) }) addFilesAsync(p, files) return cb ? promise.then(cb, cb) : promise } const addFilesSync = (p, files) => { files.forEach(file => { if (file.charAt(0) === '@') { t({ file: path.resolve(p.cwd, file.substr(1)), sync: true, noResume: true, onentry: entry => p.add(entry), }) } else p.add(file) }) p.end() } const addFilesAsync = (p, files) => { while (files.length) { const file = files.shift() if (file.charAt(0) === '@') { return t({ file: path.resolve(p.cwd, file.substr(1)), noResume: true, onentry: entry => p.add(entry), }).then(_ => addFilesAsync(p, files)) } else p.add(file) } p.end() } const createSync = (opt, files) => { const p = new Pack.Sync(opt) addFilesSync(p, files) return p } const create = (opt, files) => { const p = new Pack(opt) addFilesAsync(p, files) return p } /***/ }), /***/ 75317: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // tar -x const hlo = __webpack_require__(95274) const Unpack = __webpack_require__(17628) const fs = __webpack_require__(35747) const fsm = __webpack_require__(27714) const path = __webpack_require__(85622) module.exports = (opt_, files, cb) => { if (typeof opt_ === 'function') cb = opt_, files = null, opt_ = {} else if (Array.isArray(opt_)) files = opt_, opt_ = {} if (typeof files === 'function') cb = files, files = null if (!files) files = [] else files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') if (files.length) filesFilter(opt, files) return opt.file && opt.sync ? extractFileSync(opt) : opt.file ? extractFile(opt, cb) : opt.sync ? extractSync(opt) : extract(opt) } // construct a filter that limits the file entries listed // include child entries if a dir is included const filesFilter = (opt, files) => { const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true])) const filter = opt.filter const mapHas = (file, r) => { const root = r || path.parse(file).root || '.' const ret = file === root ? false : map.has(file) ? map.get(file) : mapHas(path.dirname(file), root) map.set(file, ret) return ret } opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, '')) : file => mapHas(file.replace(/\/+$/, '')) } const extractFileSync = opt => { const u = new Unpack.Sync(opt) const file = opt.file const stat = fs.statSync(file) // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation const readSize = opt.maxReadSize || 16 * 1024 * 1024 const stream = new fsm.ReadStreamSync(file, { readSize: readSize, size: stat.size, }) stream.pipe(u) } const extractFile = (opt, cb) => { const u = new Unpack(opt) const readSize = opt.maxReadSize || 16 * 1024 * 1024 const file = opt.file const p = new Promise((resolve, reject) => { u.on('error', reject) u.on('close', resolve) // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation fs.stat(file, (er, stat) => { if (er) reject(er) else { const stream = new fsm.ReadStream(file, { readSize: readSize, size: stat.size, }) stream.on('error', reject) stream.pipe(u) } }) }) return cb ? p.then(cb, cb) : p } const extractSync = opt => new Unpack.Sync(opt) const extract = opt => new Unpack(opt) /***/ }), /***/ 91172: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Get the appropriate flag to use for creating files // We use fmap on Windows platforms for files less than // 512kb. This is a fairly low limit, but avoids making // things slower in some cases. Since most of what this // library is used for is extracting tarballs of many // relatively small files in npm packages and the like, // it can be a big boost on Windows platforms. // Only supported in Node v12.9.0 and above. const platform = process.env.__FAKE_PLATFORM__ || process.platform const isWindows = platform === 'win32' const fs = global.__FAKE_TESTING_FS__ || __webpack_require__(35747) /* istanbul ignore next */ const { O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP = 0 } = fs.constants const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP const fMapLimit = 512 * 1024 const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY module.exports = !fMapEnabled ? () => 'w' : size => size < fMapLimit ? fMapFlag : 'w' /***/ }), /***/ 66043: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // parse a 512-byte header block to a data object, or vice-versa // encode returns `true` if a pax extended header is needed, because // the data could not be faithfully encoded in a simple header. // (Also, check header.needPax to see if it needs a pax header.) const types = __webpack_require__(24173) const pathModule = __webpack_require__(85622).posix const large = __webpack_require__(52370) const SLURP = Symbol('slurp') const TYPE = Symbol('type') class Header { constructor (data, off, ex, gex) { this.cksumValid = false this.needPax = false this.nullBlock = false this.block = null this.path = null this.mode = null this.uid = null this.gid = null this.size = null this.mtime = null this.cksum = null this[TYPE] = '0' this.linkpath = null this.uname = null this.gname = null this.devmaj = 0 this.devmin = 0 this.atime = null this.ctime = null if (Buffer.isBuffer(data)) this.decode(data, off || 0, ex, gex) else if (data) this.set(data) } decode (buf, off, ex, gex) { if (!off) off = 0 if (!buf || !(buf.length >= off + 512)) throw new Error('need 512 bytes for header') this.path = decString(buf, off, 100) this.mode = decNumber(buf, off + 100, 8) this.uid = decNumber(buf, off + 108, 8) this.gid = decNumber(buf, off + 116, 8) this.size = decNumber(buf, off + 124, 12) this.mtime = decDate(buf, off + 136, 12) this.cksum = decNumber(buf, off + 148, 12) // if we have extended or global extended headers, apply them now // See https://github.com/npm/node-tar/pull/187 this[SLURP](ex) this[SLURP](gex, true) // old tar versions marked dirs as a file with a trailing / this[TYPE] = decString(buf, off + 156, 1) if (this[TYPE] === '') this[TYPE] = '0' if (this[TYPE] === '0' && this.path.substr(-1) === '/') this[TYPE] = '5' // tar implementations sometimes incorrectly put the stat(dir).size // as the size in the tarball, even though Directory entries are // not able to have any body at all. In the very rare chance that // it actually DOES have a body, we weren't going to do anything with // it anyway, and it'll just be a warning about an invalid header. if (this[TYPE] === '5') this.size = 0 this.linkpath = decString(buf, off + 157, 100) if (buf.slice(off + 257, off + 265).toString() === 'ustar\u000000') { this.uname = decString(buf, off + 265, 32) this.gname = decString(buf, off + 297, 32) this.devmaj = decNumber(buf, off + 329, 8) this.devmin = decNumber(buf, off + 337, 8) if (buf[off + 475] !== 0) { // definitely a prefix, definitely >130 chars. const prefix = decString(buf, off + 345, 155) this.path = prefix + '/' + this.path } else { const prefix = decString(buf, off + 345, 130) if (prefix) this.path = prefix + '/' + this.path this.atime = decDate(buf, off + 476, 12) this.ctime = decDate(buf, off + 488, 12) } } let sum = 8 * 0x20 for (let i = off; i < off + 148; i++) sum += buf[i] for (let i = off + 156; i < off + 512; i++) sum += buf[i] this.cksumValid = sum === this.cksum if (this.cksum === null && sum === 8 * 0x20) this.nullBlock = true } [SLURP] (ex, global) { for (const k in ex) { // we slurp in everything except for the path attribute in // a global extended header, because that's weird. if (ex[k] !== null && ex[k] !== undefined && !(global && k === 'path')) this[k] = ex[k] } } encode (buf, off) { if (!buf) { buf = this.block = Buffer.alloc(512) off = 0 } if (!off) off = 0 if (!(buf.length >= off + 512)) throw new Error('need 512 bytes for header') const prefixSize = this.ctime || this.atime ? 130 : 155 const split = splitPrefix(this.path || '', prefixSize) const path = split[0] const prefix = split[1] this.needPax = split[2] this.needPax = encString(buf, off, 100, path) || this.needPax this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax buf[off + 156] = this[TYPE].charCodeAt(0) this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax buf.write('ustar\u000000', off + 257, 8) this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax if (buf[off + 475] !== 0) this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax else { this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax } let sum = 8 * 0x20 for (let i = off; i < off + 148; i++) sum += buf[i] for (let i = off + 156; i < off + 512; i++) sum += buf[i] this.cksum = sum encNumber(buf, off + 148, 8, this.cksum) this.cksumValid = true return this.needPax } set (data) { for (const i in data) { if (data[i] !== null && data[i] !== undefined) this[i] = data[i] } } get type () { return types.name.get(this[TYPE]) || this[TYPE] } get typeKey () { return this[TYPE] } set type (type) { if (types.code.has(type)) this[TYPE] = types.code.get(type) else this[TYPE] = type } } const splitPrefix = (p, prefixSize) => { const pathSize = 100 let pp = p let prefix = '' let ret const root = pathModule.parse(p).root || '.' if (Buffer.byteLength(pp) < pathSize) ret = [pp, prefix, false] else { // first set prefix to the dir, and path to the base prefix = pathModule.dirname(pp) pp = pathModule.basename(pp) do { // both fit! if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) ret = [pp, prefix, false] // prefix fits in prefix, but path doesn't fit in path else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) ret = [pp.substr(0, pathSize - 1), prefix, true] else { // make path take a bit from prefix pp = pathModule.join(pathModule.basename(prefix), pp) prefix = pathModule.dirname(prefix) } } while (prefix !== root && !ret) // at this point, found no resolution, just truncate if (!ret) ret = [p.substr(0, pathSize - 1), '', true] } return ret } const decString = (buf, off, size) => buf.slice(off, off + size).toString('utf8').replace(/\0.*/, '') const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)) const numToDate = num => num === null ? null : new Date(num * 1000) const decNumber = (buf, off, size) => buf[off] & 0x80 ? large.parse(buf.slice(off, off + size)) : decSmallNumber(buf, off, size) const nanNull = value => isNaN(value) ? null : value const decSmallNumber = (buf, off, size) => nanNull(parseInt( buf.slice(off, off + size) .toString('utf8').replace(/\0.*$/, '').trim(), 8)) // the maximum encodable as a null-terminated octal, by field size const MAXNUM = { 12: 0o77777777777, 8: 0o7777777, } const encNumber = (buf, off, size, number) => number === null ? false : number > MAXNUM[size] || number < 0 ? (large.encode(number, buf.slice(off, off + size)), true) : (encSmallNumber(buf, off, size, number), false) const encSmallNumber = (buf, off, size, number) => buf.write(octalString(number, size), off, size, 'ascii') const octalString = (number, size) => padOctal(Math.floor(number).toString(8), size) const padOctal = (string, size) => (string.length === size - 1 ? string : new Array(size - string.length - 1).join('0') + string + ' ') + '\0' const encDate = (buf, off, size, date) => date === null ? false : encNumber(buf, off, size, date.getTime() / 1000) // enough to fill the longest string we've got const NULLS = new Array(156).join('\0') // pad with nulls, return true if it's longer or non-ascii const encString = (buf, off, size, string) => string === null ? false : (buf.write(string + NULLS, off, size, 'utf8'), string.length !== Buffer.byteLength(string) || string.length > size) module.exports = Header /***/ }), /***/ 95274: /***/ ((module) => { "use strict"; // turn tar(1) style args like `C` into the more verbose things like `cwd` const argmap = new Map([ ['C', 'cwd'], ['f', 'file'], ['z', 'gzip'], ['P', 'preservePaths'], ['U', 'unlink'], ['strip-components', 'strip'], ['stripComponents', 'strip'], ['keep-newer', 'newer'], ['keepNewer', 'newer'], ['keep-newer-files', 'newer'], ['keepNewerFiles', 'newer'], ['k', 'keep'], ['keep-existing', 'keep'], ['keepExisting', 'keep'], ['m', 'noMtime'], ['no-mtime', 'noMtime'], ['p', 'preserveOwner'], ['L', 'follow'], ['h', 'follow'], ]) module.exports = opt => opt ? Object.keys(opt).map(k => [ argmap.has(k) ? argmap.get(k) : k, opt[k], ]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {} /***/ }), /***/ 52370: /***/ ((module) => { "use strict"; // Tar can encode large and negative numbers using a leading byte of // 0xff for negative, and 0x80 for positive. const encode = (num, buf) => { if (!Number.isSafeInteger(num)) // The number is so large that javascript cannot represent it with integer // precision. throw Error('cannot encode number outside of javascript safe integer range') else if (num < 0) encodeNegative(num, buf) else encodePositive(num, buf) return buf } const encodePositive = (num, buf) => { buf[0] = 0x80 for (var i = buf.length; i > 1; i--) { buf[i - 1] = num & 0xff num = Math.floor(num / 0x100) } } const encodeNegative = (num, buf) => { buf[0] = 0xff var flipped = false num = num * -1 for (var i = buf.length; i > 1; i--) { var byte = num & 0xff num = Math.floor(num / 0x100) if (flipped) buf[i - 1] = onesComp(byte) else if (byte === 0) buf[i - 1] = 0 else { flipped = true buf[i - 1] = twosComp(byte) } } } const parse = (buf) => { const pre = buf[0] const value = pre === 0x80 ? pos(buf.slice(1, buf.length)) : pre === 0xff ? twos(buf) : null if (value === null) throw Error('invalid base256 encoding') if (!Number.isSafeInteger(value)) // The number is so large that javascript cannot represent it with integer // precision. throw Error('parsed number outside of javascript safe integer range') return value } const twos = (buf) => { var len = buf.length var sum = 0 var flipped = false for (var i = len - 1; i > -1; i--) { var byte = buf[i] var f if (flipped) f = onesComp(byte) else if (byte === 0) f = byte else { flipped = true f = twosComp(byte) } if (f !== 0) sum -= f * Math.pow(256, len - i - 1) } return sum } const pos = (buf) => { var len = buf.length var sum = 0 for (var i = len - 1; i > -1; i--) { var byte = buf[i] if (byte !== 0) sum += byte * Math.pow(256, len - i - 1) } return sum } const onesComp = byte => (0xff ^ byte) & 0xff const twosComp = byte => ((0xff ^ byte) + 1) & 0xff module.exports = { encode, parse, } /***/ }), /***/ 51525: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // XXX: This shares a lot in common with extract.js // maybe some DRY opportunity here? // tar -t const hlo = __webpack_require__(95274) const Parser = __webpack_require__(78221) const fs = __webpack_require__(35747) const fsm = __webpack_require__(27714) const path = __webpack_require__(85622) module.exports = (opt_, files, cb) => { if (typeof opt_ === 'function') cb = opt_, files = null, opt_ = {} else if (Array.isArray(opt_)) files = opt_, opt_ = {} if (typeof files === 'function') cb = files, files = null if (!files) files = [] else files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') if (files.length) filesFilter(opt, files) if (!opt.noResume) onentryFunction(opt) return opt.file && opt.sync ? listFileSync(opt) : opt.file ? listFile(opt, cb) : list(opt) } const onentryFunction = opt => { const onentry = opt.onentry opt.onentry = onentry ? e => { onentry(e) e.resume() } : e => e.resume() } // construct a filter that limits the file entries listed // include child entries if a dir is included const filesFilter = (opt, files) => { const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true])) const filter = opt.filter const mapHas = (file, r) => { const root = r || path.parse(file).root || '.' const ret = file === root ? false : map.has(file) ? map.get(file) : mapHas(path.dirname(file), root) map.set(file, ret) return ret } opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, '')) : file => mapHas(file.replace(/\/+$/, '')) } const listFileSync = opt => { const p = list(opt) const file = opt.file let threw = true let fd try { const stat = fs.statSync(file) const readSize = opt.maxReadSize || 16 * 1024 * 1024 if (stat.size < readSize) p.end(fs.readFileSync(file)) else { let pos = 0 const buf = Buffer.allocUnsafe(readSize) fd = fs.openSync(file, 'r') while (pos < stat.size) { const bytesRead = fs.readSync(fd, buf, 0, readSize, pos) pos += bytesRead p.write(buf.slice(0, bytesRead)) } p.end() } threw = false } finally { if (threw && fd) { try { fs.closeSync(fd) } catch (er) {} } } } const listFile = (opt, cb) => { const parse = new Parser(opt) const readSize = opt.maxReadSize || 16 * 1024 * 1024 const file = opt.file const p = new Promise((resolve, reject) => { parse.on('error', reject) parse.on('end', resolve) fs.stat(file, (er, stat) => { if (er) reject(er) else { const stream = new fsm.ReadStream(file, { readSize: readSize, size: stat.size, }) stream.on('error', reject) stream.pipe(parse) } }) }) return cb ? p.then(cb, cb) : p } const list = opt => new Parser(opt) /***/ }), /***/ 69624: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // wrapper around mkdirp for tar's needs. // TODO: This should probably be a class, not functionally // passing around state in a gazillion args. const mkdirp = __webpack_require__(66186) const fs = __webpack_require__(35747) const path = __webpack_require__(85622) const chownr = __webpack_require__(59051) class SymlinkError extends Error { constructor (symlink, path) { super('Cannot extract through symbolic link') this.path = path this.symlink = symlink } get name () { return 'SylinkError' } } class CwdError extends Error { constructor (path, code) { super(code + ': Cannot cd into \'' + path + '\'') this.path = path this.code = code } get name () { return 'CwdError' } } module.exports = (dir, opt, cb) => { // if there's any overlap between mask and mode, // then we'll need an explicit chmod const umask = opt.umask const mode = opt.mode | 0o0700 const needChmod = (mode & umask) !== 0 const uid = opt.uid const gid = opt.gid const doChown = typeof uid === 'number' && typeof gid === 'number' && (uid !== opt.processUid || gid !== opt.processGid) const preserve = opt.preserve const unlink = opt.unlink const cache = opt.cache const cwd = opt.cwd const done = (er, created) => { if (er) cb(er) else { cache.set(dir, true) if (created && doChown) chownr(created, uid, gid, er => done(er)) else if (needChmod) fs.chmod(dir, mode, cb) else cb() } } if (cache && cache.get(dir) === true) return done() if (dir === cwd) { return fs.stat(dir, (er, st) => { if (er || !st.isDirectory()) er = new CwdError(dir, er && er.code || 'ENOTDIR') done(er) }) } if (preserve) return mkdirp(dir, {mode}).then(made => done(null, made), done) const sub = path.relative(cwd, dir) const parts = sub.split(/\/|\\/) mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done) } const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => { if (!parts.length) return cb(null, created) const p = parts.shift() const part = base + '/' + p if (cache.get(part)) return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) } const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => { if (er) { if (er.path && path.dirname(er.path) === cwd && (er.code === 'ENOTDIR' || er.code === 'ENOENT')) return cb(new CwdError(cwd, er.code)) fs.lstat(part, (statEr, st) => { if (statEr) cb(statEr) else if (st.isDirectory()) mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) else if (unlink) { fs.unlink(part, er => { if (er) return cb(er) fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) }) } else if (st.isSymbolicLink()) return cb(new SymlinkError(part, part + '/' + parts.join('/'))) else cb(er) }) } else { created = created || part mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) } } module.exports.sync = (dir, opt) => { // if there's any overlap between mask and mode, // then we'll need an explicit chmod const umask = opt.umask const mode = opt.mode | 0o0700 const needChmod = (mode & umask) !== 0 const uid = opt.uid const gid = opt.gid const doChown = typeof uid === 'number' && typeof gid === 'number' && (uid !== opt.processUid || gid !== opt.processGid) const preserve = opt.preserve const unlink = opt.unlink const cache = opt.cache const cwd = opt.cwd const done = (created) => { cache.set(dir, true) if (created && doChown) chownr.sync(created, uid, gid) if (needChmod) fs.chmodSync(dir, mode) } if (cache && cache.get(dir) === true) return done() if (dir === cwd) { let ok = false let code = 'ENOTDIR' try { ok = fs.statSync(dir).isDirectory() } catch (er) { code = er.code } finally { if (!ok) throw new CwdError(dir, code) } done() return } if (preserve) return done(mkdirp.sync(dir, mode)) const sub = path.relative(cwd, dir) const parts = sub.split(/\/|\\/) let created = null for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) { if (cache.get(part)) continue try { fs.mkdirSync(part, mode) created = created || part cache.set(part, true) } catch (er) { if (er.path && path.dirname(er.path) === cwd && (er.code === 'ENOTDIR' || er.code === 'ENOENT')) return new CwdError(cwd, er.code) const st = fs.lstatSync(part) if (st.isDirectory()) { cache.set(part, true) continue } else if (unlink) { fs.unlinkSync(part) fs.mkdirSync(part, mode) created = created || part cache.set(part, true) continue } else if (st.isSymbolicLink()) return new SymlinkError(part, part + '/' + parts.join('/')) } } return done(created) } /***/ }), /***/ 88371: /***/ ((module) => { "use strict"; module.exports = (mode, isDir, portable) => { mode &= 0o7777 // in portable mode, use the minimum reasonable umask // if this system creates files with 0o664 by default // (as some linux distros do), then we'll write the // archive with 0o644 instead. Also, don't ever create // a file that is not readable/writable by the owner. if (portable) mode = (mode | 0o600) & ~0o22 // if dirs are readable, then they should be listable if (isDir) { if (mode & 0o400) mode |= 0o100 if (mode & 0o40) mode |= 0o10 if (mode & 0o4) mode |= 0o1 } return mode } /***/ }), /***/ 7900: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // A readable tar stream creator // Technically, this is a transform stream that you write paths into, // and tar format comes out of. // The `add()` method is like `write()` but returns this, // and end() return `this` as well, so you can // do `new Pack(opt).add('files').add('dir').end().pipe(output) // You could also do something like: // streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar')) class PackJob { constructor (path, absolute) { this.path = path || './' this.absolute = absolute this.entry = null this.stat = null this.readdir = null this.pending = false this.ignore = false this.piped = false } } const MiniPass = __webpack_require__(73078) const zlib = __webpack_require__(33486) const ReadEntry = __webpack_require__(38116) const WriteEntry = __webpack_require__(55450) const WriteEntrySync = WriteEntry.Sync const WriteEntryTar = WriteEntry.Tar const Yallist = __webpack_require__(40665) const EOF = Buffer.alloc(1024) const ONSTAT = Symbol('onStat') const ENDED = Symbol('ended') const QUEUE = Symbol('queue') const CURRENT = Symbol('current') const PROCESS = Symbol('process') const PROCESSING = Symbol('processing') const PROCESSJOB = Symbol('processJob') const JOBS = Symbol('jobs') const JOBDONE = Symbol('jobDone') const ADDFSENTRY = Symbol('addFSEntry') const ADDTARENTRY = Symbol('addTarEntry') const STAT = Symbol('stat') const READDIR = Symbol('readdir') const ONREADDIR = Symbol('onreaddir') const PIPE = Symbol('pipe') const ENTRY = Symbol('entry') const ENTRYOPT = Symbol('entryOpt') const WRITEENTRYCLASS = Symbol('writeEntryClass') const WRITE = Symbol('write') const ONDRAIN = Symbol('ondrain') const fs = __webpack_require__(35747) const path = __webpack_require__(85622) const warner = __webpack_require__(85899) const Pack = warner(class Pack extends MiniPass { constructor (opt) { super(opt) opt = opt || Object.create(null) this.opt = opt this.file = opt.file || '' this.cwd = opt.cwd || process.cwd() this.maxReadSize = opt.maxReadSize this.preservePaths = !!opt.preservePaths this.strict = !!opt.strict this.noPax = !!opt.noPax this.prefix = (opt.prefix || '').replace(/(\\|\/)+$/, '') this.linkCache = opt.linkCache || new Map() this.statCache = opt.statCache || new Map() this.readdirCache = opt.readdirCache || new Map() this[WRITEENTRYCLASS] = WriteEntry if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) this.portable = !!opt.portable this.zip = null if (opt.gzip) { if (typeof opt.gzip !== 'object') opt.gzip = {} if (this.portable) opt.gzip.portable = true this.zip = new zlib.Gzip(opt.gzip) this.zip.on('data', chunk => super.write(chunk)) this.zip.on('end', _ => super.end()) this.zip.on('drain', _ => this[ONDRAIN]()) this.on('resume', _ => this.zip.resume()) } else this.on('drain', this[ONDRAIN]) this.noDirRecurse = !!opt.noDirRecurse this.follow = !!opt.follow this.noMtime = !!opt.noMtime this.mtime = opt.mtime || null this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true this[QUEUE] = new Yallist() this[JOBS] = 0 this.jobs = +opt.jobs || 4 this[PROCESSING] = false this[ENDED] = false } [WRITE] (chunk) { return super.write(chunk) } add (path) { this.write(path) return this } end (path) { if (path) this.write(path) this[ENDED] = true this[PROCESS]() return this } write (path) { if (this[ENDED]) throw new Error('write after end') if (path instanceof ReadEntry) this[ADDTARENTRY](path) else this[ADDFSENTRY](path) return this.flowing } [ADDTARENTRY] (p) { const absolute = path.resolve(this.cwd, p.path) if (this.prefix) p.path = this.prefix + '/' + p.path.replace(/^\.(\/+|$)/, '') // in this case, we don't have to wait for the stat if (!this.filter(p.path, p)) p.resume() else { const job = new PackJob(p.path, absolute, false) job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)) job.entry.on('end', _ => this[JOBDONE](job)) this[JOBS] += 1 this[QUEUE].push(job) } this[PROCESS]() } [ADDFSENTRY] (p) { const absolute = path.resolve(this.cwd, p) if (this.prefix) p = this.prefix + '/' + p.replace(/^\.(\/+|$)/, '') this[QUEUE].push(new PackJob(p, absolute)) this[PROCESS]() } [STAT] (job) { job.pending = true this[JOBS] += 1 const stat = this.follow ? 'stat' : 'lstat' fs[stat](job.absolute, (er, stat) => { job.pending = false this[JOBS] -= 1 if (er) this.emit('error', er) else this[ONSTAT](job, stat) }) } [ONSTAT] (job, stat) { this.statCache.set(job.absolute, stat) job.stat = stat // now we have the stat, we can filter it. if (!this.filter(job.path, stat)) job.ignore = true this[PROCESS]() } [READDIR] (job) { job.pending = true this[JOBS] += 1 fs.readdir(job.absolute, (er, entries) => { job.pending = false this[JOBS] -= 1 if (er) return this.emit('error', er) this[ONREADDIR](job, entries) }) } [ONREADDIR] (job, entries) { this.readdirCache.set(job.absolute, entries) job.readdir = entries this[PROCESS]() } [PROCESS] () { if (this[PROCESSING]) return this[PROCESSING] = true for (let w = this[QUEUE].head; w !== null && this[JOBS] < this.jobs; w = w.next) { this[PROCESSJOB](w.value) if (w.value.ignore) { const p = w.next this[QUEUE].removeNode(w) w.next = p } } this[PROCESSING] = false if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) { if (this.zip) this.zip.end(EOF) else { super.write(EOF) super.end() } } } get [CURRENT] () { return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value } [JOBDONE] (job) { this[QUEUE].shift() this[JOBS] -= 1 this[PROCESS]() } [PROCESSJOB] (job) { if (job.pending) return if (job.entry) { if (job === this[CURRENT] && !job.piped) this[PIPE](job) return } if (!job.stat) { if (this.statCache.has(job.absolute)) this[ONSTAT](job, this.statCache.get(job.absolute)) else this[STAT](job) } if (!job.stat) return // filtered out! if (job.ignore) return if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { if (this.readdirCache.has(job.absolute)) this[ONREADDIR](job, this.readdirCache.get(job.absolute)) else this[READDIR](job) if (!job.readdir) return } // we know it doesn't have an entry, because that got checked above job.entry = this[ENTRY](job) if (!job.entry) { job.ignore = true return } if (job === this[CURRENT] && !job.piped) this[PIPE](job) } [ENTRYOPT] (job) { return { onwarn: (code, msg, data) => this.warn(code, msg, data), noPax: this.noPax, cwd: this.cwd, absolute: job.absolute, preservePaths: this.preservePaths, maxReadSize: this.maxReadSize, strict: this.strict, portable: this.portable, linkCache: this.linkCache, statCache: this.statCache, noMtime: this.noMtime, mtime: this.mtime, } } [ENTRY] (job) { this[JOBS] += 1 try { return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)) .on('end', () => this[JOBDONE](job)) .on('error', er => this.emit('error', er)) } catch (er) { this.emit('error', er) } } [ONDRAIN] () { if (this[CURRENT] && this[CURRENT].entry) this[CURRENT].entry.resume() } // like .pipe() but using super, because our write() is special [PIPE] (job) { job.piped = true if (job.readdir) { job.readdir.forEach(entry => { const p = this.prefix ? job.path.slice(this.prefix.length + 1) || './' : job.path const base = p === './' ? '' : p.replace(/\/*$/, '/') this[ADDFSENTRY](base + entry) }) } const source = job.entry const zip = this.zip if (zip) { source.on('data', chunk => { if (!zip.write(chunk)) source.pause() }) } else { source.on('data', chunk => { if (!super.write(chunk)) source.pause() }) } } pause () { if (this.zip) this.zip.pause() return super.pause() } }) class PackSync extends Pack { constructor (opt) { super(opt) this[WRITEENTRYCLASS] = WriteEntrySync } // pause/resume are no-ops in sync streams. pause () {} resume () {} [STAT] (job) { const stat = this.follow ? 'statSync' : 'lstatSync' this[ONSTAT](job, fs[stat](job.absolute)) } [READDIR] (job, stat) { this[ONREADDIR](job, fs.readdirSync(job.absolute)) } // gotta get it all in this tick [PIPE] (job) { const source = job.entry const zip = this.zip if (job.readdir) { job.readdir.forEach(entry => { const p = this.prefix ? job.path.slice(this.prefix.length + 1) || './' : job.path const base = p === './' ? '' : p.replace(/\/*$/, '/') this[ADDFSENTRY](base + entry) }) } if (zip) { source.on('data', chunk => { zip.write(chunk) }) } else { source.on('data', chunk => { super[WRITE](chunk) }) } } } Pack.Sync = PackSync module.exports = Pack /***/ }), /***/ 78221: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // this[BUFFER] is the remainder of a chunk if we're waiting for // the full 512 bytes of a header to come in. We will Buffer.concat() // it to the next write(), which is a mem copy, but a small one. // // this[QUEUE] is a Yallist of entries that haven't been emitted // yet this can only get filled up if the user keeps write()ing after // a write() returns false, or does a write() with more than one entry // // We don't buffer chunks, we always parse them and either create an // entry, or push it into the active entry. The ReadEntry class knows // to throw data away if .ignore=true // // Shift entry off the buffer when it emits 'end', and emit 'entry' for // the next one in the list. // // At any time, we're pushing body chunks into the entry at WRITEENTRY, // and waiting for 'end' on the entry at READENTRY // // ignored entries get .resume() called on them straight away const warner = __webpack_require__(85899) const Header = __webpack_require__(66043) const EE = __webpack_require__(28614) const Yallist = __webpack_require__(40665) const maxMetaEntrySize = 1024 * 1024 const Entry = __webpack_require__(38116) const Pax = __webpack_require__(77996) const zlib = __webpack_require__(33486) const gzipHeader = Buffer.from([0x1f, 0x8b]) const STATE = Symbol('state') const WRITEENTRY = Symbol('writeEntry') const READENTRY = Symbol('readEntry') const NEXTENTRY = Symbol('nextEntry') const PROCESSENTRY = Symbol('processEntry') const EX = Symbol('extendedHeader') const GEX = Symbol('globalExtendedHeader') const META = Symbol('meta') const EMITMETA = Symbol('emitMeta') const BUFFER = Symbol('buffer') const QUEUE = Symbol('queue') const ENDED = Symbol('ended') const EMITTEDEND = Symbol('emittedEnd') const EMIT = Symbol('emit') const UNZIP = Symbol('unzip') const CONSUMECHUNK = Symbol('consumeChunk') const CONSUMECHUNKSUB = Symbol('consumeChunkSub') const CONSUMEBODY = Symbol('consumeBody') const CONSUMEMETA = Symbol('consumeMeta') const CONSUMEHEADER = Symbol('consumeHeader') const CONSUMING = Symbol('consuming') const BUFFERCONCAT = Symbol('bufferConcat') const MAYBEEND = Symbol('maybeEnd') const WRITING = Symbol('writing') const ABORTED = Symbol('aborted') const DONE = Symbol('onDone') const SAW_VALID_ENTRY = Symbol('sawValidEntry') const SAW_NULL_BLOCK = Symbol('sawNullBlock') const SAW_EOF = Symbol('sawEOF') const noop = _ => true module.exports = warner(class Parser extends EE { constructor (opt) { opt = opt || {} super(opt) this.file = opt.file || '' // set to boolean false when an entry starts. 1024 bytes of \0 // is technically a valid tarball, albeit a boring one. this[SAW_VALID_ENTRY] = null // these BADARCHIVE errors can't be detected early. listen on DONE. this.on(DONE, _ => { if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) { // either less than 1 block of data, or all entries were invalid. // Either way, probably not even a tarball. this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format') } }) if (opt.ondone) this.on(DONE, opt.ondone) else { this.on(DONE, _ => { this.emit('prefinish') this.emit('finish') this.emit('end') this.emit('close') }) } this.strict = !!opt.strict this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize this.filter = typeof opt.filter === 'function' ? opt.filter : noop // have to set this so that streams are ok piping into it this.writable = true this.readable = false this[QUEUE] = new Yallist() this[BUFFER] = null this[READENTRY] = null this[WRITEENTRY] = null this[STATE] = 'begin' this[META] = '' this[EX] = null this[GEX] = null this[ENDED] = false this[UNZIP] = null this[ABORTED] = false this[SAW_NULL_BLOCK] = false this[SAW_EOF] = false if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) if (typeof opt.onentry === 'function') this.on('entry', opt.onentry) } [CONSUMEHEADER] (chunk, position) { if (this[SAW_VALID_ENTRY] === null) this[SAW_VALID_ENTRY] = false let header try { header = new Header(chunk, position, this[EX], this[GEX]) } catch (er) { return this.warn('TAR_ENTRY_INVALID', er) } if (header.nullBlock) { if (this[SAW_NULL_BLOCK]) { this[SAW_EOF] = true // ending an archive with no entries. pointless, but legal. if (this[STATE] === 'begin') this[STATE] = 'header' this[EMIT]('eof') } else { this[SAW_NULL_BLOCK] = true this[EMIT]('nullBlock') } } else { this[SAW_NULL_BLOCK] = false if (!header.cksumValid) this.warn('TAR_ENTRY_INVALID', 'checksum failure', {header}) else if (!header.path) this.warn('TAR_ENTRY_INVALID', 'path is required', {header}) else { const type = header.type if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) this.warn('TAR_ENTRY_INVALID', 'linkpath required', {header}) else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', {header}) else { const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]) // we do this for meta & ignored entries as well, because they // are still valid tar, or else we wouldn't know to ignore them if (!this[SAW_VALID_ENTRY]) { if (entry.remain) { // this might be the one! const onend = () => { if (!entry.invalid) this[SAW_VALID_ENTRY] = true } entry.on('end', onend) } else this[SAW_VALID_ENTRY] = true } if (entry.meta) { if (entry.size > this.maxMetaEntrySize) { entry.ignore = true this[EMIT]('ignoredEntry', entry) this[STATE] = 'ignore' entry.resume() } else if (entry.size > 0) { this[META] = '' entry.on('data', c => this[META] += c) this[STATE] = 'meta' } } else { this[EX] = null entry.ignore = entry.ignore || !this.filter(entry.path, entry) if (entry.ignore) { // probably valid, just not something we care about this[EMIT]('ignoredEntry', entry) this[STATE] = entry.remain ? 'ignore' : 'header' entry.resume() } else { if (entry.remain) this[STATE] = 'body' else { this[STATE] = 'header' entry.end() } if (!this[READENTRY]) { this[QUEUE].push(entry) this[NEXTENTRY]() } else this[QUEUE].push(entry) } } } } } } [PROCESSENTRY] (entry) { let go = true if (!entry) { this[READENTRY] = null go = false } else if (Array.isArray(entry)) this.emit.apply(this, entry) else { this[READENTRY] = entry this.emit('entry', entry) if (!entry.emittedEnd) { entry.on('end', _ => this[NEXTENTRY]()) go = false } } return go } [NEXTENTRY] () { do {} while (this[PROCESSENTRY](this[QUEUE].shift())) if (!this[QUEUE].length) { // At this point, there's nothing in the queue, but we may have an // entry which is being consumed (readEntry). // If we don't, then we definitely can handle more data. // If we do, and either it's flowing, or it has never had any data // written to it, then it needs more. // The only other possibility is that it has returned false from a // write() call, so we wait for the next drain to continue. const re = this[READENTRY] const drainNow = !re || re.flowing || re.size === re.remain if (drainNow) { if (!this[WRITING]) this.emit('drain') } else re.once('drain', _ => this.emit('drain')) } } [CONSUMEBODY] (chunk, position) { // write up to but no more than writeEntry.blockRemain const entry = this[WRITEENTRY] const br = entry.blockRemain const c = (br >= chunk.length && position === 0) ? chunk : chunk.slice(position, position + br) entry.write(c) if (!entry.blockRemain) { this[STATE] = 'header' this[WRITEENTRY] = null entry.end() } return c.length } [CONSUMEMETA] (chunk, position) { const entry = this[WRITEENTRY] const ret = this[CONSUMEBODY](chunk, position) // if we finished, then the entry is reset if (!this[WRITEENTRY]) this[EMITMETA](entry) return ret } [EMIT] (ev, data, extra) { if (!this[QUEUE].length && !this[READENTRY]) this.emit(ev, data, extra) else this[QUEUE].push([ev, data, extra]) } [EMITMETA] (entry) { this[EMIT]('meta', this[META]) switch (entry.type) { case 'ExtendedHeader': case 'OldExtendedHeader': this[EX] = Pax.parse(this[META], this[EX], false) break case 'GlobalExtendedHeader': this[GEX] = Pax.parse(this[META], this[GEX], true) break case 'NextFileHasLongPath': case 'OldGnuLongPath': this[EX] = this[EX] || Object.create(null) this[EX].path = this[META].replace(/\0.*/, '') break case 'NextFileHasLongLinkpath': this[EX] = this[EX] || Object.create(null) this[EX].linkpath = this[META].replace(/\0.*/, '') break /* istanbul ignore next */ default: throw new Error('unknown meta: ' + entry.type) } } abort (error) { this[ABORTED] = true this.emit('abort', error) // always throws, even in non-strict mode this.warn('TAR_ABORT', error, { recoverable: false }) } write (chunk) { if (this[ABORTED]) return // first write, might be gzipped if (this[UNZIP] === null && chunk) { if (this[BUFFER]) { chunk = Buffer.concat([this[BUFFER], chunk]) this[BUFFER] = null } if (chunk.length < gzipHeader.length) { this[BUFFER] = chunk return true } for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) { if (chunk[i] !== gzipHeader[i]) this[UNZIP] = false } if (this[UNZIP] === null) { const ended = this[ENDED] this[ENDED] = false this[UNZIP] = new zlib.Unzip() this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk)) this[UNZIP].on('error', er => this.abort(er)) this[UNZIP].on('end', _ => { this[ENDED] = true this[CONSUMECHUNK]() }) this[WRITING] = true const ret = this[UNZIP][ended ? 'end' : 'write'](chunk) this[WRITING] = false return ret } } this[WRITING] = true if (this[UNZIP]) this[UNZIP].write(chunk) else this[CONSUMECHUNK](chunk) this[WRITING] = false // return false if there's a queue, or if the current entry isn't flowing const ret = this[QUEUE].length ? false : this[READENTRY] ? this[READENTRY].flowing : true // if we have no queue, then that means a clogged READENTRY if (!ret && !this[QUEUE].length) this[READENTRY].once('drain', _ => this.emit('drain')) return ret } [BUFFERCONCAT] (c) { if (c && !this[ABORTED]) this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c } [MAYBEEND] () { if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED] && !this[CONSUMING]) { this[EMITTEDEND] = true const entry = this[WRITEENTRY] if (entry && entry.blockRemain) { // truncated, likely a damaged file const have = this[BUFFER] ? this[BUFFER].length : 0 this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${ entry.blockRemain} more bytes, only ${have} available)`, {entry}) if (this[BUFFER]) entry.write(this[BUFFER]) entry.end() } this[EMIT](DONE) } } [CONSUMECHUNK] (chunk) { if (this[CONSUMING]) this[BUFFERCONCAT](chunk) else if (!chunk && !this[BUFFER]) this[MAYBEEND]() else { this[CONSUMING] = true if (this[BUFFER]) { this[BUFFERCONCAT](chunk) const c = this[BUFFER] this[BUFFER] = null this[CONSUMECHUNKSUB](c) } else this[CONSUMECHUNKSUB](chunk) while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED] && !this[SAW_EOF]) { const c = this[BUFFER] this[BUFFER] = null this[CONSUMECHUNKSUB](c) } this[CONSUMING] = false } if (!this[BUFFER] || this[ENDED]) this[MAYBEEND]() } [CONSUMECHUNKSUB] (chunk) { // we know that we are in CONSUMING mode, so anything written goes into // the buffer. Advance the position and put any remainder in the buffer. let position = 0 const length = chunk.length while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) { switch (this[STATE]) { case 'begin': case 'header': this[CONSUMEHEADER](chunk, position) position += 512 break case 'ignore': case 'body': position += this[CONSUMEBODY](chunk, position) break case 'meta': position += this[CONSUMEMETA](chunk, position) break /* istanbul ignore next */ default: throw new Error('invalid state: ' + this[STATE]) } } if (position < length) { if (this[BUFFER]) this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]]) else this[BUFFER] = chunk.slice(position) } } end (chunk) { if (!this[ABORTED]) { if (this[UNZIP]) this[UNZIP].end(chunk) else { this[ENDED] = true this.write(chunk) } } } }) /***/ }), /***/ 99587: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // A path exclusive reservation system // reserve([list, of, paths], fn) // When the fn is first in line for all its paths, it // is called with a cb that clears the reservation. // // Used by async unpack to avoid clobbering paths in use, // while still allowing maximal safe parallelization. const assert = __webpack_require__(42357) module.exports = () => { // path => [function or Set] // A Set object means a directory reservation // A fn is a direct reservation on that path const queues = new Map() // fn => {paths:[path,...], dirs:[path, ...]} const reservations = new Map() // return a set of parent dirs for a given path const { join } = __webpack_require__(85622) const getDirs = path => join(path).split(/[\\/]/).slice(0, -1).reduce((set, path) => set.length ? set.concat(join(set[set.length - 1], path)) : [path], []) // functions currently running const running = new Set() // return the queues for each path the function cares about // fn => {paths, dirs} const getQueues = fn => { const res = reservations.get(fn) /* istanbul ignore if - unpossible */ if (!res) throw new Error('function does not have any path reservations') return { paths: res.paths.map(path => queues.get(path)), dirs: [...res.dirs].map(path => queues.get(path)), } } // check if fn is first in line for all its paths, and is // included in the first set for all its dir queues const check = fn => { const {paths, dirs} = getQueues(fn) return paths.every(q => q[0] === fn) && dirs.every(q => q[0] instanceof Set && q[0].has(fn)) } // run the function if it's first in line and not already running const run = fn => { if (running.has(fn) || !check(fn)) return false running.add(fn) fn(() => clear(fn)) return true } const clear = fn => { if (!running.has(fn)) return false const { paths, dirs } = reservations.get(fn) const next = new Set() paths.forEach(path => { const q = queues.get(path) assert.equal(q[0], fn) if (q.length === 1) queues.delete(path) else { q.shift() if (typeof q[0] === 'function') next.add(q[0]) else q[0].forEach(fn => next.add(fn)) } }) dirs.forEach(dir => { const q = queues.get(dir) assert(q[0] instanceof Set) if (q[0].size === 1 && q.length === 1) queues.delete(dir) else if (q[0].size === 1) { q.shift() // must be a function or else the Set would've been reused next.add(q[0]) } else q[0].delete(fn) }) running.delete(fn) next.forEach(fn => run(fn)) return true } const reserve = (paths, fn) => { const dirs = new Set( paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b)) ) reservations.set(fn, {dirs, paths}) paths.forEach(path => { const q = queues.get(path) if (!q) queues.set(path, [fn]) else q.push(fn) }) dirs.forEach(dir => { const q = queues.get(dir) if (!q) queues.set(dir, [new Set([fn])]) else if (q[q.length - 1] instanceof Set) q[q.length - 1].add(fn) else q.push(new Set([fn])) }) return run(fn) } return { check, reserve } } /***/ }), /***/ 77996: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const Header = __webpack_require__(66043) const path = __webpack_require__(85622) class Pax { constructor (obj, global) { this.atime = obj.atime || null this.charset = obj.charset || null this.comment = obj.comment || null this.ctime = obj.ctime || null this.gid = obj.gid || null this.gname = obj.gname || null this.linkpath = obj.linkpath || null this.mtime = obj.mtime || null this.path = obj.path || null this.size = obj.size || null this.uid = obj.uid || null this.uname = obj.uname || null this.dev = obj.dev || null this.ino = obj.ino || null this.nlink = obj.nlink || null this.global = global || false } encode () { const body = this.encodeBody() if (body === '') return null const bodyLen = Buffer.byteLength(body) // round up to 512 bytes // add 512 for header const bufLen = 512 * Math.ceil(1 + bodyLen / 512) const buf = Buffer.allocUnsafe(bufLen) // 0-fill the header section, it might not hit every field for (let i = 0; i < 512; i++) buf[i] = 0 new Header({ // XXX split the path // then the path should be PaxHeader + basename, but less than 99, // prepend with the dirname path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99), mode: this.mode || 0o644, uid: this.uid || null, gid: this.gid || null, size: bodyLen, mtime: this.mtime || null, type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader', linkpath: '', uname: this.uname || '', gname: this.gname || '', devmaj: 0, devmin: 0, atime: this.atime || null, ctime: this.ctime || null, }).encode(buf) buf.write(body, 512, bodyLen, 'utf8') // null pad after the body for (let i = bodyLen + 512; i < buf.length; i++) buf[i] = 0 return buf } encodeBody () { return ( this.encodeField('path') + this.encodeField('ctime') + this.encodeField('atime') + this.encodeField('dev') + this.encodeField('ino') + this.encodeField('nlink') + this.encodeField('charset') + this.encodeField('comment') + this.encodeField('gid') + this.encodeField('gname') + this.encodeField('linkpath') + this.encodeField('mtime') + this.encodeField('size') + this.encodeField('uid') + this.encodeField('uname') ) } encodeField (field) { if (this[field] === null || this[field] === undefined) return '' const v = this[field] instanceof Date ? this[field].getTime() / 1000 : this[field] const s = ' ' + (field === 'dev' || field === 'ino' || field === 'nlink' ? 'SCHILY.' : '') + field + '=' + v + '\n' const byteLen = Buffer.byteLength(s) // the digits includes the length of the digits in ascii base-10 // so if it's 9 characters, then adding 1 for the 9 makes it 10 // which makes it 11 chars. let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1 if (byteLen + digits >= Math.pow(10, digits)) digits += 1 const len = digits + byteLen return len + s } } Pax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g) const merge = (a, b) => b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a const parseKV = string => string .replace(/\n$/, '') .split('\n') .reduce(parseKVLine, Object.create(null)) const parseKVLine = (set, line) => { const n = parseInt(line, 10) // XXX Values with \n in them will fail this. // Refactor to not be a naive line-by-line parse. if (n !== Buffer.byteLength(line) + 1) return set line = line.substr((n + ' ').length) const kv = line.split('=') const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, '$1') if (!k) return set const v = kv.join('=') set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(v * 1000) : /^[0-9]+$/.test(v) ? +v : v return set } module.exports = Pax /***/ }), /***/ 38116: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const MiniPass = __webpack_require__(73078) const SLURP = Symbol('slurp') module.exports = class ReadEntry extends MiniPass { constructor (header, ex, gex) { super() // read entries always start life paused. this is to avoid the // situation where Minipass's auto-ending empty streams results // in an entry ending before we're ready for it. this.pause() this.extended = ex this.globalExtended = gex this.header = header this.startBlockSize = 512 * Math.ceil(header.size / 512) this.blockRemain = this.startBlockSize this.remain = header.size this.type = header.type this.meta = false this.ignore = false switch (this.type) { case 'File': case 'OldFile': case 'Link': case 'SymbolicLink': case 'CharacterDevice': case 'BlockDevice': case 'Directory': case 'FIFO': case 'ContiguousFile': case 'GNUDumpDir': break case 'NextFileHasLongLinkpath': case 'NextFileHasLongPath': case 'OldGnuLongPath': case 'GlobalExtendedHeader': case 'ExtendedHeader': case 'OldExtendedHeader': this.meta = true break // NOTE: gnutar and bsdtar treat unrecognized types as 'File' // it may be worth doing the same, but with a warning. default: this.ignore = true } this.path = header.path this.mode = header.mode if (this.mode) this.mode = this.mode & 0o7777 this.uid = header.uid this.gid = header.gid this.uname = header.uname this.gname = header.gname this.size = header.size this.mtime = header.mtime this.atime = header.atime this.ctime = header.ctime this.linkpath = header.linkpath this.uname = header.uname this.gname = header.gname if (ex) this[SLURP](ex) if (gex) this[SLURP](gex, true) } write (data) { const writeLen = data.length if (writeLen > this.blockRemain) throw new Error('writing more to entry than is appropriate') const r = this.remain const br = this.blockRemain this.remain = Math.max(0, r - writeLen) this.blockRemain = Math.max(0, br - writeLen) if (this.ignore) return true if (r >= writeLen) return super.write(data) // r < writeLen return super.write(data.slice(0, r)) } [SLURP] (ex, global) { for (const k in ex) { // we slurp in everything except for the path attribute in // a global extended header, because that's weird. if (ex[k] !== null && ex[k] !== undefined && !(global && k === 'path')) this[k] = ex[k] } } } /***/ }), /***/ 45923: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // tar -r const hlo = __webpack_require__(95274) const Pack = __webpack_require__(7900) const fs = __webpack_require__(35747) const fsm = __webpack_require__(27714) const t = __webpack_require__(51525) const path = __webpack_require__(85622) // starting at the head of the file, read a Header // If the checksum is invalid, that's our position to start writing // If it is, jump forward by the specified size (round up to 512) // and try again. // Write the new Pack stream starting there. const Header = __webpack_require__(66043) module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) throw new TypeError('file is required') if (opt.gzip) throw new TypeError('cannot append to compressed archives') if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) return opt.sync ? replaceSync(opt, files) : replace(opt, files, cb) } const replaceSync = (opt, files) => { const p = new Pack.Sync(opt) let threw = true let fd let position try { try { fd = fs.openSync(opt.file, 'r+') } catch (er) { if (er.code === 'ENOENT') fd = fs.openSync(opt.file, 'w+') else throw er } const st = fs.fstatSync(fd) const headBuf = Buffer.alloc(512) POSITION: for (position = 0; position < st.size; position += 512) { for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) { bytes = fs.readSync( fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos ) if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) throw new Error('cannot append to compressed archives') if (!bytes) break POSITION } const h = new Header(headBuf) if (!h.cksumValid) break const entryBlockSize = 512 * Math.ceil(h.size / 512) if (position + entryBlockSize + 512 > st.size) break // the 512 for the header we just parsed will be added as well // also jump ahead all the blocks for the body position += entryBlockSize if (opt.mtimeCache) opt.mtimeCache.set(h.path, h.mtime) } threw = false streamSync(opt, p, position, fd, files) } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } } } const streamSync = (opt, p, position, fd, files) => { const stream = new fsm.WriteStreamSync(opt.file, { fd: fd, start: position, }) p.pipe(stream) addFilesSync(p, files) } const replace = (opt, files, cb) => { files = Array.from(files) const p = new Pack(opt) const getPos = (fd, size, cb_) => { const cb = (er, pos) => { if (er) fs.close(fd, _ => cb_(er)) else cb_(null, pos) } let position = 0 if (size === 0) return cb(null, 0) let bufPos = 0 const headBuf = Buffer.alloc(512) const onread = (er, bytes) => { if (er) return cb(er) bufPos += bytes if (bufPos < 512 && bytes) { return fs.read( fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread ) } if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) return cb(new Error('cannot append to compressed archives')) // truncated header if (bufPos < 512) return cb(null, position) const h = new Header(headBuf) if (!h.cksumValid) return cb(null, position) const entryBlockSize = 512 * Math.ceil(h.size / 512) if (position + entryBlockSize + 512 > size) return cb(null, position) position += entryBlockSize + 512 if (position >= size) return cb(null, position) if (opt.mtimeCache) opt.mtimeCache.set(h.path, h.mtime) bufPos = 0 fs.read(fd, headBuf, 0, 512, position, onread) } fs.read(fd, headBuf, 0, 512, position, onread) } const promise = new Promise((resolve, reject) => { p.on('error', reject) let flag = 'r+' const onopen = (er, fd) => { if (er && er.code === 'ENOENT' && flag === 'r+') { flag = 'w+' return fs.open(opt.file, flag, onopen) } if (er) return reject(er) fs.fstat(fd, (er, st) => { if (er) return reject(er) getPos(fd, st.size, (er, position) => { if (er) return reject(er) const stream = new fsm.WriteStream(opt.file, { fd: fd, start: position, }) p.pipe(stream) stream.on('error', reject) stream.on('close', resolve) addFilesAsync(p, files) }) }) } fs.open(opt.file, flag, onopen) }) return cb ? promise.then(cb, cb) : promise } const addFilesSync = (p, files) => { files.forEach(file => { if (file.charAt(0) === '@') { t({ file: path.resolve(p.cwd, file.substr(1)), sync: true, noResume: true, onentry: entry => p.add(entry), }) } else p.add(file) }) p.end() } const addFilesAsync = (p, files) => { while (files.length) { const file = files.shift() if (file.charAt(0) === '@') { return t({ file: path.resolve(p.cwd, file.substr(1)), noResume: true, onentry: entry => p.add(entry), }).then(_ => addFilesAsync(p, files)) } else p.add(file) } p.end() } /***/ }), /***/ 24173: /***/ ((__unused_webpack_module, exports) => { "use strict"; // map types from key to human-friendly name exports.name = new Map([ ['0', 'File'], // same as File ['', 'OldFile'], ['1', 'Link'], ['2', 'SymbolicLink'], // Devices and FIFOs aren't fully supported // they are parsed, but skipped when unpacking ['3', 'CharacterDevice'], ['4', 'BlockDevice'], ['5', 'Directory'], ['6', 'FIFO'], // same as File ['7', 'ContiguousFile'], // pax headers ['g', 'GlobalExtendedHeader'], ['x', 'ExtendedHeader'], // vendor-specific stuff // skip ['A', 'SolarisACL'], // like 5, but with data, which should be skipped ['D', 'GNUDumpDir'], // metadata only, skip ['I', 'Inode'], // data = link path of next file ['K', 'NextFileHasLongLinkpath'], // data = path of next file ['L', 'NextFileHasLongPath'], // skip ['M', 'ContinuationFile'], // like L ['N', 'OldGnuLongPath'], // skip ['S', 'SparseFile'], // skip ['V', 'TapeVolumeHeader'], // like x ['X', 'OldExtendedHeader'], ]) // map the other direction exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]])) /***/ }), /***/ 17628: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet. // but the path reservations are required to avoid race conditions where // parallelized unpack ops may mess with one another, due to dependencies // (like a Link depending on its target) or destructive operations (like // clobbering an fs object to create one of a different type.) const assert = __webpack_require__(42357) const Parser = __webpack_require__(78221) const fs = __webpack_require__(35747) const fsm = __webpack_require__(27714) const path = __webpack_require__(85622) const mkdir = __webpack_require__(69624) const wc = __webpack_require__(44808) const pathReservations = __webpack_require__(99587) const ONENTRY = Symbol('onEntry') const CHECKFS = Symbol('checkFs') const CHECKFS2 = Symbol('checkFs2') const ISREUSABLE = Symbol('isReusable') const MAKEFS = Symbol('makeFs') const FILE = Symbol('file') const DIRECTORY = Symbol('directory') const LINK = Symbol('link') const SYMLINK = Symbol('symlink') const HARDLINK = Symbol('hardlink') const UNSUPPORTED = Symbol('unsupported') const CHECKPATH = Symbol('checkPath') const MKDIR = Symbol('mkdir') const ONERROR = Symbol('onError') const PENDING = Symbol('pending') const PEND = Symbol('pend') const UNPEND = Symbol('unpend') const ENDED = Symbol('ended') const MAYBECLOSE = Symbol('maybeClose') const SKIP = Symbol('skip') const DOCHOWN = Symbol('doChown') const UID = Symbol('uid') const GID = Symbol('gid') const crypto = __webpack_require__(76417) const getFlag = __webpack_require__(91172) /* istanbul ignore next */ const neverCalled = () => { throw new Error('sync function called cb somehow?!?') } // Unlinks on Windows are not atomic. // // This means that if you have a file entry, followed by another // file entry with an identical name, and you cannot re-use the file // (because it's a hardlink, or because unlink:true is set, or it's // Windows, which does not have useful nlink values), then the unlink // will be committed to the disk AFTER the new file has been written // over the old one, deleting the new file. // // To work around this, on Windows systems, we rename the file and then // delete the renamed file. It's a sloppy kludge, but frankly, I do not // know of a better way to do this, given windows' non-atomic unlink // semantics. // // See: https://github.com/npm/node-tar/issues/183 /* istanbul ignore next */ const unlinkFile = (path, cb) => { if (process.platform !== 'win32') return fs.unlink(path, cb) const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') fs.rename(path, name, er => { if (er) return cb(er) fs.unlink(name, cb) }) } /* istanbul ignore next */ const unlinkFileSync = path => { if (process.platform !== 'win32') return fs.unlinkSync(path) const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') fs.renameSync(path, name) fs.unlinkSync(name) } // this.gid, entry.gid, this.processUid const uint32 = (a, b, c) => a === a >>> 0 ? a : b === b >>> 0 ? b : c class Unpack extends Parser { constructor (opt) { if (!opt) opt = {} opt.ondone = _ => { this[ENDED] = true this[MAYBECLOSE]() } super(opt) this.reservations = pathReservations() this.transform = typeof opt.transform === 'function' ? opt.transform : null this.writable = true this.readable = false this[PENDING] = 0 this[ENDED] = false this.dirCache = opt.dirCache || new Map() if (typeof opt.uid === 'number' || typeof opt.gid === 'number') { // need both or neither if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number') throw new TypeError('cannot set owner without number uid and gid') if (opt.preserveOwner) { throw new TypeError( 'cannot preserve owner in archive and also set owner explicitly') } this.uid = opt.uid this.gid = opt.gid this.setOwner = true } else { this.uid = null this.gid = null this.setOwner = false } // default true for root if (opt.preserveOwner === undefined && typeof opt.uid !== 'number') this.preserveOwner = process.getuid && process.getuid() === 0 else this.preserveOwner = !!opt.preserveOwner this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null // mostly just for testing, but useful in some cases. // Forcibly trigger a chown on every entry, no matter what this.forceChown = opt.forceChown === true // turn > this[ONENTRY](entry)) } // a bad or damaged archive is a warning for Parser, but an error // when extracting. Mark those errors as unrecoverable, because // the Unpack contract cannot be met. warn (code, msg, data = {}) { if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') data.recoverable = false return super.warn(code, msg, data) } [MAYBECLOSE] () { if (this[ENDED] && this[PENDING] === 0) { this.emit('prefinish') this.emit('finish') this.emit('end') this.emit('close') } } [CHECKPATH] (entry) { if (this.strip) { const parts = entry.path.split(/\/|\\/) if (parts.length < this.strip) return false entry.path = parts.slice(this.strip).join('/') if (entry.type === 'Link') { const linkparts = entry.linkpath.split(/\/|\\/) if (linkparts.length >= this.strip) entry.linkpath = linkparts.slice(this.strip).join('/') } } if (!this.preservePaths) { const p = entry.path if (p.match(/(^|\/|\\)\.\.(\\|\/|$)/)) { this.warn('TAR_ENTRY_ERROR', `path contains '..'`, { entry, path: p, }) return false } // absolutes on posix are also absolutes on win32 // so we only need to test this one to get both if (path.win32.isAbsolute(p)) { const parsed = path.win32.parse(p) entry.path = p.substr(parsed.root.length) const r = parsed.root this.warn('TAR_ENTRY_INFO', `stripping ${r} from absolute path`, { entry, path: p, }) } } // only encode : chars that aren't drive letter indicators if (this.win32) { const parsed = path.win32.parse(entry.path) entry.path = parsed.root === '' ? wc.encode(entry.path) : parsed.root + wc.encode(entry.path.substr(parsed.root.length)) } if (path.isAbsolute(entry.path)) entry.absolute = entry.path else entry.absolute = path.resolve(this.cwd, entry.path) return true } [ONENTRY] (entry) { if (!this[CHECKPATH](entry)) return entry.resume() assert.equal(typeof entry.absolute, 'string') switch (entry.type) { case 'Directory': case 'GNUDumpDir': if (entry.mode) entry.mode = entry.mode | 0o700 case 'File': case 'OldFile': case 'ContiguousFile': case 'Link': case 'SymbolicLink': return this[CHECKFS](entry) case 'CharacterDevice': case 'BlockDevice': case 'FIFO': default: return this[UNSUPPORTED](entry) } } [ONERROR] (er, entry) { // Cwd has to exist, or else nothing works. That's serious. // Other errors are warnings, which raise the error in strict // mode, but otherwise continue on. if (er.name === 'CwdError') this.emit('error', er) else { this.warn('TAR_ENTRY_ERROR', er, {entry}) this[UNPEND]() entry.resume() } } [MKDIR] (dir, mode, cb) { mkdir(dir, { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cache: this.dirCache, cwd: this.cwd, mode: mode, noChmod: this.noChmod, }, cb) } [DOCHOWN] (entry) { // in preserve owner mode, chown if the entry doesn't match process // in set owner mode, chown if setting doesn't match process return this.forceChown || this.preserveOwner && (typeof entry.uid === 'number' && entry.uid !== this.processUid || typeof entry.gid === 'number' && entry.gid !== this.processGid) || (typeof this.uid === 'number' && this.uid !== this.processUid || typeof this.gid === 'number' && this.gid !== this.processGid) } [UID] (entry) { return uint32(this.uid, entry.uid, this.processUid) } [GID] (entry) { return uint32(this.gid, entry.gid, this.processGid) } [FILE] (entry, fullyDone) { const mode = entry.mode & 0o7777 || this.fmode const stream = new fsm.WriteStream(entry.absolute, { flags: getFlag(entry.size), mode: mode, autoClose: false, }) stream.on('error', er => this[ONERROR](er, entry)) let actions = 1 const done = er => { if (er) return this[ONERROR](er, entry) if (--actions === 0) { fs.close(stream.fd, er => { fullyDone() er ? this[ONERROR](er, entry) : this[UNPEND]() }) } } stream.on('finish', _ => { // if futimes fails, try utimes // if utimes fails, fail with the original error // same for fchown/chown const abs = entry.absolute const fd = stream.fd if (entry.mtime && !this.noMtime) { actions++ const atime = entry.atime || new Date() const mtime = entry.mtime fs.futimes(fd, atime, mtime, er => er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er)) : done()) } if (this[DOCHOWN](entry)) { actions++ const uid = this[UID](entry) const gid = this[GID](entry) fs.fchown(fd, uid, gid, er => er ? fs.chown(abs, uid, gid, er2 => done(er2 && er)) : done()) } done() }) const tx = this.transform ? this.transform(entry) || entry : entry if (tx !== entry) { tx.on('error', er => this[ONERROR](er, entry)) entry.pipe(tx) } tx.pipe(stream) } [DIRECTORY] (entry, fullyDone) { const mode = entry.mode & 0o7777 || this.dmode this[MKDIR](entry.absolute, mode, er => { if (er) { fullyDone() return this[ONERROR](er, entry) } let actions = 1 const done = _ => { if (--actions === 0) { fullyDone() this[UNPEND]() entry.resume() } } if (entry.mtime && !this.noMtime) { actions++ fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done) } if (this[DOCHOWN](entry)) { actions++ fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done) } done() }) } [UNSUPPORTED] (entry) { entry.unsupported = true this.warn('TAR_ENTRY_UNSUPPORTED', `unsupported entry type: ${entry.type}`, {entry}) entry.resume() } [SYMLINK] (entry, done) { this[LINK](entry, entry.linkpath, 'symlink', done) } [HARDLINK] (entry, done) { this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link', done) } [PEND] () { this[PENDING]++ } [UNPEND] () { this[PENDING]-- this[MAYBECLOSE]() } [SKIP] (entry) { this[UNPEND]() entry.resume() } // Check if we can reuse an existing filesystem entry safely and // overwrite it, rather than unlinking and recreating // Windows doesn't report a useful nlink, so we just never reuse entries [ISREUSABLE] (entry, st) { return entry.type === 'File' && !this.unlink && st.isFile() && st.nlink <= 1 && process.platform !== 'win32' } // check if a thing is there, and if so, try to clobber it [CHECKFS] (entry) { this[PEND]() const paths = [entry.path] if (entry.linkpath) paths.push(entry.linkpath) this.reservations.reserve(paths, done => this[CHECKFS2](entry, done)) } [CHECKFS2] (entry, done) { this[MKDIR](path.dirname(entry.absolute), this.dmode, er => { if (er) { done() return this[ONERROR](er, entry) } fs.lstat(entry.absolute, (er, st) => { if (st && (this.keep || this.newer && st.mtime > entry.mtime)) { this[SKIP](entry) done() } else if (er || this[ISREUSABLE](entry, st)) this[MAKEFS](null, entry, done) else if (st.isDirectory()) { if (entry.type === 'Directory') { if (!this.noChmod && (!entry.mode || (st.mode & 0o7777) === entry.mode)) this[MAKEFS](null, entry, done) else { fs.chmod(entry.absolute, entry.mode, er => this[MAKEFS](er, entry, done)) } } else fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done)) } else unlinkFile(entry.absolute, er => this[MAKEFS](er, entry, done)) }) }) } [MAKEFS] (er, entry, done) { if (er) return this[ONERROR](er, entry) switch (entry.type) { case 'File': case 'OldFile': case 'ContiguousFile': return this[FILE](entry, done) case 'Link': return this[HARDLINK](entry, done) case 'SymbolicLink': return this[SYMLINK](entry, done) case 'Directory': case 'GNUDumpDir': return this[DIRECTORY](entry, done) } } [LINK] (entry, linkpath, link, done) { // XXX: get the type ('file' or 'dir') for windows fs[link](linkpath, entry.absolute, er => { if (er) return this[ONERROR](er, entry) done() this[UNPEND]() entry.resume() }) } } class UnpackSync extends Unpack { [CHECKFS] (entry) { const er = this[MKDIR](path.dirname(entry.absolute), this.dmode, neverCalled) if (er) return this[ONERROR](er, entry) try { const st = fs.lstatSync(entry.absolute) if (this.keep || this.newer && st.mtime > entry.mtime) return this[SKIP](entry) else if (this[ISREUSABLE](entry, st)) return this[MAKEFS](null, entry, neverCalled) else { try { if (st.isDirectory()) { if (entry.type === 'Directory') { if (!this.noChmod && entry.mode && (st.mode & 0o7777) !== entry.mode) fs.chmodSync(entry.absolute, entry.mode) } else fs.rmdirSync(entry.absolute) } else unlinkFileSync(entry.absolute) return this[MAKEFS](null, entry, neverCalled) } catch (er) { return this[ONERROR](er, entry) } } } catch (er) { return this[MAKEFS](null, entry, neverCalled) } } [FILE] (entry, _) { const mode = entry.mode & 0o7777 || this.fmode const oner = er => { let closeError try { fs.closeSync(fd) } catch (e) { closeError = e } if (er || closeError) this[ONERROR](er || closeError, entry) } let fd try { fd = fs.openSync(entry.absolute, getFlag(entry.size), mode) } catch (er) { return oner(er) } const tx = this.transform ? this.transform(entry) || entry : entry if (tx !== entry) { tx.on('error', er => this[ONERROR](er, entry)) entry.pipe(tx) } tx.on('data', chunk => { try { fs.writeSync(fd, chunk, 0, chunk.length) } catch (er) { oner(er) } }) tx.on('end', _ => { let er = null // try both, falling futimes back to utimes // if either fails, handle the first error if (entry.mtime && !this.noMtime) { const atime = entry.atime || new Date() const mtime = entry.mtime try { fs.futimesSync(fd, atime, mtime) } catch (futimeser) { try { fs.utimesSync(entry.absolute, atime, mtime) } catch (utimeser) { er = futimeser } } } if (this[DOCHOWN](entry)) { const uid = this[UID](entry) const gid = this[GID](entry) try { fs.fchownSync(fd, uid, gid) } catch (fchowner) { try { fs.chownSync(entry.absolute, uid, gid) } catch (chowner) { er = er || fchowner } } } oner(er) }) } [DIRECTORY] (entry, _) { const mode = entry.mode & 0o7777 || this.dmode const er = this[MKDIR](entry.absolute, mode) if (er) return this[ONERROR](er, entry) if (entry.mtime && !this.noMtime) { try { fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime) } catch (er) {} } if (this[DOCHOWN](entry)) { try { fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry)) } catch (er) {} } entry.resume() } [MKDIR] (dir, mode) { try { return mkdir.sync(dir, { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cache: this.dirCache, cwd: this.cwd, mode: mode, }) } catch (er) { return er } } [LINK] (entry, linkpath, link, _) { try { fs[link + 'Sync'](linkpath, entry.absolute) entry.resume() } catch (er) { return this[ONERROR](er, entry) } } } Unpack.Sync = UnpackSync module.exports = Unpack /***/ }), /***/ 94404: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // tar -u const hlo = __webpack_require__(95274) const r = __webpack_require__(45923) // just call tar.r with the filter and mtimeCache module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) throw new TypeError('file is required') if (opt.gzip) throw new TypeError('cannot append to compressed archives') if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) mtimeFilter(opt) return r(opt, files, cb) } const mtimeFilter = opt => { const filter = opt.filter if (!opt.mtimeCache) opt.mtimeCache = new Map() opt.filter = filter ? (path, stat) => filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime) : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime) } /***/ }), /***/ 85899: /***/ ((module) => { "use strict"; module.exports = Base => class extends Base { warn (code, message, data = {}) { if (this.file) data.file = this.file if (this.cwd) data.cwd = this.cwd data.code = message instanceof Error && message.code || code data.tarCode = code if (!this.strict && data.recoverable !== false) { if (message instanceof Error) { data = Object.assign(message, data) message = message.message } this.emit('warn', data.tarCode, message, data) } else if (message instanceof Error) this.emit('error', Object.assign(message, data)) else this.emit('error', Object.assign(new Error(`${code}: ${message}`), data)) } } /***/ }), /***/ 44808: /***/ ((module) => { "use strict"; // When writing files on Windows, translate the characters to their // 0xf000 higher-encoded versions. const raw = [ '|', '<', '>', '?', ':', ] const win = raw.map(char => String.fromCharCode(0xf000 + char.charCodeAt(0))) const toWin = new Map(raw.map((char, i) => [char, win[i]])) const toRaw = new Map(win.map((char, i) => [char, raw[i]])) module.exports = { encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s), decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s), } /***/ }), /***/ 55450: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const MiniPass = __webpack_require__(73078) const Pax = __webpack_require__(77996) const Header = __webpack_require__(66043) const fs = __webpack_require__(35747) const path = __webpack_require__(85622) const maxReadSize = 16 * 1024 * 1024 const PROCESS = Symbol('process') const FILE = Symbol('file') const DIRECTORY = Symbol('directory') const SYMLINK = Symbol('symlink') const HARDLINK = Symbol('hardlink') const HEADER = Symbol('header') const READ = Symbol('read') const LSTAT = Symbol('lstat') const ONLSTAT = Symbol('onlstat') const ONREAD = Symbol('onread') const ONREADLINK = Symbol('onreadlink') const OPENFILE = Symbol('openfile') const ONOPENFILE = Symbol('onopenfile') const CLOSE = Symbol('close') const MODE = Symbol('mode') const warner = __webpack_require__(85899) const winchars = __webpack_require__(44808) const modeFix = __webpack_require__(88371) const WriteEntry = warner(class WriteEntry extends MiniPass { constructor (p, opt) { opt = opt || {} super(opt) if (typeof p !== 'string') throw new TypeError('path is required') this.path = p // suppress atime, ctime, uid, gid, uname, gname this.portable = !!opt.portable // until node has builtin pwnam functions, this'll have to do this.myuid = process.getuid && process.getuid() this.myuser = process.env.USER || '' this.maxReadSize = opt.maxReadSize || maxReadSize this.linkCache = opt.linkCache || new Map() this.statCache = opt.statCache || new Map() this.preservePaths = !!opt.preservePaths this.cwd = opt.cwd || process.cwd() this.strict = !!opt.strict this.noPax = !!opt.noPax this.noMtime = !!opt.noMtime this.mtime = opt.mtime || null if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) let pathWarn = false if (!this.preservePaths && path.win32.isAbsolute(p)) { // absolutes on posix are also absolutes on win32 // so we only need to test this one to get both const parsed = path.win32.parse(p) this.path = p.substr(parsed.root.length) pathWarn = parsed.root } this.win32 = !!opt.win32 || process.platform === 'win32' if (this.win32) { this.path = winchars.decode(this.path.replace(/\\/g, '/')) p = p.replace(/\\/g, '/') } this.absolute = opt.absolute || path.resolve(this.cwd, p) if (this.path === '') this.path = './' if (pathWarn) { this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { entry: this, path: pathWarn + this.path, }) } if (this.statCache.has(this.absolute)) this[ONLSTAT](this.statCache.get(this.absolute)) else this[LSTAT]() } [LSTAT] () { fs.lstat(this.absolute, (er, stat) => { if (er) return this.emit('error', er) this[ONLSTAT](stat) }) } [ONLSTAT] (stat) { this.statCache.set(this.absolute, stat) this.stat = stat if (!stat.isFile()) stat.size = 0 this.type = getType(stat) this.emit('stat', stat) this[PROCESS]() } [PROCESS] () { switch (this.type) { case 'File': return this[FILE]() case 'Directory': return this[DIRECTORY]() case 'SymbolicLink': return this[SYMLINK]() // unsupported types are ignored. default: return this.end() } } [MODE] (mode) { return modeFix(mode, this.type === 'Directory', this.portable) } [HEADER] () { if (this.type === 'Directory' && this.portable) this.noMtime = true this.header = new Header({ path: this.path, linkpath: this.linkpath, // only the permissions and setuid/setgid/sticky bitflags // not the higher-order bits that specify file type mode: this[MODE](this.stat.mode), uid: this.portable ? null : this.stat.uid, gid: this.portable ? null : this.stat.gid, size: this.stat.size, mtime: this.noMtime ? null : this.mtime || this.stat.mtime, type: this.type, uname: this.portable ? null : this.stat.uid === this.myuid ? this.myuser : '', atime: this.portable ? null : this.stat.atime, ctime: this.portable ? null : this.stat.ctime, }) if (this.header.encode() && !this.noPax) { this.write(new Pax({ atime: this.portable ? null : this.header.atime, ctime: this.portable ? null : this.header.ctime, gid: this.portable ? null : this.header.gid, mtime: this.noMtime ? null : this.mtime || this.header.mtime, path: this.path, linkpath: this.linkpath, size: this.header.size, uid: this.portable ? null : this.header.uid, uname: this.portable ? null : this.header.uname, dev: this.portable ? null : this.stat.dev, ino: this.portable ? null : this.stat.ino, nlink: this.portable ? null : this.stat.nlink, }).encode()) } this.write(this.header.block) } [DIRECTORY] () { if (this.path.substr(-1) !== '/') this.path += '/' this.stat.size = 0 this[HEADER]() this.end() } [SYMLINK] () { fs.readlink(this.absolute, (er, linkpath) => { if (er) return this.emit('error', er) this[ONREADLINK](linkpath) }) } [ONREADLINK] (linkpath) { this.linkpath = linkpath.replace(/\\/g, '/') this[HEADER]() this.end() } [HARDLINK] (linkpath) { this.type = 'Link' this.linkpath = path.relative(this.cwd, linkpath).replace(/\\/g, '/') this.stat.size = 0 this[HEADER]() this.end() } [FILE] () { if (this.stat.nlink > 1) { const linkKey = this.stat.dev + ':' + this.stat.ino if (this.linkCache.has(linkKey)) { const linkpath = this.linkCache.get(linkKey) if (linkpath.indexOf(this.cwd) === 0) return this[HARDLINK](linkpath) } this.linkCache.set(linkKey, this.absolute) } this[HEADER]() if (this.stat.size === 0) return this.end() this[OPENFILE]() } [OPENFILE] () { fs.open(this.absolute, 'r', (er, fd) => { if (er) return this.emit('error', er) this[ONOPENFILE](fd) }) } [ONOPENFILE] (fd) { const blockLen = 512 * Math.ceil(this.stat.size / 512) const bufLen = Math.min(blockLen, this.maxReadSize) const buf = Buffer.allocUnsafe(bufLen) this[READ](fd, buf, 0, buf.length, 0, this.stat.size, blockLen) } [READ] (fd, buf, offset, length, pos, remain, blockRemain) { fs.read(fd, buf, offset, length, pos, (er, bytesRead) => { if (er) { // ignoring the error from close(2) is a bad practice, but at // this point we already have an error, don't need another one return this[CLOSE](fd, () => this.emit('error', er)) } this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) }) } [CLOSE] (fd, cb) { fs.close(fd, cb) } [ONREAD] (fd, buf, offset, length, pos, remain, blockRemain, bytesRead) { if (bytesRead <= 0 && remain > 0) { const er = new Error('encountered unexpected EOF') er.path = this.absolute er.syscall = 'read' er.code = 'EOF' return this[CLOSE](fd, () => this.emit('error', er)) } if (bytesRead > remain) { const er = new Error('did not encounter expected EOF') er.path = this.absolute er.syscall = 'read' er.code = 'EOF' return this[CLOSE](fd, () => this.emit('error', er)) } // null out the rest of the buffer, if we could fit the block padding if (bytesRead === remain) { for (let i = bytesRead; i < length && bytesRead < blockRemain; i++) { buf[i + offset] = 0 bytesRead++ remain++ } } const writeBuf = offset === 0 && bytesRead === buf.length ? buf : buf.slice(offset, offset + bytesRead) remain -= bytesRead blockRemain -= bytesRead pos += bytesRead offset += bytesRead this.write(writeBuf) if (!remain) { if (blockRemain) this.write(Buffer.alloc(blockRemain)) return this[CLOSE](fd, er => er ? this.emit('error', er) : this.end()) } if (offset >= length) { buf = Buffer.allocUnsafe(length) offset = 0 } length = buf.length - offset this[READ](fd, buf, offset, length, pos, remain, blockRemain) } }) class WriteEntrySync extends WriteEntry { [LSTAT] () { this[ONLSTAT](fs.lstatSync(this.absolute)) } [SYMLINK] () { this[ONREADLINK](fs.readlinkSync(this.absolute)) } [OPENFILE] () { this[ONOPENFILE](fs.openSync(this.absolute, 'r')) } [READ] (fd, buf, offset, length, pos, remain, blockRemain) { let threw = true try { const bytesRead = fs.readSync(fd, buf, offset, length, pos) this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) threw = false } finally { // ignoring the error from close(2) is a bad practice, but at // this point we already have an error, don't need another one if (threw) { try { this[CLOSE](fd, () => {}) } catch (er) {} } } } [CLOSE] (fd, cb) { fs.closeSync(fd) cb() } } const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { constructor (readEntry, opt) { opt = opt || {} super(opt) this.preservePaths = !!opt.preservePaths this.portable = !!opt.portable this.strict = !!opt.strict this.noPax = !!opt.noPax this.noMtime = !!opt.noMtime this.readEntry = readEntry this.type = readEntry.type if (this.type === 'Directory' && this.portable) this.noMtime = true this.path = readEntry.path this.mode = this[MODE](readEntry.mode) this.uid = this.portable ? null : readEntry.uid this.gid = this.portable ? null : readEntry.gid this.uname = this.portable ? null : readEntry.uname this.gname = this.portable ? null : readEntry.gname this.size = readEntry.size this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime this.atime = this.portable ? null : readEntry.atime this.ctime = this.portable ? null : readEntry.ctime this.linkpath = readEntry.linkpath if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) let pathWarn = false if (path.isAbsolute(this.path) && !this.preservePaths) { const parsed = path.parse(this.path) pathWarn = parsed.root this.path = this.path.substr(parsed.root.length) } this.remain = readEntry.size this.blockRemain = readEntry.startBlockSize this.header = new Header({ path: this.path, linkpath: this.linkpath, // only the permissions and setuid/setgid/sticky bitflags // not the higher-order bits that specify file type mode: this.mode, uid: this.portable ? null : this.uid, gid: this.portable ? null : this.gid, size: this.size, mtime: this.noMtime ? null : this.mtime, type: this.type, uname: this.portable ? null : this.uname, atime: this.portable ? null : this.atime, ctime: this.portable ? null : this.ctime, }) if (pathWarn) { this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { entry: this, path: pathWarn + this.path, }) } if (this.header.encode() && !this.noPax) { super.write(new Pax({ atime: this.portable ? null : this.atime, ctime: this.portable ? null : this.ctime, gid: this.portable ? null : this.gid, mtime: this.noMtime ? null : this.mtime, path: this.path, linkpath: this.linkpath, size: this.size, uid: this.portable ? null : this.uid, uname: this.portable ? null : this.uname, dev: this.portable ? null : this.readEntry.dev, ino: this.portable ? null : this.readEntry.ino, nlink: this.portable ? null : this.readEntry.nlink, }).encode()) } super.write(this.header.block) readEntry.pipe(this) } [MODE] (mode) { return modeFix(mode, this.type === 'Directory', this.portable) } write (data) { const writeLen = data.length if (writeLen > this.blockRemain) throw new Error('writing more to entry than is appropriate') this.blockRemain -= writeLen return super.write(data) } end () { if (this.blockRemain) this.write(Buffer.alloc(this.blockRemain)) return super.end() } }) WriteEntry.Sync = WriteEntrySync WriteEntry.Tar = WriteEntryTar const getType = stat => stat.isFile() ? 'File' : stat.isDirectory() ? 'Directory' : stat.isSymbolicLink() ? 'SymbolicLink' : 'Unsupported' module.exports = WriteEntry /***/ }), /***/ 14920: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TeenyStatistics = exports.TeenyStatisticsWarning = void 0; /** * @class TeenyStatisticsWarning * @extends Error * @description While an error, is used for emitting warnings when * meeting certain configured thresholds. * @see process.emitWarning */ class TeenyStatisticsWarning extends Error { /** * @param {string} message */ constructor(message) { super(message); this.threshold = 0; this.type = ''; this.value = 0; this.name = this.constructor.name; Error.captureStackTrace(this, this.constructor); } } exports.TeenyStatisticsWarning = TeenyStatisticsWarning; TeenyStatisticsWarning.CONCURRENT_REQUESTS = 'ConcurrentRequestsExceededWarning'; /** * @class TeenyStatistics * @description Maintain various statistics internal to teeny-request. Tracking * is not automatic and must be instrumented within teeny-request. */ class TeenyStatistics { /** * @param {TeenyStatisticsOptions} [opts] */ constructor(opts) { /** * @type {number} * @private * @default 0 */ this._concurrentRequests = 0; /** * @type {boolean} * @private * @default false */ this._didConcurrentRequestWarn = false; this._options = TeenyStatistics._prepareOptions(opts); } /** * Returns a copy of the current options. * @return {TeenyStatisticsOptions} */ getOptions() { return Object.assign({}, this._options); } /** * Change configured statistics options. This will not preserve unspecified * options that were previously specified, i.e. this is a reset of options. * @param {TeenyStatisticsOptions} [opts] * @returns {TeenyStatisticsConfig} The previous options. * @see _prepareOptions */ setOptions(opts) { const oldOpts = this._options; this._options = TeenyStatistics._prepareOptions(opts); return oldOpts; } /** * @readonly * @return {TeenyStatisticsCounters} */ get counters() { return { concurrentRequests: this._concurrentRequests, }; } /** * @description Should call this right before making a request. */ requestStarting() { this._concurrentRequests++; if (this._options.concurrentRequests > 0 && this._concurrentRequests >= this._options.concurrentRequests && !this._didConcurrentRequestWarn) { this._didConcurrentRequestWarn = true; const warning = new TeenyStatisticsWarning('Possible excessive concurrent requests detected. ' + this._concurrentRequests + ' requests in-flight, which exceeds the configured threshold of ' + this._options.concurrentRequests + '. Use the TEENY_REQUEST_WARN_CONCURRENT_REQUESTS environment ' + 'variable or the concurrentRequests option of teeny-request to ' + 'increase or disable (0) this warning.'); warning.type = TeenyStatisticsWarning.CONCURRENT_REQUESTS; warning.value = this._concurrentRequests; warning.threshold = this._options.concurrentRequests; process.emitWarning(warning); } } /** * @description When using `requestStarting`, call this after the request * has finished. */ requestFinished() { // TODO negative? this._concurrentRequests--; } /** * Configuration Precedence: * 1. Dependency inversion via defined option. * 2. Global numeric environment variable. * 3. Built-in default. * This will not preserve unspecified options previously specified. * @param {TeenyStatisticsOptions} [opts] * @returns {TeenyStatisticsOptions} * @private */ static _prepareOptions({ concurrentRequests: diConcurrentRequests, } = {}) { let concurrentRequests = this.DEFAULT_WARN_CONCURRENT_REQUESTS; const envConcurrentRequests = Number(process.env.TEENY_REQUEST_WARN_CONCURRENT_REQUESTS); if (diConcurrentRequests !== undefined) { concurrentRequests = diConcurrentRequests; } else if (!Number.isNaN(envConcurrentRequests)) { concurrentRequests = envConcurrentRequests; } return { concurrentRequests }; } } exports.TeenyStatistics = TeenyStatistics; /** * @description A default threshold representing when to warn about excessive * in-flight/concurrent requests. * @type {number} * @static * @readonly * @default 5000 */ TeenyStatistics.DEFAULT_WARN_CONCURRENT_REQUESTS = 5000; //# sourceMappingURL=TeenyStatistics.js.map /***/ }), /***/ 60446: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getAgent = exports.pool = void 0; const http_1 = __webpack_require__(98605); const https_1 = __webpack_require__(57211); // eslint-disable-next-line node/no-deprecated-api const url_1 = __webpack_require__(78835); exports.pool = new Map(); /** * Returns a custom request Agent if one is found, otherwise returns undefined * which will result in the global http(s) Agent being used. * @private * @param {string} uri The request uri * @param {Options} reqOpts The request options * @returns {HttpAnyAgent|undefined} */ function getAgent(uri, reqOpts) { const isHttp = uri.startsWith('http://'); const proxy = reqOpts.proxy || process.env.HTTP_PROXY || process.env.http_proxy || process.env.HTTPS_PROXY || process.env.https_proxy; const poolOptions = Object.assign({}, reqOpts.pool); if (proxy) { // tslint:disable-next-line variable-name const Agent = isHttp ? __webpack_require__(23764) : __webpack_require__(77219); const proxyOpts = { ...url_1.parse(proxy), ...poolOptions }; return new Agent(proxyOpts); } let key = isHttp ? 'http' : 'https'; if (reqOpts.forever) { key += ':forever'; if (!exports.pool.has(key)) { // tslint:disable-next-line variable-name const Agent = isHttp ? http_1.Agent : https_1.Agent; exports.pool.set(key, new Agent({ ...poolOptions, keepAlive: true })); } } return exports.pool.get(key); } exports.getAgent = getAgent; //# sourceMappingURL=agents.js.map /***/ }), /***/ 6886: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.teenyRequest = exports.RequestError = void 0; const node_fetch_1 = __webpack_require__(80467); const stream_1 = __webpack_require__(92413); const uuid = __webpack_require__(4552); const agents_1 = __webpack_require__(60446); const TeenyStatistics_1 = __webpack_require__(14920); // eslint-disable-next-line @typescript-eslint/no-var-requires const streamEvents = __webpack_require__(79626); class RequestError extends Error { } exports.RequestError = RequestError; /** * Convert options from Request to Fetch format * @private * @param reqOpts Request options */ function requestToFetchOptions(reqOpts) { const options = { method: reqOpts.method || 'GET', ...(reqOpts.timeout && { timeout: reqOpts.timeout }), ...(typeof reqOpts.gzip === 'boolean' && { compress: reqOpts.gzip }), }; if (typeof reqOpts.json === 'object') { // Add Content-type: application/json header reqOpts.headers = reqOpts.headers || {}; reqOpts.headers['Content-Type'] = 'application/json'; // Set body to JSON representation of value options.body = JSON.stringify(reqOpts.json); } else { if (Buffer.isBuffer(reqOpts.body)) { options.body = reqOpts.body; } else if (typeof reqOpts.body !== 'string') { options.body = JSON.stringify(reqOpts.body); } else { options.body = reqOpts.body; } } // eslint-disable-next-line @typescript-eslint/no-explicit-any options.headers = reqOpts.headers; let uri = (reqOpts.uri || reqOpts.url); if (!uri) { throw new Error('Missing uri or url in reqOpts.'); } if (reqOpts.useQuerystring === true || typeof reqOpts.qs === 'object') { // eslint-disable-next-line @typescript-eslint/no-var-requires const qs = __webpack_require__(71191); const params = qs.stringify(reqOpts.qs); uri = uri + '?' + params; } options.agent = agents_1.getAgent(uri, reqOpts); return { uri, options }; } /** * Convert a response from `fetch` to `request` format. * @private * @param opts The `request` options used to create the request. * @param res The Fetch response * @returns A `request` response object */ function fetchToRequestResponse(opts, res) { const request = {}; request.agent = opts.agent || false; request.headers = (opts.headers || {}); request.href = res.url; // headers need to be converted from a map to an obj const resHeaders = {}; res.headers.forEach((value, key) => (resHeaders[key] = value)); const response = Object.assign(res.body, { statusCode: res.status, statusMessage: res.statusText, request, body: res.body, headers: resHeaders, toJSON: () => ({ headers: resHeaders }), }); return response; } /** * Create POST body from two parts as multipart/related content-type * @private * @param boundary * @param multipart */ function createMultipartStream(boundary, multipart) { const finale = `--${boundary}--`; const stream = new stream_1.PassThrough(); for (const part of multipart) { const preamble = `--${boundary}\r\nContent-Type: ${part['Content-Type']}\r\n\r\n`; stream.write(preamble); if (typeof part.body === 'string') { stream.write(part.body); stream.write('\r\n'); } else { part.body.pipe(stream, { end: false }); part.body.on('end', () => { stream.write('\r\n'); stream.write(finale); stream.end(); }); } } return stream; } function teenyRequest(reqOpts, callback) { const { uri, options } = requestToFetchOptions(reqOpts); const multipart = reqOpts.multipart; if (reqOpts.multipart && multipart.length === 2) { if (!callback) { // TODO: add support for multipart uploads through streaming throw new Error('Multipart without callback is not implemented.'); } const boundary = uuid.v4(); options.headers['Content-Type'] = `multipart/related; boundary=${boundary}`; options.body = createMultipartStream(boundary, multipart); // Multipart upload teenyRequest.stats.requestStarting(); node_fetch_1.default(uri, options).then(res => { teenyRequest.stats.requestFinished(); const header = res.headers.get('content-type'); const response = fetchToRequestResponse(options, res); const body = response.body; if (header === 'application/json' || header === 'application/json; charset=utf-8') { res.json().then(json => { response.body = json; callback(null, response, json); }, (err) => { callback(err, response, body); }); return; } res.text().then(text => { response.body = text; callback(null, response, text); }, err => { callback(err, response, body); }); }, err => { teenyRequest.stats.requestFinished(); callback(err, null, null); }); return; } if (callback === undefined) { // Stream mode const requestStream = streamEvents(new stream_1.PassThrough()); // eslint-disable-next-line @typescript-eslint/no-explicit-any let responseStream; requestStream.once('reading', () => { if (responseStream) { responseStream.pipe(requestStream); } else { requestStream.once('response', () => { responseStream.pipe(requestStream); }); } }); options.compress = false; teenyRequest.stats.requestStarting(); node_fetch_1.default(uri, options).then(res => { teenyRequest.stats.requestFinished(); responseStream = res.body; responseStream.on('error', (err) => { requestStream.emit('error', err); }); const response = fetchToRequestResponse(options, res); requestStream.emit('response', response); }, err => { teenyRequest.stats.requestFinished(); requestStream.emit('error', err); }); // fetch doesn't supply the raw HTTP stream, instead it // returns a PassThrough piped from the HTTP response // stream. return requestStream; } // GET or POST with callback teenyRequest.stats.requestStarting(); node_fetch_1.default(uri, options).then(res => { teenyRequest.stats.requestFinished(); const header = res.headers.get('content-type'); const response = fetchToRequestResponse(options, res); const body = response.body; if (header === 'application/json' || header === 'application/json; charset=utf-8') { if (response.statusCode === 204) { // Probably a DELETE callback(null, response, body); return; } res.json().then(json => { response.body = json; callback(null, response, json); }, err => { callback(err, response, body); }); return; } res.text().then(text => { const response = fetchToRequestResponse(options, res); response.body = text; callback(null, response, text); }, err => { callback(err, response, body); }); }, err => { teenyRequest.stats.requestFinished(); callback(err, null, null); }); return; } exports.teenyRequest = teenyRequest; teenyRequest.defaults = (defaults) => { return (reqOpts, callback) => { const opts = { ...defaults, ...reqOpts }; if (callback === undefined) { return teenyRequest(opts); } teenyRequest(opts, callback); }; }; /** * Single instance of an interface for keeping track of things. */ teenyRequest.stats = new TeenyStatistics_1.TeenyStatistics(); teenyRequest.resetStats = () => { teenyRequest.stats = new TeenyStatistics_1.TeenyStatistics(teenyRequest.stats.getOptions()); }; //# sourceMappingURL=index.js.map /***/ }), /***/ 68065: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { promisify } = __webpack_require__(31669); const tmp = __webpack_require__(8517); // file module.exports.fileSync = tmp.fileSync; const fileWithOptions = promisify((options, cb) => tmp.file(options, (err, path, fd, cleanup) => err ? cb(err) : cb(undefined, { path, fd, cleanup: promisify(cleanup) }) ) ); module.exports.file = async (options) => fileWithOptions(options); module.exports.withFile = async function withFile(fn, options) { const { path, fd, cleanup } = await module.exports.file(options); try { return await fn({ path, fd }); } finally { await cleanup(); } }; // directory module.exports.dirSync = tmp.dirSync; const dirWithOptions = promisify((options, cb) => tmp.dir(options, (err, path, cleanup) => err ? cb(err) : cb(undefined, { path, cleanup: promisify(cleanup) }) ) ); module.exports.dir = async (options) => dirWithOptions(options); module.exports.withDir = async function withDir(fn, options) { const { path, cleanup } = await module.exports.dir(options); try { return await fn({ path }); } finally { await cleanup(); } }; // name generation module.exports.tmpNameSync = tmp.tmpNameSync; module.exports.tmpName = promisify(tmp.tmpName); module.exports.tmpdir = tmp.tmpdir; module.exports.setGracefulCleanup = tmp.setGracefulCleanup; /***/ }), /***/ 8517: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*! * Tmp * * Copyright (c) 2011-2017 KARASZI Istvan * * MIT Licensed */ /* * Module dependencies. */ const fs = __webpack_require__(35747); const os = __webpack_require__(12087); const path = __webpack_require__(85622); const crypto = __webpack_require__(76417); const _c = { fs: fs.constants, os: os.constants }; const rimraf = __webpack_require__(14959); /* * The working inner variables. */ const // the random characters to choose from RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', TEMPLATE_PATTERN = /XXXXXX/, DEFAULT_TRIES = 3, CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR), // constants are off on the windows platform and will not match the actual errno codes IS_WIN32 = os.platform() === 'win32', EBADF = _c.EBADF || _c.os.errno.EBADF, ENOENT = _c.ENOENT || _c.os.errno.ENOENT, DIR_MODE = 0o700 /* 448 */, FILE_MODE = 0o600 /* 384 */, EXIT = 'exit', // this will hold the objects need to be removed on exit _removeObjects = [], // API change in fs.rmdirSync leads to error when passing in a second parameter, e.g. the callback FN_RMDIR_SYNC = fs.rmdirSync.bind(fs), FN_RIMRAF_SYNC = rimraf.sync; let _gracefulCleanup = false; /** * Gets a temporary file name. * * @param {(Options|tmpNameCallback)} options options or callback * @param {?tmpNameCallback} callback the callback function */ function tmpName(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; try { _assertAndSanitizeOptions(opts); } catch (err) { return cb(err); } let tries = opts.tries; (function _getUniqueName() { try { const name = _generateTmpName(opts); // check whether the path exists then retry if needed fs.stat(name, function (err) { /* istanbul ignore else */ if (!err) { /* istanbul ignore else */ if (tries-- > 0) return _getUniqueName(); return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name)); } cb(null, name); }); } catch (err) { cb(err); } }()); } /** * Synchronous version of tmpName. * * @param {Object} options * @returns {string} the generated random name * @throws {Error} if the options are invalid or could not generate a filename */ function tmpNameSync(options) { const args = _parseArguments(options), opts = args[0]; _assertAndSanitizeOptions(opts); let tries = opts.tries; do { const name = _generateTmpName(opts); try { fs.statSync(name); } catch (e) { return name; } } while (tries-- > 0); throw new Error('Could not get a unique tmp filename, max tries reached'); } /** * Creates and opens a temporary file. * * @param {(Options|null|undefined|fileCallback)} options the config options or the callback function or null or undefined * @param {?fileCallback} callback */ function file(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; // gets a temporary filename tmpName(opts, function _tmpNameCreated(err, name) { /* istanbul ignore else */ if (err) return cb(err); // create and open the file fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) { /* istanbu ignore else */ if (err) return cb(err); if (opts.discardDescriptor) { return fs.close(fd, function _discardCallback(possibleErr) { // the chance of getting an error on close here is rather low and might occur in the most edgiest cases only return cb(possibleErr, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts, false)); }); } else { // detachDescriptor passes the descriptor whereas discardDescriptor closes it, either way, we no longer care // about the descriptor const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false)); } }); }); } /** * Synchronous version of file. * * @param {Options} options * @returns {FileSyncObject} object consists of name, fd and removeCallback * @throws {Error} if cannot create a file */ function fileSync(options) { const args = _parseArguments(options), opts = args[0]; const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; const name = tmpNameSync(opts); var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); /* istanbul ignore else */ if (opts.discardDescriptor) { fs.closeSync(fd); fd = undefined; } return { name: name, fd: fd, removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true) }; } /** * Creates a temporary directory. * * @param {(Options|dirCallback)} options the options or the callback function * @param {?dirCallback} callback */ function dir(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; // gets a temporary filename tmpName(opts, function _tmpNameCreated(err, name) { /* istanbul ignore else */ if (err) return cb(err); // create the directory fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) { /* istanbul ignore else */ if (err) return cb(err); cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); }); }); } /** * Synchronous version of dir. * * @param {Options} options * @returns {DirSyncObject} object consists of name and removeCallback * @throws {Error} if it cannot create a directory */ function dirSync(options) { const args = _parseArguments(options), opts = args[0]; const name = tmpNameSync(opts); fs.mkdirSync(name, opts.mode || DIR_MODE); return { name: name, removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) }; } /** * Removes files asynchronously. * * @param {Object} fdPath * @param {Function} next * @private */ function _removeFileAsync(fdPath, next) { const _handler = function (err) { if (err && !_isENOENT(err)) { // reraise any unanticipated error return next(err); } next(); }; if (0 <= fdPath[0]) fs.close(fdPath[0], function () { fs.unlink(fdPath[1], _handler); }); else fs.unlink(fdPath[1], _handler); } /** * Removes files synchronously. * * @param {Object} fdPath * @private */ function _removeFileSync(fdPath) { let rethrownException = null; try { if (0 <= fdPath[0]) fs.closeSync(fdPath[0]); } catch (e) { // reraise any unanticipated error if (!_isEBADF(e) && !_isENOENT(e)) throw e; } finally { try { fs.unlinkSync(fdPath[1]); } catch (e) { // reraise any unanticipated error if (!_isENOENT(e)) rethrownException = e; } } if (rethrownException !== null) { throw rethrownException; } } /** * Prepares the callback for removal of the temporary file. * * Returns either a sync callback or a async callback depending on whether * fileSync or file was called, which is expressed by the sync parameter. * * @param {string} name the path of the file * @param {number} fd file descriptor * @param {Object} opts * @param {boolean} sync * @returns {fileCallback | fileCallbackSync} * @private */ function _prepareTmpFileRemoveCallback(name, fd, opts, sync) { const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync); const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync); if (!opts.keep) _removeObjects.unshift(removeCallbackSync); return sync ? removeCallbackSync : removeCallback; } /** * Prepares the callback for removal of the temporary directory. * * Returns either a sync callback or a async callback depending on whether * tmpFileSync or tmpFile was called, which is expressed by the sync parameter. * * @param {string} name * @param {Object} opts * @param {boolean} sync * @returns {Function} the callback * @private */ function _prepareTmpDirRemoveCallback(name, opts, sync) { const removeFunction = opts.unsafeCleanup ? rimraf : fs.rmdir.bind(fs); const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC; const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync); const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync); if (!opts.keep) _removeObjects.unshift(removeCallbackSync); return sync ? removeCallbackSync : removeCallback; } /** * Creates a guarded function wrapping the removeFunction call. * * The cleanup callback is save to be called multiple times. * Subsequent invocations will be ignored. * * @param {Function} removeFunction * @param {string} fileOrDirName * @param {boolean} sync * @param {cleanupCallbackSync?} cleanupCallbackSync * @returns {cleanupCallback | cleanupCallbackSync} * @private */ function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) { let called = false; // if sync is true, the next parameter will be ignored return function _cleanupCallback(next) { /* istanbul ignore else */ if (!called) { // remove cleanupCallback from cache const toRemove = cleanupCallbackSync || _cleanupCallback; const index = _removeObjects.indexOf(toRemove); /* istanbul ignore else */ if (index >= 0) _removeObjects.splice(index, 1); called = true; if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { return removeFunction(fileOrDirName); } else { return removeFunction(fileOrDirName, next || function() {}); } } }; } /** * The garbage collector. * * @private */ function _garbageCollector() { /* istanbul ignore else */ if (!_gracefulCleanup) return; // the function being called removes itself from _removeObjects, // loop until _removeObjects is empty while (_removeObjects.length) { try { _removeObjects[0](); } catch (e) { // already removed? } } } /** * Random name generator based on crypto. * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript * * @param {number} howMany * @returns {string} the generated random name * @private */ function _randomChars(howMany) { let value = [], rnd = null; // make sure that we do not fail because we ran out of entropy try { rnd = crypto.randomBytes(howMany); } catch (e) { rnd = crypto.pseudoRandomBytes(howMany); } for (var i = 0; i < howMany; i++) { value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); } return value.join(''); } /** * Helper which determines whether a string s is blank, that is undefined, or empty or null. * * @private * @param {string} s * @returns {Boolean} true whether the string s is blank, false otherwise */ function _isBlank(s) { return s === null || _isUndefined(s) || !s.trim(); } /** * Checks whether the `obj` parameter is defined or not. * * @param {Object} obj * @returns {boolean} true if the object is undefined * @private */ function _isUndefined(obj) { return typeof obj === 'undefined'; } /** * Parses the function arguments. * * This function helps to have optional arguments. * * @param {(Options|null|undefined|Function)} options * @param {?Function} callback * @returns {Array} parsed arguments * @private */ function _parseArguments(options, callback) { /* istanbul ignore else */ if (typeof options === 'function') { return [{}, options]; } /* istanbul ignore else */ if (_isUndefined(options)) { return [{}, callback]; } // copy options so we do not leak the changes we make internally const actualOptions = {}; for (const key of Object.getOwnPropertyNames(options)) { actualOptions[key] = options[key]; } return [actualOptions, callback]; } /** * Generates a new temporary name. * * @param {Object} opts * @returns {string} the new random name according to opts * @private */ function _generateTmpName(opts) { const tmpDir = opts.tmpdir; /* istanbul ignore else */ if (!_isUndefined(opts.name)) return path.join(tmpDir, opts.dir, opts.name); /* istanbul ignore else */ if (!_isUndefined(opts.template)) return path.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); // prefix and postfix const name = [ opts.prefix ? opts.prefix : 'tmp', '-', process.pid, '-', _randomChars(12), opts.postfix ? '-' + opts.postfix : '' ].join(''); return path.join(tmpDir, opts.dir, name); } /** * Asserts whether the specified options are valid, also sanitizes options and provides sane defaults for missing * options. * * @param {Options} options * @private */ function _assertAndSanitizeOptions(options) { options.tmpdir = _getTmpDir(options); const tmpDir = options.tmpdir; /* istanbul ignore else */ if (!_isUndefined(options.name)) _assertIsRelative(options.name, 'name', tmpDir); /* istanbul ignore else */ if (!_isUndefined(options.dir)) _assertIsRelative(options.dir, 'dir', tmpDir); /* istanbul ignore else */ if (!_isUndefined(options.template)) { _assertIsRelative(options.template, 'template', tmpDir); if (!options.template.match(TEMPLATE_PATTERN)) throw new Error(`Invalid template, found "${options.template}".`); } /* istanbul ignore else */ if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) throw new Error(`Invalid tries, found "${options.tries}".`); // if a name was specified we will try once options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1; options.keep = !!options.keep; options.detachDescriptor = !!options.detachDescriptor; options.discardDescriptor = !!options.discardDescriptor; options.unsafeCleanup = !!options.unsafeCleanup; // sanitize dir, also keep (multiple) blanks if the user, purportedly sane, requests us to options.dir = _isUndefined(options.dir) ? '' : path.relative(tmpDir, _resolvePath(options.dir, tmpDir)); options.template = _isUndefined(options.template) ? undefined : path.relative(tmpDir, _resolvePath(options.template, tmpDir)); // sanitize further if template is relative to options.dir options.template = _isBlank(options.template) ? undefined : path.relative(options.dir, options.template); // for completeness' sake only, also keep (multiple) blanks if the user, purportedly sane, requests us to options.name = _isUndefined(options.name) ? undefined : _sanitizeName(options.name); options.prefix = _isUndefined(options.prefix) ? '' : options.prefix; options.postfix = _isUndefined(options.postfix) ? '' : options.postfix; } /** * Resolve the specified path name in respect to tmpDir. * * The specified name might include relative path components, e.g. ../ * so we need to resolve in order to be sure that is is located inside tmpDir * * @param name * @param tmpDir * @returns {string} * @private */ function _resolvePath(name, tmpDir) { const sanitizedName = _sanitizeName(name); if (sanitizedName.startsWith(tmpDir)) { return path.resolve(sanitizedName); } else { return path.resolve(path.join(tmpDir, sanitizedName)); } } /** * Sanitize the specified path name by removing all quote characters. * * @param name * @returns {string} * @private */ function _sanitizeName(name) { if (_isBlank(name)) { return name; } return name.replace(/["']/g, ''); } /** * Asserts whether specified name is relative to the specified tmpDir. * * @param {string} name * @param {string} option * @param {string} tmpDir * @throws {Error} * @private */ function _assertIsRelative(name, option, tmpDir) { if (option === 'name') { // assert that name is not absolute and does not contain a path if (path.isAbsolute(name)) throw new Error(`${option} option must not contain an absolute path, found "${name}".`); // must not fail on valid . or .. or similar such constructs let basename = path.basename(name); if (basename === '..' || basename === '.' || basename !== name) throw new Error(`${option} option must not contain a path, found "${name}".`); } else { // if (option === 'dir' || option === 'template') { // assert that dir or template are relative to tmpDir if (path.isAbsolute(name) && !name.startsWith(tmpDir)) { throw new Error(`${option} option must be relative to "${tmpDir}", found "${name}".`); } let resolvedPath = _resolvePath(name, tmpDir); if (!resolvedPath.startsWith(tmpDir)) throw new Error(`${option} option must be relative to "${tmpDir}", found "${resolvedPath}".`); } } /** * Helper for testing against EBADF to compensate changes made to Node 7.x under Windows. * * @private */ function _isEBADF(error) { return _isExpectedError(error, -EBADF, 'EBADF'); } /** * Helper for testing against ENOENT to compensate changes made to Node 7.x under Windows. * * @private */ function _isENOENT(error) { return _isExpectedError(error, -ENOENT, 'ENOENT'); } /** * Helper to determine whether the expected error code matches the actual code and errno, * which will differ between the supported node versions. * * - Node >= 7.0: * error.code {string} * error.errno {number} any numerical value will be negated * * CAVEAT * * On windows, the errno for EBADF is -4083 but os.constants.errno.EBADF is different and we must assume that ENOENT * is no different here. * * @param {SystemError} error * @param {number} errno * @param {string} code * @private */ function _isExpectedError(error, errno, code) { return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno; } /** * Sets the graceful cleanup. * * If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the * temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary * object removals. */ function setGracefulCleanup() { _gracefulCleanup = true; } /** * Returns the currently configured tmp dir from os.tmpdir(). * * @private * @param {?Options} options * @returns {string} the currently configured tmp dir */ function _getTmpDir(options) { return path.resolve(_sanitizeName(options && options.tmpdir || os.tmpdir())); } // Install process exit listener process.addListener(EXIT, _garbageCollector); /** * Configuration options. * * @typedef {Object} Options * @property {?boolean} keep the temporary object (file or dir) will not be garbage collected * @property {?number} tries the number of tries before give up the name generation * @property (?int) mode the access mode, defaults are 0o700 for directories and 0o600 for files * @property {?string} template the "mkstemp" like filename template * @property {?string} name fixed name relative to tmpdir or the specified dir option * @property {?string} dir tmp directory relative to the root tmp directory in use * @property {?string} prefix prefix for the generated name * @property {?string} postfix postfix for the generated name * @property {?string} tmpdir the root tmp directory which overrides the os tmpdir * @property {?boolean} unsafeCleanup recursively removes the created temporary directory, even when it's not empty * @property {?boolean} detachDescriptor detaches the file descriptor, caller is responsible for closing the file, tmp will no longer try closing the file during garbage collection * @property {?boolean} discardDescriptor discards the file descriptor (closes file, fd is -1), tmp will no longer try closing the file during garbage collection */ /** * @typedef {Object} FileSyncObject * @property {string} name the name of the file * @property {string} fd the file descriptor or -1 if the fd has been discarded * @property {fileCallback} removeCallback the callback function to remove the file */ /** * @typedef {Object} DirSyncObject * @property {string} name the name of the directory * @property {fileCallback} removeCallback the callback function to remove the directory */ /** * @callback tmpNameCallback * @param {?Error} err the error object if anything goes wrong * @param {string} name the temporary file name */ /** * @callback fileCallback * @param {?Error} err the error object if anything goes wrong * @param {string} name the temporary file name * @param {number} fd the file descriptor or -1 if the fd had been discarded * @param {cleanupCallback} fn the cleanup callback function */ /** * @callback fileCallbackSync * @param {?Error} err the error object if anything goes wrong * @param {string} name the temporary file name * @param {number} fd the file descriptor or -1 if the fd had been discarded * @param {cleanupCallbackSync} fn the cleanup callback function */ /** * @callback dirCallback * @param {?Error} err the error object if anything goes wrong * @param {string} name the temporary file name * @param {cleanupCallback} fn the cleanup callback function */ /** * @callback dirCallbackSync * @param {?Error} err the error object if anything goes wrong * @param {string} name the temporary file name * @param {cleanupCallbackSync} fn the cleanup callback function */ /** * Removes the temporary created file or directory. * * @callback cleanupCallback * @param {simpleCallback} [next] function to call whenever the tmp object needs to be removed */ /** * Removes the temporary created file or directory. * * @callback cleanupCallbackSync */ /** * Callback function for function composition. * @see {@link https://github.com/raszi/node-tmp/issues/57|raszi/node-tmp#57} * * @callback simpleCallback */ // exporting all the needed methods // evaluate _getTmpDir() lazily, mainly for simplifying testing but it also will // allow users to reconfigure the temporary directory Object.defineProperty(module.exports, "tmpdir", ({ enumerable: true, configurable: false, get: function () { return _getTmpDir(); } })); module.exports.dir = dir; module.exports.dirSync = dirSync; module.exports.file = file; module.exports.fileSync = fileSync; module.exports.tmpName = tmpName; module.exports.tmpNameSync = tmpNameSync; module.exports.setGracefulCleanup = setGracefulCleanup; /***/ }), /***/ 47372: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var net = __webpack_require__(11631); var urlParse = __webpack_require__(78835).parse; var util = __webpack_require__(31669); var pubsuffix = __webpack_require__(94401); var Store = __webpack_require__(460)/* .Store */ .y; var MemoryCookieStore = __webpack_require__(52640)/* .MemoryCookieStore */ .m; var pathMatch = __webpack_require__(54336)/* .pathMatch */ .U; var VERSION = __webpack_require__(93199); var punycode; try { punycode = __webpack_require__(94213); } catch(e) { console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization"); } // From RFC6265 S4.1.1 // note that it excludes \x3B ";" var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/; var CONTROL_CHARS = /[\x00-\x1F]/; // From Chromium // '\r', '\n' and '\0' should be treated as a terminator in // the "relaxed" mode, see: // https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60 var TERMINATORS = ['\n', '\r', '\0']; // RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' // Note ';' is \x3B var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; // date-time parsing constants (RFC6265 S5.1.1) var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; var MONTH_TO_NUM = { jan:0, feb:1, mar:2, apr:3, may:4, jun:5, jul:6, aug:7, sep:8, oct:9, nov:10, dec:11 }; var NUM_TO_MONTH = [ 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' ]; var NUM_TO_DAY = [ 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' ]; var MAX_TIME = 2147483647000; // 31-bit max var MIN_TIME = 0; // 31-bit min /* * Parses a Natural number (i.e., non-negative integer) with either the * *DIGIT ( non-digit *OCTET ) * or * *DIGIT * grammar (RFC6265 S5.1.1). * * The "trailingOK" boolean controls if the grammar accepts a * "( non-digit *OCTET )" trailer. */ function parseDigits(token, minDigits, maxDigits, trailingOK) { var count = 0; while (count < token.length) { var c = token.charCodeAt(count); // "non-digit = %x00-2F / %x3A-FF" if (c <= 0x2F || c >= 0x3A) { break; } count++; } // constrain to a minimum and maximum number of digits. if (count < minDigits || count > maxDigits) { return null; } if (!trailingOK && count != token.length) { return null; } return parseInt(token.substr(0,count), 10); } function parseTime(token) { var parts = token.split(':'); var result = [0,0,0]; /* RF6256 S5.1.1: * time = hms-time ( non-digit *OCTET ) * hms-time = time-field ":" time-field ":" time-field * time-field = 1*2DIGIT */ if (parts.length !== 3) { return null; } for (var i = 0; i < 3; i++) { // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be // followed by "( non-digit *OCTET )" so therefore the last time-field can // have a trailer var trailingOK = (i == 2); var num = parseDigits(parts[i], 1, 2, trailingOK); if (num === null) { return null; } result[i] = num; } return result; } function parseMonth(token) { token = String(token).substr(0,3).toLowerCase(); var num = MONTH_TO_NUM[token]; return num >= 0 ? num : null; } /* * RFC6265 S5.1.1 date parser (see RFC for full grammar) */ function parseDate(str) { if (!str) { return; } /* RFC6265 S5.1.1: * 2. Process each date-token sequentially in the order the date-tokens * appear in the cookie-date */ var tokens = str.split(DATE_DELIM); if (!tokens) { return; } var hour = null; var minute = null; var second = null; var dayOfMonth = null; var month = null; var year = null; for (var i=0; i= 70 && year <= 99) { year += 1900; } else if (year >= 0 && year <= 69) { year += 2000; } } } } /* RFC 6265 S5.1.1 * "5. Abort these steps and fail to parse the cookie-date if: * * at least one of the found-day-of-month, found-month, found- * year, or found-time flags is not set, * * the day-of-month-value is less than 1 or greater than 31, * * the year-value is less than 1601, * * the hour-value is greater than 23, * * the minute-value is greater than 59, or * * the second-value is greater than 59. * (Note that leap seconds cannot be represented in this syntax.)" * * So, in order as above: */ if ( dayOfMonth === null || month === null || year === null || second === null || dayOfMonth < 1 || dayOfMonth > 31 || year < 1601 || hour > 23 || minute > 59 || second > 59 ) { return; } return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second)); } function formatDate(date) { var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d; var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h; var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m; var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s; return NUM_TO_DAY[date.getUTCDay()] + ', ' + d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+ h+':'+m+':'+s+' GMT'; } // S5.1.2 Canonicalized Host Names function canonicalDomain(str) { if (str == null) { return null; } str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading . // convert to IDN if any non-ASCII characters if (punycode && /[^\u0001-\u007f]/.test(str)) { str = punycode.toASCII(str); } return str.toLowerCase(); } // S5.1.3 Domain Matching function domainMatch(str, domStr, canonicalize) { if (str == null || domStr == null) { return null; } if (canonicalize !== false) { str = canonicalDomain(str); domStr = canonicalDomain(domStr); } /* * "The domain string and the string are identical. (Note that both the * domain string and the string will have been canonicalized to lower case at * this point)" */ if (str == domStr) { return true; } /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */ /* "* The string is a host name (i.e., not an IP address)." */ if (net.isIP(str)) { return false; } /* "* The domain string is a suffix of the string" */ var idx = str.indexOf(domStr); if (idx <= 0) { return false; // it's a non-match (-1) or prefix (0) } // e.g "a.b.c".indexOf("b.c") === 2 // 5 === 3+2 if (str.length !== domStr.length + idx) { // it's not a suffix return false; } /* "* The last character of the string that is not included in the domain * string is a %x2E (".") character." */ if (str.substr(idx-1,1) !== '.') { return false; } return true; } // RFC6265 S5.1.4 Paths and Path-Match /* * "The user agent MUST use an algorithm equivalent to the following algorithm * to compute the default-path of a cookie:" * * Assumption: the path (and not query part or absolute uri) is passed in. */ function defaultPath(path) { // "2. If the uri-path is empty or if the first character of the uri-path is not // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. if (!path || path.substr(0,1) !== "/") { return "/"; } // "3. If the uri-path contains no more than one %x2F ("/") character, output // %x2F ("/") and skip the remaining step." if (path === "/") { return path; } var rightSlash = path.lastIndexOf("/"); if (rightSlash === 0) { return "/"; } // "4. Output the characters of the uri-path from the first character up to, // but not including, the right-most %x2F ("/")." return path.slice(0, rightSlash); } function trimTerminator(str) { for (var t = 0; t < TERMINATORS.length; t++) { var terminatorIdx = str.indexOf(TERMINATORS[t]); if (terminatorIdx !== -1) { str = str.substr(0,terminatorIdx); } } return str; } function parseCookiePair(cookiePair, looseMode) { cookiePair = trimTerminator(cookiePair); var firstEq = cookiePair.indexOf('='); if (looseMode) { if (firstEq === 0) { // '=' is immediately at start cookiePair = cookiePair.substr(1); firstEq = cookiePair.indexOf('='); // might still need to split on '=' } } else { // non-loose mode if (firstEq <= 0) { // no '=' or is at start return; // needs to have non-empty "cookie-name" } } var cookieName, cookieValue; if (firstEq <= 0) { cookieName = ""; cookieValue = cookiePair.trim(); } else { cookieName = cookiePair.substr(0, firstEq).trim(); cookieValue = cookiePair.substr(firstEq+1).trim(); } if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) { return; } var c = new Cookie(); c.key = cookieName; c.value = cookieValue; return c; } function parse(str, options) { if (!options || typeof options !== 'object') { options = {}; } str = str.trim(); // We use a regex to parse the "name-value-pair" part of S5.2 var firstSemi = str.indexOf(';'); // S5.2 step 1 var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi); var c = parseCookiePair(cookiePair, !!options.loose); if (!c) { return; } if (firstSemi === -1) { return c; } // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string // (including the %x3B (";") in question)." plus later on in the same section // "discard the first ";" and trim". var unparsed = str.slice(firstSemi + 1).trim(); // "If the unparsed-attributes string is empty, skip the rest of these // steps." if (unparsed.length === 0) { return c; } /* * S5.2 says that when looping over the items "[p]rocess the attribute-name * and attribute-value according to the requirements in the following * subsections" for every item. Plus, for many of the individual attributes * in S5.3 it says to use the "attribute-value of the last attribute in the * cookie-attribute-list". Therefore, in this implementation, we overwrite * the previous value. */ var cookie_avs = unparsed.split(';'); while (cookie_avs.length) { var av = cookie_avs.shift().trim(); if (av.length === 0) { // happens if ";;" appears continue; } var av_sep = av.indexOf('='); var av_key, av_value; if (av_sep === -1) { av_key = av; av_value = null; } else { av_key = av.substr(0,av_sep); av_value = av.substr(av_sep+1); } av_key = av_key.trim().toLowerCase(); if (av_value) { av_value = av_value.trim(); } switch(av_key) { case 'expires': // S5.2.1 if (av_value) { var exp = parseDate(av_value); // "If the attribute-value failed to parse as a cookie date, ignore the // cookie-av." if (exp) { // over and underflow not realistically a concern: V8's getTime() seems to // store something larger than a 32-bit time_t (even with 32-bit node) c.expires = exp; } } break; case 'max-age': // S5.2.2 if (av_value) { // "If the first character of the attribute-value is not a DIGIT or a "-" // character ...[or]... If the remainder of attribute-value contains a // non-DIGIT character, ignore the cookie-av." if (/^-?[0-9]+$/.test(av_value)) { var delta = parseInt(av_value, 10); // "If delta-seconds is less than or equal to zero (0), let expiry-time // be the earliest representable date and time." c.setMaxAge(delta); } } break; case 'domain': // S5.2.3 // "If the attribute-value is empty, the behavior is undefined. However, // the user agent SHOULD ignore the cookie-av entirely." if (av_value) { // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E // (".") character." var domain = av_value.trim().replace(/^\./, ''); if (domain) { // "Convert the cookie-domain to lower case." c.domain = domain.toLowerCase(); } } break; case 'path': // S5.2.4 /* * "If the attribute-value is empty or if the first character of the * attribute-value is not %x2F ("/"): * Let cookie-path be the default-path. * Otherwise: * Let cookie-path be the attribute-value." * * We'll represent the default-path as null since it depends on the * context of the parsing. */ c.path = av_value && av_value[0] === "/" ? av_value : null; break; case 'secure': // S5.2.5 /* * "If the attribute-name case-insensitively matches the string "Secure", * the user agent MUST append an attribute to the cookie-attribute-list * with an attribute-name of Secure and an empty attribute-value." */ c.secure = true; break; case 'httponly': // S5.2.6 -- effectively the same as 'secure' c.httpOnly = true; break; default: c.extensions = c.extensions || []; c.extensions.push(av); break; } } return c; } // avoid the V8 deoptimization monster! function jsonParse(str) { var obj; try { obj = JSON.parse(str); } catch (e) { return e; } return obj; } function fromJSON(str) { if (!str) { return null; } var obj; if (typeof str === 'string') { obj = jsonParse(str); if (obj instanceof Error) { return null; } } else { // assume it's an Object obj = str; } var c = new Cookie(); for (var i=0; i 1) { var lindex = path.lastIndexOf('/'); if (lindex === 0) { break; } path = path.substr(0,lindex); permutations.push(path); } permutations.push('/'); return permutations; } function getCookieContext(url) { if (url instanceof Object) { return url; } // NOTE: decodeURI will throw on malformed URIs (see GH-32). // Therefore, we will just skip decoding for such URIs. try { url = decodeURI(url); } catch(err) { // Silently swallow error } return urlParse(url); } function Cookie(options) { options = options || {}; Object.keys(options).forEach(function(prop) { if (Cookie.prototype.hasOwnProperty(prop) && Cookie.prototype[prop] !== options[prop] && prop.substr(0,1) !== '_') { this[prop] = options[prop]; } }, this); this.creation = this.creation || new Date(); // used to break creation ties in cookieCompare(): Object.defineProperty(this, 'creationIndex', { configurable: false, enumerable: false, // important for assert.deepEqual checks writable: true, value: ++Cookie.cookiesCreated }); } Cookie.cookiesCreated = 0; // incremented each time a cookie is created Cookie.parse = parse; Cookie.fromJSON = fromJSON; Cookie.prototype.key = ""; Cookie.prototype.value = ""; // the order in which the RFC has them: Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity Cookie.prototype.maxAge = null; // takes precedence over expires for TTL Cookie.prototype.domain = null; Cookie.prototype.path = null; Cookie.prototype.secure = false; Cookie.prototype.httpOnly = false; Cookie.prototype.extensions = null; // set by the CookieJar: Cookie.prototype.hostOnly = null; // boolean when set Cookie.prototype.pathIsDefault = null; // boolean when set Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse Cookie.prototype.lastAccessed = null; // Date when set Object.defineProperty(Cookie.prototype, 'creationIndex', { configurable: true, enumerable: false, writable: true, value: 0 }); Cookie.serializableProperties = Object.keys(Cookie.prototype) .filter(function(prop) { return !( Cookie.prototype[prop] instanceof Function || prop === 'creationIndex' || prop.substr(0,1) === '_' ); }); Cookie.prototype.inspect = function inspect() { var now = Date.now(); return 'Cookie="'+this.toString() + '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') + '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') + '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') + '"'; }; // Use the new custom inspection symbol to add the custom inspect function if // available. if (util.inspect.custom) { Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect; } Cookie.prototype.toJSON = function() { var obj = {}; var props = Cookie.serializableProperties; for (var i=0; i { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var Store = __webpack_require__(460)/* .Store */ .y; var permuteDomain = __webpack_require__(55986).permuteDomain; var pathMatch = __webpack_require__(54336)/* .pathMatch */ .U; var util = __webpack_require__(31669); function MemoryCookieStore() { Store.call(this); this.idx = {}; } util.inherits(MemoryCookieStore, Store); exports.m = MemoryCookieStore; MemoryCookieStore.prototype.idx = null; // Since it's just a struct in RAM, this Store is synchronous MemoryCookieStore.prototype.synchronous = true; // force a default depth: MemoryCookieStore.prototype.inspect = function() { return "{ idx: "+util.inspect(this.idx, false, 2)+' }'; }; // Use the new custom inspection symbol to add the custom inspect function if // available. if (util.inspect.custom) { MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect; } MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) { if (!this.idx[domain]) { return cb(null,undefined); } if (!this.idx[domain][path]) { return cb(null,undefined); } return cb(null,this.idx[domain][path][key]||null); }; MemoryCookieStore.prototype.findCookies = function(domain, path, cb) { var results = []; if (!domain) { return cb(null,[]); } var pathMatcher; if (!path) { // null means "all paths" pathMatcher = function matchAll(domainIndex) { for (var curPath in domainIndex) { var pathIndex = domainIndex[curPath]; for (var key in pathIndex) { results.push(pathIndex[key]); } } }; } else { pathMatcher = function matchRFC(domainIndex) { //NOTE: we should use path-match algorithm from S5.1.4 here //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299) Object.keys(domainIndex).forEach(function (cookiePath) { if (pathMatch(path, cookiePath)) { var pathIndex = domainIndex[cookiePath]; for (var key in pathIndex) { results.push(pathIndex[key]); } } }); }; } var domains = permuteDomain(domain) || [domain]; var idx = this.idx; domains.forEach(function(curDomain) { var domainIndex = idx[curDomain]; if (!domainIndex) { return; } pathMatcher(domainIndex); }); cb(null,results); }; MemoryCookieStore.prototype.putCookie = function(cookie, cb) { if (!this.idx[cookie.domain]) { this.idx[cookie.domain] = {}; } if (!this.idx[cookie.domain][cookie.path]) { this.idx[cookie.domain][cookie.path] = {}; } this.idx[cookie.domain][cookie.path][cookie.key] = cookie; cb(null); }; MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) { // updateCookie() may avoid updating cookies that are identical. For example, // lastAccessed may not be important to some stores and an equality // comparison could exclude that field. this.putCookie(newCookie,cb); }; MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) { if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) { delete this.idx[domain][path][key]; } cb(null); }; MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) { if (this.idx[domain]) { if (path) { delete this.idx[domain][path]; } else { delete this.idx[domain]; } } return cb(null); }; MemoryCookieStore.prototype.removeAllCookies = function(cb) { this.idx = {}; return cb(null); } MemoryCookieStore.prototype.getAllCookies = function(cb) { var cookies = []; var idx = this.idx; var domains = Object.keys(idx); domains.forEach(function(domain) { var paths = Object.keys(idx[domain]); paths.forEach(function(path) { var keys = Object.keys(idx[domain][path]); keys.forEach(function(key) { if (key !== null) { cookies.push(idx[domain][path][key]); } }); }); }); // Sort by creationIndex so deserializing retains the creation order. // When implementing your own store, this SHOULD retain the order too cookies.sort(function(a,b) { return (a.creationIndex||0) - (b.creationIndex||0); }); cb(null, cookies); }; /***/ }), /***/ 54336: /***/ ((__unused_webpack_module, exports) => { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * "A request-path path-matches a given cookie-path if at least one of the * following conditions holds:" */ function pathMatch (reqPath, cookiePath) { // "o The cookie-path and the request-path are identical." if (cookiePath === reqPath) { return true; } var idx = reqPath.indexOf(cookiePath); if (idx === 0) { // "o The cookie-path is a prefix of the request-path, and the last // character of the cookie-path is %x2F ("/")." if (cookiePath.substr(-1) === "/") { return true; } // " o The cookie-path is a prefix of the request-path, and the first // character of the request-path that is not included in the cookie- path // is a %x2F ("/") character." if (reqPath.substr(cookiePath.length, 1) === "/") { return true; } } return false; } exports.U = pathMatch; /***/ }), /***/ 55986: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var pubsuffix = __webpack_require__(94401); // Gives the permutation of all possible domainMatch()es of a given domain. The // array is in shortest-to-longest order. Handy for indexing. function permuteDomain (domain) { var pubSuf = pubsuffix.getPublicSuffix(domain); if (!pubSuf) { return null; } if (pubSuf == domain) { return [domain]; } var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com" var parts = prefix.split('.').reverse(); var cur = pubSuf; var permutations = [cur]; while (parts.length) { cur = parts.shift() + '.' + cur; permutations.push(cur); } return permutations; } exports.permuteDomain = permuteDomain; /***/ }), /***/ 94401: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /*! * Copyright (c) 2018, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ var psl = __webpack_require__(29975); function getPublicSuffix(domain) { return psl.get(domain); } exports.getPublicSuffix = getPublicSuffix; /***/ }), /***/ 460: /***/ ((__unused_webpack_module, exports) => { "use strict"; /*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /*jshint unused:false */ function Store() { } exports.y = Store; // Stores may be synchronous, but are still required to use a // Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" // API that converts from synchronous-callbacks to imperative style. Store.prototype.synchronous = false; Store.prototype.findCookie = function(domain, path, key, cb) { throw new Error('findCookie is not implemented'); }; Store.prototype.findCookies = function(domain, path, cb) { throw new Error('findCookies is not implemented'); }; Store.prototype.putCookie = function(cookie, cb) { throw new Error('putCookie is not implemented'); }; Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { // recommended default implementation: // return this.putCookie(newCookie, cb); throw new Error('updateCookie is not implemented'); }; Store.prototype.removeCookie = function(domain, path, key, cb) { throw new Error('removeCookie is not implemented'); }; Store.prototype.removeCookies = function(domain, path, cb) { throw new Error('removeCookies is not implemented'); }; Store.prototype.removeAllCookies = function(cb) { throw new Error('removeAllCookies is not implemented'); } Store.prototype.getAllCookies = function(cb) { throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); }; /***/ }), /***/ 93199: /***/ ((module) => { // generated by genversion module.exports = '2.5.0' /***/ }), /***/ 75636: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "__extends": () => /* binding */ __extends, /* harmony export */ "__assign": () => /* binding */ __assign, /* harmony export */ "__rest": () => /* binding */ __rest, /* harmony export */ "__decorate": () => /* binding */ __decorate, /* harmony export */ "__param": () => /* binding */ __param, /* harmony export */ "__metadata": () => /* binding */ __metadata, /* harmony export */ "__awaiter": () => /* binding */ __awaiter, /* harmony export */ "__generator": () => /* binding */ __generator, /* harmony export */ "__createBinding": () => /* binding */ __createBinding, /* harmony export */ "__exportStar": () => /* binding */ __exportStar, /* harmony export */ "__values": () => /* binding */ __values, /* harmony export */ "__read": () => /* binding */ __read, /* harmony export */ "__spread": () => /* binding */ __spread, /* harmony export */ "__spreadArrays": () => /* binding */ __spreadArrays, /* harmony export */ "__await": () => /* binding */ __await, /* harmony export */ "__asyncGenerator": () => /* binding */ __asyncGenerator, /* harmony export */ "__asyncDelegator": () => /* binding */ __asyncDelegator, /* harmony export */ "__asyncValues": () => /* binding */ __asyncValues, /* harmony export */ "__makeTemplateObject": () => /* binding */ __makeTemplateObject, /* harmony export */ "__importStar": () => /* binding */ __importStar, /* harmony export */ "__importDefault": () => /* binding */ __importDefault, /* harmony export */ "__classPrivateFieldGet": () => /* binding */ __classPrivateFieldGet, /* harmony export */ "__classPrivateFieldSet": () => /* binding */ __classPrivateFieldSet /* harmony export */ }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __createBinding(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; } function __exportStar(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result.default = mod; return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, privateMap) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return privateMap.get(receiver); } function __classPrivateFieldSet(receiver, privateMap, value) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to set private field on non-instance"); } privateMap.set(receiver, value); return value; } /***/ }), /***/ 11137: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var net = __webpack_require__(11631) , tls = __webpack_require__(4016) , http = __webpack_require__(98605) , https = __webpack_require__(57211) , events = __webpack_require__(28614) , assert = __webpack_require__(42357) , util = __webpack_require__(31669) , Buffer = __webpack_require__(21867).Buffer ; exports.httpOverHttp = httpOverHttp exports.httpsOverHttp = httpsOverHttp exports.httpOverHttps = httpOverHttps exports.httpsOverHttps = httpsOverHttps function httpOverHttp(options) { var agent = new TunnelingAgent(options) agent.request = http.request return agent } function httpsOverHttp(options) { var agent = new TunnelingAgent(options) agent.request = http.request agent.createSocket = createSecureSocket agent.defaultPort = 443 return agent } function httpOverHttps(options) { var agent = new TunnelingAgent(options) agent.request = https.request return agent } function httpsOverHttps(options) { var agent = new TunnelingAgent(options) agent.request = https.request agent.createSocket = createSecureSocket agent.defaultPort = 443 return agent } function TunnelingAgent(options) { var self = this self.options = options || {} self.proxyOptions = self.options.proxy || {} self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets self.requests = [] self.sockets = [] self.on('free', function onFree(socket, host, port) { for (var i = 0, len = self.requests.length; i < len; ++i) { var pending = self.requests[i] if (pending.host === host && pending.port === port) { // Detect the request to connect same origin server, // reuse the connection. self.requests.splice(i, 1) pending.request.onSocket(socket) return } } socket.destroy() self.removeSocket(socket) }) } util.inherits(TunnelingAgent, events.EventEmitter) TunnelingAgent.prototype.addRequest = function addRequest(req, options) { var self = this // Legacy API: addRequest(req, host, port, path) if (typeof options === 'string') { options = { host: options, port: arguments[2], path: arguments[3] }; } if (self.sockets.length >= this.maxSockets) { // We are over limit so we'll add it to the queue. self.requests.push({host: options.host, port: options.port, request: req}) return } // If we are under maxSockets create a new one. self.createConnection({host: options.host, port: options.port, request: req}) } TunnelingAgent.prototype.createConnection = function createConnection(pending) { var self = this self.createSocket(pending, function(socket) { socket.on('free', onFree) socket.on('close', onCloseOrRemove) socket.on('agentRemove', onCloseOrRemove) pending.request.onSocket(socket) function onFree() { self.emit('free', socket, pending.host, pending.port) } function onCloseOrRemove(err) { self.removeSocket(socket) socket.removeListener('free', onFree) socket.removeListener('close', onCloseOrRemove) socket.removeListener('agentRemove', onCloseOrRemove) } }) } TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self = this var placeholder = {} self.sockets.push(placeholder) var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT' , path: options.host + ':' + options.port , agent: false } ) if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {} connectOptions.headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(connectOptions.proxyAuth).toString('base64') } debug('making CONNECT request') var connectReq = self.request(connectOptions) connectReq.useChunkedEncodingByDefault = false // for v0.6 connectReq.once('response', onResponse) // for v0.6 connectReq.once('upgrade', onUpgrade) // for v0.6 connectReq.once('connect', onConnect) // for v0.7 or later connectReq.once('error', onError) connectReq.end() function onResponse(res) { // Very hacky. This is necessary to avoid http-parser leaks. res.upgrade = true } function onUpgrade(res, socket, head) { // Hacky. process.nextTick(function() { onConnect(res, socket, head) }) } function onConnect(res, socket, head) { connectReq.removeAllListeners() socket.removeAllListeners() if (res.statusCode === 200) { assert.equal(head.length, 0) debug('tunneling connection has established') self.sockets[self.sockets.indexOf(placeholder)] = socket cb(socket) } else { debug('tunneling socket could not be established, statusCode=%d', res.statusCode) var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) error.code = 'ECONNRESET' options.request.emit('error', error) self.removeSocket(placeholder) } } function onError(cause) { connectReq.removeAllListeners() debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) error.code = 'ECONNRESET' options.request.emit('error', error) self.removeSocket(placeholder) } } TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) return this.sockets.splice(pos, 1) var pending = this.requests.shift() if (pending) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createConnection(pending) } } function createSecureSocket(options, cb) { var self = this TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { // 0 is dummy port for v0.6 var secureSocket = tls.connect(0, mergeOptions({}, self.options, { servername: options.host , socket: socket } )) self.sockets[self.sockets.indexOf(socket)] = secureSocket cb(secureSocket) }) } function mergeOptions(target) { for (var i = 1, len = arguments.length; i < len; ++i) { var overrides = arguments[i] if (typeof overrides === 'object') { var keys = Object.keys(overrides) for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j] if (overrides[k] !== undefined) { target[k] = overrides[k] } } } } return target } var debug if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug = function() { var args = Array.prototype.slice.call(arguments) if (typeof args[0] === 'string') { args[0] = 'TUNNEL: ' + args[0] } else { args.unshift('TUNNEL:') } console.error.apply(console, args) } } else { debug = function() {} } exports.debug = debug // for test /***/ }), /***/ 68729: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { (function(nacl) { 'use strict'; // Ported in 2014 by Dmitry Chestnykh and Devi Mandiri. // Public domain. // // Implementation derived from TweetNaCl version 20140427. // See for details: http://tweetnacl.cr.yp.to/ var gf = function(init) { var i, r = new Float64Array(16); if (init) for (i = 0; i < init.length; i++) r[i] = init[i]; return r; }; // Pluggable, initialized in high-level API below. var randombytes = function(/* x, n */) { throw new Error('no PRNG'); }; var _0 = new Uint8Array(16); var _9 = new Uint8Array(32); _9[0] = 9; var gf0 = gf(), gf1 = gf([1]), _121665 = gf([0xdb41, 1]), D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]), D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]), X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]), Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]), I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); function ts64(x, i, h, l) { x[i] = (h >> 24) & 0xff; x[i+1] = (h >> 16) & 0xff; x[i+2] = (h >> 8) & 0xff; x[i+3] = h & 0xff; x[i+4] = (l >> 24) & 0xff; x[i+5] = (l >> 16) & 0xff; x[i+6] = (l >> 8) & 0xff; x[i+7] = l & 0xff; } function vn(x, xi, y, yi, n) { var i,d = 0; for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i]; return (1 & ((d - 1) >>> 8)) - 1; } function crypto_verify_16(x, xi, y, yi) { return vn(x,xi,y,yi,16); } function crypto_verify_32(x, xi, y, yi) { return vn(x,xi,y,yi,32); } function core_salsa20(o, p, k, c) { var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; for (var i = 0; i < 20; i += 2) { u = x0 + x12 | 0; x4 ^= u<<7 | u>>>(32-7); u = x4 + x0 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x4 | 0; x12 ^= u<<13 | u>>>(32-13); u = x12 + x8 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x1 | 0; x9 ^= u<<7 | u>>>(32-7); u = x9 + x5 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x9 | 0; x1 ^= u<<13 | u>>>(32-13); u = x1 + x13 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x6 | 0; x14 ^= u<<7 | u>>>(32-7); u = x14 + x10 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x14 | 0; x6 ^= u<<13 | u>>>(32-13); u = x6 + x2 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x11 | 0; x3 ^= u<<7 | u>>>(32-7); u = x3 + x15 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x3 | 0; x11 ^= u<<13 | u>>>(32-13); u = x11 + x7 | 0; x15 ^= u<<18 | u>>>(32-18); u = x0 + x3 | 0; x1 ^= u<<7 | u>>>(32-7); u = x1 + x0 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x1 | 0; x3 ^= u<<13 | u>>>(32-13); u = x3 + x2 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x4 | 0; x6 ^= u<<7 | u>>>(32-7); u = x6 + x5 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x6 | 0; x4 ^= u<<13 | u>>>(32-13); u = x4 + x7 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x9 | 0; x11 ^= u<<7 | u>>>(32-7); u = x11 + x10 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x11 | 0; x9 ^= u<<13 | u>>>(32-13); u = x9 + x8 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x14 | 0; x12 ^= u<<7 | u>>>(32-7); u = x12 + x15 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x12 | 0; x14 ^= u<<13 | u>>>(32-13); u = x14 + x13 | 0; x15 ^= u<<18 | u>>>(32-18); } x0 = x0 + j0 | 0; x1 = x1 + j1 | 0; x2 = x2 + j2 | 0; x3 = x3 + j3 | 0; x4 = x4 + j4 | 0; x5 = x5 + j5 | 0; x6 = x6 + j6 | 0; x7 = x7 + j7 | 0; x8 = x8 + j8 | 0; x9 = x9 + j9 | 0; x10 = x10 + j10 | 0; x11 = x11 + j11 | 0; x12 = x12 + j12 | 0; x13 = x13 + j13 | 0; x14 = x14 + j14 | 0; x15 = x15 + j15 | 0; o[ 0] = x0 >>> 0 & 0xff; o[ 1] = x0 >>> 8 & 0xff; o[ 2] = x0 >>> 16 & 0xff; o[ 3] = x0 >>> 24 & 0xff; o[ 4] = x1 >>> 0 & 0xff; o[ 5] = x1 >>> 8 & 0xff; o[ 6] = x1 >>> 16 & 0xff; o[ 7] = x1 >>> 24 & 0xff; o[ 8] = x2 >>> 0 & 0xff; o[ 9] = x2 >>> 8 & 0xff; o[10] = x2 >>> 16 & 0xff; o[11] = x2 >>> 24 & 0xff; o[12] = x3 >>> 0 & 0xff; o[13] = x3 >>> 8 & 0xff; o[14] = x3 >>> 16 & 0xff; o[15] = x3 >>> 24 & 0xff; o[16] = x4 >>> 0 & 0xff; o[17] = x4 >>> 8 & 0xff; o[18] = x4 >>> 16 & 0xff; o[19] = x4 >>> 24 & 0xff; o[20] = x5 >>> 0 & 0xff; o[21] = x5 >>> 8 & 0xff; o[22] = x5 >>> 16 & 0xff; o[23] = x5 >>> 24 & 0xff; o[24] = x6 >>> 0 & 0xff; o[25] = x6 >>> 8 & 0xff; o[26] = x6 >>> 16 & 0xff; o[27] = x6 >>> 24 & 0xff; o[28] = x7 >>> 0 & 0xff; o[29] = x7 >>> 8 & 0xff; o[30] = x7 >>> 16 & 0xff; o[31] = x7 >>> 24 & 0xff; o[32] = x8 >>> 0 & 0xff; o[33] = x8 >>> 8 & 0xff; o[34] = x8 >>> 16 & 0xff; o[35] = x8 >>> 24 & 0xff; o[36] = x9 >>> 0 & 0xff; o[37] = x9 >>> 8 & 0xff; o[38] = x9 >>> 16 & 0xff; o[39] = x9 >>> 24 & 0xff; o[40] = x10 >>> 0 & 0xff; o[41] = x10 >>> 8 & 0xff; o[42] = x10 >>> 16 & 0xff; o[43] = x10 >>> 24 & 0xff; o[44] = x11 >>> 0 & 0xff; o[45] = x11 >>> 8 & 0xff; o[46] = x11 >>> 16 & 0xff; o[47] = x11 >>> 24 & 0xff; o[48] = x12 >>> 0 & 0xff; o[49] = x12 >>> 8 & 0xff; o[50] = x12 >>> 16 & 0xff; o[51] = x12 >>> 24 & 0xff; o[52] = x13 >>> 0 & 0xff; o[53] = x13 >>> 8 & 0xff; o[54] = x13 >>> 16 & 0xff; o[55] = x13 >>> 24 & 0xff; o[56] = x14 >>> 0 & 0xff; o[57] = x14 >>> 8 & 0xff; o[58] = x14 >>> 16 & 0xff; o[59] = x14 >>> 24 & 0xff; o[60] = x15 >>> 0 & 0xff; o[61] = x15 >>> 8 & 0xff; o[62] = x15 >>> 16 & 0xff; o[63] = x15 >>> 24 & 0xff; } function core_hsalsa20(o,p,k,c) { var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; for (var i = 0; i < 20; i += 2) { u = x0 + x12 | 0; x4 ^= u<<7 | u>>>(32-7); u = x4 + x0 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x4 | 0; x12 ^= u<<13 | u>>>(32-13); u = x12 + x8 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x1 | 0; x9 ^= u<<7 | u>>>(32-7); u = x9 + x5 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x9 | 0; x1 ^= u<<13 | u>>>(32-13); u = x1 + x13 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x6 | 0; x14 ^= u<<7 | u>>>(32-7); u = x14 + x10 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x14 | 0; x6 ^= u<<13 | u>>>(32-13); u = x6 + x2 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x11 | 0; x3 ^= u<<7 | u>>>(32-7); u = x3 + x15 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x3 | 0; x11 ^= u<<13 | u>>>(32-13); u = x11 + x7 | 0; x15 ^= u<<18 | u>>>(32-18); u = x0 + x3 | 0; x1 ^= u<<7 | u>>>(32-7); u = x1 + x0 | 0; x2 ^= u<<9 | u>>>(32-9); u = x2 + x1 | 0; x3 ^= u<<13 | u>>>(32-13); u = x3 + x2 | 0; x0 ^= u<<18 | u>>>(32-18); u = x5 + x4 | 0; x6 ^= u<<7 | u>>>(32-7); u = x6 + x5 | 0; x7 ^= u<<9 | u>>>(32-9); u = x7 + x6 | 0; x4 ^= u<<13 | u>>>(32-13); u = x4 + x7 | 0; x5 ^= u<<18 | u>>>(32-18); u = x10 + x9 | 0; x11 ^= u<<7 | u>>>(32-7); u = x11 + x10 | 0; x8 ^= u<<9 | u>>>(32-9); u = x8 + x11 | 0; x9 ^= u<<13 | u>>>(32-13); u = x9 + x8 | 0; x10 ^= u<<18 | u>>>(32-18); u = x15 + x14 | 0; x12 ^= u<<7 | u>>>(32-7); u = x12 + x15 | 0; x13 ^= u<<9 | u>>>(32-9); u = x13 + x12 | 0; x14 ^= u<<13 | u>>>(32-13); u = x14 + x13 | 0; x15 ^= u<<18 | u>>>(32-18); } o[ 0] = x0 >>> 0 & 0xff; o[ 1] = x0 >>> 8 & 0xff; o[ 2] = x0 >>> 16 & 0xff; o[ 3] = x0 >>> 24 & 0xff; o[ 4] = x5 >>> 0 & 0xff; o[ 5] = x5 >>> 8 & 0xff; o[ 6] = x5 >>> 16 & 0xff; o[ 7] = x5 >>> 24 & 0xff; o[ 8] = x10 >>> 0 & 0xff; o[ 9] = x10 >>> 8 & 0xff; o[10] = x10 >>> 16 & 0xff; o[11] = x10 >>> 24 & 0xff; o[12] = x15 >>> 0 & 0xff; o[13] = x15 >>> 8 & 0xff; o[14] = x15 >>> 16 & 0xff; o[15] = x15 >>> 24 & 0xff; o[16] = x6 >>> 0 & 0xff; o[17] = x6 >>> 8 & 0xff; o[18] = x6 >>> 16 & 0xff; o[19] = x6 >>> 24 & 0xff; o[20] = x7 >>> 0 & 0xff; o[21] = x7 >>> 8 & 0xff; o[22] = x7 >>> 16 & 0xff; o[23] = x7 >>> 24 & 0xff; o[24] = x8 >>> 0 & 0xff; o[25] = x8 >>> 8 & 0xff; o[26] = x8 >>> 16 & 0xff; o[27] = x8 >>> 24 & 0xff; o[28] = x9 >>> 0 & 0xff; o[29] = x9 >>> 8 & 0xff; o[30] = x9 >>> 16 & 0xff; o[31] = x9 >>> 24 & 0xff; } function crypto_core_salsa20(out,inp,k,c) { core_salsa20(out,inp,k,c); } function crypto_core_hsalsa20(out,inp,k,c) { core_hsalsa20(out,inp,k,c); } var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); // "expand 32-byte k" function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) { var z = new Uint8Array(16), x = new Uint8Array(64); var u, i; for (i = 0; i < 16; i++) z[i] = 0; for (i = 0; i < 8; i++) z[i] = n[i]; while (b >= 64) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i]; u = 1; for (i = 8; i < 16; i++) { u = u + (z[i] & 0xff) | 0; z[i] = u & 0xff; u >>>= 8; } b -= 64; cpos += 64; mpos += 64; } if (b > 0) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i]; } return 0; } function crypto_stream_salsa20(c,cpos,b,n,k) { var z = new Uint8Array(16), x = new Uint8Array(64); var u, i; for (i = 0; i < 16; i++) z[i] = 0; for (i = 0; i < 8; i++) z[i] = n[i]; while (b >= 64) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < 64; i++) c[cpos+i] = x[i]; u = 1; for (i = 8; i < 16; i++) { u = u + (z[i] & 0xff) | 0; z[i] = u & 0xff; u >>>= 8; } b -= 64; cpos += 64; } if (b > 0) { crypto_core_salsa20(x,z,k,sigma); for (i = 0; i < b; i++) c[cpos+i] = x[i]; } return 0; } function crypto_stream(c,cpos,d,n,k) { var s = new Uint8Array(32); crypto_core_hsalsa20(s,n,k,sigma); var sn = new Uint8Array(8); for (var i = 0; i < 8; i++) sn[i] = n[i+16]; return crypto_stream_salsa20(c,cpos,d,sn,s); } function crypto_stream_xor(c,cpos,m,mpos,d,n,k) { var s = new Uint8Array(32); crypto_core_hsalsa20(s,n,k,sigma); var sn = new Uint8Array(8); for (var i = 0; i < 8; i++) sn[i] = n[i+16]; return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s); } /* * Port of Andrew Moon's Poly1305-donna-16. Public domain. * https://github.com/floodyberry/poly1305-donna */ var poly1305 = function(key) { this.buffer = new Uint8Array(16); this.r = new Uint16Array(10); this.h = new Uint16Array(10); this.pad = new Uint16Array(8); this.leftover = 0; this.fin = 0; var t0, t1, t2, t3, t4, t5, t6, t7; t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff; t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff; t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03; t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff; t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff; this.r[5] = ((t4 >>> 1)) & 0x1ffe; t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff; t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81; t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff; this.r[9] = ((t7 >>> 5)) & 0x007f; this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8; this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8; this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8; this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8; this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8; this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8; this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8; this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8; }; poly1305.prototype.blocks = function(m, mpos, bytes) { var hibit = this.fin ? 0 : (1 << 11); var t0, t1, t2, t3, t4, t5, t6, t7, c; var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; while (bytes >= 16) { t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff; t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff; t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff; t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff; t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff; h5 += ((t4 >>> 1)) & 0x1fff; t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff; t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff; t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff; h9 += ((t7 >>> 5)) | hibit; c = 0; d0 = c; d0 += h0 * r0; d0 += h1 * (5 * r9); d0 += h2 * (5 * r8); d0 += h3 * (5 * r7); d0 += h4 * (5 * r6); c = (d0 >>> 13); d0 &= 0x1fff; d0 += h5 * (5 * r5); d0 += h6 * (5 * r4); d0 += h7 * (5 * r3); d0 += h8 * (5 * r2); d0 += h9 * (5 * r1); c += (d0 >>> 13); d0 &= 0x1fff; d1 = c; d1 += h0 * r1; d1 += h1 * r0; d1 += h2 * (5 * r9); d1 += h3 * (5 * r8); d1 += h4 * (5 * r7); c = (d1 >>> 13); d1 &= 0x1fff; d1 += h5 * (5 * r6); d1 += h6 * (5 * r5); d1 += h7 * (5 * r4); d1 += h8 * (5 * r3); d1 += h9 * (5 * r2); c += (d1 >>> 13); d1 &= 0x1fff; d2 = c; d2 += h0 * r2; d2 += h1 * r1; d2 += h2 * r0; d2 += h3 * (5 * r9); d2 += h4 * (5 * r8); c = (d2 >>> 13); d2 &= 0x1fff; d2 += h5 * (5 * r7); d2 += h6 * (5 * r6); d2 += h7 * (5 * r5); d2 += h8 * (5 * r4); d2 += h9 * (5 * r3); c += (d2 >>> 13); d2 &= 0x1fff; d3 = c; d3 += h0 * r3; d3 += h1 * r2; d3 += h2 * r1; d3 += h3 * r0; d3 += h4 * (5 * r9); c = (d3 >>> 13); d3 &= 0x1fff; d3 += h5 * (5 * r8); d3 += h6 * (5 * r7); d3 += h7 * (5 * r6); d3 += h8 * (5 * r5); d3 += h9 * (5 * r4); c += (d3 >>> 13); d3 &= 0x1fff; d4 = c; d4 += h0 * r4; d4 += h1 * r3; d4 += h2 * r2; d4 += h3 * r1; d4 += h4 * r0; c = (d4 >>> 13); d4 &= 0x1fff; d4 += h5 * (5 * r9); d4 += h6 * (5 * r8); d4 += h7 * (5 * r7); d4 += h8 * (5 * r6); d4 += h9 * (5 * r5); c += (d4 >>> 13); d4 &= 0x1fff; d5 = c; d5 += h0 * r5; d5 += h1 * r4; d5 += h2 * r3; d5 += h3 * r2; d5 += h4 * r1; c = (d5 >>> 13); d5 &= 0x1fff; d5 += h5 * r0; d5 += h6 * (5 * r9); d5 += h7 * (5 * r8); d5 += h8 * (5 * r7); d5 += h9 * (5 * r6); c += (d5 >>> 13); d5 &= 0x1fff; d6 = c; d6 += h0 * r6; d6 += h1 * r5; d6 += h2 * r4; d6 += h3 * r3; d6 += h4 * r2; c = (d6 >>> 13); d6 &= 0x1fff; d6 += h5 * r1; d6 += h6 * r0; d6 += h7 * (5 * r9); d6 += h8 * (5 * r8); d6 += h9 * (5 * r7); c += (d6 >>> 13); d6 &= 0x1fff; d7 = c; d7 += h0 * r7; d7 += h1 * r6; d7 += h2 * r5; d7 += h3 * r4; d7 += h4 * r3; c = (d7 >>> 13); d7 &= 0x1fff; d7 += h5 * r2; d7 += h6 * r1; d7 += h7 * r0; d7 += h8 * (5 * r9); d7 += h9 * (5 * r8); c += (d7 >>> 13); d7 &= 0x1fff; d8 = c; d8 += h0 * r8; d8 += h1 * r7; d8 += h2 * r6; d8 += h3 * r5; d8 += h4 * r4; c = (d8 >>> 13); d8 &= 0x1fff; d8 += h5 * r3; d8 += h6 * r2; d8 += h7 * r1; d8 += h8 * r0; d8 += h9 * (5 * r9); c += (d8 >>> 13); d8 &= 0x1fff; d9 = c; d9 += h0 * r9; d9 += h1 * r8; d9 += h2 * r7; d9 += h3 * r6; d9 += h4 * r5; c = (d9 >>> 13); d9 &= 0x1fff; d9 += h5 * r4; d9 += h6 * r3; d9 += h7 * r2; d9 += h8 * r1; d9 += h9 * r0; c += (d9 >>> 13); d9 &= 0x1fff; c = (((c << 2) + c)) | 0; c = (c + d0) | 0; d0 = c & 0x1fff; c = (c >>> 13); d1 += c; h0 = d0; h1 = d1; h2 = d2; h3 = d3; h4 = d4; h5 = d5; h6 = d6; h7 = d7; h8 = d8; h9 = d9; mpos += 16; bytes -= 16; } this.h[0] = h0; this.h[1] = h1; this.h[2] = h2; this.h[3] = h3; this.h[4] = h4; this.h[5] = h5; this.h[6] = h6; this.h[7] = h7; this.h[8] = h8; this.h[9] = h9; }; poly1305.prototype.finish = function(mac, macpos) { var g = new Uint16Array(10); var c, mask, f, i; if (this.leftover) { i = this.leftover; this.buffer[i++] = 1; for (; i < 16; i++) this.buffer[i] = 0; this.fin = 1; this.blocks(this.buffer, 0, 16); } c = this.h[1] >>> 13; this.h[1] &= 0x1fff; for (i = 2; i < 10; i++) { this.h[i] += c; c = this.h[i] >>> 13; this.h[i] &= 0x1fff; } this.h[0] += (c * 5); c = this.h[0] >>> 13; this.h[0] &= 0x1fff; this.h[1] += c; c = this.h[1] >>> 13; this.h[1] &= 0x1fff; this.h[2] += c; g[0] = this.h[0] + 5; c = g[0] >>> 13; g[0] &= 0x1fff; for (i = 1; i < 10; i++) { g[i] = this.h[i] + c; c = g[i] >>> 13; g[i] &= 0x1fff; } g[9] -= (1 << 13); mask = (c ^ 1) - 1; for (i = 0; i < 10; i++) g[i] &= mask; mask = ~mask; for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i]; this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff; this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff; this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff; this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff; this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff; this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff; this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff; this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff; f = this.h[0] + this.pad[0]; this.h[0] = f & 0xffff; for (i = 1; i < 8; i++) { f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0; this.h[i] = f & 0xffff; } mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff; mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff; mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff; mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff; mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff; mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff; mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff; mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff; mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff; mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff; mac[macpos+10] = (this.h[5] >>> 0) & 0xff; mac[macpos+11] = (this.h[5] >>> 8) & 0xff; mac[macpos+12] = (this.h[6] >>> 0) & 0xff; mac[macpos+13] = (this.h[6] >>> 8) & 0xff; mac[macpos+14] = (this.h[7] >>> 0) & 0xff; mac[macpos+15] = (this.h[7] >>> 8) & 0xff; }; poly1305.prototype.update = function(m, mpos, bytes) { var i, want; if (this.leftover) { want = (16 - this.leftover); if (want > bytes) want = bytes; for (i = 0; i < want; i++) this.buffer[this.leftover + i] = m[mpos+i]; bytes -= want; mpos += want; this.leftover += want; if (this.leftover < 16) return; this.blocks(this.buffer, 0, 16); this.leftover = 0; } if (bytes >= 16) { want = bytes - (bytes % 16); this.blocks(m, mpos, want); mpos += want; bytes -= want; } if (bytes) { for (i = 0; i < bytes; i++) this.buffer[this.leftover + i] = m[mpos+i]; this.leftover += bytes; } }; function crypto_onetimeauth(out, outpos, m, mpos, n, k) { var s = new poly1305(k); s.update(m, mpos, n); s.finish(out, outpos); return 0; } function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { var x = new Uint8Array(16); crypto_onetimeauth(x,0,m,mpos,n,k); return crypto_verify_16(h,hpos,x,0); } function crypto_secretbox(c,m,d,n,k) { var i; if (d < 32) return -1; crypto_stream_xor(c,0,m,0,d,n,k); crypto_onetimeauth(c, 16, c, 32, d - 32, c); for (i = 0; i < 16; i++) c[i] = 0; return 0; } function crypto_secretbox_open(m,c,d,n,k) { var i; var x = new Uint8Array(32); if (d < 32) return -1; crypto_stream(x,0,32,n,k); if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1; crypto_stream_xor(m,0,c,0,d,n,k); for (i = 0; i < 32; i++) m[i] = 0; return 0; } function set25519(r, a) { var i; for (i = 0; i < 16; i++) r[i] = a[i]|0; } function car25519(o) { var i, v, c = 1; for (i = 0; i < 16; i++) { v = o[i] + c + 65535; c = Math.floor(v / 65536); o[i] = v - c * 65536; } o[0] += c-1 + 37 * (c-1); } function sel25519(p, q, b) { var t, c = ~(b-1); for (var i = 0; i < 16; i++) { t = c & (p[i] ^ q[i]); p[i] ^= t; q[i] ^= t; } } function pack25519(o, n) { var i, j, b; var m = gf(), t = gf(); for (i = 0; i < 16; i++) t[i] = n[i]; car25519(t); car25519(t); car25519(t); for (j = 0; j < 2; j++) { m[0] = t[0] - 0xffed; for (i = 1; i < 15; i++) { m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1); m[i-1] &= 0xffff; } m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1); b = (m[15]>>16) & 1; m[14] &= 0xffff; sel25519(t, m, 1-b); } for (i = 0; i < 16; i++) { o[2*i] = t[i] & 0xff; o[2*i+1] = t[i]>>8; } } function neq25519(a, b) { var c = new Uint8Array(32), d = new Uint8Array(32); pack25519(c, a); pack25519(d, b); return crypto_verify_32(c, 0, d, 0); } function par25519(a) { var d = new Uint8Array(32); pack25519(d, a); return d[0] & 1; } function unpack25519(o, n) { var i; for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8); o[15] &= 0x7fff; } function A(o, a, b) { for (var i = 0; i < 16; i++) o[i] = a[i] + b[i]; } function Z(o, a, b) { for (var i = 0; i < 16; i++) o[i] = a[i] - b[i]; } function M(o, a, b) { var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; v = a[0]; t0 += v * b0; t1 += v * b1; t2 += v * b2; t3 += v * b3; t4 += v * b4; t5 += v * b5; t6 += v * b6; t7 += v * b7; t8 += v * b8; t9 += v * b9; t10 += v * b10; t11 += v * b11; t12 += v * b12; t13 += v * b13; t14 += v * b14; t15 += v * b15; v = a[1]; t1 += v * b0; t2 += v * b1; t3 += v * b2; t4 += v * b3; t5 += v * b4; t6 += v * b5; t7 += v * b6; t8 += v * b7; t9 += v * b8; t10 += v * b9; t11 += v * b10; t12 += v * b11; t13 += v * b12; t14 += v * b13; t15 += v * b14; t16 += v * b15; v = a[2]; t2 += v * b0; t3 += v * b1; t4 += v * b2; t5 += v * b3; t6 += v * b4; t7 += v * b5; t8 += v * b6; t9 += v * b7; t10 += v * b8; t11 += v * b9; t12 += v * b10; t13 += v * b11; t14 += v * b12; t15 += v * b13; t16 += v * b14; t17 += v * b15; v = a[3]; t3 += v * b0; t4 += v * b1; t5 += v * b2; t6 += v * b3; t7 += v * b4; t8 += v * b5; t9 += v * b6; t10 += v * b7; t11 += v * b8; t12 += v * b9; t13 += v * b10; t14 += v * b11; t15 += v * b12; t16 += v * b13; t17 += v * b14; t18 += v * b15; v = a[4]; t4 += v * b0; t5 += v * b1; t6 += v * b2; t7 += v * b3; t8 += v * b4; t9 += v * b5; t10 += v * b6; t11 += v * b7; t12 += v * b8; t13 += v * b9; t14 += v * b10; t15 += v * b11; t16 += v * b12; t17 += v * b13; t18 += v * b14; t19 += v * b15; v = a[5]; t5 += v * b0; t6 += v * b1; t7 += v * b2; t8 += v * b3; t9 += v * b4; t10 += v * b5; t11 += v * b6; t12 += v * b7; t13 += v * b8; t14 += v * b9; t15 += v * b10; t16 += v * b11; t17 += v * b12; t18 += v * b13; t19 += v * b14; t20 += v * b15; v = a[6]; t6 += v * b0; t7 += v * b1; t8 += v * b2; t9 += v * b3; t10 += v * b4; t11 += v * b5; t12 += v * b6; t13 += v * b7; t14 += v * b8; t15 += v * b9; t16 += v * b10; t17 += v * b11; t18 += v * b12; t19 += v * b13; t20 += v * b14; t21 += v * b15; v = a[7]; t7 += v * b0; t8 += v * b1; t9 += v * b2; t10 += v * b3; t11 += v * b4; t12 += v * b5; t13 += v * b6; t14 += v * b7; t15 += v * b8; t16 += v * b9; t17 += v * b10; t18 += v * b11; t19 += v * b12; t20 += v * b13; t21 += v * b14; t22 += v * b15; v = a[8]; t8 += v * b0; t9 += v * b1; t10 += v * b2; t11 += v * b3; t12 += v * b4; t13 += v * b5; t14 += v * b6; t15 += v * b7; t16 += v * b8; t17 += v * b9; t18 += v * b10; t19 += v * b11; t20 += v * b12; t21 += v * b13; t22 += v * b14; t23 += v * b15; v = a[9]; t9 += v * b0; t10 += v * b1; t11 += v * b2; t12 += v * b3; t13 += v * b4; t14 += v * b5; t15 += v * b6; t16 += v * b7; t17 += v * b8; t18 += v * b9; t19 += v * b10; t20 += v * b11; t21 += v * b12; t22 += v * b13; t23 += v * b14; t24 += v * b15; v = a[10]; t10 += v * b0; t11 += v * b1; t12 += v * b2; t13 += v * b3; t14 += v * b4; t15 += v * b5; t16 += v * b6; t17 += v * b7; t18 += v * b8; t19 += v * b9; t20 += v * b10; t21 += v * b11; t22 += v * b12; t23 += v * b13; t24 += v * b14; t25 += v * b15; v = a[11]; t11 += v * b0; t12 += v * b1; t13 += v * b2; t14 += v * b3; t15 += v * b4; t16 += v * b5; t17 += v * b6; t18 += v * b7; t19 += v * b8; t20 += v * b9; t21 += v * b10; t22 += v * b11; t23 += v * b12; t24 += v * b13; t25 += v * b14; t26 += v * b15; v = a[12]; t12 += v * b0; t13 += v * b1; t14 += v * b2; t15 += v * b3; t16 += v * b4; t17 += v * b5; t18 += v * b6; t19 += v * b7; t20 += v * b8; t21 += v * b9; t22 += v * b10; t23 += v * b11; t24 += v * b12; t25 += v * b13; t26 += v * b14; t27 += v * b15; v = a[13]; t13 += v * b0; t14 += v * b1; t15 += v * b2; t16 += v * b3; t17 += v * b4; t18 += v * b5; t19 += v * b6; t20 += v * b7; t21 += v * b8; t22 += v * b9; t23 += v * b10; t24 += v * b11; t25 += v * b12; t26 += v * b13; t27 += v * b14; t28 += v * b15; v = a[14]; t14 += v * b0; t15 += v * b1; t16 += v * b2; t17 += v * b3; t18 += v * b4; t19 += v * b5; t20 += v * b6; t21 += v * b7; t22 += v * b8; t23 += v * b9; t24 += v * b10; t25 += v * b11; t26 += v * b12; t27 += v * b13; t28 += v * b14; t29 += v * b15; v = a[15]; t15 += v * b0; t16 += v * b1; t17 += v * b2; t18 += v * b3; t19 += v * b4; t20 += v * b5; t21 += v * b6; t22 += v * b7; t23 += v * b8; t24 += v * b9; t25 += v * b10; t26 += v * b11; t27 += v * b12; t28 += v * b13; t29 += v * b14; t30 += v * b15; t0 += 38 * t16; t1 += 38 * t17; t2 += 38 * t18; t3 += 38 * t19; t4 += 38 * t20; t5 += 38 * t21; t6 += 38 * t22; t7 += 38 * t23; t8 += 38 * t24; t9 += 38 * t25; t10 += 38 * t26; t11 += 38 * t27; t12 += 38 * t28; t13 += 38 * t29; t14 += 38 * t30; // t15 left as is // first car c = 1; v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; t0 += c-1 + 37 * (c-1); // second car c = 1; v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; t0 += c-1 + 37 * (c-1); o[ 0] = t0; o[ 1] = t1; o[ 2] = t2; o[ 3] = t3; o[ 4] = t4; o[ 5] = t5; o[ 6] = t6; o[ 7] = t7; o[ 8] = t8; o[ 9] = t9; o[10] = t10; o[11] = t11; o[12] = t12; o[13] = t13; o[14] = t14; o[15] = t15; } function S(o, a) { M(o, a, a); } function inv25519(o, i) { var c = gf(); var a; for (a = 0; a < 16; a++) c[a] = i[a]; for (a = 253; a >= 0; a--) { S(c, c); if(a !== 2 && a !== 4) M(c, c, i); } for (a = 0; a < 16; a++) o[a] = c[a]; } function pow2523(o, i) { var c = gf(); var a; for (a = 0; a < 16; a++) c[a] = i[a]; for (a = 250; a >= 0; a--) { S(c, c); if(a !== 1) M(c, c, i); } for (a = 0; a < 16; a++) o[a] = c[a]; } function crypto_scalarmult(q, n, p) { var z = new Uint8Array(32); var x = new Float64Array(80), r, i; var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); for (i = 0; i < 31; i++) z[i] = n[i]; z[31]=(n[31]&127)|64; z[0]&=248; unpack25519(x,p); for (i = 0; i < 16; i++) { b[i]=x[i]; d[i]=a[i]=c[i]=0; } a[0]=d[0]=1; for (i=254; i>=0; --i) { r=(z[i>>>3]>>>(i&7))&1; sel25519(a,b,r); sel25519(c,d,r); A(e,a,c); Z(a,a,c); A(c,b,d); Z(b,b,d); S(d,e); S(f,a); M(a,c,a); M(c,b,e); A(e,a,c); Z(a,a,c); S(b,a); Z(c,d,f); M(a,c,_121665); A(a,a,d); M(c,c,a); M(a,d,f); M(d,b,x); S(b,e); sel25519(a,b,r); sel25519(c,d,r); } for (i = 0; i < 16; i++) { x[i+16]=a[i]; x[i+32]=c[i]; x[i+48]=b[i]; x[i+64]=d[i]; } var x32 = x.subarray(32); var x16 = x.subarray(16); inv25519(x32,x32); M(x16,x16,x32); pack25519(q,x16); return 0; } function crypto_scalarmult_base(q, n) { return crypto_scalarmult(q, n, _9); } function crypto_box_keypair(y, x) { randombytes(x, 32); return crypto_scalarmult_base(y, x); } function crypto_box_beforenm(k, y, x) { var s = new Uint8Array(32); crypto_scalarmult(s, x, y); return crypto_core_hsalsa20(k, _0, s, sigma); } var crypto_box_afternm = crypto_secretbox; var crypto_box_open_afternm = crypto_secretbox_open; function crypto_box(c, m, d, n, y, x) { var k = new Uint8Array(32); crypto_box_beforenm(k, y, x); return crypto_box_afternm(c, m, d, n, k); } function crypto_box_open(m, c, d, n, y, x) { var k = new Uint8Array(32); crypto_box_beforenm(k, y, x); return crypto_box_open_afternm(m, c, d, n, k); } var K = [ 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 ]; function crypto_hashblocks_hl(hh, hl, m, n) { var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; var pos = 0; while (n >= 128) { for (i = 0; i < 16; i++) { j = 8 * i + pos; wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3]; wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7]; } for (i = 0; i < 80; i++) { bh0 = ah0; bh1 = ah1; bh2 = ah2; bh3 = ah3; bh4 = ah4; bh5 = ah5; bh6 = ah6; bh7 = ah7; bl0 = al0; bl1 = al1; bl2 = al2; bl3 = al3; bl4 = al4; bl5 = al5; bl6 = al6; bl7 = al7; // add h = ah7; l = al7; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; // Sigma1 h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32)))); l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32)))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // Ch h = (ah4 & ah5) ^ (~ah4 & ah6); l = (al4 & al5) ^ (~al4 & al6); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // K h = K[i*2]; l = K[i*2+1]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // w h = wh[i%16]; l = wl[i%16]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; th = c & 0xffff | d << 16; tl = a & 0xffff | b << 16; // add h = th; l = tl; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; // Sigma0 h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32)))); l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32)))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // Maj h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2); l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; bh7 = (c & 0xffff) | (d << 16); bl7 = (a & 0xffff) | (b << 16); // add h = bh3; l = bl3; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = th; l = tl; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; bh3 = (c & 0xffff) | (d << 16); bl3 = (a & 0xffff) | (b << 16); ah1 = bh0; ah2 = bh1; ah3 = bh2; ah4 = bh3; ah5 = bh4; ah6 = bh5; ah7 = bh6; ah0 = bh7; al1 = bl0; al2 = bl1; al3 = bl2; al4 = bl3; al5 = bl4; al6 = bl5; al7 = bl6; al0 = bl7; if (i%16 === 15) { for (j = 0; j < 16; j++) { // add h = wh[j]; l = wl[j]; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = wh[(j+9)%16]; l = wl[(j+9)%16]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // sigma0 th = wh[(j+1)%16]; tl = wl[(j+1)%16]; h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7); l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; // sigma1 th = wh[(j+14)%16]; tl = wl[(j+14)%16]; h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6); l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6))); a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; wh[j] = (c & 0xffff) | (d << 16); wl[j] = (a & 0xffff) | (b << 16); } } } // add h = ah0; l = al0; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[0]; l = hl[0]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[0] = ah0 = (c & 0xffff) | (d << 16); hl[0] = al0 = (a & 0xffff) | (b << 16); h = ah1; l = al1; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[1]; l = hl[1]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[1] = ah1 = (c & 0xffff) | (d << 16); hl[1] = al1 = (a & 0xffff) | (b << 16); h = ah2; l = al2; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[2]; l = hl[2]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[2] = ah2 = (c & 0xffff) | (d << 16); hl[2] = al2 = (a & 0xffff) | (b << 16); h = ah3; l = al3; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[3]; l = hl[3]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[3] = ah3 = (c & 0xffff) | (d << 16); hl[3] = al3 = (a & 0xffff) | (b << 16); h = ah4; l = al4; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[4]; l = hl[4]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[4] = ah4 = (c & 0xffff) | (d << 16); hl[4] = al4 = (a & 0xffff) | (b << 16); h = ah5; l = al5; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[5]; l = hl[5]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[5] = ah5 = (c & 0xffff) | (d << 16); hl[5] = al5 = (a & 0xffff) | (b << 16); h = ah6; l = al6; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[6]; l = hl[6]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[6] = ah6 = (c & 0xffff) | (d << 16); hl[6] = al6 = (a & 0xffff) | (b << 16); h = ah7; l = al7; a = l & 0xffff; b = l >>> 16; c = h & 0xffff; d = h >>> 16; h = hh[7]; l = hl[7]; a += l & 0xffff; b += l >>> 16; c += h & 0xffff; d += h >>> 16; b += a >>> 16; c += b >>> 16; d += c >>> 16; hh[7] = ah7 = (c & 0xffff) | (d << 16); hl[7] = al7 = (a & 0xffff) | (b << 16); pos += 128; n -= 128; } return n; } function crypto_hash(out, m, n) { var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; hh[0] = 0x6a09e667; hh[1] = 0xbb67ae85; hh[2] = 0x3c6ef372; hh[3] = 0xa54ff53a; hh[4] = 0x510e527f; hh[5] = 0x9b05688c; hh[6] = 0x1f83d9ab; hh[7] = 0x5be0cd19; hl[0] = 0xf3bcc908; hl[1] = 0x84caa73b; hl[2] = 0xfe94f82b; hl[3] = 0x5f1d36f1; hl[4] = 0xade682d1; hl[5] = 0x2b3e6c1f; hl[6] = 0xfb41bd6b; hl[7] = 0x137e2179; crypto_hashblocks_hl(hh, hl, m, n); n %= 128; for (i = 0; i < n; i++) x[i] = m[b-n+i]; x[n] = 128; n = 256-128*(n<112?1:0); x[n-9] = 0; ts64(x, n-8, (b / 0x20000000) | 0, b << 3); crypto_hashblocks_hl(hh, hl, x, n); for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]); return 0; } function add(p, q) { var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); Z(a, p[1], p[0]); Z(t, q[1], q[0]); M(a, a, t); A(b, p[0], p[1]); A(t, q[0], q[1]); M(b, b, t); M(c, p[3], q[3]); M(c, c, D2); M(d, p[2], q[2]); A(d, d, d); Z(e, b, a); Z(f, d, c); A(g, d, c); A(h, b, a); M(p[0], e, f); M(p[1], h, g); M(p[2], g, f); M(p[3], e, h); } function cswap(p, q, b) { var i; for (i = 0; i < 4; i++) { sel25519(p[i], q[i], b); } } function pack(r, p) { var tx = gf(), ty = gf(), zi = gf(); inv25519(zi, p[2]); M(tx, p[0], zi); M(ty, p[1], zi); pack25519(r, ty); r[31] ^= par25519(tx) << 7; } function scalarmult(p, q, s) { var b, i; set25519(p[0], gf0); set25519(p[1], gf1); set25519(p[2], gf1); set25519(p[3], gf0); for (i = 255; i >= 0; --i) { b = (s[(i/8)|0] >> (i&7)) & 1; cswap(p, q, b); add(q, p); add(p, p); cswap(p, q, b); } } function scalarbase(p, s) { var q = [gf(), gf(), gf(), gf()]; set25519(q[0], X); set25519(q[1], Y); set25519(q[2], gf1); M(q[3], X, Y); scalarmult(p, q, s); } function crypto_sign_keypair(pk, sk, seeded) { var d = new Uint8Array(64); var p = [gf(), gf(), gf(), gf()]; var i; if (!seeded) randombytes(sk, 32); crypto_hash(d, sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; scalarbase(p, d); pack(pk, p); for (i = 0; i < 32; i++) sk[i+32] = pk[i]; return 0; } var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); function modL(r, x) { var carry, i, j, k; for (i = 63; i >= 32; --i) { carry = 0; for (j = i - 32, k = i - 12; j < k; ++j) { x[j] += carry - 16 * x[i] * L[j - (i - 32)]; carry = (x[j] + 128) >> 8; x[j] -= carry * 256; } x[j] += carry; x[i] = 0; } carry = 0; for (j = 0; j < 32; j++) { x[j] += carry - (x[31] >> 4) * L[j]; carry = x[j] >> 8; x[j] &= 255; } for (j = 0; j < 32; j++) x[j] -= carry * L[j]; for (i = 0; i < 32; i++) { x[i+1] += x[i] >> 8; r[i] = x[i] & 255; } } function reduce(r) { var x = new Float64Array(64), i; for (i = 0; i < 64; i++) x[i] = r[i]; for (i = 0; i < 64; i++) r[i] = 0; modL(r, x); } // Note: difference from C - smlen returned, not passed as argument. function crypto_sign(sm, m, n, sk) { var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); var i, j, x = new Float64Array(64); var p = [gf(), gf(), gf(), gf()]; crypto_hash(d, sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; var smlen = n + 64; for (i = 0; i < n; i++) sm[64 + i] = m[i]; for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i]; crypto_hash(r, sm.subarray(32), n+32); reduce(r); scalarbase(p, r); pack(sm, p); for (i = 32; i < 64; i++) sm[i] = sk[i]; crypto_hash(h, sm, n + 64); reduce(h); for (i = 0; i < 64; i++) x[i] = 0; for (i = 0; i < 32; i++) x[i] = r[i]; for (i = 0; i < 32; i++) { for (j = 0; j < 32; j++) { x[i+j] += h[i] * d[j]; } } modL(sm.subarray(32), x); return smlen; } function unpackneg(r, p) { var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); set25519(r[2], gf1); unpack25519(r[1], p); S(num, r[1]); M(den, num, D); Z(num, num, r[2]); A(den, r[2], den); S(den2, den); S(den4, den2); M(den6, den4, den2); M(t, den6, num); M(t, t, den); pow2523(t, t); M(t, t, num); M(t, t, den); M(t, t, den); M(r[0], t, den); S(chk, r[0]); M(chk, chk, den); if (neq25519(chk, num)) M(r[0], r[0], I); S(chk, r[0]); M(chk, chk, den); if (neq25519(chk, num)) return -1; if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]); M(r[3], r[0], r[1]); return 0; } function crypto_sign_open(m, sm, n, pk) { var i, mlen; var t = new Uint8Array(32), h = new Uint8Array(64); var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; mlen = -1; if (n < 64) return -1; if (unpackneg(q, pk)) return -1; for (i = 0; i < n; i++) m[i] = sm[i]; for (i = 0; i < 32; i++) m[i+32] = pk[i]; crypto_hash(h, m, n); reduce(h); scalarmult(p, q, h); scalarbase(q, sm.subarray(32)); add(p, q); pack(t, p); n -= 64; if (crypto_verify_32(sm, 0, t, 0)) { for (i = 0; i < n; i++) m[i] = 0; return -1; } for (i = 0; i < n; i++) m[i] = sm[i + 64]; mlen = n; return mlen; } var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; nacl.lowlevel = { crypto_core_hsalsa20: crypto_core_hsalsa20, crypto_stream_xor: crypto_stream_xor, crypto_stream: crypto_stream, crypto_stream_salsa20_xor: crypto_stream_salsa20_xor, crypto_stream_salsa20: crypto_stream_salsa20, crypto_onetimeauth: crypto_onetimeauth, crypto_onetimeauth_verify: crypto_onetimeauth_verify, crypto_verify_16: crypto_verify_16, crypto_verify_32: crypto_verify_32, crypto_secretbox: crypto_secretbox, crypto_secretbox_open: crypto_secretbox_open, crypto_scalarmult: crypto_scalarmult, crypto_scalarmult_base: crypto_scalarmult_base, crypto_box_beforenm: crypto_box_beforenm, crypto_box_afternm: crypto_box_afternm, crypto_box: crypto_box, crypto_box_open: crypto_box_open, crypto_box_keypair: crypto_box_keypair, crypto_hash: crypto_hash, crypto_sign: crypto_sign, crypto_sign_keypair: crypto_sign_keypair, crypto_sign_open: crypto_sign_open, crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES, crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES, crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES, crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES, crypto_scalarmult_BYTES: crypto_scalarmult_BYTES, crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES, crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES, crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES, crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES, crypto_box_NONCEBYTES: crypto_box_NONCEBYTES, crypto_box_ZEROBYTES: crypto_box_ZEROBYTES, crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES, crypto_sign_BYTES: crypto_sign_BYTES, crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES, crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES, crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES, crypto_hash_BYTES: crypto_hash_BYTES }; /* High-level API */ function checkLengths(k, n) { if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size'); if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size'); } function checkBoxLengths(pk, sk) { if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size'); if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); } function checkArrayTypes() { var t, i; for (i = 0; i < arguments.length; i++) { if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]') throw new TypeError('unexpected type ' + t + ', use Uint8Array'); } } function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; } // TODO: Completely remove this in v0.15. if (!nacl.util) { nacl.util = {}; nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() { throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js'); }; } nacl.randomBytes = function(n) { var b = new Uint8Array(n); randombytes(b, n); return b; }; nacl.secretbox = function(msg, nonce, key) { checkArrayTypes(msg, nonce, key); checkLengths(key, nonce); var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); var c = new Uint8Array(m.length); for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i]; crypto_secretbox(c, m, m.length, nonce, key); return c.subarray(crypto_secretbox_BOXZEROBYTES); }; nacl.secretbox.open = function(box, nonce, key) { checkArrayTypes(box, nonce, key); checkLengths(key, nonce); var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); var m = new Uint8Array(c.length); for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i]; if (c.length < 32) return false; if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false; return m.subarray(crypto_secretbox_ZEROBYTES); }; nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES; nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; nacl.scalarMult = function(n, p) { checkArrayTypes(n, p); if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size'); var q = new Uint8Array(crypto_scalarmult_BYTES); crypto_scalarmult(q, n, p); return q; }; nacl.scalarMult.base = function(n) { checkArrayTypes(n); if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); var q = new Uint8Array(crypto_scalarmult_BYTES); crypto_scalarmult_base(q, n); return q; }; nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES; nacl.box = function(msg, nonce, publicKey, secretKey) { var k = nacl.box.before(publicKey, secretKey); return nacl.secretbox(msg, nonce, k); }; nacl.box.before = function(publicKey, secretKey) { checkArrayTypes(publicKey, secretKey); checkBoxLengths(publicKey, secretKey); var k = new Uint8Array(crypto_box_BEFORENMBYTES); crypto_box_beforenm(k, publicKey, secretKey); return k; }; nacl.box.after = nacl.secretbox; nacl.box.open = function(msg, nonce, publicKey, secretKey) { var k = nacl.box.before(publicKey, secretKey); return nacl.secretbox.open(msg, nonce, k); }; nacl.box.open.after = nacl.secretbox.open; nacl.box.keyPair = function() { var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); crypto_box_keypair(pk, sk); return {publicKey: pk, secretKey: sk}; }; nacl.box.keyPair.fromSecretKey = function(secretKey) { checkArrayTypes(secretKey); if (secretKey.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); crypto_scalarmult_base(pk, secretKey); return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; }; nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES; nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES; nacl.box.nonceLength = crypto_box_NONCEBYTES; nacl.box.overheadLength = nacl.secretbox.overheadLength; nacl.sign = function(msg, secretKey) { checkArrayTypes(msg, secretKey); if (secretKey.length !== crypto_sign_SECRETKEYBYTES) throw new Error('bad secret key size'); var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length); crypto_sign(signedMsg, msg, msg.length, secretKey); return signedMsg; }; nacl.sign.open = function(signedMsg, publicKey) { if (arguments.length !== 2) throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?'); checkArrayTypes(signedMsg, publicKey); if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) throw new Error('bad public key size'); var tmp = new Uint8Array(signedMsg.length); var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); if (mlen < 0) return null; var m = new Uint8Array(mlen); for (var i = 0; i < m.length; i++) m[i] = tmp[i]; return m; }; nacl.sign.detached = function(msg, secretKey) { var signedMsg = nacl.sign(msg, secretKey); var sig = new Uint8Array(crypto_sign_BYTES); for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; return sig; }; nacl.sign.detached.verify = function(msg, sig, publicKey) { checkArrayTypes(msg, sig, publicKey); if (sig.length !== crypto_sign_BYTES) throw new Error('bad signature size'); if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) throw new Error('bad public key size'); var sm = new Uint8Array(crypto_sign_BYTES + msg.length); var m = new Uint8Array(crypto_sign_BYTES + msg.length); var i; for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); }; nacl.sign.keyPair = function() { var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); crypto_sign_keypair(pk, sk); return {publicKey: pk, secretKey: sk}; }; nacl.sign.keyPair.fromSecretKey = function(secretKey) { checkArrayTypes(secretKey); if (secretKey.length !== crypto_sign_SECRETKEYBYTES) throw new Error('bad secret key size'); var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i]; return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; }; nacl.sign.keyPair.fromSeed = function(seed) { checkArrayTypes(seed); if (seed.length !== crypto_sign_SEEDBYTES) throw new Error('bad seed size'); var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); for (var i = 0; i < 32; i++) sk[i] = seed[i]; crypto_sign_keypair(pk, sk, true); return {publicKey: pk, secretKey: sk}; }; nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; nacl.sign.seedLength = crypto_sign_SEEDBYTES; nacl.sign.signatureLength = crypto_sign_BYTES; nacl.hash = function(msg) { checkArrayTypes(msg); var h = new Uint8Array(crypto_hash_BYTES); crypto_hash(h, msg, msg.length); return h; }; nacl.hash.hashLength = crypto_hash_BYTES; nacl.verify = function(x, y) { checkArrayTypes(x, y); // Zero length arguments are considered not equal. if (x.length === 0 || y.length === 0) return false; if (x.length !== y.length) return false; return (vn(x, 0, y, 0, x.length) === 0) ? true : false; }; nacl.setPRNG = function(fn) { randombytes = fn; }; (function() { // Initialize PRNG if environment provides CSPRNG. // If not, methods calling randombytes will throw. var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null; if (crypto && crypto.getRandomValues) { // Browsers. var QUOTA = 65536; nacl.setPRNG(function(x, n) { var i, v = new Uint8Array(n); for (i = 0; i < n; i += QUOTA) { crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); } for (i = 0; i < n; i++) x[i] = v[i]; cleanup(v); }); } else if (true) { // Node.js. crypto = __webpack_require__(76417); if (crypto && crypto.randomBytes) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); for (i = 0; i < n; i++) x[i] = v[i]; cleanup(v); }); } } })(); })( true && module.exports ? module.exports : (self.nacl = self.nacl || {})); /***/ }), /***/ 70020: /***/ (function(__unused_webpack_module, exports) { /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ (function (global, factory) { true ? factory(exports) : 0; }(this, (function (exports) { 'use strict'; function merge() { for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { sets[_key] = arguments[_key]; } if (sets.length > 1) { sets[0] = sets[0].slice(0, -1); var xl = sets.length - 1; for (var x = 1; x < xl; ++x) { sets[x] = sets[x].slice(1, -1); } sets[xl] = sets[xl].slice(1); return sets.join(''); } else { return sets[0]; } } function subexp(str) { return "(?:" + str + ")"; } function typeOf(o) { return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); } function toUpperCase(str) { return str.toUpperCase(); } function toArray(obj) { return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; } function assign(target, source) { var obj = target; if (source) { for (var key in source) { obj[key] = source[key]; } } return obj; } function buildExps(isIRI) { var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; return { NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), UNRESERVED: new RegExp(UNRESERVED$$, "g"), OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules }; } var URI_PROTOCOL = buildExps(false); var IRI_PROTOCOL = buildExps(true); var slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; /** Highest positive signed 32-bit float value */ var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ var base = 36; var tMin = 1; var tMax = 26; var skew = 38; var damp = 700; var initialBias = 72; var initialN = 128; // 0x80 var delimiter = '-'; // '\x2D' /** Regular expressions */ var regexPunycode = /^xn--/; var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators /** Error messages */ var errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }; /** Convenience shortcuts */ var baseMinusTMin = base - tMin; var floor = Math.floor; var stringFromCharCode = String.fromCharCode; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error$1(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var result = []; var length = array.length; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = []; var counter = 0; var length = string.length; while (counter < length) { var value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. var extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // It's an unmatched surrogate; only append this code unit, in case the // next code unit is the high surrogate of a surrogate pair. output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ var ucs2encode = function ucs2encode(array) { return String.fromCodePoint.apply(String, toConsumableArray(array)); }; /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ var basicToDigit = function basicToDigit(codePoint) { if (codePoint - 0x30 < 0x0A) { return codePoint - 0x16; } if (codePoint - 0x41 < 0x1A) { return codePoint - 0x41; } if (codePoint - 0x61 < 0x1A) { return codePoint - 0x61; } return base; }; /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ var digitToBasic = function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); }; /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ var adapt = function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); }; /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ var decode = function decode(input) { // Don't use UCS-2. var output = []; var inputLength = input.length; var i = 0; var n = initialN; var bias = initialBias; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. var basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (var j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error$1('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. var oldi = i; for (var w = 1, k = base;; /* no condition */k += base) { if (index >= inputLength) { error$1('invalid-input'); } var digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error$1('overflow'); } i += digit * w; var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; if (digit < t) { break; } var baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error$1('overflow'); } w *= baseMinusT; } var out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error$1('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output. output.splice(i++, 0, n); } return String.fromCodePoint.apply(String, output); }; /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ var encode = function encode(input) { var output = []; // Convert the input in UCS-2 to an array of Unicode code points. input = ucs2decode(input); // Cache the length. var inputLength = input.length; // Initialize the state. var n = initialN; var delta = 0; var bias = initialBias; // Handle the basic code points. var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { var _currentValue2 = _step.value; if (_currentValue2 < 0x80) { output.push(stringFromCharCode(_currentValue2)); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } var basicLength = output.length; var handledCPCount = basicLength; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string with a delimiter unless it's empty. if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: var m = maxInt; var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { var currentValue = _step2.value; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , // but guard against overflow. } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } var handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error$1('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { var _currentValue = _step3.value; if (_currentValue < n && ++delta > maxInt) { error$1('overflow'); } if (_currentValue == n) { // Represent delta as a generalized variable-length integer. var q = delta; for (var k = base;; /* no condition */k += base) { var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; if (q < t) { break; } var qMinusT = q - t; var baseMinusT = base - t; output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } ++delta; ++n; } return output.join(''); }; /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ var toUnicode = function toUnicode(input) { return mapDomain(input, function (string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); }; /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ var toASCII = function toASCII(input) { return mapDomain(input, function (string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); }; /*--------------------------------------------------------------------------*/ /** Define the public API */ var punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '2.1.0', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** * URI.js * * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. * @author Gary Court * @see http://github.com/garycourt/uri-js */ /** * Copyright 2011 Gary Court. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of Gary Court. */ var SCHEMES = {}; function pctEncChar(chr) { var c = chr.charCodeAt(0); var e = void 0; if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); return e; } function pctDecChars(str) { var newStr = ""; var i = 0; var il = str.length; while (i < il) { var c = parseInt(str.substr(i + 1, 2), 16); if (c < 128) { newStr += String.fromCharCode(c); i += 3; } else if (c >= 194 && c < 224) { if (il - i >= 6) { var c2 = parseInt(str.substr(i + 4, 2), 16); newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); } else { newStr += str.substr(i, 6); } i += 6; } else if (c >= 224) { if (il - i >= 9) { var _c = parseInt(str.substr(i + 4, 2), 16); var c3 = parseInt(str.substr(i + 7, 2), 16); newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); } else { newStr += str.substr(i, 9); } i += 9; } else { newStr += str.substr(i, 3); i += 3; } } return newStr; } function _normalizeComponentEncoding(components, protocol) { function decodeUnreserved(str) { var decStr = pctDecChars(str); return !decStr.match(protocol.UNRESERVED) ? str : decStr; } if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); return components; } function _stripLeadingZeros(str) { return str.replace(/^0*(.*)/, "$1") || "0"; } function _normalizeIPv4(host, protocol) { var matches = host.match(protocol.IPV4ADDRESS) || []; var _matches = slicedToArray(matches, 2), address = _matches[1]; if (address) { return address.split(".").map(_stripLeadingZeros).join("."); } else { return host; } } function _normalizeIPv6(host, protocol) { var matches = host.match(protocol.IPV6ADDRESS) || []; var _matches2 = slicedToArray(matches, 3), address = _matches2[1], zone = _matches2[2]; if (address) { var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1]; var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; var lastFields = last.split(":").map(_stripLeadingZeros); var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); var fieldCount = isLastFieldIPv4Address ? 7 : 8; var lastFieldsStart = lastFields.length - fieldCount; var fields = Array(fieldCount); for (var x = 0; x < fieldCount; ++x) { fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; } if (isLastFieldIPv4Address) { fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); } var allZeroFields = fields.reduce(function (acc, field, index) { if (!field || field === "0") { var lastLongest = acc[acc.length - 1]; if (lastLongest && lastLongest.index + lastLongest.length === index) { lastLongest.length++; } else { acc.push({ index: index, length: 1 }); } } return acc; }, []); var longestZeroFields = allZeroFields.sort(function (a, b) { return b.length - a.length; })[0]; var newHost = void 0; if (longestZeroFields && longestZeroFields.length > 1) { var newFirst = fields.slice(0, longestZeroFields.index); var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); newHost = newFirst.join(":") + "::" + newLast.join(":"); } else { newHost = fields.join(":"); } if (zone) { newHost += "%" + zone; } return newHost; } else { return host; } } var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; function parse(uriString) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var components = {}; var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; var matches = uriString.match(URI_PARSE); if (matches) { if (NO_MATCH_IS_UNDEFINED) { //store each component components.scheme = matches[1]; components.userinfo = matches[3]; components.host = matches[4]; components.port = parseInt(matches[5], 10); components.path = matches[6] || ""; components.query = matches[7]; components.fragment = matches[8]; //fix port number if (isNaN(components.port)) { components.port = matches[5]; } } else { //IE FIX for improper RegExp matching //store each component components.scheme = matches[1] || undefined; components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; components.port = parseInt(matches[5], 10); components.path = matches[6] || ""; components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; //fix port number if (isNaN(components.port)) { components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; } } if (components.host) { //normalize IP hosts components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); } //determine reference type if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { components.reference = "same-document"; } else if (components.scheme === undefined) { components.reference = "relative"; } else if (components.fragment === undefined) { components.reference = "absolute"; } else { components.reference = "uri"; } //check for reference errors if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { components.error = components.error || "URI is not a " + options.reference + " reference."; } //find scheme handler var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; //check if scheme can't handle IRIs if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { //if host component is a domain name if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { //convert Unicode IDN -> ASCII IDN try { components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); } catch (e) { components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; } } //convert IRI -> URI _normalizeComponentEncoding(components, URI_PROTOCOL); } else { //normalize encodings _normalizeComponentEncoding(components, protocol); } //perform scheme specific parsing if (schemeHandler && schemeHandler.parse) { schemeHandler.parse(components, options); } } else { components.error = components.error || "URI can not be parsed."; } return components; } function _recomposeAuthority(components, options) { var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; var uriTokens = []; if (components.userinfo !== undefined) { uriTokens.push(components.userinfo); uriTokens.push("@"); } if (components.host !== undefined) { //normalize IP hosts, add brackets and escape zone separator for IPv6 uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; })); } if (typeof components.port === "number" || typeof components.port === "string") { uriTokens.push(":"); uriTokens.push(String(components.port)); } return uriTokens.length ? uriTokens.join("") : undefined; } var RDS1 = /^\.\.?\//; var RDS2 = /^\/\.(\/|$)/; var RDS3 = /^\/\.\.(\/|$)/; var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; function removeDotSegments(input) { var output = []; while (input.length) { if (input.match(RDS1)) { input = input.replace(RDS1, ""); } else if (input.match(RDS2)) { input = input.replace(RDS2, "/"); } else if (input.match(RDS3)) { input = input.replace(RDS3, "/"); output.pop(); } else if (input === "." || input === "..") { input = ""; } else { var im = input.match(RDS5); if (im) { var s = im[0]; input = input.slice(s.length); output.push(s); } else { throw new Error("Unexpected dot segment condition"); } } } return output.join(""); } function serialize(components) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; var uriTokens = []; //find scheme handler var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; //perform scheme specific serialization if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); if (components.host) { //if host component is an IPv6 address if (protocol.IPV6ADDRESS.test(components.host)) {} //TODO: normalize IPv6 address as per RFC 5952 //if host component is a domain name else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { //convert IDN via punycode try { components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); } catch (e) { components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; } } } //normalize encoding _normalizeComponentEncoding(components, protocol); if (options.reference !== "suffix" && components.scheme) { uriTokens.push(components.scheme); uriTokens.push(":"); } var authority = _recomposeAuthority(components, options); if (authority !== undefined) { if (options.reference !== "suffix") { uriTokens.push("//"); } uriTokens.push(authority); if (components.path && components.path.charAt(0) !== "/") { uriTokens.push("/"); } } if (components.path !== undefined) { var s = components.path; if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { s = removeDotSegments(s); } if (authority === undefined) { s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" } uriTokens.push(s); } if (components.query !== undefined) { uriTokens.push("?"); uriTokens.push(components.query); } if (components.fragment !== undefined) { uriTokens.push("#"); uriTokens.push(components.fragment); } return uriTokens.join(""); //merge tokens into a string } function resolveComponents(base, relative) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var skipNormalization = arguments[3]; var target = {}; if (!skipNormalization) { base = parse(serialize(base, options), options); //normalize base components relative = parse(serialize(relative, options), options); //normalize relative components } options = options || {}; if (!options.tolerant && relative.scheme) { target.scheme = relative.scheme; //target.authority = relative.authority; target.userinfo = relative.userinfo; target.host = relative.host; target.port = relative.port; target.path = removeDotSegments(relative.path || ""); target.query = relative.query; } else { if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { //target.authority = relative.authority; target.userinfo = relative.userinfo; target.host = relative.host; target.port = relative.port; target.path = removeDotSegments(relative.path || ""); target.query = relative.query; } else { if (!relative.path) { target.path = base.path; if (relative.query !== undefined) { target.query = relative.query; } else { target.query = base.query; } } else { if (relative.path.charAt(0) === "/") { target.path = removeDotSegments(relative.path); } else { if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { target.path = "/" + relative.path; } else if (!base.path) { target.path = relative.path; } else { target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; } target.path = removeDotSegments(target.path); } target.query = relative.query; } //target.authority = base.authority; target.userinfo = base.userinfo; target.host = base.host; target.port = base.port; } target.scheme = base.scheme; } target.fragment = relative.fragment; return target; } function resolve(baseURI, relativeURI, options) { var schemelessOptions = assign({ scheme: 'null' }, options); return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); } function normalize(uri, options) { if (typeof uri === "string") { uri = serialize(parse(uri, options), options); } else if (typeOf(uri) === "object") { uri = parse(serialize(uri, options), options); } return uri; } function equal(uriA, uriB, options) { if (typeof uriA === "string") { uriA = serialize(parse(uriA, options), options); } else if (typeOf(uriA) === "object") { uriA = serialize(uriA, options); } if (typeof uriB === "string") { uriB = serialize(parse(uriB, options), options); } else if (typeOf(uriB) === "object") { uriB = serialize(uriB, options); } return uriA === uriB; } function escapeComponent(str, options) { return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); } function unescapeComponent(str, options) { return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); } var handler = { scheme: "http", domainHost: true, parse: function parse(components, options) { //report missing host if (!components.host) { components.error = components.error || "HTTP URIs must have a host."; } return components; }, serialize: function serialize(components, options) { var secure = String(components.scheme).toLowerCase() === "https"; //normalize the default port if (components.port === (secure ? 443 : 80) || components.port === "") { components.port = undefined; } //normalize the empty path if (!components.path) { components.path = "/"; } //NOTE: We do not parse query strings for HTTP URIs //as WWW Form Url Encoded query strings are part of the HTML4+ spec, //and not the HTTP spec. return components; } }; var handler$1 = { scheme: "https", domainHost: handler.domainHost, parse: handler.parse, serialize: handler.serialize }; function isSecure(wsComponents) { return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; } //RFC 6455 var handler$2 = { scheme: "ws", domainHost: true, parse: function parse(components, options) { var wsComponents = components; //indicate if the secure flag is set wsComponents.secure = isSecure(wsComponents); //construct resouce name wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); wsComponents.path = undefined; wsComponents.query = undefined; return wsComponents; }, serialize: function serialize(wsComponents, options) { //normalize the default port if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { wsComponents.port = undefined; } //ensure scheme matches secure flag if (typeof wsComponents.secure === 'boolean') { wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; wsComponents.secure = undefined; } //reconstruct path from resource name if (wsComponents.resourceName) { var _wsComponents$resourc = wsComponents.resourceName.split('?'), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1]; wsComponents.path = path && path !== '/' ? path : undefined; wsComponents.query = query; wsComponents.resourceName = undefined; } //forbid fragment component wsComponents.fragment = undefined; return wsComponents; } }; var handler$3 = { scheme: "wss", domainHost: handler$2.domainHost, parse: handler$2.parse, serialize: handler$2.serialize }; var O = {}; var isIRI = true; //RFC 3986 var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = //const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; //const WSP$$ = "[\\x20\\x09]"; //const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) //const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext //const VCHAR$$ = "[\\x21-\\x7E]"; //const WSP$$ = "[\\x20\\x09]"; //const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext //const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); //const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); //const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; var UNRESERVED = new RegExp(UNRESERVED$$, "g"); var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); var NOT_HFVALUE = NOT_HFNAME; function decodeUnreserved(str) { var decStr = pctDecChars(str); return !decStr.match(UNRESERVED) ? str : decStr; } var handler$4 = { scheme: "mailto", parse: function parse$$1(components, options) { var mailtoComponents = components; var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; mailtoComponents.path = undefined; if (mailtoComponents.query) { var unknownHeaders = false; var headers = {}; var hfields = mailtoComponents.query.split("&"); for (var x = 0, xl = hfields.length; x < xl; ++x) { var hfield = hfields[x].split("="); switch (hfield[0]) { case "to": var toAddrs = hfield[1].split(","); for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { to.push(toAddrs[_x]); } break; case "subject": mailtoComponents.subject = unescapeComponent(hfield[1], options); break; case "body": mailtoComponents.body = unescapeComponent(hfield[1], options); break; default: unknownHeaders = true; headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); break; } } if (unknownHeaders) mailtoComponents.headers = headers; } mailtoComponents.query = undefined; for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { var addr = to[_x2].split("@"); addr[0] = unescapeComponent(addr[0]); if (!options.unicodeSupport) { //convert Unicode IDN -> ASCII IDN try { addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); } catch (e) { mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; } } else { addr[1] = unescapeComponent(addr[1], options).toLowerCase(); } to[_x2] = addr.join("@"); } return mailtoComponents; }, serialize: function serialize$$1(mailtoComponents, options) { var components = mailtoComponents; var to = toArray(mailtoComponents.to); if (to) { for (var x = 0, xl = to.length; x < xl; ++x) { var toAddr = String(to[x]); var atIdx = toAddr.lastIndexOf("@"); var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); var domain = toAddr.slice(atIdx + 1); //convert IDN via punycode try { domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); } catch (e) { components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; } to[x] = localPart + "@" + domain; } components.path = to.join(","); } var headers = mailtoComponents.headers = mailtoComponents.headers || {}; if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; if (mailtoComponents.body) headers["body"] = mailtoComponents.body; var fields = []; for (var name in headers) { if (headers[name] !== O[name]) { fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); } } if (fields.length) { components.query = fields.join("&"); } return components; } }; var URN_PARSE = /^([^\:]+)\:(.*)/; //RFC 2141 var handler$5 = { scheme: "urn", parse: function parse$$1(components, options) { var matches = components.path && components.path.match(URN_PARSE); var urnComponents = components; if (matches) { var scheme = options.scheme || urnComponents.scheme || "urn"; var nid = matches[1].toLowerCase(); var nss = matches[2]; var urnScheme = scheme + ":" + (options.nid || nid); var schemeHandler = SCHEMES[urnScheme]; urnComponents.nid = nid; urnComponents.nss = nss; urnComponents.path = undefined; if (schemeHandler) { urnComponents = schemeHandler.parse(urnComponents, options); } } else { urnComponents.error = urnComponents.error || "URN can not be parsed."; } return urnComponents; }, serialize: function serialize$$1(urnComponents, options) { var scheme = options.scheme || urnComponents.scheme || "urn"; var nid = urnComponents.nid; var urnScheme = scheme + ":" + (options.nid || nid); var schemeHandler = SCHEMES[urnScheme]; if (schemeHandler) { urnComponents = schemeHandler.serialize(urnComponents, options); } var uriComponents = urnComponents; var nss = urnComponents.nss; uriComponents.path = (nid || options.nid) + ":" + nss; return uriComponents; } }; var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; //RFC 4122 var handler$6 = { scheme: "urn:uuid", parse: function parse(urnComponents, options) { var uuidComponents = urnComponents; uuidComponents.uuid = uuidComponents.nss; uuidComponents.nss = undefined; if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { uuidComponents.error = uuidComponents.error || "UUID is not valid."; } return uuidComponents; }, serialize: function serialize(uuidComponents, options) { var urnComponents = uuidComponents; //normalize UUID urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); return urnComponents; } }; SCHEMES[handler.scheme] = handler; SCHEMES[handler$1.scheme] = handler$1; SCHEMES[handler$2.scheme] = handler$2; SCHEMES[handler$3.scheme] = handler$3; SCHEMES[handler$4.scheme] = handler$4; SCHEMES[handler$5.scheme] = handler$5; SCHEMES[handler$6.scheme] = handler$6; exports.SCHEMES = SCHEMES; exports.pctEncChar = pctEncChar; exports.pctDecChars = pctDecChars; exports.parse = parse; exports.removeDotSegments = removeDotSegments; exports.serialize = serialize; exports.resolveComponents = resolveComponents; exports.resolve = resolve; exports.normalize = normalize; exports.equal = equal; exports.escapeComponent = escapeComponent; exports.unescapeComponent = unescapeComponent; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=uri.all.js.map /***/ }), /***/ 65278: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * For Node.js, simply re-export the core `util.deprecate` function. */ module.exports = __webpack_require__(31669).deprecate; /***/ }), /***/ 4552: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "NIL": () => /* reexport */ nil, "parse": () => /* reexport */ esm_node_parse, "stringify": () => /* reexport */ esm_node_stringify, "v1": () => /* reexport */ esm_node_v1, "v3": () => /* reexport */ esm_node_v3, "v4": () => /* reexport */ esm_node_v4, "v5": () => /* reexport */ esm_node_v5, "validate": () => /* reexport */ esm_node_validate, "version": () => /* reexport */ esm_node_version }); // EXTERNAL MODULE: external "crypto" var external_crypto_ = __webpack_require__(76417); var external_crypto_default = /*#__PURE__*/__webpack_require__.n(external_crypto_); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/rng.js const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate let poolPtr = rnds8Pool.length; function rng() { if (poolPtr > rnds8Pool.length - 16) { external_crypto_default().randomFillSync(rnds8Pool); poolPtr = 0; } return rnds8Pool.slice(poolPtr, poolPtr += 16); } // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/regex.js /* harmony default export */ const regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/validate.js function validate(uuid) { return typeof uuid === 'string' && regex.test(uuid); } /* harmony default export */ const esm_node_validate = (validate); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/stringify.js /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ const byteToHex = []; for (let i = 0; i < 256; ++i) { byteToHex.push((i + 0x100).toString(16).substr(1)); } function stringify(arr, offset = 0) { // Note: Be careful editing this code! It's been tuned for performance // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one // of the following: // - One or more input array values don't map to a hex octet (leading to // "undefined" in the uuid) // - Invalid input values for the RFC `version` or `variant` fields if (!esm_node_validate(uuid)) { throw TypeError('Stringified UUID is invalid'); } return uuid; } /* harmony default export */ const esm_node_stringify = (stringify); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v1.js // **`v1()` - Generate time-based UUID** // // Inspired by https://github.com/LiosK/UUID.js // and http://docs.python.org/library/uuid.html let _nodeId; let _clockseq; // Previous uuid creation time let _lastMSecs = 0; let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details function v1(options, buf, offset) { let i = buf && offset || 0; const b = buf || new Array(16); options = options || {}; let node = options.node || _nodeId; let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not // specified. We do this lazily to minimize issues related to insufficient // system entropy. See #189 if (node == null || clockseq == null) { const seedBytes = options.random || (options.rng || rng)(); if (node == null) { // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; } if (clockseq == null) { // Per 4.2.2, randomize (14 bit) clockseq clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } } // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression if (dt < 0 && options.clockseq === undefined) { clockseq = clockseq + 1 & 0x3fff; } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // time interval if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { nsecs = 0; } // Per 4.2.1.2 Throw error if too many uuids are requested if (nsecs >= 10000) { throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); } _lastMSecs = msecs; _lastNSecs = nsecs; _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch msecs += 12219292800000; // `time_low` const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; b[i++] = tl >>> 24 & 0xff; b[i++] = tl >>> 16 & 0xff; b[i++] = tl >>> 8 & 0xff; b[i++] = tl & 0xff; // `time_mid` const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; b[i++] = tmh >>> 8 & 0xff; b[i++] = tmh & 0xff; // `time_high_and_version` b[i++] = tmh >>> 24 & 0xf | 0x10; // include version b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` b[i++] = clockseq & 0xff; // `node` for (let n = 0; n < 6; ++n) { b[i + n] = node[n]; } return buf || esm_node_stringify(b); } /* harmony default export */ const esm_node_v1 = (v1); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/parse.js function parse(uuid) { if (!esm_node_validate(uuid)) { throw TypeError('Invalid UUID'); } let v; const arr = new Uint8Array(16); // Parse ########-....-....-....-............ arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; arr[1] = v >>> 16 & 0xff; arr[2] = v >>> 8 & 0xff; arr[3] = v & 0xff; // Parse ........-####-....-....-............ arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; arr[5] = v & 0xff; // Parse ........-....-####-....-............ arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; arr[7] = v & 0xff; // Parse ........-....-....-####-............ arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; arr[9] = v & 0xff; // Parse ........-....-....-....-############ // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; arr[11] = v / 0x100000000 & 0xff; arr[12] = v >>> 24 & 0xff; arr[13] = v >>> 16 & 0xff; arr[14] = v >>> 8 & 0xff; arr[15] = v & 0xff; return arr; } /* harmony default export */ const esm_node_parse = (parse); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v35.js function stringToBytes(str) { str = unescape(encodeURIComponent(str)); // UTF8 escape const bytes = []; for (let i = 0; i < str.length; ++i) { bytes.push(str.charCodeAt(i)); } return bytes; } const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; /* harmony default export */ function v35(name, version, hashfunc) { function generateUUID(value, namespace, buf, offset) { if (typeof value === 'string') { value = stringToBytes(value); } if (typeof namespace === 'string') { namespace = esm_node_parse(namespace); } if (namespace.length !== 16) { throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); } // Compute hash of namespace and value, Per 4.3 // Future: Use spread syntax when supported on all platforms, e.g. `bytes = // hashfunc([...namespace, ... value])` let bytes = new Uint8Array(16 + value.length); bytes.set(namespace); bytes.set(value, namespace.length); bytes = hashfunc(bytes); bytes[6] = bytes[6] & 0x0f | version; bytes[8] = bytes[8] & 0x3f | 0x80; if (buf) { offset = offset || 0; for (let i = 0; i < 16; ++i) { buf[offset + i] = bytes[i]; } return buf; } return esm_node_stringify(bytes); } // Function#name is not settable on some platforms (#270) try { generateUUID.name = name; // eslint-disable-next-line no-empty } catch (err) {} // For CommonJS default export support generateUUID.DNS = DNS; generateUUID.URL = URL; return generateUUID; } // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/md5.js function md5(bytes) { if (Array.isArray(bytes)) { bytes = Buffer.from(bytes); } else if (typeof bytes === 'string') { bytes = Buffer.from(bytes, 'utf8'); } return external_crypto_default().createHash('md5').update(bytes).digest(); } /* harmony default export */ const esm_node_md5 = (md5); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v3.js const v3 = v35('v3', 0x30, esm_node_md5); /* harmony default export */ const esm_node_v3 = (v3); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v4.js function v4(options, buf, offset) { options = options || {}; const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = rnds[6] & 0x0f | 0x40; rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided if (buf) { offset = offset || 0; for (let i = 0; i < 16; ++i) { buf[offset + i] = rnds[i]; } return buf; } return esm_node_stringify(rnds); } /* harmony default export */ const esm_node_v4 = (v4); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/sha1.js function sha1(bytes) { if (Array.isArray(bytes)) { bytes = Buffer.from(bytes); } else if (typeof bytes === 'string') { bytes = Buffer.from(bytes, 'utf8'); } return external_crypto_default().createHash('sha1').update(bytes).digest(); } /* harmony default export */ const esm_node_sha1 = (sha1); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/v5.js const v5 = v35('v5', 0x50, esm_node_sha1); /* harmony default export */ const esm_node_v5 = (v5); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/nil.js /* harmony default export */ const nil = ('00000000-0000-0000-0000-000000000000'); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/version.js function version(uuid) { if (!esm_node_validate(uuid)) { throw TypeError('Invalid UUID'); } return parseInt(uuid.substr(14, 1), 16); } /* harmony default export */ const esm_node_version = (version); // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-node/index.js /***/ }), /***/ 81692: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* * verror.js: richer JavaScript errors */ var mod_assertplus = __webpack_require__(66631); var mod_util = __webpack_require__(31669); var mod_extsprintf = __webpack_require__(41508); var mod_isError = __webpack_require__(95898)/* .isError */ .VZ; var sprintf = mod_extsprintf.sprintf; /* * Public interface */ /* So you can 'var VError = require('verror')' */ module.exports = VError; /* For compatibility */ VError.VError = VError; /* Other exported classes */ VError.SError = SError; VError.WError = WError; VError.MultiError = MultiError; /* * Common function used to parse constructor arguments for VError, WError, and * SError. Named arguments to this function: * * strict force strict interpretation of sprintf arguments, even * if the options in "argv" don't say so * * argv error's constructor arguments, which are to be * interpreted as described in README.md. For quick * reference, "argv" has one of the following forms: * * [ sprintf_args... ] (argv[0] is a string) * [ cause, sprintf_args... ] (argv[0] is an Error) * [ options, sprintf_args... ] (argv[0] is an object) * * This function normalizes these forms, producing an object with the following * properties: * * options equivalent to "options" in third form. This will never * be a direct reference to what the caller passed in * (i.e., it may be a shallow copy), so it can be freely * modified. * * shortmessage result of sprintf(sprintf_args), taking options.strict * into account as described in README.md. */ function parseConstructorArguments(args) { var argv, options, sprintf_args, shortmessage, k; mod_assertplus.object(args, 'args'); mod_assertplus.bool(args.strict, 'args.strict'); mod_assertplus.array(args.argv, 'args.argv'); argv = args.argv; /* * First, figure out which form of invocation we've been given. */ if (argv.length === 0) { options = {}; sprintf_args = []; } else if (mod_isError(argv[0])) { options = { 'cause': argv[0] }; sprintf_args = argv.slice(1); } else if (typeof (argv[0]) === 'object') { options = {}; for (k in argv[0]) { options[k] = argv[0][k]; } sprintf_args = argv.slice(1); } else { mod_assertplus.string(argv[0], 'first argument to VError, SError, or WError ' + 'constructor must be a string, object, or Error'); options = {}; sprintf_args = argv; } /* * Now construct the error's message. * * extsprintf (which we invoke here with our caller's arguments in order * to construct this Error's message) is strict in its interpretation of * values to be processed by the "%s" specifier. The value passed to * extsprintf must actually be a string or something convertible to a * String using .toString(). Passing other values (notably "null" and * "undefined") is considered a programmer error. The assumption is * that if you actually want to print the string "null" or "undefined", * then that's easy to do that when you're calling extsprintf; on the * other hand, if you did NOT want that (i.e., there's actually a bug * where the program assumes some variable is non-null and tries to * print it, which might happen when constructing a packet or file in * some specific format), then it's better to stop immediately than * produce bogus output. * * However, sometimes the bug is only in the code calling VError, and a * programmer might prefer to have the error message contain "null" or * "undefined" rather than have the bug in the error path crash the * program (making the first bug harder to identify). For that reason, * by default VError converts "null" or "undefined" arguments to their * string representations and passes those to extsprintf. Programmers * desiring the strict behavior can use the SError class or pass the * "strict" option to the VError constructor. */ mod_assertplus.object(options); if (!options.strict && !args.strict) { sprintf_args = sprintf_args.map(function (a) { return (a === null ? 'null' : a === undefined ? 'undefined' : a); }); } if (sprintf_args.length === 0) { shortmessage = ''; } else { shortmessage = sprintf.apply(null, sprintf_args); } return ({ 'options': options, 'shortmessage': shortmessage }); } /* * See README.md for reference documentation. */ function VError() { var args, obj, parsed, cause, ctor, message, k; args = Array.prototype.slice.call(arguments, 0); /* * This is a regrettable pattern, but JavaScript's built-in Error class * is defined to work this way, so we allow the constructor to be called * without "new". */ if (!(this instanceof VError)) { obj = Object.create(VError.prototype); VError.apply(obj, arguments); return (obj); } /* * For convenience and backwards compatibility, we support several * different calling forms. Normalize them here. */ parsed = parseConstructorArguments({ 'argv': args, 'strict': false }); /* * If we've been given a name, apply it now. */ if (parsed.options.name) { mod_assertplus.string(parsed.options.name, 'error\'s "name" must be a string'); this.name = parsed.options.name; } /* * For debugging, we keep track of the original short message (attached * this Error particularly) separately from the complete message (which * includes the messages of our cause chain). */ this.jse_shortmsg = parsed.shortmessage; message = parsed.shortmessage; /* * If we've been given a cause, record a reference to it and update our * message appropriately. */ cause = parsed.options.cause; if (cause) { mod_assertplus.ok(mod_isError(cause), 'cause is not an Error'); this.jse_cause = cause; if (!parsed.options.skipCauseMessage) { message += ': ' + cause.message; } } /* * If we've been given an object with properties, shallow-copy that * here. We don't want to use a deep copy in case there are non-plain * objects here, but we don't want to use the original object in case * the caller modifies it later. */ this.jse_info = {}; if (parsed.options.info) { for (k in parsed.options.info) { this.jse_info[k] = parsed.options.info[k]; } } this.message = message; Error.call(this, message); if (Error.captureStackTrace) { ctor = parsed.options.constructorOpt || this.constructor; Error.captureStackTrace(this, ctor); } return (this); } mod_util.inherits(VError, Error); VError.prototype.name = 'VError'; VError.prototype.toString = function ve_toString() { var str = (this.hasOwnProperty('name') && this.name || this.constructor.name || this.constructor.prototype.name); if (this.message) str += ': ' + this.message; return (str); }; /* * This method is provided for compatibility. New callers should use * VError.cause() instead. That method also uses the saner `null` return value * when there is no cause. */ VError.prototype.cause = function ve_cause() { var cause = VError.cause(this); return (cause === null ? undefined : cause); }; /* * Static methods * * These class-level methods are provided so that callers can use them on * instances of Errors that are not VErrors. New interfaces should be provided * only using static methods to eliminate the class of programming mistake where * people fail to check whether the Error object has the corresponding methods. */ VError.cause = function (err) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); return (mod_isError(err.jse_cause) ? err.jse_cause : null); }; VError.info = function (err) { var rv, cause, k; mod_assertplus.ok(mod_isError(err), 'err must be an Error'); cause = VError.cause(err); if (cause !== null) { rv = VError.info(cause); } else { rv = {}; } if (typeof (err.jse_info) == 'object' && err.jse_info !== null) { for (k in err.jse_info) { rv[k] = err.jse_info[k]; } } return (rv); }; VError.findCauseByName = function (err, name) { var cause; mod_assertplus.ok(mod_isError(err), 'err must be an Error'); mod_assertplus.string(name, 'name'); mod_assertplus.ok(name.length > 0, 'name cannot be empty'); for (cause = err; cause !== null; cause = VError.cause(cause)) { mod_assertplus.ok(mod_isError(cause)); if (cause.name == name) { return (cause); } } return (null); }; VError.hasCauseWithName = function (err, name) { return (VError.findCauseByName(err, name) !== null); }; VError.fullStack = function (err) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); var cause = VError.cause(err); if (cause) { return (err.stack + '\ncaused by: ' + VError.fullStack(cause)); } return (err.stack); }; VError.errorFromList = function (errors) { mod_assertplus.arrayOfObject(errors, 'errors'); if (errors.length === 0) { return (null); } errors.forEach(function (e) { mod_assertplus.ok(mod_isError(e)); }); if (errors.length == 1) { return (errors[0]); } return (new MultiError(errors)); }; VError.errorForEach = function (err, func) { mod_assertplus.ok(mod_isError(err), 'err must be an Error'); mod_assertplus.func(func, 'func'); if (err instanceof MultiError) { err.errors().forEach(function iterError(e) { func(e); }); } else { func(err); } }; /* * SError is like VError, but stricter about types. You cannot pass "null" or * "undefined" as string arguments to the formatter. */ function SError() { var args, obj, parsed, options; args = Array.prototype.slice.call(arguments, 0); if (!(this instanceof SError)) { obj = Object.create(SError.prototype); SError.apply(obj, arguments); return (obj); } parsed = parseConstructorArguments({ 'argv': args, 'strict': true }); options = parsed.options; VError.call(this, options, '%s', parsed.shortmessage); return (this); } /* * We don't bother setting SError.prototype.name because once constructed, * SErrors are just like VErrors. */ mod_util.inherits(SError, VError); /* * Represents a collection of errors for the purpose of consumers that generally * only deal with one error. Callers can extract the individual errors * contained in this object, but may also just treat it as a normal single * error, in which case a summary message will be printed. */ function MultiError(errors) { mod_assertplus.array(errors, 'list of errors'); mod_assertplus.ok(errors.length > 0, 'must be at least one error'); this.ase_errors = errors; VError.call(this, { 'cause': errors[0] }, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's'); } mod_util.inherits(MultiError, VError); MultiError.prototype.name = 'MultiError'; MultiError.prototype.errors = function me_errors() { return (this.ase_errors.slice(0)); }; /* * See README.md for reference details. */ function WError() { var args, obj, parsed, options; args = Array.prototype.slice.call(arguments, 0); if (!(this instanceof WError)) { obj = Object.create(WError.prototype); WError.apply(obj, args); return (obj); } parsed = parseConstructorArguments({ 'argv': args, 'strict': false }); options = parsed.options; options['skipCauseMessage'] = true; VError.call(this, options, '%s', parsed.shortmessage); return (this); } mod_util.inherits(WError, VError); WError.prototype.name = 'WError'; WError.prototype.toString = function we_toString() { var str = (this.hasOwnProperty('name') && this.name || this.constructor.name || this.constructor.prototype.name); if (this.message) str += ': ' + this.message; if (this.jse_cause && this.jse_cause.message) str += '; caused by ' + this.jse_cause.toString(); return (str); }; /* * For purely historical reasons, WError's cause() function allows you to set * the cause. */ WError.prototype.cause = function we_cause(c) { if (mod_isError(c)) this.jse_cause = c; return (this.jse_cause); }; /***/ }), /***/ 41508: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* * extsprintf.js: extended POSIX-style sprintf */ var mod_assert = __webpack_require__(42357); var mod_util = __webpack_require__(31669); /* * Public interface */ exports.sprintf = jsSprintf; exports.printf = jsPrintf; exports.fprintf = jsFprintf; /* * Stripped down version of s[n]printf(3c). We make a best effort to throw an * exception when given a format string we don't understand, rather than * ignoring it, so that we won't break existing programs if/when we go implement * the rest of this. * * This implementation currently supports specifying * - field alignment ('-' flag), * - zero-pad ('0' flag) * - always show numeric sign ('+' flag), * - field width * - conversions for strings, decimal integers, and floats (numbers). * - argument size specifiers. These are all accepted but ignored, since * Javascript has no notion of the physical size of an argument. * * Everything else is currently unsupported, most notably precision, unsigned * numbers, non-decimal numbers, and characters. */ function jsSprintf(ofmt) { var regex = [ '([^%]*)', /* normal text */ '%', /* start of format */ '([\'\\-+ #0]*?)', /* flags (optional) */ '([1-9]\\d*)?', /* width (optional) */ '(\\.([1-9]\\d*))?', /* precision (optional) */ '[lhjztL]*?', /* length mods (ignored) */ '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */ ].join(''); var re = new RegExp(regex); /* variadic arguments used to fill in conversion specifiers */ var args = Array.prototype.slice.call(arguments, 1); /* remaining format string */ var fmt = ofmt; /* components of the current conversion specifier */ var flags, width, precision, conversion; var left, pad, sign, arg, match; /* return value */ var ret = ''; /* current variadic argument (1-based) */ var argn = 1; /* 0-based position in the format string that we've read */ var posn = 0; /* 1-based position in the format string of the current conversion */ var convposn; /* current conversion specifier */ var curconv; mod_assert.equal('string', typeof (fmt), 'first argument must be a format string'); while ((match = re.exec(fmt)) !== null) { ret += match[1]; fmt = fmt.substring(match[0].length); /* * Update flags related to the current conversion specifier's * position so that we can report clear error messages. */ curconv = match[0].substring(match[1].length); convposn = posn + match[1].length + 1; posn += match[0].length; flags = match[2] || ''; width = match[3] || 0; precision = match[4] || ''; conversion = match[6]; left = false; sign = false; pad = ' '; if (conversion == '%') { ret += '%'; continue; } if (args.length === 0) { throw (jsError(ofmt, convposn, curconv, 'has no matching argument ' + '(too few arguments passed)')); } arg = args.shift(); argn++; if (flags.match(/[\' #]/)) { throw (jsError(ofmt, convposn, curconv, 'uses unsupported flags')); } if (precision.length > 0) { throw (jsError(ofmt, convposn, curconv, 'uses non-zero precision (not supported)')); } if (flags.match(/-/)) left = true; if (flags.match(/0/)) pad = '0'; if (flags.match(/\+/)) sign = true; switch (conversion) { case 's': if (arg === undefined || arg === null) { throw (jsError(ofmt, convposn, curconv, 'attempted to print undefined or null ' + 'as a string (argument ' + argn + ' to ' + 'sprintf)')); } ret += doPad(pad, width, left, arg.toString()); break; case 'd': arg = Math.floor(arg); /*jsl:fallthru*/ case 'f': sign = sign && arg > 0 ? '+' : ''; ret += sign + doPad(pad, width, left, arg.toString()); break; case 'x': ret += doPad(pad, width, left, arg.toString(16)); break; case 'j': /* non-standard */ if (width === 0) width = 10; ret += mod_util.inspect(arg, false, width); break; case 'r': /* non-standard */ ret += dumpException(arg); break; default: throw (jsError(ofmt, convposn, curconv, 'is not supported')); } } ret += fmt; return (ret); } function jsError(fmtstr, convposn, curconv, reason) { mod_assert.equal(typeof (fmtstr), 'string'); mod_assert.equal(typeof (curconv), 'string'); mod_assert.equal(typeof (convposn), 'number'); mod_assert.equal(typeof (reason), 'string'); return (new Error('format string "' + fmtstr + '": conversion specifier "' + curconv + '" at character ' + convposn + ' ' + reason)); } function jsPrintf() { var args = Array.prototype.slice.call(arguments); args.unshift(process.stdout); jsFprintf.apply(null, args); } function jsFprintf(stream) { var args = Array.prototype.slice.call(arguments, 1); return (stream.write(jsSprintf.apply(this, args))); } function doPad(chr, width, left, str) { var ret = str; while (ret.length < width) { if (left) ret += chr; else ret = chr + ret; } return (ret); } /* * This function dumps long stack traces for exceptions having a cause() method. * See node-verror for an example. */ function dumpException(ex) { var ret; if (!(ex instanceof Error)) throw (new Error(jsSprintf('invalid type for %%r: %j', ex))); /* Note that V8 prepends "ex.stack" with ex.toString(). */ ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack; if (ex.cause && typeof (ex.cause) === 'function') { var cex = ex.cause(); if (cex) { ret += '\nCaused by: ' + dumpException(cex); } } return (ret); } /***/ }), /***/ 62940: /***/ ((module) => { // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. // This makes sure that own properties are retained, so that // decorations and such are not lost along the way. module.exports = wrappy function wrappy (fn, cb) { if (fn && cb) return wrappy(fn)(cb) if (typeof fn !== 'function') throw new TypeError('need wrapper function') Object.keys(fn).forEach(function (k) { wrapper[k] = fn[k] }) return wrapper function wrapper() { var args = new Array(arguments.length) for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } var ret = fn.apply(this, args) var cb = args[args.length-1] if (typeof ret === 'function' && ret !== cb) { Object.keys(cb).forEach(function (k) { ret[k] = cb[k] }) } return ret } } /***/ }), /***/ 88867: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const WebSocket = __webpack_require__(91518); WebSocket.createWebSocketStream = __webpack_require__(41658); WebSocket.Server = __webpack_require__(58887); WebSocket.Receiver = __webpack_require__(25066); WebSocket.Sender = __webpack_require__(36947); module.exports = WebSocket; /***/ }), /***/ 9436: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { EMPTY_BUFFER } = __webpack_require__(15949); /** * Merges an array of buffers into a new buffer. * * @param {Buffer[]} list The array of buffers to concat * @param {Number} totalLength The total length of buffers in the list * @return {Buffer} The resulting buffer * @public */ function concat(list, totalLength) { if (list.length === 0) return EMPTY_BUFFER; if (list.length === 1) return list[0]; const target = Buffer.allocUnsafe(totalLength); let offset = 0; for (let i = 0; i < list.length; i++) { const buf = list[i]; target.set(buf, offset); offset += buf.length; } if (offset < totalLength) return target.slice(0, offset); return target; } /** * Masks a buffer using the given mask. * * @param {Buffer} source The buffer to mask * @param {Buffer} mask The mask to use * @param {Buffer} output The buffer where to store the result * @param {Number} offset The offset at which to start writing * @param {Number} length The number of bytes to mask. * @public */ function _mask(source, mask, output, offset, length) { for (let i = 0; i < length; i++) { output[offset + i] = source[i] ^ mask[i & 3]; } } /** * Unmasks a buffer using the given mask. * * @param {Buffer} buffer The buffer to unmask * @param {Buffer} mask The mask to use * @public */ function _unmask(buffer, mask) { // Required until https://github.com/nodejs/node/issues/9006 is resolved. const length = buffer.length; for (let i = 0; i < length; i++) { buffer[i] ^= mask[i & 3]; } } /** * Converts a buffer to an `ArrayBuffer`. * * @param {Buffer} buf The buffer to convert * @return {ArrayBuffer} Converted buffer * @public */ function toArrayBuffer(buf) { if (buf.byteLength === buf.buffer.byteLength) { return buf.buffer; } return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); } /** * Converts `data` to a `Buffer`. * * @param {*} data The data to convert * @return {Buffer} The buffer * @throws {TypeError} * @public */ function toBuffer(data) { toBuffer.readOnly = true; if (Buffer.isBuffer(data)) return data; let buf; if (data instanceof ArrayBuffer) { buf = Buffer.from(data); } else if (ArrayBuffer.isView(data)) { buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } else { buf = Buffer.from(data); toBuffer.readOnly = false; } return buf; } try { const bufferUtil = __webpack_require__(71269); const bu = bufferUtil.BufferUtil || bufferUtil; module.exports = { concat, mask(source, mask, output, offset, length) { if (length < 48) _mask(source, mask, output, offset, length); else bu.mask(source, mask, output, offset, length); }, toArrayBuffer, toBuffer, unmask(buffer, mask) { if (buffer.length < 32) _unmask(buffer, mask); else bu.unmask(buffer, mask); } }; } catch (e) /* istanbul ignore next */ { module.exports = { concat, mask: _mask, toArrayBuffer, toBuffer, unmask: _unmask }; } /***/ }), /***/ 15949: /***/ ((module) => { "use strict"; module.exports = { BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'], GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', kStatusCode: Symbol('status-code'), kWebSocket: Symbol('websocket'), EMPTY_BUFFER: Buffer.alloc(0), NOOP: () => {} }; /***/ }), /***/ 64561: /***/ ((module) => { "use strict"; /** * Class representing an event. * * @private */ class Event { /** * Create a new `Event`. * * @param {String} type The name of the event * @param {Object} target A reference to the target to which the event was * dispatched */ constructor(type, target) { this.target = target; this.type = type; } } /** * Class representing a message event. * * @extends Event * @private */ class MessageEvent extends Event { /** * Create a new `MessageEvent`. * * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(data, target) { super('message', target); this.data = data; } } /** * Class representing a close event. * * @extends Event * @private */ class CloseEvent extends Event { /** * Create a new `CloseEvent`. * * @param {Number} code The status code explaining why the connection is being * closed * @param {String} reason A human-readable string explaining why the * connection is closing * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(code, reason, target) { super('close', target); this.wasClean = target._closeFrameReceived && target._closeFrameSent; this.reason = reason; this.code = code; } } /** * Class representing an open event. * * @extends Event * @private */ class OpenEvent extends Event { /** * Create a new `OpenEvent`. * * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(target) { super('open', target); } } /** * Class representing an error event. * * @extends Event * @private */ class ErrorEvent extends Event { /** * Create a new `ErrorEvent`. * * @param {Object} error The error that generated this event * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(error, target) { super('error', target); this.message = error.message; this.error = error; } } /** * This provides methods for emulating the `EventTarget` interface. It's not * meant to be used directly. * * @mixin */ const EventTarget = { /** * Register an event listener. * * @param {String} type A string representing the event type to listen for * @param {Function} listener The listener to add * @param {Object} [options] An options object specifies characteristics about * the event listener * @param {Boolean} [options.once=false] A `Boolean`` indicating that the * listener should be invoked at most once after being added. If `true`, * the listener would be automatically removed when invoked. * @public */ addEventListener(type, listener, options) { if (typeof listener !== 'function') return; function onMessage(data) { listener.call(this, new MessageEvent(data, this)); } function onClose(code, message) { listener.call(this, new CloseEvent(code, message, this)); } function onError(error) { listener.call(this, new ErrorEvent(error, this)); } function onOpen() { listener.call(this, new OpenEvent(this)); } const method = options && options.once ? 'once' : 'on'; if (type === 'message') { onMessage._listener = listener; this[method](type, onMessage); } else if (type === 'close') { onClose._listener = listener; this[method](type, onClose); } else if (type === 'error') { onError._listener = listener; this[method](type, onError); } else if (type === 'open') { onOpen._listener = listener; this[method](type, onOpen); } else { this[method](type, listener); } }, /** * Remove an event listener. * * @param {String} type A string representing the event type to remove * @param {Function} listener The listener to remove * @public */ removeEventListener(type, listener) { const listeners = this.listeners(type); for (let i = 0; i < listeners.length; i++) { if (listeners[i] === listener || listeners[i]._listener === listener) { this.removeListener(type, listeners[i]); } } } }; module.exports = EventTarget; /***/ }), /***/ 92035: /***/ ((module) => { "use strict"; // // Allowed token characters: // // '!', '#', '$', '%', '&', ''', '*', '+', '-', // '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~' // // tokenChars[32] === 0 // ' ' // tokenChars[33] === 1 // '!' // tokenChars[34] === 0 // '"' // ... // // prettier-ignore const tokenChars = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127 ]; /** * Adds an offer to the map of extension offers or a parameter to the map of * parameters. * * @param {Object} dest The map of extension offers or parameters * @param {String} name The extension or parameter name * @param {(Object|Boolean|String)} elem The extension parameters or the * parameter value * @private */ function push(dest, name, elem) { if (dest[name] === undefined) dest[name] = [elem]; else dest[name].push(elem); } /** * Parses the `Sec-WebSocket-Extensions` header into an object. * * @param {String} header The field value of the header * @return {Object} The parsed object * @public */ function parse(header) { const offers = Object.create(null); if (header === undefined || header === '') return offers; let params = Object.create(null); let mustUnescape = false; let isEscaping = false; let inQuotes = false; let extensionName; let paramName; let start = -1; let end = -1; let i = 0; for (; i < header.length; i++) { const code = header.charCodeAt(i); if (extensionName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\t' */) { if (end === -1 && start !== -1) end = i; } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; const name = header.slice(start, end); if (code === 0x2c) { push(offers, name, params); params = Object.create(null); } else { extensionName = name; } start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else if (paramName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x20 || code === 0x09) { if (end === -1 && start !== -1) end = i; } else if (code === 0x3b || code === 0x2c) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; push(params, header.slice(start, end), true); if (code === 0x2c) { push(offers, extensionName, params); params = Object.create(null); extensionName = undefined; } start = end = -1; } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) { paramName = header.slice(start, i); start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else { // // The value of a quoted-string after unescaping must conform to the // token ABNF, so only token characters are valid. // Ref: https://tools.ietf.org/html/rfc6455#section-9.1 // if (isEscaping) { if (tokenChars[code] !== 1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (start === -1) start = i; else if (!mustUnescape) mustUnescape = true; isEscaping = false; } else if (inQuotes) { if (tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x22 /* '"' */ && start !== -1) { inQuotes = false; end = i; } else if (code === 0x5c /* '\' */) { isEscaping = true; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) { inQuotes = true; } else if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (start !== -1 && (code === 0x20 || code === 0x09)) { if (end === -1) end = i; } else if (code === 0x3b || code === 0x2c) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; let value = header.slice(start, end); if (mustUnescape) { value = value.replace(/\\/g, ''); mustUnescape = false; } push(params, paramName, value); if (code === 0x2c) { push(offers, extensionName, params); params = Object.create(null); extensionName = undefined; } paramName = undefined; start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } } if (start === -1 || inQuotes) { throw new SyntaxError('Unexpected end of input'); } if (end === -1) end = i; const token = header.slice(start, end); if (extensionName === undefined) { push(offers, token, params); } else { if (paramName === undefined) { push(params, token, true); } else if (mustUnescape) { push(params, paramName, token.replace(/\\/g, '')); } else { push(params, paramName, token); } push(offers, extensionName, params); } return offers; } /** * Builds the `Sec-WebSocket-Extensions` header field value. * * @param {Object} extensions The map of extensions and parameters to format * @return {String} A string representing the given object * @public */ function format(extensions) { return Object.keys(extensions) .map((extension) => { let configurations = extensions[extension]; if (!Array.isArray(configurations)) configurations = [configurations]; return configurations .map((params) => { return [extension] .concat( Object.keys(params).map((k) => { let values = params[k]; if (!Array.isArray(values)) values = [values]; return values .map((v) => (v === true ? k : `${k}=${v}`)) .join('; '); }) ) .join('; '); }) .join(', '); }) .join(', '); } module.exports = { format, parse }; /***/ }), /***/ 41356: /***/ ((module) => { "use strict"; const kDone = Symbol('kDone'); const kRun = Symbol('kRun'); /** * A very simple job queue with adjustable concurrency. Adapted from * https://github.com/STRML/async-limiter */ class Limiter { /** * Creates a new `Limiter`. * * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed * to run concurrently */ constructor(concurrency) { this[kDone] = () => { this.pending--; this[kRun](); }; this.concurrency = concurrency || Infinity; this.jobs = []; this.pending = 0; } /** * Adds a job to the queue. * * @param {Function} job The job to run * @public */ add(job) { this.jobs.push(job); this[kRun](); } /** * Removes a job from the queue and runs it if possible. * * @private */ [kRun]() { if (this.pending === this.concurrency) return; if (this.jobs.length) { const job = this.jobs.shift(); this.pending++; job(this[kDone]); } } } module.exports = Limiter; /***/ }), /***/ 56684: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const zlib = __webpack_require__(78761); const bufferUtil = __webpack_require__(9436); const Limiter = __webpack_require__(41356); const { kStatusCode, NOOP } = __webpack_require__(15949); const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]); const kPerMessageDeflate = Symbol('permessage-deflate'); const kTotalLength = Symbol('total-length'); const kCallback = Symbol('callback'); const kBuffers = Symbol('buffers'); const kError = Symbol('error'); // // We limit zlib concurrency, which prevents severe memory fragmentation // as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913 // and https://github.com/websockets/ws/issues/1202 // // Intentionally global; it's the global thread pool that's an issue. // let zlibLimiter; /** * permessage-deflate implementation. */ class PerMessageDeflate { /** * Creates a PerMessageDeflate instance. * * @param {Object} [options] Configuration options * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept * disabling of server context takeover * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/ * acknowledge disabling of client context takeover * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the * use of a custom server window size * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support * for, or request, a custom client window size * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on * deflate * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on * inflate * @param {Number} [options.threshold=1024] Size (in bytes) below which * messages should not be compressed * @param {Number} [options.concurrencyLimit=10] The number of concurrent * calls to zlib * @param {Boolean} [isServer=false] Create the instance in either server or * client mode * @param {Number} [maxPayload=0] The maximum allowed message length */ constructor(options, isServer, maxPayload) { this._maxPayload = maxPayload | 0; this._options = options || {}; this._threshold = this._options.threshold !== undefined ? this._options.threshold : 1024; this._isServer = !!isServer; this._deflate = null; this._inflate = null; this.params = null; if (!zlibLimiter) { const concurrency = this._options.concurrencyLimit !== undefined ? this._options.concurrencyLimit : 10; zlibLimiter = new Limiter(concurrency); } } /** * @type {String} */ static get extensionName() { return 'permessage-deflate'; } /** * Create an extension negotiation offer. * * @return {Object} Extension parameters * @public */ offer() { const params = {}; if (this._options.serverNoContextTakeover) { params.server_no_context_takeover = true; } if (this._options.clientNoContextTakeover) { params.client_no_context_takeover = true; } if (this._options.serverMaxWindowBits) { params.server_max_window_bits = this._options.serverMaxWindowBits; } if (this._options.clientMaxWindowBits) { params.client_max_window_bits = this._options.clientMaxWindowBits; } else if (this._options.clientMaxWindowBits == null) { params.client_max_window_bits = true; } return params; } /** * Accept an extension negotiation offer/response. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Object} Accepted configuration * @public */ accept(configurations) { configurations = this.normalizeParams(configurations); this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations); return this.params; } /** * Releases all resources used by the extension. * * @public */ cleanup() { if (this._inflate) { this._inflate.close(); this._inflate = null; } if (this._deflate) { const callback = this._deflate[kCallback]; this._deflate.close(); this._deflate = null; if (callback) { callback( new Error( 'The deflate stream was closed while data was being processed' ) ); } } } /** * Accept an extension negotiation offer. * * @param {Array} offers The extension negotiation offers * @return {Object} Accepted configuration * @private */ acceptAsServer(offers) { const opts = this._options; const accepted = offers.find((params) => { if ( (opts.serverNoContextTakeover === false && params.server_no_context_takeover) || (params.server_max_window_bits && (opts.serverMaxWindowBits === false || (typeof opts.serverMaxWindowBits === 'number' && opts.serverMaxWindowBits > params.server_max_window_bits))) || (typeof opts.clientMaxWindowBits === 'number' && !params.client_max_window_bits) ) { return false; } return true; }); if (!accepted) { throw new Error('None of the extension offers can be accepted'); } if (opts.serverNoContextTakeover) { accepted.server_no_context_takeover = true; } if (opts.clientNoContextTakeover) { accepted.client_no_context_takeover = true; } if (typeof opts.serverMaxWindowBits === 'number') { accepted.server_max_window_bits = opts.serverMaxWindowBits; } if (typeof opts.clientMaxWindowBits === 'number') { accepted.client_max_window_bits = opts.clientMaxWindowBits; } else if ( accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false ) { delete accepted.client_max_window_bits; } return accepted; } /** * Accept the extension negotiation response. * * @param {Array} response The extension negotiation response * @return {Object} Accepted configuration * @private */ acceptAsClient(response) { const params = response[0]; if ( this._options.clientNoContextTakeover === false && params.client_no_context_takeover ) { throw new Error('Unexpected parameter "client_no_context_takeover"'); } if (!params.client_max_window_bits) { if (typeof this._options.clientMaxWindowBits === 'number') { params.client_max_window_bits = this._options.clientMaxWindowBits; } } else if ( this._options.clientMaxWindowBits === false || (typeof this._options.clientMaxWindowBits === 'number' && params.client_max_window_bits > this._options.clientMaxWindowBits) ) { throw new Error( 'Unexpected or invalid parameter "client_max_window_bits"' ); } return params; } /** * Normalize parameters. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Array} The offers/response with normalized parameters * @private */ normalizeParams(configurations) { configurations.forEach((params) => { Object.keys(params).forEach((key) => { let value = params[key]; if (value.length > 1) { throw new Error(`Parameter "${key}" must have only a single value`); } value = value[0]; if (key === 'client_max_window_bits') { if (value !== true) { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if (!this._isServer) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else if (key === 'server_max_window_bits') { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if ( key === 'client_no_context_takeover' || key === 'server_no_context_takeover' ) { if (value !== true) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else { throw new Error(`Unknown parameter "${key}"`); } params[key] = value; }); }); return configurations; } /** * Decompress data. Concurrency limited. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ decompress(data, fin, callback) { zlibLimiter.add((done) => { this._decompress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Compress data. Concurrency limited. * * @param {Buffer} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ compress(data, fin, callback) { zlibLimiter.add((done) => { this._compress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Decompress data. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _decompress(data, fin, callback) { const endpoint = this._isServer ? 'client' : 'server'; if (!this._inflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== 'number' ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._inflate = zlib.createInflateRaw({ ...this._options.zlibInflateOptions, windowBits }); this._inflate[kPerMessageDeflate] = this; this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; this._inflate.on('error', inflateOnError); this._inflate.on('data', inflateOnData); } this._inflate[kCallback] = callback; this._inflate.write(data); if (fin) this._inflate.write(TRAILER); this._inflate.flush(() => { const err = this._inflate[kError]; if (err) { this._inflate.close(); this._inflate = null; callback(err); return; } const data = bufferUtil.concat( this._inflate[kBuffers], this._inflate[kTotalLength] ); if (this._inflate._readableState.endEmitted) { this._inflate.close(); this._inflate = null; } else { this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._inflate.reset(); } } callback(null, data); }); } /** * Compress data. * * @param {Buffer} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _compress(data, fin, callback) { const endpoint = this._isServer ? 'server' : 'client'; if (!this._deflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== 'number' ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._deflate = zlib.createDeflateRaw({ ...this._options.zlibDeflateOptions, windowBits }); this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; // // An `'error'` event is emitted, only on Node.js < 10.0.0, if the // `zlib.DeflateRaw` instance is closed while data is being processed. // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong // time due to an abnormal WebSocket closure. // this._deflate.on('error', NOOP); this._deflate.on('data', deflateOnData); } this._deflate[kCallback] = callback; this._deflate.write(data); this._deflate.flush(zlib.Z_SYNC_FLUSH, () => { if (!this._deflate) { // // The deflate stream was closed while data was being processed. // return; } let data = bufferUtil.concat( this._deflate[kBuffers], this._deflate[kTotalLength] ); if (fin) data = data.slice(0, data.length - 4); // // Ensure that the callback will not be called again in // `PerMessageDeflate#cleanup()`. // this._deflate[kCallback] = null; this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._deflate.reset(); } callback(null, data); }); } } module.exports = PerMessageDeflate; /** * The listener of the `zlib.DeflateRaw` stream `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function deflateOnData(chunk) { this[kBuffers].push(chunk); this[kTotalLength] += chunk.length; } /** * The listener of the `zlib.InflateRaw` stream `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function inflateOnData(chunk) { this[kTotalLength] += chunk.length; if ( this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload ) { this[kBuffers].push(chunk); return; } this[kError] = new RangeError('Max payload size exceeded'); this[kError][kStatusCode] = 1009; this.removeListener('data', inflateOnData); this.reset(); } /** * The listener of the `zlib.InflateRaw` stream `'error'` event. * * @param {Error} err The emitted error * @private */ function inflateOnError(err) { // // There is no need to call `Zlib#close()` as the handle is automatically // closed when an error is emitted. // this[kPerMessageDeflate]._inflate = null; err[kStatusCode] = 1007; this[kCallback](err); } /***/ }), /***/ 25066: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { Writable } = __webpack_require__(92413); const PerMessageDeflate = __webpack_require__(56684); const { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = __webpack_require__(15949); const { concat, toArrayBuffer, unmask } = __webpack_require__(9436); const { isValidStatusCode, isValidUTF8 } = __webpack_require__(86279); const GET_INFO = 0; const GET_PAYLOAD_LENGTH_16 = 1; const GET_PAYLOAD_LENGTH_64 = 2; const GET_MASK = 3; const GET_DATA = 4; const INFLATING = 5; /** * HyBi Receiver implementation. * * @extends stream.Writable */ class Receiver extends Writable { /** * Creates a Receiver instance. * * @param {String} [binaryType=nodebuffer] The type for binary data * @param {Object} [extensions] An object containing the negotiated extensions * @param {Boolean} [isServer=false] Specifies whether to operate in client or * server mode * @param {Number} [maxPayload=0] The maximum allowed message length */ constructor(binaryType, extensions, isServer, maxPayload) { super(); this._binaryType = binaryType || BINARY_TYPES[0]; this[kWebSocket] = undefined; this._extensions = extensions || {}; this._isServer = !!isServer; this._maxPayload = maxPayload | 0; this._bufferedBytes = 0; this._buffers = []; this._compressed = false; this._payloadLength = 0; this._mask = undefined; this._fragmented = 0; this._masked = false; this._fin = false; this._opcode = 0; this._totalPayloadLength = 0; this._messageLength = 0; this._fragments = []; this._state = GET_INFO; this._loop = false; } /** * Implements `Writable.prototype._write()`. * * @param {Buffer} chunk The chunk of data to write * @param {String} encoding The character encoding of `chunk` * @param {Function} cb Callback * @private */ _write(chunk, encoding, cb) { if (this._opcode === 0x08 && this._state == GET_INFO) return cb(); this._bufferedBytes += chunk.length; this._buffers.push(chunk); this.startLoop(cb); } /** * Consumes `n` bytes from the buffered data. * * @param {Number} n The number of bytes to consume * @return {Buffer} The consumed bytes * @private */ consume(n) { this._bufferedBytes -= n; if (n === this._buffers[0].length) return this._buffers.shift(); if (n < this._buffers[0].length) { const buf = this._buffers[0]; this._buffers[0] = buf.slice(n); return buf.slice(0, n); } const dst = Buffer.allocUnsafe(n); do { const buf = this._buffers[0]; const offset = dst.length - n; if (n >= buf.length) { dst.set(this._buffers.shift(), offset); } else { dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset); this._buffers[0] = buf.slice(n); } n -= buf.length; } while (n > 0); return dst; } /** * Starts the parsing loop. * * @param {Function} cb Callback * @private */ startLoop(cb) { let err; this._loop = true; do { switch (this._state) { case GET_INFO: err = this.getInfo(); break; case GET_PAYLOAD_LENGTH_16: err = this.getPayloadLength16(); break; case GET_PAYLOAD_LENGTH_64: err = this.getPayloadLength64(); break; case GET_MASK: this.getMask(); break; case GET_DATA: err = this.getData(cb); break; default: // `INFLATING` this._loop = false; return; } } while (this._loop); cb(err); } /** * Reads the first two bytes of a frame. * * @return {(RangeError|undefined)} A possible error * @private */ getInfo() { if (this._bufferedBytes < 2) { this._loop = false; return; } const buf = this.consume(2); if ((buf[0] & 0x30) !== 0x00) { this._loop = false; return error(RangeError, 'RSV2 and RSV3 must be clear', true, 1002); } const compressed = (buf[0] & 0x40) === 0x40; if (compressed && !this._extensions[PerMessageDeflate.extensionName]) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } this._fin = (buf[0] & 0x80) === 0x80; this._opcode = buf[0] & 0x0f; this._payloadLength = buf[1] & 0x7f; if (this._opcode === 0x00) { if (compressed) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } if (!this._fragmented) { this._loop = false; return error(RangeError, 'invalid opcode 0', true, 1002); } this._opcode = this._fragmented; } else if (this._opcode === 0x01 || this._opcode === 0x02) { if (this._fragmented) { this._loop = false; return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002); } this._compressed = compressed; } else if (this._opcode > 0x07 && this._opcode < 0x0b) { if (!this._fin) { this._loop = false; return error(RangeError, 'FIN must be set', true, 1002); } if (compressed) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } if (this._payloadLength > 0x7d) { this._loop = false; return error( RangeError, `invalid payload length ${this._payloadLength}`, true, 1002 ); } } else { this._loop = false; return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002); } if (!this._fin && !this._fragmented) this._fragmented = this._opcode; this._masked = (buf[1] & 0x80) === 0x80; if (this._isServer) { if (!this._masked) { this._loop = false; return error(RangeError, 'MASK must be set', true, 1002); } } else if (this._masked) { this._loop = false; return error(RangeError, 'MASK must be clear', true, 1002); } if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16; else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64; else return this.haveLength(); } /** * Gets extended payload length (7+16). * * @return {(RangeError|undefined)} A possible error * @private */ getPayloadLength16() { if (this._bufferedBytes < 2) { this._loop = false; return; } this._payloadLength = this.consume(2).readUInt16BE(0); return this.haveLength(); } /** * Gets extended payload length (7+64). * * @return {(RangeError|undefined)} A possible error * @private */ getPayloadLength64() { if (this._bufferedBytes < 8) { this._loop = false; return; } const buf = this.consume(8); const num = buf.readUInt32BE(0); // // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned // if payload length is greater than this number. // if (num > Math.pow(2, 53 - 32) - 1) { this._loop = false; return error( RangeError, 'Unsupported WebSocket frame: payload length > 2^53 - 1', false, 1009 ); } this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); return this.haveLength(); } /** * Payload length has been read. * * @return {(RangeError|undefined)} A possible error * @private */ haveLength() { if (this._payloadLength && this._opcode < 0x08) { this._totalPayloadLength += this._payloadLength; if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { this._loop = false; return error(RangeError, 'Max payload size exceeded', false, 1009); } } if (this._masked) this._state = GET_MASK; else this._state = GET_DATA; } /** * Reads mask bytes. * * @private */ getMask() { if (this._bufferedBytes < 4) { this._loop = false; return; } this._mask = this.consume(4); this._state = GET_DATA; } /** * Reads data bytes. * * @param {Function} cb Callback * @return {(Error|RangeError|undefined)} A possible error * @private */ getData(cb) { let data = EMPTY_BUFFER; if (this._payloadLength) { if (this._bufferedBytes < this._payloadLength) { this._loop = false; return; } data = this.consume(this._payloadLength); if (this._masked) unmask(data, this._mask); } if (this._opcode > 0x07) return this.controlMessage(data); if (this._compressed) { this._state = INFLATING; this.decompress(data, cb); return; } if (data.length) { // // This message is not compressed so its lenght is the sum of the payload // length of all fragments. // this._messageLength = this._totalPayloadLength; this._fragments.push(data); } return this.dataMessage(); } /** * Decompresses data. * * @param {Buffer} data Compressed data * @param {Function} cb Callback * @private */ decompress(data, cb) { const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; perMessageDeflate.decompress(data, this._fin, (err, buf) => { if (err) return cb(err); if (buf.length) { this._messageLength += buf.length; if (this._messageLength > this._maxPayload && this._maxPayload > 0) { return cb( error(RangeError, 'Max payload size exceeded', false, 1009) ); } this._fragments.push(buf); } const er = this.dataMessage(); if (er) return cb(er); this.startLoop(cb); }); } /** * Handles a data message. * * @return {(Error|undefined)} A possible error * @private */ dataMessage() { if (this._fin) { const messageLength = this._messageLength; const fragments = this._fragments; this._totalPayloadLength = 0; this._messageLength = 0; this._fragmented = 0; this._fragments = []; if (this._opcode === 2) { let data; if (this._binaryType === 'nodebuffer') { data = concat(fragments, messageLength); } else if (this._binaryType === 'arraybuffer') { data = toArrayBuffer(concat(fragments, messageLength)); } else { data = fragments; } this.emit('message', data); } else { const buf = concat(fragments, messageLength); if (!isValidUTF8(buf)) { this._loop = false; return error(Error, 'invalid UTF-8 sequence', true, 1007); } this.emit('message', buf.toString()); } } this._state = GET_INFO; } /** * Handles a control message. * * @param {Buffer} data Data to handle * @return {(Error|RangeError|undefined)} A possible error * @private */ controlMessage(data) { if (this._opcode === 0x08) { this._loop = false; if (data.length === 0) { this.emit('conclude', 1005, ''); this.end(); } else if (data.length === 1) { return error(RangeError, 'invalid payload length 1', true, 1002); } else { const code = data.readUInt16BE(0); if (!isValidStatusCode(code)) { return error(RangeError, `invalid status code ${code}`, true, 1002); } const buf = data.slice(2); if (!isValidUTF8(buf)) { return error(Error, 'invalid UTF-8 sequence', true, 1007); } this.emit('conclude', code, buf.toString()); this.end(); } } else if (this._opcode === 0x09) { this.emit('ping', data); } else { this.emit('pong', data); } this._state = GET_INFO; } } module.exports = Receiver; /** * Builds an error object. * * @param {(Error|RangeError)} ErrorCtor The error constructor * @param {String} message The error message * @param {Boolean} prefix Specifies whether or not to add a default prefix to * `message` * @param {Number} statusCode The status code * @return {(Error|RangeError)} The error * @private */ function error(ErrorCtor, message, prefix, statusCode) { const err = new ErrorCtor( prefix ? `Invalid WebSocket frame: ${message}` : message ); Error.captureStackTrace(err, error); err[kStatusCode] = statusCode; return err; } /***/ }), /***/ 36947: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { randomFillSync } = __webpack_require__(76417); const PerMessageDeflate = __webpack_require__(56684); const { EMPTY_BUFFER } = __webpack_require__(15949); const { isValidStatusCode } = __webpack_require__(86279); const { mask: applyMask, toBuffer } = __webpack_require__(9436); const mask = Buffer.alloc(4); /** * HyBi Sender implementation. */ class Sender { /** * Creates a Sender instance. * * @param {net.Socket} socket The connection socket * @param {Object} [extensions] An object containing the negotiated extensions */ constructor(socket, extensions) { this._extensions = extensions || {}; this._socket = socket; this._firstFragment = true; this._compress = false; this._bufferedBytes = 0; this._deflating = false; this._queue = []; } /** * Frames a piece of data according to the HyBi WebSocket protocol. * * @param {Buffer} data The data to frame * @param {Object} options Options object * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @return {Buffer[]} The framed data as a list of `Buffer` instances * @public */ static frame(data, options) { const merge = options.mask && options.readOnly; let offset = options.mask ? 6 : 2; let payloadLength = data.length; if (data.length >= 65536) { offset += 8; payloadLength = 127; } else if (data.length > 125) { offset += 2; payloadLength = 126; } const target = Buffer.allocUnsafe(merge ? data.length + offset : offset); target[0] = options.fin ? options.opcode | 0x80 : options.opcode; if (options.rsv1) target[0] |= 0x40; target[1] = payloadLength; if (payloadLength === 126) { target.writeUInt16BE(data.length, 2); } else if (payloadLength === 127) { target.writeUInt32BE(0, 2); target.writeUInt32BE(data.length, 6); } if (!options.mask) return [target, data]; randomFillSync(mask, 0, 4); target[1] |= 0x80; target[offset - 4] = mask[0]; target[offset - 3] = mask[1]; target[offset - 2] = mask[2]; target[offset - 1] = mask[3]; if (merge) { applyMask(data, mask, target, offset, data.length); return [target]; } applyMask(data, mask, data, 0, data.length); return [target, data]; } /** * Sends a close message to the other peer. * * @param {Number} [code] The status code component of the body * @param {String} [data] The message component of the body * @param {Boolean} [mask=false] Specifies whether or not to mask the message * @param {Function} [cb] Callback * @public */ close(code, data, mask, cb) { let buf; if (code === undefined) { buf = EMPTY_BUFFER; } else if (typeof code !== 'number' || !isValidStatusCode(code)) { throw new TypeError('First argument must be a valid error code number'); } else if (data === undefined || data === '') { buf = Buffer.allocUnsafe(2); buf.writeUInt16BE(code, 0); } else { const length = Buffer.byteLength(data); if (length > 123) { throw new RangeError('The message must not be greater than 123 bytes'); } buf = Buffer.allocUnsafe(2 + length); buf.writeUInt16BE(code, 0); buf.write(data, 2); } if (this._deflating) { this.enqueue([this.doClose, buf, mask, cb]); } else { this.doClose(buf, mask, cb); } } /** * Frames and sends a close message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @private */ doClose(data, mask, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x08, mask, readOnly: false }), cb ); } /** * Sends a ping message to the other peer. * * @param {*} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @public */ ping(data, mask, cb) { const buf = toBuffer(data); if (buf.length > 125) { throw new RangeError('The data size must not be greater than 125 bytes'); } if (this._deflating) { this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]); } else { this.doPing(buf, mask, toBuffer.readOnly, cb); } } /** * Frames and sends a ping message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified * @param {Function} [cb] Callback * @private */ doPing(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x09, mask, readOnly }), cb ); } /** * Sends a pong message to the other peer. * * @param {*} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @public */ pong(data, mask, cb) { const buf = toBuffer(data); if (buf.length > 125) { throw new RangeError('The data size must not be greater than 125 bytes'); } if (this._deflating) { this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]); } else { this.doPong(buf, mask, toBuffer.readOnly, cb); } } /** * Frames and sends a pong message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified * @param {Function} [cb] Callback * @private */ doPong(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x0a, mask, readOnly }), cb ); } /** * Sends a data message to the other peer. * * @param {*} data The message to send * @param {Object} options Options object * @param {Boolean} [options.compress=false] Specifies whether or not to * compress `data` * @param {Boolean} [options.binary=false] Specifies whether `data` is binary * or text * @param {Boolean} [options.fin=false] Specifies whether the fragment is the * last one * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Function} [cb] Callback * @public */ send(data, options, cb) { const buf = toBuffer(data); const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; let opcode = options.binary ? 2 : 1; let rsv1 = options.compress; if (this._firstFragment) { this._firstFragment = false; if (rsv1 && perMessageDeflate) { rsv1 = buf.length >= perMessageDeflate._threshold; } this._compress = rsv1; } else { rsv1 = false; opcode = 0; } if (options.fin) this._firstFragment = true; if (perMessageDeflate) { const opts = { fin: options.fin, rsv1, opcode, mask: options.mask, readOnly: toBuffer.readOnly }; if (this._deflating) { this.enqueue([this.dispatch, buf, this._compress, opts, cb]); } else { this.dispatch(buf, this._compress, opts, cb); } } else { this.sendFrame( Sender.frame(buf, { fin: options.fin, rsv1: false, opcode, mask: options.mask, readOnly: toBuffer.readOnly }), cb ); } } /** * Dispatches a data message. * * @param {Buffer} data The message to send * @param {Boolean} [compress=false] Specifies whether or not to compress * `data` * @param {Object} options Options object * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @param {Function} [cb] Callback * @private */ dispatch(data, compress, options, cb) { if (!compress) { this.sendFrame(Sender.frame(data, options), cb); return; } const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; this._bufferedBytes += data.length; this._deflating = true; perMessageDeflate.compress(data, options.fin, (_, buf) => { if (this._socket.destroyed) { const err = new Error( 'The socket was closed while data was being compressed' ); if (typeof cb === 'function') cb(err); for (let i = 0; i < this._queue.length; i++) { const callback = this._queue[i][4]; if (typeof callback === 'function') callback(err); } return; } this._bufferedBytes -= data.length; this._deflating = false; options.readOnly = false; this.sendFrame(Sender.frame(buf, options), cb); this.dequeue(); }); } /** * Executes queued send operations. * * @private */ dequeue() { while (!this._deflating && this._queue.length) { const params = this._queue.shift(); this._bufferedBytes -= params[1].length; Reflect.apply(params[0], this, params.slice(1)); } } /** * Enqueues a send operation. * * @param {Array} params Send operation parameters. * @private */ enqueue(params) { this._bufferedBytes += params[1].length; this._queue.push(params); } /** * Sends a frame. * * @param {Buffer[]} list The frame to send * @param {Function} [cb] Callback * @private */ sendFrame(list, cb) { if (list.length === 2) { this._socket.cork(); this._socket.write(list[0]); this._socket.write(list[1], cb); this._socket.uncork(); } else { this._socket.write(list[0], cb); } } } module.exports = Sender; /***/ }), /***/ 41658: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { Duplex } = __webpack_require__(92413); /** * Emits the `'close'` event on a stream. * * @param {stream.Duplex} The stream. * @private */ function emitClose(stream) { stream.emit('close'); } /** * The listener of the `'end'` event. * * @private */ function duplexOnEnd() { if (!this.destroyed && this._writableState.finished) { this.destroy(); } } /** * The listener of the `'error'` event. * * @param {Error} err The error * @private */ function duplexOnError(err) { this.removeListener('error', duplexOnError); this.destroy(); if (this.listenerCount('error') === 0) { // Do not suppress the throwing behavior. this.emit('error', err); } } /** * Wraps a `WebSocket` in a duplex stream. * * @param {WebSocket} ws The `WebSocket` to wrap * @param {Object} [options] The options for the `Duplex` constructor * @return {stream.Duplex} The duplex stream * @public */ function createWebSocketStream(ws, options) { let resumeOnReceiverDrain = true; function receiverOnDrain() { if (resumeOnReceiverDrain) ws._socket.resume(); } if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { ws._receiver.removeAllListeners('drain'); ws._receiver.on('drain', receiverOnDrain); }); } else { ws._receiver.removeAllListeners('drain'); ws._receiver.on('drain', receiverOnDrain); } const duplex = new Duplex({ ...options, autoDestroy: false, emitClose: false, objectMode: false, writableObjectMode: false }); ws.on('message', function message(msg) { if (!duplex.push(msg)) { resumeOnReceiverDrain = false; ws._socket.pause(); } }); ws.once('error', function error(err) { if (duplex.destroyed) return; duplex.destroy(err); }); ws.once('close', function close() { if (duplex.destroyed) return; duplex.push(null); }); duplex._destroy = function (err, callback) { if (ws.readyState === ws.CLOSED) { callback(err); process.nextTick(emitClose, duplex); return; } let called = false; ws.once('error', function error(err) { called = true; callback(err); }); ws.once('close', function close() { if (!called) callback(err); process.nextTick(emitClose, duplex); }); ws.terminate(); }; duplex._final = function (callback) { if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { duplex._final(callback); }); return; } // If the value of the `_socket` property is `null` it means that `ws` is a // client websocket and the handshake failed. In fact, when this happens, a // socket is never assigned to the websocket. Wait for the `'error'` event // that will be emitted by the websocket. if (ws._socket === null) return; if (ws._socket._writableState.finished) { callback(); if (duplex._readableState.endEmitted) duplex.destroy(); } else { ws._socket.once('finish', function finish() { // `duplex` is not destroyed here because the `'end'` event will be // emitted on `duplex` after this `'finish'` event. The EOF signaling // `null` chunk is, in fact, pushed when the websocket emits `'close'`. callback(); }); ws.close(); } }; duplex._read = function () { if (ws.readyState === ws.OPEN && !resumeOnReceiverDrain) { resumeOnReceiverDrain = true; if (!ws._receiver._writableState.needDrain) ws._socket.resume(); } }; duplex._write = function (chunk, encoding, callback) { if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { duplex._write(chunk, encoding, callback); }); return; } ws.send(chunk, callback); }; duplex.on('end', duplexOnEnd); duplex.on('error', duplexOnError); return duplex; } module.exports = createWebSocketStream; /***/ }), /***/ 86279: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Checks if a status code is allowed in a close frame. * * @param {Number} code The status code * @return {Boolean} `true` if the status code is valid, else `false` * @public */ function isValidStatusCode(code) { return ( (code >= 1000 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006) || (code >= 3000 && code <= 4999) ); } /** * Checks if a given buffer contains only correct UTF-8. * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by * Markus Kuhn. * * @param {Buffer} buf The buffer to check * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false` * @public */ function _isValidUTF8(buf) { const len = buf.length; let i = 0; while (i < len) { if (buf[i] < 0x80) { // 0xxxxxxx i++; } else if ((buf[i] & 0xe0) === 0xc0) { // 110xxxxx 10xxxxxx if ( i + 1 === len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i] & 0xfe) === 0xc0 // Overlong ) { return false; } else { i += 2; } } else if ((buf[i] & 0xf0) === 0xe0) { // 1110xxxx 10xxxxxx 10xxxxxx if ( i + 2 >= len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i + 2] & 0xc0) !== 0x80 || (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF) ) { return false; } else { i += 3; } } else if ((buf[i] & 0xf8) === 0xf0) { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx if ( i + 3 >= len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i + 2] & 0xc0) !== 0x80 || (buf[i + 3] & 0xc0) !== 0x80 || (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong (buf[i] === 0xf4 && buf[i + 1] > 0x8f) || buf[i] > 0xf4 // > U+10FFFF ) { return false; } else { i += 4; } } else { return false; } } return true; } try { let isValidUTF8 = __webpack_require__(24592); /* istanbul ignore if */ if (typeof isValidUTF8 === 'object') { isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0 } module.exports = { isValidStatusCode, isValidUTF8(buf) { return buf.length < 150 ? _isValidUTF8(buf) : isValidUTF8(buf); } }; } catch (e) /* istanbul ignore next */ { module.exports = { isValidStatusCode, isValidUTF8: _isValidUTF8 }; } /***/ }), /***/ 58887: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const { createHash } = __webpack_require__(76417); const { createServer, STATUS_CODES } = __webpack_require__(98605); const PerMessageDeflate = __webpack_require__(56684); const WebSocket = __webpack_require__(91518); const { format, parse } = __webpack_require__(92035); const { GUID, kWebSocket } = __webpack_require__(15949); const keyRegex = /^[+/0-9A-Za-z]{22}==$/; /** * Class representing a WebSocket server. * * @extends EventEmitter */ class WebSocketServer extends EventEmitter { /** * Create a `WebSocketServer` instance. * * @param {Object} options Configuration options * @param {Number} [options.backlog=511] The maximum length of the queue of * pending connections * @param {Boolean} [options.clientTracking=true] Specifies whether or not to * track clients * @param {Function} [options.handleProtocols] A hook to handle protocols * @param {String} [options.host] The hostname where to bind the server * @param {Number} [options.maxPayload=104857600] The maximum allowed message * size * @param {Boolean} [options.noServer=false] Enable no server mode * @param {String} [options.path] Accept only connections matching this path * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable * permessage-deflate * @param {Number} [options.port] The port where to bind the server * @param {http.Server} [options.server] A pre-created HTTP/S server to use * @param {Function} [options.verifyClient] A hook to reject connections * @param {Function} [callback] A listener for the `listening` event */ constructor(options, callback) { super(); options = { maxPayload: 100 * 1024 * 1024, perMessageDeflate: false, handleProtocols: null, clientTracking: true, verifyClient: null, noServer: false, backlog: null, // use default (511 as implemented in net.js) server: null, host: null, path: null, port: null, ...options }; if (options.port == null && !options.server && !options.noServer) { throw new TypeError( 'One of the "port", "server", or "noServer" options must be specified' ); } if (options.port != null) { this._server = createServer((req, res) => { const body = STATUS_CODES[426]; res.writeHead(426, { 'Content-Length': body.length, 'Content-Type': 'text/plain' }); res.end(body); }); this._server.listen( options.port, options.host, options.backlog, callback ); } else if (options.server) { this._server = options.server; } if (this._server) { const emitConnection = this.emit.bind(this, 'connection'); this._removeListeners = addListeners(this._server, { listening: this.emit.bind(this, 'listening'), error: this.emit.bind(this, 'error'), upgrade: (req, socket, head) => { this.handleUpgrade(req, socket, head, emitConnection); } }); } if (options.perMessageDeflate === true) options.perMessageDeflate = {}; if (options.clientTracking) this.clients = new Set(); this.options = options; } /** * Returns the bound address, the address family name, and port of the server * as reported by the operating system if listening on an IP socket. * If the server is listening on a pipe or UNIX domain socket, the name is * returned as a string. * * @return {(Object|String|null)} The address of the server * @public */ address() { if (this.options.noServer) { throw new Error('The server is operating in "noServer" mode'); } if (!this._server) return null; return this._server.address(); } /** * Close the server. * * @param {Function} [cb] Callback * @public */ close(cb) { if (cb) this.once('close', cb); // // Terminate all associated clients. // if (this.clients) { for (const client of this.clients) client.terminate(); } const server = this._server; if (server) { this._removeListeners(); this._removeListeners = this._server = null; // // Close the http server if it was internally created. // if (this.options.port != null) { server.close(() => this.emit('close')); return; } } process.nextTick(emitClose, this); } /** * See if a given request should be handled by this server instance. * * @param {http.IncomingMessage} req Request object to inspect * @return {Boolean} `true` if the request is valid, else `false` * @public */ shouldHandle(req) { if (this.options.path) { const index = req.url.indexOf('?'); const pathname = index !== -1 ? req.url.slice(0, index) : req.url; if (pathname !== this.options.path) return false; } return true; } /** * Handle a HTTP Upgrade request. * * @param {http.IncomingMessage} req The request object * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @public */ handleUpgrade(req, socket, head, cb) { socket.on('error', socketOnError); const key = req.headers['sec-websocket-key'] !== undefined ? req.headers['sec-websocket-key'].trim() : false; const version = +req.headers['sec-websocket-version']; const extensions = {}; if ( req.method !== 'GET' || req.headers.upgrade.toLowerCase() !== 'websocket' || !key || !keyRegex.test(key) || (version !== 8 && version !== 13) || !this.shouldHandle(req) ) { return abortHandshake(socket, 400); } if (this.options.perMessageDeflate) { const perMessageDeflate = new PerMessageDeflate( this.options.perMessageDeflate, true, this.options.maxPayload ); try { const offers = parse(req.headers['sec-websocket-extensions']); if (offers[PerMessageDeflate.extensionName]) { perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } } catch (err) { return abortHandshake(socket, 400); } } // // Optionally call external client verification handler. // if (this.options.verifyClient) { const info = { origin: req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`], secure: !!(req.socket.authorized || req.socket.encrypted), req }; if (this.options.verifyClient.length === 2) { this.options.verifyClient(info, (verified, code, message, headers) => { if (!verified) { return abortHandshake(socket, code || 401, message, headers); } this.completeUpgrade(key, extensions, req, socket, head, cb); }); return; } if (!this.options.verifyClient(info)) return abortHandshake(socket, 401); } this.completeUpgrade(key, extensions, req, socket, head, cb); } /** * Upgrade the connection to WebSocket. * * @param {String} key The value of the `Sec-WebSocket-Key` header * @param {Object} extensions The accepted extensions * @param {http.IncomingMessage} req The request object * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @throws {Error} If called more than once with the same socket * @private */ completeUpgrade(key, extensions, req, socket, head, cb) { // // Destroy the socket if the client has already sent a FIN packet. // if (!socket.readable || !socket.writable) return socket.destroy(); if (socket[kWebSocket]) { throw new Error( 'server.handleUpgrade() was called more than once with the same ' + 'socket, possibly due to a misconfiguration' ); } const digest = createHash('sha1') .update(key + GUID) .digest('base64'); const headers = [ 'HTTP/1.1 101 Switching Protocols', 'Upgrade: websocket', 'Connection: Upgrade', `Sec-WebSocket-Accept: ${digest}` ]; const ws = new WebSocket(null); let protocol = req.headers['sec-websocket-protocol']; if (protocol) { protocol = protocol.trim().split(/ *, */); // // Optionally call external protocol selection handler. // if (this.options.handleProtocols) { protocol = this.options.handleProtocols(protocol, req); } else { protocol = protocol[0]; } if (protocol) { headers.push(`Sec-WebSocket-Protocol: ${protocol}`); ws._protocol = protocol; } } if (extensions[PerMessageDeflate.extensionName]) { const params = extensions[PerMessageDeflate.extensionName].params; const value = format({ [PerMessageDeflate.extensionName]: [params] }); headers.push(`Sec-WebSocket-Extensions: ${value}`); ws._extensions = extensions; } // // Allow external modification/inspection of handshake headers. // this.emit('headers', headers, req); socket.write(headers.concat('\r\n').join('\r\n')); socket.removeListener('error', socketOnError); ws.setSocket(socket, head, this.options.maxPayload); if (this.clients) { this.clients.add(ws); ws.on('close', () => this.clients.delete(ws)); } cb(ws, req); } } module.exports = WebSocketServer; /** * Add event listeners on an `EventEmitter` using a map of * pairs. * * @param {EventEmitter} server The event emitter * @param {Object.} map The listeners to add * @return {Function} A function that will remove the added listeners when * called * @private */ function addListeners(server, map) { for (const event of Object.keys(map)) server.on(event, map[event]); return function removeListeners() { for (const event of Object.keys(map)) { server.removeListener(event, map[event]); } }; } /** * Emit a `'close'` event on an `EventEmitter`. * * @param {EventEmitter} server The event emitter * @private */ function emitClose(server) { server.emit('close'); } /** * Handle premature socket errors. * * @private */ function socketOnError() { this.destroy(); } /** * Close the connection when preconditions are not fulfilled. * * @param {net.Socket} socket The socket of the upgrade request * @param {Number} code The HTTP response status code * @param {String} [message] The HTTP response body * @param {Object} [headers] Additional HTTP response headers * @private */ function abortHandshake(socket, code, message, headers) { if (socket.writable) { message = message || STATUS_CODES[code]; headers = { Connection: 'close', 'Content-Type': 'text/html', 'Content-Length': Buffer.byteLength(message), ...headers }; socket.write( `HTTP/1.1 ${code} ${STATUS_CODES[code]}\r\n` + Object.keys(headers) .map((h) => `${h}: ${headers[h]}`) .join('\r\n') + '\r\n\r\n' + message ); } socket.removeListener('error', socketOnError); socket.destroy(); } /***/ }), /***/ 91518: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const EventEmitter = __webpack_require__(28614); const https = __webpack_require__(57211); const http = __webpack_require__(98605); const net = __webpack_require__(11631); const tls = __webpack_require__(4016); const { randomBytes, createHash } = __webpack_require__(76417); const { URL } = __webpack_require__(78835); const PerMessageDeflate = __webpack_require__(56684); const Receiver = __webpack_require__(25066); const Sender = __webpack_require__(36947); const { BINARY_TYPES, EMPTY_BUFFER, GUID, kStatusCode, kWebSocket, NOOP } = __webpack_require__(15949); const { addEventListener, removeEventListener } = __webpack_require__(64561); const { format, parse } = __webpack_require__(92035); const { toBuffer } = __webpack_require__(9436); const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; const protocolVersions = [8, 13]; const closeTimeout = 30 * 1000; /** * Class representing a WebSocket. * * @extends EventEmitter */ class WebSocket extends EventEmitter { /** * Create a new `WebSocket`. * * @param {(String|url.URL)} address The URL to which to connect * @param {(String|String[])} [protocols] The subprotocols * @param {Object} [options] Connection options */ constructor(address, protocols, options) { super(); this._binaryType = BINARY_TYPES[0]; this._closeCode = 1006; this._closeFrameReceived = false; this._closeFrameSent = false; this._closeMessage = ''; this._closeTimer = null; this._extensions = {}; this._protocol = ''; this._readyState = WebSocket.CONNECTING; this._receiver = null; this._sender = null; this._socket = null; if (address !== null) { this._bufferedAmount = 0; this._isServer = false; this._redirects = 0; if (Array.isArray(protocols)) { protocols = protocols.join(', '); } else if (typeof protocols === 'object' && protocols !== null) { options = protocols; protocols = undefined; } initAsClient(this, address, protocols, options); } else { this._isServer = true; } } /** * This deviates from the WHATWG interface since ws doesn't support the * required default "blob" type (instead we define a custom "nodebuffer" * type). * * @type {String} */ get binaryType() { return this._binaryType; } set binaryType(type) { if (!BINARY_TYPES.includes(type)) return; this._binaryType = type; // // Allow to change `binaryType` on the fly. // if (this._receiver) this._receiver._binaryType = type; } /** * @type {Number} */ get bufferedAmount() { if (!this._socket) return this._bufferedAmount; return this._socket._writableState.length + this._sender._bufferedBytes; } /** * @type {String} */ get extensions() { return Object.keys(this._extensions).join(); } /** * @type {String} */ get protocol() { return this._protocol; } /** * @type {Number} */ get readyState() { return this._readyState; } /** * @type {String} */ get url() { return this._url; } /** * Set up the socket and the internal resources. * * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Number} [maxPayload=0] The maximum allowed message size * @private */ setSocket(socket, head, maxPayload) { const receiver = new Receiver( this.binaryType, this._extensions, this._isServer, maxPayload ); this._sender = new Sender(socket, this._extensions); this._receiver = receiver; this._socket = socket; receiver[kWebSocket] = this; socket[kWebSocket] = this; receiver.on('conclude', receiverOnConclude); receiver.on('drain', receiverOnDrain); receiver.on('error', receiverOnError); receiver.on('message', receiverOnMessage); receiver.on('ping', receiverOnPing); receiver.on('pong', receiverOnPong); socket.setTimeout(0); socket.setNoDelay(); if (head.length > 0) socket.unshift(head); socket.on('close', socketOnClose); socket.on('data', socketOnData); socket.on('end', socketOnEnd); socket.on('error', socketOnError); this._readyState = WebSocket.OPEN; this.emit('open'); } /** * Emit the `'close'` event. * * @private */ emitClose() { if (!this._socket) { this._readyState = WebSocket.CLOSED; this.emit('close', this._closeCode, this._closeMessage); return; } if (this._extensions[PerMessageDeflate.extensionName]) { this._extensions[PerMessageDeflate.extensionName].cleanup(); } this._receiver.removeAllListeners(); this._readyState = WebSocket.CLOSED; this.emit('close', this._closeCode, this._closeMessage); } /** * Start a closing handshake. * * +----------+ +-----------+ +----------+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - * | +----------+ +-----------+ +----------+ | * +----------+ +-----------+ | * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING * +----------+ +-----------+ | * | | | +---+ | * +------------------------+-->|fin| - - - - * | +---+ | +---+ * - - - - -|fin|<---------------------+ * +---+ * * @param {Number} [code] Status code explaining why the connection is closing * @param {String} [data] A string explaining why the connection is closing * @public */ close(code, data) { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { const msg = 'WebSocket was closed before the connection was established'; return abortHandshake(this, this._req, msg); } if (this.readyState === WebSocket.CLOSING) { if (this._closeFrameSent && this._closeFrameReceived) this._socket.end(); return; } this._readyState = WebSocket.CLOSING; this._sender.close(code, data, !this._isServer, (err) => { // // This error is handled by the `'error'` listener on the socket. We only // want to know if the close frame has been sent here. // if (err) return; this._closeFrameSent = true; if (this._closeFrameReceived) this._socket.end(); }); // // Specify a timeout for the closing handshake to complete. // this._closeTimer = setTimeout( this._socket.destroy.bind(this._socket), closeTimeout ); } /** * Send a ping. * * @param {*} [data] The data to send * @param {Boolean} [mask] Indicates whether or not to mask `data` * @param {Function} [cb] Callback which is executed when the ping is sent * @public */ ping(data, mask, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof data === 'function') { cb = data; data = mask = undefined; } else if (typeof mask === 'function') { cb = mask; mask = undefined; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } if (mask === undefined) mask = !this._isServer; this._sender.ping(data || EMPTY_BUFFER, mask, cb); } /** * Send a pong. * * @param {*} [data] The data to send * @param {Boolean} [mask] Indicates whether or not to mask `data` * @param {Function} [cb] Callback which is executed when the pong is sent * @public */ pong(data, mask, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof data === 'function') { cb = data; data = mask = undefined; } else if (typeof mask === 'function') { cb = mask; mask = undefined; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } if (mask === undefined) mask = !this._isServer; this._sender.pong(data || EMPTY_BUFFER, mask, cb); } /** * Send a data message. * * @param {*} data The message to send * @param {Object} [options] Options object * @param {Boolean} [options.compress] Specifies whether or not to compress * `data` * @param {Boolean} [options.binary] Specifies whether `data` is binary or * text * @param {Boolean} [options.fin=true] Specifies whether the fragment is the * last one * @param {Boolean} [options.mask] Specifies whether or not to mask `data` * @param {Function} [cb] Callback which is executed when data is written out * @public */ send(data, options, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof options === 'function') { cb = options; options = {}; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } const opts = { binary: typeof data !== 'string', mask: !this._isServer, compress: true, fin: true, ...options }; if (!this._extensions[PerMessageDeflate.extensionName]) { opts.compress = false; } this._sender.send(data || EMPTY_BUFFER, opts, cb); } /** * Forcibly close the connection. * * @public */ terminate() { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { const msg = 'WebSocket was closed before the connection was established'; return abortHandshake(this, this._req, msg); } if (this._socket) { this._readyState = WebSocket.CLOSING; this._socket.destroy(); } } } readyStates.forEach((readyState, i) => { const descriptor = { enumerable: true, value: i }; Object.defineProperty(WebSocket.prototype, readyState, descriptor); Object.defineProperty(WebSocket, readyState, descriptor); }); [ 'binaryType', 'bufferedAmount', 'extensions', 'protocol', 'readyState', 'url' ].forEach((property) => { Object.defineProperty(WebSocket.prototype, property, { enumerable: true }); }); // // Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes. // See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface // ['open', 'error', 'close', 'message'].forEach((method) => { Object.defineProperty(WebSocket.prototype, `on${method}`, { configurable: true, enumerable: true, /** * Return the listener of the event. * * @return {(Function|undefined)} The event listener or `undefined` * @public */ get() { const listeners = this.listeners(method); for (let i = 0; i < listeners.length; i++) { if (listeners[i]._listener) return listeners[i]._listener; } return undefined; }, /** * Add a listener for the event. * * @param {Function} listener The listener to add * @public */ set(listener) { const listeners = this.listeners(method); for (let i = 0; i < listeners.length; i++) { // // Remove only the listeners added via `addEventListener`. // if (listeners[i]._listener) this.removeListener(method, listeners[i]); } this.addEventListener(method, listener); } }); }); WebSocket.prototype.addEventListener = addEventListener; WebSocket.prototype.removeEventListener = removeEventListener; module.exports = WebSocket; /** * Initialize a WebSocket client. * * @param {WebSocket} websocket The client to initialize * @param {(String|url.URL)} address The URL to which to connect * @param {String} [protocols] The subprotocols * @param {Object} [options] Connection options * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable * permessage-deflate * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the * handshake request * @param {Number} [options.protocolVersion=13] Value of the * `Sec-WebSocket-Version` header * @param {String} [options.origin] Value of the `Origin` or * `Sec-WebSocket-Origin` header * @param {Number} [options.maxPayload=104857600] The maximum allowed message * size * @param {Boolean} [options.followRedirects=false] Whether or not to follow * redirects * @param {Number} [options.maxRedirects=10] The maximum number of redirects * allowed * @private */ function initAsClient(websocket, address, protocols, options) { const opts = { protocolVersion: protocolVersions[1], maxPayload: 100 * 1024 * 1024, perMessageDeflate: true, followRedirects: false, maxRedirects: 10, ...options, createConnection: undefined, socketPath: undefined, hostname: undefined, protocol: undefined, timeout: undefined, method: undefined, host: undefined, path: undefined, port: undefined }; if (!protocolVersions.includes(opts.protocolVersion)) { throw new RangeError( `Unsupported protocol version: ${opts.protocolVersion} ` + `(supported versions: ${protocolVersions.join(', ')})` ); } let parsedUrl; if (address instanceof URL) { parsedUrl = address; websocket._url = address.href; } else { parsedUrl = new URL(address); websocket._url = address; } const isUnixSocket = parsedUrl.protocol === 'ws+unix:'; if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) { throw new Error(`Invalid URL: ${websocket.url}`); } const isSecure = parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:'; const defaultPort = isSecure ? 443 : 80; const key = randomBytes(16).toString('base64'); const get = isSecure ? https.get : http.get; let perMessageDeflate; opts.createConnection = isSecure ? tlsConnect : netConnect; opts.defaultPort = opts.defaultPort || defaultPort; opts.port = parsedUrl.port || defaultPort; opts.host = parsedUrl.hostname.startsWith('[') ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname; opts.headers = { 'Sec-WebSocket-Version': opts.protocolVersion, 'Sec-WebSocket-Key': key, Connection: 'Upgrade', Upgrade: 'websocket', ...opts.headers }; opts.path = parsedUrl.pathname + parsedUrl.search; opts.timeout = opts.handshakeTimeout; if (opts.perMessageDeflate) { perMessageDeflate = new PerMessageDeflate( opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, false, opts.maxPayload ); opts.headers['Sec-WebSocket-Extensions'] = format({ [PerMessageDeflate.extensionName]: perMessageDeflate.offer() }); } if (protocols) { opts.headers['Sec-WebSocket-Protocol'] = protocols; } if (opts.origin) { if (opts.protocolVersion < 13) { opts.headers['Sec-WebSocket-Origin'] = opts.origin; } else { opts.headers.Origin = opts.origin; } } if (parsedUrl.username || parsedUrl.password) { opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; } if (isUnixSocket) { const parts = opts.path.split(':'); opts.socketPath = parts[0]; opts.path = parts[1]; } let req = (websocket._req = get(opts)); if (opts.timeout) { req.on('timeout', () => { abortHandshake(websocket, req, 'Opening handshake has timed out'); }); } req.on('error', (err) => { if (req === null || req.aborted) return; req = websocket._req = null; websocket._readyState = WebSocket.CLOSING; websocket.emit('error', err); websocket.emitClose(); }); req.on('response', (res) => { const location = res.headers.location; const statusCode = res.statusCode; if ( location && opts.followRedirects && statusCode >= 300 && statusCode < 400 ) { if (++websocket._redirects > opts.maxRedirects) { abortHandshake(websocket, req, 'Maximum redirects exceeded'); return; } req.abort(); const addr = new URL(location, address); initAsClient(websocket, addr, protocols, options); } else if (!websocket.emit('unexpected-response', req, res)) { abortHandshake( websocket, req, `Unexpected server response: ${res.statusCode}` ); } }); req.on('upgrade', (res, socket, head) => { websocket.emit('upgrade', res); // // The user may have closed the connection from a listener of the `upgrade` // event. // if (websocket.readyState !== WebSocket.CONNECTING) return; req = websocket._req = null; const digest = createHash('sha1') .update(key + GUID) .digest('base64'); if (res.headers['sec-websocket-accept'] !== digest) { abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header'); return; } const serverProt = res.headers['sec-websocket-protocol']; const protList = (protocols || '').split(/, */); let protError; if (!protocols && serverProt) { protError = 'Server sent a subprotocol but none was requested'; } else if (protocols && !serverProt) { protError = 'Server sent no subprotocol'; } else if (serverProt && !protList.includes(serverProt)) { protError = 'Server sent an invalid subprotocol'; } if (protError) { abortHandshake(websocket, socket, protError); return; } if (serverProt) websocket._protocol = serverProt; if (perMessageDeflate) { try { const extensions = parse(res.headers['sec-websocket-extensions']); if (extensions[PerMessageDeflate.extensionName]) { perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]); websocket._extensions[ PerMessageDeflate.extensionName ] = perMessageDeflate; } } catch (err) { abortHandshake( websocket, socket, 'Invalid Sec-WebSocket-Extensions header' ); return; } } websocket.setSocket(socket, head, opts.maxPayload); }); } /** * Create a `net.Socket` and initiate a connection. * * @param {Object} options Connection options * @return {net.Socket} The newly created socket used to start the connection * @private */ function netConnect(options) { options.path = options.socketPath; return net.connect(options); } /** * Create a `tls.TLSSocket` and initiate a connection. * * @param {Object} options Connection options * @return {tls.TLSSocket} The newly created socket used to start the connection * @private */ function tlsConnect(options) { options.path = undefined; if (!options.servername && options.servername !== '') { options.servername = net.isIP(options.host) ? '' : options.host; } return tls.connect(options); } /** * Abort the handshake and emit an error. * * @param {WebSocket} websocket The WebSocket instance * @param {(http.ClientRequest|net.Socket)} stream The request to abort or the * socket to destroy * @param {String} message The error message * @private */ function abortHandshake(websocket, stream, message) { websocket._readyState = WebSocket.CLOSING; const err = new Error(message); Error.captureStackTrace(err, abortHandshake); if (stream.setHeader) { stream.abort(); if (stream.socket && !stream.socket.destroyed) { // // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if // called after the request completed. See // https://github.com/websockets/ws/issues/1869. // stream.socket.destroy(); } stream.once('abort', websocket.emitClose.bind(websocket)); websocket.emit('error', err); } else { stream.destroy(err); stream.once('error', websocket.emit.bind(websocket, 'error')); stream.once('close', websocket.emitClose.bind(websocket)); } } /** * Handle cases where the `ping()`, `pong()`, or `send()` methods are called * when the `readyState` attribute is `CLOSING` or `CLOSED`. * * @param {WebSocket} websocket The WebSocket instance * @param {*} [data] The data to send * @param {Function} [cb] Callback * @private */ function sendAfterClose(websocket, data, cb) { if (data) { const length = toBuffer(data).length; // // The `_bufferedAmount` property is used only when the peer is a client and // the opening handshake fails. Under these circumstances, in fact, the // `setSocket()` method is not called, so the `_socket` and `_sender` // properties are set to `null`. // if (websocket._socket) websocket._sender._bufferedBytes += length; else websocket._bufferedAmount += length; } if (cb) { const err = new Error( `WebSocket is not open: readyState ${websocket.readyState} ` + `(${readyStates[websocket.readyState]})` ); cb(err); } } /** * The listener of the `Receiver` `'conclude'` event. * * @param {Number} code The status code * @param {String} reason The reason for closing * @private */ function receiverOnConclude(code, reason) { const websocket = this[kWebSocket]; websocket._socket.removeListener('data', socketOnData); websocket._socket.resume(); websocket._closeFrameReceived = true; websocket._closeMessage = reason; websocket._closeCode = code; if (code === 1005) websocket.close(); else websocket.close(code, reason); } /** * The listener of the `Receiver` `'drain'` event. * * @private */ function receiverOnDrain() { this[kWebSocket]._socket.resume(); } /** * The listener of the `Receiver` `'error'` event. * * @param {(RangeError|Error)} err The emitted error * @private */ function receiverOnError(err) { const websocket = this[kWebSocket]; websocket._socket.removeListener('data', socketOnData); websocket._readyState = WebSocket.CLOSING; websocket._closeCode = err[kStatusCode]; websocket.emit('error', err); websocket._socket.destroy(); } /** * The listener of the `Receiver` `'finish'` event. * * @private */ function receiverOnFinish() { this[kWebSocket].emitClose(); } /** * The listener of the `Receiver` `'message'` event. * * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message * @private */ function receiverOnMessage(data) { this[kWebSocket].emit('message', data); } /** * The listener of the `Receiver` `'ping'` event. * * @param {Buffer} data The data included in the ping frame * @private */ function receiverOnPing(data) { const websocket = this[kWebSocket]; websocket.pong(data, !websocket._isServer, NOOP); websocket.emit('ping', data); } /** * The listener of the `Receiver` `'pong'` event. * * @param {Buffer} data The data included in the pong frame * @private */ function receiverOnPong(data) { this[kWebSocket].emit('pong', data); } /** * The listener of the `net.Socket` `'close'` event. * * @private */ function socketOnClose() { const websocket = this[kWebSocket]; this.removeListener('close', socketOnClose); this.removeListener('end', socketOnEnd); websocket._readyState = WebSocket.CLOSING; // // The close frame might not have been received or the `'end'` event emitted, // for example, if the socket was destroyed due to an error. Ensure that the // `receiver` stream is closed after writing any remaining buffered data to // it. If the readable side of the socket is in flowing mode then there is no // buffered data as everything has been already written and `readable.read()` // will return `null`. If instead, the socket is paused, any possible buffered // data will be read as a single chunk and emitted synchronously in a single // `'data'` event. // websocket._socket.read(); websocket._receiver.end(); this.removeListener('data', socketOnData); this[kWebSocket] = undefined; clearTimeout(websocket._closeTimer); if ( websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted ) { websocket.emitClose(); } else { websocket._receiver.on('error', receiverOnFinish); websocket._receiver.on('finish', receiverOnFinish); } } /** * The listener of the `net.Socket` `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function socketOnData(chunk) { if (!this[kWebSocket]._receiver.write(chunk)) { this.pause(); } } /** * The listener of the `net.Socket` `'end'` event. * * @private */ function socketOnEnd() { const websocket = this[kWebSocket]; websocket._readyState = WebSocket.CLOSING; websocket._receiver.end(); this.end(); } /** * The listener of the `net.Socket` `'error'` event. * * @private */ function socketOnError() { const websocket = this[kWebSocket]; this.removeListener('error', socketOnError); this.on('error', NOOP); if (websocket) { websocket._readyState = WebSocket.CLOSING; this.destroy(); } } /***/ }), /***/ 22624: /***/ (function(__unused_webpack_module, exports) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; exports.stripBOM = function(str) { if (str[0] === '\uFEFF') { return str.substring(1); } else { return str; } }; }).call(this); /***/ }), /***/ 43337: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty; builder = __webpack_require__(52958); defaults = __webpack_require__(97251).defaults; requiresCDATA = function(entry) { return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0); }; wrapCDATA = function(entry) { return ""; }; escapeCDATA = function(entry) { return entry.replace(']]>', ']]]]>'); }; exports.Builder = (function() { function Builder(opts) { var key, ref, value; this.options = {}; ref = defaults["0.2"]; for (key in ref) { if (!hasProp.call(ref, key)) continue; value = ref[key]; this.options[key] = value; } for (key in opts) { if (!hasProp.call(opts, key)) continue; value = opts[key]; this.options[key] = value; } } Builder.prototype.buildObject = function(rootObj) { var attrkey, charkey, render, rootElement, rootName; attrkey = this.options.attrkey; charkey = this.options.charkey; if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) { rootName = Object.keys(rootObj)[0]; rootObj = rootObj[rootName]; } else { rootName = this.options.rootName; } render = (function(_this) { return function(element, obj) { var attr, child, entry, index, key, value; if (typeof obj !== 'object') { if (_this.options.cdata && requiresCDATA(obj)) { element.raw(wrapCDATA(obj)); } else { element.txt(obj); } } else if (Array.isArray(obj)) { for (index in obj) { if (!hasProp.call(obj, index)) continue; child = obj[index]; for (key in child) { entry = child[key]; element = render(element.ele(key), entry).up(); } } } else { for (key in obj) { if (!hasProp.call(obj, key)) continue; child = obj[key]; if (key === attrkey) { if (typeof child === "object") { for (attr in child) { value = child[attr]; element = element.att(attr, value); } } } else if (key === charkey) { if (_this.options.cdata && requiresCDATA(child)) { element = element.raw(wrapCDATA(child)); } else { element = element.txt(child); } } else if (Array.isArray(child)) { for (index in child) { if (!hasProp.call(child, index)) continue; entry = child[index]; if (typeof entry === 'string') { if (_this.options.cdata && requiresCDATA(entry)) { element = element.ele(key).raw(wrapCDATA(entry)).up(); } else { element = element.ele(key, entry).up(); } } else { element = render(element.ele(key), entry).up(); } } } else if (typeof child === "object") { element = render(element.ele(key), child).up(); } else { if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) { element = element.ele(key).raw(wrapCDATA(child)).up(); } else { if (child == null) { child = ''; } element = element.ele(key, child.toString()).up(); } } } } return element; }; })(this); rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, { headless: this.options.headless, allowSurrogateChars: this.options.allowSurrogateChars }); return render(rootElement, rootObj).end(this.options.renderOpts); }; return Builder; })(); }).call(this); /***/ }), /***/ 97251: /***/ (function(__unused_webpack_module, exports) { // Generated by CoffeeScript 1.12.7 (function() { exports.defaults = { "0.1": { explicitCharkey: false, trim: true, normalize: true, normalizeTags: false, attrkey: "@", charkey: "#", explicitArray: false, ignoreAttrs: false, mergeAttrs: false, explicitRoot: false, validator: null, xmlns: false, explicitChildren: false, childkey: '@@', charsAsChildren: false, includeWhiteChars: false, async: false, strict: true, attrNameProcessors: null, attrValueProcessors: null, tagNameProcessors: null, valueProcessors: null, emptyTag: '' }, "0.2": { explicitCharkey: false, trim: false, normalize: false, normalizeTags: false, attrkey: "$", charkey: "_", explicitArray: true, ignoreAttrs: false, mergeAttrs: false, explicitRoot: true, validator: null, xmlns: false, explicitChildren: false, preserveChildrenOrder: false, childkey: '$$', charsAsChildren: false, includeWhiteChars: false, async: false, strict: true, attrNameProcessors: null, attrValueProcessors: null, tagNameProcessors: null, valueProcessors: null, rootName: 'root', xmldec: { 'version': '1.0', 'encoding': 'UTF-8', 'standalone': true }, doctype: null, renderOpts: { 'pretty': true, 'indent': ' ', 'newline': '\n' }, headless: false, chunkSize: 10000, emptyTag: '', cdata: false } }; }).call(this); /***/ }), /***/ 83314: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; sax = __webpack_require__(41695); events = __webpack_require__(28614); bom = __webpack_require__(22624); processors = __webpack_require__(99236); setImmediate = __webpack_require__(78213).setImmediate; defaults = __webpack_require__(97251).defaults; isEmpty = function(thing) { return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0; }; processItem = function(processors, item, key) { var i, len, process; for (i = 0, len = processors.length; i < len; i++) { process = processors[i]; item = process(item, key); } return item; }; exports.Parser = (function(superClass) { extend(Parser, superClass); function Parser(opts) { this.parseString = bind(this.parseString, this); this.reset = bind(this.reset, this); this.assignOrPush = bind(this.assignOrPush, this); this.processAsync = bind(this.processAsync, this); var key, ref, value; if (!(this instanceof exports.Parser)) { return new exports.Parser(opts); } this.options = {}; ref = defaults["0.2"]; for (key in ref) { if (!hasProp.call(ref, key)) continue; value = ref[key]; this.options[key] = value; } for (key in opts) { if (!hasProp.call(opts, key)) continue; value = opts[key]; this.options[key] = value; } if (this.options.xmlns) { this.options.xmlnskey = this.options.attrkey + "ns"; } if (this.options.normalizeTags) { if (!this.options.tagNameProcessors) { this.options.tagNameProcessors = []; } this.options.tagNameProcessors.unshift(processors.normalize); } this.reset(); } Parser.prototype.processAsync = function() { var chunk, err; try { if (this.remaining.length <= this.options.chunkSize) { chunk = this.remaining; this.remaining = ''; this.saxParser = this.saxParser.write(chunk); return this.saxParser.close(); } else { chunk = this.remaining.substr(0, this.options.chunkSize); this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length); this.saxParser = this.saxParser.write(chunk); return setImmediate(this.processAsync); } } catch (error1) { err = error1; if (!this.saxParser.errThrown) { this.saxParser.errThrown = true; return this.emit(err); } } }; Parser.prototype.assignOrPush = function(obj, key, newValue) { if (!(key in obj)) { if (!this.options.explicitArray) { return obj[key] = newValue; } else { return obj[key] = [newValue]; } } else { if (!(obj[key] instanceof Array)) { obj[key] = [obj[key]]; } return obj[key].push(newValue); } }; Parser.prototype.reset = function() { var attrkey, charkey, ontext, stack; this.removeAllListeners(); this.saxParser = sax.parser(this.options.strict, { trim: false, normalize: false, xmlns: this.options.xmlns }); this.saxParser.errThrown = false; this.saxParser.onerror = (function(_this) { return function(error) { _this.saxParser.resume(); if (!_this.saxParser.errThrown) { _this.saxParser.errThrown = true; return _this.emit("error", error); } }; })(this); this.saxParser.onend = (function(_this) { return function() { if (!_this.saxParser.ended) { _this.saxParser.ended = true; return _this.emit("end", _this.resultObject); } }; })(this); this.saxParser.ended = false; this.EXPLICIT_CHARKEY = this.options.explicitCharkey; this.resultObject = null; stack = []; attrkey = this.options.attrkey; charkey = this.options.charkey; this.saxParser.onopentag = (function(_this) { return function(node) { var key, newValue, obj, processedKey, ref; obj = {}; obj[charkey] = ""; if (!_this.options.ignoreAttrs) { ref = node.attributes; for (key in ref) { if (!hasProp.call(ref, key)) continue; if (!(attrkey in obj) && !_this.options.mergeAttrs) { obj[attrkey] = {}; } newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key]; processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key; if (_this.options.mergeAttrs) { _this.assignOrPush(obj, processedKey, newValue); } else { obj[attrkey][processedKey] = newValue; } } } obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name; if (_this.options.xmlns) { obj[_this.options.xmlnskey] = { uri: node.uri, local: node.local }; } return stack.push(obj); }; })(this); this.saxParser.onclosetag = (function(_this) { return function() { var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath; obj = stack.pop(); nodeName = obj["#name"]; if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) { delete obj["#name"]; } if (obj.cdata === true) { cdata = obj.cdata; delete obj.cdata; } s = stack[stack.length - 1]; if (obj[charkey].match(/^\s*$/) && !cdata) { emptyStr = obj[charkey]; delete obj[charkey]; } else { if (_this.options.trim) { obj[charkey] = obj[charkey].trim(); } if (_this.options.normalize) { obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim(); } obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey]; if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { obj = obj[charkey]; } } if (isEmpty(obj)) { obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr; } if (_this.options.validator != null) { xpath = "/" + ((function() { var i, len, results; results = []; for (i = 0, len = stack.length; i < len; i++) { node = stack[i]; results.push(node["#name"]); } return results; })()).concat(nodeName).join("/"); (function() { var err; try { return obj = _this.options.validator(xpath, s && s[nodeName], obj); } catch (error1) { err = error1; return _this.emit("error", err); } })(); } if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') { if (!_this.options.preserveChildrenOrder) { node = {}; if (_this.options.attrkey in obj) { node[_this.options.attrkey] = obj[_this.options.attrkey]; delete obj[_this.options.attrkey]; } if (!_this.options.charsAsChildren && _this.options.charkey in obj) { node[_this.options.charkey] = obj[_this.options.charkey]; delete obj[_this.options.charkey]; } if (Object.getOwnPropertyNames(obj).length > 0) { node[_this.options.childkey] = obj; } obj = node; } else if (s) { s[_this.options.childkey] = s[_this.options.childkey] || []; objClone = {}; for (key in obj) { if (!hasProp.call(obj, key)) continue; objClone[key] = obj[key]; } s[_this.options.childkey].push(objClone); delete obj["#name"]; if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { obj = obj[charkey]; } } } if (stack.length > 0) { return _this.assignOrPush(s, nodeName, obj); } else { if (_this.options.explicitRoot) { old = obj; obj = {}; obj[nodeName] = old; } _this.resultObject = obj; _this.saxParser.ended = true; return _this.emit("end", _this.resultObject); } }; })(this); ontext = (function(_this) { return function(text) { var charChild, s; s = stack[stack.length - 1]; if (s) { s[charkey] += text; if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) { s[_this.options.childkey] = s[_this.options.childkey] || []; charChild = { '#name': '__text__' }; charChild[charkey] = text; if (_this.options.normalize) { charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim(); } s[_this.options.childkey].push(charChild); } return s; } }; })(this); this.saxParser.ontext = ontext; return this.saxParser.oncdata = (function(_this) { return function(text) { var s; s = ontext(text); if (s) { return s.cdata = true; } }; })(this); }; Parser.prototype.parseString = function(str, cb) { var err; if ((cb != null) && typeof cb === "function") { this.on("end", function(result) { this.reset(); return cb(null, result); }); this.on("error", function(err) { this.reset(); return cb(err); }); } try { str = str.toString(); if (str.trim() === '') { this.emit("end", null); return true; } str = bom.stripBOM(str); if (this.options.async) { this.remaining = str; setImmediate(this.processAsync); return this.saxParser; } return this.saxParser.write(str).close(); } catch (error1) { err = error1; if (!(this.saxParser.errThrown || this.saxParser.ended)) { this.emit('error', err); return this.saxParser.errThrown = true; } else if (this.saxParser.ended) { throw err; } } }; return Parser; })(events.EventEmitter); exports.parseString = function(str, a, b) { var cb, options, parser; if (b != null) { if (typeof b === 'function') { cb = b; } if (typeof a === 'object') { options = a; } } else { if (typeof a === 'function') { cb = a; } options = {}; } parser = new exports.Parser(options); return parser.parseString(str, cb); }; }).call(this); /***/ }), /***/ 99236: /***/ (function(__unused_webpack_module, exports) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; var prefixMatch; prefixMatch = new RegExp(/(?!xmlns)^.*:/); exports.normalize = function(str) { return str.toLowerCase(); }; exports.firstCharLowerCase = function(str) { return str.charAt(0).toLowerCase() + str.slice(1); }; exports.stripPrefix = function(str) { return str.replace(prefixMatch, ''); }; exports.parseNumbers = function(str) { if (!isNaN(str)) { str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str); } return str; }; exports.parseBooleans = function(str) { if (/^(?:true|false)$/i.test(str)) { str = str.toLowerCase() === 'true'; } return str; }; }).call(this); /***/ }), /***/ 66189: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { // Generated by CoffeeScript 1.12.7 (function() { "use strict"; var builder, defaults, parser, processors, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; defaults = __webpack_require__(97251); builder = __webpack_require__(43337); parser = __webpack_require__(83314); processors = __webpack_require__(99236); exports.defaults = defaults.defaults; exports.processors = processors; exports.ValidationError = (function(superClass) { extend(ValidationError, superClass); function ValidationError(message) { this.message = message; } return ValidationError; })(Error); exports.Builder = builder.Builder; exports.Parser = parser.Parser; exports.parseString = parser.parseString; }).call(this); /***/ }), /***/ 41695: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { ;(function (sax) { // wrapper for non-node envs sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } sax.SAXParser = SAXParser sax.SAXStream = SAXStream sax.createStream = createStream // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), // since that's the earliest that a buffer overrun could occur. This way, checks are // as rare as required, but as often as necessary to ensure never crossing this bound. // Furthermore, buffers are only tested at most once per write(), so passing a very // large string into write() might have undesirable effects, but this is manageable by // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme // edge case, result in creating at most one complete copy of the string passed in. // Set to Infinity to have unlimited buffers. sax.MAX_BUFFER_LENGTH = 64 * 1024 var buffers = [ 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', 'procInstName', 'procInstBody', 'entity', 'attribName', 'attribValue', 'cdata', 'script' ] sax.EVENTS = [ 'text', 'processinginstruction', 'sgmldeclaration', 'doctype', 'comment', 'opentagstart', 'attribute', 'opentag', 'closetag', 'opencdata', 'cdata', 'closecdata', 'error', 'end', 'ready', 'script', 'opennamespace', 'closenamespace' ] function SAXParser (strict, opt) { if (!(this instanceof SAXParser)) { return new SAXParser(strict, opt) } var parser = this clearBuffers(parser) parser.q = parser.c = '' parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH parser.opt = opt || {} parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' parser.tags = [] parser.closed = parser.closedRoot = parser.sawRoot = false parser.tag = parser.error = null parser.strict = !!strict parser.noscript = !!(strict || parser.opt.noscript) parser.state = S.BEGIN parser.strictEntities = parser.opt.strictEntities parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) parser.attribList = [] // namespaces form a prototype chain. // it always points at the current tag, // which protos to its parent tag. if (parser.opt.xmlns) { parser.ns = Object.create(rootNS) } // mostly just for error reporting parser.trackPosition = parser.opt.position !== false if (parser.trackPosition) { parser.position = parser.line = parser.column = 0 } emit(parser, 'onready') } if (!Object.create) { Object.create = function (o) { function F () {} F.prototype = o var newf = new F() return newf } } if (!Object.keys) { Object.keys = function (o) { var a = [] for (var i in o) if (o.hasOwnProperty(i)) a.push(i) return a } } function checkBufferLength (parser) { var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) var maxActual = 0 for (var i = 0, l = buffers.length; i < l; i++) { var len = parser[buffers[i]].length if (len > maxAllowed) { // Text/cdata nodes can get big, and since they're buffered, // we can get here under normal conditions. // Avoid issues by emitting the text node now, // so at least it won't get any bigger. switch (buffers[i]) { case 'textNode': closeText(parser) break case 'cdata': emitNode(parser, 'oncdata', parser.cdata) parser.cdata = '' break case 'script': emitNode(parser, 'onscript', parser.script) parser.script = '' break default: error(parser, 'Max buffer length exceeded: ' + buffers[i]) } } maxActual = Math.max(maxActual, len) } // schedule the next check for the earliest possible buffer overrun. var m = sax.MAX_BUFFER_LENGTH - maxActual parser.bufferCheckPosition = m + parser.position } function clearBuffers (parser) { for (var i = 0, l = buffers.length; i < l; i++) { parser[buffers[i]] = '' } } function flushBuffers (parser) { closeText(parser) if (parser.cdata !== '') { emitNode(parser, 'oncdata', parser.cdata) parser.cdata = '' } if (parser.script !== '') { emitNode(parser, 'onscript', parser.script) parser.script = '' } } SAXParser.prototype = { end: function () { end(this) }, write: write, resume: function () { this.error = null; return this }, close: function () { return this.write(null) }, flush: function () { flushBuffers(this) } } var Stream try { Stream = __webpack_require__(92413).Stream } catch (ex) { Stream = function () {} } var streamWraps = sax.EVENTS.filter(function (ev) { return ev !== 'error' && ev !== 'end' }) function createStream (strict, opt) { return new SAXStream(strict, opt) } function SAXStream (strict, opt) { if (!(this instanceof SAXStream)) { return new SAXStream(strict, opt) } Stream.apply(this) this._parser = new SAXParser(strict, opt) this.writable = true this.readable = true var me = this this._parser.onend = function () { me.emit('end') } this._parser.onerror = function (er) { me.emit('error', er) // if didn't throw, then means error was handled. // go ahead and clear error, so we can write again. me._parser.error = null } this._decoder = null streamWraps.forEach(function (ev) { Object.defineProperty(me, 'on' + ev, { get: function () { return me._parser['on' + ev] }, set: function (h) { if (!h) { me.removeAllListeners(ev) me._parser['on' + ev] = h return h } me.on(ev, h) }, enumerable: true, configurable: false }) }) } SAXStream.prototype = Object.create(Stream.prototype, { constructor: { value: SAXStream } }) SAXStream.prototype.write = function (data) { if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function' && Buffer.isBuffer(data)) { if (!this._decoder) { var SD = __webpack_require__(24304).StringDecoder this._decoder = new SD('utf8') } data = this._decoder.write(data) } this._parser.write(data.toString()) this.emit('data', data) return true } SAXStream.prototype.end = function (chunk) { if (chunk && chunk.length) { this.write(chunk) } this._parser.end() return true } SAXStream.prototype.on = function (ev, handler) { var me = this if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { me._parser['on' + ev] = function () { var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) args.splice(0, 0, ev) me.emit.apply(me, args) } } return Stream.prototype.on.call(me, ev, handler) } // this really needs to be replaced with character classes. // XML allows all manner of ridiculous numbers and digits. var CDATA = '[CDATA[' var DOCTYPE = 'DOCTYPE' var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } // http://www.w3.org/TR/REC-xml/#NT-NameStartChar // This implementation works on strings, a single character at a time // as such, it cannot ever support astral-plane characters (10000-EFFFF) // without a significant breaking change to either this parser, or the // JavaScript language. Implementation of an emoji-capable xml parser // is left as an exercise for the reader. var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ function isWhitespace (c) { return c === ' ' || c === '\n' || c === '\r' || c === '\t' } function isQuote (c) { return c === '"' || c === '\'' } function isAttribEnd (c) { return c === '>' || isWhitespace(c) } function isMatch (regex, c) { return regex.test(c) } function notMatch (regex, c) { return !isMatch(regex, c) } var S = 0 sax.STATE = { BEGIN: S++, // leading byte order mark or whitespace BEGIN_WHITESPACE: S++, // leading whitespace TEXT: S++, // general stuff TEXT_ENTITY: S++, // & and such. OPEN_WAKA: S++, // < SGML_DECL: S++, // SCRIPT: S++, //